@openui5/sap.ui.rta 1.120.6 → 1.121.0
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/.reuse/dep5 +23 -21
- package/THIRDPARTY.txt +6 -43
- package/package.json +6 -6
- package/src/sap/ui/rta/.library +1 -1
- package/src/sap/ui/rta/Client.js +1 -1
- package/src/sap/ui/rta/RuntimeAuthoring.js +507 -759
- package/src/sap/ui/rta/Utils.js +1 -146
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +3 -3
- package/src/sap/ui/rta/appVariant/Utils.js +3 -3
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +5 -3
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_bg.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saprigi.properties +27 -27
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_et.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fi.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_kk.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_lv.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_mk.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ru.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_th.properties +1 -1
- package/src/sap/ui/rta/command/AddIFrame.js +1 -1
- package/src/sap/ui/rta/command/AddProperty.js +1 -1
- package/src/sap/ui/rta/command/AddXML.js +1 -1
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +3 -3
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
- package/src/sap/ui/rta/command/BaseCommand.js +1 -1
- package/src/sap/ui/rta/command/BindProperty.js +1 -1
- package/src/sap/ui/rta/command/Combine.js +1 -1
- package/src/sap/ui/rta/command/CommandFactory.js +1 -1
- package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +7 -5
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +10 -4
- package/src/sap/ui/rta/command/CreateContainer.js +1 -1
- package/src/sap/ui/rta/command/CustomAdd.js +1 -1
- package/src/sap/ui/rta/command/FlexCommand.js +1 -1
- package/src/sap/ui/rta/command/LREPSerializer.js +4 -3
- package/src/sap/ui/rta/command/LocalReset.js +1 -1
- package/src/sap/ui/rta/command/Move.js +1 -1
- package/src/sap/ui/rta/command/Property.js +1 -1
- package/src/sap/ui/rta/command/Remove.js +1 -1
- package/src/sap/ui/rta/command/Rename.js +1 -1
- package/src/sap/ui/rta/command/Resize.js +1 -1
- package/src/sap/ui/rta/command/Reveal.js +1 -1
- package/src/sap/ui/rta/command/Settings.js +1 -1
- package/src/sap/ui/rta/command/Split.js +1 -1
- package/src/sap/ui/rta/command/Stack.js +23 -1
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
- package/src/sap/ui/rta/enablement/elementActionTest.js +180 -258
- package/src/sap/ui/rta/library.js +3 -2
- package/src/sap/ui/rta/messagebundle.properties +8 -0
- package/src/sap/ui/rta/messagebundle_ar.properties +4 -0
- package/src/sap/ui/rta/messagebundle_bg.properties +5 -1
- package/src/sap/ui/rta/messagebundle_ca.properties +4 -0
- package/src/sap/ui/rta/messagebundle_cnr.properties +5 -1
- package/src/sap/ui/rta/messagebundle_cs.properties +4 -0
- package/src/sap/ui/rta/messagebundle_cy.properties +8 -4
- package/src/sap/ui/rta/messagebundle_da.properties +4 -0
- package/src/sap/ui/rta/messagebundle_de.properties +5 -1
- package/src/sap/ui/rta/messagebundle_el.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en_GB.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +322 -318
- package/src/sap/ui/rta/messagebundle_es.properties +4 -0
- package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -1
- package/src/sap/ui/rta/messagebundle_et.properties +6 -2
- package/src/sap/ui/rta/messagebundle_fi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_fr.properties +5 -1
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +4 -0
- package/src/sap/ui/rta/messagebundle_hi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_hr.properties +6 -2
- package/src/sap/ui/rta/messagebundle_hu.properties +4 -0
- package/src/sap/ui/rta/messagebundle_id.properties +5 -1
- package/src/sap/ui/rta/messagebundle_it.properties +10 -6
- package/src/sap/ui/rta/messagebundle_iw.properties +9 -5
- package/src/sap/ui/rta/messagebundle_ja.properties +4 -0
- package/src/sap/ui/rta/messagebundle_kk.properties +4 -0
- package/src/sap/ui/rta/messagebundle_ko.properties +4 -0
- package/src/sap/ui/rta/messagebundle_lt.properties +5 -1
- package/src/sap/ui/rta/messagebundle_lv.properties +11 -7
- package/src/sap/ui/rta/messagebundle_mk.properties +15 -11
- package/src/sap/ui/rta/messagebundle_ms.properties +5 -1
- package/src/sap/ui/rta/messagebundle_nl.properties +4 -0
- package/src/sap/ui/rta/messagebundle_no.properties +4 -0
- package/src/sap/ui/rta/messagebundle_pl.properties +5 -1
- package/src/sap/ui/rta/messagebundle_pt.properties +4 -0
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +4 -0
- package/src/sap/ui/rta/messagebundle_ro.properties +8 -4
- package/src/sap/ui/rta/messagebundle_ru.properties +5 -1
- package/src/sap/ui/rta/messagebundle_sh.properties +5 -1
- package/src/sap/ui/rta/messagebundle_sk.properties +4 -0
- package/src/sap/ui/rta/messagebundle_sl.properties +7 -3
- package/src/sap/ui/rta/messagebundle_sr.properties +6 -2
- package/src/sap/ui/rta/messagebundle_sv.properties +4 -0
- package/src/sap/ui/rta/messagebundle_th.properties +9 -5
- package/src/sap/ui/rta/messagebundle_tr.properties +7 -3
- package/src/sap/ui/rta/messagebundle_uk.properties +5 -1
- package/src/sap/ui/rta/messagebundle_vi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -1
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +6 -2
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +16 -11
- package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
- package/src/sap/ui/rta/plugin/Combine.js +1 -1
- package/src/sap/ui/rta/plugin/CompVariant.js +43 -1
- package/src/sap/ui/rta/plugin/ControlVariant.js +3 -2
- package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
- package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
- package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
- package/src/sap/ui/rta/plugin/EasyAdd.js +2 -2
- package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
- package/src/sap/ui/rta/plugin/Plugin.js +18 -10
- package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
- package/src/sap/ui/rta/plugin/Remove.js +1 -1
- package/src/sap/ui/rta/plugin/Rename.js +1 -1
- package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
- package/src/sap/ui/rta/plugin/Resize.js +1 -1
- package/src/sap/ui/rta/plugin/Selection.js +24 -9
- package/src/sap/ui/rta/plugin/Settings.js +17 -15
- package/src/sap/ui/rta/plugin/Split.js +1 -1
- package/src/sap/ui/rta/plugin/Stretch.js +14 -13
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +134 -67
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +6 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +57 -47
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +21 -8
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +56 -41
- package/src/sap/ui/rta/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
- package/src/sap/ui/rta/service/Outline.js +22 -18
- package/src/sap/ui/rta/service/Property.js +1 -1
- package/src/sap/ui/rta/service/Selection.js +1 -1
- package/src/sap/ui/rta/service/SupportTools.js +23 -19
- package/src/sap/ui/rta/toolbar/Adaptation.js +16 -18
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
- package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
- package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
- package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +12 -5
- package/src/sap/ui/rta/util/PluginManager.js +1 -1
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- package/src/sap/ui/rta/util/ReloadManager.js +19 -59
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/ServiceManager.js +193 -0
- package/src/sap/ui/rta/util/adaptationStarter.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +90 -45
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +32 -25
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +98 -132
- package/LICENSES/BSD-2-Clause.txt +0 -22
|
@@ -28,7 +28,7 @@ sap.ui.define([
|
|
|
28
28
|
* @name sap.ui.rta.service.SupportTools
|
|
29
29
|
* @author SAP SE
|
|
30
30
|
* @since 1.106
|
|
31
|
-
* @version 1.
|
|
31
|
+
* @version 1.121.0
|
|
32
32
|
* @private
|
|
33
33
|
* @ui5-restricted
|
|
34
34
|
*/
|
|
@@ -99,11 +99,12 @@ sap.ui.define([
|
|
|
99
99
|
* @param {sap.ui.rta.RuntimeAuthoring} oRta - Instance of the RuntimeAuthoring class
|
|
100
100
|
* @param {object} mPayload - Property Bag
|
|
101
101
|
* @param {string} mPayload.overlayId
|
|
102
|
+
* @returns {Promise<object|null>} Resolves with the overlay info
|
|
102
103
|
*/
|
|
103
|
-
function getOverlayInfo(oRta, mPayload) {
|
|
104
|
+
async function getOverlayInfo(oRta, mPayload) {
|
|
104
105
|
var oOverlay = Element.getElementById(mPayload.overlayId);
|
|
105
106
|
if (!oOverlay) {
|
|
106
|
-
return;
|
|
107
|
+
return null;
|
|
107
108
|
}
|
|
108
109
|
var oElement = oOverlay.getElement();
|
|
109
110
|
|
|
@@ -112,27 +113,30 @@ sap.ui.define([
|
|
|
112
113
|
removeSelectionHighlight();
|
|
113
114
|
}
|
|
114
115
|
|
|
115
|
-
|
|
116
|
+
const mEditableByPlugins = oOverlay.getEditableByPlugins();
|
|
117
|
+
const aEditableByPlugins = Object.keys(mEditableByPlugins)
|
|
118
|
+
.filter(function(sPluginName) {
|
|
119
|
+
return mEditableByPlugins[sPluginName];
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const aPlugins = await Promise.all(aEditableByPlugins.map(async function(sPluginName) {
|
|
116
123
|
var oInstance = getPluginByName(oRta, sPluginName);
|
|
117
124
|
var bIsSibling = isPluginForSibling(sPluginName);
|
|
118
125
|
|
|
119
|
-
|
|
120
|
-
.then(function(oChangeHandler) {
|
|
121
|
-
return {
|
|
122
|
-
name: sPluginName,
|
|
123
|
-
isAvailable: oInstance.isAvailable([oOverlay], bIsSibling),
|
|
124
|
-
hasChangeHandler: !!oChangeHandler
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
}))
|
|
128
|
-
.then(function(aPlugins) {
|
|
126
|
+
const oChangeHandler = await getPluginChangeHandler(oInstance, oOverlay, oRta);
|
|
129
127
|
return {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
plugins: aPlugins
|
|
128
|
+
name: sPluginName,
|
|
129
|
+
isAvailable: oInstance.isAvailable([oOverlay], bIsSibling),
|
|
130
|
+
hasChangeHandler: !!oChangeHandler
|
|
134
131
|
};
|
|
135
|
-
});
|
|
132
|
+
}));
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
elementId: oElement.getId(),
|
|
136
|
+
elementControlType: oElement.getMetadata().getName(),
|
|
137
|
+
overlayId: oOverlay.getId(),
|
|
138
|
+
plugins: aPlugins
|
|
139
|
+
};
|
|
136
140
|
}
|
|
137
141
|
|
|
138
142
|
/*
|
|
@@ -23,8 +23,7 @@ sap.ui.define([
|
|
|
23
23
|
"sap/ui/rta/toolbar/contextBased/SaveAsAdaptation",
|
|
24
24
|
"sap/ui/rta/toolbar/translation/Translation",
|
|
25
25
|
"sap/ui/rta/toolbar/versioning/Versioning",
|
|
26
|
-
"sap/ui/rta/Utils"
|
|
27
|
-
"sap/ui/VersionInfo"
|
|
26
|
+
"sap/ui/rta/Utils"
|
|
28
27
|
], function(
|
|
29
28
|
AdaptationRenderer,
|
|
30
29
|
Log,
|
|
@@ -44,8 +43,7 @@ sap.ui.define([
|
|
|
44
43
|
SaveAsAdaptation,
|
|
45
44
|
Translation,
|
|
46
45
|
Versioning,
|
|
47
|
-
Utils
|
|
48
|
-
VersionInfo
|
|
46
|
+
Utils
|
|
49
47
|
) {
|
|
50
48
|
"use strict";
|
|
51
49
|
|
|
@@ -57,7 +55,7 @@ sap.ui.define([
|
|
|
57
55
|
* @extends sap.ui.rta.toolbar.Base
|
|
58
56
|
*
|
|
59
57
|
* @author SAP SE
|
|
60
|
-
* @version 1.
|
|
58
|
+
* @version 1.121.0
|
|
61
59
|
*
|
|
62
60
|
* @constructor
|
|
63
61
|
* @private
|
|
@@ -498,17 +496,19 @@ sap.ui.define([
|
|
|
498
496
|
};
|
|
499
497
|
|
|
500
498
|
Adaptation.prototype.showFeedbackForm = async function() {
|
|
501
|
-
// Get Connector Type
|
|
502
|
-
var sConnector = FlexRuntimeInfoAPI.getConfiguredFlexServices()[0].connector;
|
|
503
|
-
|
|
504
499
|
// Set URL
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
|
|
500
|
+
const sURLPart1 = "https://sapinsights.eu.qualtrics.com/jfe/form/";
|
|
501
|
+
const sURLPart2 = "SV_4MANxRymEIl9K06";
|
|
502
|
+
const sURL = sURLPart1 + sURLPart2;
|
|
503
|
+
const oUrlParams = new URLSearchParams();
|
|
504
|
+
const mPropertyBag = {
|
|
505
|
+
rootControl: this.getRtaInformation().rootControl
|
|
506
|
+
};
|
|
507
|
+
const oFeedbackUrlParams = await FlexRuntimeInfoAPI.getFeedbackInformation(mPropertyBag);
|
|
508
|
+
oUrlParams.set("version", oFeedbackUrlParams.version);
|
|
509
|
+
oUrlParams.set("feature", (oFeedbackUrlParams.connector === "KeyUserConnector" ? "BTP" : "ABAP"));
|
|
510
|
+
oUrlParams.set("appId", oFeedbackUrlParams.appId);
|
|
511
|
+
oUrlParams.set("appVersion", oFeedbackUrlParams.appVersion);
|
|
512
512
|
|
|
513
513
|
var oFeedbackDialogModel = new JSONModel({
|
|
514
514
|
url: `${sURL}?${oUrlParams.toString()}`
|
|
@@ -522,9 +522,6 @@ sap.ui.define([
|
|
|
522
522
|
this._oFeedbackDialog.addStyleClass(Utils.getRtaStyleClassName());
|
|
523
523
|
this._oFeedbackDialog.setModel(oFeedbackDialogModel, "feedbackModel");
|
|
524
524
|
this._oFeedbackDialog.setModel(this.getModel("i18n"), "i18n");
|
|
525
|
-
this._oFeedbackDialog.attachEventOnce("afterClose", function() {
|
|
526
|
-
this._oFeedbackDialog.destroy();
|
|
527
|
-
}.bind(this));
|
|
528
525
|
this._oFeedbackDialog.open();
|
|
529
526
|
}.bind(this)).catch(function(oError) {
|
|
530
527
|
Log.error("Error loading fragment sap.ui.rta.toolbar.FeedbackDialog: ", oError);
|
|
@@ -534,6 +531,7 @@ sap.ui.define([
|
|
|
534
531
|
Adaptation.prototype.closeFeedbackForm = function() {
|
|
535
532
|
if (this._oFeedbackDialog) {
|
|
536
533
|
this._oFeedbackDialog.close();
|
|
534
|
+
this._oFeedbackDialog.destroy();
|
|
537
535
|
}
|
|
538
536
|
};
|
|
539
537
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/base/security/encodeXML",
|
|
8
9
|
"sap/m/GroupHeaderListItem",
|
|
9
10
|
"sap/ui/base/ManagedObject",
|
|
10
11
|
"sap/ui/core/format/DateFormat",
|
|
@@ -14,6 +15,7 @@ sap.ui.define([
|
|
|
14
15
|
"sap/ui/model/Sorter",
|
|
15
16
|
"sap/ui/rta/Utils"
|
|
16
17
|
], function(
|
|
18
|
+
encodeXML,
|
|
17
19
|
GroupHeaderListItem,
|
|
18
20
|
ManagedObject,
|
|
19
21
|
DateFormat,
|
|
@@ -36,7 +38,7 @@ sap.ui.define([
|
|
|
36
38
|
* @class
|
|
37
39
|
*
|
|
38
40
|
* @author SAP SE
|
|
39
|
-
* @version 1.
|
|
41
|
+
* @version 1.121.0
|
|
40
42
|
*
|
|
41
43
|
* @constructor
|
|
42
44
|
* @private
|
|
@@ -111,8 +113,11 @@ sap.ui.define([
|
|
|
111
113
|
if (sType === Version.Type.Draft) {
|
|
112
114
|
return this.oTextResources.getText("TIT_DRAFT");
|
|
113
115
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
// Version title is a string and should be displayed exactly the same as what the keyuser entered
|
|
117
|
+
// The back end do not encoded it but the FeedListItem supports text with html formatted tags
|
|
118
|
+
// So it need to be encoded before passing to control to make sure it is displayed correctly
|
|
119
|
+
// In addition, it also helps to avoid XSS security thread
|
|
120
|
+
return sTitle ? encodeXML(sTitle) : this.oTextResources.getText("TIT_VERSION_1");
|
|
116
121
|
}
|
|
117
122
|
|
|
118
123
|
function formatVersionTimeStamp(sActivatedAtTimeStamp, sImportedAtTimeStamp) {
|
|
@@ -239,8 +244,10 @@ sap.ui.define([
|
|
|
239
244
|
controller: {
|
|
240
245
|
onConfirmVersioningDialog: function() {
|
|
241
246
|
var sVersionTitle = this.getToolbar().getControl("activateVersionDialog--versionTitleInput").getValue();
|
|
242
|
-
|
|
243
|
-
|
|
247
|
+
if (sVersionTitle.length > 0) {
|
|
248
|
+
this.getToolbar().fireEvent("activate", {versionTitle: sVersionTitle});
|
|
249
|
+
this._oActivateVersionDialog.close();
|
|
250
|
+
}
|
|
244
251
|
}.bind(this),
|
|
245
252
|
onCancelVersioningDialog: function() {
|
|
246
253
|
this._oActivateVersionDialog.close();
|
|
@@ -30,7 +30,7 @@ sap.ui.define([
|
|
|
30
30
|
* @namespace sap.ui.rta.util.ReloadManager
|
|
31
31
|
* @alias sap.ui.rta.util.ReloadManager
|
|
32
32
|
* @since 1.104
|
|
33
|
-
* @version 1.
|
|
33
|
+
* @version 1.121.0
|
|
34
34
|
* @private
|
|
35
35
|
* @ui5-restricted
|
|
36
36
|
*/
|
|
@@ -43,26 +43,6 @@ sap.ui.define([
|
|
|
43
43
|
RELOAD_PAGE: "HARD_RELOAD"
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
/**
|
|
47
|
-
* Builds the navigation arguments object required to trigger the navigation
|
|
48
|
-
* using the <code>CrossApplicationNavigation</code> ushell service.
|
|
49
|
-
*
|
|
50
|
-
* @param {object} mParsedHash Parsed URL hash
|
|
51
|
-
* @return {object} Argument map ("oArg" parameter of the "toExternal" function)
|
|
52
|
-
*/
|
|
53
|
-
function buildNavigationArguments(mParsedHash) {
|
|
54
|
-
return {
|
|
55
|
-
target: {
|
|
56
|
-
semanticObject: mParsedHash.semanticObject,
|
|
57
|
-
action: mParsedHash.action,
|
|
58
|
-
context: mParsedHash.contextRaw
|
|
59
|
-
},
|
|
60
|
-
params: mParsedHash.params,
|
|
61
|
-
appSpecificRoute: mParsedHash.appSpecificRoute,
|
|
62
|
-
writeHistory: false
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
46
|
function getReloadMessageOnStart(oReloadInfo) {
|
|
67
47
|
var sReason;
|
|
68
48
|
var bIsCustomerLayer = oReloadInfo.layer === Layer.CUSTOMER;
|
|
@@ -135,7 +115,7 @@ sap.ui.define([
|
|
|
135
115
|
|
|
136
116
|
function triggerReloadOnStart(oReloadInfo, bVersioningEnabled, bDeveloperMode) {
|
|
137
117
|
return Promise.resolve().then(function() {
|
|
138
|
-
if (mUShellServices.
|
|
118
|
+
if (mUShellServices.Navigation && bVersioningEnabled) {
|
|
139
119
|
// clears FlexState and triggers reloading of the flex data without blocking
|
|
140
120
|
if (oReloadInfo.isDraftAvailable) {
|
|
141
121
|
return VersionsAPI.loadDraftForApplication({
|
|
@@ -166,38 +146,6 @@ sap.ui.define([
|
|
|
166
146
|
});
|
|
167
147
|
}
|
|
168
148
|
|
|
169
|
-
function triggerReloadForStandalone(oReloadInfo) {
|
|
170
|
-
oReloadInfo.parameters = document.location.search;
|
|
171
|
-
if (oReloadInfo.onStart) {
|
|
172
|
-
ReloadInfoAPI.handleParametersOnStart(oReloadInfo, "standalone");
|
|
173
|
-
} else {
|
|
174
|
-
ReloadInfoAPI.handleUrlParameters(oReloadInfo, "standalone");
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (document.location.search === oReloadInfo.parameters) {
|
|
178
|
-
ReloadManager.reloadPage();
|
|
179
|
-
} else {
|
|
180
|
-
ReloadManager.setUriParameters(oReloadInfo.parameters);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function triggerReloadForFLP(oReloadInfo) {
|
|
185
|
-
oReloadInfo.URLParsingService = mUShellServices.URLParsing;
|
|
186
|
-
oReloadInfo.parsedHash = FlUtils.getParsedURLHash(mUShellServices.URLParsing);
|
|
187
|
-
oReloadInfo.parameters = oReloadInfo.parsedHash.params;
|
|
188
|
-
var bChanged = oReloadInfo.onStart ? ReloadInfoAPI.handleParametersOnStart(oReloadInfo, "flp") : ReloadInfoAPI.handleUrlParameters(oReloadInfo, "flp");
|
|
189
|
-
|
|
190
|
-
if (bChanged) {
|
|
191
|
-
// if a hard reload is required the crossAppNav still has to be triggered to update the URL
|
|
192
|
-
mUShellServices.CrossApplicationNavigation.toExternal(buildNavigationArguments(oReloadInfo.parsedHash));
|
|
193
|
-
} else {
|
|
194
|
-
mUShellServices.AppLifeCycle.reloadCurrentApp();
|
|
195
|
-
}
|
|
196
|
-
if (oReloadInfo.triggerHardReload) {
|
|
197
|
-
ReloadManager.reloadPage();
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
149
|
ReloadManager.setUShellServices = function(mPassedUShellServices) {
|
|
202
150
|
mUShellServices = mPassedUShellServices;
|
|
203
151
|
};
|
|
@@ -247,10 +195,17 @@ sap.ui.define([
|
|
|
247
195
|
* @param {string} oReloadInfo.removeDraft - Indicates if draft parameter should be removed
|
|
248
196
|
*/
|
|
249
197
|
ReloadManager.triggerReload = function(oReloadInfo) {
|
|
250
|
-
if (
|
|
251
|
-
|
|
198
|
+
if (oReloadInfo.onStart) {
|
|
199
|
+
ReloadInfoAPI.handleReloadInfoOnStart(oReloadInfo);
|
|
252
200
|
} else {
|
|
253
|
-
|
|
201
|
+
ReloadInfoAPI.handleReloadInfo(oReloadInfo);
|
|
202
|
+
}
|
|
203
|
+
if (FlUtils.getUshellContainer()) {
|
|
204
|
+
mUShellServices.AppLifeCycle.reloadCurrentApp();
|
|
205
|
+
}
|
|
206
|
+
// standalone app always trigger hard reload
|
|
207
|
+
if (!FlUtils.getUshellContainer() || oReloadInfo.triggerHardReload) {
|
|
208
|
+
ReloadManager.reloadPage();
|
|
254
209
|
}
|
|
255
210
|
};
|
|
256
211
|
|
|
@@ -291,7 +246,12 @@ sap.ui.define([
|
|
|
291
246
|
URLParsingService: mUShellServices.URLParsing
|
|
292
247
|
});
|
|
293
248
|
return ReloadInfoAPI.getReloadReasonsForStart(mProperties).then(function(oReloadInfo) {
|
|
294
|
-
if (
|
|
249
|
+
if (
|
|
250
|
+
oReloadInfo.hasHigherLayerChanges
|
|
251
|
+
|| oReloadInfo.isDraftAvailable
|
|
252
|
+
|| oReloadInfo.allContexts
|
|
253
|
+
|| oReloadInfo.switchAdaptation
|
|
254
|
+
) {
|
|
295
255
|
return triggerReloadOnStart(oReloadInfo, mProperties.versioningEnabled, mProperties.developerMode);
|
|
296
256
|
}
|
|
297
257
|
return undefined;
|
|
@@ -331,7 +291,7 @@ sap.ui.define([
|
|
|
331
291
|
* @param {sap.ui.fl.Layer} oReloadInfo.layer - Current layer
|
|
332
292
|
* @param {boolean} oReloadInfo.hasHigherLayerChanges - Indicates if higher layer changes exist
|
|
333
293
|
*/
|
|
334
|
-
ReloadManager.
|
|
294
|
+
ReloadManager.handleReloadOnExit = function(oReloadInfo) {
|
|
335
295
|
if (oReloadInfo.layer !== Layer.USER && oReloadInfo.reloadMethod !== mReloadMethods.NOT_NEEDED) {
|
|
336
296
|
oReloadInfo.removeVersionParameter = true;
|
|
337
297
|
ReloadManager.triggerReload(oReloadInfo);
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define([
|
|
7
|
+
"sap/base/util/isPlainObject",
|
|
8
|
+
"sap/ui/base/ManagedObject",
|
|
9
|
+
"sap/ui/dt/Util",
|
|
10
|
+
"sap/ui/rta/service/index",
|
|
11
|
+
"sap/ui/rta/util/ServiceEventBus"
|
|
12
|
+
], function(
|
|
13
|
+
isPlainObject,
|
|
14
|
+
ManagedObject,
|
|
15
|
+
DtUtil,
|
|
16
|
+
ServicesIndex,
|
|
17
|
+
ServiceEventBus
|
|
18
|
+
) {
|
|
19
|
+
"use strict";
|
|
20
|
+
|
|
21
|
+
const SERVICE_STARTING = "SERVICE_STARTING";
|
|
22
|
+
const SERVICE_STARTED = "SERVICE_STARTED";
|
|
23
|
+
const SERVICE_FAILED = "SERVICE_FAILED";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Constructor for a new sap.ui.rta.util.ServiceManager. Starts and manages rta specific services.
|
|
27
|
+
*
|
|
28
|
+
* @extends sap.ui.base.ManagedObject
|
|
29
|
+
* @author SAP SE
|
|
30
|
+
* @version 1.121.0
|
|
31
|
+
* @constructor
|
|
32
|
+
* @private
|
|
33
|
+
* @since 1.121
|
|
34
|
+
* @alias sap.ui.rta.util.ServiceManager
|
|
35
|
+
*/
|
|
36
|
+
const ServiceManager = ManagedObject.extend("sap.ui.rta.util.ServiceManager", {
|
|
37
|
+
metadata: {
|
|
38
|
+
properties: {
|
|
39
|
+
/**
|
|
40
|
+
* Services that are started / in use
|
|
41
|
+
*/
|
|
42
|
+
services: {
|
|
43
|
+
type: "any",
|
|
44
|
+
defaultValue: {}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
// eslint-disable-next-line object-shorthand
|
|
49
|
+
constructor: function(...aArgs) {
|
|
50
|
+
ManagedObject.apply(this, aArgs);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
function resolveServiceLocation(sName) {
|
|
55
|
+
if (ServicesIndex.hasOwnProperty(sName)) {
|
|
56
|
+
return ServicesIndex[sName].replace(/\./g, "/");
|
|
57
|
+
}
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function stopServices() {
|
|
62
|
+
const aPromises = [];
|
|
63
|
+
Object.values(this.getServices()).forEach((oService) => {
|
|
64
|
+
aPromises.push(oService.initPromise.then(() => {
|
|
65
|
+
if (typeof oService.service.destroy === "function") {
|
|
66
|
+
oService.service.destroy();
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
69
|
+
});
|
|
70
|
+
await Promise.all(aPromises);
|
|
71
|
+
this.setServices({});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
ServiceManager.prototype.getServices = function() {
|
|
75
|
+
// without this changing the property would also change the default Value
|
|
76
|
+
return Object.assign({}, this.getProperty("services"));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Starts and returns the service with the given name
|
|
81
|
+
*
|
|
82
|
+
* @param {string} sName - Service name
|
|
83
|
+
* @param {sap.ui.rta.RuntimeAuthoring} oRuntimeAuthoringInstance - Instance of RuntimeAuthoring
|
|
84
|
+
* @returns {Promise<object>} Resolves with the initialized service
|
|
85
|
+
*/
|
|
86
|
+
ServiceManager.prototype.startService = function(sName, oRuntimeAuthoringInstance) {
|
|
87
|
+
const sServiceLocation = resolveServiceLocation(sName);
|
|
88
|
+
const mServices = this.getServices();
|
|
89
|
+
let mService;
|
|
90
|
+
|
|
91
|
+
if (!sServiceLocation) {
|
|
92
|
+
return Promise.reject(Error(`sap.ui.rta, ServiceManager#startService: Unknown service. Can't find any registered service by name '${sName}'`));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
mService = mServices[sName];
|
|
96
|
+
if (mService) {
|
|
97
|
+
switch (mService.status) {
|
|
98
|
+
case SERVICE_STARTED: {
|
|
99
|
+
return Promise.resolve(mService.exports);
|
|
100
|
+
}
|
|
101
|
+
case SERVICE_STARTING: {
|
|
102
|
+
return mService.initPromise;
|
|
103
|
+
}
|
|
104
|
+
case SERVICE_FAILED: {
|
|
105
|
+
return mService.initPromise;
|
|
106
|
+
}
|
|
107
|
+
default: {
|
|
108
|
+
return Promise.reject(Error(`sap.ui.rta, ServiceManager#startService: Unknown service status. Service name = '${sName}'`));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
mService = {};
|
|
113
|
+
mService.status = SERVICE_STARTING;
|
|
114
|
+
mService.location = sServiceLocation;
|
|
115
|
+
mService.initPromise = new Promise(function(fnResolve, fnReject) {
|
|
116
|
+
sap.ui.require(
|
|
117
|
+
[sServiceLocation],
|
|
118
|
+
async function(fnServiceFactory) {
|
|
119
|
+
try {
|
|
120
|
+
mService.factory = fnServiceFactory;
|
|
121
|
+
|
|
122
|
+
this._oServiceEventBus ||= new ServiceEventBus();
|
|
123
|
+
|
|
124
|
+
const oService = await fnServiceFactory(
|
|
125
|
+
oRuntimeAuthoringInstance,
|
|
126
|
+
this._oServiceEventBus.publish.bind(this._oServiceEventBus, sName)
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
if (oRuntimeAuthoringInstance.bIsDestroyed) {
|
|
130
|
+
throw Error(`sap.ui.rta, ServiceManager#startService: RuntimeAuthoring instance is destroyed while initializing the service '${sName}'`);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (!isPlainObject(oService)) {
|
|
134
|
+
throw Error(`sap.ui.rta, ServiceManager#startService: Invalid service format. Service should return simple javascript object after initialization. Service name = '${sName}'`);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
mService.service = oService;
|
|
138
|
+
mService.exports = {};
|
|
139
|
+
|
|
140
|
+
// Expose events API if there is at least one event
|
|
141
|
+
if (Array.isArray(oService.events) && oService.events.length > 0) {
|
|
142
|
+
Object.assign(mService.exports, {
|
|
143
|
+
attachEvent: this._oServiceEventBus.subscribe.bind(this._oServiceEventBus, sName),
|
|
144
|
+
detachEvent: this._oServiceEventBus.unsubscribe.bind(this._oServiceEventBus, sName),
|
|
145
|
+
attachEventOnce: this._oServiceEventBus.subscribeOnce.bind(this._oServiceEventBus, sName)
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Expose methods/properties from exports object if any
|
|
150
|
+
const mExports = oService.exports || {};
|
|
151
|
+
Object.assign(
|
|
152
|
+
mService.exports,
|
|
153
|
+
Object.keys(mExports).reduce(function(mResult, sKey) {
|
|
154
|
+
const vValue = mExports[sKey];
|
|
155
|
+
mResult[sKey] = typeof vValue === "function"
|
|
156
|
+
? DtUtil.waitForSynced(oRuntimeAuthoringInstance._oDesignTime, vValue)
|
|
157
|
+
: vValue;
|
|
158
|
+
return mResult;
|
|
159
|
+
}, {})
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
mService.status = SERVICE_STARTED;
|
|
163
|
+
fnResolve(Object.freeze(mService.exports));
|
|
164
|
+
} catch (oError) {
|
|
165
|
+
fnReject(oError);
|
|
166
|
+
}
|
|
167
|
+
}.bind(this),
|
|
168
|
+
function(vError) {
|
|
169
|
+
mService.status = SERVICE_FAILED;
|
|
170
|
+
fnReject(vError);
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}.bind(this))
|
|
174
|
+
.catch(function(vError) {
|
|
175
|
+
mService.status = SERVICE_FAILED;
|
|
176
|
+
return Promise.reject(vError);
|
|
177
|
+
});
|
|
178
|
+
mServices[sName] = mService;
|
|
179
|
+
this.setServices(mServices);
|
|
180
|
+
|
|
181
|
+
return mService.initPromise;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
ServiceManager.prototype.destroy = function() {
|
|
186
|
+
stopServices.call(this);
|
|
187
|
+
if (this._oServiceEventBus) {
|
|
188
|
+
this._oServiceEventBus.destroy();
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
return ServiceManager;
|
|
193
|
+
});
|
|
@@ -148,7 +148,7 @@ sap.ui.define([
|
|
|
148
148
|
})
|
|
149
149
|
.catch(function(vError) {
|
|
150
150
|
if (
|
|
151
|
-
vError !== "Reload triggered"
|
|
151
|
+
vError.message !== "Reload triggered"
|
|
152
152
|
&& !(FlexUtils.getUshellContainer() && vError.reason === "flexEnabled") // FLP Plugin already handles this error
|
|
153
153
|
) {
|
|
154
154
|
var oRtaResourceBundle = Lib.getResourceBundleFor("sap.ui.rta");
|