@openui5/sap.ui.rta 1.94.0 → 1.97.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 +12 -12
- package/THIRDPARTY.txt +21 -17
- 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 +108 -73
- package/src/sap/ui/rta/Utils.js +73 -1
- package/src/sap/ui/rta/api/startAdaptation.js +1 -2
- package/src/sap/ui/rta/api/startKeyUserAdaptation.js +2 -2
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +8 -5
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +27 -22
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +108 -85
- package/src/sap/ui/rta/appVariant/Feature.js +5 -12
- package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +2 -1
- package/src/sap/ui/rta/appVariant/Utils.js +10 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +35 -20
- 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/AppDescriptorCommand.js +4 -3
- 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 +4 -4
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +7 -4
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +7 -7
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -6
- 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 +1 -1
- 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/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/appDescriptor/AddLibrary.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 +1 -1
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +14 -12
- package/src/sap/ui/rta/messagebundle_ar.properties +11 -10
- package/src/sap/ui/rta/messagebundle_bg.properties +11 -10
- package/src/sap/ui/rta/messagebundle_ca.properties +10 -9
- package/src/sap/ui/rta/messagebundle_cs.properties +11 -10
- package/src/sap/ui/rta/messagebundle_cy.properties +11 -10
- package/src/sap/ui/rta/messagebundle_da.properties +11 -10
- package/src/sap/ui/rta/messagebundle_de.properties +14 -13
- package/src/sap/ui/rta/messagebundle_el.properties +11 -10
- package/src/sap/ui/rta/messagebundle_en.properties +11 -10
- package/src/sap/ui/rta/messagebundle_en_GB.properties +11 -10
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +11 -10
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +11 -10
- package/src/sap/ui/rta/messagebundle_es.properties +11 -10
- package/src/sap/ui/rta/messagebundle_es_MX.properties +11 -10
- package/src/sap/ui/rta/messagebundle_et.properties +11 -10
- package/src/sap/ui/rta/messagebundle_fi.properties +10 -9
- package/src/sap/ui/rta/messagebundle_fr.properties +11 -10
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +11 -10
- package/src/sap/ui/rta/messagebundle_hi.properties +11 -10
- package/src/sap/ui/rta/messagebundle_hr.properties +11 -10
- package/src/sap/ui/rta/messagebundle_hu.properties +10 -9
- package/src/sap/ui/rta/messagebundle_id.properties +11 -10
- package/src/sap/ui/rta/messagebundle_it.properties +11 -10
- package/src/sap/ui/rta/messagebundle_iw.properties +11 -10
- package/src/sap/ui/rta/messagebundle_ja.properties +11 -10
- package/src/sap/ui/rta/messagebundle_kk.properties +11 -10
- package/src/sap/ui/rta/messagebundle_ko.properties +11 -10
- package/src/sap/ui/rta/messagebundle_lt.properties +11 -10
- package/src/sap/ui/rta/messagebundle_lv.properties +11 -10
- package/src/sap/ui/rta/messagebundle_ms.properties +11 -10
- package/src/sap/ui/rta/messagebundle_nl.properties +11 -10
- package/src/sap/ui/rta/messagebundle_no.properties +11 -10
- package/src/sap/ui/rta/messagebundle_pl.properties +11 -10
- package/src/sap/ui/rta/messagebundle_pt.properties +10 -9
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +10 -9
- package/src/sap/ui/rta/messagebundle_ro.properties +11 -10
- package/src/sap/ui/rta/messagebundle_ru.properties +10 -9
- package/src/sap/ui/rta/messagebundle_sh.properties +11 -10
- package/src/sap/ui/rta/messagebundle_sk.properties +11 -10
- package/src/sap/ui/rta/messagebundle_sl.properties +11 -10
- package/src/sap/ui/rta/messagebundle_sv.properties +11 -10
- package/src/sap/ui/rta/messagebundle_th.properties +16 -15
- package/src/sap/ui/rta/messagebundle_tr.properties +11 -10
- package/src/sap/ui/rta/messagebundle_uk.properties +12 -11
- package/src/sap/ui/rta/messagebundle_vi.properties +11 -10
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +11 -10
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +11 -10
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
- package/src/sap/ui/rta/plugin/Combine.js +1 -1
- package/src/sap/ui/rta/plugin/CompVariant.js +1 -2
- package/src/sap/ui/rta/plugin/ControlVariant.js +10 -5
- 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 +52 -2
- package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/plugin/RTAElementMover.js +14 -62
- 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 +4 -14
- package/src/sap/ui/rta/plugin/Selection.js +1 -1
- package/src/sap/ui/rta/plugin/Settings.js +15 -14
- package/src/sap/ui/rta/plugin/Split.js +2 -1
- package/src/sap/ui/rta/plugin/Stretch.js +133 -138
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +6 -6
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.fragment.xml +74 -0
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +97 -260
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +31 -18
- 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/iframe/AddIFrame.js +8 -5
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +31 -29
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +1 -16
- package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
- 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 +164 -67
- package/src/sap/ui/rta/service/Property.js +1 -3
- package/src/sap/ui/rta/service/Selection.js +2 -1
- package/src/sap/ui/rta/themes/base/ChangeVisualization.less +23 -30
- package/src/sap/ui/rta/themes/base/OverlayWithScrollbar.less +55 -0
- package/src/sap/ui/rta/themes/base/Toolbar.base.less +12 -1
- package/src/sap/ui/rta/themes/base/library.source.less +3 -1
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +26 -14
- package/src/sap/ui/rta/toolbar/Adaptation.js +3 -3
- 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 +3 -3
- 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/translation/Translation.js +1 -1
- package/src/sap/ui/rta/util/BindingsExtractor.js +13 -7
- package/src/sap/ui/rta/util/PluginManager.js +2 -4
- package/src/sap/ui/rta/util/PopupManager.js +3 -11
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +4 -4
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +16 -78
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +15 -37
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +85 -107
- package/src/sap/ui/rta/util/changeVisualization/categories/MoveVisualization.js +30 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/RenameVisualization.js +3 -2
- package/src/sap/ui/rta/util/changeVisualization/categories/SplitVisualization.js +30 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +9 -3
- package/src/sap/ui/rta/util/validateFlexEnabled.js +4 -4
- package/ui5.yaml +4 -1
- package/src/sap/ui/rta/assets/InPageStyles.css +0 -34
- package/src/sap/ui/rta/util/changeVisualization/ChangesListPopover.fragment.xml +0 -23
package/src/sap/ui/rta/Utils.js
CHANGED
|
@@ -12,6 +12,9 @@ sap.ui.define([
|
|
|
12
12
|
"sap/ui/fl/LayerUtils",
|
|
13
13
|
"sap/ui/dt/OverlayUtil",
|
|
14
14
|
"sap/ui/dt/DOMUtil",
|
|
15
|
+
"sap/ui/dt/ElementUtil",
|
|
16
|
+
"sap/ui/dt/MetadataPropagationUtil",
|
|
17
|
+
"sap/ui/rta/util/hasStableId",
|
|
15
18
|
"sap/m/MessageBox",
|
|
16
19
|
"sap/ui/rta/util/BindingsExtractor",
|
|
17
20
|
"sap/base/util/restricted/_omit",
|
|
@@ -26,6 +29,9 @@ function(
|
|
|
26
29
|
FlexLayerUtils,
|
|
27
30
|
OverlayUtil,
|
|
28
31
|
DOMUtil,
|
|
32
|
+
ElementUtil,
|
|
33
|
+
MetadataPropagationUtil,
|
|
34
|
+
hasStableId,
|
|
29
35
|
MessageBox,
|
|
30
36
|
BindingsExtractor,
|
|
31
37
|
_omit,
|
|
@@ -40,7 +46,7 @@ function(
|
|
|
40
46
|
* @class Utility functionality to work with controls, e.g. iterate through aggregations, find parents, etc.
|
|
41
47
|
*
|
|
42
48
|
* @author SAP SE
|
|
43
|
-
* @version 1.
|
|
49
|
+
* @version 1.97.0
|
|
44
50
|
*
|
|
45
51
|
* @private
|
|
46
52
|
* @static
|
|
@@ -553,5 +559,71 @@ function(
|
|
|
553
559
|
}, {});
|
|
554
560
|
};
|
|
555
561
|
|
|
562
|
+
/**
|
|
563
|
+
* Checks drop ability for aggregation overlays
|
|
564
|
+
* @param {sap.ui.dt.Overlay} oAggregationOverlay Aggregation overlay object
|
|
565
|
+
* @param {sap.ui.dt.ElementOverlay} oMovedOverlay Overlay being moved/added
|
|
566
|
+
* @param {sap.ui.rta.Plugin} oPlugin RTA plugin calling this method
|
|
567
|
+
* @param {boolean} [bOverlayNotInDom] Flag defining if overlay is not in DOM
|
|
568
|
+
* @return {Promise.<boolean>} Promise with true value if overlay can be added to the aggregation overlay or false value if not.
|
|
569
|
+
* @override
|
|
570
|
+
*/
|
|
571
|
+
Utils.checkTargetZone = function(oAggregationOverlay, oMovedOverlay, oPlugin, bOverlayNotInDom) {
|
|
572
|
+
function fnHasMoveAction(oAggregationOverlay, oElement, oRelevantContainer, oPlugin) {
|
|
573
|
+
var oAggregationDTMetadata = oAggregationOverlay.getDesignTimeMetadata();
|
|
574
|
+
var oMoveAction = oAggregationDTMetadata.getAction("move", oElement);
|
|
575
|
+
if (!oMoveAction) {
|
|
576
|
+
return Promise.resolve(false);
|
|
577
|
+
}
|
|
578
|
+
// moveChangeHandler information is always located on the relevant container
|
|
579
|
+
return oPlugin.hasChangeHandler(oMoveAction.changeType, oRelevantContainer);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
return ElementUtil.checkTargetZone(oAggregationOverlay, oMovedOverlay, bOverlayNotInDom)
|
|
583
|
+
.then(function(bTargetZone) {
|
|
584
|
+
if (!bTargetZone) {
|
|
585
|
+
return false;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
var oMovedElement = oMovedOverlay.getElement();
|
|
589
|
+
var oTargetOverlay = oAggregationOverlay.getParent();
|
|
590
|
+
var oMovedRelevantContainer = oMovedOverlay.getRelevantContainer();
|
|
591
|
+
|
|
592
|
+
// the element or the parent overlay might be destroyed or not available
|
|
593
|
+
if (!oMovedElement || !oTargetOverlay) {
|
|
594
|
+
return false;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
var oTargetElement = oTargetOverlay.getElement();
|
|
598
|
+
var oAggregationDtMetadata = oAggregationOverlay.getDesignTimeMetadata();
|
|
599
|
+
|
|
600
|
+
// determine target relevantContainer
|
|
601
|
+
var vTargetRelevantContainerAfterMove = MetadataPropagationUtil.getRelevantContainerForPropagation(oAggregationDtMetadata.getData(), oMovedElement);
|
|
602
|
+
vTargetRelevantContainerAfterMove = vTargetRelevantContainerAfterMove || oTargetElement;
|
|
603
|
+
|
|
604
|
+
// check for same relevantContainer
|
|
605
|
+
if (
|
|
606
|
+
!oMovedRelevantContainer
|
|
607
|
+
|| !vTargetRelevantContainerAfterMove
|
|
608
|
+
|| !hasStableId(oTargetOverlay)
|
|
609
|
+
|| oMovedRelevantContainer !== vTargetRelevantContainerAfterMove
|
|
610
|
+
) {
|
|
611
|
+
return false;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
// check if binding context is the same
|
|
615
|
+
if (
|
|
616
|
+
// binding context is not relevant if the element is being moved inside its parent
|
|
617
|
+
oMovedOverlay.getParent().getElement() !== oTargetElement
|
|
618
|
+
&& !Utils.checkSourceTargetBindingCompatibility(oMovedElement, oTargetElement)
|
|
619
|
+
) {
|
|
620
|
+
return false;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
// check if movedOverlay is movable into the target aggregation
|
|
624
|
+
return fnHasMoveAction(oAggregationOverlay, oMovedElement, vTargetRelevantContainerAfterMove, oPlugin);
|
|
625
|
+
});
|
|
626
|
+
};
|
|
627
|
+
|
|
556
628
|
return Utils;
|
|
557
629
|
}, /* bExport= */true);
|
|
@@ -32,7 +32,7 @@ sap.ui.define([
|
|
|
32
32
|
* @alias module:sap/ui/rta/api/startAdaptation
|
|
33
33
|
*
|
|
34
34
|
* @param {object} mOptions - Object with properties
|
|
35
|
-
* @param {sap.ui.core.
|
|
35
|
+
* @param {sap.ui.core.Control|sap.ui.core.UIComponent} mOptions.rootControl - Control instance to get the AppComponent. This then is used to start UI adaptation.
|
|
36
36
|
* @param {object} [mOptions.flexSettings] - Map with flex-related settings
|
|
37
37
|
* @param {string} [mOptions.flexSettings.layer] - The Layer in which RTA should be started. Default: "CUSTOMER"
|
|
38
38
|
* @param {boolean} [mOptions.flexSettings.developerMode] - Whether RTA is started in developerMode mode. Default: <code>false</code>
|
|
@@ -41,7 +41,6 @@ sap.ui.define([
|
|
|
41
41
|
* @param {function} [onFailed] - Event handler function called on failed event
|
|
42
42
|
* @param {function} [onStop] - Event handler function called on stop event
|
|
43
43
|
* @returns {Promise} Resolves when UI adaptation was successfully started
|
|
44
|
-
* @ui5-restricted
|
|
45
44
|
* @public
|
|
46
45
|
*/
|
|
47
46
|
function startAdaptation(mOptions, loadPlugins, onStart, onFailed, onStop) {
|
|
@@ -22,9 +22,9 @@ sap.ui.define([
|
|
|
22
22
|
* @alias module:sap/ui/rta/api/startKeyUserAdaptation
|
|
23
23
|
*
|
|
24
24
|
* @param {object} mPropertyBag - Object with properties
|
|
25
|
-
* @param {sap.ui.core.
|
|
25
|
+
* @param {sap.ui.core.Control|sap.ui.core.UIComponent} mPropertyBag.rootControl - Control instance to get the AppComponent. This then is used to start UI adaptation.
|
|
26
26
|
*
|
|
27
|
-
* @returns {Promise} Resolves when adaptation was successfully started
|
|
27
|
+
* @returns {Promise} Resolves when UI adaptation was successfully started
|
|
28
28
|
* @public
|
|
29
29
|
*/
|
|
30
30
|
function startKeyUserAdaptation(mPropertyBag) {
|
|
@@ -26,6 +26,7 @@ sap.ui.define([
|
|
|
26
26
|
"sap/ui/model/FilterOperator",
|
|
27
27
|
"sap/ui/model/json/JSONModel",
|
|
28
28
|
"sap/ui/rta/Utils",
|
|
29
|
+
"sap/ui/layout/form/SimpleFormLayout",
|
|
29
30
|
// needs to be preloaded for the test to work
|
|
30
31
|
"sap/ui/layout/form/ResponsiveGridLayout"
|
|
31
32
|
],
|
|
@@ -49,7 +50,8 @@ function(
|
|
|
49
50
|
Filter,
|
|
50
51
|
FilterOperator,
|
|
51
52
|
JSONModel,
|
|
52
|
-
RtaUtils
|
|
53
|
+
RtaUtils,
|
|
54
|
+
SimpleFormLayout
|
|
53
55
|
) {
|
|
54
56
|
"use strict";
|
|
55
57
|
|
|
@@ -143,9 +145,10 @@ function(
|
|
|
143
145
|
var aIcons = [];
|
|
144
146
|
|
|
145
147
|
aUI5Icons.forEach(function(sName) {
|
|
148
|
+
var iconInfo = IconPool.getIconInfo(sName);
|
|
146
149
|
aIcons.push({
|
|
147
|
-
icon:
|
|
148
|
-
name: sName.toLowerCase()
|
|
150
|
+
icon: iconInfo.uri,
|
|
151
|
+
name: (iconInfo.text === "") ? sName.toLowerCase() : iconInfo.text
|
|
149
152
|
});
|
|
150
153
|
});
|
|
151
154
|
|
|
@@ -220,7 +223,7 @@ function(
|
|
|
220
223
|
function _createSimpleForm() {
|
|
221
224
|
oSimpleForm = new SimpleForm({
|
|
222
225
|
editable: true,
|
|
223
|
-
layout:
|
|
226
|
+
layout: SimpleFormLayout.ResponsiveGridLayout,
|
|
224
227
|
labelSpanXL: 4,
|
|
225
228
|
labelSpanL: 4,
|
|
226
229
|
labelSpanM: 4,
|
|
@@ -283,7 +286,7 @@ function(
|
|
|
283
286
|
|
|
284
287
|
// initialize dialog and create member variables.
|
|
285
288
|
this.setTitle(oResources.getText("CREATE_APP_VARIANT_DIALOG_TITLE"));
|
|
286
|
-
this.setContentWidth("
|
|
289
|
+
this.setContentWidth("860px");
|
|
287
290
|
this.setContentHeight("250px");
|
|
288
291
|
|
|
289
292
|
oCustomTileModel = new JSONModel({
|
|
@@ -24,7 +24,7 @@ sap.ui.define([
|
|
|
24
24
|
* @class
|
|
25
25
|
* @extends sap.ui.base.ManagedObject
|
|
26
26
|
* @author SAP SE
|
|
27
|
-
* @version 1.
|
|
27
|
+
* @version 1.97.0
|
|
28
28
|
* @constructor
|
|
29
29
|
* @private
|
|
30
30
|
* @since 1.53
|
|
@@ -46,10 +46,6 @@ sap.ui.define([
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* Opens the 'Save As' dialog.
|
|
51
|
-
* @private
|
|
52
|
-
*/
|
|
53
49
|
AppVariantManager.prototype._openDialog = function(fnCreate, fnCancel) {
|
|
54
50
|
var oDialog = new AppVariantDialog("appVariantDialog");
|
|
55
51
|
|
|
@@ -83,6 +79,7 @@ sap.ui.define([
|
|
|
83
79
|
/**
|
|
84
80
|
*
|
|
85
81
|
* @param {Object} oAppVariantSpecificData - Contains the specific info needed to create the inline changes for the app variant
|
|
82
|
+
* @param {sap.ui.fl.Selector} vSelector - Managed object or selector object
|
|
86
83
|
* @returns {Promise[]} returns all the descriptor inline changes
|
|
87
84
|
* @description Creates all the descriptor inline changes for different change types.
|
|
88
85
|
*/
|
|
@@ -108,29 +105,36 @@ sap.ui.define([
|
|
|
108
105
|
aAllInlineChangeOperations.push(AppVariantUtils.createInlineChange(oPropertyChange, "appdescr_ui_setIcon", vSelector));
|
|
109
106
|
|
|
110
107
|
/***********************************************************Inbounds handling******************************************************************/
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
return AppVariantUtils.getInboundInfo(oAppVariantSpecificData.inbounds)
|
|
109
|
+
.then(function(oInboundInfo) {
|
|
110
|
+
var sCurrentRunningInboundId = oInboundInfo.currentRunningInbound;
|
|
113
111
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
// If there is no inbound, create a new inbound
|
|
113
|
+
if (oInboundInfo.addNewInboundRequired) {
|
|
114
|
+
// create a inline change using a change type 'appdescr_app_addNewInbound'
|
|
115
|
+
var oInlineChangePromise = AppVariantUtils.prepareAddNewInboundChange(sCurrentRunningInboundId, sAppVariantId, oAppVariantSpecificData)
|
|
116
|
+
.then(function(oPropertyChange) {
|
|
117
|
+
return AppVariantUtils.createInlineChange(oPropertyChange, "appdescr_app_addNewInbound", vSelector);
|
|
118
|
+
});
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
oPropertyChange = AppVariantUtils.prepareRemoveAllInboundsExceptOneChange(sCurrentRunningInboundId);
|
|
122
|
-
aAllInlineChangeOperations.push(AppVariantUtils.createInlineChange(oPropertyChange, "appdescr_app_removeAllInboundsExceptOne", vSelector));
|
|
123
|
-
} else {
|
|
124
|
-
// create a inline change using a change type 'appdescr_app_changeInbound'
|
|
125
|
-
oPropertyChange = AppVariantUtils.prepareChangeInboundChange(sCurrentRunningInboundId, sAppVariantId, oAppVariantSpecificData);
|
|
126
|
-
aAllInlineChangeOperations.push(AppVariantUtils.createInlineChange(oPropertyChange, "appdescr_app_changeInbound", vSelector));
|
|
127
|
-
}
|
|
120
|
+
aAllInlineChangeOperations.push(oInlineChangePromise);
|
|
128
121
|
|
|
129
|
-
|
|
122
|
+
// create a inline change using a change type 'appdescr_app_removeAllInboundsExceptOne'
|
|
123
|
+
oPropertyChange = AppVariantUtils.prepareRemoveAllInboundsExceptOneChange(sCurrentRunningInboundId);
|
|
124
|
+
aAllInlineChangeOperations.push(AppVariantUtils.createInlineChange(oPropertyChange, "appdescr_app_removeAllInboundsExceptOne", vSelector));
|
|
125
|
+
} else {
|
|
126
|
+
// create a inline change using a change type 'appdescr_app_changeInbound'
|
|
127
|
+
oPropertyChange = AppVariantUtils.prepareChangeInboundChange(sCurrentRunningInboundId, sAppVariantId, oAppVariantSpecificData);
|
|
128
|
+
aAllInlineChangeOperations.push(AppVariantUtils.createInlineChange(oPropertyChange, "appdescr_app_changeInbound", vSelector));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return Promise.all(aAllInlineChangeOperations);
|
|
132
|
+
});
|
|
130
133
|
};
|
|
131
134
|
|
|
132
135
|
/**
|
|
133
136
|
* @param {String} sAppVariantId - Application variant ID
|
|
137
|
+
* @param {sap.ui.fl.Selector} vSelector - Selector
|
|
134
138
|
* @returns {Promise} Resolved promise
|
|
135
139
|
* @description Creates the app variant with all inline changes in backend.
|
|
136
140
|
*/
|
|
@@ -182,6 +186,7 @@ sap.ui.define([
|
|
|
182
186
|
|
|
183
187
|
/**
|
|
184
188
|
* Dirty changes get taken over by the app variant.
|
|
189
|
+
* @returns {Promise} Resolves as soon as the command stack is cleared
|
|
185
190
|
* @private
|
|
186
191
|
*/
|
|
187
192
|
AppVariantManager.prototype._clearRTACommandStack = function() {
|
|
@@ -224,7 +229,7 @@ sap.ui.define([
|
|
|
224
229
|
/**
|
|
225
230
|
*
|
|
226
231
|
* @param {String} sIamId - Identity Access Management ID of SAP Fiori app
|
|
227
|
-
* @param {String}
|
|
232
|
+
* @param {String} sAppVarId - Application variant ID
|
|
228
233
|
* @param {Boolean} bCreation - Indicates that app is being created
|
|
229
234
|
* @returns {Promise} Resolved promise
|
|
230
235
|
* @description When the app variant creation/deletion and catalog assignment/unassignment are executed successfully, this asynchronous process gets triggered. It talks to the server every 2.5 secs.
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
/* global XMLHttpRequest */
|
|
8
|
-
|
|
9
7
|
sap.ui.define([
|
|
10
8
|
"sap/ui/fl/Utils",
|
|
11
9
|
"sap/m/MessageBox",
|
|
@@ -16,8 +14,7 @@ sap.ui.define([
|
|
|
16
14
|
"sap/ui/fl/write/api/PersistenceWriteAPI",
|
|
17
15
|
"sap/ui/fl/write/api/AppVariantWriteAPI",
|
|
18
16
|
"sap/ui/fl/write/api/ChangesWriteAPI"
|
|
19
|
-
],
|
|
20
|
-
function(
|
|
17
|
+
], function(
|
|
21
18
|
FlexUtils,
|
|
22
19
|
MessageBox,
|
|
23
20
|
RtaUtils,
|
|
@@ -167,43 +164,48 @@ function(
|
|
|
167
164
|
if (!oInbounds) {
|
|
168
165
|
oInboundInfo.currentRunningInbound = "customer.savedAsAppVariant";
|
|
169
166
|
oInboundInfo.addNewInboundRequired = true;
|
|
170
|
-
return oInboundInfo;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
var oParsedHash = FlexUtils.getParsedURLHash();
|
|
174
|
-
var aInbounds = Object.keys(oInbounds);
|
|
175
|
-
var aInboundsFound = [];
|
|
176
|
-
|
|
177
|
-
// This will only happen if app variants are created on top of app variants
|
|
178
|
-
if (aInbounds.length === 1 && aInbounds[0] === "customer.savedAsAppVariant") {
|
|
179
|
-
return {
|
|
180
|
-
currentRunningInbound: "customer.savedAsAppVariant",
|
|
181
|
-
addNewInboundRequired: false
|
|
182
|
-
};
|
|
167
|
+
return Promise.resolve(oInboundInfo);
|
|
183
168
|
}
|
|
184
169
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
170
|
+
return FlexUtils.getUShellService("URLParsing")
|
|
171
|
+
.then(function(oURLParsingService) {
|
|
172
|
+
return FlexUtils.getParsedURLHash(oURLParsingService);
|
|
173
|
+
})
|
|
174
|
+
.then(function(oParsedHash) {
|
|
175
|
+
var aInbounds = Object.keys(oInbounds);
|
|
176
|
+
var aInboundsFound = [];
|
|
177
|
+
|
|
178
|
+
// This will only happen if app variants are created on top of app variants
|
|
179
|
+
if (aInbounds.length === 1 && aInbounds[0] === "customer.savedAsAppVariant") {
|
|
180
|
+
return {
|
|
181
|
+
currentRunningInbound: "customer.savedAsAppVariant",
|
|
182
|
+
addNewInboundRequired: false
|
|
183
|
+
};
|
|
184
|
+
}
|
|
190
185
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
186
|
+
aInbounds.forEach(function(sInboundId) {
|
|
187
|
+
if ((oInbounds[sInboundId].action === oParsedHash.action) && (oInbounds[sInboundId].semanticObject === oParsedHash.semanticObject)) {
|
|
188
|
+
aInboundsFound.push(sInboundId);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
switch (aInboundsFound.length) {
|
|
193
|
+
case 0:
|
|
194
|
+
oInboundInfo.currentRunningInbound = "customer.savedAsAppVariant";
|
|
195
|
+
oInboundInfo.addNewInboundRequired = true;
|
|
196
|
+
break;
|
|
197
|
+
case 1:
|
|
198
|
+
oInboundInfo.currentRunningInbound = aInboundsFound[0];
|
|
199
|
+
oInboundInfo.addNewInboundRequired = false;
|
|
200
|
+
break;
|
|
201
|
+
default:
|
|
202
|
+
oInboundInfo.currentRunningInbound = "customer.savedAsAppVariant";
|
|
203
|
+
oInboundInfo.addNewInboundRequired = true;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
205
206
|
|
|
206
|
-
|
|
207
|
+
return oInboundInfo;
|
|
208
|
+
});
|
|
207
209
|
};
|
|
208
210
|
|
|
209
211
|
AppVariantUtils.getInboundPropertiesKey = function(sAppVariantId, sCurrentRunningInboundId, sPropertyName) {
|
|
@@ -230,47 +232,60 @@ function(
|
|
|
230
232
|
};
|
|
231
233
|
};
|
|
232
234
|
|
|
235
|
+
/**
|
|
236
|
+
* Collects the inbound properties and adds to the change content
|
|
237
|
+
*
|
|
238
|
+
* @param {string} sCurrentRunningInboundId - Identifier of current running inbound
|
|
239
|
+
* @param {string} sAppVariantId - App Variant Identifier
|
|
240
|
+
* @param {object} oAppVariantSpecificData - App Variant specific data (e.g. reference App Id)
|
|
241
|
+
* @returns {Promise<object>} resolving to property object containing inbound properties
|
|
242
|
+
*/
|
|
233
243
|
AppVariantUtils.prepareAddNewInboundChange = function(sCurrentRunningInboundId, sAppVariantId, oAppVariantSpecificData) {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
return FlexUtils.getUShellService("URLParsing")
|
|
245
|
+
.then(function(oURLParsingService) {
|
|
246
|
+
return FlexUtils.getParsedURLHash(oURLParsingService);
|
|
247
|
+
})
|
|
248
|
+
.then(function(oParsedHash) {
|
|
249
|
+
var oProperty = {
|
|
250
|
+
content: {
|
|
251
|
+
inbound: {}
|
|
252
|
+
},
|
|
253
|
+
texts: {}
|
|
254
|
+
};
|
|
244
255
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
var sInboundTitleKey = this.getInboundPropertiesKey(oAppVariantSpecificData.referenceAppId, sCurrentRunningInboundId, "title");
|
|
257
|
+
var sInboundSubTitleKey = this.getInboundPropertiesKey(oAppVariantSpecificData.referenceAppId, sCurrentRunningInboundId, "subTitle");
|
|
258
|
+
|
|
259
|
+
// Filling change content
|
|
260
|
+
oProperty.content.inbound[sCurrentRunningInboundId] = {
|
|
261
|
+
semanticObject: oParsedHash.semanticObject,
|
|
262
|
+
action: oParsedHash.action,
|
|
263
|
+
title: "{{" + sInboundTitleKey + "}}",
|
|
264
|
+
subTitle: "{{" + sInboundSubTitleKey + "}}",
|
|
265
|
+
icon: oAppVariantSpecificData.icon,
|
|
266
|
+
signature: {
|
|
267
|
+
parameters: {
|
|
268
|
+
"sap-appvar-id": {
|
|
269
|
+
required: true,
|
|
270
|
+
filter: {
|
|
271
|
+
value: sAppVariantId,
|
|
272
|
+
format: "plain"
|
|
273
|
+
},
|
|
274
|
+
launcherValue: {
|
|
275
|
+
value: sAppVariantId
|
|
276
|
+
}
|
|
277
|
+
}
|
|
259
278
|
},
|
|
260
|
-
|
|
261
|
-
value: sAppVariantId
|
|
262
|
-
}
|
|
279
|
+
additionalParameters: "ignored"
|
|
263
280
|
}
|
|
264
|
-
}
|
|
265
|
-
additionalParameters: "ignored"
|
|
266
|
-
}
|
|
267
|
-
};
|
|
281
|
+
};
|
|
268
282
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
283
|
+
// Filling change texts
|
|
284
|
+
oProperty.texts[sInboundTitleKey] = this.prepareTextsChange("title", oAppVariantSpecificData.title);
|
|
285
|
+
oProperty.texts[sInboundSubTitleKey] = this.prepareTextsChange("subTitle", oAppVariantSpecificData.subTitle);
|
|
272
286
|
|
|
273
|
-
|
|
287
|
+
return oProperty;
|
|
288
|
+
}.bind(this));
|
|
274
289
|
};
|
|
275
290
|
|
|
276
291
|
AppVariantUtils.prepareChangeInboundChange = function(sCurrentRunningInboundId, sAppVariantId, oAppVariantSpecificData) {
|
|
@@ -462,9 +477,6 @@ function(
|
|
|
462
477
|
};
|
|
463
478
|
};
|
|
464
479
|
|
|
465
|
-
/**
|
|
466
|
-
* Builds the final success message on S/4HANA Cloud.
|
|
467
|
-
*/
|
|
468
480
|
AppVariantUtils.buildFinalSuccessInfoS4HANACloud = function() {
|
|
469
481
|
var sMessage = AppVariantUtils.getText("MSG_SAVE_APP_VARIANT_NEW_TILE_AVAILABLE");
|
|
470
482
|
return { text: sMessage };
|
|
@@ -546,18 +558,29 @@ function(
|
|
|
546
558
|
|
|
547
559
|
/**
|
|
548
560
|
* Navigates to the Fiorilaunchpad
|
|
561
|
+
* @returns {Promise} resolving when the navigation is triggered if ushell is available
|
|
549
562
|
*/
|
|
550
563
|
AppVariantUtils.navigateToFLPHomepage = function() {
|
|
551
|
-
var
|
|
552
|
-
var oComponentInstance
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
564
|
+
var oUshellContainer = FlexUtils.getUshellContainer();
|
|
565
|
+
var oComponentInstance;
|
|
566
|
+
if (oUshellContainer) {
|
|
567
|
+
return oUshellContainer.getServiceAsync("AppConfiguration")
|
|
568
|
+
.then(function(oAppConfiguration) {
|
|
569
|
+
var oApplication = oAppConfiguration.getCurrentApplication();
|
|
570
|
+
oComponentInstance = oApplication.componentHandle.getInstance();
|
|
571
|
+
if (oComponentInstance) {
|
|
572
|
+
return oUshellContainer.getServiceAsync("CrossApplicationNavigation");
|
|
573
|
+
}
|
|
574
|
+
return undefined;
|
|
575
|
+
})
|
|
576
|
+
.then(function(oCrossAppNav) {
|
|
577
|
+
if (oCrossAppNav && oCrossAppNav.toExternal) {
|
|
578
|
+
oCrossAppNav.toExternal({target: {shellHash: "#"}}, oComponentInstance);
|
|
579
|
+
}
|
|
580
|
+
})
|
|
581
|
+
.catch(function(vError) {
|
|
582
|
+
throw new Error("Error navigating to FLP Homepage: " + vError);
|
|
583
|
+
});
|
|
561
584
|
}
|
|
562
585
|
return Promise.resolve();
|
|
563
586
|
};
|
|
@@ -168,23 +168,16 @@ sap.ui.define([
|
|
|
168
168
|
if (oDescriptor["sap.app"] && oDescriptor["sap.app"].id) {
|
|
169
169
|
return FeaturesAPI.isSaveAsAvailable(sCurrentLayer).then(function(bIsSaveAsAvailable) {
|
|
170
170
|
if (bIsSaveAsAvailable) {
|
|
171
|
-
var oInboundInfo;
|
|
172
|
-
|
|
173
171
|
if (oDescriptor["sap.app"].crossNavigation && oDescriptor["sap.app"].crossNavigation.inbounds) {
|
|
174
|
-
|
|
175
|
-
} else {
|
|
176
|
-
oInboundInfo = AppVariantUtils.getInboundInfo();
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (oInboundInfo) {
|
|
180
|
-
return true;
|
|
172
|
+
return AppVariantUtils.getInboundInfo(oDescriptor["sap.app"].crossNavigation.inbounds);
|
|
181
173
|
}
|
|
174
|
+
return AppVariantUtils.getInboundInfo();
|
|
182
175
|
}
|
|
183
|
-
|
|
184
|
-
|
|
176
|
+
return undefined;
|
|
177
|
+
}).then(function(oInboundInfo) {
|
|
178
|
+
return !!oInboundInfo;
|
|
185
179
|
});
|
|
186
180
|
}
|
|
187
|
-
|
|
188
181
|
return Promise.resolve(false);
|
|
189
182
|
},
|
|
190
183
|
/**
|
|
@@ -143,7 +143,8 @@ sap.ui.define([
|
|
|
143
143
|
/**
|
|
144
144
|
* Polls the OData model to check catalog publishing status of the given IAM app ID.
|
|
145
145
|
*
|
|
146
|
-
* @param
|
|
146
|
+
* @param {string} sIamAppId - Identity Access Management ID of SAP Fiori app
|
|
147
|
+
* @param {boolean} bAppVarCreation - Indicates if it's a creation scenario
|
|
147
148
|
* @return {Promise<boolean>} Promise delivering a boolean value
|
|
148
149
|
* @async
|
|
149
150
|
*/
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
sap.ui.define([
|
|
7
7
|
"sap/ui/rta/appVariant/AppVariantUtils",
|
|
8
8
|
"sap/ui/fl/registry/Settings",
|
|
9
|
+
"sap/ui/fl/Utils",
|
|
9
10
|
"sap/base/i18n/ResourceBundle",
|
|
10
11
|
"sap/ui/fl/write/api/AppVariantWriteAPI",
|
|
11
12
|
"sap/ui/core/IconPool"
|
|
@@ -13,6 +14,7 @@ sap.ui.define([
|
|
|
13
14
|
function(
|
|
14
15
|
AppVariantUtils,
|
|
15
16
|
Settings,
|
|
17
|
+
FlUtils,
|
|
16
18
|
ResourceBundle,
|
|
17
19
|
AppVariantWriteAPI,
|
|
18
20
|
IconPool
|
|
@@ -27,8 +29,14 @@ function(
|
|
|
27
29
|
});
|
|
28
30
|
|
|
29
31
|
Utils._checkNavigationSupported = function(oNavigationParams) {
|
|
30
|
-
var
|
|
31
|
-
return
|
|
32
|
+
var oUShellContainer = FlUtils.getUshellContainer();
|
|
33
|
+
return oUShellContainer.getServiceAsync("CrossApplicationNavigation")
|
|
34
|
+
.then(function(oNavigationService) {
|
|
35
|
+
return oNavigationService.getLinks(oNavigationParams);
|
|
36
|
+
})
|
|
37
|
+
.catch(function(vError) {
|
|
38
|
+
throw new Error("Error retrieving ushell service CrossApplicationNavigation: " + vError);
|
|
39
|
+
});
|
|
32
40
|
};
|
|
33
41
|
|
|
34
42
|
Utils._checkAppType = function(bOriginalApp, bAppVariant) {
|