@sap-ux/preview-middleware 0.18.15 → 0.18.16
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/base/config.js +1 -1
- package/dist/base/flp.d.ts +7 -0
- package/dist/base/flp.js +13 -0
- package/dist/client/adp/api-handler.js +153 -153
- package/dist/client/adp/command-executor.js +75 -75
- package/dist/client/adp/control-utils.js +44 -44
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
- package/dist/client/adp/controllers/ControllerExtension.controller.js +209 -209
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
- package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
- package/dist/client/adp/dialog-factory.js +125 -125
- package/dist/client/adp/init-dialogs.js +107 -107
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
- package/dist/client/adp/quick-actions/common/create-page-action.js +51 -51
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -48
- package/dist/client/adp/quick-actions/common/utils.js +18 -18
- package/dist/client/adp/quick-actions/control-types.js +21 -21
- package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
- package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +104 -104
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
- package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
- package/dist/client/adp/quick-actions/fe-v2/registry.js +75 -75
- package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +50 -50
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
- package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
- package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
- package/dist/client/adp/quick-actions/fe-v4/registry.js +58 -58
- package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
- package/dist/client/adp/quick-actions/load.js +44 -44
- package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
- package/dist/client/adp/utils.js +160 -160
- package/dist/client/cpe/changes/index.js +10 -10
- package/dist/client/cpe/changes/validator.js +39 -39
- package/dist/client/cpe/documentation.js +164 -164
- package/dist/client/cpe/feature-service.js +36 -36
- package/dist/client/cpe/logger.js +30 -30
- package/dist/client/cpe/outline/editable.js +37 -37
- package/dist/client/cpe/outline/nodes.js +222 -222
- package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
- package/dist/client/cpe/quick-actions/registry.js +143 -143
- package/dist/client/cpe/quick-actions/utils.js +92 -92
- package/dist/client/cpe/types.js +4 -4
- package/dist/client/cpe/ui5-utils.js +33 -33
- package/dist/client/cpe/utils.js +138 -138
- package/dist/client/flp/WorkspaceConnector.js +86 -86
- package/dist/client/flp/common.js +28 -28
- package/dist/client/flp/enableFakeConnector.js +83 -83
- package/dist/client/flp/initConnectors.js +28 -30
- package/dist/client/flp/initConnectors.ts +0 -7
- package/dist/client/flp/initRta.js +178 -178
- package/dist/client/i18n.js +56 -56
- package/dist/client/utils/application.js +32 -32
- package/dist/client/utils/core.js +68 -68
- package/dist/client/utils/error.js +19 -19
- package/dist/client/utils/fe-v4.js +118 -118
- package/dist/client/utils/version.js +104 -104
- package/package.json +5 -5
|
@@ -1,189 +1,189 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/core/library", "sap/ui/core/mvc/Controller", "sap/m/MessageToast", "../utils", "../../utils/error", "../../utils/core", "../control-utils", "sap/ui/dt/OverlayRegistry"], function (sap_ui_core_library, Controller, MessageToast, ___utils, ____utils_error, ____utils_core, __ControlUtils, OverlayRegistry) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
function _interopRequireDefault(obj) {
|
|
7
|
-
return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
|
|
8
|
-
}
|
|
9
|
-
const ValueState = sap_ui_core_library["ValueState"];
|
|
10
|
-
const matchesFragmentName = ___utils["matchesFragmentName"];
|
|
11
|
-
const getError = ____utils_error["getError"];
|
|
12
|
-
const getControlById = ____utils_core["getControlById"];
|
|
13
|
-
const ControlUtils = _interopRequireDefault(__ControlUtils);
|
|
14
|
-
/**
|
|
15
|
-
* @namespace open.ux.preview.client.adp.controllers
|
|
16
|
-
*/
|
|
17
|
-
const BaseDialog = Controller.extend("open.ux.preview.client.adp.controllers.BaseDialog", {
|
|
18
|
-
/**
|
|
19
|
-
* Method is used in add fragment dialog controllers to get current control metadata which are needed on the dialog
|
|
20
|
-
* @returns control metadata and target aggregations
|
|
21
|
-
*/
|
|
22
|
-
getControlMetadata: function _getControlMetadata() {
|
|
23
|
-
const selectorId = this.overlays.getId();
|
|
24
|
-
let controlMetadata;
|
|
25
|
-
const overlayControl = getControlById(selectorId);
|
|
26
|
-
if (overlayControl) {
|
|
27
|
-
this.runtimeControl = ControlUtils.getRuntimeControl(overlayControl);
|
|
28
|
-
controlMetadata = this.runtimeControl.getMetadata();
|
|
29
|
-
} else {
|
|
30
|
-
throw new Error('Cannot get overlay control');
|
|
31
|
-
}
|
|
32
|
-
const allAggregations = Object.keys(controlMetadata.getAllAggregations());
|
|
33
|
-
const hiddenAggregations = ['customData', 'layoutData', 'dependents'];
|
|
34
|
-
const targetAggregation = allAggregations.filter(item => {
|
|
35
|
-
if (hiddenAggregations.indexOf(item) === -1) {
|
|
36
|
-
return item;
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
});
|
|
40
|
-
return {
|
|
41
|
-
controlMetadata,
|
|
42
|
-
targetAggregation
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
/**
|
|
46
|
-
* Fills indexArray from selected control children
|
|
47
|
-
*
|
|
48
|
-
* @param selectedControlChildren Array of numbers
|
|
49
|
-
* @returns Array of key value pairs
|
|
50
|
-
*/
|
|
51
|
-
fillIndexArray: function _fillIndexArray(selectedControlChildren) {
|
|
52
|
-
let indexArray = [];
|
|
53
|
-
if (selectedControlChildren.length === 0) {
|
|
54
|
-
indexArray.push({
|
|
55
|
-
key: 0,
|
|
56
|
-
value: 0
|
|
57
|
-
});
|
|
58
|
-
} else {
|
|
59
|
-
indexArray = selectedControlChildren.map((elem, index) => {
|
|
60
|
-
return {
|
|
61
|
-
key: index + 1,
|
|
62
|
-
value: elem + 1
|
|
63
|
-
};
|
|
64
|
-
});
|
|
65
|
-
indexArray.unshift({
|
|
66
|
-
key: 0,
|
|
67
|
-
value: 0
|
|
68
|
-
});
|
|
69
|
-
indexArray.push({
|
|
70
|
-
key: selectedControlChildren.length + 1,
|
|
71
|
-
value: selectedControlChildren.length + 1
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
return indexArray;
|
|
75
|
-
},
|
|
76
|
-
/**
|
|
77
|
-
* Handles fragment name input change
|
|
78
|
-
*
|
|
79
|
-
* @param event Event
|
|
80
|
-
*/
|
|
81
|
-
onFragmentNameInputChange: function _onFragmentNameInputChange(event) {
|
|
82
|
-
const input = event.getSource();
|
|
83
|
-
const beginBtn = this.dialog.getBeginButton();
|
|
84
|
-
const fragmentName = input.getValue();
|
|
85
|
-
const fragmentList = this.model.getProperty('/fragmentList');
|
|
86
|
-
const updateDialogState = function (valueState) {
|
|
87
|
-
let valueStateText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
88
|
-
input.setValueState(valueState).setValueStateText(valueStateText);
|
|
89
|
-
beginBtn.setEnabled(valueState === ValueState.Success);
|
|
90
|
-
};
|
|
91
|
-
if (fragmentName.length <= 0) {
|
|
92
|
-
updateDialogState(ValueState.None);
|
|
93
|
-
this.model.setProperty('/newFragmentName', null);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const fileExists = fragmentList.some(f => f.fragmentName === `${fragmentName}.fragment.xml`);
|
|
97
|
-
if (fileExists) {
|
|
98
|
-
updateDialogState(ValueState.Error, 'Enter a different name. The fragment name that you entered already exists in your project.');
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const isValidName = /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(fragmentName);
|
|
102
|
-
if (!isValidName) {
|
|
103
|
-
updateDialogState(ValueState.Error, 'The fragment name cannot contain white spaces or special characters.');
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
if (fragmentName.length > 64) {
|
|
107
|
-
updateDialogState(ValueState.Error, 'A fragment file name cannot contain more than 64 characters.');
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const changeExists = this.checkForExistingChange(fragmentName);
|
|
111
|
-
if (changeExists) {
|
|
112
|
-
updateDialogState(ValueState.Error, 'Enter a different name. The fragment name entered matches the name of an unsaved fragment.');
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
updateDialogState(ValueState.Success);
|
|
116
|
-
this.model.setProperty('/newFragmentName', fragmentName);
|
|
117
|
-
},
|
|
118
|
-
/**
|
|
119
|
-
* Checks for the existence of a change associated with a specific fragment name in the RTA command stack.
|
|
120
|
-
*
|
|
121
|
-
* @param {string} fragmentName - The name of the fragment to check for existing changes.
|
|
122
|
-
* @returns {Promise<boolean>} A promise that resolves to `true` if a matching change is found, otherwise `false`.
|
|
123
|
-
*/
|
|
124
|
-
checkForExistingChange: function _checkForExistingChange(fragmentName) {
|
|
125
|
-
const allCommands = this.rta.getCommandStack().getCommands();
|
|
126
|
-
return allCommands.some(command => {
|
|
127
|
-
if (typeof command.getCommands === 'function') {
|
|
128
|
-
const addXmlCommand = command.getCommands().find(c => c?.getProperty('name') === 'addXMLAtExtensionPoint');
|
|
129
|
-
return addXmlCommand && matchesFragmentName(addXmlCommand, fragmentName);
|
|
130
|
-
} else {
|
|
131
|
-
return matchesFragmentName(command, fragmentName);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
},
|
|
135
|
-
/**
|
|
136
|
-
* Sets custom function that fires when user presses escape key.
|
|
137
|
-
*/
|
|
138
|
-
setEscapeHandler: function _setEscapeHandler() {
|
|
139
|
-
this.dialog.setEscapeHandler(_ref => {
|
|
140
|
-
let {
|
|
141
|
-
resolve
|
|
142
|
-
} = _ref;
|
|
143
|
-
this.handleDialogClose();
|
|
144
|
-
resolve();
|
|
145
|
-
});
|
|
146
|
-
},
|
|
147
|
-
/**
|
|
148
|
-
* Handles the dialog closing and destruction of it.
|
|
149
|
-
*/
|
|
150
|
-
handleDialogClose: function _handleDialogClose() {
|
|
151
|
-
this.dialog.close();
|
|
152
|
-
this.dialog.destroy();
|
|
153
|
-
},
|
|
154
|
-
/**
|
|
155
|
-
* Function that handles runtime thrown errors with MessageToast
|
|
156
|
-
*
|
|
157
|
-
* @param e error instance
|
|
158
|
-
* @throws {Error}.
|
|
159
|
-
*/
|
|
160
|
-
handleError: function _handleError(e) {
|
|
161
|
-
const error = getError(e);
|
|
162
|
-
MessageToast.show(error.message, {
|
|
163
|
-
duration: 5000
|
|
164
|
-
});
|
|
165
|
-
throw error;
|
|
166
|
-
},
|
|
167
|
-
/**
|
|
168
|
-
* Handles the index field whenever a specific aggregation is chosen
|
|
169
|
-
*
|
|
170
|
-
* @param specialIndexAggregation string | number
|
|
171
|
-
*/
|
|
172
|
-
specialIndexHandling: function _specialIndexHandling(specialIndexAggregation) {
|
|
173
|
-
const overlay = OverlayRegistry.getOverlay(this.runtimeControl);
|
|
174
|
-
const aggregations = overlay.getDesignTimeMetadata().getData().aggregations;
|
|
175
|
-
if (specialIndexAggregation in aggregations && 'specialIndexHandling' in aggregations[specialIndexAggregation]) {
|
|
176
|
-
const controlType = this.runtimeControl.getMetadata().getName();
|
|
177
|
-
this.model.setProperty('/indexHandlingFlag', false);
|
|
178
|
-
this.model.setProperty('/specialIndexHandlingIcon', true);
|
|
179
|
-
this.model.setProperty('/iconTooltip', `Index is defined by special logic of ${controlType} and can't be set here`);
|
|
180
|
-
} else {
|
|
181
|
-
this.model.setProperty('/indexHandlingFlag', true);
|
|
182
|
-
this.model.setProperty('/specialIndexHandlingIcon', false);
|
|
183
|
-
this.model.setProperty('/specialIndexHandlingIconPressed', false);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
return BaseDialog;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/core/library", "sap/ui/core/mvc/Controller", "sap/m/MessageToast", "../utils", "../../utils/error", "../../utils/core", "../control-utils", "sap/ui/dt/OverlayRegistry"], function (sap_ui_core_library, Controller, MessageToast, ___utils, ____utils_error, ____utils_core, __ControlUtils, OverlayRegistry) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function _interopRequireDefault(obj) {
|
|
7
|
+
return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
|
|
8
|
+
}
|
|
9
|
+
const ValueState = sap_ui_core_library["ValueState"];
|
|
10
|
+
const matchesFragmentName = ___utils["matchesFragmentName"];
|
|
11
|
+
const getError = ____utils_error["getError"];
|
|
12
|
+
const getControlById = ____utils_core["getControlById"];
|
|
13
|
+
const ControlUtils = _interopRequireDefault(__ControlUtils);
|
|
14
|
+
/**
|
|
15
|
+
* @namespace open.ux.preview.client.adp.controllers
|
|
16
|
+
*/
|
|
17
|
+
const BaseDialog = Controller.extend("open.ux.preview.client.adp.controllers.BaseDialog", {
|
|
18
|
+
/**
|
|
19
|
+
* Method is used in add fragment dialog controllers to get current control metadata which are needed on the dialog
|
|
20
|
+
* @returns control metadata and target aggregations
|
|
21
|
+
*/
|
|
22
|
+
getControlMetadata: function _getControlMetadata() {
|
|
23
|
+
const selectorId = this.overlays.getId();
|
|
24
|
+
let controlMetadata;
|
|
25
|
+
const overlayControl = getControlById(selectorId);
|
|
26
|
+
if (overlayControl) {
|
|
27
|
+
this.runtimeControl = ControlUtils.getRuntimeControl(overlayControl);
|
|
28
|
+
controlMetadata = this.runtimeControl.getMetadata();
|
|
29
|
+
} else {
|
|
30
|
+
throw new Error('Cannot get overlay control');
|
|
31
|
+
}
|
|
32
|
+
const allAggregations = Object.keys(controlMetadata.getAllAggregations());
|
|
33
|
+
const hiddenAggregations = ['customData', 'layoutData', 'dependents'];
|
|
34
|
+
const targetAggregation = allAggregations.filter(item => {
|
|
35
|
+
if (hiddenAggregations.indexOf(item) === -1) {
|
|
36
|
+
return item;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
controlMetadata,
|
|
42
|
+
targetAggregation
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* Fills indexArray from selected control children
|
|
47
|
+
*
|
|
48
|
+
* @param selectedControlChildren Array of numbers
|
|
49
|
+
* @returns Array of key value pairs
|
|
50
|
+
*/
|
|
51
|
+
fillIndexArray: function _fillIndexArray(selectedControlChildren) {
|
|
52
|
+
let indexArray = [];
|
|
53
|
+
if (selectedControlChildren.length === 0) {
|
|
54
|
+
indexArray.push({
|
|
55
|
+
key: 0,
|
|
56
|
+
value: 0
|
|
57
|
+
});
|
|
58
|
+
} else {
|
|
59
|
+
indexArray = selectedControlChildren.map((elem, index) => {
|
|
60
|
+
return {
|
|
61
|
+
key: index + 1,
|
|
62
|
+
value: elem + 1
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
indexArray.unshift({
|
|
66
|
+
key: 0,
|
|
67
|
+
value: 0
|
|
68
|
+
});
|
|
69
|
+
indexArray.push({
|
|
70
|
+
key: selectedControlChildren.length + 1,
|
|
71
|
+
value: selectedControlChildren.length + 1
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return indexArray;
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* Handles fragment name input change
|
|
78
|
+
*
|
|
79
|
+
* @param event Event
|
|
80
|
+
*/
|
|
81
|
+
onFragmentNameInputChange: function _onFragmentNameInputChange(event) {
|
|
82
|
+
const input = event.getSource();
|
|
83
|
+
const beginBtn = this.dialog.getBeginButton();
|
|
84
|
+
const fragmentName = input.getValue();
|
|
85
|
+
const fragmentList = this.model.getProperty('/fragmentList');
|
|
86
|
+
const updateDialogState = function (valueState) {
|
|
87
|
+
let valueStateText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
88
|
+
input.setValueState(valueState).setValueStateText(valueStateText);
|
|
89
|
+
beginBtn.setEnabled(valueState === ValueState.Success);
|
|
90
|
+
};
|
|
91
|
+
if (fragmentName.length <= 0) {
|
|
92
|
+
updateDialogState(ValueState.None);
|
|
93
|
+
this.model.setProperty('/newFragmentName', null);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const fileExists = fragmentList.some(f => f.fragmentName === `${fragmentName}.fragment.xml`);
|
|
97
|
+
if (fileExists) {
|
|
98
|
+
updateDialogState(ValueState.Error, 'Enter a different name. The fragment name that you entered already exists in your project.');
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const isValidName = /^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(fragmentName);
|
|
102
|
+
if (!isValidName) {
|
|
103
|
+
updateDialogState(ValueState.Error, 'The fragment name cannot contain white spaces or special characters.');
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (fragmentName.length > 64) {
|
|
107
|
+
updateDialogState(ValueState.Error, 'A fragment file name cannot contain more than 64 characters.');
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const changeExists = this.checkForExistingChange(fragmentName);
|
|
111
|
+
if (changeExists) {
|
|
112
|
+
updateDialogState(ValueState.Error, 'Enter a different name. The fragment name entered matches the name of an unsaved fragment.');
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
updateDialogState(ValueState.Success);
|
|
116
|
+
this.model.setProperty('/newFragmentName', fragmentName);
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* Checks for the existence of a change associated with a specific fragment name in the RTA command stack.
|
|
120
|
+
*
|
|
121
|
+
* @param {string} fragmentName - The name of the fragment to check for existing changes.
|
|
122
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if a matching change is found, otherwise `false`.
|
|
123
|
+
*/
|
|
124
|
+
checkForExistingChange: function _checkForExistingChange(fragmentName) {
|
|
125
|
+
const allCommands = this.rta.getCommandStack().getCommands();
|
|
126
|
+
return allCommands.some(command => {
|
|
127
|
+
if (typeof command.getCommands === 'function') {
|
|
128
|
+
const addXmlCommand = command.getCommands().find(c => c?.getProperty('name') === 'addXMLAtExtensionPoint');
|
|
129
|
+
return addXmlCommand && matchesFragmentName(addXmlCommand, fragmentName);
|
|
130
|
+
} else {
|
|
131
|
+
return matchesFragmentName(command, fragmentName);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* Sets custom function that fires when user presses escape key.
|
|
137
|
+
*/
|
|
138
|
+
setEscapeHandler: function _setEscapeHandler() {
|
|
139
|
+
this.dialog.setEscapeHandler(_ref => {
|
|
140
|
+
let {
|
|
141
|
+
resolve
|
|
142
|
+
} = _ref;
|
|
143
|
+
this.handleDialogClose();
|
|
144
|
+
resolve();
|
|
145
|
+
});
|
|
146
|
+
},
|
|
147
|
+
/**
|
|
148
|
+
* Handles the dialog closing and destruction of it.
|
|
149
|
+
*/
|
|
150
|
+
handleDialogClose: function _handleDialogClose() {
|
|
151
|
+
this.dialog.close();
|
|
152
|
+
this.dialog.destroy();
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* Function that handles runtime thrown errors with MessageToast
|
|
156
|
+
*
|
|
157
|
+
* @param e error instance
|
|
158
|
+
* @throws {Error}.
|
|
159
|
+
*/
|
|
160
|
+
handleError: function _handleError(e) {
|
|
161
|
+
const error = getError(e);
|
|
162
|
+
MessageToast.show(error.message, {
|
|
163
|
+
duration: 5000
|
|
164
|
+
});
|
|
165
|
+
throw error;
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* Handles the index field whenever a specific aggregation is chosen
|
|
169
|
+
*
|
|
170
|
+
* @param specialIndexAggregation string | number
|
|
171
|
+
*/
|
|
172
|
+
specialIndexHandling: function _specialIndexHandling(specialIndexAggregation) {
|
|
173
|
+
const overlay = OverlayRegistry.getOverlay(this.runtimeControl);
|
|
174
|
+
const aggregations = overlay.getDesignTimeMetadata().getData().aggregations;
|
|
175
|
+
if (specialIndexAggregation in aggregations && 'specialIndexHandling' in aggregations[specialIndexAggregation]) {
|
|
176
|
+
const controlType = this.runtimeControl.getMetadata().getName();
|
|
177
|
+
this.model.setProperty('/indexHandlingFlag', false);
|
|
178
|
+
this.model.setProperty('/specialIndexHandlingIcon', true);
|
|
179
|
+
this.model.setProperty('/iconTooltip', `Index is defined by special logic of ${controlType} and can't be set here`);
|
|
180
|
+
} else {
|
|
181
|
+
this.model.setProperty('/indexHandlingFlag', true);
|
|
182
|
+
this.model.setProperty('/specialIndexHandlingIcon', false);
|
|
183
|
+
this.model.setProperty('/specialIndexHandlingIconPressed', false);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
return BaseDialog;
|
|
188
188
|
});
|
|
189
189
|
//# sourceMappingURL=BaseDialog.controller.js.map
|