@openui5/sap.ui.rta 1.134.0 → 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 (157) hide show
  1. package/THIRDPARTY.txt +2 -2
  2. package/package.json +6 -6
  3. package/src/sap/ui/rta/.library +1 -1
  4. package/src/sap/ui/rta/Client.js +1 -1
  5. package/src/sap/ui/rta/RuntimeAuthoring.js +34 -11
  6. package/src/sap/ui/rta/Utils.js +1 -1
  7. package/src/sap/ui/rta/appVariant/AppVariantManager.js +25 -25
  8. package/src/sap/ui/rta/appVariant/Feature.js +71 -71
  9. package/src/sap/ui/rta/appVariant/Utils.js +21 -23
  10. package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +30 -30
  11. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr_CA.properties +2 -2
  12. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  13. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  14. package/src/sap/ui/rta/command/AddXML.js +1 -1
  15. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  16. package/src/sap/ui/rta/command/AnnotationCommand.js +65 -5
  17. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  18. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  19. package/src/sap/ui/rta/command/Combine.js +1 -1
  20. package/src/sap/ui/rta/command/CommandFactory.js +71 -47
  21. package/src/sap/ui/rta/command/CompositeCommand.js +12 -12
  22. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  23. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  24. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  25. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  26. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  27. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  28. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  29. package/src/sap/ui/rta/command/ExtendControllerCommand.js +92 -0
  30. package/src/sap/ui/rta/command/FlexCommand.js +54 -43
  31. package/src/sap/ui/rta/command/LREPSerializer.js +23 -23
  32. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  33. package/src/sap/ui/rta/command/ManifestCommand.js +112 -0
  34. package/src/sap/ui/rta/command/Move.js +1 -1
  35. package/src/sap/ui/rta/command/Property.js +1 -1
  36. package/src/sap/ui/rta/command/Remove.js +1 -1
  37. package/src/sap/ui/rta/command/Rename.js +1 -1
  38. package/src/sap/ui/rta/command/Resize.js +1 -1
  39. package/src/sap/ui/rta/command/Reveal.js +1 -1
  40. package/src/sap/ui/rta/command/Settings.js +1 -1
  41. package/src/sap/ui/rta/command/Split.js +1 -1
  42. package/src/sap/ui/rta/command/Stack.js +1 -1
  43. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  44. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  45. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  46. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  47. package/src/sap/ui/rta/command/{appDescriptor → manifest}/AddLibrary.js +10 -10
  48. package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
  49. package/src/sap/ui/rta/library.js +2 -2
  50. package/src/sap/ui/rta/messagebundle.properties +16 -3
  51. package/src/sap/ui/rta/messagebundle_ar.properties +1 -0
  52. package/src/sap/ui/rta/messagebundle_bg.properties +1 -0
  53. package/src/sap/ui/rta/messagebundle_ca.properties +1 -0
  54. package/src/sap/ui/rta/messagebundle_cnr.properties +1 -0
  55. package/src/sap/ui/rta/messagebundle_cs.properties +1 -0
  56. package/src/sap/ui/rta/messagebundle_cy.properties +1 -0
  57. package/src/sap/ui/rta/messagebundle_da.properties +1 -0
  58. package/src/sap/ui/rta/messagebundle_de.properties +1 -0
  59. package/src/sap/ui/rta/messagebundle_el.properties +1 -0
  60. package/src/sap/ui/rta/messagebundle_en.properties +1 -0
  61. package/src/sap/ui/rta/messagebundle_en_GB.properties +1 -0
  62. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +7 -1
  63. package/src/sap/ui/rta/messagebundle_es.properties +1 -0
  64. package/src/sap/ui/rta/messagebundle_es_MX.properties +1 -0
  65. package/src/sap/ui/rta/messagebundle_et.properties +1 -0
  66. package/src/sap/ui/rta/messagebundle_fi.properties +2 -1
  67. package/src/sap/ui/rta/messagebundle_fr.properties +10 -9
  68. package/src/sap/ui/rta/messagebundle_fr_CA.properties +5 -4
  69. package/src/sap/ui/rta/messagebundle_hi.properties +1 -0
  70. package/src/sap/ui/rta/messagebundle_hr.properties +32 -31
  71. package/src/sap/ui/rta/messagebundle_hu.properties +1 -0
  72. package/src/sap/ui/rta/messagebundle_id.properties +1 -0
  73. package/src/sap/ui/rta/messagebundle_it.properties +46 -45
  74. package/src/sap/ui/rta/messagebundle_iw.properties +1 -0
  75. package/src/sap/ui/rta/messagebundle_ja.properties +1 -0
  76. package/src/sap/ui/rta/messagebundle_kk.properties +1 -0
  77. package/src/sap/ui/rta/messagebundle_ko.properties +1 -0
  78. package/src/sap/ui/rta/messagebundle_lt.properties +1 -0
  79. package/src/sap/ui/rta/messagebundle_lv.properties +1 -0
  80. package/src/sap/ui/rta/messagebundle_mk.properties +1 -0
  81. package/src/sap/ui/rta/messagebundle_ms.properties +1 -0
  82. package/src/sap/ui/rta/messagebundle_nl.properties +1 -0
  83. package/src/sap/ui/rta/messagebundle_no.properties +1 -0
  84. package/src/sap/ui/rta/messagebundle_pl.properties +1 -0
  85. package/src/sap/ui/rta/messagebundle_pt.properties +1 -0
  86. package/src/sap/ui/rta/messagebundle_pt_PT.properties +1 -0
  87. package/src/sap/ui/rta/messagebundle_ro.properties +1 -0
  88. package/src/sap/ui/rta/messagebundle_ru.properties +1 -0
  89. package/src/sap/ui/rta/messagebundle_sh.properties +1 -0
  90. package/src/sap/ui/rta/messagebundle_sk.properties +1 -0
  91. package/src/sap/ui/rta/messagebundle_sl.properties +1 -0
  92. package/src/sap/ui/rta/messagebundle_sr.properties +1 -0
  93. package/src/sap/ui/rta/messagebundle_sv.properties +1 -0
  94. package/src/sap/ui/rta/messagebundle_th.properties +1 -0
  95. package/src/sap/ui/rta/messagebundle_tr.properties +1 -0
  96. package/src/sap/ui/rta/messagebundle_uk.properties +1 -0
  97. package/src/sap/ui/rta/messagebundle_vi.properties +1 -0
  98. package/src/sap/ui/rta/messagebundle_zh_CN.properties +1 -0
  99. package/src/sap/ui/rta/messagebundle_zh_TW.properties +1 -0
  100. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +33 -33
  101. package/src/sap/ui/rta/plugin/AddXMLPlugin.js +1 -1
  102. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  103. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  104. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  105. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  106. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  107. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  108. package/src/sap/ui/rta/plugin/ExtendControllerPlugin.js +161 -0
  109. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  110. package/src/sap/ui/rta/plugin/Plugin.js +3 -1
  111. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  112. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  113. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  114. package/src/sap/ui/rta/plugin/RenameHandler.js +1 -1
  115. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  116. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  117. package/src/sap/ui/rta/plugin/Settings.js +71 -61
  118. package/src/sap/ui/rta/plugin/Split.js +1 -1
  119. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  120. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  121. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  122. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  123. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  124. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
  125. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.fragment.xml +9 -5
  126. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.js +58 -9
  127. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +11 -4
  128. package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +54 -17
  129. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  130. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  131. package/src/sap/ui/rta/service/Action.js +1 -1
  132. package/src/sap/ui/rta/service/ControllerExtension.js +10 -4
  133. package/src/sap/ui/rta/service/Outline.js +1 -1
  134. package/src/sap/ui/rta/service/Property.js +1 -1
  135. package/src/sap/ui/rta/service/Selection.js +1 -1
  136. package/src/sap/ui/rta/service/SupportTools.js +1 -1
  137. package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +5 -0
  138. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +21 -3
  139. package/src/sap/ui/rta/toolbar/Adaptation.js +33 -7
  140. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  141. package/src/sap/ui/rta/toolbar/Fiori.js +4 -3
  142. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  143. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  144. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  145. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
  146. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  147. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  148. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  149. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  150. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  151. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  152. package/src/sap/ui/rta/util/ServiceManager.js +1 -1
  153. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
  154. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
  155. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +2 -2
  156. package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +1 -1
  157. package/src/sap/ui/rta/command/AppDescriptorCommand.js +0 -114
