123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- 'use strict';
- define(['../../../lib/@waca/core-client/js/core-client/ui/core/Class', 'underscore'], function (BaseClass, _) {
- 'use strict';
-
- var DashboardFactory = BaseClass.extend({
- API_METHODS: ['createNew', 'openDashboard'],
- API_ENUMS: [],
- init: function init(options) {
- this.glassContext = options.glassContext;
- },
-
- createNew: function createNew() {
- return new Promise(function (resolve, reject) {
- this.glassContext.appController.openAppView('createBoard', {
- content: {
- id: 'createBoardPage_dashboard',
- editMode: true,
- restrictTemplate: 'dashboard',
- containerAppOptions: {
- callbacks: {
- resolve: resolve,
- reject: reject
- },
- configuration: {
- ui: {},
- pinning: 'disabled'
- }
- },
- ui_appbar: false
- }
- });
- }.bind(this));
- },
-
- openDashboard: function openDashboard(options) {
- return new Promise(function (resolve, reject) {
- this.glassContext.appController.openAppView('dashboard', {
- content: {
- id: _.uniqueId(),
- editMode: false,
- containerAppOptions: {
- callbacks: {
- resolve: resolve,
- reject: reject
- },
- configuration: {
- ui: {},
- pinning: 'disabled'
- }
- },
- ui_appbar: false,
- boardId: options.dashboardId || null,
- boardSpec: options.dashboardSpec
- }
- });
- }.bind(this));
- }
- });
- return DashboardFactory;
- });
|