@agilemotion/oui-react-js 1.8.30 → 1.8.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApplicationManager.js +111 -305
- package/dist/ViewContext.js +239 -0
- package/dist/components/Button.js +3 -2
- package/dist/components/DataGrid.css +4 -0
- package/dist/components/DataGrid.js +8 -4
- package/dist/components/DataGridFilter.js +2 -2
- package/dist/components/DataGridHeading.js +1 -1
- package/dist/components/DocumentViewer.js +22 -10
- package/dist/components/Graph.js +2 -0
- package/dist/components/HtmlPanel.js +0 -1
- package/dist/components/Icon.js +15 -0
- package/dist/components/LottieIcon.js +19 -19
- package/dist/components/SocketManager.js +3 -0
- package/dist/components/Spinner.js +56 -0
- package/dist/components/StepperTitleBar.js +11 -2
- package/dist/components/TabPage.js +1 -1
- package/dist/components/TabPanel.js +2 -1
- package/dist/components/TitleBar.js +1 -1
- package/dist/components/Toolbar.js +1 -0
- package/dist/components/WordDocumentViewer.js +27 -4
- package/dist/components/dashboard/SideMenuModuleDashboard.css +4 -0
- package/dist/components/dashboard/components/Header.js +1 -1
- package/dist/components/form/CurrencyField.js +1 -1
- package/dist/components/form/DatePicker.js +1 -1
- package/dist/components/form/FieldSet.js +1 -1
- package/dist/components/form/Form.css +8 -0
- package/dist/components/form/IconField.js +5 -3
- package/dist/components/form/LookupField.js +1 -1
- package/dist/components/form/Section.js +6 -1
- package/dist/components/form/SelectItem.js +1 -0
- package/dist/components/form/TextField.js +1 -0
- package/dist/components/form/TimePicker.js +1 -0
- package/dist/components/form/TransferList.js +6 -5
- package/dist/components/layout/Layout.js +11 -2
- package/dist/components/layout/View.css +57 -0
- package/dist/components/layout/ViewPort.js +1 -0
- package/dist/components/layout/Window.js +4 -1
- package/dist/components/layout/WindowViewPort.js +12 -3
- package/dist/components/media/TrainingRoom.js +1 -1
- package/dist/components/media/VCEventType.js +0 -3
- package/dist/event/Observable.js +11 -2
- package/dist/event/RouteActionHandler.js +50 -55
- package/dist/js/ProcurementMeetings.js +61 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.TEMPLATE_TOKEN_REGEX = exports.SYSTEM_EVENT = exports.LEGEND_ARROW_ICON = exports.AVATAR_LISTENER_TYPE = exports.APP_VARIABLE = void 0;
|
|
6
|
+
exports.default = exports.TEMPLATE_TOKEN_REGEX = exports.SYSTEM_EVENT = exports.SOCKET_VARIABLE = exports.LEGEND_ARROW_ICON = exports.AVATAR_LISTENER_TYPE = exports.APP_VARIABLE = void 0;
|
|
7
7
|
var _Observable = _interopRequireDefault(require("./event/Observable"));
|
|
8
8
|
var _Event = _interopRequireDefault(require("./event/Event"));
|
|
9
9
|
var _EventType = _interopRequireDefault(require("./event/EventType"));
|
|
@@ -11,10 +11,13 @@ var _Graph = _interopRequireDefault(require("./components/Graph"));
|
|
|
11
11
|
var _Utils = _interopRequireDefault(require("./Utils"));
|
|
12
12
|
var _DynamicJS = _interopRequireWildcard(require("./DynamicJS"));
|
|
13
13
|
var _TypedValue = _interopRequireDefault(require("./TypedValue"));
|
|
14
|
+
var _SocketManager = _interopRequireDefault(require("./components/SocketManager"));
|
|
15
|
+
var _ViewContext = require("./ViewContext");
|
|
14
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
19
|
const APP_VARIABLE = exports.APP_VARIABLE = '__APPLICATION_OUI_SYS_VAR__';
|
|
20
|
+
const SOCKET_VARIABLE = exports.SOCKET_VARIABLE = '__SOCKET_VARIABLE_OUI_SYS_VAR__';
|
|
18
21
|
const AVATAR_LISTENER_TYPE = exports.AVATAR_LISTENER_TYPE = 'AVATAR_LISTENER';
|
|
19
22
|
const SYSTEM_EVENT = exports.SYSTEM_EVENT = 'SYSTEM_EVENT';
|
|
20
23
|
const TEMPLATE_TOKEN_REGEX = exports.TEMPLATE_TOKEN_REGEX = new RegExp('(([$]{1}[{]{1})(([a-zA-Z0-9_$.@#{}[\\]]*)+){1}([}]{1}))+', 'g');
|
|
@@ -23,14 +26,16 @@ const applicationContext = {};
|
|
|
23
26
|
class ApplicationManager {
|
|
24
27
|
constructor() {
|
|
25
28
|
if (!ApplicationManager.instance) {
|
|
26
|
-
this.
|
|
27
|
-
|
|
29
|
+
this.viewContext = {
|
|
30
|
+
main: new _ViewContext.ViewContext('main'),
|
|
31
|
+
window: new _ViewContext.ViewContext('window'),
|
|
32
|
+
dashboard: new _ViewContext.ViewContext('dashboard'),
|
|
33
|
+
popup: new _ViewContext.ViewContext('popup')
|
|
34
|
+
};
|
|
28
35
|
this.props = {};
|
|
29
36
|
this.listeners = [];
|
|
30
37
|
this.libs = {};
|
|
31
|
-
this.navHistory = [];
|
|
32
38
|
this.fileCache = [];
|
|
33
|
-
this.graphs = [];
|
|
34
39
|
this.api = {
|
|
35
40
|
get id() {
|
|
36
41
|
return instance.getId();
|
|
@@ -41,8 +46,11 @@ class ApplicationManager {
|
|
|
41
46
|
alert(viewId, message, messageType) {
|
|
42
47
|
instance.alert(viewId, message, messageType);
|
|
43
48
|
},
|
|
44
|
-
removeLoadedGraph(
|
|
45
|
-
instance.removeLoadedGraph(
|
|
49
|
+
removeLoadedGraph(viewContext) {
|
|
50
|
+
instance.removeLoadedGraph(viewContext);
|
|
51
|
+
},
|
|
52
|
+
setHasActiveMeeting(hasActiveMeeting) {
|
|
53
|
+
instance.setHasActiveMeeting(hasActiveMeeting);
|
|
46
54
|
},
|
|
47
55
|
hasActiveMeeting() {
|
|
48
56
|
return instance.hasActiveMeeting();
|
|
@@ -56,6 +64,12 @@ class ApplicationManager {
|
|
|
56
64
|
fireEvent(eventType, event) {
|
|
57
65
|
return _Observable.default.fireEvent(eventType, new _Event.default(event.source, event.viewId, event.data));
|
|
58
66
|
},
|
|
67
|
+
updateContext(values) {
|
|
68
|
+
return instance.updateContext(values);
|
|
69
|
+
},
|
|
70
|
+
emitSocketEvent(eventType, data) {
|
|
71
|
+
return _SocketManager.default.emitEvent(eventType, data);
|
|
72
|
+
},
|
|
59
73
|
setActiveTenant(tenant) {
|
|
60
74
|
instance.setActiveTenant(tenant);
|
|
61
75
|
},
|
|
@@ -178,6 +192,16 @@ class ApplicationManager {
|
|
|
178
192
|
}
|
|
179
193
|
});
|
|
180
194
|
}
|
|
195
|
+
openPopupView(view) {
|
|
196
|
+
this.props.confirmationDialogController.openPopupView(view);
|
|
197
|
+
}
|
|
198
|
+
openWindowView(view) {
|
|
199
|
+
_Observable.default.emitContextChangeEvent(applicationContext, {
|
|
200
|
+
windowView: view
|
|
201
|
+
});
|
|
202
|
+
applicationContext.windowView = view;
|
|
203
|
+
}
|
|
204
|
+
|
|
181
205
|
/**
|
|
182
206
|
* registers a library
|
|
183
207
|
*
|
|
@@ -206,15 +230,6 @@ class ApplicationManager {
|
|
|
206
230
|
return this.props.applicationHistory;
|
|
207
231
|
};
|
|
208
232
|
|
|
209
|
-
/**
|
|
210
|
-
* get app bar title
|
|
211
|
-
*
|
|
212
|
-
* @returns app bar title
|
|
213
|
-
*/
|
|
214
|
-
getAppBarTitle = () => {
|
|
215
|
-
return this.props.appBarTitle;
|
|
216
|
-
};
|
|
217
|
-
|
|
218
233
|
/**
|
|
219
234
|
* update appbar title
|
|
220
235
|
*
|
|
@@ -222,74 +237,9 @@ class ApplicationManager {
|
|
|
222
237
|
* @param title
|
|
223
238
|
*/
|
|
224
239
|
updateAppBarTitle = (viewId, title) => {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
let legendIconArrow = LEGEND_ARROW_ICON.replace('__COLOR__', this.props.secondaryColor);
|
|
230
|
-
let titleValue = '';
|
|
231
|
-
if (!title.match(_DynamicJS.TEMPLATE_REGEX)) {
|
|
232
|
-
titleValue = title;
|
|
233
|
-
} else {
|
|
234
|
-
titleValue = _DynamicJS.default.executeScript(viewId + 'Title', title, viewId);
|
|
235
|
-
}
|
|
236
|
-
if (!view.popUp && this.graphs.length === 0) {
|
|
237
|
-
for (const navHistoryElement of this.navHistory) {
|
|
238
|
-
if (navHistoryElement.viewId === viewId) {
|
|
239
|
-
navHistoryElement.title = titleValue;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
let legendValue = '<span>';
|
|
243
|
-
let counter = 0;
|
|
244
|
-
for (const navHistoryElement of this.navHistory) {
|
|
245
|
-
legendValue += `${navHistoryElement.title}`;
|
|
246
|
-
if (counter++ < this.navHistory.length - 1) {
|
|
247
|
-
legendValue += legendIconArrow;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
legendValue += '</span>';
|
|
251
|
-
this.props.appBarTitle = legendValue;
|
|
252
|
-
} else if (!view.popUp) {
|
|
253
|
-
let legendPath = '';
|
|
254
|
-
for (let i = 0; i < this.graphs[0].initialNavHistoryDepth && i < this.navHistory.length; i++) {
|
|
255
|
-
legendPath += `${this.navHistory[i].title}`;
|
|
256
|
-
if (i < this.graphs[0].initialNavHistoryDepth - 1) {
|
|
257
|
-
legendPath += legendIconArrow;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
legendPath = legendPath.length > 0 ? legendPath + legendIconArrow : '';
|
|
261
|
-
this.props.appBarTitle = this.graphs[0].initialNavHistoryDepth === 0 ? titleValue : `${legendPath}<span>${this.graphs[0].title}</span>`;
|
|
262
|
-
this.graphs[0].setCurrentNodeTitle(titleValue);
|
|
263
|
-
}
|
|
264
|
-
let property = {};
|
|
265
|
-
property.name = 'title';
|
|
266
|
-
property.value = this.props.appBarTitle;
|
|
267
|
-
let event = new _Event.default(this, SYSTEM_EVENT, property);
|
|
268
|
-
_Observable.default.fireEvent(_EventType.default.APPLICATION_CONTEXT_CHANGE, event);
|
|
269
|
-
if (!view.popUp && this.graphs.length > 0) {
|
|
270
|
-
property = {};
|
|
271
|
-
property.name = 'stepperTitle';
|
|
272
|
-
let event = new _Event.default(this, SYSTEM_EVENT, property);
|
|
273
|
-
_Observable.default.fireEvent(_EventType.default.APPLICATION_CONTEXT_CHANGE, event);
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* set viewport history
|
|
279
|
-
*
|
|
280
|
-
* @param history
|
|
281
|
-
*/
|
|
282
|
-
setViewPortHistory = history => {
|
|
283
|
-
this.props.viewPortHistory = history;
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* get viewport history
|
|
288
|
-
*
|
|
289
|
-
* @returns viewport history
|
|
290
|
-
*/
|
|
291
|
-
getViewPortHistory = () => {
|
|
292
|
-
return this.props.viewPortHistory;
|
|
240
|
+
Object.keys(this.viewContext).forEach(key => {
|
|
241
|
+
this.viewContext[key].updateAppBarTitle(viewId, title);
|
|
242
|
+
});
|
|
293
243
|
};
|
|
294
244
|
|
|
295
245
|
/**
|
|
@@ -298,19 +248,11 @@ class ApplicationManager {
|
|
|
298
248
|
*/
|
|
299
249
|
clear = () => {
|
|
300
250
|
_Observable.default.clearAllEventListeners();
|
|
301
|
-
this.
|
|
251
|
+
Object.keys(this.viewContext).forEach(key => {
|
|
252
|
+
this.viewContext[key].clear();
|
|
253
|
+
});
|
|
302
254
|
this.fileCache.splice(0, this.fileCache.length);
|
|
303
255
|
};
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
*
|
|
307
|
-
*/
|
|
308
|
-
getPreviousHistoryElement = () => {
|
|
309
|
-
if (this.navHistory.length > 1) {
|
|
310
|
-
return this.navHistory[this.navHistory.length - 2];
|
|
311
|
-
}
|
|
312
|
-
return null;
|
|
313
|
-
};
|
|
314
256
|
getFileDomainCache = domain => {
|
|
315
257
|
for (const fileCacheElement of this.fileCache) {
|
|
316
258
|
if (fileCacheElement.domain === domain) {
|
|
@@ -365,7 +307,7 @@ class ApplicationManager {
|
|
|
365
307
|
* @param forward
|
|
366
308
|
*/
|
|
367
309
|
addDashboardView = (view, path) => {
|
|
368
|
-
this.
|
|
310
|
+
this.viewContext.dashboard.addView(view);
|
|
369
311
|
};
|
|
370
312
|
|
|
371
313
|
/**
|
|
@@ -373,7 +315,7 @@ class ApplicationManager {
|
|
|
373
315
|
*
|
|
374
316
|
*/
|
|
375
317
|
clearDashboardViews = () => {
|
|
376
|
-
this.
|
|
318
|
+
this.viewContext.dashboard.closeAllViews();
|
|
377
319
|
};
|
|
378
320
|
|
|
379
321
|
/**
|
|
@@ -382,70 +324,20 @@ class ApplicationManager {
|
|
|
382
324
|
* @param view the listener to be added
|
|
383
325
|
* @param path
|
|
384
326
|
* @param forward
|
|
327
|
+
* @param managerId
|
|
385
328
|
*/
|
|
386
|
-
addView = (view, path, forward) => {
|
|
387
|
-
|
|
388
|
-
let topView = this.getTopAnchorView();
|
|
389
|
-
if (topView) {
|
|
390
|
-
this.closeView(topView?.config.id, forward);
|
|
391
|
-
}
|
|
392
|
-
} else {
|
|
393
|
-
if (view.popUp) {
|
|
394
|
-
this.props.confirmationDialogController.openPopupView(view);
|
|
395
|
-
}
|
|
396
|
-
if (view.window) {
|
|
397
|
-
let topView = this.getTopWindowView();
|
|
398
|
-
if (topView) {
|
|
399
|
-
this.closeView(topView?.config.id, forward);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
if (view.parent) {
|
|
404
|
-
this.navHistory.splice(0, this.navHistory.length);
|
|
405
|
-
for (const contextView of this.views) {
|
|
406
|
-
let shouldClose = view.window && contextView.window || !view.window && !contextView.window;
|
|
407
|
-
if (!_Utils.default.isNull(contextView) && !_Utils.default.isNull(contextView.handle.api) && shouldClose) {
|
|
408
|
-
this.closeView(contextView.handle.api.id, forward);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
if (forward || view.parent) {
|
|
413
|
-
let historyElement = {};
|
|
414
|
-
historyElement.viewId = view.config.id;
|
|
415
|
-
historyElement.parent = view.parent;
|
|
416
|
-
historyElement.graphId = view.graphId;
|
|
417
|
-
historyElement.path = path;
|
|
418
|
-
this.navHistory.push(historyElement);
|
|
419
|
-
}
|
|
420
|
-
this.views.push(view);
|
|
421
|
-
if (view.window) {
|
|
422
|
-
_Observable.default.emitContextChangeEvent(applicationContext, {
|
|
423
|
-
windowView: view
|
|
424
|
-
});
|
|
425
|
-
applicationContext.windowView = view;
|
|
426
|
-
}
|
|
427
|
-
let currentGraph = this.graphs.length > 0 ? this.graphs[this.graphs.length - 1] : null;
|
|
428
|
-
if (currentGraph) {
|
|
429
|
-
if (!view.window && view.parent && currentGraph.config.isWindow) {
|
|
430
|
-
currentGraph.anchorView = view;
|
|
431
|
-
currentGraph.anchorHistoryElement = this.navHistory[this.navHistory.length - 1];
|
|
432
|
-
currentGraph.initialNavHistoryDepth = 0;
|
|
433
|
-
//this.updateAppBarTitle(currentGraph.anchorView.config.id, currentGraph.anchorView.config.title);
|
|
434
|
-
this.updateContext({
|
|
435
|
-
windowDisplayState: 'PINNED'
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
}
|
|
329
|
+
addView = (view, path, forward, managerId) => {
|
|
330
|
+
this.viewContext[managerId].addView(view, path, forward);
|
|
439
331
|
};
|
|
440
332
|
|
|
441
333
|
/**
|
|
442
|
-
* closes
|
|
334
|
+
* closes all views
|
|
443
335
|
*
|
|
444
336
|
*/
|
|
445
337
|
closeAllViews = () => {
|
|
446
|
-
|
|
447
|
-
this.
|
|
448
|
-
}
|
|
338
|
+
Object.keys(this.viewContext).forEach(key => {
|
|
339
|
+
this.viewContext[key].closeAllViews();
|
|
340
|
+
});
|
|
449
341
|
_Observable.default.emitContextChangeEvent(applicationContext, {
|
|
450
342
|
windowView: null
|
|
451
343
|
});
|
|
@@ -459,48 +351,17 @@ class ApplicationManager {
|
|
|
459
351
|
* @param forward
|
|
460
352
|
*/
|
|
461
353
|
closeView = (viewId, forward) => {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
if (
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
break;
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
let index = this.views.findIndex(v => v.handle.api.id === viewId);
|
|
474
|
-
if (index >= 0) {
|
|
475
|
-
this.views.splice(index, 1);
|
|
476
|
-
if (!view.popUp && !view.parent && !forward) {
|
|
477
|
-
let viewIndex = this.navHistory.findIndex(h => h.viewId === viewId);
|
|
478
|
-
if (viewIndex >= 0) {
|
|
479
|
-
this.navHistory.splice(viewIndex, 1);
|
|
480
|
-
}
|
|
481
|
-
} else if (view.popUp) {
|
|
482
|
-
this.props.confirmationDialogController.closePopupView();
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
let hasWindow = false;
|
|
487
|
-
for (const viewsElement of this.views) {
|
|
488
|
-
if (viewsElement.window) {
|
|
489
|
-
hasWindow = true;
|
|
354
|
+
for (const key of Object.keys(this.viewContext)) {
|
|
355
|
+
let viewContextElement = this.viewContext[key];
|
|
356
|
+
if (key === 'popup') {
|
|
357
|
+
this.props.confirmationDialogController.closePopupView();
|
|
358
|
+
} else {
|
|
359
|
+
const view = viewContextElement.getView();
|
|
360
|
+
if (view) {
|
|
361
|
+
viewContextElement.closeView(viewId, forward);
|
|
490
362
|
break;
|
|
491
363
|
}
|
|
492
364
|
}
|
|
493
|
-
if (!hasWindow) {
|
|
494
|
-
_Observable.default.emitContextChangeEvent(applicationContext, {
|
|
495
|
-
windowView: null
|
|
496
|
-
});
|
|
497
|
-
applicationContext.windowView = null;
|
|
498
|
-
}
|
|
499
|
-
if (view.window) {
|
|
500
|
-
this.updateContext({
|
|
501
|
-
windowDisplayState: 'MAXIMIZED'
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
365
|
}
|
|
505
366
|
};
|
|
506
367
|
|
|
@@ -509,12 +370,13 @@ class ApplicationManager {
|
|
|
509
370
|
*
|
|
510
371
|
*/
|
|
511
372
|
getView = id => {
|
|
512
|
-
for (const
|
|
513
|
-
|
|
373
|
+
for (const key of Object.keys(this.viewContext)) {
|
|
374
|
+
const view = this.viewContext[key].getView(id);
|
|
375
|
+
if (view) {
|
|
514
376
|
return view;
|
|
515
377
|
}
|
|
516
378
|
}
|
|
517
|
-
return
|
|
379
|
+
return null;
|
|
518
380
|
};
|
|
519
381
|
getViewComponent = (view, id) => {
|
|
520
382
|
if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle) && !_Utils.default.isNull(view.handle.api)) {
|
|
@@ -539,21 +401,26 @@ class ApplicationManager {
|
|
|
539
401
|
if (APP_VARIABLE === id) {
|
|
540
402
|
return this.api;
|
|
541
403
|
}
|
|
542
|
-
|
|
404
|
+
let graphs = [];
|
|
405
|
+
for (const key of Object.keys(this.viewContext)) {
|
|
406
|
+
let viewContext = this.viewContext[key];
|
|
407
|
+
for (const graph of viewContext.getGraphs()) {
|
|
408
|
+
graphs.push(graph);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
for (const graph of graphs) {
|
|
543
412
|
if (graph.id === id) {
|
|
544
413
|
return graph;
|
|
545
414
|
}
|
|
546
415
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
416
|
+
let views = [];
|
|
417
|
+
for (const key of Object.keys(this.viewContext)) {
|
|
418
|
+
let viewContext = this.viewContext[key];
|
|
419
|
+
for (const view of viewContext.getViews()) {
|
|
420
|
+
views.push(view);
|
|
551
421
|
}
|
|
552
422
|
}
|
|
553
|
-
|
|
554
|
-
return this.getViewComponent(this.props.dashboardView, id);
|
|
555
|
-
}
|
|
556
|
-
for (const view of this.views) {
|
|
423
|
+
for (const view of views) {
|
|
557
424
|
let component = this.getViewComponent(view, id);
|
|
558
425
|
if (component) {
|
|
559
426
|
return component;
|
|
@@ -781,106 +648,6 @@ class ApplicationManager {
|
|
|
781
648
|
getId = () => {
|
|
782
649
|
return 'applicationManager';
|
|
783
650
|
};
|
|
784
|
-
loadAnchor(graph) {
|
|
785
|
-
alert('Loading anchor');
|
|
786
|
-
this.navHistory.splice(graph.initialNavHistoryDepth - 1, this.navHistory.length);
|
|
787
|
-
this.addView(graph.anchorView, graph.anchorHistoryElement.path, true);
|
|
788
|
-
//this.navigate('/view/unload');
|
|
789
|
-
this.navigate('/view/' + graph.anchorView.config.id);
|
|
790
|
-
}
|
|
791
|
-
removeLoadedGraph(routeBackToAnchor) {
|
|
792
|
-
if (this.graphs.length > 0) {
|
|
793
|
-
let graph = this.graphs[this.graphs.length - 1];
|
|
794
|
-
console.log("\n\n\n\n\nREMOVING GRAPH - VIEWS : ", this.views);
|
|
795
|
-
let graphViews = this.views.filter(view => view.graphId === graph.id);
|
|
796
|
-
console.log("REMOVING GRAPH - GRAPH VIEWS : ", graphViews);
|
|
797
|
-
for (const graphView of graphViews) {
|
|
798
|
-
this.closeView(graphView.config.id, false);
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
/*if(graph.config.isWindow) {
|
|
802
|
-
let graphWindowViews = [] = this.views.filter((v) => v.graphWindow);
|
|
803
|
-
for (const graphWindowView of graphWindowViews) {
|
|
804
|
-
this.closeView(graphWindowView);
|
|
805
|
-
}
|
|
806
|
-
} else {
|
|
807
|
-
let view = this.getTopAnchorView();
|
|
808
|
-
if (view) {
|
|
809
|
-
this.closeView(view.config.id, false);
|
|
810
|
-
}
|
|
811
|
-
}*/
|
|
812
|
-
|
|
813
|
-
if (!_Utils.default.isNull(graph.anchorHistoryElement) && routeBackToAnchor) {
|
|
814
|
-
this.loadAnchor(graph);
|
|
815
|
-
}
|
|
816
|
-
this.graphs.splice(0, this.graphs.length);
|
|
817
|
-
let graphHistory = this.navHistory.filter(view => view.graphId === graph.id);
|
|
818
|
-
for (const graphHistoryElement of graphHistory) {
|
|
819
|
-
this.navHistory.splice(this.navHistory.findIndex(e => e === graphHistoryElement), 1);
|
|
820
|
-
}
|
|
821
|
-
console.log("\n\n\n\nNAV HISTORY : ", this.navHistory);
|
|
822
|
-
if (!_Utils.default.isNull(graph.anchorHistoryElement)) {
|
|
823
|
-
this.updateAppBarTitle(graph.anchorView.config.id, graph.anchorView.config.title);
|
|
824
|
-
}
|
|
825
|
-
if (graph.config.isWindow) {
|
|
826
|
-
this.updateContext({
|
|
827
|
-
windowDisplayState: 'MAXIMIZED'
|
|
828
|
-
});
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
loadGraph(isParent, isPopup, isWindow, config, parameterValues) {
|
|
833
|
-
if (isParent && !isPopup && !isWindow) {
|
|
834
|
-
this.navHistory.splice(0, this.navHistory.length);
|
|
835
|
-
for (const contextView of this.views) {
|
|
836
|
-
this.closeView(contextView.handle.api.id, false);
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
/*this.getViewPortHistory()
|
|
840
|
-
.push('/switch');*/
|
|
841
|
-
}
|
|
842
|
-
config.isWindow = isWindow;
|
|
843
|
-
let graph = new _Graph.default(_Utils.default.parseConfig(config));
|
|
844
|
-
graph.initialNavHistoryDepth = this.navHistory.length;
|
|
845
|
-
if (this.navHistory.length > 0) {
|
|
846
|
-
graph.anchorView = this.getTopAnchorView(); //= this.getCurrentView();
|
|
847
|
-
graph.anchorHistoryElement = this.navHistory[this.navHistory.length - 1];
|
|
848
|
-
}
|
|
849
|
-
this.graphs.push(graph);
|
|
850
|
-
for (const parameterValue of parameterValues) {
|
|
851
|
-
graph.model[parameterValue.name] = parameterValue.value;
|
|
852
|
-
}
|
|
853
|
-
graph.init();
|
|
854
|
-
}
|
|
855
|
-
getTopAnchorView() {
|
|
856
|
-
for (let i = this.views.length - 1; i >= 0; i--) {
|
|
857
|
-
if (!this.views[i].window) {
|
|
858
|
-
return this.views[i];
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
getTopWindowView() {
|
|
863
|
-
for (let i = this.views.length - 1; i >= 0; i--) {
|
|
864
|
-
if (this.views[i].window) {
|
|
865
|
-
return this.views[i];
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
getTopView() {
|
|
870
|
-
return this.getTopWindowView() ? this.getTopWindowView() : this.getTopAnchorView();
|
|
871
|
-
}
|
|
872
|
-
signalGraph(id, event) {
|
|
873
|
-
if (this.graphs.length > 0) {
|
|
874
|
-
let graphToSignal = this.graphs[this.graphs.length - 1];
|
|
875
|
-
for (const graph of this.graphs) {
|
|
876
|
-
if (id === graph.id) {
|
|
877
|
-
graphToSignal = graph;
|
|
878
|
-
break;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
graphToSignal.signal(event);
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
651
|
enableFormMarkers(enabled) {
|
|
885
652
|
this.props.formMarkersEnabled = enabled;
|
|
886
653
|
}
|
|
@@ -896,6 +663,45 @@ class ApplicationManager {
|
|
|
896
663
|
getUserDetails() {
|
|
897
664
|
return this.props.userDetails;
|
|
898
665
|
}
|
|
666
|
+
loadGraph(isParent, config, parameterValues, viewContext) {
|
|
667
|
+
this.viewContext[viewContext].loadGraph(isParent, config, parameterValues);
|
|
668
|
+
}
|
|
669
|
+
removeLoadedGraph(viewContext) {
|
|
670
|
+
let graph = this.viewContext[viewContext].removeLoadedGraph();
|
|
671
|
+
if (graph && graph.config.isWindow) {
|
|
672
|
+
_Observable.default.emitContextChangeEvent(applicationContext, {
|
|
673
|
+
windowView: null
|
|
674
|
+
});
|
|
675
|
+
applicationContext.windowView = null;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
signalGraph(id, event) {
|
|
679
|
+
Object.keys(this.viewContext).forEach(key => {
|
|
680
|
+
this.viewContext[key].signalGraph(id, event);
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* viewContext
|
|
686
|
+
*/
|
|
687
|
+
getPreviousHistoryElement = viewContext => {
|
|
688
|
+
return this.viewContext[viewContext].getPreviousHistoryElement();
|
|
689
|
+
};
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* viewContext
|
|
693
|
+
*/
|
|
694
|
+
getCurrentGraph = viewContext => {
|
|
695
|
+
let graphs = this.viewContext[viewContext].graphs;
|
|
696
|
+
return graphs && graphs.length > 0 ? graphs[graphs.length - 1] : null;
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* viewContext
|
|
701
|
+
*/
|
|
702
|
+
getTopView = viewContext => {
|
|
703
|
+
return this.viewContext[viewContext].getTopView();
|
|
704
|
+
};
|
|
899
705
|
}
|
|
900
706
|
const instance = new ApplicationManager();
|
|
901
707
|
Object.freeze(instance);
|