@openui5/sap.ui.rta 1.122.0 → 1.123.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 (141) hide show
  1. package/package.json +6 -6
  2. package/src/sap/ui/rta/.library +1 -1
  3. package/src/sap/ui/rta/Client.js +1 -1
  4. package/src/sap/ui/rta/RuntimeAuthoring.js +2 -1
  5. package/src/sap/ui/rta/Utils.js +1 -1
  6. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  7. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  8. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  9. package/src/sap/ui/rta/command/AddXML.js +1 -1
  10. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  11. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  12. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  13. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  14. package/src/sap/ui/rta/command/Combine.js +1 -1
  15. package/src/sap/ui/rta/command/CommandFactory.js +1 -1
  16. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  17. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  18. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  19. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  20. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  21. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  22. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  23. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  24. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  25. package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
  26. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  27. package/src/sap/ui/rta/command/Move.js +1 -1
  28. package/src/sap/ui/rta/command/Property.js +1 -1
  29. package/src/sap/ui/rta/command/Remove.js +1 -1
  30. package/src/sap/ui/rta/command/Rename.js +1 -1
  31. package/src/sap/ui/rta/command/Resize.js +1 -1
  32. package/src/sap/ui/rta/command/Reveal.js +1 -1
  33. package/src/sap/ui/rta/command/Settings.js +1 -1
  34. package/src/sap/ui/rta/command/Split.js +1 -1
  35. package/src/sap/ui/rta/command/Stack.js +1 -1
  36. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  37. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  38. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  39. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  40. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  41. package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
  42. package/src/sap/ui/rta/library.js +2 -2
  43. package/src/sap/ui/rta/messagebundle.properties +2 -0
  44. package/src/sap/ui/rta/messagebundle_ar.properties +1 -0
  45. package/src/sap/ui/rta/messagebundle_bg.properties +1 -0
  46. package/src/sap/ui/rta/messagebundle_ca.properties +1 -0
  47. package/src/sap/ui/rta/messagebundle_cnr.properties +1 -0
  48. package/src/sap/ui/rta/messagebundle_cs.properties +1 -0
  49. package/src/sap/ui/rta/messagebundle_cy.properties +2 -1
  50. package/src/sap/ui/rta/messagebundle_da.properties +1 -0
  51. package/src/sap/ui/rta/messagebundle_de.properties +2 -1
  52. package/src/sap/ui/rta/messagebundle_el.properties +1 -0
  53. package/src/sap/ui/rta/messagebundle_en.properties +325 -0
  54. package/src/sap/ui/rta/messagebundle_en_GB.properties +1 -0
  55. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +3 -3
  56. package/src/sap/ui/rta/messagebundle_es.properties +1 -0
  57. package/src/sap/ui/rta/messagebundle_es_MX.properties +1 -0
  58. package/src/sap/ui/rta/messagebundle_et.properties +1 -0
  59. package/src/sap/ui/rta/messagebundle_fi.properties +1 -0
  60. package/src/sap/ui/rta/messagebundle_fr.properties +1 -0
  61. package/src/sap/ui/rta/messagebundle_fr_CA.properties +24 -23
  62. package/src/sap/ui/rta/messagebundle_hi.properties +1 -0
  63. package/src/sap/ui/rta/messagebundle_hr.properties +1 -0
  64. package/src/sap/ui/rta/messagebundle_hu.properties +1 -0
  65. package/src/sap/ui/rta/messagebundle_id.properties +1 -0
  66. package/src/sap/ui/rta/messagebundle_it.properties +1 -0
  67. package/src/sap/ui/rta/messagebundle_iw.properties +1 -0
  68. package/src/sap/ui/rta/messagebundle_ja.properties +1 -0
  69. package/src/sap/ui/rta/messagebundle_kk.properties +1 -0
  70. package/src/sap/ui/rta/messagebundle_ko.properties +1 -0
  71. package/src/sap/ui/rta/messagebundle_lt.properties +1 -0
  72. package/src/sap/ui/rta/messagebundle_lv.properties +1 -0
  73. package/src/sap/ui/rta/messagebundle_mk.properties +1 -0
  74. package/src/sap/ui/rta/messagebundle_ms.properties +1 -0
  75. package/src/sap/ui/rta/messagebundle_nl.properties +2 -1
  76. package/src/sap/ui/rta/messagebundle_no.properties +1 -0
  77. package/src/sap/ui/rta/messagebundle_pl.properties +1 -0
  78. package/src/sap/ui/rta/messagebundle_pt.properties +1 -0
  79. package/src/sap/ui/rta/messagebundle_pt_PT.properties +1 -0
  80. package/src/sap/ui/rta/messagebundle_ro.properties +1 -0
  81. package/src/sap/ui/rta/messagebundle_ru.properties +1 -0
  82. package/src/sap/ui/rta/messagebundle_sh.properties +1 -0
  83. package/src/sap/ui/rta/messagebundle_sk.properties +1 -0
  84. package/src/sap/ui/rta/messagebundle_sl.properties +1 -0
  85. package/src/sap/ui/rta/messagebundle_sr.properties +1 -0
  86. package/src/sap/ui/rta/messagebundle_sv.properties +1 -0
  87. package/src/sap/ui/rta/messagebundle_th.properties +1 -0
  88. package/src/sap/ui/rta/messagebundle_tr.properties +1 -0
  89. package/src/sap/ui/rta/messagebundle_uk.properties +1 -0
  90. package/src/sap/ui/rta/messagebundle_vi.properties +1 -0
  91. package/src/sap/ui/rta/messagebundle_zh_CN.properties +1 -0
  92. package/src/sap/ui/rta/messagebundle_zh_TW.properties +1 -0
  93. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  94. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  95. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  96. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  97. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  98. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  99. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  100. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  101. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  102. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  103. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  104. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  105. package/src/sap/ui/rta/plugin/RenameHandler.js +1 -1
  106. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  107. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  108. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  109. package/src/sap/ui/rta/plugin/Split.js +1 -1
  110. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  111. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  112. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.fragment.xml +20 -6
  113. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +53 -35
  114. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +43 -20
  115. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  116. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
  117. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  118. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  119. package/src/sap/ui/rta/service/Action.js +1 -1
  120. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  121. package/src/sap/ui/rta/service/Outline.js +1 -1
  122. package/src/sap/ui/rta/service/Property.js +1 -1
  123. package/src/sap/ui/rta/service/Selection.js +1 -1
  124. package/src/sap/ui/rta/service/SupportTools.js +1 -1
  125. package/src/sap/ui/rta/toolbar/Adaptation.js +1 -1
  126. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  127. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  128. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  129. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  130. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  131. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
  132. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  133. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  134. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  135. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  136. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  137. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  138. package/src/sap/ui/rta/util/ServiceManager.js +1 -1
  139. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
  140. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
  141. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +1 -1
