@openui5/sap.ui.rta 1.133.1 → 1.135.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/.reuse/dep5 +0 -7
  2. package/THIRDPARTY.txt +2 -23
  3. package/package.json +6 -6
  4. package/src/sap/ui/rta/.library +1 -1
  5. package/src/sap/ui/rta/Client.js +1 -1
  6. package/src/sap/ui/rta/RuntimeAuthoring.js +38 -17
  7. package/src/sap/ui/rta/Utils.js +11 -1
  8. package/src/sap/ui/rta/appVariant/AppVariantManager.js +26 -26
  9. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +0 -4
  10. package/src/sap/ui/rta/appVariant/Feature.js +85 -91
  11. package/src/sap/ui/rta/appVariant/Utils.js +50 -56
  12. package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +30 -30
  13. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr_CA.properties +2 -2
  14. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  15. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  16. package/src/sap/ui/rta/command/AddXML.js +1 -1
  17. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  18. package/src/sap/ui/rta/command/AnnotationCommand.js +65 -5
  19. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  20. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  21. package/src/sap/ui/rta/command/Combine.js +1 -1
  22. package/src/sap/ui/rta/command/CommandFactory.js +71 -47
  23. package/src/sap/ui/rta/command/CompositeCommand.js +12 -12
  24. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  25. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  26. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  27. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  28. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  29. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  30. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  31. package/src/sap/ui/rta/command/ExtendControllerCommand.js +92 -0
  32. package/src/sap/ui/rta/command/FlexCommand.js +54 -43
  33. package/src/sap/ui/rta/command/LREPSerializer.js +23 -23
  34. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  35. package/src/sap/ui/rta/command/ManifestCommand.js +112 -0
  36. package/src/sap/ui/rta/command/Move.js +1 -1
  37. package/src/sap/ui/rta/command/Property.js +1 -1
  38. package/src/sap/ui/rta/command/Remove.js +1 -1
  39. package/src/sap/ui/rta/command/Rename.js +1 -1
  40. package/src/sap/ui/rta/command/Resize.js +1 -1
  41. package/src/sap/ui/rta/command/Reveal.js +1 -1
  42. package/src/sap/ui/rta/command/Settings.js +1 -1
  43. package/src/sap/ui/rta/command/Split.js +1 -1
  44. package/src/sap/ui/rta/command/Stack.js +1 -1
  45. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  46. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  47. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  48. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  49. package/src/sap/ui/rta/command/{appDescriptor → manifest}/AddLibrary.js +10 -10
  50. package/src/sap/ui/rta/enablement/elementActionTest.js +1 -7
  51. package/src/sap/ui/rta/library.js +2 -2
  52. package/src/sap/ui/rta/messagebundle.properties +22 -7
  53. package/src/sap/ui/rta/messagebundle_ar.properties +3 -1
  54. package/src/sap/ui/rta/messagebundle_bg.properties +4 -2
  55. package/src/sap/ui/rta/messagebundle_ca.properties +3 -1
  56. package/src/sap/ui/rta/messagebundle_cnr.properties +4 -2
  57. package/src/sap/ui/rta/messagebundle_cs.properties +3 -1
  58. package/src/sap/ui/rta/messagebundle_cy.properties +3 -1
  59. package/src/sap/ui/rta/messagebundle_da.properties +4 -2
  60. package/src/sap/ui/rta/messagebundle_de.properties +3 -1
  61. package/src/sap/ui/rta/messagebundle_el.properties +3 -1
  62. package/src/sap/ui/rta/messagebundle_en.properties +3 -1
  63. package/src/sap/ui/rta/messagebundle_en_GB.properties +3 -1
  64. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +10 -2
  65. package/src/sap/ui/rta/messagebundle_es.properties +3 -1
  66. package/src/sap/ui/rta/messagebundle_es_MX.properties +4 -2
  67. package/src/sap/ui/rta/messagebundle_et.properties +3 -1
  68. package/src/sap/ui/rta/messagebundle_fi.properties +4 -2
  69. package/src/sap/ui/rta/messagebundle_fr.properties +12 -10
  70. package/src/sap/ui/rta/messagebundle_fr_CA.properties +7 -5
  71. package/src/sap/ui/rta/messagebundle_hi.properties +3 -1
  72. package/src/sap/ui/rta/messagebundle_hr.properties +34 -32
  73. package/src/sap/ui/rta/messagebundle_hu.properties +3 -1
  74. package/src/sap/ui/rta/messagebundle_id.properties +3 -1
  75. package/src/sap/ui/rta/messagebundle_it.properties +48 -46
  76. package/src/sap/ui/rta/messagebundle_iw.properties +3 -1
  77. package/src/sap/ui/rta/messagebundle_ja.properties +3 -1
  78. package/src/sap/ui/rta/messagebundle_kk.properties +3 -1
  79. package/src/sap/ui/rta/messagebundle_ko.properties +3 -1
  80. package/src/sap/ui/rta/messagebundle_lt.properties +3 -1
  81. package/src/sap/ui/rta/messagebundle_lv.properties +3 -1
  82. package/src/sap/ui/rta/messagebundle_mk.properties +3 -1
  83. package/src/sap/ui/rta/messagebundle_ms.properties +3 -1
  84. package/src/sap/ui/rta/messagebundle_nl.properties +3 -1
  85. package/src/sap/ui/rta/messagebundle_no.properties +3 -1
  86. package/src/sap/ui/rta/messagebundle_pl.properties +3 -1
  87. package/src/sap/ui/rta/messagebundle_pt.properties +3 -1
  88. package/src/sap/ui/rta/messagebundle_pt_PT.properties +3 -1
  89. package/src/sap/ui/rta/messagebundle_ro.properties +3 -1
  90. package/src/sap/ui/rta/messagebundle_ru.properties +3 -1
  91. package/src/sap/ui/rta/messagebundle_sh.properties +4 -2
  92. package/src/sap/ui/rta/messagebundle_sk.properties +3 -1
  93. package/src/sap/ui/rta/messagebundle_sl.properties +3 -1
  94. package/src/sap/ui/rta/messagebundle_sr.properties +4 -2
  95. package/src/sap/ui/rta/messagebundle_sv.properties +3 -1
  96. package/src/sap/ui/rta/messagebundle_th.properties +3 -1
  97. package/src/sap/ui/rta/messagebundle_tr.properties +3 -1
  98. package/src/sap/ui/rta/messagebundle_uk.properties +3 -1
  99. package/src/sap/ui/rta/messagebundle_vi.properties +3 -1
  100. package/src/sap/ui/rta/messagebundle_zh_CN.properties +3 -1
  101. package/src/sap/ui/rta/messagebundle_zh_TW.properties +3 -1
  102. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +41 -35
  103. package/src/sap/ui/rta/plugin/AddXMLPlugin.js +168 -0
  104. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  105. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  106. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  107. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  108. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  109. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  110. package/src/sap/ui/rta/plugin/ExtendControllerPlugin.js +161 -0
  111. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  112. package/src/sap/ui/rta/plugin/Plugin.js +7 -4
  113. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  114. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  115. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  116. package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
  117. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  118. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  119. package/src/sap/ui/rta/plugin/Settings.js +71 -61
  120. package/src/sap/ui/rta/plugin/Split.js +1 -1
  121. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  122. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  123. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  124. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  125. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  126. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
  127. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.fragment.xml +38 -51
  128. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.js +85 -47
  129. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +97 -33
  130. package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +72 -17
  131. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  132. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  133. package/src/sap/ui/rta/service/Action.js +1 -1
  134. package/src/sap/ui/rta/service/ControllerExtension.js +10 -4
  135. package/src/sap/ui/rta/service/Outline.js +1 -1
  136. package/src/sap/ui/rta/service/Property.js +1 -1
  137. package/src/sap/ui/rta/service/Selection.js +1 -1
  138. package/src/sap/ui/rta/service/SupportTools.js +1 -1
  139. package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +5 -0
  140. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +21 -3
  141. package/src/sap/ui/rta/toolbar/Adaptation.js +33 -7
  142. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  143. package/src/sap/ui/rta/toolbar/Fiori.js +4 -3
  144. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  145. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  146. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  147. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
  148. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  149. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  150. package/src/sap/ui/rta/util/Animation.js +1 -1
  151. package/src/sap/ui/rta/util/BindingsExtractor.js +1 -1
  152. package/src/sap/ui/rta/util/PluginManager.js +5 -7
  153. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  154. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  155. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  156. package/src/sap/ui/rta/util/ServiceManager.js +1 -1
  157. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
  158. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
  159. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +2 -2
  160. package/src/sap/ui/rta/util/isReuseComponent.js +44 -0
  161. package/src/sap/ui/rta/util/validateText.js +1 -1
  162. package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +1 -1
  163. package/src/sap/ui/rta/util/whatsNew/WhatsNewUtils.js +12 -7
  164. package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +0 -5
  165. package/src/sap/ui/rta/command/AppDescriptorCommand.js +0 -114
