@sap-ux/preview-middleware 0.23.48 → 0.23.50
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/command-executor.js +99 -66
- package/dist/client/adp/controllers/AddCustomFragment.controller.js +120 -102
- package/dist/client/adp/controllers/AddFragment.controller.js +189 -163
- package/dist/client/adp/controllers/AddSubpage.controller.js +146 -137
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +230 -188
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -164
- package/dist/client/adp/controllers/ControllerExtension.controller.js +329 -253
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +158 -114
- package/dist/client/adp/extension-point.js +81 -60
- package/dist/client/adp/init.js +100 -99
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +165 -147
- package/dist/client/adp/quick-actions/enablement-validator.js +0 -4
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +105 -100
- package/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -40
- package/dist/client/adp/quick-actions/table-quick-action-base.js +309 -266
- package/dist/client/adp/sync-views-utils.js +119 -83
- package/dist/client/cpe/changes/flex-change.js +64 -48
- package/dist/client/cpe/changes/service.js +492 -367
- package/dist/client/cpe/communication-service.js +41 -29
- package/dist/client/cpe/connector-service.js +87 -64
- package/dist/client/cpe/context-menu-service.js +87 -74
- package/dist/client/cpe/control-data.js +353 -263
- package/dist/client/cpe/documentation.js +183 -126
- package/dist/client/cpe/init.js +69 -75
- package/dist/client/cpe/outline/service.js +60 -45
- package/dist/client/cpe/quick-actions/quick-action-definition.js +0 -4
- package/dist/client/cpe/quick-actions/quick-action-service.js +154 -129
- package/dist/client/cpe/rta-service.js +91 -69
- package/dist/client/cpe/selection.js +239 -187
- package/dist/client/cpe/types.js +0 -4
- package/dist/client/flp/init.js +403 -296
- package/dist/client/manifest.json +7 -4
- package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +444 -370
- package/dist/client/utils/info-center-message.js +59 -31
- package/dist/client/utils/version.js +128 -72
- package/package.json +4 -4
|
@@ -1,116 +1,160 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const source = event.getSource();
|
|
51
|
-
const selectedItem = source.getSelectedItem();
|
|
52
|
-
let extensionPointName = '';
|
|
53
|
-
if (selectedItem) {
|
|
54
|
-
extensionPointName = selectedItem.getText();
|
|
55
|
-
}
|
|
56
|
-
this.model.setProperty('/extensionPointName', extensionPointName);
|
|
57
|
-
const hasDefaultContent = this.hasDefaultContentForName(extensionPointName);
|
|
58
|
-
this.model.setProperty('/hasDefaultContent', hasDefaultContent);
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/model/json/JSONModel", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../../utils/error", "../../utils/info-center-message", "../api-handler", "./BaseDialog.controller"], function (JSONModel, ___sap_ux_private_control_property_editor_common, ____utils_error, ____utils_info_center_message, ___api_handler, __BaseDialog) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function _interopRequireDefault(obj) {
|
|
7
|
+
return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
|
|
8
|
+
}
|
|
9
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common["MessageBarType"];
|
|
10
|
+
const getError = ____utils_error["getError"];
|
|
11
|
+
const sendInfoCenterMessage = ____utils_info_center_message["sendInfoCenterMessage"];
|
|
12
|
+
const getFragments = ___api_handler["getFragments"];
|
|
13
|
+
const BaseDialog = _interopRequireDefault(__BaseDialog);
|
|
14
|
+
/**
|
|
15
|
+
* @namespace open.ux.preview.client.adp.controllers
|
|
16
|
+
*/
|
|
17
|
+
const ExtensionPoint = BaseDialog.extend("open.ux.preview.client.adp.controllers.ExtensionPoint", {
|
|
18
|
+
constructor: function _constructor(name, _overlays, rta, data) {
|
|
19
|
+
BaseDialog.prototype.constructor.call(this, name);
|
|
20
|
+
this.model = new JSONModel();
|
|
21
|
+
this.data = data;
|
|
22
|
+
this.rta = rta;
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* Setups the Dialog and the JSON Model
|
|
26
|
+
*
|
|
27
|
+
* @param {Dialog} dialog - Dialog instance
|
|
28
|
+
*/
|
|
29
|
+
setup: async function _setup(dialog) {
|
|
30
|
+
this.dialog = dialog;
|
|
31
|
+
this.setEscapeHandler();
|
|
32
|
+
await this.buildDialogData();
|
|
33
|
+
this.dialog.setModel(this.model);
|
|
34
|
+
this.dialog.open();
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* Handles create button press
|
|
38
|
+
*
|
|
39
|
+
* @param event Event
|
|
40
|
+
*/
|
|
41
|
+
onCreateBtnPress: async function _onCreateBtnPress(event) {
|
|
42
|
+
const source = event.getSource();
|
|
43
|
+
source.setEnabled(false);
|
|
44
|
+
await BaseDialog.prototype.onCreateBtnPressHandler.call(this);
|
|
45
|
+
const fragmentName = this.model.getProperty('/newFragmentName');
|
|
46
|
+
this.createExtensionPointFragmentChange(fragmentName);
|
|
47
|
+
await sendInfoCenterMessage({
|
|
48
|
+
title: {
|
|
49
|
+
key: 'ADP_CREATE_XML_FRAGMENT_TITLE'
|
|
59
50
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
description: {
|
|
52
|
+
key: 'ADP_CREATE_XML_FRAGMENT_DESCRIPTION',
|
|
53
|
+
params: [fragmentName]
|
|
63
54
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
55
|
+
type: MessageBarType.info
|
|
56
|
+
});
|
|
57
|
+
this.handleDialogClose();
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* Handler for extension point select control
|
|
61
|
+
*
|
|
62
|
+
* @param event Select control change event
|
|
63
|
+
*/
|
|
64
|
+
onExtensionPointHandler: function _onExtensionPointHandler(event) {
|
|
65
|
+
const source = event.getSource();
|
|
66
|
+
const selectedItem = source.getSelectedItem();
|
|
67
|
+
let extensionPointName = '';
|
|
68
|
+
if (selectedItem) {
|
|
69
|
+
extensionPointName = selectedItem.getText();
|
|
70
|
+
}
|
|
71
|
+
this.model.setProperty('/extensionPointName', extensionPointName);
|
|
72
|
+
const hasDefaultContent = this.hasDefaultContentForName(extensionPointName);
|
|
73
|
+
this.model.setProperty('/hasDefaultContent', hasDefaultContent);
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* Determines whether there is default content associated with the given name.
|
|
77
|
+
*
|
|
78
|
+
* @param {string} name - The name to check for associated default content.
|
|
79
|
+
* @returns {boolean} - True if there is non-empty default content associated with the name, false otherwise.
|
|
80
|
+
*/
|
|
81
|
+
hasDefaultContentForName: function _hasDefaultContentForName(name) {
|
|
82
|
+
const defaultContent = this.data?.info.find(v => v.name === name)?.defaultContent;
|
|
83
|
+
return defaultContent ? defaultContent.length > 0 : false;
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* Builds data that is used in the dialog
|
|
87
|
+
*/
|
|
88
|
+
buildDialogData: async function _buildDialogData() {
|
|
89
|
+
const name = this.data?.name;
|
|
90
|
+
if (name) {
|
|
91
|
+
const hasDefaultContent = this.hasDefaultContentForName(name);
|
|
92
|
+
const extensionPointList = [{
|
|
93
|
+
key: 0,
|
|
94
|
+
value: name
|
|
95
|
+
}];
|
|
96
|
+
this.updateModel(name, 0, extensionPointList, false, hasDefaultContent);
|
|
97
|
+
} else {
|
|
98
|
+
// In this case we are selecting from the application. There can be many extension points under one control.
|
|
99
|
+
const extensionPointList = this.data.info.map((v, idx) => {
|
|
100
|
+
return {
|
|
101
|
+
key: idx,
|
|
102
|
+
value: v.name
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
const firstElName = extensionPointList[0].value;
|
|
106
|
+
const enabled = extensionPointList.length > 1;
|
|
107
|
+
const hasDefaultContent = this.hasDefaultContentForName(firstElName);
|
|
108
|
+
this.updateModel(firstElName, 0, extensionPointList, enabled, hasDefaultContent);
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
const {
|
|
112
|
+
fragments
|
|
113
|
+
} = await getFragments();
|
|
114
|
+
this.model.setProperty('/fragmentList', fragments);
|
|
115
|
+
} catch (e) {
|
|
116
|
+
const error = getError(e);
|
|
117
|
+
await sendInfoCenterMessage({
|
|
118
|
+
title: {
|
|
119
|
+
key: 'ADP_EXTENSION_POINT_ERROR_TITLE'
|
|
120
|
+
},
|
|
121
|
+
description: error.message,
|
|
122
|
+
type: MessageBarType.error
|
|
123
|
+
});
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
/**
|
|
128
|
+
* Updates the Select control according to provided values
|
|
129
|
+
*
|
|
130
|
+
* @param name Extension point name
|
|
131
|
+
* @param key Selected extension point key
|
|
132
|
+
* @param list All of the extension points that are under a view
|
|
133
|
+
* @param enabled Enables the select control
|
|
134
|
+
* @param hasDefaultContent Whether there is default content associated with the extension name
|
|
135
|
+
*/
|
|
136
|
+
updateModel: function _updateModel(name, key, list, enabled, hasDefaultContent) {
|
|
137
|
+
this.model.setProperty('/extensionPointName', name);
|
|
138
|
+
this.model.setProperty('/extensionPointKey', key);
|
|
139
|
+
this.model.setProperty('/extensionPointList', list);
|
|
140
|
+
this.model.setProperty('/extensionListEnabled', enabled);
|
|
141
|
+
this.model.setProperty('/hasDefaultContent', hasDefaultContent);
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* Creates add xml at extension point changes
|
|
145
|
+
*
|
|
146
|
+
* @param fragmentName Fragment name
|
|
147
|
+
*/
|
|
148
|
+
createExtensionPointFragmentChange: function _createExtensionPointFragmentChange(fragmentName) {
|
|
149
|
+
const extensionPointName = this.model.getProperty('/extensionPointName');
|
|
150
|
+
const modifiedValue = {
|
|
151
|
+
fragment: `<core:FragmentDefinition xmlns:core='sap.ui.core'></core:FragmentDefinition>`,
|
|
152
|
+
fragmentPath: `fragments/${fragmentName}.fragment.xml`,
|
|
153
|
+
extensionPointName
|
|
154
|
+
};
|
|
155
|
+
this.data.deferred.resolve(modifiedValue);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
return ExtensionPoint;
|
|
159
|
+
});
|
|
160
|
+
//# sourceMappingURL=ExtensionPoint.controller.js.map
|
|
@@ -1,62 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const plugin = new AddXMLAtExtensionPoint({
|
|
42
|
-
commandFactory,
|
|
43
|
-
fragmentHandler: async (overlay, info) => await this.fragmentHandler(overlay, info)
|
|
44
|
-
});
|
|
45
|
-
const plugins = this.rta.getPlugins();
|
|
46
|
-
plugins.addXMLAtExtensionPoint = plugin;
|
|
47
|
-
this.rta.setPlugins(plugins);
|
|
48
|
-
}
|
|
49
|
-
async fragmentHandler(overlay, info) {
|
|
50
|
-
let deferred = createDeferred();
|
|
51
|
-
const name = this.selectedExtensionPointName;
|
|
52
|
-
await DialogFactory.createDialog(overlay, this.rta, DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT, {
|
|
53
|
-
name,
|
|
54
|
-
info,
|
|
55
|
-
deferred
|
|
56
|
-
});
|
|
57
|
-
this.selectedExtensionPointName = '';
|
|
58
|
-
return deferred.promise;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/rta/plugin/AddXMLAtExtensionPoint", "sap/ui/rta/command/CommandFactory", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "./utils", "./dialog-factory", "../cpe/communication-service"], function (AddXMLAtExtensionPoint, CommandFactory, ___sap_ux_private_control_property_editor_common, ___utils, ___dialog_factory, ___cpe_communication_service) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const addExtensionPoint = ___sap_ux_private_control_property_editor_common["addExtensionPoint"];
|
|
7
|
+
const createDeferred = ___utils["createDeferred"];
|
|
8
|
+
const DialogFactory = ___dialog_factory["DialogFactory"];
|
|
9
|
+
const DialogNames = ___dialog_factory["DialogNames"];
|
|
10
|
+
const CommunicationService = ___cpe_communication_service["CommunicationService"];
|
|
11
|
+
class ExtensionPointService {
|
|
12
|
+
actionId = 'CTX_ADDXML_AT_EXTENSIONPOINT';
|
|
13
|
+
/**
|
|
14
|
+
* @param rta Runtime Authoring
|
|
15
|
+
*/
|
|
16
|
+
constructor(rta) {
|
|
17
|
+
this.rta = rta;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Initializes communication with CPE, and the extension point plugin.
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
init() {
|
|
25
|
+
this.initPlugin();
|
|
26
|
+
CommunicationService.subscribe(async action => {
|
|
27
|
+
if (addExtensionPoint.match(action)) {
|
|
28
|
+
try {
|
|
29
|
+
const {
|
|
30
|
+
controlId,
|
|
31
|
+
name
|
|
32
|
+
} = action.payload;
|
|
33
|
+
const suffix = `--${name}`;
|
|
34
|
+
const baseControlId = controlId.endsWith(suffix) ? controlId.slice(0, -suffix.length) : controlId;
|
|
35
|
+
const service = await this.rta.getService('action');
|
|
36
|
+
service.execute(baseControlId, this.actionId);
|
|
37
|
+
this.selectedExtensionPointName = name;
|
|
38
|
+
} catch (e) {
|
|
39
|
+
throw new Error(`Failed to execute service with actionId: ${this.actionId}`);
|
|
40
|
+
}
|
|
59
41
|
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Initializes Add XML at Extension Point plugin and adds it to the default RTA plugins.
|
|
47
|
+
*/
|
|
48
|
+
initPlugin() {
|
|
49
|
+
const flexSettings = this.rta.getFlexSettings();
|
|
50
|
+
const commandFactory = new CommandFactory({
|
|
51
|
+
flexSettings
|
|
52
|
+
});
|
|
53
|
+
const plugin = new AddXMLAtExtensionPoint({
|
|
54
|
+
commandFactory,
|
|
55
|
+
fragmentHandler: async (overlay, info) => await this.fragmentHandler(overlay, info)
|
|
56
|
+
});
|
|
57
|
+
const plugins = this.rta.getPlugins();
|
|
58
|
+
plugins.addXMLAtExtensionPoint = plugin;
|
|
59
|
+
this.rta.setPlugins(plugins);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Handler function for AddXMLAtExtensionPoint plugin.
|
|
64
|
+
*
|
|
65
|
+
* @param overlay UI5 Element overlay
|
|
66
|
+
* @param info Extension point data from the plugin
|
|
67
|
+
* @returns Deferred extension point data that is provided to the plugin
|
|
68
|
+
*/
|
|
69
|
+
async fragmentHandler(overlay, info) {
|
|
70
|
+
let deferred = createDeferred();
|
|
71
|
+
const name = this.selectedExtensionPointName;
|
|
72
|
+
await DialogFactory.createDialog(overlay, this.rta, DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT, {
|
|
73
|
+
name,
|
|
74
|
+
info,
|
|
75
|
+
deferred
|
|
76
|
+
});
|
|
77
|
+
this.selectedExtensionPointName = '';
|
|
78
|
+
return deferred.promise;
|
|
60
79
|
}
|
|
61
|
-
|
|
62
|
-
|
|
80
|
+
}
|
|
81
|
+
return ExtensionPointService;
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=extension-point.js.map
|
package/dist/client/adp/init.js
CHANGED
|
@@ -1,101 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../utils/version", "../cpe/init", "./sync-views-utils", "../utils/application", "./quick-actions/load", "./init-dialogs", "../utils/info-center-message", "../cpe/communication-service"], function (log, ___sap_ux_private_control_property_editor_common, ___utils_version, __init, ___sync_views_utils, ___utils_application, ___quick_actions_load, ___init_dialogs, ___utils_info_center_message, ___cpe_communication_service) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function _interopRequireDefault(obj) {
|
|
7
|
+
return obj && obj.__esModule && typeof obj.default !== "undefined" ? obj.default : obj;
|
|
8
|
+
}
|
|
9
|
+
function __ui5_require_async(path) {
|
|
10
|
+
return new Promise(function (resolve, reject) {
|
|
11
|
+
sap.ui.require([path], function (module) {
|
|
12
|
+
if (!(module && module.__esModule)) {
|
|
13
|
+
module = module === null || !(typeof module === "object" && path.endsWith("/library")) ? {
|
|
14
|
+
default: module
|
|
15
|
+
} : module;
|
|
16
|
+
Object.defineProperty(module, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
resolve(module);
|
|
21
|
+
}, function (err) {
|
|
22
|
+
reject(err);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const enableTelemetry = ___sap_ux_private_control_property_editor_common["enableTelemetry"];
|
|
27
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common["MessageBarType"];
|
|
28
|
+
const toggleAppPreviewVisibility = ___sap_ux_private_control_property_editor_common["toggleAppPreviewVisibility"];
|
|
29
|
+
const getFullyQualifiedUi5Version = ___utils_version["getFullyQualifiedUi5Version"];
|
|
30
|
+
const getUi5Version = ___utils_version["getUi5Version"];
|
|
31
|
+
const isLowerThanMinimalUi5Version = ___utils_version["isLowerThanMinimalUi5Version"];
|
|
32
|
+
const minVersionInfo = ___utils_version["minVersionInfo"];
|
|
33
|
+
const init = _interopRequireDefault(__init);
|
|
34
|
+
const updateSyncViewsIds = ___sync_views_utils["updateSyncViewsIds"];
|
|
35
|
+
const showSyncViewsWarning = ___sync_views_utils["showSyncViewsWarning"];
|
|
36
|
+
const getApplicationType = ___utils_application["getApplicationType"];
|
|
37
|
+
const loadDefinitions = ___quick_actions_load["loadDefinitions"];
|
|
38
|
+
const initDialogs = ___init_dialogs["initDialogs"];
|
|
39
|
+
const sendInfoCenterMessage = ___utils_info_center_message["sendInfoCenterMessage"];
|
|
40
|
+
const CommunicationService = ___cpe_communication_service["CommunicationService"];
|
|
41
|
+
var __exports = async function (rta) {
|
|
42
|
+
const flexSettings = rta.getFlexSettings();
|
|
43
|
+
if (flexSettings.telemetry === true) {
|
|
44
|
+
enableTelemetry();
|
|
17
45
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
46
|
+
const ui5VersionInfo = await getUi5Version();
|
|
47
|
+
|
|
48
|
+
// Plugins need to be set before adding additional plugins to prevent overriding with the default
|
|
49
|
+
// and allow usage of getPlugins later in the flow
|
|
50
|
+
const defaultPlugins = rta.getDefaultPlugins();
|
|
51
|
+
rta.setPlugins(defaultPlugins);
|
|
52
|
+
if (isLowerThanMinimalUi5Version(ui5VersionInfo, {
|
|
53
|
+
major: 1,
|
|
54
|
+
minor: 136,
|
|
55
|
+
patch: 2
|
|
56
|
+
})) {
|
|
57
|
+
await initDialogs(rta, ui5VersionInfo);
|
|
58
|
+
} else {
|
|
59
|
+
(await __ui5_require_async('open/ux/preview/client/adp/add-fragment')).initAddXMLPlugin(rta);
|
|
60
|
+
(await __ui5_require_async('open/ux/preview/client/adp/extend-controller')).initExtendControllerPlugin(rta);
|
|
30
61
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const applicationType = getApplicationType(rta.getRootControlInstance().getManifest());
|
|
73
|
-
const quickActionRegistries = await loadDefinitions(applicationType);
|
|
74
|
-
await init(rta, quickActionRegistries);
|
|
75
|
-
rta.getService('outline').then(outlineService => {
|
|
76
|
-
outlineService.attachEvent('update', async () => {
|
|
77
|
-
await updateSyncViewsIds(ui5VersionInfo);
|
|
78
|
-
await showSyncViewsWarning();
|
|
79
|
-
});
|
|
80
|
-
}).catch(error => {
|
|
81
|
-
log.error('Failed to attach update event to outline service', error);
|
|
82
|
-
});
|
|
83
|
-
if (isLowerThanMinimalUi5Version(ui5VersionInfo)) {
|
|
84
|
-
await sendInfoCenterMessage({
|
|
85
|
-
title: { key: 'FLP_UI5_VERSION_WARNING_TITLE' },
|
|
86
|
-
description: {
|
|
87
|
-
key: 'FLP_UI5_VERSION_WARNING_DESCRIPTION',
|
|
88
|
-
params: [
|
|
89
|
-
getFullyQualifiedUi5Version(ui5VersionInfo),
|
|
90
|
-
getFullyQualifiedUi5Version(minVersionInfo)
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
type: MessageBarType.error
|
|
94
|
-
});
|
|
95
|
-
CommunicationService.sendAction(toggleAppPreviewVisibility(false));
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
log.debug('ADP init executed.');
|
|
99
|
-
};
|
|
100
|
-
return __exports;
|
|
101
|
-
});
|
|
62
|
+
if (!isLowerThanMinimalUi5Version(ui5VersionInfo, {
|
|
63
|
+
major: 1,
|
|
64
|
+
minor: 78
|
|
65
|
+
})) {
|
|
66
|
+
const ExtensionPointService = (await __ui5_require_async('open/ux/preview/client/adp/extension-point')).default;
|
|
67
|
+
const extPointService = new ExtensionPointService(rta);
|
|
68
|
+
extPointService.init();
|
|
69
|
+
}
|
|
70
|
+
const applicationType = getApplicationType(rta.getRootControlInstance().getManifest());
|
|
71
|
+
const quickActionRegistries = await loadDefinitions(applicationType);
|
|
72
|
+
await init(rta, quickActionRegistries);
|
|
73
|
+
|
|
74
|
+
// Register synchronious views detection and warning
|
|
75
|
+
// This is not awaited to prevent deadlock in the initialization
|
|
76
|
+
rta.getService('outline').then(outlineService => {
|
|
77
|
+
outlineService.attachEvent('update', async () => {
|
|
78
|
+
await updateSyncViewsIds(ui5VersionInfo);
|
|
79
|
+
await showSyncViewsWarning();
|
|
80
|
+
});
|
|
81
|
+
}).catch(error => {
|
|
82
|
+
log.error('Failed to attach update event to outline service', error);
|
|
83
|
+
});
|
|
84
|
+
if (isLowerThanMinimalUi5Version(ui5VersionInfo)) {
|
|
85
|
+
await sendInfoCenterMessage({
|
|
86
|
+
title: {
|
|
87
|
+
key: 'FLP_UI5_VERSION_WARNING_TITLE'
|
|
88
|
+
},
|
|
89
|
+
description: {
|
|
90
|
+
key: 'FLP_UI5_VERSION_WARNING_DESCRIPTION',
|
|
91
|
+
params: [getFullyQualifiedUi5Version(ui5VersionInfo), getFullyQualifiedUi5Version(minVersionInfo)]
|
|
92
|
+
},
|
|
93
|
+
type: MessageBarType.error
|
|
94
|
+
});
|
|
95
|
+
CommunicationService.sendAction(toggleAppPreviewVisibility(false));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
log.debug('ADP init executed.');
|
|
99
|
+
};
|
|
100
|
+
return __exports;
|
|
101
|
+
});
|
|
102
|
+
//# sourceMappingURL=init.js.map
|