@agilemotion/oui-react-js 1.3.4 → 1.3.6

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.
@@ -74,7 +74,7 @@ class ActionHandlers {
74
74
  let shouldRun = true;
75
75
 
76
76
  if (!_Utils.default.isNull(preCondition)) {
77
- shouldRun = _DynamicJS.default.executeScript(Math.random() + "_action_pre_condition", preCondition);
77
+ shouldRun = _DynamicJS.default.executeScript(Math.random() + "_" + viewId + "_" + (component ? component.api.id : "NO_COMPONENT") + "_action_pre_condition", preCondition);
78
78
  }
79
79
 
80
80
  if (shouldRun) {
@@ -22,7 +22,7 @@ class LoadDataActionHandler {
22
22
 
23
23
  execute(actionConfig, event, component, currentViewId) {
24
24
  if (!_Utils.default.isNull(component)) {
25
- component.api.loadData(actionConfig, event.data);
25
+ component.api.loadData(actionConfig, event);
26
26
  }
27
27
  }
28
28
 
@@ -51,7 +51,7 @@ class RouteActionHandler {
51
51
  } else {
52
52
  path = _ApplicationContext.default.isExpression(actionConfig.path) ? _ApplicationContext.default.resolveExpressionValue(actionConfig.path, event.data) : actionConfig.path;
53
53
 
54
- if ("@#{history.back}" === actionConfig.path) {
54
+ if ("@#{history.back}" === actionConfig.path && _ApplicationContext.default.graphs.length === 0) {
55
55
  let historyElement = _ApplicationContext.default.getPreviousHistoryElement();
56
56
 
57
57
  if (historyElement === null) {
@@ -87,49 +87,53 @@ class RouteActionHandler {
87
87
  }
88
88
  }
89
89
 
90
- let url = location + _ApplicationContext.default.getBaseApiUrl() + _ApplicationContext.default.getUIConfigPath() + "/view?version=1.0&id=" + path;
91
- (0, _RestUtils.sendRequest)(url, data => {
92
- if (isParent) {
93
- _ApplicationContext.default.removeLoadedGraph();
94
- }
90
+ if ("@#{history.back}" === actionConfig.path && _ApplicationContext.default.graphs.length > 0) {
91
+ _ApplicationContext.default.removeLoadedGraph();
92
+ } else {
93
+ let url = location + _ApplicationContext.default.getBaseApiUrl() + _ApplicationContext.default.getUIConfigPath() + "/view?version=1.0&id=" + path;
94
+ (0, _RestUtils.sendRequest)(url, data => {
95
+ if (isParent) {
96
+ _ApplicationContext.default.removeLoadedGraph();
97
+ }
95
98
 
96
- if (data.type === 'view') {
97
- let currentView = _ApplicationContext.default.getCurrentView();
99
+ if (data.type === 'view') {
100
+ let currentView = _ApplicationContext.default.getCurrentView();
98
101
 
99
- if (_Utils.default.isNull(currentView) || !currentView.popUp) {
100
- let view = {};
101
- view.config = data;
102
- view.handle = {};
103
- view.parameters = parameterValues;
104
- view.parent = isParent;
105
- view.popUp = isPopup;
102
+ if (_Utils.default.isNull(currentView) || !currentView.popUp) {
103
+ let view = {};
104
+ view.config = data;
105
+ view.handle = {};
106
+ view.parameters = parameterValues;
107
+ view.parent = isParent;
108
+ view.popUp = isPopup;
106
109
 
107
- _ApplicationContext.default.addView(view, path, forward); // None-existing route to ensure that the current view unloads
110
+ _ApplicationContext.default.addView(view, path, forward); // None-existing route to ensure that the current view unloads
108
111
 
109
112
 
110
- if (_Utils.default.isNull(actionConfig.popUp) || actionConfig.popUp === false) {
111
- _ApplicationContext.default.getViewPortHistory().push("/switch");
113
+ if (_Utils.default.isNull(actionConfig.popUp) || actionConfig.popUp === false) {
114
+ _ApplicationContext.default.getViewPortHistory().push("/switch");
112
115
 
113
- _ApplicationContext.default.getViewPortHistory().push("/view/" + data.id);
114
- }
115
- } else {
116
- _ApplicationContext.default.closeCurrentView(false);
116
+ _ApplicationContext.default.getViewPortHistory().push("/view/" + data.id);
117
+ }
118
+ } else {
119
+ _ApplicationContext.default.closeCurrentView(false);
117
120
 
118
- currentView = _ApplicationContext.default.getCurrentView();
121
+ currentView = _ApplicationContext.default.getCurrentView();
119
122
 
120
- if (currentView) {
121
- currentView.handle.api.updateModel(parameterValues);
122
- let event = new _Event.default(currentView.handle, currentView.config.id, null);
123
+ if (currentView) {
124
+ currentView.handle.api.updateModel(parameterValues);
125
+ let event = new _Event.default(currentView.handle, currentView.config.id, null);
123
126
 
124
- _Observable.default.fireEvent(_EventType.default.COMPONENT_LOAD, event);
127
+ _Observable.default.fireEvent(_EventType.default.COMPONENT_LOAD, event);
128
+ }
125
129
  }
130
+ } else if (data.type === 'graph') {
131
+ _ApplicationContext.default.loadGraph(isParent, isPopup, data, parameterValues);
126
132
  }
127
- } else if (data.type === 'graph') {
128
- _ApplicationContext.default.loadGraph(isParent, isPopup, data, parameterValues);
129
- }
130
- }, e => {
131
- console.error(e);
132
- }, true, false);
133
+ }, e => {
134
+ console.error(e);
135
+ }, true, false);
136
+ }
133
137
  }
134
138
 
135
139
  }
@@ -53,7 +53,7 @@ class ServiceCallActionHandler {
53
53
  if (invalidParameterCallback) {
54
54
  invalidParameterCallback();
55
55
  }
56
- }, actionConfig.returnValueBinding, actionConfig.successMessage);
56
+ }, actionConfig.returnValueBinding, actionConfig.successMessage, event);
57
57
  }
58
58
 
59
59
  }
@@ -10,22 +10,22 @@ class Addresses {
10
10
  this.resolver = resolver;
11
11
  }
12
12
 
13
- copy(from, to, checked) {
13
+ copy(from, to, checked, mode = 'line') {
14
14
  if (checked) {
15
- let street = this.resolver.resolveComponentApi(from + '.street').value;
16
- let suburb = this.resolver.resolveComponentApi(from + '.suburb').value;
17
- let city = this.resolver.resolveComponentApi(from + '.city').value;
18
- let municipality = this.resolver.resolveComponentApi(from + '.municipality').value;
19
- let province = this.resolver.resolveComponentApi(from + '.province').value;
20
- let country = this.resolver.resolveComponentApi(from + '.country').value;
15
+ let street = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.street' : '.line1')).value;
16
+ let suburb = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.suburb' : '.line2')).value;
17
+ let city = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.city' : '.line3')).value;
18
+ let municipality = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.municipality' : '.line4')).value;
19
+ let province = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.province' : '.line5')).value;
20
+ let country = this.resolver.resolveComponentApi(from + (mode === 'street' ? '.country' : '.line6')).value;
21
21
  let code = this.resolver.resolveComponentApi(from + '.code').value;
22
22
  let building = this.resolver.resolveComponentApi(from + '.building').value;
23
- this.resolver.resolveComponentApi(to + '.street').value = street;
24
- this.resolver.resolveComponentApi(to + '.suburb').value = suburb;
25
- this.resolver.resolveComponentApi(to + '.city').value = city;
26
- this.resolver.resolveComponentApi(to + '.municipality').value = municipality;
27
- this.resolver.resolveComponentApi(to + '.province').value = province;
28
- this.resolver.resolveComponentApi(to + '.country').value = country;
23
+ this.resolver.resolveComponentApi(to + (mode === 'street' ? '.street' : '.line1')).value = street;
24
+ this.resolver.resolveComponentApi(to + (mode === 'street' ? '.suburb' : '.line2')).value = suburb;
25
+ this.resolver.resolveComponentApi(to + (mode === 'street' ? '.city' : '.line3')).value = city;
26
+ this.resolver.resolveComponentApi(to + (mode === 'street' ? '.municipality' : '.line4')).value = municipality;
27
+ this.resolver.resolveComponentApi(to + (mode === 'street' ? '.province' : '.line5')).value = province;
28
+ this.resolver.resolveComponentApi(to + (mode === 'street' ? '.country' : '.line6')).value = country;
29
29
  this.resolver.resolveComponentApi(to + '.code').value = code;
30
30
  this.resolver.resolveComponentApi(to + '.building').value = building;
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agilemotion/oui-react-js",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "babel": {
5
5
  "presets": [
6
6
  "@babel/preset-env",