@openui5/sap.ui.rta 1.133.1 → 1.135.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 +0 -7
- package/THIRDPARTY.txt +2 -23
- 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 +38 -17
- package/src/sap/ui/rta/Utils.js +11 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +26 -26
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +0 -4
- package/src/sap/ui/rta/appVariant/Feature.js +85 -91
- package/src/sap/ui/rta/appVariant/Utils.js +50 -56
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +30 -30
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr_CA.properties +2 -2
- 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 +1 -1
- package/src/sap/ui/rta/command/AnnotationCommand.js +65 -5
- 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 +71 -47
- package/src/sap/ui/rta/command/CompositeCommand.js +12 -12
- 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 +1 -1
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
- 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/ExtendControllerCommand.js +92 -0
- package/src/sap/ui/rta/command/FlexCommand.js +54 -43
- package/src/sap/ui/rta/command/LREPSerializer.js +23 -23
- package/src/sap/ui/rta/command/LocalReset.js +1 -1
- package/src/sap/ui/rta/command/ManifestCommand.js +112 -0
- 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 +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/command/{appDescriptor → manifest}/AddLibrary.js +10 -10
- package/src/sap/ui/rta/enablement/elementActionTest.js +1 -7
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +22 -7
- package/src/sap/ui/rta/messagebundle_ar.properties +3 -1
- package/src/sap/ui/rta/messagebundle_bg.properties +4 -2
- package/src/sap/ui/rta/messagebundle_ca.properties +3 -1
- package/src/sap/ui/rta/messagebundle_cnr.properties +4 -2
- package/src/sap/ui/rta/messagebundle_cs.properties +3 -1
- package/src/sap/ui/rta/messagebundle_cy.properties +3 -1
- package/src/sap/ui/rta/messagebundle_da.properties +4 -2
- package/src/sap/ui/rta/messagebundle_de.properties +3 -1
- package/src/sap/ui/rta/messagebundle_el.properties +3 -1
- package/src/sap/ui/rta/messagebundle_en.properties +3 -1
- package/src/sap/ui/rta/messagebundle_en_GB.properties +3 -1
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +10 -2
- package/src/sap/ui/rta/messagebundle_es.properties +3 -1
- package/src/sap/ui/rta/messagebundle_es_MX.properties +4 -2
- package/src/sap/ui/rta/messagebundle_et.properties +3 -1
- package/src/sap/ui/rta/messagebundle_fi.properties +4 -2
- package/src/sap/ui/rta/messagebundle_fr.properties +12 -10
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +7 -5
- package/src/sap/ui/rta/messagebundle_hi.properties +3 -1
- package/src/sap/ui/rta/messagebundle_hr.properties +34 -32
- package/src/sap/ui/rta/messagebundle_hu.properties +3 -1
- package/src/sap/ui/rta/messagebundle_id.properties +3 -1
- package/src/sap/ui/rta/messagebundle_it.properties +48 -46
- package/src/sap/ui/rta/messagebundle_iw.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ja.properties +3 -1
- package/src/sap/ui/rta/messagebundle_kk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ko.properties +3 -1
- package/src/sap/ui/rta/messagebundle_lt.properties +3 -1
- package/src/sap/ui/rta/messagebundle_lv.properties +3 -1
- package/src/sap/ui/rta/messagebundle_mk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ms.properties +3 -1
- package/src/sap/ui/rta/messagebundle_nl.properties +3 -1
- package/src/sap/ui/rta/messagebundle_no.properties +3 -1
- package/src/sap/ui/rta/messagebundle_pl.properties +3 -1
- package/src/sap/ui/rta/messagebundle_pt.properties +3 -1
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ro.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ru.properties +3 -1
- package/src/sap/ui/rta/messagebundle_sh.properties +4 -2
- package/src/sap/ui/rta/messagebundle_sk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_sl.properties +3 -1
- package/src/sap/ui/rta/messagebundle_sr.properties +4 -2
- package/src/sap/ui/rta/messagebundle_sv.properties +3 -1
- package/src/sap/ui/rta/messagebundle_th.properties +3 -1
- package/src/sap/ui/rta/messagebundle_tr.properties +3 -1
- package/src/sap/ui/rta/messagebundle_uk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_vi.properties +3 -1
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +3 -1
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +3 -1
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +41 -35
- package/src/sap/ui/rta/plugin/AddXMLPlugin.js +168 -0
- 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/ControlVariant.js +1 -1
- 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/ExtendControllerPlugin.js +161 -0
- package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
- package/src/sap/ui/rta/plugin/Plugin.js +7 -4
- 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 +1 -1
- package/src/sap/ui/rta/plugin/Settings.js +71 -61
- package/src/sap/ui/rta/plugin/Split.js +1 -1
- package/src/sap/ui/rta/plugin/Stretch.js +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.fragment.xml +38 -51
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.js +85 -47
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +97 -33
- package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +72 -17
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
- package/src/sap/ui/rta/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +10 -4
- package/src/sap/ui/rta/service/Outline.js +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +5 -0
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +21 -3
- package/src/sap/ui/rta/toolbar/Adaptation.js +33 -7
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +4 -3
- 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/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 +1 -1
- package/src/sap/ui/rta/util/Animation.js +1 -1
- package/src/sap/ui/rta/util/BindingsExtractor.js +1 -1
- package/src/sap/ui/rta/util/PluginManager.js +5 -7
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- package/src/sap/ui/rta/util/ReloadManager.js +1 -1
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/ServiceManager.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +2 -2
- package/src/sap/ui/rta/util/isReuseComponent.js +44 -0
- package/src/sap/ui/rta/util/validateText.js +1 -1
- package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +1 -1
- package/src/sap/ui/rta/util/whatsNew/WhatsNewUtils.js +12 -7
- package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +0 -5
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +0 -114
|
@@ -5,62 +5,58 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/
|
|
9
|
-
"sap/ui/rta/appVariant/AppVariantUtils",
|
|
10
|
-
"sap/ui/rta/util/showMessageBox",
|
|
8
|
+
"sap/base/util/merge",
|
|
11
9
|
"sap/ui/core/BusyIndicator",
|
|
12
10
|
"sap/ui/core/EventBus",
|
|
13
|
-
"sap/ui/fl/
|
|
11
|
+
"sap/ui/fl/apply/api/FlexRuntimeInfoAPI",
|
|
14
12
|
"sap/ui/fl/write/_internal/appVariant/AppVariantFactory",
|
|
15
13
|
"sap/ui/fl/write/api/FeaturesAPI",
|
|
16
|
-
"sap/
|
|
14
|
+
"sap/ui/fl/Utils",
|
|
15
|
+
"sap/ui/rta/appVariant/AppVariantUtils",
|
|
16
|
+
"sap/ui/rta/util/showMessageBox"
|
|
17
17
|
], function(
|
|
18
|
-
|
|
19
|
-
AppVariantUtils,
|
|
20
|
-
showMessageBox,
|
|
18
|
+
merge,
|
|
21
19
|
BusyIndicator,
|
|
22
20
|
EventBus,
|
|
23
|
-
|
|
21
|
+
FlexRuntimeInfoAPI,
|
|
24
22
|
AppVariantFactory,
|
|
25
23
|
FeaturesAPI,
|
|
26
|
-
|
|
24
|
+
FlexUtils,
|
|
25
|
+
AppVariantUtils,
|
|
26
|
+
showMessageBox
|
|
27
27
|
) {
|
|
28
28
|
"use strict";
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
let oAppVariantOverviewDialog;
|
|
31
|
+
let oAppVariantManager;
|
|
32
|
+
let oRootControlRunningApp;
|
|
33
|
+
let oCommandSerializer;
|
|
34
|
+
let _oldUnloadHandler;
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const fnGetManifest = function() {
|
|
37
37
|
return FlexUtils.getAppDescriptor(oRootControlRunningApp);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
return Settings.getInstance();
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
var fnS4HanaRemoveBrowserCloseWarning = function() {
|
|
40
|
+
const fnS4HanaRemoveBrowserCloseWarning = function() {
|
|
45
41
|
window.onbeforeunload = _oldUnloadHandler;
|
|
46
42
|
};
|
|
47
43
|
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
const fnS4HanaAddBrowserCloseWarning = function(bCurrentlyAdapting) {
|
|
45
|
+
const sMessageKey = bCurrentlyAdapting ? "MSG_DO_NOT_CLOSE_BROWSER_CURRENTLY_ADAPTING" : "MSG_DO_NOT_CLOSE_BROWSER";
|
|
50
46
|
_oldUnloadHandler = window.onbeforeunload;
|
|
51
47
|
window.onbeforeunload = AppVariantUtils.handleBeforeUnloadEvent;
|
|
52
48
|
return AppVariantUtils.showMessage(sMessageKey);
|
|
53
49
|
};
|
|
54
50
|
|
|
55
|
-
|
|
51
|
+
const fnTriggerCatalogAssignment = function(sAppVariantId, sReferenceAppId) {
|
|
56
52
|
return oAppVariantManager.triggerCatalogPublishing(sAppVariantId, sReferenceAppId, true);
|
|
57
53
|
};
|
|
58
54
|
|
|
59
|
-
|
|
55
|
+
const fnTriggerCatalogUnAssignment = function(sAppVariantId) {
|
|
60
56
|
return oAppVariantManager.triggerCatalogPublishing(sAppVariantId, null, false);
|
|
61
57
|
};
|
|
62
58
|
|
|
63
|
-
|
|
59
|
+
const fnReloadOverviewDialog = function(bIsReloadNeeded, sCurrentLayer) {
|
|
64
60
|
if (oAppVariantOverviewDialog) {
|
|
65
61
|
// in case of S/4HANA Cloud when customer did not close overview
|
|
66
62
|
AppVariantUtils.closeOverviewDialog();
|
|
@@ -72,11 +68,11 @@ sap.ui.define([
|
|
|
72
68
|
return Promise.resolve();
|
|
73
69
|
};
|
|
74
70
|
|
|
75
|
-
|
|
71
|
+
const fnTriggerActionFlow = function(bSaveAsTriggeredFromRtaToolbar, bIsS4HanaCloud, sCurrentLayer) {
|
|
76
72
|
return bSaveAsTriggeredFromRtaToolbar ? AppVariantUtils.navigateToFLPHomepage() : fnReloadOverviewDialog.call(this, !bIsS4HanaCloud, sCurrentLayer);
|
|
77
73
|
};
|
|
78
74
|
|
|
79
|
-
|
|
75
|
+
const fnTriggerPollingTileCreation = function(oResult, sAppVariantId) {
|
|
80
76
|
// In case of S/4HANA Cloud, oResult is filled from catalog assignment call
|
|
81
77
|
if (oResult && oResult.response && oResult.response.IAMId) {
|
|
82
78
|
if (!Array.isArray(oResult.response.CatalogIds) || oResult.response.CatalogIds.length === 0) {
|
|
@@ -90,7 +86,7 @@ sap.ui.define([
|
|
|
90
86
|
return Promise.resolve();
|
|
91
87
|
};
|
|
92
88
|
|
|
93
|
-
|
|
89
|
+
const fnTriggerPollingTileDeletion = function(oResult, sAppVariantId) {
|
|
94
90
|
// In case of S/4HANA Cloud, oResult is filled from catalog unassignment call, do polling only if inProgress === true
|
|
95
91
|
if (oResult && oResult.response && oResult.response.IAMId && oResult.response.inProgress) {
|
|
96
92
|
return oAppVariantManager.notifyKeyUserWhenPublishingIsReady(oResult.response.IAMId, sAppVariantId, false);
|
|
@@ -108,16 +104,16 @@ sap.ui.define([
|
|
|
108
104
|
return {
|
|
109
105
|
// To see the overview of app variants, a key user has created from an app
|
|
110
106
|
onGetOverview(bAsKeyUser, sLayer) {
|
|
111
|
-
|
|
107
|
+
const oManifest = fnGetManifest();
|
|
112
108
|
|
|
113
109
|
return new Promise(function(resolve) {
|
|
114
|
-
|
|
110
|
+
const fnCancel = function() {
|
|
115
111
|
AppVariantUtils.closeOverviewDialog();
|
|
116
112
|
};
|
|
117
113
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
idRunningApp:
|
|
114
|
+
const sOverviewPath = "sap/ui/rta/appVariant/AppVariantOverviewDialog";
|
|
115
|
+
const oProperties = {
|
|
116
|
+
idRunningApp: oManifest["sap.app"].id,
|
|
121
117
|
isOverviewForKeyUser: bAsKeyUser,
|
|
122
118
|
layer: sLayer
|
|
123
119
|
};
|
|
@@ -144,8 +140,8 @@ sap.ui.define([
|
|
|
144
140
|
* When this method returns <code>false</code>, an app variant overview is shown only for a key user.
|
|
145
141
|
*/
|
|
146
142
|
isOverviewExtended() {
|
|
147
|
-
|
|
148
|
-
|
|
143
|
+
const oUriParams = new URLSearchParams(window.location.search);
|
|
144
|
+
const sMode = oUriParams.get("sap-ui-xx-app-variant-overview-extended");
|
|
149
145
|
if (!sMode) {
|
|
150
146
|
return false;
|
|
151
147
|
}
|
|
@@ -153,8 +149,8 @@ sap.ui.define([
|
|
|
153
149
|
return sMode.toLowerCase() === "true";
|
|
154
150
|
},
|
|
155
151
|
isManifestSupported() {
|
|
156
|
-
|
|
157
|
-
return AppVariantUtils.getManifirstSupport(
|
|
152
|
+
const oManifest = fnGetManifest();
|
|
153
|
+
return AppVariantUtils.getManifirstSupport(oManifest["sap.app"].id);
|
|
158
154
|
},
|
|
159
155
|
/**
|
|
160
156
|
* @param {object} oRootControl - Root control of an app (variant)
|
|
@@ -166,13 +162,13 @@ sap.ui.define([
|
|
|
166
162
|
oRootControlRunningApp = oRootControl;
|
|
167
163
|
oCommandSerializer = oLrepSerializer;
|
|
168
164
|
|
|
169
|
-
|
|
165
|
+
const oManifest = fnGetManifest();
|
|
170
166
|
|
|
171
|
-
if (
|
|
167
|
+
if (oManifest["sap.app"] && oManifest["sap.app"].id) {
|
|
172
168
|
return FeaturesAPI.isSaveAsAvailable(sCurrentLayer).then(function(bIsSaveAsAvailable) {
|
|
173
169
|
if (bIsSaveAsAvailable) {
|
|
174
|
-
if (
|
|
175
|
-
return AppVariantUtils.getInboundInfo(
|
|
170
|
+
if (oManifest["sap.app"].crossNavigation && oManifest["sap.app"].crossNavigation.inbounds) {
|
|
171
|
+
return AppVariantUtils.getInboundInfo(oManifest["sap.app"].crossNavigation.inbounds);
|
|
176
172
|
}
|
|
177
173
|
return AppVariantUtils.getInboundInfo();
|
|
178
174
|
}
|
|
@@ -185,23 +181,23 @@ sap.ui.define([
|
|
|
185
181
|
},
|
|
186
182
|
/**
|
|
187
183
|
* @param {object} oRootControl - Root control of an app (variant)
|
|
188
|
-
* @returns {Promise} Resolved promise with an app variant
|
|
189
|
-
* @description Getting here an app variant
|
|
184
|
+
* @returns {Promise} Resolved promise with an app variant manifest
|
|
185
|
+
* @description Getting here an app variant manifest from the layered repository.
|
|
190
186
|
*/
|
|
191
|
-
|
|
187
|
+
getAppVariantManifest(oRootControl) {
|
|
192
188
|
oRootControlRunningApp = oRootControl;
|
|
193
|
-
|
|
194
|
-
if (
|
|
189
|
+
const oManifest = fnGetManifest();
|
|
190
|
+
if (oManifest["sap.app"] && oManifest["sap.app"].id) {
|
|
195
191
|
return AppVariantFactory.load({
|
|
196
|
-
id:
|
|
192
|
+
id: oManifest["sap.app"].id
|
|
197
193
|
});
|
|
198
194
|
}
|
|
199
195
|
return Promise.resolve(false);
|
|
200
196
|
},
|
|
201
|
-
_determineSelector(bIsRunningApp,
|
|
197
|
+
_determineSelector(bIsRunningApp, oManifest) {
|
|
202
198
|
return bIsRunningApp ? oRootControlRunningApp : {
|
|
203
|
-
appId:
|
|
204
|
-
appVersion:
|
|
199
|
+
appId: oManifest["sap.app"].id,
|
|
200
|
+
appVersion: oManifest["sap.app"].applicationVersion.version
|
|
205
201
|
};
|
|
206
202
|
},
|
|
207
203
|
/**
|
|
@@ -215,58 +211,58 @@ sap.ui.define([
|
|
|
215
211
|
* The flag <code>bCopyUnsavedChanges</code> is <code>true</code> if a key user presses 'Save As' from the running app entry in the app variant overview dialog.
|
|
216
212
|
*/
|
|
217
213
|
onSaveAs(bSaveAsFromRta, bCopyUnsavedChanges, sCurrentLayer, oSelectedAppVariant) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
214
|
+
let bIsS4HanaCloud;
|
|
215
|
+
let oAppVariantSaveClosure;
|
|
216
|
+
let oManifest = fnGetManifest();
|
|
217
|
+
let bIsRunningApp = true;
|
|
222
218
|
|
|
223
219
|
if (
|
|
224
220
|
oSelectedAppVariant
|
|
225
|
-
&& oSelectedAppVariant["sap.app"].id ===
|
|
221
|
+
&& oSelectedAppVariant["sap.app"].id === oManifest["sap.app"].id
|
|
226
222
|
) {
|
|
227
223
|
// When an app variant is created on top of base app/app variant from the app variant overview dialog and root control is from the latter
|
|
228
224
|
bCopyUnsavedChanges = true;
|
|
229
|
-
|
|
225
|
+
oManifest = merge({}, oSelectedAppVariant);
|
|
230
226
|
oSelectedAppVariant = null;
|
|
231
227
|
} else if (oSelectedAppVariant) {
|
|
232
228
|
// When an app variant is created on top of app variant from the app variant overview dialog and root control is from base application
|
|
233
229
|
bIsRunningApp = false;
|
|
234
|
-
|
|
230
|
+
oManifest = merge({}, oSelectedAppVariant);
|
|
235
231
|
oSelectedAppVariant = null;
|
|
236
232
|
}
|
|
237
233
|
|
|
238
234
|
// Determine the selector
|
|
239
|
-
|
|
235
|
+
const vSelector = this._determineSelector(bIsRunningApp, oManifest);
|
|
240
236
|
|
|
241
237
|
return new Promise(function(resolve) {
|
|
242
|
-
|
|
243
|
-
return oAppVariantManager.processSaveAsDialog(
|
|
238
|
+
const fnProcessSaveAsDialog = function() {
|
|
239
|
+
return oAppVariantManager.processSaveAsDialog(oManifest, bSaveAsFromRta);
|
|
244
240
|
};
|
|
245
241
|
|
|
246
|
-
|
|
242
|
+
const fnCreateInlineChanges = function(oAppVariantSpecificData) {
|
|
247
243
|
BusyIndicator.show();
|
|
248
244
|
return oAppVariantManager.createAllInlineChanges(oAppVariantSpecificData, vSelector);
|
|
249
245
|
};
|
|
250
246
|
|
|
251
|
-
|
|
252
|
-
|
|
247
|
+
const fnAddChangesToPersistence = function(aChanges) {
|
|
248
|
+
const aAllInlineChanges = aChanges.slice();
|
|
253
249
|
return AppVariantUtils.addChangesToPersistence(aAllInlineChanges, vSelector);
|
|
254
250
|
};
|
|
255
251
|
|
|
256
|
-
|
|
257
|
-
|
|
252
|
+
const fnCreateAppVariant = function() {
|
|
253
|
+
const sAppVariantId = AppVariantUtils.getNewAppVariantId();
|
|
258
254
|
|
|
259
|
-
// Based on the key user provided info, app variant
|
|
255
|
+
// Based on the key user provided info, app variant manifest is created
|
|
260
256
|
return oAppVariantManager.createAppVariant(sAppVariantId, vSelector)
|
|
261
257
|
.catch(function(oError) {
|
|
262
|
-
|
|
258
|
+
let sMessageKey = oError.messageKey;
|
|
263
259
|
sMessageKey ||= "MSG_SAVE_APP_VARIANT_FAILED";
|
|
264
260
|
|
|
265
261
|
return AppVariantUtils.catchErrorDialog(oError, sMessageKey, sAppVariantId);
|
|
266
262
|
});
|
|
267
263
|
};
|
|
268
264
|
|
|
269
|
-
|
|
265
|
+
const fnClearRTACommandStack = function(oResult) {
|
|
270
266
|
oAppVariantSaveClosure = null;
|
|
271
267
|
oAppVariantSaveClosure = merge({}, oResult.response);
|
|
272
268
|
|
|
@@ -274,32 +270,32 @@ sap.ui.define([
|
|
|
274
270
|
return oAppVariantManager.clearRTACommandStack(bCopyUnsavedChanges);
|
|
275
271
|
};
|
|
276
272
|
|
|
277
|
-
|
|
278
|
-
|
|
273
|
+
const fnResetDirtyFlag = function() {
|
|
274
|
+
const oUshellContainer = FlexUtils.getUshellContainer();
|
|
279
275
|
if (oUshellContainer && bCopyUnsavedChanges) {
|
|
280
276
|
// Tell FLP that no UI change is booked for the currently adapting app
|
|
281
277
|
oUshellContainer.setDirtyFlag(false);
|
|
282
278
|
}
|
|
283
279
|
};
|
|
284
280
|
|
|
285
|
-
var fnTriggerSuccessMessage = function(
|
|
281
|
+
var fnTriggerSuccessMessage = function() {
|
|
286
282
|
fnResetDirtyFlag();
|
|
287
|
-
bIsS4HanaCloud =
|
|
283
|
+
bIsS4HanaCloud = FlexRuntimeInfoAPI.isAtoEnabled();
|
|
288
284
|
// Shows the success message and closes the current app (if 'Save As' triggered from UI adaptation toolbar)
|
|
289
285
|
// or opens the app variant overview list (if 'Save As' triggered from App variant overview List)
|
|
290
|
-
|
|
286
|
+
const oSuccessInfo = AppVariantUtils.buildSuccessInfo(oAppVariantSaveClosure.id, bSaveAsFromRta, bIsS4HanaCloud);
|
|
291
287
|
return oAppVariantManager.showSuccessMessage(oSuccessInfo);
|
|
292
288
|
};
|
|
293
289
|
|
|
294
|
-
|
|
295
|
-
|
|
290
|
+
const fnShowCatalogAssignmentSuccessMessage = function() {
|
|
291
|
+
const oSuccessInfo = AppVariantUtils.buildFinalSuccessInfoS4HANACloud();
|
|
296
292
|
return oAppVariantManager.showSuccessMessage(oSuccessInfo);
|
|
297
293
|
};
|
|
298
294
|
|
|
299
|
-
|
|
295
|
+
const fnTriggerPlatformDependentFlow = function() {
|
|
300
296
|
BusyIndicator.show();
|
|
301
297
|
if (bIsS4HanaCloud) {
|
|
302
|
-
|
|
298
|
+
let oIAMResponse;
|
|
303
299
|
return fnS4HanaAddBrowserCloseWarning()
|
|
304
300
|
.then(function() {
|
|
305
301
|
return fnTriggerCatalogAssignment(oAppVariantSaveClosure.id, oAppVariantSaveClosure.reference);
|
|
@@ -332,10 +328,9 @@ sap.ui.define([
|
|
|
332
328
|
|
|
333
329
|
return fnProcessSaveAsDialog()
|
|
334
330
|
.then(fnCreateInlineChanges) // Create the inline changes for application variant
|
|
335
|
-
.then(fnAddChangesToPersistence) // Adds the
|
|
331
|
+
.then(fnAddChangesToPersistence) // Adds the manifest inline changes to the persistence
|
|
336
332
|
.then(fnCreateAppVariant) // Creates the application variant and saves it to the layered repository
|
|
337
333
|
.then(fnClearRTACommandStack)
|
|
338
|
-
.then(fnGetFlexSettings)
|
|
339
334
|
.then(fnTriggerSuccessMessage)
|
|
340
335
|
.then(fnTriggerPlatformDependentFlow.bind(this)).then(resolve)
|
|
341
336
|
.catch(function(oError) {
|
|
@@ -358,7 +353,7 @@ sap.ui.define([
|
|
|
358
353
|
* @description Triggers a delete operation of the app variant.
|
|
359
354
|
*/
|
|
360
355
|
onDeleteFromOverviewDialog(sAppVariantId, bCurrentlyAdapting, sCurrentLayer) {
|
|
361
|
-
|
|
356
|
+
let bIsS4HanaCloud;
|
|
362
357
|
return new Promise(function(resolve) {
|
|
363
358
|
sap.ui.require(["sap/ui/rta/appVariant/AppVariantManager"], function(AppVariantManager) {
|
|
364
359
|
oAppVariantManager ||= new AppVariantManager({
|
|
@@ -367,28 +362,28 @@ sap.ui.define([
|
|
|
367
362
|
layer: sCurrentLayer
|
|
368
363
|
});
|
|
369
364
|
|
|
370
|
-
|
|
365
|
+
const fnDeleteAppVariant = function() {
|
|
371
366
|
return oAppVariantManager.deleteAppVariant(sAppVariantId)
|
|
372
367
|
.catch(function(oError) {
|
|
373
368
|
if (oError === "cancel") {
|
|
374
369
|
return Promise.reject("cancel");
|
|
375
370
|
}
|
|
376
|
-
|
|
371
|
+
let sMessageKey = oError.messageKey;
|
|
377
372
|
sMessageKey ||= "MSG_DELETE_APP_VARIANT_FAILED";
|
|
378
373
|
return AppVariantUtils.catchErrorDialog(oError, sMessageKey, sAppVariantId);
|
|
379
374
|
});
|
|
380
375
|
};
|
|
381
376
|
|
|
382
|
-
|
|
377
|
+
const fnDeleteSuccessMessage = function() {
|
|
383
378
|
AppVariantUtils.closeOverviewDialog();
|
|
384
|
-
|
|
379
|
+
const oSuccessInfo = AppVariantUtils.buildDeleteSuccessMessage(sAppVariantId, bIsS4HanaCloud);
|
|
385
380
|
return oAppVariantManager.showSuccessMessage(oSuccessInfo);
|
|
386
381
|
};
|
|
387
382
|
|
|
388
|
-
|
|
389
|
-
bIsS4HanaCloud =
|
|
383
|
+
const fnTriggerS4HanaPolling = function() {
|
|
384
|
+
bIsS4HanaCloud = FlexRuntimeInfoAPI.isAtoEnabled();
|
|
390
385
|
if (bIsS4HanaCloud) {
|
|
391
|
-
|
|
386
|
+
let oIAMResponse;
|
|
392
387
|
return fnS4HanaAddBrowserCloseWarning(bCurrentlyAdapting)
|
|
393
388
|
.then(function() {
|
|
394
389
|
return fnTriggerCatalogUnAssignment(sAppVariantId);
|
|
@@ -405,7 +400,7 @@ sap.ui.define([
|
|
|
405
400
|
return Promise.resolve();
|
|
406
401
|
};
|
|
407
402
|
|
|
408
|
-
|
|
403
|
+
const fnTriggerS4HanaRefresh = function() {
|
|
409
404
|
if (bIsS4HanaCloud) {
|
|
410
405
|
fnS4HanaRemoveBrowserCloseWarning();
|
|
411
406
|
}
|
|
@@ -418,8 +413,7 @@ sap.ui.define([
|
|
|
418
413
|
AppVariantUtils.navigateToFLPHomepage();
|
|
419
414
|
}
|
|
420
415
|
|
|
421
|
-
return
|
|
422
|
-
.then(fnTriggerS4HanaPolling.bind(this))
|
|
416
|
+
return fnTriggerS4HanaPolling.call(this)
|
|
423
417
|
.then(fnDeleteAppVariant)
|
|
424
418
|
.then(fnDeleteSuccessMessage)
|
|
425
419
|
.then(fnTriggerS4HanaRefresh.bind(this))
|
|
@@ -4,32 +4,31 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
-
"sap/ui/rta/appVariant/AppVariantUtils",
|
|
8
|
-
"sap/ui/fl/registry/Settings",
|
|
9
|
-
"sap/ui/fl/Utils",
|
|
10
7
|
"sap/base/i18n/ResourceBundle",
|
|
8
|
+
"sap/ui/core/IconPool",
|
|
9
|
+
"sap/ui/fl/apply/api/FlexRuntimeInfoAPI",
|
|
11
10
|
"sap/ui/fl/write/api/AppVariantWriteAPI",
|
|
12
|
-
"sap/ui/
|
|
13
|
-
|
|
14
|
-
function(
|
|
15
|
-
AppVariantUtils,
|
|
16
|
-
Settings,
|
|
17
|
-
FlUtils,
|
|
11
|
+
"sap/ui/fl/Utils",
|
|
12
|
+
"sap/ui/rta/appVariant/AppVariantUtils"
|
|
13
|
+
], function(
|
|
18
14
|
ResourceBundle,
|
|
15
|
+
IconPool,
|
|
16
|
+
FlexRuntimeInfoAPI,
|
|
19
17
|
AppVariantWriteAPI,
|
|
20
|
-
|
|
18
|
+
FlUtils,
|
|
19
|
+
AppVariantUtils
|
|
21
20
|
) {
|
|
22
21
|
"use strict";
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
const Utils = {};
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const sModulePath = `${sap.ui.require.toUrl("sap/ui/rta/appVariant/manageApps/")}webapp`;
|
|
26
|
+
const oI18n = ResourceBundle.create({
|
|
28
27
|
url: `${sModulePath}/i18n/i18n.properties`
|
|
29
28
|
});
|
|
30
29
|
|
|
31
30
|
Utils._checkNavigationSupported = function(oNavigationParams) {
|
|
32
|
-
|
|
31
|
+
const oUShellContainer = FlUtils.getUshellContainer();
|
|
33
32
|
return oUShellContainer.getServiceAsync("Navigation")
|
|
34
33
|
.then(function(oNavigationService) {
|
|
35
34
|
return oNavigationService.getLinks([oNavigationParams]);
|
|
@@ -53,7 +52,7 @@ function(
|
|
|
53
52
|
|
|
54
53
|
Utils._calculateCurrentStatus = function(sAppVariantInfoId, sAppVarStatus) {
|
|
55
54
|
// Get the id of a new created app variant
|
|
56
|
-
|
|
55
|
+
const sNewAppVariantId = AppVariantUtils.getNewAppVariantId();
|
|
57
56
|
|
|
58
57
|
if (sAppVarStatus === "R") {
|
|
59
58
|
return oI18n.getText("MAA_OPERATION_IN_PROGRESS");
|
|
@@ -66,7 +65,7 @@ function(
|
|
|
66
65
|
};
|
|
67
66
|
|
|
68
67
|
Utils._checkMenuItemOptions = function(oPreparedObject, bAdaptUIButtonEnabled) {
|
|
69
|
-
|
|
68
|
+
const oAppVarObject = {};
|
|
70
69
|
|
|
71
70
|
if (oPreparedObject.isKeyUser) {
|
|
72
71
|
if (oPreparedObject.isOriginal) {
|
|
@@ -113,21 +112,19 @@ function(
|
|
|
113
112
|
};
|
|
114
113
|
|
|
115
114
|
Utils._getNavigationInfo = function(oPreparedObject) {
|
|
116
|
-
|
|
115
|
+
let oNavigationObject = {};
|
|
117
116
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
const sSemanticObject = oPreparedObject.startWith.semanticObject;
|
|
118
|
+
const sAction = oPreparedObject.startWith.action;
|
|
119
|
+
const oParams = oPreparedObject.startWith.parameters;
|
|
121
120
|
|
|
122
|
-
|
|
121
|
+
const oNavigationParams = {
|
|
123
122
|
semanticObject: sSemanticObject,
|
|
124
123
|
action: sAction,
|
|
125
124
|
params: oParams
|
|
126
125
|
};
|
|
127
126
|
|
|
128
127
|
return this._checkNavigationSupported(oNavigationParams).then(function(aResult) {
|
|
129
|
-
var oDeleteButtonProperties;
|
|
130
|
-
|
|
131
128
|
if (aResult[0].length && oPreparedObject.isKeyUser) {
|
|
132
129
|
oNavigationObject.adaptUIButtonEnabled = true;
|
|
133
130
|
|
|
@@ -139,7 +136,7 @@ function(
|
|
|
139
136
|
oNavigationObject.adaptUIButtonEnabled = false;
|
|
140
137
|
}
|
|
141
138
|
|
|
142
|
-
oDeleteButtonProperties = this._checkMenuItemOptions(oPreparedObject, oNavigationObject.adaptUIButtonEnabled);
|
|
139
|
+
const oDeleteButtonProperties = this._checkMenuItemOptions(oPreparedObject, oNavigationObject.adaptUIButtonEnabled);
|
|
143
140
|
|
|
144
141
|
oNavigationObject.semanticObject = sSemanticObject;
|
|
145
142
|
oNavigationObject.action = sAction;
|
|
@@ -175,9 +172,9 @@ function(
|
|
|
175
172
|
};
|
|
176
173
|
|
|
177
174
|
Utils.getAppVariantOverviewAttributes = function(oAppVariantInfo, bKeyUser) {
|
|
178
|
-
|
|
175
|
+
let oAppVariantAttributes;
|
|
179
176
|
// Adding the tooltip to every icon which is shown on the App Variant Overview Dialog
|
|
180
|
-
|
|
177
|
+
const sIconUrl = oAppVariantInfo.iconUrl;
|
|
181
178
|
if (sIconUrl && IconPool.isIconURI(sIconUrl)) {
|
|
182
179
|
// eslint-disable-next-line prefer-destructuring
|
|
183
180
|
oAppVariantInfo.iconText = sIconUrl.split("//")[1];
|
|
@@ -194,39 +191,36 @@ function(
|
|
|
194
191
|
// Calculate current status of application required for Overview Dialog
|
|
195
192
|
oAppVariantAttributes.currentStatus = this._calculateCurrentStatus(oAppVariantInfo.appId, oAppVariantInfo.appVarStatus);
|
|
196
193
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
// Populate the app variant attributes with the cloud system information
|
|
201
|
-
oAppVariantAttributes.isS4HanaCloud = bIsS4HanaCloud;
|
|
202
|
-
|
|
203
|
-
var oPreparedObject = {
|
|
204
|
-
isKeyUser: bKeyUser,
|
|
205
|
-
isOriginal: oAppVariantInfo.isOriginal,
|
|
206
|
-
isS4HanaCloud: bIsS4HanaCloud,
|
|
207
|
-
appVarStatus: oAppVariantInfo.appVarStatus
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
if (oAppVariantInfo.hasStartableIntent) {
|
|
211
|
-
oPreparedObject.startWith = oAppVariantInfo.startWith;
|
|
212
|
-
return this._getNavigationInfo(oPreparedObject).then(function(oNavigationObject) {
|
|
213
|
-
oAppVariantAttributes = { ...oAppVariantAttributes, ...oNavigationObject };
|
|
214
|
-
return oAppVariantAttributes;
|
|
215
|
-
});
|
|
216
|
-
}
|
|
194
|
+
const bIsS4HanaCloud = FlexRuntimeInfoAPI.isAtoEnabled();
|
|
195
|
+
// Populate the app variant attributes with the cloud system information
|
|
196
|
+
oAppVariantAttributes.isS4HanaCloud = bIsS4HanaCloud;
|
|
217
197
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
198
|
+
const oPreparedObject = {
|
|
199
|
+
isKeyUser: bKeyUser,
|
|
200
|
+
isOriginal: oAppVariantInfo.isOriginal,
|
|
201
|
+
isS4HanaCloud: bIsS4HanaCloud,
|
|
202
|
+
appVarStatus: oAppVariantInfo.appVarStatus
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
if (oAppVariantInfo.hasStartableIntent) {
|
|
206
|
+
oPreparedObject.startWith = oAppVariantInfo.startWith;
|
|
207
|
+
return this._getNavigationInfo(oPreparedObject).then(function(oNavigationObject) {
|
|
208
|
+
oAppVariantAttributes = { ...oAppVariantAttributes, ...oNavigationObject };
|
|
209
|
+
return oAppVariantAttributes;
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
oAppVariantAttributes.adaptUIButtonEnabled = false;
|
|
214
|
+
const oDeleteButtonProperties = this._checkMenuItemOptions(oPreparedObject, false);
|
|
215
|
+
oAppVariantAttributes = { ...oAppVariantAttributes, ...oDeleteButtonProperties };
|
|
216
|
+
return Promise.resolve(oAppVariantAttributes);
|
|
223
217
|
};
|
|
224
218
|
|
|
225
219
|
Utils.getAppVariantOverview = function(sReferenceAppId, bKeyUser) {
|
|
226
220
|
// Customer* means the layer can be either CUSTOMER or CUSTOMER_BASE. This layer determination takes place in backend.
|
|
227
|
-
|
|
221
|
+
const sLayer = bKeyUser ? "CUSTOMER*" : "VENDOR";
|
|
228
222
|
|
|
229
|
-
|
|
223
|
+
const mPropertyBag = {
|
|
230
224
|
selector: {
|
|
231
225
|
appId: sReferenceAppId
|
|
232
226
|
},
|
|
@@ -234,8 +228,8 @@ function(
|
|
|
234
228
|
};
|
|
235
229
|
|
|
236
230
|
return AppVariantWriteAPI.listAllAppVariants(mPropertyBag).then(function(oResult) {
|
|
237
|
-
|
|
238
|
-
|
|
231
|
+
const aAppVariantOverviewInfo = [];
|
|
232
|
+
let aAppVariantInfo;
|
|
239
233
|
if (oResult.response && oResult.response.items) {
|
|
240
234
|
aAppVariantInfo = oResult.response.items;
|
|
241
235
|
} else {
|
|
@@ -254,7 +248,7 @@ function(
|
|
|
254
248
|
}.bind(this));
|
|
255
249
|
};
|
|
256
250
|
|
|
257
|
-
Utils.
|
|
251
|
+
Utils.getManifest = function(mPropertyBag) {
|
|
258
252
|
return AppVariantWriteAPI.getManifest(mPropertyBag).then(function(oResult) {
|
|
259
253
|
return oResult.response;
|
|
260
254
|
});
|