@openui5/sap.ui.rta 1.93.3 → 1.96.1

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 (158) hide show
  1. package/.reuse/dep5 +6 -11
  2. package/THIRDPARTY.txt +10 -16
  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 +160 -121
  7. package/src/sap/ui/rta/Utils.js +73 -1
  8. package/src/sap/ui/rta/appVariant/AppVariantDialog.js +4 -3
  9. package/src/sap/ui/rta/appVariant/AppVariantManager.js +24 -17
  10. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +107 -78
  11. package/src/sap/ui/rta/appVariant/Feature.js +5 -12
  12. package/src/sap/ui/rta/appVariant/Utils.js +10 -2
  13. package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +35 -20
  14. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_de.properties +1 -1
  15. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  16. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  17. package/src/sap/ui/rta/command/AddXML.js +1 -1
  18. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  19. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  20. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  21. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  22. package/src/sap/ui/rta/command/Combine.js +1 -1
  23. package/src/sap/ui/rta/command/CommandFactory.js +1 -1
  24. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  25. package/src/sap/ui/rta/command/ControlVariantConfigure.js +4 -4
  26. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  27. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +7 -4
  28. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +7 -7
  29. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  30. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  31. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  32. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  33. package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
  34. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  35. package/src/sap/ui/rta/command/Move.js +1 -1
  36. package/src/sap/ui/rta/command/Property.js +1 -1
  37. package/src/sap/ui/rta/command/Remove.js +1 -1
  38. package/src/sap/ui/rta/command/Rename.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/appDescriptor/AddLibrary.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/enablement/elementActionTest.js +1 -1
  48. package/src/sap/ui/rta/library.js +2 -2
  49. package/src/sap/ui/rta/messagebundle.properties +23 -9
  50. package/src/sap/ui/rta/messagebundle_ar.properties +8 -1
  51. package/src/sap/ui/rta/messagebundle_bg.properties +8 -1
  52. package/src/sap/ui/rta/messagebundle_ca.properties +8 -1
  53. package/src/sap/ui/rta/messagebundle_cs.properties +8 -1
  54. package/src/sap/ui/rta/messagebundle_cy.properties +13 -6
  55. package/src/sap/ui/rta/messagebundle_da.properties +8 -1
  56. package/src/sap/ui/rta/messagebundle_de.properties +23 -16
  57. package/src/sap/ui/rta/messagebundle_el.properties +9 -2
  58. package/src/sap/ui/rta/messagebundle_en.properties +8 -1
  59. package/src/sap/ui/rta/messagebundle_en_GB.properties +8 -1
  60. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +14 -7
  61. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +14 -7
  62. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +14 -7
  63. package/src/sap/ui/rta/messagebundle_es.properties +8 -1
  64. package/src/sap/ui/rta/messagebundle_es_MX.properties +8 -1
  65. package/src/sap/ui/rta/messagebundle_et.properties +8 -1
  66. package/src/sap/ui/rta/messagebundle_fi.properties +10 -3
  67. package/src/sap/ui/rta/messagebundle_fr.properties +8 -1
  68. package/src/sap/ui/rta/messagebundle_fr_CA.properties +8 -1
  69. package/src/sap/ui/rta/messagebundle_hi.properties +8 -1
  70. package/src/sap/ui/rta/messagebundle_hr.properties +8 -1
  71. package/src/sap/ui/rta/messagebundle_hu.properties +8 -1
  72. package/src/sap/ui/rta/messagebundle_id.properties +10 -3
  73. package/src/sap/ui/rta/messagebundle_it.properties +8 -1
  74. package/src/sap/ui/rta/messagebundle_iw.properties +8 -1
  75. package/src/sap/ui/rta/messagebundle_ja.properties +8 -1
  76. package/src/sap/ui/rta/messagebundle_kk.properties +8 -1
  77. package/src/sap/ui/rta/messagebundle_ko.properties +9 -2
  78. package/src/sap/ui/rta/messagebundle_lt.properties +8 -1
  79. package/src/sap/ui/rta/messagebundle_lv.properties +8 -1
  80. package/src/sap/ui/rta/messagebundle_ms.properties +8 -1
  81. package/src/sap/ui/rta/messagebundle_nl.properties +8 -1
  82. package/src/sap/ui/rta/messagebundle_no.properties +8 -1
  83. package/src/sap/ui/rta/messagebundle_pl.properties +8 -1
  84. package/src/sap/ui/rta/messagebundle_pt.properties +8 -1
  85. package/src/sap/ui/rta/messagebundle_pt_PT.properties +8 -1
  86. package/src/sap/ui/rta/messagebundle_ro.properties +8 -1
  87. package/src/sap/ui/rta/messagebundle_ru.properties +8 -1
  88. package/src/sap/ui/rta/messagebundle_sh.properties +8 -1
  89. package/src/sap/ui/rta/messagebundle_sk.properties +8 -1
  90. package/src/sap/ui/rta/messagebundle_sl.properties +8 -1
  91. package/src/sap/ui/rta/messagebundle_sv.properties +10 -3
  92. package/src/sap/ui/rta/messagebundle_th.properties +8 -1
  93. package/src/sap/ui/rta/messagebundle_tr.properties +8 -1
  94. package/src/sap/ui/rta/messagebundle_uk.properties +8 -1
  95. package/src/sap/ui/rta/messagebundle_vi.properties +8 -1
  96. package/src/sap/ui/rta/messagebundle_zh_CN.properties +8 -1
  97. package/src/sap/ui/rta/messagebundle_zh_TW.properties +8 -1
  98. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  99. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  100. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  101. package/src/sap/ui/rta/plugin/CompVariant.js +1 -2
  102. package/src/sap/ui/rta/plugin/ControlVariant.js +10 -5
  103. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  104. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  105. package/src/sap/ui/rta/plugin/DragDrop.js +52 -2
  106. package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
  107. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  108. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  109. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  110. package/src/sap/ui/rta/plugin/RTAElementMover.js +18 -61
  111. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  112. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  113. package/src/sap/ui/rta/plugin/RenameHandler.js +4 -1
  114. package/src/sap/ui/rta/plugin/Selection.js +35 -1
  115. package/src/sap/ui/rta/plugin/Settings.js +15 -14
  116. package/src/sap/ui/rta/plugin/Split.js +1 -1
  117. package/src/sap/ui/rta/plugin/Stretch.js +133 -139
  118. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +505 -0
  119. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.fragment.xml +74 -0
  120. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +97 -260
  121. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +4 -2
  122. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +136 -831
  123. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +117 -0
  124. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +337 -0
  125. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +8 -5
  126. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +31 -29
  127. package/src/sap/ui/rta/service/Action.js +1 -1
  128. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  129. package/src/sap/ui/rta/service/Outline.js +109 -62
  130. package/src/sap/ui/rta/service/Property.js +1 -1
  131. package/src/sap/ui/rta/service/Selection.js +1 -1
  132. package/src/sap/ui/rta/themes/base/ChangeVisualization.less +16 -0
  133. package/src/sap/ui/rta/themes/base/Overlay.less +59 -58
  134. package/src/sap/ui/rta/{assets/InPageStyles.css → themes/base/OverlayWithScrollbar.less} +14 -12
  135. package/src/sap/ui/rta/themes/base/Toolbar.base.less +12 -1
  136. package/src/sap/ui/rta/themes/base/library.source.less +3 -1
  137. package/src/sap/ui/rta/themes/sap_hcb/Overlay.less +2 -3
  138. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +67 -48
  139. package/src/sap/ui/rta/toolbar/Adaptation.js +43 -38
  140. package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +4 -5
  141. package/src/sap/ui/rta/toolbar/Base.js +64 -18
  142. package/src/sap/ui/rta/toolbar/BaseRenderer.js +2 -2
  143. package/src/sap/ui/rta/toolbar/Fiori.js +9 -9
  144. package/src/sap/ui/rta/toolbar/FioriLike.js +4 -4
  145. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +98 -0
  146. package/src/sap/ui/rta/toolbar/Personalization.js +8 -8
  147. package/src/sap/ui/rta/toolbar/Standalone.js +4 -4
  148. package/src/sap/ui/rta/toolbar/translation/Translation.js +52 -39
  149. package/src/sap/ui/rta/util/BindingsExtractor.js +24 -27
  150. package/src/sap/ui/rta/util/PluginManager.js +2 -4
  151. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  152. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  153. package/src/sap/ui/rta/util/adaptationStarter.js +3 -3
  154. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +21 -2
  155. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
  156. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +71 -96
  157. package/ui5.yaml +4 -1
  158. package/src/sap/ui/rta/util/changeVisualization/ChangesListPopover.fragment.xml +0 -23
