@sap-ux/preview-middleware 0.19.23 → 0.19.25
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/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/ControllerExtension.controller.js +210 -210
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +139 -139
- package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
- package/dist/client/adp/dialog-factory.js +135 -135
- package/dist/client/adp/init-dialogs.js +138 -138
- package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +96 -96
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +60 -60
- package/dist/client/adp/quick-actions/common/create-page-action.js +54 -54
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +39 -39
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +67 -67
- package/dist/client/adp/quick-actions/common/utils.js +18 -18
- package/dist/client/adp/quick-actions/control-types.js +23 -23
- 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/add-new-subpage.js +81 -81
- package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +67 -67
- 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 +107 -107
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +99 -99
- 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 +77 -77
- package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
- package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +138 -138
- package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +79 -79
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +75 -75
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +53 -53
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +49 -49
- 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 +84 -84
- 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 +60 -60
- package/dist/client/adp/quick-actions/fe-v4/utils.js +72 -72
- package/dist/client/adp/quick-actions/load.js +44 -44
- package/dist/client/adp/quick-actions/quick-action-base.js +64 -64
- package/dist/client/adp/utils.js +218 -218
- 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 +203 -203
- 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 +111 -111
- 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/homepage/Component.js +14 -14
- package/dist/client/flp/initCdm.js +117 -117
- package/dist/client/flp/initConnectors.js +28 -28
- 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 +84 -84
- package/dist/client/utils/error.js +19 -19
- package/dist/client/utils/fe-v2.js +56 -56
- package/dist/client/utils/fe-v4.js +140 -140
- package/dist/client/utils/version.js +104 -104
- package/package.json +2 -2
|
@@ -1,141 +1,141 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/model/json/JSONModel", "../api-handler", "./BaseDialog.controller", "../utils"], function (JSONModel, ___api_handler, __BaseDialog, ___utils) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
function _interopRequireDefault(obj) {
|
|
7
|
-
return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
|
|
8
|
-
}
|
|
9
|
-
const getFragments = ___api_handler["getFragments"];
|
|
10
|
-
const BaseDialog = _interopRequireDefault(__BaseDialog);
|
|
11
|
-
const notifyUser = ___utils["notifyUser"];
|
|
12
|
-
/**
|
|
13
|
-
* @namespace open.ux.preview.client.adp.controllers
|
|
14
|
-
*/
|
|
15
|
-
const ExtensionPoint = BaseDialog.extend("open.ux.preview.client.adp.controllers.ExtensionPoint", {
|
|
16
|
-
constructor: function _constructor(name, _overlays, rta, data) {
|
|
17
|
-
BaseDialog.prototype.constructor.call(this, name);
|
|
18
|
-
this.model = new JSONModel();
|
|
19
|
-
this.data = data;
|
|
20
|
-
this.rta = rta;
|
|
21
|
-
},
|
|
22
|
-
/**
|
|
23
|
-
* Setups the Dialog and the JSON Model
|
|
24
|
-
*
|
|
25
|
-
* @param {Dialog} dialog - Dialog instance
|
|
26
|
-
*/
|
|
27
|
-
setup: async function _setup(dialog) {
|
|
28
|
-
this.dialog = dialog;
|
|
29
|
-
this.setEscapeHandler();
|
|
30
|
-
await this.buildDialogData();
|
|
31
|
-
this.dialog.setModel(this.model);
|
|
32
|
-
this.dialog.open();
|
|
33
|
-
},
|
|
34
|
-
/**
|
|
35
|
-
* Handles create button press
|
|
36
|
-
*
|
|
37
|
-
* @param event Event
|
|
38
|
-
*/
|
|
39
|
-
onCreateBtnPress: async function _onCreateBtnPress(event) {
|
|
40
|
-
const source = event.getSource();
|
|
41
|
-
source.setEnabled(false);
|
|
42
|
-
await BaseDialog.prototype.onCreateBtnPressHandler.call(this);
|
|
43
|
-
const fragmentName = this.model.getProperty('/newFragmentName');
|
|
44
|
-
this.createExtensionPointFragmentChange(fragmentName);
|
|
45
|
-
notifyUser(`Note: The '${fragmentName}.fragment.xml' fragment will be created once you save the change.`, 8000);
|
|
46
|
-
this.handleDialogClose();
|
|
47
|
-
},
|
|
48
|
-
/**
|
|
49
|
-
* Handler for extension point select control
|
|
50
|
-
*
|
|
51
|
-
* @param event Select control change event
|
|
52
|
-
*/
|
|
53
|
-
onExtensionPointHandler: function _onExtensionPointHandler(event) {
|
|
54
|
-
const source = event.getSource();
|
|
55
|
-
const selectedItem = source.getSelectedItem();
|
|
56
|
-
let extensionPointName = '';
|
|
57
|
-
if (selectedItem) {
|
|
58
|
-
extensionPointName = selectedItem.getText();
|
|
59
|
-
}
|
|
60
|
-
this.model.setProperty('/extensionPointName', extensionPointName);
|
|
61
|
-
const hasDefaultContent = this.hasDefaultContentForName(extensionPointName);
|
|
62
|
-
this.model.setProperty('/hasDefaultContent', hasDefaultContent);
|
|
63
|
-
},
|
|
64
|
-
/**
|
|
65
|
-
* Determines whether there is default content associated with the given name.
|
|
66
|
-
*
|
|
67
|
-
* @param {string} name - The name to check for associated default content.
|
|
68
|
-
* @returns {boolean} - True if there is non-empty default content associated with the name, false otherwise.
|
|
69
|
-
*/
|
|
70
|
-
hasDefaultContentForName: function _hasDefaultContentForName(name) {
|
|
71
|
-
const defaultContent = this.data?.info.find(v => v.name === name)?.defaultContent;
|
|
72
|
-
return defaultContent ? defaultContent.length > 0 : false;
|
|
73
|
-
},
|
|
74
|
-
/**
|
|
75
|
-
* Builds data that is used in the dialog
|
|
76
|
-
*/
|
|
77
|
-
buildDialogData: async function _buildDialogData() {
|
|
78
|
-
const name = this.data?.name;
|
|
79
|
-
if (name) {
|
|
80
|
-
const hasDefaultContent = this.hasDefaultContentForName(name);
|
|
81
|
-
const extensionPointList = [{
|
|
82
|
-
key: 0,
|
|
83
|
-
value: name
|
|
84
|
-
}];
|
|
85
|
-
this.updateModel(name, 0, extensionPointList, false, hasDefaultContent);
|
|
86
|
-
} else {
|
|
87
|
-
// In this case we are selecting from the application. There can be many extension points under one control.
|
|
88
|
-
const extensionPointList = this.data.info.map((v, idx) => {
|
|
89
|
-
return {
|
|
90
|
-
key: idx,
|
|
91
|
-
value: v.name
|
|
92
|
-
};
|
|
93
|
-
});
|
|
94
|
-
const firstElName = extensionPointList[0].value;
|
|
95
|
-
const enabled = extensionPointList.length > 1;
|
|
96
|
-
const hasDefaultContent = this.hasDefaultContentForName(firstElName);
|
|
97
|
-
this.updateModel(firstElName, 0, extensionPointList, enabled, hasDefaultContent);
|
|
98
|
-
}
|
|
99
|
-
try {
|
|
100
|
-
const {
|
|
101
|
-
fragments
|
|
102
|
-
} = await getFragments();
|
|
103
|
-
this.model.setProperty('/fragmentList', fragments);
|
|
104
|
-
} catch (e) {
|
|
105
|
-
this.handleError(e);
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
/**
|
|
109
|
-
* Updates the Select control according to provided values
|
|
110
|
-
*
|
|
111
|
-
* @param name Extension point name
|
|
112
|
-
* @param key Selected extension point key
|
|
113
|
-
* @param list All of the extension points that are under a view
|
|
114
|
-
* @param enabled Enables the select control
|
|
115
|
-
* @param hasDefaultContent Whether there is default content associated with the extension name
|
|
116
|
-
*/
|
|
117
|
-
updateModel: function _updateModel(name, key, list, enabled, hasDefaultContent) {
|
|
118
|
-
this.model.setProperty('/extensionPointName', name);
|
|
119
|
-
this.model.setProperty('/extensionPointKey', key);
|
|
120
|
-
this.model.setProperty('/extensionPointList', list);
|
|
121
|
-
this.model.setProperty('/extensionListEnabled', enabled);
|
|
122
|
-
this.model.setProperty('/hasDefaultContent', hasDefaultContent);
|
|
123
|
-
},
|
|
124
|
-
/**
|
|
125
|
-
* Creates add xml at extension point changes
|
|
126
|
-
*
|
|
127
|
-
* @param fragmentName Fragment name
|
|
128
|
-
*/
|
|
129
|
-
createExtensionPointFragmentChange: function _createExtensionPointFragmentChange(fragmentName) {
|
|
130
|
-
const extensionPointName = this.model.getProperty('/extensionPointName');
|
|
131
|
-
const modifiedValue = {
|
|
132
|
-
fragment: `<core:FragmentDefinition xmlns:core='sap.ui.core'></core:FragmentDefinition>`,
|
|
133
|
-
fragmentPath: `fragments/${fragmentName}.fragment.xml`,
|
|
134
|
-
extensionPointName
|
|
135
|
-
};
|
|
136
|
-
this.data.deferred.resolve(modifiedValue);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
return ExtensionPoint;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/model/json/JSONModel", "../api-handler", "./BaseDialog.controller", "../utils"], function (JSONModel, ___api_handler, __BaseDialog, ___utils) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function _interopRequireDefault(obj) {
|
|
7
|
+
return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
|
|
8
|
+
}
|
|
9
|
+
const getFragments = ___api_handler["getFragments"];
|
|
10
|
+
const BaseDialog = _interopRequireDefault(__BaseDialog);
|
|
11
|
+
const notifyUser = ___utils["notifyUser"];
|
|
12
|
+
/**
|
|
13
|
+
* @namespace open.ux.preview.client.adp.controllers
|
|
14
|
+
*/
|
|
15
|
+
const ExtensionPoint = BaseDialog.extend("open.ux.preview.client.adp.controllers.ExtensionPoint", {
|
|
16
|
+
constructor: function _constructor(name, _overlays, rta, data) {
|
|
17
|
+
BaseDialog.prototype.constructor.call(this, name);
|
|
18
|
+
this.model = new JSONModel();
|
|
19
|
+
this.data = data;
|
|
20
|
+
this.rta = rta;
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* Setups the Dialog and the JSON Model
|
|
24
|
+
*
|
|
25
|
+
* @param {Dialog} dialog - Dialog instance
|
|
26
|
+
*/
|
|
27
|
+
setup: async function _setup(dialog) {
|
|
28
|
+
this.dialog = dialog;
|
|
29
|
+
this.setEscapeHandler();
|
|
30
|
+
await this.buildDialogData();
|
|
31
|
+
this.dialog.setModel(this.model);
|
|
32
|
+
this.dialog.open();
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* Handles create button press
|
|
36
|
+
*
|
|
37
|
+
* @param event Event
|
|
38
|
+
*/
|
|
39
|
+
onCreateBtnPress: async function _onCreateBtnPress(event) {
|
|
40
|
+
const source = event.getSource();
|
|
41
|
+
source.setEnabled(false);
|
|
42
|
+
await BaseDialog.prototype.onCreateBtnPressHandler.call(this);
|
|
43
|
+
const fragmentName = this.model.getProperty('/newFragmentName');
|
|
44
|
+
this.createExtensionPointFragmentChange(fragmentName);
|
|
45
|
+
notifyUser(`Note: The '${fragmentName}.fragment.xml' fragment will be created once you save the change.`, 8000);
|
|
46
|
+
this.handleDialogClose();
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Handler for extension point select control
|
|
50
|
+
*
|
|
51
|
+
* @param event Select control change event
|
|
52
|
+
*/
|
|
53
|
+
onExtensionPointHandler: function _onExtensionPointHandler(event) {
|
|
54
|
+
const source = event.getSource();
|
|
55
|
+
const selectedItem = source.getSelectedItem();
|
|
56
|
+
let extensionPointName = '';
|
|
57
|
+
if (selectedItem) {
|
|
58
|
+
extensionPointName = selectedItem.getText();
|
|
59
|
+
}
|
|
60
|
+
this.model.setProperty('/extensionPointName', extensionPointName);
|
|
61
|
+
const hasDefaultContent = this.hasDefaultContentForName(extensionPointName);
|
|
62
|
+
this.model.setProperty('/hasDefaultContent', hasDefaultContent);
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* Determines whether there is default content associated with the given name.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} name - The name to check for associated default content.
|
|
68
|
+
* @returns {boolean} - True if there is non-empty default content associated with the name, false otherwise.
|
|
69
|
+
*/
|
|
70
|
+
hasDefaultContentForName: function _hasDefaultContentForName(name) {
|
|
71
|
+
const defaultContent = this.data?.info.find(v => v.name === name)?.defaultContent;
|
|
72
|
+
return defaultContent ? defaultContent.length > 0 : false;
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* Builds data that is used in the dialog
|
|
76
|
+
*/
|
|
77
|
+
buildDialogData: async function _buildDialogData() {
|
|
78
|
+
const name = this.data?.name;
|
|
79
|
+
if (name) {
|
|
80
|
+
const hasDefaultContent = this.hasDefaultContentForName(name);
|
|
81
|
+
const extensionPointList = [{
|
|
82
|
+
key: 0,
|
|
83
|
+
value: name
|
|
84
|
+
}];
|
|
85
|
+
this.updateModel(name, 0, extensionPointList, false, hasDefaultContent);
|
|
86
|
+
} else {
|
|
87
|
+
// In this case we are selecting from the application. There can be many extension points under one control.
|
|
88
|
+
const extensionPointList = this.data.info.map((v, idx) => {
|
|
89
|
+
return {
|
|
90
|
+
key: idx,
|
|
91
|
+
value: v.name
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
const firstElName = extensionPointList[0].value;
|
|
95
|
+
const enabled = extensionPointList.length > 1;
|
|
96
|
+
const hasDefaultContent = this.hasDefaultContentForName(firstElName);
|
|
97
|
+
this.updateModel(firstElName, 0, extensionPointList, enabled, hasDefaultContent);
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
const {
|
|
101
|
+
fragments
|
|
102
|
+
} = await getFragments();
|
|
103
|
+
this.model.setProperty('/fragmentList', fragments);
|
|
104
|
+
} catch (e) {
|
|
105
|
+
this.handleError(e);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Updates the Select control according to provided values
|
|
110
|
+
*
|
|
111
|
+
* @param name Extension point name
|
|
112
|
+
* @param key Selected extension point key
|
|
113
|
+
* @param list All of the extension points that are under a view
|
|
114
|
+
* @param enabled Enables the select control
|
|
115
|
+
* @param hasDefaultContent Whether there is default content associated with the extension name
|
|
116
|
+
*/
|
|
117
|
+
updateModel: function _updateModel(name, key, list, enabled, hasDefaultContent) {
|
|
118
|
+
this.model.setProperty('/extensionPointName', name);
|
|
119
|
+
this.model.setProperty('/extensionPointKey', key);
|
|
120
|
+
this.model.setProperty('/extensionPointList', list);
|
|
121
|
+
this.model.setProperty('/extensionListEnabled', enabled);
|
|
122
|
+
this.model.setProperty('/hasDefaultContent', hasDefaultContent);
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* Creates add xml at extension point changes
|
|
126
|
+
*
|
|
127
|
+
* @param fragmentName Fragment name
|
|
128
|
+
*/
|
|
129
|
+
createExtensionPointFragmentChange: function _createExtensionPointFragmentChange(fragmentName) {
|
|
130
|
+
const extensionPointName = this.model.getProperty('/extensionPointName');
|
|
131
|
+
const modifiedValue = {
|
|
132
|
+
fragment: `<core:FragmentDefinition xmlns:core='sap.ui.core'></core:FragmentDefinition>`,
|
|
133
|
+
fragmentPath: `fragments/${fragmentName}.fragment.xml`,
|
|
134
|
+
extensionPointName
|
|
135
|
+
};
|
|
136
|
+
this.data.deferred.resolve(modifiedValue);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
return ExtensionPoint;
|
|
140
140
|
});
|
|
141
141
|
//# sourceMappingURL=ExtensionPoint.controller.js.map
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/model/json/JSONModel", "./BaseDialog.controller", "../../i18n"], function (JSONModel, __BaseDialog, ____i18n) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
function _interopRequireDefault(obj) {
|
|
7
|
-
return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
|
|
8
|
-
}
|
|
9
|
-
const BaseDialog = _interopRequireDefault(__BaseDialog);
|
|
10
|
-
const getResourceModel = ____i18n["getResourceModel"];
|
|
11
|
-
/**
|
|
12
|
-
* @namespace open.ux.preview.client.adp.controllers
|
|
13
|
-
*/
|
|
14
|
-
const FileExistsDialog = BaseDialog.extend("open.ux.preview.client.adp.controllers.FileExistsDialog", {
|
|
15
|
-
constructor: function _constructor(name, options) {
|
|
16
|
-
BaseDialog.prototype.constructor.call(this, name);
|
|
17
|
-
this.model = new JSONModel();
|
|
18
|
-
this.options = options;
|
|
19
|
-
},
|
|
20
|
-
/**
|
|
21
|
-
* Setups the Dialog and the JSON Model
|
|
22
|
-
*
|
|
23
|
-
* @param {Dialog} dialog - Dialog instance
|
|
24
|
-
*/
|
|
25
|
-
setup: async function _setup(dialog) {
|
|
26
|
-
this.dialog = dialog;
|
|
27
|
-
this.setEscapeHandler();
|
|
28
|
-
this.model.setProperty('/filePath', this.options.filePath);
|
|
29
|
-
this.model.setProperty('/filePathFromRoot', this.options.fileName);
|
|
30
|
-
this.model.setProperty('/isRunningInBAS', this.options.isRunningInBAS);
|
|
31
|
-
this.buildDialogData();
|
|
32
|
-
const resourceModel = await getResourceModel();
|
|
33
|
-
this.dialog.setModel(this.model);
|
|
34
|
-
this.dialog.setModel(resourceModel, 'i18n');
|
|
35
|
-
this.dialog.open();
|
|
36
|
-
},
|
|
37
|
-
/**
|
|
38
|
-
* Handles create button press
|
|
39
|
-
*
|
|
40
|
-
* @param _event Event
|
|
41
|
-
*/
|
|
42
|
-
onShowFileInVscodeBtn: function _onShowFileInVscodeBtn(_event) {
|
|
43
|
-
const annotationPath = this.model.getProperty('/filePath');
|
|
44
|
-
window.open(`vscode://file${annotationPath}`);
|
|
45
|
-
this.handleDialogClose();
|
|
46
|
-
},
|
|
47
|
-
/**
|
|
48
|
-
* Builds data that is used in the dialog.
|
|
49
|
-
*/
|
|
50
|
-
buildDialogData: function _buildDialogData() {
|
|
51
|
-
const content = this.dialog.getContent();
|
|
52
|
-
const messageForm = content[0];
|
|
53
|
-
messageForm.setVisible(true);
|
|
54
|
-
const isRunningInBAS = this.model.getProperty('/isRunningInBAS');
|
|
55
|
-
if (isRunningInBAS) {
|
|
56
|
-
this.dialog.getBeginButton().setVisible(false);
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* Handles create button press
|
|
61
|
-
*
|
|
62
|
-
* @param _event Event
|
|
63
|
-
*/
|
|
64
|
-
onCreateBtnPress: function _onCreateBtnPress(_event) {}
|
|
65
|
-
});
|
|
66
|
-
return FileExistsDialog;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/model/json/JSONModel", "./BaseDialog.controller", "../../i18n"], function (JSONModel, __BaseDialog, ____i18n) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function _interopRequireDefault(obj) {
|
|
7
|
+
return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
|
|
8
|
+
}
|
|
9
|
+
const BaseDialog = _interopRequireDefault(__BaseDialog);
|
|
10
|
+
const getResourceModel = ____i18n["getResourceModel"];
|
|
11
|
+
/**
|
|
12
|
+
* @namespace open.ux.preview.client.adp.controllers
|
|
13
|
+
*/
|
|
14
|
+
const FileExistsDialog = BaseDialog.extend("open.ux.preview.client.adp.controllers.FileExistsDialog", {
|
|
15
|
+
constructor: function _constructor(name, options) {
|
|
16
|
+
BaseDialog.prototype.constructor.call(this, name);
|
|
17
|
+
this.model = new JSONModel();
|
|
18
|
+
this.options = options;
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* Setups the Dialog and the JSON Model
|
|
22
|
+
*
|
|
23
|
+
* @param {Dialog} dialog - Dialog instance
|
|
24
|
+
*/
|
|
25
|
+
setup: async function _setup(dialog) {
|
|
26
|
+
this.dialog = dialog;
|
|
27
|
+
this.setEscapeHandler();
|
|
28
|
+
this.model.setProperty('/filePath', this.options.filePath);
|
|
29
|
+
this.model.setProperty('/filePathFromRoot', this.options.fileName);
|
|
30
|
+
this.model.setProperty('/isRunningInBAS', this.options.isRunningInBAS);
|
|
31
|
+
this.buildDialogData();
|
|
32
|
+
const resourceModel = await getResourceModel();
|
|
33
|
+
this.dialog.setModel(this.model);
|
|
34
|
+
this.dialog.setModel(resourceModel, 'i18n');
|
|
35
|
+
this.dialog.open();
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Handles create button press
|
|
39
|
+
*
|
|
40
|
+
* @param _event Event
|
|
41
|
+
*/
|
|
42
|
+
onShowFileInVscodeBtn: function _onShowFileInVscodeBtn(_event) {
|
|
43
|
+
const annotationPath = this.model.getProperty('/filePath');
|
|
44
|
+
window.open(`vscode://file${annotationPath}`);
|
|
45
|
+
this.handleDialogClose();
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Builds data that is used in the dialog.
|
|
49
|
+
*/
|
|
50
|
+
buildDialogData: function _buildDialogData() {
|
|
51
|
+
const content = this.dialog.getContent();
|
|
52
|
+
const messageForm = content[0];
|
|
53
|
+
messageForm.setVisible(true);
|
|
54
|
+
const isRunningInBAS = this.model.getProperty('/isRunningInBAS');
|
|
55
|
+
if (isRunningInBAS) {
|
|
56
|
+
this.dialog.getBeginButton().setVisible(false);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* Handles create button press
|
|
61
|
+
*
|
|
62
|
+
* @param _event Event
|
|
63
|
+
*/
|
|
64
|
+
onCreateBtnPress: function _onCreateBtnPress(_event) {}
|
|
65
|
+
});
|
|
66
|
+
return FileExistsDialog;
|
|
67
67
|
});
|
|
68
68
|
//# sourceMappingURL=FileExistsDialog.controller.js.map
|