@@ -7,18 +7,22 @@
7
7
  sap.ui.define([
8
8
  "sap/ui/base/ManagedObject",
9
9
  "sap/ui/core/Fragment",
10
+ "sap/ui/dt/ElementUtil",
10
11
  "sap/ui/fl/write/api/PersistenceWriteAPI",
11
12
  "sap/ui/model/json/JSONModel",
12
13
  "sap/ui/model/resource/ResourceModel",
13
14
  "sap/ui/rta/plugin/annotations/AnnotationChangeDialogController",
15
+ "sap/ui/rta/plugin/annotations/AnnotationTypes",
14
16
  "sap/ui/rta/Utils"
15
17
  ], function(
16
18
  ManagedObject,
17
19
  Fragment,
20
+ ElementUtil,
18
21
  PersistenceWriteAPI,
19
22
  JSONModel,
20
23
  ResourceModel,
21
24
  AnnotationChangeDialogController,
25
+ AnnotationTypes,
22
26
  RtaUtils
23
27
  ) {
24
28
  "use strict";
@@ -27,7 +31,7 @@ sap.ui.define([
27
31
  * @class Constructor for a new sap.ui.rta.plugin.annotations.AnnotationChangeDialog.
28
32
  * @extends sap.ui.base.ManagedObject
29
33
  * @author SAP SE
30
- * @version 1.134.0
34
+ * @version 1.135.0
31
35
  * @constructor
32
36
  * @since 1.132
33
37
  * @private
@@ -35,6 +39,15 @@ sap.ui.define([
35
39
  */
36
40
  const AnnotationChangeDialog = ManagedObject.extend("sap.ui.rta.plugin.annotations.AnnotationChangeDialog");
37
41
 
42
+ function replaceCurrentValueWithTextFromControl(aProperties, sPreSelectedProperty, oControl) {
43
+ const oProperty = aProperties.find((oProperty) => oProperty.annotationPath === sPreSelectedProperty);
44
+ const aNewLabel = ElementUtil.getLabelForElement(oControl);
45
+ if (oProperty && aNewLabel) {
46
+ oProperty.currentValue = aNewLabel;
47
+ oProperty.originalValue = aNewLabel;
48
+ }
49
+ }
50
+
38
51
  AnnotationChangeDialog.prototype._createDialog = async function() {
39
52
  this._oController = new AnnotationChangeDialogController();
40
53
  const oDialog = await Fragment.load({
@@ -63,6 +76,8 @@ sap.ui.define([
63
76
  * @property {string} properties.annotationPath - Path of the property
64
77
  * @property {string} properties.propertyName - Name of the property
65
78
  * @property {string} properties.currentValue - Current value of the property
79
+ * @property {string} [properties.label] - Label of the property. If not given, the property name is used
80
+ * @property {string} [properties.tooltip] - Tooltip of the property
66
81
  * @property {object[]} possibleValues - Array of possible values for value list type properties
67
82
  * @property {string} possibleValues.key - Key of the option
68
83
  * @property {string} possibleValues.text - Text of the option
@@ -83,10 +98,15 @@ sap.ui.define([
83
98
  *
84
99
  * @typedef {object} sap.ui.rta.plugin.annotations.AnnotationChangeDefinition
85
100
  * @property {string} annotationChangeType - Change type
101
+ * @property {string} serviceUrl - Url of the OData service
86
102
  * @property {object} content - Change content
87
103
  * @property {string} content.annotationPath - Path of the property
88
104
  * @property {string} content.value - New value
89
- * @property {string} serviceUrl - Url of the OData service
105
+ * @property {string} content.text - New value as translatable text. If given, the value is ignored
106
+ * @property {object} [content.objectTemplateInfo] - Object template to construct a return object.
107
+ * If given the applyChange function will return an object as value, which is parsed from the template string.
108
+ * @property {string} [content.objectTemplateInfo.templateAsString] - Stringified template to be used for constructing the return object
109
+ * @property {string} [content.objectTemplateInfo.placeholder] - Placeholder in the template string. Will be replaced by the new value
90
110
  * @public
91
111
  */
92
112
 
@@ -110,20 +130,31 @@ sap.ui.define([
110
130
  delegate: oDelegate,
111
131
  control: oControl,
112
132
  annotation: sAnnotation,
113
- description: sAnnotationDescription = ""
133
+ description: sAnnotationDescription,
134
+ singleRename: bSingleRename
114
135
  } = mPropertyBag;
115
136
  const {
116
137
  serviceUrl: sServiceUrl,
117
138
  properties: aDelegateProperties,
118
- possibleValues: aPossibleValues,
139
+ possibleValues: aDelegatePossibleValues,
119
140
  preSelectedProperty: sPreSelectedPropertyKey
120
- } = oDelegate.getAnnotationsChangeInfo(oControl, sAnnotation);
141
+ } = await oDelegate.getAnnotationsChangeInfo(oControl, sAnnotation);
142
+
143
+ const bObjectAsKey = !!aDelegatePossibleValues?.some((oPossibleValue) => typeof oPossibleValue.key === "object");
144
+ // the key could be an object which does not work as property for the Select control
145
+ // therefore the key must be stringified and later parsed
121
146
  const aProperties = aDelegateProperties.map((oProperty) => ({
122
147
  ...oProperty,
123
- originalValue: oProperty.currentValue
148
+ currentValue: bObjectAsKey ? JSON.stringify(oProperty.currentValue) : oProperty.currentValue,
149
+ originalValue: bObjectAsKey ? JSON.stringify(oProperty.currentValue) : oProperty.currentValue,
150
+ label: oProperty.label || oProperty.propertyName
151
+ }));
152
+ const aPossibleValues = (aDelegatePossibleValues || []).map((oPossibleValue) => ({
153
+ ...oPossibleValue,
154
+ key: bObjectAsKey ? JSON.stringify(oPossibleValue.key) : oPossibleValue.key
124
155
  }));
125
156
 
126
- aProperties.sort((oProperty1, oProperty2) => oProperty1.propertyName.localeCompare(oProperty2.propertyName));
157
+ aProperties.sort((oProperty1, oProperty2) => oProperty1.label.localeCompare(oProperty2.label));
127
158
 
128
159
  const aExistingChanges = PersistenceWriteAPI._getAnnotationChanges({
129
160
  control: oControl
@@ -136,16 +167,30 @@ sap.ui.define([
136
167
  this._oDialog ||= await this._createDialog();
137
168
 
138
169
  const sFilterText = sPreSelectedPropertyKey
139
- ? aProperties.find((oProperty) => oProperty.annotationPath === sPreSelectedPropertyKey).propertyName
170
+ ? aProperties.find((oProperty) => oProperty.annotationPath === sPreSelectedPropertyKey).label
140
171
  : "";
172
+ // default size limit is 100, but we need to display all properties.
173
+ // As the list size is not dynamic, we can set the size limit to the number of properties
174
+ // the size influences all binding sizes, so we only set it if the number of properties is greater than 100
175
+ if (aProperties.length > 100) {
176
+ this.oChangeAnnotationModel.setSizeLimit(aProperties.length);
177
+ }
178
+
179
+ if (bSingleRename) {
180
+ replaceCurrentValueWithTextFromControl(aProperties, sPreSelectedPropertyKey, oControl);
181
+ }
182
+
141
183
  this.oChangeAnnotationModel.setData({
184
+ objectAsKey: bObjectAsKey,
185
+ control: oControl,
142
186
  title: sAnnotationTitle,
143
- description: sAnnotationDescription,
187
+ description: sAnnotationDescription || "",
144
188
  properties: aProperties, // all properties
145
189
  changedProperties: aProperties.filter(({ annotationPath }) => aChangedAnnotations.includes(annotationPath)),
146
190
  propertiesToDisplay: aProperties, // switches dynamically between all properties and changed properties
147
191
  showChangedPropertiesOnly: false,
148
192
  filterText: sFilterText,
193
+ singleRename: bSingleRename || false,
149
194
  possibleValues: aPossibleValues,
150
195
  valueType: sAnnotationValueType,
151
196
  serviceUrl: sServiceUrl
@@ -153,7 +198,11 @@ sap.ui.define([
153
198
  if (sFilterText) {
154
199
  this._oController.filterProperties(sFilterText);
155
200
  }
201
+ // Ensure that the model is fully refreshed before opening the dialog
202
+ this.oChangeAnnotationModel.refresh(true);
156
203
  const aChangedProperties = await this._openDialog();
204
+ // reset filter to not have a filtered list when opening the dialog again
205
+ this._oController.filterProperties("");
157
206
  this._oDialog.close();
158
207
  return aChangedProperties;
159
208
  };
@@ -6,6 +6,7 @@
6
6
  */
7
7
  sap.ui.define([
8
8
  "sap/m/Input",
9
+ "sap/m/Label",
9
10
  "sap/m/Select",
10
11
  "sap/m/Switch",
11
12
  "sap/ui/core/mvc/Controller",
@@ -17,6 +18,7 @@ sap.ui.define([
17
18
  "sap/ui/rta/plugin/annotations/AnnotationTypes"
18
19
  ], function(
19
20
  Input,
21
+ Label,
20
22
  Select,
21
23
  Switch,
22
24
  Controller,
@@ -33,7 +35,7 @@ sap.ui.define([
33
35
  * @class Controller for the AnnotationChangeDialog.
34
36
  * @extends sap.ui.core.mvc.Controller
35
37
  * @author SAP SE
36
- * @version 1.134.0
38
+ * @version 1.135.0
37
39
  * @constructor
38
40
  * @since 1.132
39
41
  * @private
@@ -50,7 +52,7 @@ sap.ui.define([
50
52
  AnnotationChangeDialogController.prototype.filterProperties = function(sQuery) {
51
53
  const aFilters = [];
52
54
  if (sQuery && sQuery.length > 0) {
53
- const filter = new Filter("propertyName", FilterOperator.Contains, sQuery);
55
+ const filter = new Filter("label", FilterOperator.Contains, sQuery);
54
56
  aFilters.push(filter);
55
57
  }
56
58
 
@@ -89,10 +91,12 @@ sap.ui.define([
89
91
  annotationPath: oProperty.annotationPath
90
92
  }
91
93
  };
92
- oChangeSpecificData.content[oModelData.valueType === AnnotationTypes.StringType ? "text" : "value"] = oProperty.currentValue;
94
+ oChangeSpecificData.content[oModelData.valueType === AnnotationTypes.StringType ? "text" : "value"] =
95
+ oModelData.objectAsKey ? JSON.parse(oProperty.currentValue) : oProperty.currentValue;
93
96
  return oChangeSpecificData;
94
97
  })
95
98
  .filter(Boolean);
99
+
96
100
  this._fnResolveAfterClose(aChanges);
97
101
  };
98
102
 
@@ -151,7 +155,10 @@ sap.ui.define([
151
155
 
152
156
  return new FormElement({
153
157
  id: sId,
154
- label: "{propertyName}",
158
+ label: new Label({
159
+ text: "{= ${label} || ${propertyName}}",
160
+ tooltip: "{tooltip}"
161
+ }),
155
162
  fields: [
156
163
  createEditorField.call(this, sValueType)
157
164
  ]
@@ -7,28 +7,39 @@
7
7
  sap.ui.define([
8
8
  "sap/base/Log",
9
9
  "sap/ui/base/DesignTime",
10
+ "sap/ui/core/util/reflection/JsControlTreeModifier",
10
11
  "sap/ui/dt/Util",
12
+ "sap/ui/fl/write/api/PersistenceWriteAPI",
13
+ "sap/ui/fl/Utils",
11
14
  "sap/ui/rta/plugin/annotations/AnnotationChangeDialog",
15
+ "sap/ui/rta/plugin/annotations/AnnotationTypes",
12
16
  "sap/ui/rta/plugin/Plugin"
13
17
  ], function(
14
18
  BaseLog,
15
19
  DesignTime,
20
+ JsControlTreeModifier,
16
21
  DtUtil,
22
+ PersistenceWriteAPI,
23
+ Utils,
17
24
  AnnotationChangeDialog,
25
+ AnnotationTypes,
18
26
  Plugin
19
27
  ) {
20
28
  "use strict";
21
29
 
22
- async function handleCompositeCommand(oElement, oAction, aChanges) {
30
+ async function handleCompositeCommand(oElement, oAction, aAnnotationChanges, aLegacyRenameChanges) {
23
31
  const oCompositeCommand = await this.getCommandFactory().getCommandFor(oElement, "composite");
24
- for (const oChange of aChanges) {
32
+ for (const oChange of aAnnotationChanges) {
33
+ // aLegacyRenameChanges is only passed for singleRename scenarios, where there is only one annotation change to be saved
34
+ // so we can simply add it in the loop
25
35
  const oAnnotationCommand = await this.getCommandFactory().getCommandFor(
26
36
  oElement,
27
37
  "annotation",
28
38
  {
29
39
  changeType: oAction.changeType,
30
40
  serviceUrl: oChange.serviceUrl,
31
- content: oChange.content
41
+ content: {...oChange.content, objectTemplateInfo: oAction.objectTemplateInfo},
42
+ changesToDelete: aLegacyRenameChanges
32
43
  }
33
44
  );
34
45
  oCompositeCommand.addCommand(oAnnotationCommand);
@@ -36,8 +47,7 @@ sap.ui.define([
36
47
 
37
48
  if (oCompositeCommand.getCommands().length > 0) {
38
49
  this.fireElementModified({
39
- command: oCompositeCommand,
40
- hasAnnotationCommand: true
50
+ command: oCompositeCommand
41
51
  });
42
52
  }
43
53
  }
@@ -59,7 +69,7 @@ sap.ui.define([
59
69
  }
60
70
 
61
71
  function getActionIcon(oAnnotationAction) {
62
- const sDefaultIcon = "sap-icon://request";
72
+ const sDefaultIcon = oAnnotationAction.type === AnnotationTypes.StringType ? "sap-icon://edit" : "sap-icon://request";
63
73
  const sActionIcon = oAnnotationAction.icon;
64
74
  if (!sActionIcon) {
65
75
  return sDefaultIcon;
@@ -71,6 +81,14 @@ sap.ui.define([
71
81
  return sActionIcon;
72
82
  }
73
83
 
84
+ function checkDesigntimeActionProperties(oAction) {
85
+ if (oAction.singleRename && !oAction.controlBasedRenameChangeType) {
86
+ BaseLog.error("When using singleRename, controlBasedRenameChangeType must also be defined");
87
+ return false;
88
+ }
89
+ return true;
90
+ }
91
+
74
92
  /**
75
93
  * Constructor for a new Annotation Plugin.
76
94
  * Multiple annotation actions can be defined for the same overlay. Each action is represented by a menu item.
@@ -82,7 +100,7 @@ sap.ui.define([
82
100
  * @class
83
101
  * @extends sap.ui.rta.plugin.Plugin
84
102
  * @author SAP SE
85
- * @version 1.134.0
103
+ * @version 1.135.0
86
104
  * @constructor
87
105
  * @private
88
106
  * @since 1.132
@@ -97,7 +115,8 @@ sap.ui.define([
97
115
  }
98
116
  });
99
117
 
100
- const sPluginId = "CTX_ANNOTATION";
118
+ const sPluginIdDefault = "CTX_ANNOTATION";
119
+ const sPluginIdSingleLabelChange = "CTX_ANNOTATION_CHANGE_SINGLE_LABEL";
101
120
 
102
121
  AnnotationPlugin.prototype.init = function(...aArgs) {
103
122
  Plugin.prototype.init.apply(this, aArgs);
@@ -169,17 +188,32 @@ sap.ui.define([
169
188
  const oElement = oElementOverlay.getElement();
170
189
 
171
190
  try {
172
- const aChanges = await this._oDialog.openDialogAndHandleChanges({
191
+ const aAnnotationChanges = await this._oDialog.openDialogAndHandleChanges({
173
192
  title: getActionText(oElementOverlay, oAction),
174
193
  type: oAction.type,
175
194
  control: oElement,
176
195
  delegate: oAction.delegate,
177
196
  annotation: oAction.annotation,
178
- description: oAction.description
197
+ description: oAction.description,
198
+ singleRename: oAction.singleRename,
199
+ controlBasedRenameChangeType: oAction.controlBasedRenameChangeType
179
200
  });
180
201
 
181
- if (aChanges.length > 0) {
182
- return handleCompositeCommand.call(this, oElement, oAction, aChanges);
202
+ if (aAnnotationChanges.length) {
203
+ const aLegacyRenameChanges = [];
204
+ // for single rename scenarios we are able to remove any existing control based rename change in the context of
205
+ // the given control and change type
206
+ if (oAction.singleRename) {
207
+ const aUIChanges = await PersistenceWriteAPI._getUIChanges({
208
+ selector: oElement
209
+ });
210
+ const oAppComponent = Utils.getAppComponentForControl(oElement);
211
+ aLegacyRenameChanges.push(...aUIChanges.filter((oChange) =>
212
+ oChange.getChangeType() === oAction.controlBasedRenameChangeType
213
+ && JsControlTreeModifier.getControlIdBySelector(oChange.getSelector(), oAppComponent) === oElement.getId()
214
+ ));
215
+ }
216
+ return handleCompositeCommand.call(this, oElement, oAction, aAnnotationChanges, aLegacyRenameChanges);
183
217
  }
184
218
  return undefined;
185
219
  } catch (vError) {
@@ -187,7 +221,7 @@ sap.ui.define([
187
221
  vError,
188
222
  "AnnotationPlugin#handler",
189
223
  "Error occurred during handler execution",
190
- "sap.ui.rta.plugin.annotations.annotationplugin"
224
+ "sap.ui.rta.plugin.annotations.AnnotationPlugin"
191
225
  );
192
226
  }
193
227
  };
@@ -205,16 +239,19 @@ sap.ui.define([
205
239
 
206
240
  const aMenuItems = [];
207
241
  if (oAnnotationActionMap) {
208
- const iRank = this.getRank(sPluginId);
209
-
210
242
  if (this._isEditableByPlugin(oResponsibleElementOverlay) === undefined) {
211
243
  // The responsibleElement editableByPlugin state was not evaluated yet e.g. because it
212
244
  // has no visible geometry, thus evaluateEditable now
213
245
  await this.evaluateEditable([oResponsibleElementOverlay], { onRegistration: false });
214
246
  }
215
- Object.values(oAnnotationActionMap).forEach(function(oAction, iIndex) {
247
+ Object.entries(oAnnotationActionMap).forEach(function([sKey, oAction], iIndex) {
248
+ const sPluginId = oAction.type === AnnotationTypes.StringType && oAction.singleRename
249
+ ? sPluginIdSingleLabelChange
250
+ : sPluginIdDefault;
251
+ const iRank = this.getRank(sPluginId);
216
252
  if (
217
253
  this.isAvailable([oResponsibleElementOverlay])
254
+ && checkDesigntimeActionProperties(oAction)
218
255
  ) {
219
256
  const sActionText = getActionText(oResponsibleElementOverlay, oAction);
220
257
  if (!sActionText) {
@@ -222,7 +259,7 @@ sap.ui.define([
222
259
  }
223
260
 
224
261
  aMenuItems.push({
225
- id: sPluginId + iIndex,
262
+ id: `${sPluginId}_${sKey}`,
226
263
  rank: iRank + iIndex,
227
264
  text: sActionText,
228
265
  icon: getActionIcon(oAction),
@@ -119,7 +119,7 @@ sap.ui.define([
119
119
  * @class The AddIFrame allows trigger AddIFrame operations on the overlay.
120
120
  * @extends sap.ui.rta.plugin.BaseCreate
121
121
  * @author SAP SE
122
- * @version 1.134.0
122
+ * @version 1.135.0
123
123
  * @constructor
124
124
  * @private
125
125
  * @since 1.75
@@ -159,7 +159,7 @@ sap.ui.define([
159
159
  * @class Context - Dialog for IFrame settings in Runtime Authoring
160
160
  * @extends sap.ui.base.ManagedObject
161
161
  * @author SAP SE
162
- * @version 1.134.0
162
+ * @version 1.135.0
163
163
  * @constructor
164
164
  * @private
165
165
  * @since 1.78
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @name sap.ui.rta.service.Action
25
25
  * @author SAP SE
26
26
  * @since 1.58
27
- * @version 1.134.0
27
+ * @version 1.135.0
28
28
  * @private
29
29
  * @ui5-restricted
30
30
  *
@@ -30,7 +30,7 @@ sap.ui.define([
30
30
  * @name sap.ui.rta.service.ControllerExtension
31
31
  * @author SAP SE
32
32
  * @since 1.58
33
- * @version 1.134.0
33
+ * @version 1.135.0
34
34
  * @private
35
35
  * @ui5-restricted
36
36
  */
@@ -62,11 +62,17 @@ sap.ui.define([
62
62
  add(sCodeRef, sViewId) {
63
63
  var oFlexSettings = oRta.getFlexSettings();
64
64
  if (!oFlexSettings.developerMode) {
65
- throw DtUtil.createError("service.ControllerExtension#add", "code extensions can only be created in developer mode", "sap.ui.rta");
65
+ throw DtUtil.createError(
66
+ "service.ControllerExtension#add", "code extensions can only be created in developer mode",
67
+ "sap.ui.rta"
68
+ );
66
69
  }
67
70
 
68
71
  if (!sCodeRef) {
69
- throw DtUtil.createError("service.ControllerExtension#add", "can't create controller extension without codeRef", "sap.ui.rta");
72
+ throw DtUtil.createError(
73
+ "service.ControllerExtension#add", "can't create controller extension without codeRef",
74
+ "sap.ui.rta"
75
+ );
70
76
  }
71
77
 
72
78
  if (!sCodeRef.endsWith(".js")) {
@@ -75,7 +81,7 @@ sap.ui.define([
75
81
 
76
82
  var oView = Element.getElementById(sViewId);
77
83
  var oAppComponent = FlexUtils.getAppComponentForControl(oView);
78
- var sControllerName = oView.getControllerName && oView.getControllerName() || oView.getController() && oView.getController().getMetadata().getName();
84
+ var sControllerName = oView.getControllerModuleName() ? `module:${oView.getControllerModuleName()}` : oView.getController()?.getMetadata().getName();
79
85
  // Calculate moduleName for code extension
80
86
  var sReference = FlexRuntimeInfoAPI.getFlexReference({element: oAppComponent});
81
87
  var sModuleName = sReference.replace(/\.Component/g, "").replace(/\./g, "/");
@@ -43,7 +43,7 @@ sap.ui.define([
43
43
  * @name sap.ui.rta.service.Outline
44
44
  * @author SAP SE
45
45
  * @since 1.56
46
- * @version 1.134.0
46
+ * @version 1.135.0
47
47
  * @private
48
48
  * @ui5-restricted
49
49
  */
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @name sap.ui.rta.service.Property
28
28
  * @author SAP SE
29
29
  * @since 1.58
30
- * @version 1.134.0
30
+ * @version 1.135.0
31
31
  * @private
32
32
  * @ui5-restricted
33
33
  */
@@ -14,7 +14,7 @@ sap.ui.define(function() {
14
14
  * @name sap.ui.rta.service.Selection
15
15
  * @author SAP SE
16
16
  * @since 1.58
17
- * @version 1.134.0
17
+ * @version 1.135.0
18
18
  * @private
19
19
  * @ui5-restricted
20
20
  */
@@ -30,7 +30,7 @@ sap.ui.define([
30
30
  * @name sap.ui.rta.service.SupportTools
31
31
  * @author SAP SE
32
32
  * @since 1.106
33
- * @version 1.134.0
33
+ * @version 1.135.0
34
34
  * @private
35
35
  * @ui5-restricted
36
36
  */
@@ -25,6 +25,11 @@
25
25
  }
26
26
  }
27
27
 
28
+ .sapUiRtaHardReloadInfoButton .sapMBtnAttention {
29
+ background-color: transparent;
30
+ border-color: transparent;
31
+ }
32
+
28
33
  .sapMFlexBox {
29
34
  margin-left: 0;
30
35
  height: 2.5rem; //40px
@@ -20,14 +20,32 @@
20
20
  class="sapUiRtaVersionButton"
21
21
  icon="sap-icon://megamenu"
22
22
  iconFirst="false"
23
- visible="{= (${versions>/versioningEnabled} && ${controls>/modeSwitcher} === 'adaptation')}"
23
+ visible="{= (${versions>/versioningEnabled} && ${controls>/modeSwitcher} === 'adaptation' && ${controls>/changesNeedHardReload} === false)}"
24
24
  text="{parts: [{path: 'versions>/versions'}, {path: 'versions>/displayedVersion'}], formatter: '.formatVersionButtonText'}"
25
- tooltip="{parts: [{path: 'versions>/versions'}, {path: 'versions>/displayedVersion'}], formatter: '.formatVersionButtonText'}"
25
+ tooltip="{i18n>TOL_SHOW_VERSION_HISTORY}"
26
26
  press=".showVersionHistory">
27
27
  <layoutData>
28
28
  <OverflowToolbarLayoutData priority="NeverOverflow"/>
29
29
  </layoutData>
30
30
  </Button>
31
+ <Button
32
+ id="sapUiRta_hardReloadButton"
33
+ type="Attention"
34
+ visible="{= ${controls>/changesNeedHardReload} === true}"
35
+ text="{i18n>SAVE_AND_RELOAD}"
36
+ iconFirst="true"
37
+ icon="sap-icon://refresh"
38
+ press=".saveAndReloadApp"
39
+ />
40
+ <Button
41
+ id="sapUiRta_hardReloadInfoButton"
42
+ type="Attention"
43
+ visible="{= ${controls>/changesNeedHardReload} === true}"
44
+ press=".showHardReloadInfoPopover"
45
+ icon="sap-icon://question-mark"
46
+ class="sapUiNoMarginBeginEnd sapUiRtaHardReloadInfoButton"
47
+ tooltip="{i18n>TOL_SHOW_HARD_RELOAD_INFO}"
48
+ />
31
49
  <toolbar:OverflowToolbarButton
32
50
  id="sapUiRta_activate"
33
51
  icon="sap-icon://activate"
@@ -65,7 +83,7 @@
65
83
  id="sapUiRta_modeSwitcher"
66
84
  selectionChange=".modeChange"
67
85
  selectedKey="{controls>/modeSwitcher}"
68
- width="auto" >
86
+ width="100%" >
69
87
  <items>
70
88
  <SegmentedButtonItem
71
89
  id="sapUiRta_adaptationSwitcherButton"
@@ -5,9 +5,11 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "./AdaptationRenderer",
9
8
  "sap/base/Log",
10
9
  "sap/m/MessageBox",
10
+ "sap/m/MessageStrip",
11
+ "sap/m/Popover",
12
+ "sap/ui/core/message/MessageType",
11
13
  "sap/ui/core/BusyIndicator",
12
14
  "sap/ui/core/Element",
13
15
  "sap/ui/core/Fragment",
@@ -18,17 +20,20 @@ sap.ui.define([
18
20
  "sap/ui/model/json/JSONModel",
19
21
  "sap/ui/performance/Measurement",
20
22
  "sap/ui/rta/appVariant/Feature",
21
- "sap/ui/rta/toolbar/Base",
22
23
  "sap/ui/rta/toolbar/contextBased/ManageAdaptations",
23
24
  "sap/ui/rta/toolbar/contextBased/SaveAsAdaptation",
24
25
  "sap/ui/rta/toolbar/translation/Translation",
25
26
  "sap/ui/rta/toolbar/versioning/Versioning",
27
+ "sap/ui/rta/toolbar/AdaptationRenderer",
28
+ "sap/ui/rta/toolbar/Base",
26
29
  "sap/ui/rta/util/whatsNew/WhatsNewOverview",
27
30
  "sap/ui/rta/Utils"
28
31
  ], function(
29
- AdaptationRenderer,
30
32
  Log,
31
33
  MessageBox,
34
+ MessageStrip,
35
+ Popover,
36
+ MessageType,
32
37
  BusyIndicator,
33
38
  Element,
34
39
  Fragment,
@@ -39,11 +44,12 @@ sap.ui.define([
39
44
  JSONModel,
40
45
  Measurement,
41
46
  AppVariantFeature,
42
- Base,
43
47
  ManageAdaptations,
44
48
  SaveAsAdaptation,
45
49
  Translation,
46
50
  Versioning,
51
+ AdaptationRenderer,
52
+ Base,
47
53
  WhatsNewOverview,
48
54
  Utils
49
55
  ) {
@@ -57,7 +63,7 @@ sap.ui.define([
57
63
  * @extends sap.ui.rta.toolbar.Base
58
64
  *
59
65
  * @author SAP SE
60
- * @version 1.134.0
66
+ * @version 1.135.0
61
67
  *
62
68
  * @constructor
63
69
  * @private
@@ -85,7 +91,8 @@ sap.ui.define([
85
91
  switchVersion: {},
86
92
  switchAdaptation: {},
87
93
  deleteAdaptation: {},
88
- openChangeCategorySelectionPopover: {}
94
+ openChangeCategorySelectionPopover: {},
95
+ saveAndReload: {}
89
96
  }
90
97
  }
91
98
  });
@@ -242,6 +249,23 @@ sap.ui.define([
242
249
  return this.getExtension("versioning", Versioning).openActivateVersionDialog(sDisplayedVersion);
243
250
  };
244
251
 
252
+ Adaptation.prototype.showHardReloadInfoPopover = function(oEvent) {
253
+ this._oHardReloadInfoPopover ||= new Popover({
254
+ placement: "Bottom",
255
+ content: [
256
+ new MessageStrip({
257
+ text: this.getTextResources().getText("MSG_HARD_RELOAD_INFO"),
258
+ type: MessageType.Warning,
259
+ showIcon: true
260
+ })
261
+ ],
262
+ showHeader: false,
263
+ contentWidth: "18rem"
264
+ });
265
+ this.addDependent(this._oHardReloadInfoPopover);
266
+ this._oHardReloadInfoPopover.openBy(oEvent.getSource());
267
+ };
268
+
245
269
  Adaptation.prototype.showActionsMenu = function(oEvent) {
246
270
  var oButton = oEvent.getSource();
247
271
  if (!this._oActionsMenuFragment) {
@@ -326,7 +350,9 @@ sap.ui.define([
326
350
  formatVersionButtonText: this.formatVersionButtonText.bind(this),
327
351
  showVersionHistory: this.showVersionHistory.bind(this),
328
352
  showActionsMenu: this.showActionsMenu.bind(this),
329
- showFeedbackForm: this.showFeedbackForm.bind(this)
353
+ showFeedbackForm: this.showFeedbackForm.bind(this),
354
+ showHardReloadInfoPopover: this.showHardReloadInfoPopover.bind(this),
355
+ saveAndReloadApp: this.eventHandler.bind(this, "SaveAndReload")
330
356
  }
331
357
  });
332
358
  };
@@ -33,7 +33,7 @@ sap.ui.define([
33
33
  * @extends sap.m.HBox
34
34
  *
35
35
  * @author SAP SE
36
- * @version 1.134.0
36
+ * @version 1.135.0
37
37
  *
38
38
  * @constructor
39
39
  * @private