@openui5/sap.ui.rta 1.98.0 → 1.101.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/THIRDPARTY.txt +6 -6
- 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 +64 -50
- package/src/sap/ui/rta/Utils.js +4 -6
- package/src/sap/ui/rta/appContexts/AppContextsOverviewDialog.js +76 -0
- package/src/sap/ui/rta/appContexts/Component.js +31 -0
- package/src/sap/ui/rta/appContexts/controller/ManageContexts.controller.js +323 -0
- package/src/sap/ui/rta/appContexts/controller/RestAPIConnector.js +22 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n.properties +47 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ar.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_bg.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ca.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_cs.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_cy.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_da.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_de.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_el.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_en.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_GB.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_sappsd.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saprigi.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saptrc.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_es.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_es_MX.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_et.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_fi.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_fr.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_fr_CA.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_hi.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_hr.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_hu.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_id.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_it.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_iw.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ja.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_kk.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ko.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_lt.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_lv.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ms.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_nl.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_no.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_pl.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_pt.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_pt_PT.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ro.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ru.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_sh.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_sk.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_sl.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_sv.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_th.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_tr.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_uk.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_vi.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_zh_CN.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_zh_TW.properties +23 -0
- package/src/sap/ui/rta/appContexts/index.html +25 -0
- package/src/sap/ui/rta/appContexts/manifest.json +52 -0
- package/src/sap/ui/rta/appContexts/view/EditContextsDialog.fragment.xml +76 -0
- package/src/sap/ui/rta/appContexts/view/ManageContexts.view.xml +103 -0
- package/src/sap/ui/rta/appContexts/view/SaveAsContextsDialog.fragment.xml +76 -0
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +6 -3
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +11 -11
- package/src/sap/ui/rta/appVariant/Feature.js +16 -6
- 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 +3 -2
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +3 -2
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
- package/src/sap/ui/rta/command/BaseCommand.js +1 -1
- package/src/sap/ui/rta/command/BindProperty.js +3 -2
- package/src/sap/ui/rta/command/Combine.js +5 -1
- package/src/sap/ui/rta/command/CommandFactory.js +20 -13
- package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +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/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/Resize.js +45 -0
- 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 +15 -12
- 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 +6 -9
- package/src/sap/ui/rta/messagebundle.properties +20 -11
- package/src/sap/ui/rta/messagebundle_ar.properties +14 -9
- package/src/sap/ui/rta/messagebundle_bg.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ca.properties +15 -10
- package/src/sap/ui/rta/messagebundle_cs.properties +14 -9
- package/src/sap/ui/rta/messagebundle_cy.properties +14 -9
- package/src/sap/ui/rta/messagebundle_da.properties +14 -9
- package/src/sap/ui/rta/messagebundle_de.properties +14 -9
- package/src/sap/ui/rta/messagebundle_el.properties +14 -9
- package/src/sap/ui/rta/messagebundle_en.properties +14 -9
- package/src/sap/ui/rta/messagebundle_en_GB.properties +14 -9
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +14 -9
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +42 -20
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +14 -9
- package/src/sap/ui/rta/messagebundle_es.properties +14 -9
- package/src/sap/ui/rta/messagebundle_es_MX.properties +15 -10
- package/src/sap/ui/rta/messagebundle_et.properties +14 -9
- package/src/sap/ui/rta/messagebundle_fi.properties +14 -9
- package/src/sap/ui/rta/messagebundle_fr.properties +14 -9
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +14 -9
- package/src/sap/ui/rta/messagebundle_hi.properties +13 -8
- package/src/sap/ui/rta/messagebundle_hr.properties +14 -9
- package/src/sap/ui/rta/messagebundle_hu.properties +14 -9
- package/src/sap/ui/rta/messagebundle_id.properties +14 -9
- package/src/sap/ui/rta/messagebundle_it.properties +14 -9
- package/src/sap/ui/rta/messagebundle_iw.properties +14 -9
- package/src/sap/ui/rta/messagebundle_ja.properties +14 -9
- package/src/sap/ui/rta/messagebundle_kk.properties +14 -9
- package/src/sap/ui/rta/messagebundle_ko.properties +14 -9
- package/src/sap/ui/rta/messagebundle_lt.properties +14 -9
- package/src/sap/ui/rta/messagebundle_lv.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ms.properties +14 -9
- package/src/sap/ui/rta/messagebundle_nl.properties +14 -9
- package/src/sap/ui/rta/messagebundle_no.properties +14 -9
- package/src/sap/ui/rta/messagebundle_pl.properties +14 -9
- package/src/sap/ui/rta/messagebundle_pt.properties +14 -9
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +14 -9
- package/src/sap/ui/rta/messagebundle_ro.properties +14 -9
- package/src/sap/ui/rta/messagebundle_ru.properties +14 -9
- package/src/sap/ui/rta/messagebundle_sh.properties +14 -9
- package/src/sap/ui/rta/messagebundle_sk.properties +15 -10
- package/src/sap/ui/rta/messagebundle_sl.properties +14 -9
- package/src/sap/ui/rta/messagebundle_sv.properties +14 -9
- package/src/sap/ui/rta/messagebundle_th.properties +14 -9
- package/src/sap/ui/rta/messagebundle_tr.properties +14 -9
- package/src/sap/ui/rta/messagebundle_uk.properties +13 -8
- package/src/sap/ui/rta/messagebundle_vi.properties +14 -9
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +14 -9
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +15 -10
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
- package/src/sap/ui/rta/plugin/Combine.js +15 -14
- package/src/sap/ui/rta/plugin/ControlVariant.js +3 -3
- package/src/sap/ui/rta/plugin/CreateContainer.js +1 -3
- package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
- package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
- package/src/sap/ui/rta/plugin/EasyAdd.js +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 +32 -11
- package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
- package/src/sap/ui/rta/plugin/Remove.js +26 -27
- package/src/sap/ui/rta/plugin/Rename.js +6 -19
- package/src/sap/ui/rta/plugin/RenameHandler.js +21 -6
- package/src/sap/ui/rta/plugin/Resize.js +432 -0
- package/src/sap/ui/rta/plugin/Selection.js +21 -8
- package/src/sap/ui/rta/plugin/Settings.js +1 -1
- package/src/sap/ui/rta/plugin/Split.js +5 -11
- package/src/sap/ui/rta/plugin/Stretch.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +39 -38
- 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/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 +1 -1
- 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/themes/base/ChangeVisualization.less +55 -75
- package/src/sap/ui/rta/themes/base/Overlay.less +50 -0
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +5 -19
- package/src/sap/ui/rta/toolbar/Adaptation.js +4 -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 +1 -1
- package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/translation/Translation.js +52 -31
- package/src/sap/ui/rta/util/PluginManager.js +9 -3
- package/src/sap/ui/rta/util/PopupManager.js +33 -12
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +109 -60
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +30 -0
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +6 -5
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +146 -79
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +37 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/MoveVisualization.js +25 -4
- package/src/sap/ui/rta/util/changeVisualization/categories/RenameVisualization.js +14 -2
- package/src/sap/ui/rta/util/changeVisualization/categories/SplitVisualization.js +5 -2
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/ui/core/Fragment",
|
|
8
9
|
"sap/base/util/restricted/_difference",
|
|
9
10
|
"sap/base/util/deepEqual",
|
|
10
11
|
"sap/base/Log",
|
|
@@ -12,7 +13,6 @@ sap.ui.define([
|
|
|
12
13
|
"sap/ui/core/Control",
|
|
13
14
|
"sap/ui/dt/OverlayRegistry",
|
|
14
15
|
"sap/ui/dt/ElementUtil",
|
|
15
|
-
"sap/ui/events/KeyCodes",
|
|
16
16
|
"sap/ui/fl/apply/_internal/changes/Utils",
|
|
17
17
|
"sap/ui/fl/write/api/ChangesWriteAPI",
|
|
18
18
|
"sap/ui/fl/write/api/PersistenceWriteAPI",
|
|
@@ -23,6 +23,7 @@ sap.ui.define([
|
|
|
23
23
|
"sap/ui/rta/util/changeVisualization/ChangeIndicator",
|
|
24
24
|
"sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry"
|
|
25
25
|
], function(
|
|
26
|
+
Fragment,
|
|
26
27
|
difference,
|
|
27
28
|
deepEqual,
|
|
28
29
|
Log,
|
|
@@ -30,7 +31,6 @@ sap.ui.define([
|
|
|
30
31
|
Control,
|
|
31
32
|
OverlayRegistry,
|
|
32
33
|
ElementUtil,
|
|
33
|
-
KeyCodes,
|
|
34
34
|
ChangesUtils,
|
|
35
35
|
ChangesWriteAPI,
|
|
36
36
|
PersistenceWriteAPI,
|
|
@@ -79,8 +79,9 @@ sap.ui.define([
|
|
|
79
79
|
* When clicking anywhere on the application, the menu must close
|
|
80
80
|
*/
|
|
81
81
|
function _onClick() {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
var oPopover = this.getPopover();
|
|
83
|
+
if (oPopover && oPopover.isOpen()) {
|
|
84
|
+
oPopover.close();
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
|
|
@@ -92,7 +93,7 @@ sap.ui.define([
|
|
|
92
93
|
* @alias sap.ui.rta.util.changeVisualization.ChangeVisualization
|
|
93
94
|
* @author SAP SE
|
|
94
95
|
* @since 1.84.0
|
|
95
|
-
* @version 1.
|
|
96
|
+
* @version 1.101.0
|
|
96
97
|
* @private
|
|
97
98
|
*/
|
|
98
99
|
var ChangeVisualization = Control.extend("sap.ui.rta.util.changeVisualization.ChangeVisualization", {
|
|
@@ -112,9 +113,15 @@ sap.ui.define([
|
|
|
112
113
|
type: "boolean",
|
|
113
114
|
defaultValue: false
|
|
114
115
|
}
|
|
116
|
+
},
|
|
117
|
+
aggregations: {
|
|
118
|
+
popover: {
|
|
119
|
+
type: "sap.m.Popover",
|
|
120
|
+
multiple: false
|
|
121
|
+
}
|
|
115
122
|
}
|
|
116
123
|
},
|
|
117
|
-
constructor: function
|
|
124
|
+
constructor: function() {
|
|
118
125
|
Control.prototype.constructor.apply(this, arguments);
|
|
119
126
|
|
|
120
127
|
this._oChangeIndicatorRegistry = new ChangeIndicatorRegistry({
|
|
@@ -137,18 +144,18 @@ sap.ui.define([
|
|
|
137
144
|
}
|
|
138
145
|
});
|
|
139
146
|
|
|
140
|
-
ChangeVisualization.prototype.setRootControlId = function
|
|
147
|
+
ChangeVisualization.prototype.setRootControlId = function(sRootControlId) {
|
|
141
148
|
if (this.getRootControlId() && this.getRootControlId() !== sRootControlId) {
|
|
142
149
|
this._reset();
|
|
143
150
|
}
|
|
144
151
|
this.setProperty("rootControlId", sRootControlId);
|
|
145
152
|
};
|
|
146
153
|
|
|
147
|
-
ChangeVisualization.prototype._getComponent = function
|
|
154
|
+
ChangeVisualization.prototype._getComponent = function() {
|
|
148
155
|
return FlUtils.getAppComponentForControl(ElementUtil.getElementInstance(this.getRootControlId()));
|
|
149
156
|
};
|
|
150
157
|
|
|
151
|
-
ChangeVisualization.prototype.setIsActive = function
|
|
158
|
+
ChangeVisualization.prototype.setIsActive = function(bActiveState) {
|
|
152
159
|
if (bActiveState === this.getIsActive()) {
|
|
153
160
|
return;
|
|
154
161
|
}
|
|
@@ -161,24 +168,37 @@ sap.ui.define([
|
|
|
161
168
|
}
|
|
162
169
|
};
|
|
163
170
|
|
|
164
|
-
ChangeVisualization.prototype.exit = function
|
|
171
|
+
ChangeVisualization.prototype.exit = function() {
|
|
165
172
|
this._oChangeIndicatorRegistry.destroy();
|
|
166
173
|
if (this.oRootOverlay) {
|
|
167
|
-
this.oRootOverlay.getDomRef().removeEventListener("click", this._fnOnClickHandler, {capture: true});
|
|
174
|
+
this.oRootOverlay.getDomRef().removeEventListener("click", this._fnOnClickHandler, { capture: true });
|
|
168
175
|
}
|
|
169
176
|
};
|
|
170
177
|
|
|
171
|
-
ChangeVisualization.prototype._reset = function
|
|
178
|
+
ChangeVisualization.prototype._reset = function() {
|
|
172
179
|
this._oChangeIndicatorRegistry.reset();
|
|
173
180
|
};
|
|
174
181
|
|
|
175
|
-
ChangeVisualization.prototype._updateVisualizationModelMenuData = function
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
ChangeVisualization.prototype._updateVisualizationModelMenuData = function() {
|
|
183
|
+
var aVisualizedChanges = this._oChangeVisualizationModel.getData().visualizedChanges;
|
|
184
|
+
var aHiddenChanges = [];
|
|
185
|
+
var aRegisteredChanges = this._oChangeIndicatorRegistry.getChanges();
|
|
186
|
+
aRegisteredChanges.forEach(function(oChange) {
|
|
187
|
+
var oVisualizedChange = aVisualizedChanges.find(function(oVisualizedChange) {
|
|
188
|
+
return oChange.change.getId() === oVisualizedChange.id;
|
|
189
|
+
});
|
|
190
|
+
if (!oVisualizedChange && !oChange.dependent) {
|
|
191
|
+
aHiddenChanges.push(oChange);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
var aCommandData = Object.keys(VALID_COMMANDS).map(function(sCommandCategoryName) {
|
|
195
|
+
var sTitle = this._getCommandCategoryLabel(
|
|
196
|
+
sCommandCategoryName,
|
|
197
|
+
this._getChangesForCommandCategory(sCommandCategoryName, aVisualizedChanges).length
|
|
198
|
+
);
|
|
179
199
|
return {
|
|
180
200
|
key: sCommandCategoryName,
|
|
181
|
-
count: this._getChangesForCommandCategory(sCommandCategoryName).length,
|
|
201
|
+
count: this._getChangesForCommandCategory(sCommandCategoryName, aVisualizedChanges).length,
|
|
182
202
|
title: sTitle,
|
|
183
203
|
icon: CATEGORY_ICONS[sCommandCategoryName]
|
|
184
204
|
};
|
|
@@ -186,50 +206,85 @@ sap.ui.define([
|
|
|
186
206
|
|
|
187
207
|
aCommandData.unshift({
|
|
188
208
|
key: CATEGORY_ALL,
|
|
189
|
-
count: this._getChangesForCommandCategory(CATEGORY_ALL).length,
|
|
190
|
-
title: this._getCommandCategoryLabel(CATEGORY_ALL, this._getChangesForCommandCategory(CATEGORY_ALL).length),
|
|
209
|
+
count: this._getChangesForCommandCategory(CATEGORY_ALL, aVisualizedChanges).length,
|
|
210
|
+
title: this._getCommandCategoryLabel(CATEGORY_ALL, this._getChangesForCommandCategory(CATEGORY_ALL, aVisualizedChanges).length),
|
|
191
211
|
icon: CATEGORY_ICONS[CATEGORY_ALL]
|
|
192
212
|
});
|
|
193
213
|
|
|
194
214
|
this._updateVisualizationModel({
|
|
195
|
-
commandCategories: aCommandData
|
|
215
|
+
commandCategories: aCommandData,
|
|
216
|
+
hiddenChanges: aHiddenChanges,
|
|
217
|
+
popupInfoMessage: this._oTextBundle.getText(
|
|
218
|
+
"MSG_CHANGEVISUALIZATION_HIDDEN_CHANGES_INFO",
|
|
219
|
+
[aHiddenChanges.length]
|
|
220
|
+
)
|
|
196
221
|
});
|
|
197
222
|
};
|
|
198
223
|
|
|
199
|
-
ChangeVisualization.prototype._getChangesForCommandCategory = function
|
|
200
|
-
|
|
201
|
-
return aRegisteredChanges.filter(function (oChange) {
|
|
224
|
+
ChangeVisualization.prototype._getChangesForCommandCategory = function(sCommandCategory, aChanges) {
|
|
225
|
+
return aChanges.filter(function(oChange) {
|
|
202
226
|
return sCommandCategory === CATEGORY_ALL
|
|
203
227
|
? oChange.commandCategory !== undefined
|
|
204
228
|
: sCommandCategory === oChange.commandCategory;
|
|
205
229
|
});
|
|
206
230
|
};
|
|
207
231
|
|
|
208
|
-
ChangeVisualization.prototype._getCommandCategoryLabel = function
|
|
232
|
+
ChangeVisualization.prototype._getCommandCategoryLabel = function(sCommandCategoryName, iChangesCount) {
|
|
209
233
|
var sLabelKey = "TXT_CHANGEVISUALIZATION_OVERVIEW_" + sCommandCategoryName.toUpperCase();
|
|
210
234
|
return this._oTextBundle.getText(sLabelKey, [iChangesCount]);
|
|
211
235
|
};
|
|
212
236
|
|
|
213
|
-
ChangeVisualization.prototype._getCommandCategoryButton = function
|
|
237
|
+
ChangeVisualization.prototype._getCommandCategoryButton = function(sCommandCategoryName) {
|
|
214
238
|
var sButtonKey = "BTN_CHANGEVISUALIZATION_OVERVIEW_" + sCommandCategoryName.toUpperCase();
|
|
215
239
|
return this._oTextBundle.getText(sButtonKey);
|
|
216
240
|
};
|
|
217
241
|
|
|
242
|
+
ChangeVisualization.prototype.openChangeCategorySelectionPopover = function(oEvent) {
|
|
243
|
+
if (!this._oToolbarButton) {
|
|
244
|
+
// Event bubbled through the toolbar, get original source
|
|
245
|
+
this._oToolbarButton = sap.ui.getCore().byId(oEvent.getParameter("id"));
|
|
246
|
+
}
|
|
247
|
+
var oPopover = this.getPopover();
|
|
248
|
+
|
|
249
|
+
if (!oPopover) {
|
|
250
|
+
Fragment.load({
|
|
251
|
+
name: "sap.ui.rta.util.changeVisualization.ChangeIndicatorCategorySelection",
|
|
252
|
+
id: this._getComponent().createId("changeVisualization_changesListPopover"),
|
|
253
|
+
controller: this
|
|
254
|
+
})
|
|
255
|
+
.then(function(oPopover) {
|
|
256
|
+
this._oToolbarButton.addDependent(oPopover);
|
|
257
|
+
oPopover.setModel(this._oChangeVisualizationModel, "visualizationModel");
|
|
258
|
+
oPopover.openBy(this._oToolbarButton);
|
|
259
|
+
this.setPopover(oPopover);
|
|
260
|
+
}.bind(this));
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
if (oPopover.isOpen()) {
|
|
265
|
+
oPopover.close();
|
|
266
|
+
} else {
|
|
267
|
+
oPopover.openBy(this._oToolbarButton);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
|
|
218
271
|
/**
|
|
219
272
|
* Sets the selected command category and visualizes all changes for the given category
|
|
220
273
|
*
|
|
221
274
|
* @param {event} oEvent - Event
|
|
222
|
-
* @returns {
|
|
275
|
+
* @returns {Promise} - Promise of category change
|
|
223
276
|
*/
|
|
224
|
-
ChangeVisualization.prototype.onCommandCategorySelection = function
|
|
225
|
-
var sSelectedCommandCategory = oEvent.
|
|
277
|
+
ChangeVisualization.prototype.onCommandCategorySelection = function(oEvent) {
|
|
278
|
+
var sSelectedCommandCategory = oEvent.getSource().getBindingContext("visualizationModel").getObject().key;
|
|
226
279
|
return this._selectCommandCategory(sSelectedCommandCategory);
|
|
227
280
|
};
|
|
228
281
|
|
|
229
|
-
ChangeVisualization.prototype._selectCommandCategory = function
|
|
282
|
+
ChangeVisualization.prototype._selectCommandCategory = function(sSelectedCommandCategory) {
|
|
230
283
|
this._sSelectedCommandCategory = sSelectedCommandCategory;
|
|
231
284
|
|
|
232
|
-
var
|
|
285
|
+
var aRegisteredChanges = this._oChangeIndicatorRegistry.getChanges();
|
|
286
|
+
var aRelevantChanges = this._getChangesForCommandCategory(sSelectedCommandCategory, aRegisteredChanges);
|
|
287
|
+
|
|
233
288
|
var sCommandCategoryText = this._getCommandCategoryButton(sSelectedCommandCategory);
|
|
234
289
|
|
|
235
290
|
this._updateVisualizationModel({
|
|
@@ -237,22 +292,22 @@ sap.ui.define([
|
|
|
237
292
|
commandCategoryText: sCommandCategoryText
|
|
238
293
|
});
|
|
239
294
|
|
|
240
|
-
return Promise.all(aRelevantChanges.map(function
|
|
295
|
+
return Promise.all(aRelevantChanges.map(function(oChange) {
|
|
241
296
|
return this._getVisualizationInfo(oChange)
|
|
242
|
-
.then(function
|
|
297
|
+
.then(function(mVisualizationInfo) {
|
|
243
298
|
this._oChangeIndicatorRegistry.addVisualizationInfo(
|
|
244
299
|
oChange.change.getId(),
|
|
245
300
|
mVisualizationInfo
|
|
246
301
|
);
|
|
247
302
|
}.bind(this));
|
|
248
303
|
}.bind(this)))
|
|
249
|
-
.then(function
|
|
304
|
+
.then(function() {
|
|
250
305
|
this._updateChangeIndicators();
|
|
251
306
|
this._setFocusedIndicator();
|
|
252
307
|
}.bind(this));
|
|
253
308
|
};
|
|
254
309
|
|
|
255
|
-
ChangeVisualization.prototype._getVisualizationInfo = function
|
|
310
|
+
ChangeVisualization.prototype._getVisualizationInfo = function(mChangeInformation) {
|
|
256
311
|
var oComponent = this._getComponent();
|
|
257
312
|
|
|
258
313
|
function getSelectorIds(aSelectorList) {
|
|
@@ -260,7 +315,7 @@ sap.ui.define([
|
|
|
260
315
|
return undefined;
|
|
261
316
|
}
|
|
262
317
|
return aSelectorList
|
|
263
|
-
.map(function
|
|
318
|
+
.map(function(vSelector) {
|
|
264
319
|
var oElement = typeof vSelector.getId === "function"
|
|
265
320
|
? vSelector
|
|
266
321
|
: JsControlTreeModifier.bySelector(vSelector, oComponent);
|
|
@@ -270,7 +325,7 @@ sap.ui.define([
|
|
|
270
325
|
}
|
|
271
326
|
|
|
272
327
|
return this._getInfoFromChangeHandler(oComponent, mChangeInformation.change)
|
|
273
|
-
.then(function
|
|
328
|
+
.then(function(oInfoFromChangeHandler) {
|
|
274
329
|
var mVisualizationInfo = oInfoFromChangeHandler || {};
|
|
275
330
|
var aAffectedElementIds = (
|
|
276
331
|
getSelectorIds(mVisualizationInfo.affectedControls || [mChangeInformation.change.getSelector()])
|
|
@@ -329,7 +384,7 @@ sap.ui.define([
|
|
|
329
384
|
&& searchForCommand(OverlayRegistry.getOverlay(oLastDependentSelectorControl));
|
|
330
385
|
};
|
|
331
386
|
|
|
332
|
-
ChangeVisualization.prototype._getInfoFromChangeHandler = function
|
|
387
|
+
ChangeVisualization.prototype._getInfoFromChangeHandler = function(oAppComponent, oChange) {
|
|
333
388
|
var oControl = JsControlTreeModifier.bySelector(oChange.getSelector(), oAppComponent);
|
|
334
389
|
if (oControl) {
|
|
335
390
|
var mPropertyBag = {
|
|
@@ -344,50 +399,54 @@ sap.ui.define([
|
|
|
344
399
|
modifier: JsControlTreeModifier,
|
|
345
400
|
layer: oChange.getLayer()
|
|
346
401
|
})
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
402
|
+
.then(function(oChangeHandler) {
|
|
403
|
+
if (oChangeHandler && typeof oChangeHandler.getChangeVisualizationInfo === "function") {
|
|
404
|
+
return oChangeHandler.getChangeVisualizationInfo(oChange, oAppComponent);
|
|
405
|
+
}
|
|
406
|
+
return undefined;
|
|
407
|
+
})
|
|
408
|
+
.catch(function(vErr) {
|
|
409
|
+
Log.error(vErr);
|
|
410
|
+
return undefined;
|
|
411
|
+
});
|
|
357
412
|
}
|
|
358
413
|
|
|
359
414
|
return Promise.resolve();
|
|
360
415
|
};
|
|
361
416
|
|
|
362
|
-
ChangeVisualization.prototype._collectChanges = function
|
|
417
|
+
ChangeVisualization.prototype._collectChanges = function() {
|
|
363
418
|
var oComponent = this._getComponent();
|
|
364
419
|
var mPropertyBag = {
|
|
365
|
-
oComponent: oComponent,
|
|
366
420
|
selector: oComponent,
|
|
367
421
|
invalidateCache: false,
|
|
368
|
-
includeVariants: true,
|
|
369
422
|
// includeCtrlVariants: true,
|
|
370
|
-
currentLayer: Layer.CUSTOMER
|
|
423
|
+
currentLayer: Layer.CUSTOMER,
|
|
424
|
+
includeDirtyChanges: true,
|
|
425
|
+
onlyCurrentVariants: true
|
|
371
426
|
};
|
|
372
427
|
return PersistenceWriteAPI._getUIChanges(mPropertyBag);
|
|
373
428
|
};
|
|
374
429
|
|
|
375
|
-
ChangeVisualization.prototype._updateChangeRegistry = function
|
|
376
|
-
return this._collectChanges().then(function
|
|
430
|
+
ChangeVisualization.prototype._updateChangeRegistry = function() {
|
|
431
|
+
return this._collectChanges().then(function(aChanges) {
|
|
377
432
|
var aRegisteredChangeIds = this._oChangeIndicatorRegistry.getChangeIds();
|
|
378
|
-
var oCurrentChanges = aChanges
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
433
|
+
var oCurrentChanges = aChanges
|
|
434
|
+
.filter(function(oChange) {
|
|
435
|
+
return oChange.getFileType() === 'change';
|
|
436
|
+
})
|
|
437
|
+
.reduce(function(oChanges, oChange) {
|
|
438
|
+
oChanges[oChange.getId()] = oChange;
|
|
439
|
+
return oChanges;
|
|
440
|
+
}, {});
|
|
382
441
|
var aCurrentChangeIds = Object.keys(oCurrentChanges);
|
|
383
442
|
|
|
384
443
|
// Remove registered changes which no longer exist
|
|
385
|
-
difference(aRegisteredChangeIds, aCurrentChangeIds).forEach(function
|
|
444
|
+
difference(aRegisteredChangeIds, aCurrentChangeIds).forEach(function(sChangeIdToRemove) {
|
|
386
445
|
this._oChangeIndicatorRegistry.removeChange(sChangeIdToRemove);
|
|
387
446
|
}.bind(this));
|
|
388
447
|
|
|
389
448
|
// Register missing changes
|
|
390
|
-
difference(aCurrentChangeIds, aRegisteredChangeIds).forEach(function
|
|
449
|
+
difference(aCurrentChangeIds, aRegisteredChangeIds).forEach(function(sChangeIdToAdd) {
|
|
391
450
|
var oChangeToAdd = oCurrentChanges[sChangeIdToAdd];
|
|
392
451
|
var sCommandName = this._getCommandForChange(oChangeToAdd);
|
|
393
452
|
this._oChangeIndicatorRegistry.registerChange(oChangeToAdd, sCommandName);
|
|
@@ -395,24 +454,24 @@ sap.ui.define([
|
|
|
395
454
|
}.bind(this));
|
|
396
455
|
};
|
|
397
456
|
|
|
398
|
-
ChangeVisualization.prototype.selectChange = function
|
|
457
|
+
ChangeVisualization.prototype.selectChange = function(oEvent) {
|
|
399
458
|
var sChangeId = oEvent.getParameter("changeId");
|
|
400
459
|
this._selectChange(sChangeId);
|
|
401
460
|
};
|
|
402
461
|
|
|
403
|
-
ChangeVisualization.prototype._selectChange = function
|
|
462
|
+
ChangeVisualization.prototype._selectChange = function(sChangeId) {
|
|
404
463
|
var aDependentElements = this._oChangeIndicatorRegistry.getChange(sChangeId).visualizationInfo.dependentElementIds;
|
|
405
464
|
aDependentElements.forEach(function(sElementId) {
|
|
406
465
|
var oOverlayDomRef = OverlayRegistry.getOverlay(sElementId).getDomRef();
|
|
407
466
|
oOverlayDomRef.scrollIntoViewIfNeeded();
|
|
408
467
|
oOverlayDomRef.classList.add("sapUiRtaChangeIndicatorDependent");
|
|
409
|
-
oOverlayDomRef.addEventListener("animationend", function
|
|
468
|
+
oOverlayDomRef.addEventListener("animationend", function() {
|
|
410
469
|
oOverlayDomRef.classList.remove("sapUiRtaChangeIndicatorDependent");
|
|
411
|
-
}, {once: true});
|
|
470
|
+
}, { once: true });
|
|
412
471
|
});
|
|
413
472
|
};
|
|
414
473
|
|
|
415
|
-
ChangeVisualization.prototype._updateVisualizationModel = function
|
|
474
|
+
ChangeVisualization.prototype._updateVisualizationModel = function(oData) {
|
|
416
475
|
this._oChangeVisualizationModel.setData(Object.assign(
|
|
417
476
|
{},
|
|
418
477
|
this._oChangeVisualizationModel.getData(),
|
|
@@ -420,23 +479,27 @@ sap.ui.define([
|
|
|
420
479
|
));
|
|
421
480
|
};
|
|
422
481
|
|
|
423
|
-
ChangeVisualization.prototype._updateChangeIndicators = function
|
|
482
|
+
ChangeVisualization.prototype._updateChangeIndicators = function() {
|
|
424
483
|
var oSelectors = this._oChangeIndicatorRegistry.getChangeIndicatorData();
|
|
425
484
|
var oIndicators = {};
|
|
485
|
+
var aVisualizedChanges = [];
|
|
426
486
|
Object.keys(oSelectors)
|
|
427
|
-
.forEach(function
|
|
487
|
+
.forEach(function(sSelectorId) {
|
|
428
488
|
var aChanges = oSelectors[sSelectorId];
|
|
429
489
|
var oOverlay = OverlayRegistry.getOverlay(sSelectorId);
|
|
430
|
-
if (!oOverlay || !oOverlay.getDomRef()) {
|
|
490
|
+
if (!oOverlay || !oOverlay.getDomRef() || !oOverlay.isVisible()) {
|
|
431
491
|
// Change is not visible
|
|
432
492
|
return undefined;
|
|
433
493
|
}
|
|
434
|
-
|
|
435
|
-
var
|
|
494
|
+
var oOverlayPosition = oOverlay.getDomRef().getClientRects()[0] || { left: 0, top: 0 };
|
|
495
|
+
var aRelevantChanges = this._filterRelevantChanges(aChanges);
|
|
496
|
+
aRelevantChanges.forEach(function (oChange) {
|
|
497
|
+
aVisualizedChanges.push(oChange);
|
|
498
|
+
});
|
|
436
499
|
oIndicators[sSelectorId] = {
|
|
437
500
|
posX: parseInt(oOverlayPosition.left),
|
|
438
501
|
posY: parseInt(oOverlayPosition.top),
|
|
439
|
-
changes:
|
|
502
|
+
changes: aRelevantChanges
|
|
440
503
|
};
|
|
441
504
|
|
|
442
505
|
if (!this._oChangeIndicatorRegistry.hasChangeIndicator(sSelectorId)) {
|
|
@@ -449,21 +512,25 @@ sap.ui.define([
|
|
|
449
512
|
!deepEqual(
|
|
450
513
|
oIndicators,
|
|
451
514
|
this._oChangeVisualizationModel.getData().content
|
|
515
|
+
) || !deepEqual(
|
|
516
|
+
aVisualizedChanges,
|
|
517
|
+
this._oChangeVisualizationModel.getData().visualizedChanges
|
|
452
518
|
)
|
|
453
519
|
) {
|
|
454
520
|
this._updateVisualizationModel({
|
|
455
|
-
content: oIndicators
|
|
521
|
+
content: oIndicators,
|
|
522
|
+
visualizedChanges: aVisualizedChanges
|
|
456
523
|
});
|
|
457
524
|
}
|
|
458
525
|
};
|
|
459
526
|
|
|
460
|
-
ChangeVisualization.prototype._filterRelevantChanges = function
|
|
527
|
+
ChangeVisualization.prototype._filterRelevantChanges = function(aChanges) {
|
|
461
528
|
if (!Array.isArray(aChanges)) {
|
|
462
529
|
return aChanges;
|
|
463
530
|
}
|
|
464
531
|
var oRootData = this._oChangeVisualizationModel.getData();
|
|
465
532
|
|
|
466
|
-
return aChanges.filter(function
|
|
533
|
+
return aChanges.filter(function(oChange) {
|
|
467
534
|
return (
|
|
468
535
|
!oChange.dependent
|
|
469
536
|
&& (
|
|
@@ -474,7 +541,7 @@ sap.ui.define([
|
|
|
474
541
|
});
|
|
475
542
|
};
|
|
476
543
|
|
|
477
|
-
ChangeVisualization.prototype._createChangeIndicator = function
|
|
544
|
+
ChangeVisualization.prototype._createChangeIndicator = function(oOverlay, sSelectorId) {
|
|
478
545
|
var oChangeIndicator = new ChangeIndicator({
|
|
479
546
|
changes: "{changes}",
|
|
480
547
|
posX: "{posX}",
|
|
@@ -494,17 +561,17 @@ sap.ui.define([
|
|
|
494
561
|
this._oChangeIndicatorRegistry.registerChangeIndicator(sSelectorId, oChangeIndicator);
|
|
495
562
|
};
|
|
496
563
|
|
|
497
|
-
ChangeVisualization.prototype._setFocusedIndicator = function
|
|
564
|
+
ChangeVisualization.prototype._setFocusedIndicator = function() {
|
|
498
565
|
// Sort the Indicators according XY-Position
|
|
499
566
|
// Set the tabindex according the sorting
|
|
500
567
|
// Focus the first visible indicator
|
|
501
568
|
sap.ui.getCore().applyChanges();
|
|
502
569
|
|
|
503
570
|
var aVisibleIndicators = this._oChangeIndicatorRegistry.getChangeIndicators()
|
|
504
|
-
.filter(function
|
|
571
|
+
.filter(function(oIndicator) {
|
|
505
572
|
return oIndicator.getVisible();
|
|
506
573
|
})
|
|
507
|
-
.sort(function
|
|
574
|
+
.sort(function(oIndicator1, oIndicator2) {
|
|
508
575
|
var iDeltaY = oIndicator1.getPosY() - oIndicator2.getPosY();
|
|
509
576
|
var iDeltaX = oIndicator1.getPosX() - oIndicator2.getPosX();
|
|
510
577
|
// Only consider x value if y is the same
|
|
@@ -533,12 +600,12 @@ sap.ui.define([
|
|
|
533
600
|
if (this.getIsActive()) {
|
|
534
601
|
this.setIsActive(false);
|
|
535
602
|
if (this.oRootOverlay) {
|
|
536
|
-
this.oRootOverlay.getDomRef().removeEventListener("click", this._fnOnClickHandler, {capture: true});
|
|
603
|
+
this.oRootOverlay.getDomRef().removeEventListener("click", this._fnOnClickHandler, { capture: true });
|
|
537
604
|
}
|
|
538
605
|
return;
|
|
539
606
|
}
|
|
540
607
|
if (this.oRootOverlay) {
|
|
541
|
-
this.oRootOverlay.getDomRef().addEventListener("click", this._fnOnClickHandler, {capture: true});
|
|
608
|
+
this.oRootOverlay.getDomRef().addEventListener("click", this._fnOnClickHandler, { capture: true });
|
|
542
609
|
}
|
|
543
610
|
if (!this.getRootControlId()) {
|
|
544
611
|
this.setRootControlId(oRootControl);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ! OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
], function(
|
|
9
|
+
) {
|
|
10
|
+
"use strict";
|
|
11
|
+
|
|
12
|
+
var ChangeVisualizationUtils = {};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* Shortens a string if it is longer than 60 characters in the middle
|
|
17
|
+
* and only shows the first and last part of it.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} sString - Any string
|
|
20
|
+
* @returns {string} Shortened string
|
|
21
|
+
* @private
|
|
22
|
+
*/
|
|
23
|
+
ChangeVisualizationUtils.shortenString = function(sString) {
|
|
24
|
+
if (!sString) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
var iStringLength = sString.length;
|
|
28
|
+
if (iStringLength > 60) {
|
|
29
|
+
var sFirstPart = sString.substring(0, 27);
|
|
30
|
+
var sLastPart = sString.substring(iStringLength - 27);
|
|
31
|
+
sString = sFirstPart + "(...)" + sLastPart;
|
|
32
|
+
}
|
|
33
|
+
return sString;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return ChangeVisualizationUtils;
|
|
37
|
+
});
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils",
|
|
9
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier"
|
|
8
10
|
], function(
|
|
11
|
+
ChangeVisualizationUtils,
|
|
12
|
+
JsControlTreeModifier
|
|
9
13
|
) {
|
|
10
14
|
"use strict";
|
|
11
15
|
|
|
@@ -17,13 +21,30 @@ sap.ui.define([
|
|
|
17
21
|
*
|
|
18
22
|
* @param {object} mPayload - Change visualization payload from the change handler
|
|
19
23
|
* @param {string} sLabel - Change handler label
|
|
24
|
+
* @param {object} mPropertyBag - Additional properties
|
|
20
25
|
* @returns {object} Localized description text and button text
|
|
21
26
|
*/
|
|
22
|
-
MoveVisualization.getDescription = function
|
|
27
|
+
MoveVisualization.getDescription = function(mPayload, sLabel, mPropertyBag) {
|
|
23
28
|
var oRtaResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
24
|
-
var sDescriptionText = oRtaResourceBundle.getText("
|
|
25
|
-
var
|
|
26
|
-
|
|
29
|
+
var sDescriptionText = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_MOVE_WITHIN", ChangeVisualizationUtils.shortenString(sLabel));
|
|
30
|
+
var sDescriptionTooltip = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_MOVE_WITHIN", sLabel);
|
|
31
|
+
var sButtonText;
|
|
32
|
+
var oAppComponent = mPropertyBag.appComponent;
|
|
33
|
+
var sSourceParentId = (
|
|
34
|
+
mPayload.sourceParentContainer
|
|
35
|
+
&& JsControlTreeModifier.getControlIdBySelector(mPayload.sourceParentContainer, oAppComponent)
|
|
36
|
+
);
|
|
37
|
+
var sTargetParentId = (
|
|
38
|
+
mPayload.targetParentContainer
|
|
39
|
+
&& JsControlTreeModifier.getControlIdBySelector(mPayload.targetParentContainer, oAppComponent)
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
if (sSourceParentId !== sTargetParentId) {
|
|
43
|
+
sButtonText = oRtaResourceBundle.getText("BTN_CHANGEVISUALIZATION_SHOW_DEPENDENT_CONTAINER_MOVE");
|
|
44
|
+
sDescriptionText = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_MOVE", ChangeVisualizationUtils.shortenString(sLabel));
|
|
45
|
+
sDescriptionTooltip = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_MOVE", sLabel);
|
|
46
|
+
}
|
|
47
|
+
return { descriptionText: sDescriptionText, descriptionTooltip: sDescriptionTooltip, buttonText: sButtonText };
|
|
27
48
|
};
|
|
28
49
|
|
|
29
50
|
return MoveVisualization;
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils"
|
|
8
9
|
], function(
|
|
10
|
+
ChangeVisualizationUtils
|
|
9
11
|
) {
|
|
10
12
|
"use strict";
|
|
11
13
|
|
|
@@ -21,19 +23,29 @@ sap.ui.define([
|
|
|
21
23
|
* @param {string} sFallbackLabel - New label as a fallback if change handler provides no info
|
|
22
24
|
* @returns {object} Localized description
|
|
23
25
|
*/
|
|
24
|
-
RenameVisualization.getDescription = function
|
|
26
|
+
RenameVisualization.getDescription = function(mPayload, sFallbackLabel) {
|
|
25
27
|
var oRtaResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
26
28
|
var sKey = mPayload.originalLabel
|
|
27
29
|
? "TXT_CHANGEVISUALIZATION_CHANGE_RENAME_FROM_TO"
|
|
28
30
|
: "TXT_CHANGEVISUALIZATION_CHANGE_RENAME_TO";
|
|
29
31
|
var sDescriptionText = oRtaResourceBundle.getText(
|
|
32
|
+
sKey,
|
|
33
|
+
[
|
|
34
|
+
ChangeVisualizationUtils.shortenString(mPayload.newLabel) || sFallbackLabel,
|
|
35
|
+
ChangeVisualizationUtils.shortenString(mPayload.originalLabel)
|
|
36
|
+
]
|
|
37
|
+
);
|
|
38
|
+
var sDescriptionTooltip = oRtaResourceBundle.getText(
|
|
30
39
|
sKey,
|
|
31
40
|
[
|
|
32
41
|
mPayload.newLabel || sFallbackLabel,
|
|
33
42
|
mPayload.originalLabel
|
|
34
43
|
]
|
|
35
44
|
);
|
|
36
|
-
return {
|
|
45
|
+
return {
|
|
46
|
+
descriptionText: sDescriptionText,
|
|
47
|
+
descriptionTooltip: sDescriptionTooltip
|
|
48
|
+
};
|
|
37
49
|
};
|
|
38
50
|
|
|
39
51
|
return RenameVisualization;
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils"
|
|
8
9
|
], function(
|
|
10
|
+
ChangeVisualizationUtils
|
|
9
11
|
) {
|
|
10
12
|
"use strict";
|
|
11
13
|
|
|
@@ -21,9 +23,10 @@ sap.ui.define([
|
|
|
21
23
|
*/
|
|
22
24
|
SplitVisualization.getDescription = function (mPayload, sLabel) {
|
|
23
25
|
var oRtaResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
24
|
-
var sDescriptionText = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_SPLIT", sLabel);
|
|
26
|
+
var sDescriptionText = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_SPLIT", ChangeVisualizationUtils.shortenString(sLabel));
|
|
27
|
+
var sDescriptionTooltip = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_SPLIT", sLabel);
|
|
25
28
|
var sButtonText = oRtaResourceBundle.getText("BTN_CHANGEVISUALIZATION_SHOW_DEPENDENT_CONTAINER_SPLIT");
|
|
26
|
-
return { descriptionText: sDescriptionText, buttonText: sButtonText};
|
|
29
|
+
return { descriptionText: sDescriptionText, descriptionTooltip: sDescriptionTooltip, buttonText: sButtonText};
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
return SplitVisualization;
|