@@ -4,68 +4,35 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
  sap.ui.define([
7
- "sap/base/Log",
8
- "sap/m/Button",
9
- "sap/m/CustomListItem",
10
- "sap/m/Dialog",
11
- "sap/m/Label",
12
- "sap/m/library",
13
- "sap/m/List",
14
- "sap/m/SearchField",
15
- "sap/m/Text",
16
- "sap/m/ToolbarSpacer",
17
- "sap/m/Toolbar",
18
- "sap/m/ScrollContainer",
19
- "sap/m/VBox",
20
7
  "sap/ui/base/ManagedObject",
8
+ "sap/ui/core/Fragment",
21
9
  "sap/ui/fl/write/api/FieldExtensibility",
22
- "sap/ui/layout/VerticalLayout",
23
10
  "sap/ui/model/json/JSONModel",
24
11
  "sap/ui/model/Filter",
25
12
  "sap/ui/model/FilterOperator",
13
+ "sap/ui/model/resource/ResourceModel",
26
14
  "sap/ui/model/Sorter",
27
15
  "sap/ui/rta/Utils"
28
16
  ], function(
29
- Log,
30
- Button,
31
- ListItem,
32
- Dialog,
33
- Label,
34
- mobileLibrary,
35
- List,
36
- SearchField,
37
- Text,
38
- ToolbarSpacer,
39
- Toolbar,
40
- ScrollContainer,
41
- VBox,
42
17
  ManagedObject,
18
+ Fragment,
43
19
  FieldExtensibility,
44
- VerticalLayout,
45
20
  JSONModel,
46
21
  Filter,
47
22
  FilterOperator,
23
+ ResourceModel,
48
24
  Sorter,
49
25
  Utils
50
26
  ) {
51
27
  "use strict";
52
28
 
53
- // shortcut for sap.m.ButtonType
54
- var ButtonType = mobileLibrary.ButtonType;
55
-
56
- // shortcut for sap.m.ListType
57
- var ListType = mobileLibrary.ListType;
58
-
59
- // shortcut for sap.m.LabelDesign
60
- var LabelDesign = mobileLibrary.LabelDesign;
61
-
62
29
  /**
63
30
  * Constructor for a new sap.ui.rta.plugin.additionalElements.AddElementsDialog control.
64
31
  *
65
32
  * @class Context - Dialog for available Fields in Runtime Authoring
66
33
  * @extends sap.ui.base.ManagedObject
67
34
  * @author SAP SE
68
- * @version 1.93.3
35
+ * @version 1.96.1
69
36
  * @constructor
70
37
  * @private
71
38
  * @since 1.44
@@ -96,222 +63,98 @@ sap.ui.define([
96
63
  }
97
64
  });
98
65
 
66
+ var oRTAResourceModel;
67
+
99
68
  /**
100
69
  * Initialize the Dialog
101
70
  *
102
71
  * @private
103
72
  */
104
73
  AddElementsDialog.prototype.init = function() {
105
- // Get messagebundle.properties for sap.ui.rta
106
- this._oTextResources = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
107
- this._bAscendingSortOrder = false;
108
- // sap.m.Dialog shouldn't have no parent or a rendered parent
109
- // otherwise invalidate/filter/... is not working correctly
110
- this._oDialog = new Dialog().addStyleClass("sapUIRtaFieldRepositoryDialog");
111
- this._oDialog.addStyleClass(Utils.getRtaStyleClassName());
112
- this._oDialog.addStyleClass("sapUiNoContentPadding");
113
- this._oDialog.setModel(new JSONModel({
114
- elements: []
115
- }));
116
-
117
- var aContent = this._createContent();
118
- var aButtons = this._createButtons();
119
- aContent.forEach(function(oContent) {
120
- this._oDialog.addContent(oContent);
121
- }, this);
122
- aButtons.forEach(function(oButton) {
123
- this._oDialog.addButton(oButton);
124
- }, this);
125
- this._oDialog.setInitialFocus(this._oInput);
126
- };
127
-
128
- AddElementsDialog.prototype.exit = function() {
129
- this._oDialog.destroy();
130
- };
131
-
132
- /**
133
- * Create the Content of the Dialog
134
- *
135
- * @returns {object} list containes inputList and oScrollContainer objects
136
- * @private
137
- */
138
- AddElementsDialog.prototype._createContent = function() {
139
- // SearchField
140
- this._oInput = new SearchField({
141
- width: "100%",
142
- liveChange: [this._updateModelFilter, this]
74
+ this._oDialogPromise = Fragment.load({
75
+ id: this.getId(),
76
+ name: "sap.ui.rta.plugin.additionalElements.AddElementsDialog",
77
+ controller: this
143
78
  });
144
79
 
145
- // Button for sorting the List
146
- var oResortButton = new Button({
147
- text: "",
148
- icon: "sap-icon://sort",
149
- press: [this._resortList, this]
80
+ this._oDialogModel = new JSONModel({
81
+ elements: [],
82
+ customFieldEnabled: false,
83
+ customFieldVisible: false,
84
+ businessContextVisible: false,
85
+ customFieldButtonTooltip: "",
86
+ businessContextTexts: [{text: ""}] //empty element in first place, to be replaced by the headerText (see: addExtensionData)
150
87
  });
151
88
 
152
- // Button for creating Custom Fields
153
- this._oCustomFieldButton = new Button({
154
- text: "",
155
- icon: "sap-icon://add",
156
- tooltip: "",
157
- enabled: this.getCustomFieldEnabled(),
158
- press: [this._redirectToCustomFieldCreation, this]
159
- });
160
-
161
- // Toolbar
162
- this._oToolbarSpacer1 = new ToolbarSpacer();
163
- this.oInputFields = new Toolbar({
164
- content: [this._oInput, oResortButton, this._oToolbarSpacer1, this._oCustomFieldButton]
165
- });
166
-
167
- //Business Context Display
168
- this._oBCContainer = new VerticalLayout({
169
- visible: this.getBusinessContextVisible(),
170
- content: [
171
- new Text({
172
- text: ""
173
- })
174
- ]
175
- }).addStyleClass("sapUIRtaBusinessContextContainer");
176
-
177
- // Fields of the List
178
- var oFieldName = new Label({
179
- design: LabelDesign.Standard,
180
- text: {
181
- parts: [{path: "label"}, {path: "parentPropertyName"}, {path: "duplicateName"}],
182
- formatter: function(sLabel, sParentPropertyName, bDuplicateName) {
183
- if (bDuplicateName && sParentPropertyName) {
184
- sLabel += " (" + sParentPropertyName + ")";
185
- }
186
- return sLabel;
187
- }
89
+ this._oDialogPromise.then(function (oDialog) {
90
+ oDialog.setModel(this._oDialogModel);
91
+ if (!oRTAResourceModel) {
92
+ oRTAResourceModel = new ResourceModel({bundleName: "sap.ui.rta.messagebundle"});
188
93
  }
189
- });
94
+ oDialog.setModel(oRTAResourceModel, "i18n");
190
95
 
191
- var oFieldName2 = new Label({
192
- text: {
193
- parts: [{path: "originalLabel"}],
194
- formatter: function(sOriginalLabel) {
195
- if (sOriginalLabel) {
196
- return this._oTextResources.getText("LBL_FREP", sOriginalLabel);
197
- }
198
- return "";
199
- }.bind(this)
200
- },
201
- visible: {
202
- parts: [{path: "originalLabel"}],
203
- formatter: function(sOriginalLabel) {
204
- if (sOriginalLabel) {
205
- return true;
206
- }
207
- return false;
208
- }
209
- }
210
- });
211
-
212
- var oVBox = new VBox();
213
- oVBox.addItem(oFieldName);
214
- oVBox.addItem(oFieldName2);
96
+ oDialog.addStyleClass(Utils.getRtaStyleClassName());
215
97
 
216
- // List
217
- var oSorter = new Sorter("label", this._bAscendingSortOrder);
218
- this._oList = new List(
219
- {
220
- mode: "MultiSelect",
221
- includeItemInSelection: true,
222
- growing: true,
223
- growingScrollToLoad: true
224
- }).setNoDataText(this._oTextResources.getText("MSG_NO_FIELDS", this._oTextResources.getText("MULTIPLE_CONTROL_NAME").toLowerCase()));
98
+ this._oDialogModel.setProperty("/listNoDataText", oRTAResourceModel.getProperty("MSG_NO_FIELDS").toLowerCase());
225
99
 
226
- var oListItem = new ListItem({
227
- type: ListType.Active,
228
- selected: "{selected}",
229
- tooltip: "{tooltip}",
230
- content: [oVBox]
231
- }).addStyleClass("sapUIRtaListItem");
100
+ //retrieve List to set the sorting for the 'items' aggregation, since sap.ui.model.Sorter
101
+ //does not support binding to a model property...
102
+ this._oList = sap.ui.getCore().byId(this.getId() + "--rta_addElementsDialogList");
103
+ this._bDescendingSortOrder = false;
104
+ }.bind(this));
105
+ };
232
106
 
233
- this._oList.bindItems({
234
- path: "/elements",
235
- template: oListItem,
236
- sorter: oSorter,
237
- templateShareable: false,
238
- //Extended Change Detection via "key" property see docs: #/topic/7cdff73f308b4b10bdf7d83b7aba72e7 -
239
- key: function (oContext) {
240
- switch (oContext.getProperty("type")) {
241
- case "invisible":
242
- return oContext.getProperty("elementId");
243
- case "odata":
244
- return oContext.getProperty("name");
245
- case "delegate":
246
- return oContext.getProperty("name");
247
- case "custom":
248
- return oContext.getProperty("key");
249
- default:
250
- Log.error("sap.ui.rta.plugin.additionalElements.AddElementsDialog#_createContent: unsupported data type");
251
- }
252
- }
107
+ AddElementsDialog.prototype.exit = function() {
108
+ this._oDialogPromise.then(function(oDialog) {
109
+ oDialog.destroy();
253
110
  });
254
111
 
255
- // Scrollcontainer containing the List
256
- // Needed for scrolling the List
257
- var oScrollContainer = new ScrollContainer({
258
- content: this._oList,
259
- vertical: true,
260
- horizontal: false
261
- }).addStyleClass("sapUIRtaCCDialogScrollContainer");
262
-
263
- return [this.oInputFields,
264
- this._oBCContainer,
265
- oScrollContainer];
112
+ if (ManagedObject.prototype.exit) {
113
+ ManagedObject.prototype.exit.apply(this, arguments);
114
+ }
266
115
  };
267
116
 
268
- /**
269
- * Create the Buttons of the Dialog (OK/Cancel)
270
- *
271
- * @returns {object} list containes ok button and cancel button objects
272
- * @private
273
- */
274
- AddElementsDialog.prototype._createButtons = function() {
275
- this._oOKButton = new Button({
276
- text: this._oTextResources.getText("BTN_FREP_OK"),
277
- press: [this._submitDialog, this],
278
- type: ButtonType.Emphasized
279
- });
280
- var oCancelButton = new Button({
281
- text: this._oTextResources.getText("BTN_FREP_CANCEL"),
282
- press: [this._cancelDialog, this]
283
- });
284
- return [this._oOKButton, oCancelButton];
117
+ AddElementsDialog.prototype.setCustomFieldButtonVisible = function(bVisible) {
118
+ this._oDialogModel.setProperty("/customFieldVisible", bVisible);
285
119
  };
286
120
 
287
121
  /**
288
122
  * Close the dialog.
123
+ * @returns {Promise} a Promise that resolves (to nothing) once the dialog is loaded and closed
289
124
  */
290
125
  AddElementsDialog.prototype._submitDialog = function() {
291
- this._oDialog.close();
292
- this._fnResolve();
126
+ return this._oDialogPromise.then(function(oDialog) {
127
+ oDialog.close();
128
+ this._fnResolveOnDialogConfirm();
129
+ }.bind(this));
130
+ //indicate that the dialog has been closed and the selected fields (if any) are to be added to the UI
293
131
  };
294
132
 
295
133
  /**
296
- * Close dialog and revert all change operations
134
+ * Close dialog. All sections will be reverted
297
135
  */
298
136
  AddElementsDialog.prototype._cancelDialog = function() {
299
- // clear all variables
300
- this._oList.removeSelections();
301
- this._oDialog.close();
302
- this._fnReject();
137
+ //clear all selections
138
+ this._oDialogModel.getObject("/elements").forEach(function(oElem) {
139
+ oElem.selected = false;
140
+ });
141
+ this._oDialogPromise.then(function(oDialog) {
142
+ oDialog.close();
143
+ });
144
+ //indicate that the dialog has been closed without choosing to add any fields (canceled)
145
+ this._fnRejectOnDialogCancel();
303
146
  };
304
147
 
305
148
  AddElementsDialog.prototype.setElements = function(aElements) {
306
- this._oDialog.getModel().setProperty("/elements", aElements);
149
+ this._oDialogModel.setProperty("/elements", aElements);
307
150
  };
308
151
 
309
152
  AddElementsDialog.prototype.getElements = function() {
310
- return this._oDialog.getModel().getProperty("/elements");
153
+ return this._oDialogModel.getProperty("/elements");
311
154
  };
312
155
 
313
156
  AddElementsDialog.prototype.getSelectedElements = function() {
314
- return this._oDialog.getModel().getObject("/elements").filter(function(oElement) {
157
+ return this._oDialogModel.getObject("/elements").filter(function(oElement) {
315
158
  return oElement.selected;
316
159
  });
317
160
  };
@@ -319,34 +162,33 @@ sap.ui.define([
319
162
  /**
320
163
  * Open the Field Repository Dialog
321
164
  *
322
- * @param {sap.ui.core.Control} oControl Currently selected control
323
- * @returns {Promise} empty promise
165
+ * @returns {Promise} promise that resolves once the Fragment is loaded and the dialog is opened
324
166
  * @public
325
167
  */
326
- AddElementsDialog.prototype.open = function () {
327
- return new Promise(function (resolve, reject) {
328
- this._fnResolve = resolve;
329
- this._fnReject = reject;
330
- this._oDialog.attachAfterOpen(function () {
331
- this.fireOpened();
168
+ AddElementsDialog.prototype.open = function() {
169
+ return new Promise(function(resolve, reject) {
170
+ this._fnResolveOnDialogConfirm = resolve;
171
+ this._fnRejectOnDialogCancel = reject;
172
+
173
+ this._oDialogPromise.then(function(oDialog) {
174
+ oDialog.attachAfterOpen(function() {
175
+ this.fireOpened();
176
+ }.bind(this));
177
+ oDialog.open();
332
178
  }.bind(this));
333
- // Makes sure the modal div element does not change the size of our application (which would result in
334
- // recalculation of our overlays)
335
- this._oDialog.open();
336
179
  }.bind(this));
337
180
  };
338
181
 
339
182
  /**
340
183
  * Resort the list
341
184
  *
342
- * @param {sap.ui.base.Event} oEvent event object
343
185
  * @private
344
186
  */
345
187
  AddElementsDialog.prototype._resortList = function () {
346
- this._bAscendingSortOrder = !this._bAscendingSortOrder;
188
+ this._bDescendingSortOrder = !this._bDescendingSortOrder;
347
189
  var oBinding = this._oList.getBinding("items");
348
190
  var aSorter = [];
349
- aSorter.push(new Sorter("label", this._bAscendingSortOrder));
191
+ aSorter.push(new Sorter("label", this._bDescendingSortOrder));
350
192
  oBinding.sort(aSorter);
351
193
  };
352
194
 
@@ -375,28 +217,31 @@ sap.ui.define([
375
217
  /**
376
218
  * Fire an event to redirect to custom field creation
377
219
  *
378
- * @param {sap.ui.base.Event} oEvent event object
379
220
  * @private
380
221
  */
381
222
  AddElementsDialog.prototype._redirectToCustomFieldCreation = function () {
382
223
  this.fireOpenCustomField();
383
- this._oDialog.close();
224
+ this._oDialogPromise.then(function(oDialog) {
225
+ oDialog.close();
226
+ });
384
227
  };
385
228
 
386
229
  AddElementsDialog.prototype.setTitle = function(sTitle) {
387
230
  ManagedObject.prototype.setProperty.call(this, "title", sTitle, true);
388
- this._oDialog.setTitle(sTitle);
231
+ this._oDialogPromise.then(function(oDialog) {
232
+ oDialog.setTitle(sTitle);
233
+ });
389
234
  };
390
235
 
391
236
  /**
392
237
  * Enables the Custom Field Creation button
393
238
  *
394
- * @param {boolean} bCustomFieldEnabled true shows the button, false not
239
+ * @param {boolean} bCustomFieldEnabled field extensibility button is enabled if true, else disabled
395
240
  * @public
396
241
  */
397
242
  AddElementsDialog.prototype.setCustomFieldEnabled = function(bCustomFieldEnabled) {
398
243
  this.setProperty("customFieldEnabled", bCustomFieldEnabled, true);
399
- this._oCustomFieldButton.setEnabled(this.getProperty("customFieldEnabled"));
244
+ this._oDialogModel.setProperty("/customFieldEnabled", this.getProperty("customFieldEnabled"));
400
245
  };
401
246
 
402
247
  /**
@@ -407,46 +252,41 @@ sap.ui.define([
407
252
  */
408
253
  AddElementsDialog.prototype._setBusinessContextVisible = function(bBusinessContextVisible) {
409
254
  this.setProperty("businessContextVisible", bBusinessContextVisible, true);
410
- this._oBCContainer.setVisible(this.getProperty("businessContextVisible"));
411
- };
412
-
413
- /**
414
- * Returns list control
415
- * @returns {sap.m.List}
416
- */
417
- AddElementsDialog.prototype.getList = function () {
418
- return this._oList;
255
+ this._oDialogModel.setProperty("/businessContextVisible", bBusinessContextVisible);
419
256
  };
420
257
 
421
258
  /**
422
259
  * Adds extension data, e.g. business contexts
423
260
  * @param {object[]} aExtensionData - Array containing extension data
261
+ * @returns {Promise<undefined>} A promise resolving to undefined
424
262
  * @public
425
263
  */
426
264
  AddElementsDialog.prototype.addExtensionData = function (aExtensionData) {
427
- // clear old values from last run
265
+ //clear old values from last run
428
266
  this._removeExtensionDataTexts();
429
- // Message "none" when no extension data is available
430
- var oBCDescription = new Text({
431
- text: this._oTextResources.getText("MSG_NO_BUSINESS_CONTEXTS")
432
- });
267
+
268
+ var aBusinessContextTexts = this._oDialogModel.getObject("/businessContextTexts");
433
269
  if (aExtensionData && aExtensionData.length > 0) {
434
270
  aExtensionData.forEach(function (oContext) {
435
- oBCDescription = new Text({
271
+ aBusinessContextTexts.push({
436
272
  text: oContext.description
437
273
  });
438
- this._oBCContainer.addContent(oBCDescription);
439
274
  }, this);
440
275
  } else {
441
- this._oBCContainer.addContent(oBCDescription);
276
+ //Message "none" when no extension data is available
277
+ aBusinessContextTexts.push({
278
+ text: oRTAResourceModel.getProperty("MSG_NO_BUSINESS_CONTEXTS")
279
+ });
442
280
  }
443
- // set the container visible
281
+ //set the container visible
444
282
  this._setBusinessContextVisible(true);
445
283
 
446
284
  return FieldExtensibility.getTexts().then(function(oFieldExtensibilityTexts) {
447
285
  if (oFieldExtensibilityTexts) {
448
- this._oCustomFieldButton.setTooltip(oFieldExtensibilityTexts.tooltip);
449
- this._oBCContainer.getContent()[0].setText(oFieldExtensibilityTexts.headerText);
286
+ this._oDialogModel.setProperty("/customFieldButtonTooltip", oFieldExtensibilityTexts.tooltip);
287
+ //the first entry is always the "header" to be set by the implementation of FieldExtensibility
288
+ //it is set during the instantiation of the model, in the 'init' function
289
+ this._oDialogModel.setProperty("/businessContextTexts/0/text", oFieldExtensibilityTexts.headerText);
450
290
  }
451
291
  }.bind(this));
452
292
  };
@@ -457,12 +297,9 @@ sap.ui.define([
457
297
  * @private
458
298
  */
459
299
  AddElementsDialog.prototype._removeExtensionDataTexts = function () {
460
- var nIndex;
461
- var nElementsCount = this._oBCContainer.getContent().length;
462
- for (nIndex = 0; nIndex < nElementsCount; nIndex++) {
463
- this._oBCContainer.removeContent(1);
464
- }
300
+ var aBusinessContextTexts = this._oDialogModel.getObject("/businessContextTexts");
301
+ aBusinessContextTexts.splice(1);
465
302
  };
466
303
 
467
304
  return AddElementsDialog;
468
- });
305
+ });
@@ -164,7 +164,8 @@ sap.ui.define([
164
164
  bindingPath: oElement.__bindingPath, //used for OPA tests and debugging
165
165
  //command relevant data
166
166
  type: "invisible",
167
- elementId: oElement.getId()
167
+ elementId: oElement.getId(),
168
+ sourceAggregation: mData.sourceAggregation
168
169
  };
169
170
  }
170
171
 
@@ -466,7 +467,8 @@ sap.ui.define([
466
467
  if (bIncludeElement) {
467
468
  aAllElementData.push({
468
469
  element: oInvisibleElement,
469
- action: mRevealAction
470
+ action: mRevealAction,
471
+ sourceAggregation: mInvisibleElement.sourceAggregation
470
472
  });
471
473
  }
472
474
  });