@agilemotion/oui-react-js 1.8.30 → 1.8.32

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.
Files changed (56) hide show
  1. package/dist/ApplicationManager.js +116 -304
  2. package/dist/DynamicJS.js +1 -0
  3. package/dist/RestService.js +4 -0
  4. package/dist/ViewContext.js +239 -0
  5. package/dist/components/AlertBar.js +1 -1
  6. package/dist/components/Button.css +3 -0
  7. package/dist/components/Button.js +5 -3
  8. package/dist/components/DataGrid.css +4 -0
  9. package/dist/components/DataGrid.js +8 -4
  10. package/dist/components/DataGridFilter.js +2 -2
  11. package/dist/components/DataGridHeading.js +1 -1
  12. package/dist/components/DocumentViewer.js +22 -10
  13. package/dist/components/Graph.js +2 -0
  14. package/dist/components/HtmlPanel.js +0 -1
  15. package/dist/components/Icon.js +22 -0
  16. package/dist/components/LottieIcon.js +19 -19
  17. package/dist/components/SocketManager.js +5 -0
  18. package/dist/components/Spinner.js +56 -0
  19. package/dist/components/StepperTitleBar.js +11 -2
  20. package/dist/components/TabPage.js +1 -1
  21. package/dist/components/TabPanel.js +2 -1
  22. package/dist/components/TitleBar.js +1 -1
  23. package/dist/components/Toolbar.js +5 -7
  24. package/dist/components/WordDocumentViewer.js +27 -4
  25. package/dist/components/customInput/File.js +1 -2
  26. package/dist/components/dashboard/SideMenuModuleDashboard.css +4 -0
  27. package/dist/components/dashboard/components/Header.js +1 -1
  28. package/dist/components/form/CurrencyField.js +1 -1
  29. package/dist/components/form/DatePicker.js +1 -1
  30. package/dist/components/form/FieldSet.js +1 -1
  31. package/dist/components/form/Form.css +8 -0
  32. package/dist/components/form/IconField.js +7 -3
  33. package/dist/components/form/LookupField.js +1 -1
  34. package/dist/components/form/Section.js +6 -1
  35. package/dist/components/form/SelectItem.js +1 -0
  36. package/dist/components/form/TextField.js +1 -0
  37. package/dist/components/form/TimePicker.js +1 -0
  38. package/dist/components/form/TransferList.js +6 -5
  39. package/dist/components/layout/Layout.js +11 -2
  40. package/dist/components/layout/View.css +57 -0
  41. package/dist/components/layout/ViewPort.js +1 -0
  42. package/dist/components/layout/Window.js +4 -1
  43. package/dist/components/layout/WindowViewPort.js +16 -4
  44. package/dist/components/media/ClosablePanel.css +1 -1
  45. package/dist/components/media/ToolbarButton.js +2 -1
  46. package/dist/components/media/TrainingRoom.js +9 -1
  47. package/dist/components/media/VCEventType.js +0 -3
  48. package/dist/components/media/VCRoom.js +15 -1
  49. package/dist/components/media/chat/ChatRoom.js +6 -17
  50. package/dist/components/media/chat/ChatRoomItem.js +8 -8
  51. package/dist/components/media/chat/ChatRooms.scss +27 -13
  52. package/dist/event/EventType.js +1 -0
  53. package/dist/event/Observable.js +11 -2
  54. package/dist/event/RouteActionHandler.js +49 -56
  55. package/dist/js/ProcurementMeetings.js +65 -0
  56. 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.views = [];
