@openui5/sap.ui.rta 1.131.1 → 1.132.1
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/.eslintrc.json +1 -2
- package/THIRDPARTY.txt +1 -1
- package/package.json +6 -6
- package/src/sap/ui/rta/.library +2 -2
- package/src/sap/ui/rta/Client.js +2 -2
- package/src/sap/ui/rta/RuntimeAuthoring.js +26 -10
- package/src/sap/ui/rta/Utils.js +2 -2
- package/src/sap/ui/rta/api/startAdaptation.js +1 -1
- package/src/sap/ui/rta/api/startKeyUserAdaptation.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +2 -2
- package/src/sap/ui/rta/appVariant/AppVariantOverviewDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +1 -1
- package/src/sap/ui/rta/appVariant/Feature.js +1 -1
- package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +1 -1
- package/src/sap/ui/rta/appVariant/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/Component.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saptrc.properties +27 -27
- package/src/sap/ui/rta/appVariant/manageApps/webapp/index.html +3 -3
- package/src/sap/ui/rta/appVariant/manageApps/webapp/index.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/model/models.js +1 -1
- package/src/sap/ui/rta/command/AddIFrame.js +2 -2
- package/src/sap/ui/rta/command/AddProperty.js +2 -2
- package/src/sap/ui/rta/command/AddXML.js +2 -2
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +2 -2
- package/src/sap/ui/rta/command/AnnotationCommand.js +79 -0
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +2 -2
- package/src/sap/ui/rta/command/BaseCommand.js +2 -2
- package/src/sap/ui/rta/command/BindProperty.js +6 -8
- package/src/sap/ui/rta/command/Combine.js +2 -2
- package/src/sap/ui/rta/command/CommandFactory.js +3 -3
- package/src/sap/ui/rta/command/CompositeCommand.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +9 -5
- package/src/sap/ui/rta/command/ControlVariantSave.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +8 -6
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +14 -11
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +6 -4
- package/src/sap/ui/rta/command/CreateContainer.js +2 -2
- package/src/sap/ui/rta/command/CustomAdd.js +2 -2
- package/src/sap/ui/rta/command/FlexCommand.js +2 -2
- package/src/sap/ui/rta/command/LREPSerializer.js +2 -2
- package/src/sap/ui/rta/command/LocalReset.js +2 -2
- package/src/sap/ui/rta/command/Move.js +2 -2
- package/src/sap/ui/rta/command/Property.js +2 -2
- package/src/sap/ui/rta/command/Remove.js +2 -2
- package/src/sap/ui/rta/command/Rename.js +2 -2
- package/src/sap/ui/rta/command/Resize.js +2 -2
- package/src/sap/ui/rta/command/Reveal.js +2 -2
- package/src/sap/ui/rta/command/Settings.js +2 -2
- package/src/sap/ui/rta/command/Split.js +2 -2
- package/src/sap/ui/rta/command/Stack.js +2 -2
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +14 -2
- package/src/sap/ui/rta/enablement/TestDelegate.js +1 -1
- package/src/sap/ui/rta/enablement/elementActionTest.js +15 -16
- package/src/sap/ui/rta/library.js +3 -3
- package/src/sap/ui/rta/messagebundle.properties +18 -0
- package/src/sap/ui/rta/messagebundle_ar.properties +10 -0
- package/src/sap/ui/rta/messagebundle_bg.properties +13 -3
- package/src/sap/ui/rta/messagebundle_ca.properties +10 -0
- package/src/sap/ui/rta/messagebundle_cnr.properties +10 -0
- package/src/sap/ui/rta/messagebundle_cs.properties +10 -0
- package/src/sap/ui/rta/messagebundle_cy.properties +10 -0
- package/src/sap/ui/rta/messagebundle_da.properties +10 -0
- package/src/sap/ui/rta/messagebundle_de.properties +10 -0
- package/src/sap/ui/rta/messagebundle_el.properties +10 -0
- package/src/sap/ui/rta/messagebundle_en.properties +10 -0
- package/src/sap/ui/rta/messagebundle_en_GB.properties +10 -0
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +10 -0
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +347 -325
- package/src/sap/ui/rta/messagebundle_es.properties +10 -0
- package/src/sap/ui/rta/messagebundle_es_MX.properties +18 -8
- package/src/sap/ui/rta/messagebundle_et.properties +10 -0
- package/src/sap/ui/rta/messagebundle_fi.properties +10 -0
- package/src/sap/ui/rta/messagebundle_fr.properties +10 -0
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +10 -0
- package/src/sap/ui/rta/messagebundle_hi.properties +10 -0
- package/src/sap/ui/rta/messagebundle_hr.properties +10 -0
- package/src/sap/ui/rta/messagebundle_hu.properties +10 -0
- package/src/sap/ui/rta/messagebundle_id.properties +10 -0
- package/src/sap/ui/rta/messagebundle_it.properties +10 -0
- package/src/sap/ui/rta/messagebundle_iw.properties +10 -0
- package/src/sap/ui/rta/messagebundle_ja.properties +10 -0
- package/src/sap/ui/rta/messagebundle_kk.properties +10 -0
- package/src/sap/ui/rta/messagebundle_ko.properties +10 -0
- package/src/sap/ui/rta/messagebundle_lt.properties +10 -0
- package/src/sap/ui/rta/messagebundle_lv.properties +10 -0
- package/src/sap/ui/rta/messagebundle_mk.properties +10 -0
- package/src/sap/ui/rta/messagebundle_ms.properties +14 -4
- package/src/sap/ui/rta/messagebundle_nl.properties +10 -0
- package/src/sap/ui/rta/messagebundle_no.properties +10 -0
- package/src/sap/ui/rta/messagebundle_pl.properties +10 -0
- package/src/sap/ui/rta/messagebundle_pt.properties +10 -0
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +10 -0
- package/src/sap/ui/rta/messagebundle_ro.properties +10 -0
- package/src/sap/ui/rta/messagebundle_ru.properties +10 -0
- package/src/sap/ui/rta/messagebundle_sh.properties +10 -0
- package/src/sap/ui/rta/messagebundle_sk.properties +10 -0
- package/src/sap/ui/rta/messagebundle_sl.properties +10 -0
- package/src/sap/ui/rta/messagebundle_sr.properties +10 -0
- package/src/sap/ui/rta/messagebundle_sv.properties +10 -0
- package/src/sap/ui/rta/messagebundle_th.properties +10 -0
- package/src/sap/ui/rta/messagebundle_tr.properties +10 -0
- package/src/sap/ui/rta/messagebundle_uk.properties +11 -1
- package/src/sap/ui/rta/messagebundle_vi.properties +10 -0
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +10 -0
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +10 -0
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +2 -2
- package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
- package/src/sap/ui/rta/plugin/Combine.js +2 -2
- package/src/sap/ui/rta/plugin/CompVariant.js +4 -2
- package/src/sap/ui/rta/plugin/ControlVariant.js +5 -23
- package/src/sap/ui/rta/plugin/CreateContainer.js +2 -2
- package/src/sap/ui/rta/plugin/CutPaste.js +2 -2
- package/src/sap/ui/rta/plugin/DragDrop.js +2 -2
- package/src/sap/ui/rta/plugin/LocalReset.js +2 -2
- package/src/sap/ui/rta/plugin/Plugin.js +15 -13
- package/src/sap/ui/rta/plugin/RTAElementMover.js +2 -2
- package/src/sap/ui/rta/plugin/Remove.js +2 -2
- package/src/sap/ui/rta/plugin/Rename.js +3 -3
- package/src/sap/ui/rta/plugin/RenameHandler.js +5 -9
- package/src/sap/ui/rta/plugin/Resize.js +3 -3
- package/src/sap/ui/rta/plugin/Selection.js +2 -2
- package/src/sap/ui/rta/plugin/Settings.js +2 -21
- package/src/sap/ui/rta/plugin/Split.js +2 -2
- package/src/sap/ui/rta/plugin/Stretch.js +7 -5
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +94 -126
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +28 -31
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +141 -172
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +108 -137
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +2 -2
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +96 -141
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.fragment.xml +112 -0
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.js +183 -0
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +109 -0
- package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +239 -0
- package/src/sap/ui/rta/plugin/annotations/AnnotationTypes.js +15 -0
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +3 -3
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
- package/src/sap/ui/rta/service/Action.js +2 -2
- package/src/sap/ui/rta/service/ControllerExtension.js +2 -2
- package/src/sap/ui/rta/service/Outline.js +2 -2
- package/src/sap/ui/rta/service/Property.js +2 -2
- package/src/sap/ui/rta/service/Receiver.js +1 -1
- package/src/sap/ui/rta/service/Selection.js +2 -2
- package/src/sap/ui/rta/service/SupportTools.js +2 -2
- package/src/sap/ui/rta/service/index.js +1 -1
- package/src/sap/ui/rta/themes/base/WhatsNew.less +5 -0
- package/src/sap/ui/rta/themes/base/library.source.less +1 -1
- package/src/sap/ui/rta/themes/sap_hcb/library.source.less +1 -1
- package/src/sap/ui/rta/toolbar/Adaptation.js +2 -2
- package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
- package/src/sap/ui/rta/toolbar/Base.js +2 -2
- package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +3 -4
- package/src/sap/ui/rta/toolbar/FioriLike.js +2 -2
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +2 -2
- package/src/sap/ui/rta/toolbar/Standalone.js +2 -2
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +1 -1
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +2 -2
- package/src/sap/ui/rta/toolbar/translation/Translation.js +3 -3
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +2 -2
- 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 +16 -10
- package/src/sap/ui/rta/util/PopupManager.js +3 -3
- package/src/sap/ui/rta/util/ReloadManager.js +9 -9
- package/src/sap/ui/rta/util/ServiceEventBus.js +2 -2
- package/src/sap/ui/rta/util/ServiceManager.js +2 -2
- package/src/sap/ui/rta/util/adaptationStarter.js +17 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +5 -3
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/MoveVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/RenameVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +1 -1
- package/src/sap/ui/rta/util/hasStableId.js +1 -1
- package/src/sap/ui/rta/util/showMessageBox.js +1 -1
- package/src/sap/ui/rta/util/validateFlexEnabled.js +1 -1
- package/src/sap/ui/rta/util/validateStableIds.js +1 -1
- package/src/sap/ui/rta/util/validateText.js +1 -1
- package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +2 -2
- package/src/sap/ui/rta/util/whatsNew/WhatsNewDialog.fragment.xml +5 -4
- package/src/sap/ui/rta/util/whatsNew/WhatsNewOverview.js +1 -1
- package/src/sap/ui/rta/util/whatsNew/WhatsNewOverviewDialog.fragment.xml +8 -2
- package/src/sap/ui/rta/util/whatsNew/WhatsNewUtils.js +1 -1
- package/src/sap/ui/rta/util/whatsNew/whatsNewContent/WhatsNewFeatures.js +1 -1
- package/src/sap/ui/rta/command/Annotation.js +0 -45
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2025 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -21,12 +21,12 @@ sap.ui.define([
|
|
|
21
21
|
) {
|
|
22
22
|
"use strict";
|
|
23
23
|
|
|
24
|
-
function
|
|
24
|
+
function checkForAbsoluteAggregationBinding(oElement, sAggregationName, sModelName) {
|
|
25
25
|
if (!oElement) {
|
|
26
26
|
return false;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const mBindingInfo = oElement.getBindingInfo(sAggregationName, sModelName);
|
|
29
|
+
let sPath = mBindingInfo && mBindingInfo.path;
|
|
30
30
|
if (!sPath) {
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
@@ -36,8 +36,8 @@ sap.ui.define([
|
|
|
36
36
|
return sPath.indexOf("/") === 0;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
function
|
|
40
|
-
|
|
39
|
+
function getModelBindingData(oElement, bAbsoluteAggregationBinding, sAggregationName, sModelName) {
|
|
40
|
+
let vBinding;
|
|
41
41
|
if (bAbsoluteAggregationBinding) {
|
|
42
42
|
vBinding = oElement.getBindingInfo(sAggregationName, sModelName);
|
|
43
43
|
// check to be model binding otherwise return undefined
|
|
@@ -51,15 +51,16 @@ sap.ui.define([
|
|
|
51
51
|
return vBinding;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
function getBindingContextPath(oElement, sAggregationName, sModelName) {
|
|
55
|
+
const bAbsoluteAggregationBinding = checkForAbsoluteAggregationBinding(oElement, sAggregationName, sModelName);
|
|
56
|
+
const vBinding = getModelBindingData(oElement, bAbsoluteAggregationBinding, sAggregationName, sModelName);
|
|
57
57
|
if (vBinding) {
|
|
58
58
|
return bAbsoluteAggregationBinding ? vBinding.path : vBinding.getPath();
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
|
|
62
|
+
function flattenProperties(aProperties) {
|
|
63
|
+
const aFlattenedProperties = aProperties.reduce(function(aFlattened, oProperty) {
|
|
63
64
|
if (Array.isArray(oProperty.properties)) {
|
|
64
65
|
// only one level supported by our dialogs
|
|
65
66
|
// Only take the leaves, but attach the parent property name/label to it
|
|
@@ -76,54 +77,50 @@ sap.ui.define([
|
|
|
76
77
|
return aFlattenedProperties;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
function
|
|
80
|
-
|
|
80
|
+
async function getAllPropertiesFromAddViaDelegateAction(oElement, sAggregationName, mAction) {
|
|
81
|
+
const aProperties = await mAction.delegateInfo.delegate.getPropertyInfo({
|
|
81
82
|
element: oElement,
|
|
82
83
|
aggregationName: sAggregationName,
|
|
83
84
|
payload: mAction.delegateInfo.payload || {}
|
|
84
|
-
};
|
|
85
|
-
return
|
|
86
|
-
.then(_flattenProperties.bind(null));
|
|
85
|
+
});
|
|
86
|
+
return flattenProperties(aProperties);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
function getAllPropertiesFromDelegate(oElement, sAggregationName) {
|
|
90
|
-
|
|
89
|
+
async function getAllPropertiesFromDelegate(oElement, sAggregationName) {
|
|
90
|
+
const mDelegateInfo = await DelegateMediatorAPI.getReadDelegateForControl({
|
|
91
91
|
control: oElement,
|
|
92
92
|
modifier: JsControlTreeModifier
|
|
93
|
-
}).then(function(mDelegateInfo) {
|
|
94
|
-
if (mDelegateInfo && mDelegateInfo.instance) {
|
|
95
|
-
return mDelegateInfo.instance.getPropertyInfo({
|
|
96
|
-
element: oElement,
|
|
97
|
-
aggregationName: sAggregationName,
|
|
98
|
-
payload: mDelegateInfo.payload || {}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
return [];
|
|
102
93
|
});
|
|
94
|
+
if (mDelegateInfo && mDelegateInfo.instance) {
|
|
95
|
+
return mDelegateInfo.instance.getPropertyInfo({
|
|
96
|
+
element: oElement,
|
|
97
|
+
aggregationName: sAggregationName,
|
|
98
|
+
payload: mDelegateInfo.payload || {}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return [];
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
function
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
async function getAllPropertiesFromModels(oElement, sAggregationName, mActions) {
|
|
105
|
+
const mAddViaDelegate = mActions.addViaDelegate;
|
|
106
|
+
let fnGetAllProperties;
|
|
108
107
|
if (mAddViaDelegate) {
|
|
109
|
-
fnGetAllProperties =
|
|
108
|
+
fnGetAllProperties = getAllPropertiesFromAddViaDelegateAction.bind(null, oElement, sAggregationName, mAddViaDelegate);
|
|
110
109
|
} else {
|
|
111
110
|
fnGetAllProperties = getAllPropertiesFromDelegate.bind(null, oElement, sAggregationName);
|
|
112
111
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return _checkForDuplicateProperties(aProperties);
|
|
116
|
-
});
|
|
112
|
+
const aProperties = await fnGetAllProperties();
|
|
113
|
+
return checkForDuplicateProperties(aProperties);
|
|
117
114
|
}
|
|
118
115
|
|
|
119
|
-
function
|
|
116
|
+
function filterUnsupportedProperties(aProperties) {
|
|
120
117
|
return aProperties.filter(function(mProperty) {
|
|
121
118
|
// see _enrichProperty
|
|
122
119
|
return !(mProperty.unsupported || mProperty.hideFromReveal);
|
|
123
120
|
});
|
|
124
121
|
}
|
|
125
122
|
|
|
126
|
-
function
|
|
123
|
+
function oPropertyToAdditionalElementInfo(oProperty) {
|
|
127
124
|
return {
|
|
128
125
|
selected: false,
|
|
129
126
|
label: oProperty.label || oProperty.name,
|
|
@@ -139,9 +136,9 @@ sap.ui.define([
|
|
|
139
136
|
};
|
|
140
137
|
}
|
|
141
138
|
|
|
142
|
-
function
|
|
143
|
-
|
|
144
|
-
|
|
139
|
+
function elementToAdditionalElementInfo(mData) {
|
|
140
|
+
const oElement = mData.element;
|
|
141
|
+
const mAction = mData.action;
|
|
145
142
|
return {
|
|
146
143
|
selected: false,
|
|
147
144
|
label: oElement.__label || ElementUtil.getLabelForElement(oElement, mAction.getLabel),
|
|
@@ -166,27 +163,25 @@ sap.ui.define([
|
|
|
166
163
|
* @param {string} sModelName - model name
|
|
167
164
|
*
|
|
168
165
|
* @return {sap.ui.core.Element[]} - returns an array with found siblings elements
|
|
169
|
-
*
|
|
170
|
-
* @private
|
|
171
166
|
*/
|
|
172
|
-
function
|
|
167
|
+
function getRelevantElements(oElement, oRelevantContainer, sAggregationName, sModelName) {
|
|
173
168
|
if (oRelevantContainer && oRelevantContainer !== oElement) {
|
|
174
|
-
|
|
169
|
+
const sRelevantContainerBindingContext = getBindingContextPath(oElement, sAggregationName, sModelName);
|
|
175
170
|
|
|
176
171
|
return ElementUtil
|
|
177
172
|
.findAllSiblingsInContainer(oElement, oRelevantContainer)
|
|
178
173
|
// We accept only siblings that are bound on the same model
|
|
179
174
|
.filter(function(oSiblingElement) {
|
|
180
|
-
return sRelevantContainerBindingContext ===
|
|
175
|
+
return sRelevantContainerBindingContext === getBindingContextPath(oSiblingElement, sAggregationName, sModelName);
|
|
181
176
|
});
|
|
182
177
|
}
|
|
183
178
|
return [oElement];
|
|
184
179
|
}
|
|
185
180
|
|
|
186
|
-
function
|
|
181
|
+
function checkForDuplicateProperties(aProperties) {
|
|
187
182
|
aProperties.forEach(function(oModelProperty, index, aProperties) {
|
|
188
183
|
if (oModelProperty.duplicateName !== true) {
|
|
189
|
-
for (
|
|
184
|
+
for (let j = index + 1; j < aProperties.length - 1; j++) {
|
|
190
185
|
if (oModelProperty.label === aProperties[j].label) {
|
|
191
186
|
oModelProperty.duplicateName = true;
|
|
192
187
|
aProperties[j].duplicateName = true;
|
|
@@ -198,7 +193,7 @@ sap.ui.define([
|
|
|
198
193
|
}
|
|
199
194
|
|
|
200
195
|
// check for duplicate labels to later add the parent property name/label if available
|
|
201
|
-
function
|
|
196
|
+
function checkForDuplicateLabels(oInvisibleElement, aProperties) {
|
|
202
197
|
return aProperties.some(function(oModelProperty) {
|
|
203
198
|
return oModelProperty.label === oInvisibleElement.__label;
|
|
204
199
|
});
|
|
@@ -208,9 +203,8 @@ sap.ui.define([
|
|
|
208
203
|
* Checks if array of paths is not empty
|
|
209
204
|
* @param {string[]} aBindingPaths - Array of collected binding paths
|
|
210
205
|
* @return {boolean} - true if it has binding(s)
|
|
211
|
-
* @private
|
|
212
206
|
*/
|
|
213
|
-
function
|
|
207
|
+
function hasBindings(aBindingPaths) {
|
|
214
208
|
return Array.isArray(aBindingPaths) && aBindingPaths.length > 0;
|
|
215
209
|
}
|
|
216
210
|
|
|
@@ -221,10 +215,8 @@ sap.ui.define([
|
|
|
221
215
|
* @param {object[]} aProperties - Array of Fields
|
|
222
216
|
*
|
|
223
217
|
* @return {object|undefined} - returns first found Object with Field (Property) description, undefined if not found
|
|
224
|
-
*
|
|
225
|
-
* @private
|
|
226
218
|
*/
|
|
227
|
-
function
|
|
219
|
+
function findModelProperty(aControlsBindingPaths, aProperties) {
|
|
228
220
|
return aProperties
|
|
229
221
|
.sort(function(oProperty1, oProperty2) {
|
|
230
222
|
// Temporary fix to avoid evaluating technical properties like RAP feature
|
|
@@ -247,7 +239,7 @@ sap.ui.define([
|
|
|
247
239
|
.pop();
|
|
248
240
|
}
|
|
249
241
|
|
|
250
|
-
function
|
|
242
|
+
function vBindingToPath(vBinding) {
|
|
251
243
|
return (
|
|
252
244
|
isPlainObject(vBinding)
|
|
253
245
|
? vBinding.parts[0].path // TODO what about complex bindings with multiple paths, this was not covered so far?
|
|
@@ -255,23 +247,23 @@ sap.ui.define([
|
|
|
255
247
|
);
|
|
256
248
|
}
|
|
257
249
|
|
|
258
|
-
function
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
250
|
+
function getRepresentedBindingPathsFromBinding(oElement, mAction, sModelName, sAggregationName) {
|
|
251
|
+
const oModel = oElement.getModel(sModelName);
|
|
252
|
+
const aRelevantElements = getRelevantElements(oElement, mAction.relevantContainer, sAggregationName, sModelName);
|
|
253
|
+
let aBindingPaths = [];
|
|
262
254
|
|
|
263
255
|
aRelevantElements.forEach(function(oElement) {
|
|
264
256
|
aBindingPaths = aBindingPaths.concat(BindingsExtractor.getBindings({
|
|
265
257
|
element: oElement,
|
|
266
258
|
model: oModel,
|
|
267
259
|
parent: oElement.getParent()
|
|
268
|
-
}).map(
|
|
260
|
+
}).map(vBindingToPath));
|
|
269
261
|
});
|
|
270
262
|
return aBindingPaths;
|
|
271
263
|
}
|
|
272
264
|
|
|
273
|
-
function
|
|
274
|
-
|
|
265
|
+
function getRepresentedPropertiesFromDelegate(mAction, sAggregationName) {
|
|
266
|
+
const mPropertyBag = {
|
|
275
267
|
element: mAction.relevantContainer,
|
|
276
268
|
aggregationName: sAggregationName,
|
|
277
269
|
payload: mAction.delegateInfo.payload || {}
|
|
@@ -279,30 +271,26 @@ sap.ui.define([
|
|
|
279
271
|
return mAction.delegateInfo.delegate.getRepresentedProperties(mPropertyBag);
|
|
280
272
|
}
|
|
281
273
|
|
|
282
|
-
function
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
aBindingPaths = aBindingPaths.concat(oRepresentedProperty.bindingPaths);
|
|
292
|
-
});
|
|
293
|
-
return aBindingPaths;
|
|
274
|
+
async function getRepresentedBindingPathsFromDelegateOrBinding(oElement, mAction, sModelName, sAggregationName) {
|
|
275
|
+
const aRepresentedProperties = await getRepresentedPropertiesFromDelegate(mAction, sAggregationName);
|
|
276
|
+
if (aRepresentedProperties === undefined) {
|
|
277
|
+
// delegate skipped taking over => evaluate binding
|
|
278
|
+
return getRepresentedBindingPathsFromBinding(oElement, mAction, sModelName, sAggregationName);
|
|
279
|
+
}
|
|
280
|
+
let aBindingPaths = [];
|
|
281
|
+
aRepresentedProperties.forEach(function(oRepresentedProperty) {
|
|
282
|
+
aBindingPaths = aBindingPaths.concat(oRepresentedProperty.bindingPaths);
|
|
294
283
|
});
|
|
284
|
+
return aBindingPaths;
|
|
295
285
|
}
|
|
296
286
|
|
|
297
|
-
function
|
|
298
|
-
|
|
299
|
-
var bHasDelegateAndGetRepresentedProperties = !!ObjectPath.get("delegateInfo.delegate.getRepresentedProperties", mAction);
|
|
287
|
+
function getRepresentedBindingPaths(oElement, mAction, sModelName, sAggregationName) {
|
|
288
|
+
const bHasDelegateAndGetRepresentedProperties = !!ObjectPath.get("delegateInfo.delegate.getRepresentedProperties", mAction);
|
|
300
289
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
});
|
|
290
|
+
if (bHasDelegateAndGetRepresentedProperties) {
|
|
291
|
+
return getRepresentedBindingPathsFromDelegateOrBinding(oElement, mAction, sModelName, sAggregationName);
|
|
292
|
+
}
|
|
293
|
+
return getRepresentedBindingPathsFromBinding(oElement, mAction, sModelName, sAggregationName);
|
|
306
294
|
}
|
|
307
295
|
|
|
308
296
|
/**
|
|
@@ -310,10 +298,8 @@ sap.ui.define([
|
|
|
310
298
|
*
|
|
311
299
|
* @param {sap.ui.core.Element} oInvisibleElement - Invisible Element
|
|
312
300
|
* @param {object} mSomeItem - source of data enhancement process
|
|
313
|
-
*
|
|
314
|
-
* @private
|
|
315
301
|
*/
|
|
316
|
-
function
|
|
302
|
+
function enhanceInvisibleElement(oInvisibleElement, mSomeItem) {
|
|
317
303
|
oInvisibleElement.__originalLabel = mSomeItem.label;
|
|
318
304
|
|
|
319
305
|
oInvisibleElement.__tooltip = mSomeItem.tooltip;
|
|
@@ -330,16 +316,16 @@ sap.ui.define([
|
|
|
330
316
|
}
|
|
331
317
|
}
|
|
332
318
|
|
|
333
|
-
function
|
|
334
|
-
|
|
319
|
+
function getRepresentedBindingPathsFromDelegateIfAvailable(mAction, sAggregationName) {
|
|
320
|
+
const bHasDelegateAndGetRepresentedProperties = !!ObjectPath.get("delegateInfo.delegate.getRepresentedProperties", mAction);
|
|
335
321
|
|
|
336
322
|
if (bHasDelegateAndGetRepresentedProperties) {
|
|
337
|
-
return
|
|
323
|
+
return getRepresentedPropertiesFromDelegate(mAction, sAggregationName);
|
|
338
324
|
}
|
|
339
325
|
}
|
|
340
326
|
|
|
341
|
-
function
|
|
342
|
-
|
|
327
|
+
function getRepresentedBindingPathsOfInvisibleElement(oInvisibleElement, aRepresentedProperties) {
|
|
328
|
+
let oRepresentedProperty;
|
|
343
329
|
aRepresentedProperties.some(function(oProperty) {
|
|
344
330
|
if (oProperty.id === oInvisibleElement.getId()) {
|
|
345
331
|
oRepresentedProperty = oProperty;
|
|
@@ -364,22 +350,20 @@ sap.ui.define([
|
|
|
364
350
|
* @param {boolean} bHasAddViaDelegate - If AddViaDelegate action is available
|
|
365
351
|
*
|
|
366
352
|
* @return {boolean} - whether this field should be included
|
|
367
|
-
*
|
|
368
|
-
* @private
|
|
369
353
|
*/
|
|
370
|
-
function
|
|
371
|
-
if (!
|
|
354
|
+
function checkAndEnhanceByModelProperty(oInvisibleElement, aProperties, aBindingPaths, bHasAddViaDelegate) {
|
|
355
|
+
if (!hasBindings(aBindingPaths)) {
|
|
372
356
|
// include it if the field has no bindings (bindings can be added in runtime)
|
|
373
357
|
return true;
|
|
374
358
|
}
|
|
375
359
|
|
|
376
|
-
|
|
360
|
+
const mModelProperty = findModelProperty(aBindingPaths, aProperties);
|
|
377
361
|
if (mModelProperty) {
|
|
378
362
|
if (mModelProperty.hideFromReveal) {
|
|
379
363
|
return false;
|
|
380
364
|
}
|
|
381
365
|
if (bHasAddViaDelegate) {
|
|
382
|
-
|
|
366
|
+
enhanceInvisibleElement(oInvisibleElement, mModelProperty);
|
|
383
367
|
}
|
|
384
368
|
return true;
|
|
385
369
|
}
|
|
@@ -387,9 +371,9 @@ sap.ui.define([
|
|
|
387
371
|
return !bHasAddViaDelegate;
|
|
388
372
|
}
|
|
389
373
|
|
|
390
|
-
function
|
|
374
|
+
function enhanceByMetadata(oElement, sAggregationName, mInvisibleElement, mActions, aRepresentedProperties, aProperties) {
|
|
391
375
|
const mAddViaDelegate = mActions.addViaDelegate;
|
|
392
|
-
const sModelName =
|
|
376
|
+
const sModelName = getModelName(mAddViaDelegate);
|
|
393
377
|
const oModel = oElement.getModel(sModelName);
|
|
394
378
|
let bIncludeElement = true;
|
|
395
379
|
let aBindingPaths = [];
|
|
@@ -397,9 +381,9 @@ sap.ui.define([
|
|
|
397
381
|
const iDepth = mInvisibleElement.action.depthOfRelevantBindings;
|
|
398
382
|
|
|
399
383
|
if (aRepresentedProperties) {
|
|
400
|
-
aBindingPaths =
|
|
384
|
+
aBindingPaths = getRepresentedBindingPathsOfInvisibleElement(oInvisibleElement, aRepresentedProperties);
|
|
401
385
|
// BCP: 1880498671
|
|
402
|
-
} else if (
|
|
386
|
+
} else if (getBindingContextPath(oElement, sAggregationName, sModelName) === getBindingContextPath(oInvisibleElement, sAggregationName, sModelName)) {
|
|
403
387
|
aBindingPaths = BindingsExtractor.collectBindingPaths(oInvisibleElement, oModel, null, iDepth).bindingPaths;
|
|
404
388
|
} else if (mAddViaDelegate && BindingsExtractor.getBindings({
|
|
405
389
|
element: oInvisibleElement,
|
|
@@ -409,20 +393,19 @@ sap.ui.define([
|
|
|
409
393
|
}
|
|
410
394
|
|
|
411
395
|
if (bIncludeElement) {
|
|
412
|
-
oInvisibleElement.__duplicateName =
|
|
413
|
-
bIncludeElement =
|
|
396
|
+
oInvisibleElement.__duplicateName = checkForDuplicateLabels(oInvisibleElement, aProperties);
|
|
397
|
+
bIncludeElement = checkAndEnhanceByModelProperty(oInvisibleElement, aProperties, aBindingPaths, !!mAddViaDelegate);
|
|
414
398
|
}
|
|
415
399
|
return bIncludeElement;
|
|
416
400
|
}
|
|
417
401
|
|
|
418
|
-
function
|
|
402
|
+
function getModelName(mAddViaDelegate) {
|
|
419
403
|
// ManagedObject jsdoc tells to use undefined for default model, therefore it
|
|
420
404
|
// is necessary to return undefined if modelName or whole delegateInfo is missing
|
|
421
405
|
return ObjectPath.get("delegateInfo.payload.modelName", mAddViaDelegate);
|
|
422
406
|
}
|
|
423
407
|
|
|
424
|
-
|
|
425
|
-
var oAnalyzer = {
|
|
408
|
+
const oAnalyzer = {
|
|
426
409
|
/**
|
|
427
410
|
* Filters available invisible elements whether they could be shown or not
|
|
428
411
|
*
|
|
@@ -431,46 +414,39 @@ sap.ui.define([
|
|
|
431
414
|
*
|
|
432
415
|
* @return {Promise} - returns a Promise which resolves with a list of hidden controls are available to display
|
|
433
416
|
*/
|
|
434
|
-
enhanceInvisibleElements(oElement, mActions) {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
])
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
sourceAggregation: mInvisibleElement.sourceAggregation
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
return aAllElementData;
|
|
470
|
-
})
|
|
471
|
-
.then(function(aAllElementData) {
|
|
472
|
-
return aAllElementData.map(_elementToAdditionalElementInfo);
|
|
417
|
+
async enhanceInvisibleElements(oElement, mActions) {
|
|
418
|
+
const mRevealData = mActions.reveal;
|
|
419
|
+
const mAddViaDelegate = mActions.addViaDelegate;
|
|
420
|
+
|
|
421
|
+
const oDefaultAggregation = oElement.getMetadata().getAggregation();
|
|
422
|
+
const sAggregationName = oDefaultAggregation ? oDefaultAggregation.name : mActions.aggregation;
|
|
423
|
+
|
|
424
|
+
const [aProperties, aRepresentedProperties] = await Promise.all([
|
|
425
|
+
getAllPropertiesFromModels(oElement, sAggregationName, mActions),
|
|
426
|
+
getRepresentedBindingPathsFromDelegateIfAvailable(mAddViaDelegate, sAggregationName)
|
|
427
|
+
]);
|
|
428
|
+
const aAllElementData = [];
|
|
429
|
+
const aInvisibleElements = mRevealData.elements || [];
|
|
430
|
+
|
|
431
|
+
aInvisibleElements.forEach(function(mInvisibleElement) {
|
|
432
|
+
const oInvisibleElement = mInvisibleElement.element;
|
|
433
|
+
const mRevealAction = mInvisibleElement.action;
|
|
434
|
+
|
|
435
|
+
oInvisibleElement.__label = ElementUtil.getLabelForElement(oInvisibleElement, mRevealAction.getLabel);
|
|
436
|
+
|
|
437
|
+
const bIncludeElement = enhanceByMetadata(
|
|
438
|
+
oElement, sAggregationName, mInvisibleElement, mActions, aRepresentedProperties, aProperties
|
|
439
|
+
);
|
|
440
|
+
|
|
441
|
+
if (bIncludeElement) {
|
|
442
|
+
aAllElementData.push({
|
|
443
|
+
element: oInvisibleElement,
|
|
444
|
+
action: mRevealAction,
|
|
445
|
+
sourceAggregation: mInvisibleElement.sourceAggregation
|
|
446
|
+
});
|
|
447
|
+
}
|
|
473
448
|
});
|
|
449
|
+
return aAllElementData.map(elementToAdditionalElementInfo);
|
|
474
450
|
},
|
|
475
451
|
|
|
476
452
|
/**
|
|
@@ -481,37 +457,30 @@ sap.ui.define([
|
|
|
481
457
|
*
|
|
482
458
|
* @return {Promise} - returns a Promise which resolves with a list of available to display delegate properties
|
|
483
459
|
*/
|
|
484
|
-
getUnrepresentedDelegateProperties(oElement, mAction) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
])
|
|
492
|
-
.
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
return !bIsRepresented && fnFilter(mAction.relevantContainer, oModelProperty);
|
|
507
|
-
});
|
|
460
|
+
async getUnrepresentedDelegateProperties(oElement, mAction) {
|
|
461
|
+
const sModelName = getModelName(mAction);
|
|
462
|
+
const oDefaultAggregation = oElement.getMetadata().getAggregation();
|
|
463
|
+
const sAggregationName = oDefaultAggregation ? oDefaultAggregation.name : mAction.action.aggregation;
|
|
464
|
+
const [aAllProperties, aRepresentedBindingPaths] = await Promise.all([
|
|
465
|
+
getAllPropertiesFromAddViaDelegateAction(oElement, sAggregationName, mAction),
|
|
466
|
+
getRepresentedBindingPaths(oElement, mAction, sModelName, sAggregationName)
|
|
467
|
+
]);
|
|
468
|
+
const fnFilter = mAction.action.filter ? mAction.action.filter : function() {return true;};
|
|
469
|
+
|
|
470
|
+
let aUnrepresentedProperties = filterUnsupportedProperties(aAllProperties);
|
|
471
|
+
aUnrepresentedProperties = aUnrepresentedProperties.filter(function(oModelProperty) {
|
|
472
|
+
let bIsRepresented = false;
|
|
473
|
+
if (aRepresentedBindingPaths) {
|
|
474
|
+
bIsRepresented = aRepresentedBindingPaths.some(function(sBindingPath) {
|
|
475
|
+
return sBindingPath === oModelProperty.bindingPath;
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
return !bIsRepresented && fnFilter(mAction.relevantContainer, oModelProperty);
|
|
479
|
+
});
|
|
508
480
|
|
|
509
|
-
|
|
481
|
+
aUnrepresentedProperties = checkForDuplicateProperties(aUnrepresentedProperties);
|
|
510
482
|
|
|
511
|
-
|
|
512
|
-
}).then(function(aUnrepresentedProperties) {
|
|
513
|
-
return aUnrepresentedProperties.map(_oPropertyToAdditionalElementInfo);
|
|
514
|
-
});
|
|
483
|
+
return aUnrepresentedProperties.map(oPropertyToAdditionalElementInfo);
|
|
515
484
|
}
|
|
516
485
|
};
|
|
517
486
|
return oAnalyzer;
|