@@ -0,0 +1,161 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2025 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/dt/Util",
9
+ "sap/ui/fl/Utils",
10
+ "sap/ui/rta/plugin/Plugin",
11
+ "sap/ui/rta/util/isReuseComponent",
12
+ "sap/ui/rta/Utils"
13
+ ], function(
14
+ DtUtil,
15
+ FlUtils,
16
+ Plugin,
17
+ isReuseComponent,
18
+ RtaUtils
19
+ ) {
20
+ "use strict";
21
+
22
+ /**
23
+ *
24
+ * @typedef {function} sap.ui.rta.plugin.ExtendController.handlerFunction
25
+ * @since 1.134
26
+ * @param {sap.ui.dt.ElementOverlay} oOverlay - Target overlay for where XML will be added
27
+
28
+ /**
29
+ * Constructor for a new ExtendController plugin.
30
+ * The controller handler <code>{@link sap.ui.rta.plugin.ExtendController.handlerFunction HandlerFunction}</code>
31
+ * is a callback function that needs to be passed on instantiation of the plugin or alternatively into the
32
+ * propertyBag when the handler function is called.
33
+ *
34
+ * @class
35
+ * @extends sap.ui.rta.plugin.Plugin
36
+ * @author SAP SE
37
+ * @version 1.135.0
38
+ * @constructor
39
+ * @private
40
+ * @since 1.134
41
+ * @alias sap.ui.rta.plugin.ExtendControllerPlugin
42
+ */
43
+ const ExtendControllerPlugin = Plugin
44
+ .extend("sap.ui.rta.plugin.ExtendController", /** @lends sap.ui.rta.plugin.ExtendControllerPlugin.prototype */ {
45
+ metadata: {
46
+ library: "sap.ui.rta",
47
+ properties: {
48
+ handlerFunction: {
49
+ type: "function"
50
+ }
51
+ },
52
+ associations: {},
53
+ events: {}
54
+ }
55
+ });
56
+
57
+ const FLEX_CHANGE_TYPE = "codeExt";
58
+
59
+ /**
60
+ * Check if the given overlay should be editable.
61
+ *
62
+ * @param {sap.ui.dt.ElementOverlay} oOverlay - Overlay to be checked for editable
63
+ * @returns {Promise<boolean>} <code>true</code> when editable wrapped in a promise
64
+ * @private
65
+ */
66
+ ExtendControllerPlugin.prototype._isEditable = async function(oOverlay) {
67
+ const oComponent = FlUtils.getComponentForControl(oOverlay.getElement());
68
+ const bIsS4HanaCloud = RtaUtils.isS4HanaCloud();
69
+ if (
70
+ bIsS4HanaCloud ||
71
+ isReuseComponent(oComponent)
72
+ ) {
73
+ return false;
74
+ }
75
+ const bHasChangeHandler = await this.hasChangeHandler(FLEX_CHANGE_TYPE, oOverlay.getElement());
76
+ return bHasChangeHandler;
77
+ };
78
+
79
+ /**
80
+ * Checks if ExtendController is enabled for the given overlays
81
+ * @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - Target overlays
82
+ * @returns {boolean} <code>true</code> if enabled
83
+ * @public
84
+ */
85
+ ExtendControllerPlugin.prototype.isEnabled = function(aElementOverlays) {
86
+ const bEnabled = aElementOverlays.length === 1;
87
+ return bEnabled;
88
+ };
89
+
90
+ function handleExtendControllerCommand(mExtendControllerData, oElement) {
91
+ const mExtendControllerSettings = {
92
+ codeRef: mExtendControllerData.codeRef,
93
+ viewId: mExtendControllerData.viewId
94
+ };
95
+
96
+ return this.getCommandFactory().getCommandFor(
97
+ oElement,
98
+ FLEX_CHANGE_TYPE,
99
+ mExtendControllerSettings
100
+ );
101
+ }
102
+
103
+ /**
104
+ * Triggers the plugin execution.
105
+ * @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - Target overlays
106
+ * @param {Object} mPropertyBag - Property bag
107
+ * @param {sap.ui.rta.plugin.ExtentController.handlerFunction} [mPropertyBag.handlerFunction] - Handler function for controller handling. The controller handler is a callback function that needs to be passed here into the <code>propertyBag</code> or alternatively on instantiation of the plugin.
108
+ * @returns {Promise} Resolves when handler is executed successfully
109
+ */
110
+ ExtendControllerPlugin.prototype.handler = async function(aElementOverlays, mPropertyBag) {
111
+ try {
112
+ const fnControllerHandler = mPropertyBag.handlerFunction || this.getHandlerFunction();
113
+ if (!fnControllerHandler) {
114
+ throw Error("Controller handler function is not available in the handler");
115
+ }
116
+
117
+ const oElementOverlay = aElementOverlays[0];
118
+
119
+ const mExtendControllerData = await fnControllerHandler(oElementOverlay);
120
+
121
+ const oExtendControllerCommand = await handleExtendControllerCommand.call(
122
+ this,
123
+ mExtendControllerData,
124
+ oElementOverlay.getElement()
125
+ );
126
+
127
+ this.fireElementModified({
128
+ command: oExtendControllerCommand
129
+ });
130
+ } catch (vError) {
131
+ throw DtUtil.propagateError(
132
+ vError,
133
+ "ExtentController#handler",
134
+ "Error occurred in ExtentController handler function",
135
+ "sap.ui.rta"
136
+ );
137
+ }
138
+ };
139
+
140
+ /**
141
+ * Retrieves the context menu item for the action.
142
+ * @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - Target overlays
143
+ * @returns {object[]} Array of the items with required data
144
+ */
145
+ ExtendControllerPlugin.prototype.getMenuItems = function(aElementOverlays) {
146
+ return this._getMenuItems(aElementOverlays, {
147
+ pluginId: "CTX_EXTEND_CONTROLLER",
148
+ icon: "sap-icon://create-form"
149
+ });
150
+ };
151
+
152
+ /**
153
+ * Gets the name of the action related to this plugin.
154
+ * @returns {string} Action name
155
+ */
156
+ ExtendControllerPlugin.prototype.getActionName = function() {
157
+ return "extendController";
158
+ };
159
+
160
+ return ExtendControllerPlugin;
161
+ });
@@ -41,7 +41,7 @@ sap.ui.define([
41
41
  * @class
42
42
  * @extends sap.ui.rta.plugin.Plugin
43
43
  * @author SAP SE
44
- * @version 1.133.1
44
+ * @version 1.135.0
45
45
  * @constructor
46
46
  * @private
47
47
  * @since 1.90
@@ -27,6 +27,7 @@ sap.ui.define([
27
27
  // The ranks define the order of the plugin actions in the context menu
28
28
  const CONTEXT_MENU_RANKS = {
29
29
  CTX_RENAME: 10,
30
+ CTX_ANNOTATION_CHANGE_SINGLE_LABEL: 12,
30
31
  CTX_ADD_ELEMENTS_AS_SIBLING: 20,
31
32
  CTX_ADD_ELEMENTS_AS_CHILD: 25,
32
33
  CTX_ADD_ELEMENTS_CHILD_AND_SIBLING: 30,
@@ -39,12 +40,12 @@ sap.ui.define([
39
40
  CTX_GROUP_FIELDS: 90,
40
41
  CTX_UNGROUP_FIELDS: 100,
41
42
  CTX_ADDXML_AT_EXTENSIONPOINT: 105,
43
+ CTX_ADDXML: 106,
44
+ CTX_EXTEND_CONTROLLER: 107,
42
45
  // Settings ranks go up 1 by 1 for each setting
43
46
  CTX_SETTINGS: 110,
44
47
  // IFrame ranks go up 1 by 1 for each possible child target
45
48
  CTX_CREATE_SIBLING_IFRAME: 130,
46
- // Annotation ranks go up 1 by 1 for each action
47
- CTX_ANNOTATION: 140,
48
49
  // Variant types are mutually exclusive
49
50
  CTX_VARIANT_SET_TITLE: 200,
50
51
  CTX_COMP_VARIANT_RENAME: 200,
@@ -56,7 +57,9 @@ sap.ui.define([
56
57
  CTX_COMP_VARIANT_MANAGE: 230,
57
58
  CTX_VARIANT_SWITCH_SUBMENU: 240,
58
59
  CTX_COMP_VARIANT_SWITCH: 240,
59
- CTX_COMP_VARIANT_CONTENT: 250
60
+ CTX_COMP_VARIANT_CONTENT: 250,
61
+ // Annotation ranks go up 1 by 1 for each action
62
+ CTX_ANNOTATION: 300
60
63
  };
61
64
 
62
65
  function _handleEditableByPlugin(mPropertyBag, aPromises, oSourceElementOverlay) {
@@ -105,7 +108,7 @@ sap.ui.define([
105
108
  * @extends sap.ui.dt.Plugin
106
109
  *
107
110
  * @author SAP SE
108
- * @version 1.133.1
111
+ * @version 1.135.0
109
112
  *
110
113
  * @constructor
111
114
  * @private
@@ -35,7 +35,7 @@ function(
35
35
  * The RTAElementMover is responsible for the RTA specific adaptation of element movements.
36
36
  *
37
37
  * @author SAP SE
38
- * @version 1.133.1
38
+ * @version 1.135.0
39
39
  *
40
40
  * @constructor
41
41
  * @private
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  * @class The Remove allows trigger remove operations on the overlay
30
30
  * @extends sap.ui.rta.plugin.Plugin
31
31
  * @author SAP SE
32
- * @version 1.133.1
32
+ * @version 1.135.0
33
33
  * @constructor
34
34
  * @private
35
35
  * @since 1.34
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  * @extends sap.ui.rta.plugin.Plugin
29
29
  *
30
30
  * @author SAP SE
31
- * @version 1.133.1
31
+ * @version 1.135.0
32
32
  *
33
33
  * @constructor
34
34
  * @private
@@ -43,7 +43,7 @@ sap.ui.define([
43
43
  * Provides Rename handling functionality
44
44
  *
45
45
  * @author SAP SE
46
- * @version 1.133.1
46
+ * @version 1.135.0
47
47
  *
48
48
  * @constructor
49
49
  * @private
@@ -474,4 +474,4 @@ sap.ui.define([
474
474
  }
475
475
  };
476
476
  return RenameHandler;
477
- }, true);
477
+ });
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @class
28
28
  * @extends sap.ui.rta.plugin.Plugin
29
29
  * @author SAP SE
30
- * @version 1.133.1
30
+ * @version 1.135.0
31
31
  * @constructor
32
32
  * @private
33
33
  * @since 1.101
@@ -31,7 +31,7 @@ sap.ui.define([
31
31
  * @class The Selection plugin allows you to select or focus overlays with mouse or keyboard and navigate to others.
32
32
  * @extends sap.ui.rta.plugin.Plugin
33
33
  * @author SAP SE
34
- * @version 1.133.1
34
+ * @version 1.135.0
35
35
  * @constructor
36
36
  * @private
37
37
  * @since 1.34
@@ -28,13 +28,13 @@ sap.ui.define([
28
28
  * @class The Settings allows trigger change of settings operations on the overlay
29
29
  * @extends sap.ui.rta.plugin.Plugin
30
30
  * @author SAP SE
31
- * @version 1.133.1
31
+ * @version 1.135.0
32
32
  * @constructor
33
33
  * @private
34
34
  * @since 1.44
35
35
  * @alias sap.ui.rta.plugin.Settings
36
36
  */
37
- var Settings = Plugin.extend("sap.ui.rta.plugin.Settings", /** @lends sap.ui.rta.plugin.Settings.prototype */ {
37
+ const Settings = Plugin.extend("sap.ui.rta.plugin.Settings", /** @lends sap.ui.rta.plugin.Settings.prototype */ {
38
38
  metadata: {
39
39
  library: "sap.ui.rta",
40
40
  associations: {},
@@ -42,7 +42,27 @@ sap.ui.define([
42
42
  }
43
43
  });
44
44
 
45
- var sPluginId = "CTX_SETTINGS";
45
+ const sPluginId = "CTX_SETTINGS";
46
+
47
+ function getValidActions(vSettingsAction, oOverlay) {
48
+ if (vSettingsAction.handler) {
49
+ return [vSettingsAction];
50
+ }
51
+ const aSettingsActions = [];
52
+ Object.keys(vSettingsAction).forEach((sSettingsAction) => {
53
+ let oSettingsAction = vSettingsAction[sSettingsAction];
54
+ if (typeof oSettingsAction === "function") {
55
+ oSettingsAction = oSettingsAction(oOverlay.getElement());
56
+ }
57
+ if (oSettingsAction.handler) {
58
+ oSettingsAction.key = sSettingsAction;
59
+ aSettingsActions.push(oSettingsAction);
60
+ } else {
61
+ BaseLog.warning("Handler not found for settings action");
62
+ }
63
+ });
64
+ return aSettingsActions;
65
+ }
46
66
 
47
67
  /**
48
68
  * @param {sap.ui.dt.ElementOverlay} oOverlay overlay to be checked for editable
@@ -50,20 +70,13 @@ sap.ui.define([
50
70
  * @private
51
71
  */
52
72
  Settings.prototype._isEditable = function(oOverlay) {
53
- var vSettingsAction = this.getAction(oOverlay);
73
+ const vSettingsAction = this.getAction(oOverlay);
54
74
  // If no additional actions are defined in settings, a handler must be present to make it available
55
75
  if (vSettingsAction) {
56
- if (vSettingsAction.handler) {
57
- return this.hasStableId(oOverlay);
58
- }
59
-
60
- var bHandlerAndStableIdFound = Object.keys(vSettingsAction).some(function(sSettingsAction) {
61
- var oSettingsAction = vSettingsAction[sSettingsAction];
62
- return oSettingsAction.handler && this._checkRelevantContainerStableID(oSettingsAction, oOverlay);
63
- }.bind(this));
64
- if (bHandlerAndStableIdFound) {
65
- return this.hasStableId(oOverlay);
66
- }
76
+ const aSettingsActions = getValidActions(vSettingsAction, oOverlay);
77
+ return aSettingsActions.some((oSettingsAction) => {
78
+ return this._checkRelevantContainerStableID(oSettingsAction, oOverlay);
79
+ });
67
80
  }
68
81
 
69
82
  return false;
@@ -79,24 +92,27 @@ sap.ui.define([
79
92
  Settings.prototype.isEnabled = function(aElementOverlays) {
80
93
  const oElementOverlay = aElementOverlays[0];
81
94
  const oResponsibleElementOverlay = this.getResponsibleElementOverlay(oElementOverlay);
82
- const oAction = this.getAction(oResponsibleElementOverlay);
83
- if (!oAction) {
84
- return false;
95
+ const vSettingsAction = this.getAction(oResponsibleElementOverlay);
96
+ if (vSettingsAction) {
97
+ const oSettingsActions = getValidActions(vSettingsAction, oResponsibleElementOverlay);
98
+ return oSettingsActions.some((oSettingsAction) => {
99
+ if (typeof oSettingsAction.isEnabled !== "undefined") {
100
+ if (typeof oSettingsAction.isEnabled === "function") {
101
+ return oSettingsAction.isEnabled(oResponsibleElementOverlay.getElement());
102
+ }
103
+ return oSettingsAction.isEnabled;
104
+ }
105
+ return !!oSettingsAction.handler;
106
+ });
85
107
  }
86
108
 
87
- if (typeof oAction.isEnabled !== "undefined") {
88
- if (typeof oAction.isEnabled === "function") {
89
- return oAction.isEnabled(oResponsibleElementOverlay.getElement());
90
- }
91
- return oAction.isEnabled;
92
- }
93
- return true;
109
+ return false;
94
110
  };
95
111
 
96
112
  Settings.prototype._getUnsavedChanges = function(sId, aChangeTypes) {
97
- var sElementId;
113
+ let sElementId;
98
114
 
99
- var aUnsavedChanges = this.getCommandStack().getAllExecutedCommands().filter(function(oCommand) {
115
+ const aUnsavedChanges = this.getCommandStack().getAllExecutedCommands().filter(function(oCommand) {
100
116
  sElementId = oCommand.getElementId && oCommand.getElementId() || oCommand.getElement && oCommand.getElement().getId();
101
117
  return sElementId === sId && aChangeTypes.indexOf(oCommand.getChangeType()) >= 0;
102
118
  }).map(function(oCommand) {
@@ -107,12 +123,12 @@ sap.ui.define([
107
123
  };
108
124
 
109
125
  Settings.prototype._handleFlexChangeCommand = function(mChange, aSelectedOverlays, oCompositeCommand, oSettingsAction) {
110
- var mChangeSpecificData = mChange.changeSpecificData;
111
- var sVariantManagementReference;
126
+ const mChangeSpecificData = mChange.changeSpecificData;
127
+ let sVariantManagementReference;
112
128
  // temporarily support both
113
- var vSelector = mChange.selectorElement || mChange.selectorControl;
114
- var sControlType;
115
- var oControl;
129
+ const vSelector = mChange.selectorElement || mChange.selectorControl;
130
+ let sControlType;
131
+ let oControl;
116
132
 
117
133
  if (vSelector.controlType) {
118
134
  sControlType = vSelector.controlType;
@@ -134,7 +150,7 @@ sap.ui.define([
134
150
  );
135
151
  }.bind(this))
136
152
  .then(function(oSettingsCommand) {
137
- var bRuntimeOnly = oSettingsAction.runtimeOnly;
153
+ const bRuntimeOnly = oSettingsAction.runtimeOnly;
138
154
  if (oSettingsCommand && bRuntimeOnly) {
139
155
  oSettingsCommand.setRuntimeOnly(bRuntimeOnly);
140
156
  }
@@ -142,15 +158,15 @@ sap.ui.define([
142
158
  });
143
159
  };
144
160
 
145
- Settings.prototype._handleAppDescriptorChangeCommand = function(mChange, oElement, oCompositeCommand) {
146
- var mChangeSpecificData = mChange.changeSpecificData;
147
- var oComponent = mChange.appComponent;
148
- var mManifest = oComponent.getManifest();
149
- var sReference = mManifest["sap.app"].id;
161
+ Settings.prototype._handleManifestChangeCommand = function(mChange, oElement, oCompositeCommand) {
162
+ const mChangeSpecificData = mChange.changeSpecificData;
163
+ const oComponent = mChange.appComponent;
164
+ const mManifest = oComponent.getManifest();
165
+ const sReference = mManifest["sap.app"].id;
150
166
 
151
167
  return this.getCommandFactory().getCommandFor(
152
168
  oElement,
153
- "appDescriptor",
169
+ "manifest",
154
170
  {
155
171
  reference: sReference,
156
172
  appComponent: oComponent,
@@ -159,13 +175,13 @@ sap.ui.define([
159
175
  texts: mChangeSpecificData.content.texts
160
176
  }
161
177
  )
162
- .then(function(oAppDescriptorCommand) {
163
- return oCompositeCommand.addCommand(oAppDescriptorCommand);
178
+ .then(function(oManifestCommand) {
179
+ return oCompositeCommand.addCommand(oManifestCommand);
164
180
  });
165
181
  };
166
182
 
167
183
  Settings.prototype._handleCompositeCommand = function(aElementOverlays, oElement, aChanges, oSettingsAction) {
168
- var oCompositeCommand;
184
+ let oCompositeCommand;
169
185
 
170
186
  return this.getCommandFactory().getCommandFor(oElement, "composite")
171
187
 
@@ -175,13 +191,13 @@ sap.ui.define([
175
191
 
176
192
  .then(function() {
177
193
  return aChanges.map(function(mChange) {
178
- var mChangeSpecificData = mChange.changeSpecificData;
194
+ const mChangeSpecificData = mChange.changeSpecificData;
179
195
  // Flex Change
180
196
  if (mChangeSpecificData.changeType) {
181
197
  return () => this._handleFlexChangeCommand(mChange, aElementOverlays, oCompositeCommand, oSettingsAction);
182
- // App Descriptor Change
198
+ // Manifest Change
183
199
  } else if (mChangeSpecificData.appDescriptorChangeType) {
184
- return () => this._handleAppDescriptorChangeCommand(mChange, oElement, oCompositeCommand);
200
+ return () => this._handleManifestChangeCommand(mChange, oElement, oCompositeCommand);
185
201
  }
186
202
  return undefined;
187
203
  }, this);
@@ -213,8 +229,8 @@ sap.ui.define([
213
229
  */
214
230
  Settings.prototype.handler = function(aElementOverlays, mPropertyBag, oSettingsAction) {
215
231
  mPropertyBag ||= {};
216
- var oElement = aElementOverlays[0].getElement();
217
- var {fnHandler} = mPropertyBag;
232
+ const oElement = aElementOverlays[0].getElement();
233
+ let {fnHandler} = mPropertyBag;
218
234
 
219
235
  fnHandler ||= aElementOverlays[0].getDesignTimeMetadata().getAction("settings").handler;
220
236
  if (!fnHandler) {
@@ -251,28 +267,22 @@ sap.ui.define([
251
267
  Settings.prototype.getMenuItems = async function(aElementOverlays) {
252
268
  const oElementOverlay = aElementOverlays[0];
253
269
  const oResponsibleElementOverlay = this.getResponsibleElementOverlay(oElementOverlay);
254
- let vSettingsActions = this.getAction(oResponsibleElementOverlay);
270
+ const vSettingsActions = this.getAction(oResponsibleElementOverlay);
255
271
 
256
272
  const aMenuItems = [];
257
273
  if (vSettingsActions) {
258
274
  const iRank = this.getRank("CTX_SETTINGS");
259
275
 
260
- if (vSettingsActions.handler) {
261
- vSettingsActions = {
262
- settings: vSettingsActions
263
- };
264
- }
276
+ const aSettingsActions = getValidActions(vSettingsActions, oResponsibleElementOverlay);
277
+
265
278
  if (this._isEditableByPlugin(oResponsibleElementOverlay) === undefined) {
266
279
  // The responsibleElement editableByPlugin state was not evaluated yet e.g. because it
267
280
  // has no visible geometry, thus evaluateEditable now
268
281
  await this.evaluateEditable([oResponsibleElementOverlay], { onRegistration: false });
269
282
  }
270
- const aSettingsActions = Object.keys(vSettingsActions);
271
- aSettingsActions.forEach(function(sSettingsAction, iIndex, aActions) {
272
- const oSettingsAction = vSettingsActions[sSettingsAction];
283
+ aSettingsActions.forEach(function(oSettingsAction, iIndex, aActions) {
273
284
  if (
274
- oSettingsAction.handler
275
- && this._checkRelevantContainerStableID(oSettingsAction, oResponsibleElementOverlay)
285
+ this._checkRelevantContainerStableID(oSettingsAction, oResponsibleElementOverlay)
276
286
  && this.isAvailable([oResponsibleElementOverlay])
277
287
  ) {
278
288
  const bSingleAction = aActions.length === 1;
@@ -298,7 +308,7 @@ sap.ui.define([
298
308
  submenu: formatSubMenuItems(oSettingsAction.submenu)
299
309
  });
300
310
  } else {
301
- BaseLog.warning(`Handler not found for settings action '${sSettingsAction}' or relevant container has no stable id`);
311
+ BaseLog.warning("Action is not available or relevant container has no stable id");
302
312
  }
303
313
  }, this);
304
314
  }
@@ -321,8 +331,8 @@ sap.ui.define([
321
331
  }
322
332
 
323
333
  function getActionIcon(oSettingsAction) {
324
- var sDefaultSettingIcon = "sap-icon://key-user-settings";
325
- var sActionIcon = oSettingsAction.icon;
334
+ const sDefaultSettingIcon = "sap-icon://key-user-settings";
335
+ const sActionIcon = oSettingsAction.icon;
326
336
  if (!sActionIcon) {
327
337
  return sDefaultSettingIcon;
328
338
  }
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @class
24
24
  * @extends sap.ui.rta.plugin.Plugin
25
25
  * @author SAP SE
26
- * @version 1.133.1
26
+ * @version 1.135.0
27
27
  * @constructor
28
28
  * @private
29
29
  * @since 1.46
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  * @extends sap.ui.rta.plugin.Plugin
30
30
  *
31
31
  * @author SAP SE
32
- * @version 1.133.1
32
+ * @version 1.135.0
33
33
  *
34
34
  * @constructor
35
35
  * @private
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * handled by the AdditionalElements Plugin (Reveal, Add Via Delegate, Add Custom)
33
33
  *
34
34
  * @author SAP SE
35
- * @version 1.133.1
35
+ * @version 1.135.0
36
36
  * @private
37
37
  * @since 1.94
38
38
  */
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * @class Context - Dialog for available Fields in Runtime Authoring
33
33
  * @extends sap.ui.base.ManagedObject
34
34
  * @author SAP SE
35
- * @version 1.133.1
35
+ * @version 1.135.0
36
36
  * @constructor
37
37
  * @private
38
38
  * @since 1.44
@@ -119,7 +119,7 @@ sap.ui.define([
119
119
  * @class The plugin allows to add additional elements that exist either hidden in the UI or in the OData service
120
120
  * @extends sap.ui.rta.plugin.Plugin
121
121
  * @author SAP SE
122
- * @version 1.133.1
122
+ * @version 1.135.0
123
123
  * @constructor
124
124
  * @private
125
125
  * @since 1.44
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  * Helper object containing methods for the AdditionalElements plugin
18
18
  *
19
19
  * @author SAP SE
20
- * @version 1.133.1
20
+ * @version 1.135.0
21
21
  * @private
22
22
  * @since 1.94
23
23
  */
@@ -25,7 +25,7 @@ sap.ui.define([
25
25
  * Helper object to build the RTA commands resulting from the AdditionalElements Plugin
26
26
  *
27
27
  * @author SAP SE
28
- * @version 1.133.1
28
+ * @version 1.135.0
29
29
  * @private
30
30
  * @since 1.94
31
31
  */