27
- this.dashboardViews = [];
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(routeToAnchor) {
45
- instance.removeLoadedGraph(routeToAnchor);
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
- let view = this.getView(viewId);
226
- if (!view) {
227
- return;
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.views.splice(0, this.views.length);
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.dashboardViews.push(view);
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.dashboardViews.splice(0, this.dashboardViews.length);
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
- if (!view.popUp && !view.window) {
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 the current view
334
+ * closes all views
443
335
  *
444
336
  */
445
337
  closeAllViews = () => {
446
- for (const view of this.views) {
447
- this.closeView(view.config.id, false);
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,23 @@ class ApplicationManager {
459
351
  * @param forward
460
352
  */
461
353
  closeView = (viewId, forward) => {
462
- let view = this.getView(viewId);
463
- if (view) {
464
- if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle.api)) {
465
- _Observable.default.clearEventListeners(viewId);
466
- for (let i = 0; i < this.fileCache.length; i++) {
467
- let cacheElement = this.fileCache[i];
468
- if (cacheElement.domain === viewId) {
469
- this.fileCache.slice(i, 1);
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();
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);
362
+ if (key === 'window') {
363
+ _Observable.default.emitContextChangeEvent(applicationContext, {
364
+ windowView: null
365
+ });
366
+ applicationContext.windowView = null;
483
367
  }
484
- }
485
- }
486
- let hasWindow = false;
487
- for (const viewsElement of this.views) {
488
- if (viewsElement.window) {
489
- hasWindow = true;
490
368
  break;
491
369
  }
492
370
  }
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
371
  }
505
372
  };
506
373
 
@@ -509,12 +376,13 @@ class ApplicationManager {
509
376
  *
510
377
  */
511
378
  getView = id => {
512
- for (const view of this.views) {
513
- if (id === view.config.id) {
379
+ for (const key of Object.keys(this.viewContext)) {
380
+ const view = this.viewContext[key].getView(id);
381
+ if (view) {
514
382
  return view;
515
383
  }
516
384
  }
517
- return this.dashboardViews.find(v => v.config.id === id);
385
+ return null;
518
386
  };
519
387
  getViewComponent = (view, id) => {
520
388
  if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle) && !_Utils.default.isNull(view.handle.api)) {
@@ -539,21 +407,26 @@ class ApplicationManager {
539
407
  if (APP_VARIABLE === id) {
540
408
  return this.api;
541
409
  }
542
- for (const graph of this.graphs) {
410
+ let graphs = [];
411
+ for (const key of Object.keys(this.viewContext)) {
412
+ let viewContext = this.viewContext[key];
413
+ for (const graph of viewContext.getGraphs()) {
414
+ graphs.push(graph);
415
+ }
416
+ }
417
+ for (const graph of graphs) {
543
418
  if (graph.id === id) {
544
419
  return graph;
545
420
  }
546
421
  }
547
- for (const view of this.dashboardViews) {
548
- let component = this.getViewComponent(view, id);
549
- if (component) {
550
- return component;
422
+ let views = [];
423
+ for (const key of Object.keys(this.viewContext)) {
424
+ let viewContext = this.viewContext[key];
425
+ for (const view of viewContext.getViews()) {
426
+ views.push(view);
551
427
  }
552
428
  }
553
- if (this.views.length === 0) {
554
- return this.getViewComponent(this.props.dashboardView, id);
555
- }
556
- for (const view of this.views) {
429
+ for (const view of views) {
557
430
  let component = this.getViewComponent(view, id);
558
431
  if (component) {
559
432
  return component;
@@ -781,106 +654,6 @@ class ApplicationManager {
781
654
  getId = () => {
782
655
  return 'applicationManager';
783
656
  };
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
657
  enableFormMarkers(enabled) {
885
658
  this.props.formMarkersEnabled = enabled;
886
659
  }
@@ -896,6 +669,45 @@ class ApplicationManager {
896
669
  getUserDetails() {
897
670
  return this.props.userDetails;
898
671
  }
672
+ loadGraph(isParent, config, parameterValues, viewContext) {
673
+ this.viewContext[viewContext].loadGraph(isParent, config, parameterValues);
674
+ }
675
+ removeLoadedGraph(viewContext) {
676
+ let graph = this.viewContext[viewContext].removeLoadedGraph();
677
+ if (graph && graph.config.isWindow) {
678
+ _Observable.default.emitContextChangeEvent(applicationContext, {
679
+ windowView: null
680
+ });
681
+ applicationContext.windowView = null;
682
+ }
683
+ }
684
+ signalGraph(id, event) {
685
+ Object.keys(this.viewContext).forEach(key => {
686
+ this.viewContext[key].signalGraph(id, event);
687
+ });
688
+ }
689
+
690
+ /**
691
+ * viewContext
692
+ */
693
+ getPreviousHistoryElement = viewContext => {
694
+ return this.viewContext[viewContext].getPreviousHistoryElement();
695
+ };
696
+
697
+ /**
698
+ * viewContext
699
+ */
700
+ getCurrentGraph = viewContext => {
701
+ let graphs = this.viewContext[viewContext].graphs;
702
+ return graphs && graphs.length > 0 ? graphs[graphs.length - 1] : null;
703
+ };
704
+
705
+ /**
706
+ * viewContext
707
+ */
708
+ getTopView = viewContext => {
709
+ return this.viewContext[viewContext].getTopView();
710
+ };
899
711
  }
900
712
  const instance = new ApplicationManager();
901
713
  Object.freeze(instance);
package/dist/DynamicJS.js CHANGED
@@ -90,6 +90,7 @@ class DynamicJS {
90
90
  if (!_Utils.default.isNull(event)) {
91
91
  eventParam = {};
92
92
  eventParam.data = event.data;
93
+ eventParam.viewId = event.viewId;
93
94
  }
94
95
  try {
95
96
  // NB : The javascript serializer uses UCT for dates and it is 2 hours behind. TODO : use DateUtils.makeDateReplacer
@@ -114,6 +114,7 @@ class RestService {
114
114
  }
115
115
  if (requestBody !== null || service.method === 'POST') {
116
116
  this.fetchWithCustomConfig({
117
+ viewId: request.viewId,
117
118
  url,
118
119
  serviceType: request.service.type,
119
120
  method: 'POST',
@@ -131,6 +132,7 @@ class RestService {
131
132
  });
132
133
  } else if (contentType === 'application/pdf' || contentType === 'application/vnd.ms-excel') {
133
134
  this.fetchWithCustomConfig({
135
+ viewId: request.viewId,
134
136
  url,
135
137
  serviceType: request.service.type,
136
138
  secure: request.secure,
@@ -144,6 +146,7 @@ class RestService {
144
146
  });
145
147
  } else {
146
148
  this.fetchWithCustomConfig({
149
+ viewId: request.viewId,
147
150
  url,
148
151
  serviceType: request.service.type,
149
152
  secure: !service.url.startsWith('http://'),
@@ -208,6 +211,7 @@ class RestService {
208
211
  }
209
212
  }
210
213
  this.fetchWithCustomConfig({
214
+ viewId: request.viewId,
211
215
  url: location + _ApplicationManager.default.getContextRoot() + '/' + module + '/api/v1/rpc/invoke',
212
216
  serviceType: request.service.type,
213
217
  secure: true,