@@ -70,7 +70,7 @@ sap.ui.define([
70
70
  * @extends sap.ui.dt.Plugin
71
71
  *
72
72
  * @author SAP SE
73
- * @version 1.122.0
73
+ * @version 1.123.0
74
74
  *
75
75
  * @constructor
76
76
  * @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.122.0
38
+ * @version 1.123.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.122.0
32
+ * @version 1.123.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.122.0
31
+ * @version 1.123.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.122.0
46
+ * @version 1.123.0
47
47
  *
48
48
  * @constructor
49
49
  * @private
@@ -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.122.0
30
+ * @version 1.123.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.122.0
34
+ * @version 1.123.0
35
35
  * @constructor
36
36
  * @private
37
37
  * @since 1.34
@@ -25,7 +25,7 @@ sap.ui.define([
25
25
  * @class The Settings allows trigger change of settings operations on the overlay
26
26
  * @extends sap.ui.rta.plugin.Plugin
27
27
  * @author SAP SE
28
- * @version 1.122.0
28
+ * @version 1.123.0
29
29
  * @constructor
30
30
  * @private
31
31
  * @since 1.44
@@ -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.122.0
26
+ * @version 1.123.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.122.0
32
+ * @version 1.123.0
33
33
  *
34
34
  * @constructor
35
35
  * @private
@@ -34,7 +34,7 @@ sap.ui.define([
34
34
  * handled by the AdditionalElements Plugin (Reveal, Add Via Delegate, Add Custom)
35
35
  *
36
36
  * @author SAP SE
37
- * @version 1.122.0
37
+ * @version 1.123.0
38
38
  * @private
39
39
  * @since 1.94
40
40
  */
@@ -1,5 +1,5 @@
1
1
  <core:FragmentDefinition
2
- xmlns="sap.m"
2
+ xmlns="sap.m"
3
3
  xmlns:core="sap.ui.core"
4
4
  xmlns:layout="sap.ui.layout">
5
5
 
@@ -28,12 +28,26 @@
28
28
  press="._resortList"/>
29
29
  <Button
30
30
  id="rta_customFieldButton"
31
- text=""
32
- icon="sap-icon://add"
31
+ text="{/customFieldButtonText}"
33
32
  tooltip="{/customFieldButtonTooltip}"
34
- enabled="{/customFieldEnabled}"
35
- visible="{/customFieldVisible}"
36
- press="._redirectToCustomFieldCreation"/>
33
+ visible="{/customFieldButtonVisible}"
34
+ press="._redirectToExtensibilityAction(${/extensibilityOptions/0/actionKey})"/>
35
+ <MenuButton
36
+ id="rta_customFieldMenuButton"
37
+ text="{/extensibilityMenuButtonText}"
38
+ tooltip="{/extensibilityMenuButtonTooltip}"
39
+ visible="{/extensibilityMenuButtonActive}">
40
+ <Menu
41
+ itemSelected="onMenuItemPress"
42
+ items="{/extensibilityOptions}">
43
+ <items>
44
+ <MenuItem
45
+ text="{text}"
46
+ tooltip="{tooltip}"
47
+ press="_redirectToExtensibilityAction(${actionKey})"/>
48
+ </items>
49
+ </Menu>
50
+ </MenuButton>
37
51
  </Toolbar>
38
52
  <layout:VerticalLayout
39
53
  id="rta_businessContextContainer"
@@ -7,7 +7,7 @@ sap.ui.define([
7
7
  "sap/ui/base/ManagedObject",
8
8
  "sap/ui/core/Element",
9
9
  "sap/ui/core/Fragment",
10
- "sap/ui/fl/write/api/FieldExtensibility",
10
+ "sap/ui/core/Lib",
11
11
  "sap/ui/model/json/JSONModel",
12
12
  "sap/ui/model/Filter",
13
13
  "sap/ui/model/FilterOperator",
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  ManagedObject,
19
19
  Element,
20
20
  Fragment,
21
- FieldExtensibility,
21
+ Lib,
22
22
  JSONModel,
23
23
  Filter,
24
24
  FilterOperator,
@@ -34,7 +34,7 @@ sap.ui.define([
34
34
  * @class Context - Dialog for available Fields in Runtime Authoring
35
35
  * @extends sap.ui.base.ManagedObject
36
36
  * @author SAP SE
37
- * @version 1.122.0
37
+ * @version 1.123.0
38
38
  * @constructor
39
39
  * @private
40
40
  * @since 1.44
@@ -44,10 +44,6 @@ sap.ui.define([
44
44
  metadata: {
45
45
  library: "sap.ui.rta",
46
46
  properties: {
47
- customFieldEnabled: {
48
- type: "boolean",
49
- defaultValue: false
50
- },
51
47
  businessContextVisible: {
52
48
  type: "boolean",
53
49
  defaultValue: false
@@ -58,7 +54,7 @@ sap.ui.define([
58
54
  },
59
55
  events: {
60
56
  opened: {},
61
- openCustomField: {}
57
+ triggerExtensibilityAction: {}
62
58
  }
63
59
  }
64
60
  });
@@ -79,11 +75,15 @@ sap.ui.define([
79
75
 
80
76
  this._oDialogModel = new JSONModel({
81
77
  elements: [],
82
- customFieldEnabled: false,
83
- customFieldVisible: false,
78
+ customFieldButtonText: "",
79
+ customFieldButtonVisible: false,
84
80
  businessContextVisible: false,
85
81
  customFieldButtonTooltip: "",
86
- businessContextTexts: [{text: ""}] // empty element in first place, to be replaced by the headerText (see: addExtensionData)
82
+ businessContextTexts: [{text: ""}], // empty element in first place to be replaced by the headerText (see: addExtensibilityInfo)
83
+ extensibilityMenuButtonActive: false,
84
+ extensibilityMenuButtonText: "",
85
+ extensibilityMenuButtonTooltip: "",
86
+ extensibilityOptions: []
87
87
  });
88
88
 
89
89
  this._oDialogPromise.then(function(oDialog) {
@@ -113,7 +113,11 @@ sap.ui.define([
113
113
  };
114
114
 
115
115
  AddElementsDialog.prototype.setCustomFieldButtonVisible = function(bVisible) {
116
- this._oDialogModel.setProperty("/customFieldVisible", bVisible);
116
+ this._oDialogModel.setProperty("/customFieldButtonVisible", bVisible);
117
+ };
118
+
119
+ AddElementsDialog.prototype.getCustomFieldButtonVisible = function() {
120
+ return this._oDialogModel.getProperty("/customFieldButtonVisible");
117
121
  };
118
122
 
119
123
  /**
@@ -213,12 +217,12 @@ sap.ui.define([
213
217
  };
214
218
 
215
219
  /**
216
- * Fire an event to redirect to custom field creation
217
- *
220
+ * Fire an event to redirect to the extensibility action
221
+ * @param {string} sActionKey - Key for the mapping of specific actions (e.g. which URI to open for given extension data)
218
222
  * @private
219
223
  */
220
- AddElementsDialog.prototype._redirectToCustomFieldCreation = function() {
221
- this.fireOpenCustomField();
224
+ AddElementsDialog.prototype._redirectToExtensibilityAction = function(sActionKey) {
225
+ this.fireTriggerExtensibilityAction({actionKey: sActionKey});
222
226
  this._oDialogPromise.then(function(oDialog) {
223
227
  oDialog.close();
224
228
  });
@@ -232,14 +236,33 @@ sap.ui.define([
232
236
  };
233
237
 
234
238
  /**
235
- * Enables the Custom Field Creation button
239
+ * Sets the information for the extensibility menu button items
236
240
  *
237
- * @param {boolean} bCustomFieldEnabled field extensibility button is enabled if true, else disabled
241
+ * @param {string} sButtonText - Text for the extensibility MenuButton
242
+ * @param {string} sButtonTooltip - Tooltip for the extensibility MenuButton
243
+ * @param {object[]} aExtensibilityOptions - Options available on the extensibility MenuButton
238
244
  * @public
239
245
  */
240
- AddElementsDialog.prototype.setCustomFieldEnabled = function(bCustomFieldEnabled) {
241
- this.setProperty("customFieldEnabled", bCustomFieldEnabled, true);
242
- this._oDialogModel.setProperty("/customFieldEnabled", this.getProperty("customFieldEnabled"));
246
+ AddElementsDialog.prototype.setExtensibilityOptions = function(oExtensibilityInfo) {
247
+ const aExtensibilityOptions = oExtensibilityInfo.UITexts.options;
248
+
249
+ this._oDialogModel.setProperty("/extensibilityOptions", aExtensibilityOptions);
250
+ if (aExtensibilityOptions.length === 1) {
251
+ // if there is only one option, we can directly set the button text
252
+ this._oDialogModel.setProperty("/customFieldButtonText", aExtensibilityOptions[0].text);
253
+ if (aExtensibilityOptions[0]?.tooltip) {
254
+ this._oDialogModel.setProperty("/customFieldButtonTooltip", aExtensibilityOptions[0].tooltip);
255
+ }
256
+ this.setCustomFieldButtonVisible(true);
257
+ } else {
258
+ this._oDialogModel.setProperty("/extensibilityMenuButtonActive", true);
259
+ this._oDialogModel.setProperty("/extensibilityMenuButtonText", oExtensibilityInfo.UITexts.buttonText);
260
+ this._oDialogModel.setProperty("/extensibilityMenuButtonTooltip", oExtensibilityInfo.UITexts.tooltip);
261
+ }
262
+ };
263
+
264
+ AddElementsDialog.prototype.getExtensibilityOptions = function() {
265
+ return this._oDialogModel.getProperty("/extensibilityOptions");
243
266
  };
244
267
 
245
268
  /**
@@ -254,18 +277,18 @@ sap.ui.define([
254
277
  };
255
278
 
256
279
  /**
257
- * Adds extension data, e.g. business contexts
258
- * @param {object[]} aExtensionData - Array containing extension data
259
- * @returns {Promise<undefined>} A promise resolving to undefined
280
+ * Adds extensibility info - business contexts, UI Texts, etc...
281
+ * @param {object} oExtensibilityInfo - Extensibility Info
260
282
  * @public
261
283
  */
262
- AddElementsDialog.prototype.addExtensionData = function(aExtensionData) {
284
+ AddElementsDialog.prototype.addExtensibilityInfo = function(oExtensibilityInfo) {
285
+ const aContexts = oExtensibilityInfo?.extensionData;
263
286
  // clear old values from last run
264
287
  this._removeExtensionDataTexts();
265
288
 
266
289
  var aBusinessContextTexts = this._oDialogModel.getObject("/businessContextTexts");
267
- if (aExtensionData && aExtensionData.length > 0) {
268
- aExtensionData.forEach(function(oContext) {
290
+ if (aContexts && aContexts.length > 0) {
291
+ aContexts.forEach(function(oContext) {
269
292
  aBusinessContextTexts.push({
270
293
  text: oContext.description
271
294
  });
@@ -279,14 +302,9 @@ sap.ui.define([
279
302
  // set the container visible
280
303
  this._setBusinessContextVisible(true);
281
304
 
282
- return FieldExtensibility.getTexts().then(function(oFieldExtensibilityTexts) {
283
- if (oFieldExtensibilityTexts) {
284
- this._oDialogModel.setProperty("/customFieldButtonTooltip", oFieldExtensibilityTexts.tooltip);
285
- // the first entry is always the "header" to be set by the implementation of FieldExtensibility
286
- // it is set during the instantiation of the model, in the 'init' function
287
- this._oDialogModel.setProperty("/businessContextTexts/0/text", oFieldExtensibilityTexts.headerText);
288
- }
289
- }.bind(this));
305
+ // the first entry is always the "header" to be set by the implementation of FieldExtensibility
306
+ // it is set during the instantiation of the model, in the 'init' function
307
+ this._oDialogModel.setProperty("/businessContextTexts/0/text", oExtensibilityInfo?.UITexts?.headerText);
290
308
  };
291
309
 
292
310
  /**
@@ -67,17 +67,47 @@ sap.ui.define([
67
67
  }
68
68
  }
69
69
 
70
- async function handleExtensibility(oControl) {
70
+ async function loadExtensibilityInfo(oControl) {
71
71
  await FieldExtensibility.onControlSelected(oControl);
72
72
  const bExtensibilityEnabled = await FieldExtensibility.isExtensibilityEnabled(oControl);
73
73
 
74
74
  if (bExtensibilityEnabled) {
75
75
  await isServiceUpToDate(oControl);
76
- return FieldExtensibility.getExtensionData(oControl);
76
+ const oExtensibilityInfo = await FieldExtensibility.getExtensionData(oControl);
77
+ if (oExtensibilityInfo) {
78
+ oExtensibilityInfo.UITexts = await FieldExtensibility.getTexts() || {};
79
+ }
80
+ return oExtensibilityInfo;
77
81
  }
78
82
  return undefined;
79
83
  }
80
84
 
85
+ // Configure the dialog elements related to extensibility
86
+ function configureExtensibility(bOverlayIsSibling) {
87
+ const oExtensibilityInfo = this.getExtensibilityInfo(bOverlayIsSibling);
88
+ if (!oExtensibilityInfo) {
89
+ this.getDialog().setCustomFieldButtonVisible(false);
90
+ return;
91
+ }
92
+ const aExtensibilityOptions = oExtensibilityInfo.UITexts?.options;
93
+ if (!aExtensibilityOptions) {
94
+ // Legacy implementation (CustomFieldButton) does not have "options" in the UI Texts
95
+ const oTextResources = Lib.getResourceBundleFor("sap.ui.rta");
96
+ oExtensibilityInfo.UITexts.options = [
97
+ {
98
+ actionKey: undefined,
99
+ text: oTextResources.getText("BTN_ADDITIONAL_ELEMENTS_CREATE_CUSTOM_FIELDS"),
100
+ tooltip: oExtensibilityInfo.UITexts.tooltip
101
+ }
102
+ ];
103
+ }
104
+
105
+ this.getDialog().setExtensibilityOptions(oExtensibilityInfo);
106
+ this.getDialog().detachEvent("triggerExtensibilityAction", this._onTriggerExtensibilityAction, this);
107
+ this.getDialog().attachEvent("triggerExtensibilityAction", bOverlayIsSibling, this._onTriggerExtensibilityAction, this);
108
+ this.getDialog().addExtensibilityInfo(oExtensibilityInfo);
109
+ }
110
+
81
111
  /**
82
112
  * Constructor for a new Additional Elements Plugin.
83
113
  *
@@ -89,7 +119,7 @@ sap.ui.define([
89
119
  * @class The plugin allows to add additional elements that exist either hidden in the UI or in the OData service
90
120
  * @extends sap.ui.rta.plugin.Plugin
91
121
  * @author SAP SE
92
- * @version 1.122.0
122
+ * @version 1.123.0
93
123
  * @constructor
94
124
  * @private
95
125
  * @since 1.44
@@ -260,19 +290,7 @@ sap.ui.define([
260
290
 
261
291
  .then(function(aCollectedElements) {
262
292
  aAllElements = aCollectedElements;
263
- // getAllElements() also sets the extensibility info
264
- var oExtensibilityInfo = this.getExtensibilityInfo(bOverlayIsSibling);
265
- this.getDialog().setCustomFieldEnabled(!!oExtensibilityInfo);
266
- if (oExtensibilityInfo) {
267
- this.getDialog().detachEvent("openCustomField", this._onOpenCustomField, this);
268
- this.getDialog().attachEvent("openCustomField", bOverlayIsSibling, this._onOpenCustomField, this);
269
- this.getDialog().setCustomFieldButtonVisible(true);
270
- return this.getDialog().addExtensionData(oExtensibilityInfo.extensionData);
271
- }
272
- return this.getDialog().setCustomFieldButtonVisible(false);
273
- }.bind(this))
274
-
275
- .then(function() {
293
+ configureExtensibility.call(this, bOverlayIsSibling);
276
294
  var oAggregationWithElements = aAllElements.filter(function(mElementsPerAggregation) {
277
295
  return mElementsPerAggregation.aggregation === sAggregationName;
278
296
  })[0];
@@ -337,9 +355,14 @@ sap.ui.define([
337
355
  },
338
356
 
339
357
  // Function called when custom field button was pressed
340
- _onOpenCustomField(oEvent, bOverlayIsSibling) {
341
- var sRtaStyleClassName = Utils.getRtaStyleClassName();
342
- return FieldExtensibility.onTriggerCreateExtensionData(this.getExtensibilityInfo(bOverlayIsSibling), sRtaStyleClassName);
358
+ _onTriggerExtensibilityAction(oEvent, bOverlayIsSibling) {
359
+ const sRtaStyleClassName = Utils.getRtaStyleClassName();
360
+ const sActionKey = oEvent.getParameters().actionKey;
361
+ return FieldExtensibility.onTriggerCreateExtensionData(
362
+ this.getExtensibilityInfo(bOverlayIsSibling),
363
+ sRtaStyleClassName,
364
+ sActionKey
365
+ );
343
366
  },
344
367
 
345
368
  /**
@@ -440,7 +463,7 @@ sap.ui.define([
440
463
  });
441
464
  });
442
465
  if (bCheckExtensibility) {
443
- return handleExtensibility(mParents.parent);
466
+ return loadExtensibilityInfo(mParents.parent);
444
467
  }
445
468
  return undefined;
446
469
  })
@@ -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.122.0
20
+ * @version 1.123.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.122.0
28
+ * @version 1.123.0
29
29
  * @private
30
30
  * @since 1.94
31
31
  */
@@ -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.122.0
122
+ * @version 1.123.0
123
123
  * @constructor
124
124
  * @private
125
125
  * @since 1.75
@@ -150,7 +150,7 @@ sap.ui.define([
150
150
  * @class Context - Dialog for IFrame settings in Runtime Authoring
151
151
  * @extends sap.ui.base.ManagedObject
152
152
  * @author SAP SE
153
- * @version 1.122.0
153
+ * @version 1.123.0
154
154
  * @constructor
155
155
  * @private
156
156
  * @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.122.0
27
+ * @version 1.123.0
28
28
  * @private
29
29
  * @ui5-restricted
30
30
  *
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * @name sap.ui.rta.service.ControllerExtension
33
33
  * @author SAP SE
34
34
  * @since 1.58
35
- * @version 1.122.0
35
+ * @version 1.123.0
36
36
  * @private
37
37
  * @ui5-restricted
38
38
  */
@@ -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.122.0
46
+ * @version 1.123.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.122.0
30
+ * @version 1.123.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.122.0
17
+ * @version 1.123.0
18
18
  * @private
19
19
  * @ui5-restricted
20
20
  */
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  * @name sap.ui.rta.service.SupportTools
29
29
  * @author SAP SE
30
30
  * @since 1.106
31
- * @version 1.122.0
31
+ * @version 1.123.0
32
32
  * @private
33
33
  * @ui5-restricted
34
34
  */
@@ -55,7 +55,7 @@ sap.ui.define([
55
55
  * @extends sap.ui.rta.toolbar.Base
56
56
  *
57
57
  * @author SAP SE
58
- * @version 1.122.0
58
+ * @version 1.123.0
59
59
  *
60
60
  * @constructor
61
61
  * @private
@@ -33,7 +33,7 @@ sap.ui.define([
33
33
  * @extends sap.m.HBox
34
34
  *
35
35
  * @author SAP SE
36
- * @version 1.122.0
36
+ * @version 1.123.0
37
37
  *
38
38
  * @constructor
39
39
  * @private
@@ -32,7 +32,7 @@ function(
32
32
  * @extends sap.ui.rta.toolbar.Adaptation
33
33
  *
34
34
  * @author SAP SE
35
- * @version 1.122.0
35
+ * @version 1.123.0
36
36
  *
37
37
  * @constructor
38
38
  * @private
@@ -20,7 +20,7 @@ function(
20
20
  * @extends sap.ui.rta.toolbar.Adaptation
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.122.0
23
+ * @version 1.123.0
24
24
  *
25
25
  * @constructor
26
26
  * @private
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @extends sap.m.OverflowToolbarButton
24
24
  *
25
25
  * @author SAP SE
26
- * @version 1.122.0
26
+ * @version 1.123.0
27
27
  *
28
28
  * @constructor
29
29
  * @private
@@ -20,7 +20,7 @@ function(
20
20
  * @extends sap.ui.rta.toolbar.Adaptation
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.122.0
23
+ * @version 1.123.0
24
24
  *
25
25
  * @constructor
26
26
  * @private
@@ -45,7 +45,7 @@ sap.ui.define([
45
45
  * @class
46
46
  *
47
47
  * @author SAP SE
48
- * @version 1.122.0
48
+ * @version 1.123.0
49
49
  *
50
50
  * @constructor
51
51
  * @private
@@ -53,7 +53,7 @@ sap.ui.define([
53
53
  * @class
54
54
  *
55
55
  * @author SAP SE
56
- * @version 1.122.0
56
+ * @version 1.123.0
57
57
  *
58
58
  * @constructor
59
59
  * @private
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  * @class
39
39
  *
40
40
  * @author SAP SE
41
- * @version 1.122.0
41
+ * @version 1.123.0
42
42
  *
43
43
  * @constructor
44
44
  * @private
@@ -62,7 +62,7 @@ sap.ui.define([
62
62
  * Constructor for a new sap.ui.rta.util.PluginManager
63
63
  * @extends sap.ui.base.ManagedObject
64
64
  * @author SAP SE
65
- * @version 1.122.0
65
+ * @version 1.123.0
66
66
  * @constructor
67
67
  * @private
68
68
  * @since 1.86
@@ -42,7 +42,7 @@ sap.ui.define([
42
42
  * Constructor for a new sap.ui.rta.util.PopupManager
43
43
  * @extends sap.ui.base.ManagedObject
44
44
  * @author SAP SE
45
- * @version 1.122.0
45
+ * @version 1.123.0
46
46
  * @constructor
47
47
  * @private
48
48
  * @since 1.48
@@ -30,7 +30,7 @@ sap.ui.define([
30
30
  * @namespace sap.ui.rta.util.ReloadManager
31
31
  * @alias sap.ui.rta.util.ReloadManager
32
32
  * @since 1.104
33
- * @version 1.122.0
33
+ * @version 1.123.0
34
34
  * @private
35
35
  * @ui5-restricted
36
36
  */