@openui5/sap.ui.rta 1.105.1 → 1.107.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 +20 -17
- package/THIRDPARTY.txt +31 -21
- 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 +652 -653
- package/src/sap/ui/rta/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +2 -0
- 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 +1 -1
- package/src/sap/ui/rta/command/BaseCommand.js +1 -1
- package/src/sap/ui/rta/command/BindProperty.js +1 -1
- package/src/sap/ui/rta/command/Combine.js +1 -1
- package/src/sap/ui/rta/command/CommandFactory.js +6 -5
- package/src/sap/ui/rta/command/CompositeCommand.js +7 -5
- 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 +3 -3
- package/src/sap/ui/rta/command/LREPSerializer.js +3 -2
- package/src/sap/ui/rta/command/LocalReset.js +1 -1
- package/src/sap/ui/rta/command/Move.js +1 -1
- package/src/sap/ui/rta/command/Property.js +1 -1
- package/src/sap/ui/rta/command/Remove.js +1 -1
- package/src/sap/ui/rta/command/Rename.js +1 -1
- package/src/sap/ui/rta/command/Resize.js +1 -1
- package/src/sap/ui/rta/command/Reveal.js +1 -1
- package/src/sap/ui/rta/command/Settings.js +1 -1
- package/src/sap/ui/rta/command/Split.js +1 -1
- package/src/sap/ui/rta/command/Stack.js +26 -7
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
- package/src/sap/ui/rta/enablement/elementActionTest.js +89 -15
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +31 -0
- package/src/sap/ui/rta/messagebundle_ar.properties +16 -11
- package/src/sap/ui/rta/messagebundle_bg.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ca.properties +16 -11
- package/src/sap/ui/rta/messagebundle_cs.properties +16 -11
- package/src/sap/ui/rta/messagebundle_cy.properties +16 -11
- package/src/sap/ui/rta/messagebundle_da.properties +16 -11
- package/src/sap/ui/rta/messagebundle_de.properties +17 -12
- package/src/sap/ui/rta/messagebundle_el.properties +16 -11
- package/src/sap/ui/rta/messagebundle_en.properties +7 -2
- package/src/sap/ui/rta/messagebundle_en_GB.properties +7 -2
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +13 -1
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
- package/src/sap/ui/rta/messagebundle_es.properties +16 -11
- package/src/sap/ui/rta/messagebundle_es_MX.properties +16 -11
- package/src/sap/ui/rta/messagebundle_et.properties +16 -11
- package/src/sap/ui/rta/messagebundle_fi.properties +16 -11
- package/src/sap/ui/rta/messagebundle_fr.properties +16 -11
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +16 -11
- package/src/sap/ui/rta/messagebundle_hi.properties +16 -11
- package/src/sap/ui/rta/messagebundle_hr.properties +16 -11
- package/src/sap/ui/rta/messagebundle_hu.properties +16 -11
- package/src/sap/ui/rta/messagebundle_id.properties +16 -11
- package/src/sap/ui/rta/messagebundle_it.properties +16 -11
- package/src/sap/ui/rta/messagebundle_iw.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ja.properties +16 -11
- package/src/sap/ui/rta/messagebundle_kk.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ko.properties +16 -11
- package/src/sap/ui/rta/messagebundle_lt.properties +16 -11
- package/src/sap/ui/rta/messagebundle_lv.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ms.properties +16 -11
- package/src/sap/ui/rta/messagebundle_nl.properties +16 -11
- package/src/sap/ui/rta/messagebundle_no.properties +16 -11
- package/src/sap/ui/rta/messagebundle_pl.properties +16 -11
- package/src/sap/ui/rta/messagebundle_pt.properties +16 -11
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ro.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ru.properties +16 -11
- package/src/sap/ui/rta/messagebundle_sh.properties +16 -11
- package/src/sap/ui/rta/messagebundle_sk.properties +16 -11
- package/src/sap/ui/rta/messagebundle_sl.properties +16 -11
- package/src/sap/ui/rta/messagebundle_sv.properties +16 -11
- package/src/sap/ui/rta/messagebundle_th.properties +16 -11
- package/src/sap/ui/rta/messagebundle_tr.properties +16 -11
- package/src/sap/ui/rta/messagebundle_uk.properties +16 -11
- package/src/sap/ui/rta/messagebundle_vi.properties +16 -11
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +16 -11
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +16 -11
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +7 -5
- 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 +8 -6
- package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
- package/src/sap/ui/rta/plugin/CreateContainer.js +9 -4
- 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 +3 -1
- package/src/sap/ui/rta/plugin/EasyRemove.js +3 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +2 -2
- package/src/sap/ui/rta/plugin/Plugin.js +1 -1
- package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
- package/src/sap/ui/rta/plugin/Remove.js +1 -1
- package/src/sap/ui/rta/plugin/Rename.js +3 -3
- package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
- package/src/sap/ui/rta/plugin/Resize.js +3 -3
- package/src/sap/ui/rta/plugin/Selection.js +1 -1
- package/src/sap/ui/rta/plugin/Settings.js +2 -2
- package/src/sap/ui/rta/plugin/Split.js +2 -2
- package/src/sap/ui/rta/plugin/Stretch.js +3 -1
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +9 -6
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +9 -9
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +3 -3
- 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 +6 -4
- package/src/sap/ui/rta/service/Property.js +1 -1
- package/src/sap/ui/rta/service/Selection.js +1 -1
- package/src/sap/ui/rta/service/SupportTools.js +189 -0
- package/src/sap/ui/rta/service/index.js +7 -6
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +11 -1
- package/src/sap/ui/rta/toolbar/Adaptation.js +9 -1
- package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +3 -1
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- package/src/sap/ui/rta/toolbar/BaseRenderer.js +6 -4
- package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
- package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
- package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation.js +125 -0
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptationDialog.fragment.xml +79 -0
- package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -5
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
- package/src/sap/ui/rta/util/BindingsExtractor.js +97 -41
- package/src/sap/ui/rta/util/PluginManager.js +1 -1
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- package/src/sap/ui/rta/util/ReloadManager.js +1 -1
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/StylesLoader.js +3 -3
- package/src/sap/ui/rta/util/adaptationStarter.js +13 -4
- package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +50 -0
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +44 -41
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +2 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +2 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +69 -43
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +57 -83
- package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/CombineVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/MoveVisualization.js +13 -10
- package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/RenameVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/SplitVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +37 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +0 -35
|
@@ -13,7 +13,8 @@ sap.ui.define([
|
|
|
13
13
|
"sap/ui/fl/Layer",
|
|
14
14
|
"sap/ui/fl/Utils",
|
|
15
15
|
"sap/ui/rta/util/showMessageBox",
|
|
16
|
-
"sap/ui/rta/RuntimeAuthoring"
|
|
16
|
+
"sap/ui/rta/RuntimeAuthoring",
|
|
17
|
+
"sap/ui/core/Core"
|
|
17
18
|
], function(
|
|
18
19
|
UriParameters,
|
|
19
20
|
Log,
|
|
@@ -24,7 +25,8 @@ sap.ui.define([
|
|
|
24
25
|
Layer,
|
|
25
26
|
FlexUtils,
|
|
26
27
|
showMessageBox,
|
|
27
|
-
RuntimeAuthoring
|
|
28
|
+
RuntimeAuthoring,
|
|
29
|
+
Core
|
|
28
30
|
) {
|
|
29
31
|
"use strict";
|
|
30
32
|
|
|
@@ -33,7 +35,8 @@ sap.ui.define([
|
|
|
33
35
|
return FeaturesAPI.isKeyUser()
|
|
34
36
|
.then(function(bIsKeyUser) {
|
|
35
37
|
if (!bIsKeyUser) {
|
|
36
|
-
var
|
|
38
|
+
var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
|
|
39
|
+
var oError = new Error(oRtaResourceBundle.getText("MSG_NO_KEY_USER_RIGHTS_ERROR_MESSAGE"));
|
|
37
40
|
oError.reason = "isKeyUser";
|
|
38
41
|
throw oError;
|
|
39
42
|
}
|
|
@@ -122,7 +125,7 @@ sap.ui.define([
|
|
|
122
125
|
PersistenceWriteAPI.getChangesWarning(mPropertyBag)
|
|
123
126
|
.then(function(oWarningMessage) {
|
|
124
127
|
if (oWarningMessage.showWarning) {
|
|
125
|
-
var oRtaResourceBundle =
|
|
128
|
+
var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
|
|
126
129
|
var oMessageProps = oWarningMessage.warningType === "mixedChangesWarning"
|
|
127
130
|
? {
|
|
128
131
|
text: "MSG_ADAPTATION_STARTER_MIXED_CHANGES_WARNING",
|
|
@@ -147,6 +150,12 @@ sap.ui.define([
|
|
|
147
150
|
})
|
|
148
151
|
.catch(function(vError) {
|
|
149
152
|
if (vError !== "Reload triggered") {
|
|
153
|
+
var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
|
|
154
|
+
showMessageBox(
|
|
155
|
+
oRtaResourceBundle.getText("MSG_GENERIC_ERROR_MESSAGE", vError.message),
|
|
156
|
+
{title: oRtaResourceBundle.getText("MSG_ADAPTATION_COULD_NOT_START")},
|
|
157
|
+
"error"
|
|
158
|
+
);
|
|
150
159
|
Log.error("UI Adaptation could not be started", vError.message);
|
|
151
160
|
}
|
|
152
161
|
throw vError;
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
"sap/ui/fl/changeHandler/common/ChangeCategories"
|
|
9
|
+
], function(
|
|
10
|
+
FlChangeCategories
|
|
11
|
+
) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
var ChangeCategories = {};
|
|
15
|
+
|
|
16
|
+
ChangeCategories.ALL = "all";
|
|
17
|
+
|
|
18
|
+
// Assignment of commands to change categories
|
|
19
|
+
var COMMANDS = {};
|
|
20
|
+
COMMANDS[FlChangeCategories.ADD] = [
|
|
21
|
+
"createContainer",
|
|
22
|
+
"addDelegateProperty",
|
|
23
|
+
"reveal",
|
|
24
|
+
"addIFrame"
|
|
25
|
+
];
|
|
26
|
+
COMMANDS[FlChangeCategories.MOVE] = ["move"];
|
|
27
|
+
COMMANDS[FlChangeCategories.RENAME] = ["rename"];
|
|
28
|
+
COMMANDS[FlChangeCategories.COMBINESPLIT] = ["combine", "split"];
|
|
29
|
+
COMMANDS[FlChangeCategories.REMOVE] = ["remove"];
|
|
30
|
+
COMMANDS[FlChangeCategories.OTHER] = [];
|
|
31
|
+
|
|
32
|
+
var CATEGORY_ICONS = {};
|
|
33
|
+
CATEGORY_ICONS[ChangeCategories.ALL] = "sap-icon://show";
|
|
34
|
+
CATEGORY_ICONS[FlChangeCategories.ADD] = "sap-icon://add";
|
|
35
|
+
CATEGORY_ICONS[FlChangeCategories.MOVE] = "sap-icon://move";
|
|
36
|
+
CATEGORY_ICONS[FlChangeCategories.RENAME] = "sap-icon://edit";
|
|
37
|
+
CATEGORY_ICONS[FlChangeCategories.COMBINESPLIT] = "sap-icon://combine";
|
|
38
|
+
CATEGORY_ICONS[FlChangeCategories.REMOVE] = "sap-icon://less";
|
|
39
|
+
CATEGORY_ICONS[FlChangeCategories.OTHER] = "sap-icon://key-user-settings";
|
|
40
|
+
|
|
41
|
+
ChangeCategories.getCategories = function() {
|
|
42
|
+
return COMMANDS;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
ChangeCategories.getIconForCategory = function(sCategory) {
|
|
46
|
+
return CATEGORY_ICONS[sCategory];
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return ChangeCategories;
|
|
50
|
+
});
|
|
@@ -10,33 +10,27 @@ sap.ui.define([
|
|
|
10
10
|
"sap/ui/core/Control",
|
|
11
11
|
"sap/ui/core/format/DateFormat",
|
|
12
12
|
"sap/ui/events/KeyCodes",
|
|
13
|
-
"sap/ui/rta/util/changeVisualization/
|
|
13
|
+
"sap/ui/rta/util/changeVisualization/commands/getCommandVisualization",
|
|
14
14
|
"sap/ui/fl/Utils",
|
|
15
15
|
"sap/ui/fl/util/resolveBinding",
|
|
16
16
|
"sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils",
|
|
17
|
-
"sap/ui/core/Core"
|
|
17
|
+
"sap/ui/core/Core",
|
|
18
|
+
"sap/ui/rta/util/changeVisualization/ChangeCategories"
|
|
18
19
|
], function(
|
|
19
20
|
Fragment,
|
|
20
21
|
JSONModel,
|
|
21
22
|
Control,
|
|
22
23
|
DateFormat,
|
|
23
24
|
KeyCodes,
|
|
24
|
-
|
|
25
|
+
getCommandVisualization,
|
|
25
26
|
FlUtils,
|
|
26
27
|
resolveBinding,
|
|
27
28
|
ChangeVisualizationUtils,
|
|
28
|
-
Core
|
|
29
|
+
Core,
|
|
30
|
+
ChangeCategories
|
|
29
31
|
) {
|
|
30
32
|
"use strict";
|
|
31
33
|
|
|
32
|
-
var CATEGORY_ICONS = {
|
|
33
|
-
add: "sap-icon://add",
|
|
34
|
-
move: "sap-icon://move",
|
|
35
|
-
rename: "sap-icon://edit",
|
|
36
|
-
combinesplit: "sap-icon://combine",
|
|
37
|
-
remove: "sap-icon://less"
|
|
38
|
-
};
|
|
39
|
-
|
|
40
34
|
/**
|
|
41
35
|
* @class
|
|
42
36
|
* Constructor for a new <code>sap.ui.rta.util.changeVisualization.ChangeIndicator</code> class.
|
|
@@ -46,7 +40,7 @@ sap.ui.define([
|
|
|
46
40
|
* @alias sap.ui.rta.util.changeVisualization.ChangeIndicator
|
|
47
41
|
* @author SAP SE
|
|
48
42
|
* @since 1.84.0
|
|
49
|
-
* @version 1.
|
|
43
|
+
* @version 1.107.0
|
|
50
44
|
* @private
|
|
51
45
|
*/
|
|
52
46
|
var ChangeIndicator = Control.extend("sap.ui.rta.util.changeVisualization.ChangeIndicator", {
|
|
@@ -168,50 +162,59 @@ sap.ui.define([
|
|
|
168
162
|
|
|
169
163
|
function getTexts(mChangeInformation, oRtaResourceBundle, sOverlayId) {
|
|
170
164
|
var oAffectedElement = Core.byId(mChangeInformation.affectedElementId);
|
|
171
|
-
var
|
|
172
|
-
var vOriginalValue = mChangeInformation.
|
|
165
|
+
var mDescriptionPayload = Object.keys(mChangeInformation.descriptionPayload || {}).reduce(function(mDescriptionPayload, sKey) {
|
|
166
|
+
var vOriginalValue = mChangeInformation.descriptionPayload[sKey];
|
|
173
167
|
var bIsBinding = FlUtils.isBinding(vOriginalValue);
|
|
174
168
|
var vValue = bIsBinding
|
|
175
169
|
? resolveBinding(vOriginalValue, oAffectedElement)
|
|
176
170
|
: vOriginalValue;
|
|
177
|
-
|
|
178
|
-
return
|
|
171
|
+
mDescriptionPayload[sKey] = vValue;
|
|
172
|
+
return mDescriptionPayload;
|
|
179
173
|
}, {});
|
|
180
174
|
|
|
181
175
|
var mPropertyBag = { appComponent: FlUtils.getAppComponentForControl(oAffectedElement) };
|
|
182
176
|
var oOverlay = Core.byId(sOverlayId);
|
|
183
|
-
var oVisualizationUtil = getVisualizationCategory(mChangeInformation);
|
|
184
177
|
var sElementLabel = oOverlay.getDesignTimeMetadata().getLabel(oAffectedElement);
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
-
var
|
|
188
|
-
var sChangeTextKey = (
|
|
189
|
-
"TXT_CHANGEVISUALIZATION_CHANGE_"
|
|
190
|
-
+ mChangeInformation.commandName.toUpperCase()
|
|
191
|
-
);
|
|
192
|
-
|
|
178
|
+
var oCommandVisualization = getCommandVisualization(mChangeInformation);
|
|
179
|
+
var oDescription = oCommandVisualization && oCommandVisualization.getDescription(mDescriptionPayload, sElementLabel, mPropertyBag) || {};
|
|
180
|
+
var sCommandName = mChangeInformation.commandName;
|
|
193
181
|
var sDescriptionText;
|
|
194
182
|
var sDescriptionTooltip;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
183
|
+
|
|
184
|
+
// 'Settings' with a custom description should overwrite the description from the CommandVisualization
|
|
185
|
+
if (sCommandName === "settings" && mDescriptionPayload.description) {
|
|
186
|
+
oDescription.descriptionText = mDescriptionPayload.description;
|
|
187
|
+
oDescription.descriptionTooltip = mDescriptionPayload.descriptionTooltip;
|
|
188
|
+
} else if (mChangeInformation.changeCategory === "other") {
|
|
189
|
+
// To retrieve the generic description for commands without visualization
|
|
190
|
+
sCommandName = "other";
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (oDescription.descriptionText) {
|
|
194
|
+
sDescriptionText = oDescription.descriptionText;
|
|
195
|
+
sDescriptionTooltip = oDescription.descriptionTooltip || "";
|
|
199
196
|
} else {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
sDescriptionTooltip =
|
|
197
|
+
sElementLabel = sElementLabel && "'" + sElementLabel + "'";
|
|
198
|
+
var sShortenedElementLabel = ChangeVisualizationUtils.shortenString(sElementLabel);
|
|
199
|
+
var sChangeTextKey = (
|
|
200
|
+
"TXT_CHANGEVISUALIZATION_CHANGE_"
|
|
201
|
+
+ sCommandName.toUpperCase()
|
|
202
|
+
);
|
|
203
|
+
sDescriptionText = oRtaResourceBundle.getText(sChangeTextKey, sShortenedElementLabel);
|
|
204
|
+
sDescriptionTooltip = oRtaResourceBundle.getText(sChangeTextKey, sElementLabel);
|
|
208
205
|
}
|
|
206
|
+
sDescriptionTooltip = sDescriptionText.length < sDescriptionTooltip.length ? sDescriptionTooltip : null;
|
|
209
207
|
var sDetailButtonText = oDescription && oDescription.buttonText;
|
|
208
|
+
var sIconTooltip = oRtaResourceBundle.getText(
|
|
209
|
+
"TXT_CHANGEVISUALIZATION_OVERVIEW_"
|
|
210
|
+
+ mChangeInformation.changeCategory.toUpperCase()
|
|
211
|
+
);
|
|
210
212
|
|
|
211
213
|
return {
|
|
212
214
|
description: sDescriptionText,
|
|
213
215
|
tooltip: sDescriptionTooltip,
|
|
214
|
-
buttonText: sDetailButtonText
|
|
216
|
+
buttonText: sDetailButtonText,
|
|
217
|
+
iconTooltip: sIconTooltip
|
|
215
218
|
};
|
|
216
219
|
}
|
|
217
220
|
|
|
@@ -231,7 +234,6 @@ sap.ui.define([
|
|
|
231
234
|
var oTexts = getTexts(mChangeInformation, oRtaResourceBundle, sOverlayId);
|
|
232
235
|
var oDates = getDates(mChangeInformation, oRtaResourceBundle);
|
|
233
236
|
|
|
234
|
-
|
|
235
237
|
return {
|
|
236
238
|
id: mChangeInformation.id,
|
|
237
239
|
change: mChangeInformation,
|
|
@@ -240,7 +242,8 @@ sap.ui.define([
|
|
|
240
242
|
fullDate: oDates.fullDate,
|
|
241
243
|
relativeDate: oDates.relativeDate,
|
|
242
244
|
detailButtonText: oTexts.buttonText,
|
|
243
|
-
icon:
|
|
245
|
+
icon: ChangeCategories.getIconForCategory(mChangeInformation.changeCategory),
|
|
246
|
+
iconTooltip: oTexts.iconTooltip
|
|
244
247
|
};
|
|
245
248
|
}
|
|
246
249
|
|
package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml
CHANGED
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
</MessageStrip>
|
|
19
19
|
<List
|
|
20
20
|
class="sapUiRtaChangesList"
|
|
21
|
-
items="{visualizationModel>/
|
|
21
|
+
items="{visualizationModel>/changeCategories/}">
|
|
22
22
|
<StandardListItem
|
|
23
23
|
title="{visualizationModel>title}"
|
|
24
24
|
counter="{visualizationModel>count}"
|
|
25
25
|
type="{= ${visualizationModel>count} > 0 ? 'Active' : 'Inactive'}"
|
|
26
26
|
icon="{visualizationModel>icon}"
|
|
27
|
-
press=".
|
|
27
|
+
press=".onChangeCategorySelection"/>
|
|
28
28
|
</List>
|
|
29
29
|
</Popover>
|
|
30
30
|
</core:FragmentDefinition>
|
|
@@ -13,7 +13,8 @@ sap.ui.define([
|
|
|
13
13
|
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
14
14
|
"sap/ui/dt/ElementUtil",
|
|
15
15
|
"sap/ui/fl/write/api/ChangesWriteAPI",
|
|
16
|
-
"sap/ui/fl/Utils"
|
|
16
|
+
"sap/ui/fl/Utils",
|
|
17
|
+
"sap/ui/fl/changeHandler/common/ChangeCategories"
|
|
17
18
|
], function(
|
|
18
19
|
includes,
|
|
19
20
|
values,
|
|
@@ -23,7 +24,8 @@ sap.ui.define([
|
|
|
23
24
|
JsControlTreeModifier,
|
|
24
25
|
ElementUtil,
|
|
25
26
|
ChangesWriteAPI,
|
|
26
|
-
FlUtils
|
|
27
|
+
FlUtils,
|
|
28
|
+
ChangeCategories
|
|
27
29
|
) {
|
|
28
30
|
"use strict";
|
|
29
31
|
|
|
@@ -35,7 +37,7 @@ sap.ui.define([
|
|
|
35
37
|
* @alias sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry
|
|
36
38
|
* @author SAP SE
|
|
37
39
|
* @since 1.86.0
|
|
38
|
-
* @version 1.
|
|
40
|
+
* @version 1.107.0
|
|
39
41
|
* @private
|
|
40
42
|
*/
|
|
41
43
|
var ChangeIndicatorRegistry = ManagedObject.extend("sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry", {
|
|
@@ -44,7 +46,7 @@ sap.ui.define([
|
|
|
44
46
|
/**
|
|
45
47
|
* Available command categories
|
|
46
48
|
*/
|
|
47
|
-
|
|
49
|
+
changeCategories: {
|
|
48
50
|
type: "object",
|
|
49
51
|
defaultValue: []
|
|
50
52
|
},
|
|
@@ -58,7 +60,11 @@ sap.ui.define([
|
|
|
58
60
|
},
|
|
59
61
|
constructor: function () {
|
|
60
62
|
ManagedObject.prototype.constructor.apply(this, arguments);
|
|
61
|
-
|
|
63
|
+
|
|
64
|
+
// List of entries with indicator data, grouped by Change ID
|
|
65
|
+
this._oRegisteredChanges = {};
|
|
66
|
+
|
|
67
|
+
// List of actual change indicator objects, grouped by selector
|
|
62
68
|
this._oChangeIndicators = {};
|
|
63
69
|
}
|
|
64
70
|
});
|
|
@@ -68,12 +74,12 @@ sap.ui.define([
|
|
|
68
74
|
};
|
|
69
75
|
|
|
70
76
|
/**
|
|
71
|
-
* Returns all registered changes.
|
|
77
|
+
* Returns the change indicator data for all registered changes.
|
|
72
78
|
*
|
|
73
|
-
* @returns {object[]}
|
|
79
|
+
* @returns {object[]} Change indicator data for all registered changes
|
|
74
80
|
*/
|
|
75
|
-
ChangeIndicatorRegistry.prototype.
|
|
76
|
-
return values(this.
|
|
81
|
+
ChangeIndicatorRegistry.prototype.getAllRegisteredChanges = function () {
|
|
82
|
+
return values(this._oRegisteredChanges || {}).map(function (oChange) {
|
|
77
83
|
return Object.assign({}, oChange);
|
|
78
84
|
});
|
|
79
85
|
};
|
|
@@ -81,55 +87,58 @@ sap.ui.define([
|
|
|
81
87
|
/**
|
|
82
88
|
* Returns the IDs of all registered changes.
|
|
83
89
|
*
|
|
84
|
-
* @returns {string[]}
|
|
90
|
+
* @returns {string[]} Array with both design time and runtime registered changes
|
|
85
91
|
*/
|
|
86
|
-
ChangeIndicatorRegistry.prototype.
|
|
87
|
-
return Object.keys(this.
|
|
92
|
+
ChangeIndicatorRegistry.prototype.getRegisteredChangeIds = function () {
|
|
93
|
+
return Object.keys(this._oRegisteredChanges || {});
|
|
88
94
|
};
|
|
89
95
|
|
|
90
96
|
/**
|
|
91
|
-
* Returns a registered change.
|
|
97
|
+
* Returns a data entry of a registered change indicator for a change ID.
|
|
92
98
|
*
|
|
93
99
|
* @param {string} sChangeId - ID of the registered change
|
|
94
100
|
* @returns {object} Registered change
|
|
95
101
|
*/
|
|
96
|
-
ChangeIndicatorRegistry.prototype.
|
|
97
|
-
return this.
|
|
102
|
+
ChangeIndicatorRegistry.prototype.getRegisteredChange = function (sChangeId) {
|
|
103
|
+
return this._oRegisteredChanges[sChangeId] && Object.assign({}, this._oRegisteredChanges[sChangeId]);
|
|
98
104
|
};
|
|
99
105
|
|
|
100
106
|
/**
|
|
101
107
|
* Groups all registered changes by their selectors and returns a list of selectors
|
|
102
|
-
* with all dependent and non-dependent
|
|
108
|
+
* with all dependent and non-dependent change indicator data.
|
|
103
109
|
*
|
|
104
|
-
* @returns {object
|
|
110
|
+
* @returns {object} List of selectors with change indicator data.
|
|
105
111
|
*/
|
|
106
|
-
ChangeIndicatorRegistry.prototype.
|
|
112
|
+
ChangeIndicatorRegistry.prototype.getSelectorsWithRegisteredChanges = function () {
|
|
107
113
|
var oChangeIndicators = {};
|
|
108
114
|
|
|
109
|
-
function addSelector (sSelectorId, sAffectedElementId,
|
|
115
|
+
function addSelector (sSelectorId, sAffectedElementId, oChangeIndicatorData, bDependent) {
|
|
110
116
|
if (oChangeIndicators[sSelectorId] === undefined) {
|
|
111
117
|
oChangeIndicators[sSelectorId] = [];
|
|
112
118
|
}
|
|
113
119
|
oChangeIndicators[sSelectorId].push(Object.assign(
|
|
114
120
|
{
|
|
115
|
-
id:
|
|
121
|
+
id: oChangeIndicatorData.change.getId(),
|
|
116
122
|
dependent: bDependent,
|
|
117
123
|
affectedElementId: sAffectedElementId,
|
|
118
|
-
|
|
124
|
+
descriptionPayload: oChangeIndicatorData.visualizationInfo.descriptionPayload || {}
|
|
119
125
|
},
|
|
120
|
-
_omit(
|
|
126
|
+
_omit(oChangeIndicatorData, ["visualizationInfo"])
|
|
121
127
|
));
|
|
122
128
|
}
|
|
123
129
|
|
|
124
|
-
values(this.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
130
|
+
values(this._oRegisteredChanges)
|
|
131
|
+
.forEach(function (oChangeIndicatorData) {
|
|
132
|
+
oChangeIndicatorData.visualizationInfo.displayElementIds
|
|
133
|
+
.forEach(function (sId, iIndex) {
|
|
134
|
+
addSelector(sId, oChangeIndicatorData.visualizationInfo.affectedElementIds[iIndex], oChangeIndicatorData, false);
|
|
135
|
+
});
|
|
128
136
|
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
oChangeIndicatorData.visualizationInfo.dependentElementIds
|
|
138
|
+
.forEach(function (sId) {
|
|
139
|
+
addSelector(sId, sId, oChangeIndicatorData, true);
|
|
140
|
+
});
|
|
131
141
|
});
|
|
132
|
-
});
|
|
133
142
|
|
|
134
143
|
return oChangeIndicators;
|
|
135
144
|
};
|
|
@@ -163,20 +172,24 @@ sap.ui.define([
|
|
|
163
172
|
ChangeIndicatorRegistry.prototype.registerChange = function(oChange, sCommandName) {
|
|
164
173
|
var oAppComponent = FlUtils.getAppComponentForControl(ElementUtil.getElementInstance(this.getRootControlId()));
|
|
165
174
|
return getVisualizationInfo(oChange, oAppComponent).then(function(mChangeVisualizationInfo) {
|
|
166
|
-
var aCategories = this.
|
|
167
|
-
var
|
|
168
|
-
|
|
169
|
-
|
|
175
|
+
var aCategories = this.getChangeCategories();
|
|
176
|
+
var sChangeCategory;
|
|
177
|
+
// For "settings", the control developer can choose one of the existing categories
|
|
178
|
+
if (sCommandName === "settings" && includes(Object.keys(aCategories), mChangeVisualizationInfo.descriptionPayload.category)) {
|
|
179
|
+
sChangeCategory = mChangeVisualizationInfo.descriptionPayload.category;
|
|
170
180
|
} else {
|
|
171
|
-
|
|
172
|
-
return includes(aCategories[
|
|
181
|
+
sChangeCategory = Object.keys(aCategories).find(function (sChangeCategoryName) {
|
|
182
|
+
return includes(aCategories[sChangeCategoryName], sCommandName);
|
|
173
183
|
});
|
|
184
|
+
if (!sChangeCategory) {
|
|
185
|
+
sChangeCategory = ChangeCategories.OTHER;
|
|
186
|
+
}
|
|
174
187
|
}
|
|
175
188
|
|
|
176
|
-
this.
|
|
189
|
+
this._oRegisteredChanges[oChange.getId()] = {
|
|
177
190
|
change: oChange,
|
|
178
191
|
commandName: sCommandName,
|
|
179
|
-
|
|
192
|
+
changeCategory: sChangeCategory,
|
|
180
193
|
visualizationInfo: mChangeVisualizationInfo
|
|
181
194
|
};
|
|
182
195
|
}.bind(this));
|
|
@@ -206,7 +219,8 @@ sap.ui.define([
|
|
|
206
219
|
affectedElementIds: aAffectedElementIds,
|
|
207
220
|
dependentElementIds: getSelectorIds(mVisualizationInfo.dependentControls) || [],
|
|
208
221
|
displayElementIds: getSelectorIds(mVisualizationInfo.displayControls) || aAffectedElementIds,
|
|
209
|
-
|
|
222
|
+
updateRequired: mVisualizationInfo.updateRequired,
|
|
223
|
+
descriptionPayload: mVisualizationInfo.descriptionPayload || {}
|
|
210
224
|
};
|
|
211
225
|
});
|
|
212
226
|
}
|
|
@@ -249,8 +263,8 @@ sap.ui.define([
|
|
|
249
263
|
* Resets the change and change indicator registries.
|
|
250
264
|
*/
|
|
251
265
|
ChangeIndicatorRegistry.prototype.reset = function () {
|
|
252
|
-
Object.keys(this.
|
|
253
|
-
this.
|
|
266
|
+
Object.keys(this._oRegisteredChanges).forEach(function (sKeyToRemove) {
|
|
267
|
+
this.removeRegisteredChange(sKeyToRemove);
|
|
254
268
|
}.bind(this));
|
|
255
269
|
|
|
256
270
|
values(this._oChangeIndicators).forEach(function (oIndicator) {
|
|
@@ -260,12 +274,24 @@ sap.ui.define([
|
|
|
260
274
|
};
|
|
261
275
|
|
|
262
276
|
/**
|
|
263
|
-
* Removes a change.
|
|
277
|
+
* Removes a data entry of a registered change indicator.
|
|
264
278
|
*
|
|
265
279
|
* @param {string} sChangeId - ID of the registered change
|
|
266
280
|
*/
|
|
267
|
-
ChangeIndicatorRegistry.prototype.
|
|
268
|
-
delete this.
|
|
281
|
+
ChangeIndicatorRegistry.prototype.removeRegisteredChange = function (sChangeId) {
|
|
282
|
+
delete this._oRegisteredChanges[sChangeId];
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Removes changes with the updateRequired flag from the registry so the change can be re-registered and
|
|
287
|
+
* the visualizationInfo is updated => if an element has an unstable id this updates the id information in the registry (e.g simple forms)
|
|
288
|
+
*/
|
|
289
|
+
ChangeIndicatorRegistry.prototype.removeOutdatedRegisteredChanges = function () {
|
|
290
|
+
this.getAllRegisteredChanges().forEach(function(oChange) {
|
|
291
|
+
if (oChange.visualizationInfo && oChange.visualizationInfo.updateRequired) {
|
|
292
|
+
this.removeRegisteredChange(oChange.change.getId());
|
|
293
|
+
}
|
|
294
|
+
}.bind(this));
|
|
269
295
|
};
|
|
270
296
|
|
|
271
297
|
return ChangeIndicatorRegistry;
|