@openui5/sap.ui.rta 1.107.0 → 1.108.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 (147) hide show
  1. package/THIRDPARTY.txt +1 -1
  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 +14 -5
  6. package/src/sap/ui/rta/Utils.js +1 -1
  7. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  8. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  9. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  10. package/src/sap/ui/rta/command/AddXML.js +1 -1
  11. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  12. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  13. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  14. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  15. package/src/sap/ui/rta/command/Combine.js +1 -1
  16. package/src/sap/ui/rta/command/CommandFactory.js +1 -1
  17. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  18. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  19. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  20. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  21. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  22. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  23. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  24. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  25. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  26. package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
  27. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  28. package/src/sap/ui/rta/command/Move.js +1 -1
  29. package/src/sap/ui/rta/command/Property.js +1 -1
  30. package/src/sap/ui/rta/command/Remove.js +1 -1
  31. package/src/sap/ui/rta/command/Rename.js +1 -1
  32. package/src/sap/ui/rta/command/Resize.js +1 -1
  33. package/src/sap/ui/rta/command/Reveal.js +1 -1
  34. package/src/sap/ui/rta/command/Settings.js +1 -1
  35. package/src/sap/ui/rta/command/Split.js +1 -1
  36. package/src/sap/ui/rta/command/Stack.js +1 -1
  37. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  38. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +49 -27
  39. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +10 -1
  40. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  41. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +8 -4
  42. package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
  43. package/src/sap/ui/rta/library.js +2 -2
  44. package/src/sap/ui/rta/messagebundle.properties +20 -10
  45. package/src/sap/ui/rta/messagebundle_ar.properties +6 -1
  46. package/src/sap/ui/rta/messagebundle_bg.properties +14 -9
  47. package/src/sap/ui/rta/messagebundle_ca.properties +6 -1
  48. package/src/sap/ui/rta/messagebundle_cs.properties +6 -1
  49. package/src/sap/ui/rta/messagebundle_cy.properties +6 -1
  50. package/src/sap/ui/rta/messagebundle_da.properties +6 -1
  51. package/src/sap/ui/rta/messagebundle_de.properties +6 -1
  52. package/src/sap/ui/rta/messagebundle_el.properties +6 -1
  53. package/src/sap/ui/rta/messagebundle_en.properties +6 -1
  54. package/src/sap/ui/rta/messagebundle_en_GB.properties +6 -1
  55. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +6 -1
  56. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +6 -1
  57. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
  58. package/src/sap/ui/rta/messagebundle_es.properties +6 -1
  59. package/src/sap/ui/rta/messagebundle_es_MX.properties +6 -1
  60. package/src/sap/ui/rta/messagebundle_et.properties +6 -1
  61. package/src/sap/ui/rta/messagebundle_fi.properties +6 -1
  62. package/src/sap/ui/rta/messagebundle_fr.properties +6 -1
  63. package/src/sap/ui/rta/messagebundle_fr_CA.properties +7 -2
  64. package/src/sap/ui/rta/messagebundle_hi.properties +6 -1
  65. package/src/sap/ui/rta/messagebundle_hr.properties +6 -1
  66. package/src/sap/ui/rta/messagebundle_hu.properties +6 -1
  67. package/src/sap/ui/rta/messagebundle_id.properties +6 -1
  68. package/src/sap/ui/rta/messagebundle_it.properties +6 -1
  69. package/src/sap/ui/rta/messagebundle_iw.properties +6 -1
  70. package/src/sap/ui/rta/messagebundle_ja.properties +6 -1
  71. package/src/sap/ui/rta/messagebundle_kk.properties +6 -1
  72. package/src/sap/ui/rta/messagebundle_ko.properties +6 -1
  73. package/src/sap/ui/rta/messagebundle_lt.properties +6 -1
  74. package/src/sap/ui/rta/messagebundle_lv.properties +6 -1
  75. package/src/sap/ui/rta/messagebundle_ms.properties +6 -1
  76. package/src/sap/ui/rta/messagebundle_nl.properties +6 -1
  77. package/src/sap/ui/rta/messagebundle_no.properties +6 -1
  78. package/src/sap/ui/rta/messagebundle_pl.properties +6 -1
  79. package/src/sap/ui/rta/messagebundle_pt.properties +6 -1
  80. package/src/sap/ui/rta/messagebundle_pt_PT.properties +6 -1
  81. package/src/sap/ui/rta/messagebundle_ro.properties +6 -1
  82. package/src/sap/ui/rta/messagebundle_ru.properties +6 -1
  83. package/src/sap/ui/rta/messagebundle_sh.properties +6 -1
  84. package/src/sap/ui/rta/messagebundle_sk.properties +6 -1
  85. package/src/sap/ui/rta/messagebundle_sl.properties +6 -1
  86. package/src/sap/ui/rta/messagebundle_sv.properties +6 -1
  87. package/src/sap/ui/rta/messagebundle_th.properties +6 -1
  88. package/src/sap/ui/rta/messagebundle_tr.properties +6 -1
  89. package/src/sap/ui/rta/messagebundle_uk.properties +6 -1
  90. package/src/sap/ui/rta/messagebundle_vi.properties +6 -1
  91. package/src/sap/ui/rta/messagebundle_zh_CN.properties +6 -1
  92. package/src/sap/ui/rta/messagebundle_zh_TW.properties +6 -1
  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/CompVariant.js +75 -29
  97. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  98. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  99. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  100. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  101. package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
  102. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  103. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  104. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  105. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  106. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  107. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  108. package/src/sap/ui/rta/plugin/RenameHandler.js +3 -1
  109. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  110. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  111. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  112. package/src/sap/ui/rta/plugin/Split.js +1 -1
  113. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  114. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  115. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  116. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  117. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  118. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
  119. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  120. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +2 -2
  121. package/src/sap/ui/rta/service/Action.js +1 -1
  122. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  123. package/src/sap/ui/rta/service/Outline.js +1 -1
  124. package/src/sap/ui/rta/service/Property.js +1 -1
  125. package/src/sap/ui/rta/service/Selection.js +1 -1
  126. package/src/sap/ui/rta/service/SupportTools.js +1 -1
  127. package/src/sap/ui/rta/toolbar/Adaptation.js +1 -1
  128. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  129. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  130. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  131. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  132. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  133. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  134. package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation.js +7 -8
  135. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  136. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  137. package/src/sap/ui/rta/util/PluginManager.js +2 -2
  138. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  139. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  140. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  141. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
  142. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +16 -0
  143. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +21 -4
  144. package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +28 -0
  145. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +135 -53
  146. package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +39 -0
  147. package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +6 -3
@@ -19,7 +19,7 @@ function(
19
19
  *
20
20
  * @extends sap.ui.core.EventBus
21
21
  * @author SAP SE
22
- * @version 1.107.0
22
+ * @version 1.108.0
23
23
  * @private
24
24
  * @since 1.56.0
25
25
  * @alias sap.ui.rta.util.ServiceEventBus
@@ -40,7 +40,7 @@ sap.ui.define([
40
40
  * @alias sap.ui.rta.util.changeVisualization.ChangeIndicator
41
41
  * @author SAP SE
42
42
  * @since 1.84.0
43
- * @version 1.107.0
43
+ * @version 1.108.0
44
44
  * @private
45
45
  */
46
46
  var ChangeIndicator = Control.extend("sap.ui.rta.util.changeVisualization.ChangeIndicator", {
@@ -5,6 +5,22 @@
5
5
  <Popover
6
6
  showHeader="false"
7
7
  placement="Bottom">
8
+ <SegmentedButton selectedKey="satellite" width="420px" selectionChange=".onVersioningCategoryChange">
9
+ <items>
10
+ <SegmentedButtonItem
11
+ text="{i18n>BUT_CHANGEVISUALIZATION_VERSIONING_ALL}"
12
+ key="all"/>
13
+ <SegmentedButtonItem
14
+ text="{i18n>BUT_CHANGEVISUALIZATION_VERSIONING_DRAFT}"
15
+ key="draft"
16
+ visible="{visualizationModel>/versioningAvailable}"
17
+ enabled="{= ${visualizationModel>/hasDraftChanges} || ${visualizationModel>/hasDirtyChanges}}"/>
18
+ <SegmentedButtonItem
19
+ text="{i18n>BUT_CHANGEVISUALIZATION_VERSIONING_DIRTY}"
20
+ key="dirty"
21
+ enabled="{visualizationModel>/hasDirtyChanges}"/>
22
+ </items>
23
+ </SegmentedButton>
8
24
  <MessageStrip
9
25
  text="{visualizationModel>/popupInfoMessage}"
10
26
  type="Information"
@@ -14,7 +14,8 @@ sap.ui.define([
14
14
  "sap/ui/dt/ElementUtil",
15
15
  "sap/ui/fl/write/api/ChangesWriteAPI",
16
16
  "sap/ui/fl/Utils",
17
- "sap/ui/fl/changeHandler/common/ChangeCategories"
17
+ "sap/ui/fl/changeHandler/common/ChangeCategories",
18
+ "sap/ui/rta/util/changeVisualization/ChangeStates"
18
19
  ], function(
19
20
  includes,
20
21
  values,
@@ -25,7 +26,8 @@ sap.ui.define([
25
26
  ElementUtil,
26
27
  ChangesWriteAPI,
27
28
  FlUtils,
28
- ChangeCategories
29
+ ChangeCategories,
30
+ ChangeStates
29
31
  ) {
30
32
  "use strict";
31
33
 
@@ -37,7 +39,7 @@ sap.ui.define([
37
39
  * @alias sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry
38
40
  * @author SAP SE
39
41
  * @since 1.86.0
40
- * @version 1.107.0
42
+ * @version 1.108.0
41
43
  * @private
42
44
  */
43
45
  var ChangeIndicatorRegistry = ManagedObject.extend("sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry", {
@@ -167,9 +169,10 @@ sap.ui.define([
167
169
  *
168
170
  * @param {object} oChange - The change to register
169
171
  * @param {string} sCommandName - Command name of the change
172
+ * @param {string} oVersionsModel - Model with versioning data
170
173
  * @returns {Promise<undefined>} Resolves as soon as the change is registered
171
174
  */
172
- ChangeIndicatorRegistry.prototype.registerChange = function(oChange, sCommandName) {
175
+ ChangeIndicatorRegistry.prototype.registerChange = function(oChange, sCommandName, oVersionsModel) {
173
176
  var oAppComponent = FlUtils.getAppComponentForControl(ElementUtil.getElementInstance(this.getRootControlId()));
174
177
  return getVisualizationInfo(oChange, oAppComponent).then(function(mChangeVisualizationInfo) {
175
178
  var aCategories = this.getChangeCategories();
@@ -185,11 +188,25 @@ sap.ui.define([
185
188
  sChangeCategory = ChangeCategories.OTHER;
186
189
  }
187
190
  }
191
+ var aChangeStates;
192
+ var aDraftChangesList = [];
193
+ if (oVersionsModel) {
194
+ aDraftChangesList = oVersionsModel.getData().draftFilenames;
195
+ }
196
+
197
+ if (oChange.getState() === "NEW") {
198
+ aChangeStates = [ChangeStates.DIRTY, ChangeStates.DRAFT];
199
+ } else if (aDraftChangesList && aDraftChangesList.includes(oChange.getFileName())) {
200
+ aChangeStates = [ChangeStates.DRAFT];
201
+ } else {
202
+ aChangeStates = [ChangeStates.ACTIVATED];
203
+ }
188
204
 
189
205
  this._oRegisteredChanges[oChange.getId()] = {
190
206
  change: oChange,
191
207
  commandName: sCommandName,
192
208
  changeCategory: sChangeCategory,
209
+ changeStates: aChangeStates,
193
210
  visualizationInfo: mChangeVisualizationInfo
194
211
  };
195
212
  }.bind(this));
@@ -0,0 +1,28 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ ], function(
9
+ ) {
10
+ "use strict";
11
+
12
+ var ChangeStates = {};
13
+
14
+ ChangeStates.ACTIVATED = "activated";
15
+ ChangeStates.DRAFT = "draft";
16
+ ChangeStates.DIRTY = "dirty";
17
+
18
+ /**
19
+ * Builds an array with the combined State of Draft and Dirty
20
+ *
21
+ * @returns {array} Array of change states.
22
+ */
23
+ ChangeStates.getDraftState = function() {
24
+ return [this.DRAFT, this.DIRTY];
25
+ };
26
+
27
+ return ChangeStates;
28
+ });
@@ -19,7 +19,8 @@ sap.ui.define([
19
19
  "sap/ui/model/json/JSONModel",
20
20
  "sap/ui/rta/util/changeVisualization/ChangeIndicator",
21
21
  "sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry",
22
- "sap/ui/rta/util/changeVisualization/ChangeCategories"
22
+ "sap/ui/rta/util/changeVisualization/ChangeCategories",
23
+ "sap/ui/rta/util/changeVisualization/ChangeStates"
23
24
  ], function(
24
25
  Fragment,
25
26
  difference,
@@ -35,7 +36,8 @@ sap.ui.define([
35
36
  JSONModel,
36
37
  ChangeIndicator,
37
38
  ChangeIndicatorRegistry,
38
- ChangeCategories
39
+ ChangeCategories,
40
+ ChangeStates
39
41
  ) {
40
42
  "use strict";
41
43
 
@@ -57,7 +59,7 @@ sap.ui.define([
57
59
  * @alias sap.ui.rta.util.changeVisualization.ChangeVisualization
58
60
  * @author SAP SE
59
61
  * @since 1.84.0
60
- * @version 1.107.0
62
+ * @version 1.108.0
61
63
  * @private
62
64
  */
63
65
  var ChangeVisualization = Control.extend("sap.ui.rta.util.changeVisualization.ChangeVisualization", {
@@ -109,6 +111,10 @@ sap.ui.define([
109
111
  }
110
112
  });
111
113
 
114
+ ChangeVisualization.prototype.setVersionsModel = function(oToolbar) {
115
+ this.oVersionsModel = oToolbar.getModel("versions");
116
+ };
117
+
112
118
  ChangeVisualization.prototype.setRootControlId = function(sRootControlId) {
113
119
  if (this.getRootControlId() && this.getRootControlId() !== sRootControlId) {
114
120
  this._reset();
@@ -144,16 +150,24 @@ sap.ui.define([
144
150
  };
145
151
 
146
152
  ChangeVisualization.prototype._updateVisualizationModelMenuData = function() {
147
- var aVisualizedChanges = this._oChangeVisualizationModel.getData().visualizedChanges;
148
- var aHiddenChanges = [];
149
153
  var aAllRegisteredChanges = this._oChangeIndicatorRegistry.getAllRegisteredChanges();
150
- aAllRegisteredChanges.forEach(function(oRegisteredChange) {
151
- var oVisualizedChange = aVisualizedChanges.find(function(oVisualizedChange) {
152
- return oRegisteredChange.change.getId() === oVisualizedChange.id;
153
- });
154
- if (!oVisualizedChange && !oRegisteredChange.dependent) {
155
- aHiddenChanges.push(oRegisteredChange);
154
+ var aHiddenChanges = this._oChangeVisualizationModel.getData().hiddenChanges;
155
+ var aHiddenChangeIds = aHiddenChanges.map(function(oHiddenChange) {
156
+ return oHiddenChange.id;
157
+ });
158
+ var sVisualizedChangeState = this._oChangeVisualizationModel.getData().changeState;
159
+ var aHiddenChangesPerChangeState = aHiddenChanges.filter(function (oHiddenChange) {
160
+ if (!sVisualizedChangeState || sVisualizedChangeState === "all") {
161
+ return true;
156
162
  }
163
+ return oHiddenChange.changeStates.includes(sVisualizedChangeState);
164
+ });
165
+ var aVisualizedChanges = aAllRegisteredChanges.filter(function (oChange) {
166
+ var bIsChangeVisible = !aHiddenChangeIds.includes(oChange.change.getId());
167
+ if (!sVisualizedChangeState || sVisualizedChangeState === "all") {
168
+ return bIsChangeVisible;
169
+ }
170
+ return bIsChangeVisible && oChange.changeStates.includes(sVisualizedChangeState);
157
171
  });
158
172
  var aCommandData = Object.keys(ChangeCategories.getCategories()).map(function(sChangeCategoryName) {
159
173
  var sTitle = this._getChangeCategoryLabel(
@@ -177,10 +191,11 @@ sap.ui.define([
177
191
 
178
192
  this._updateVisualizationModel({
179
193
  changeCategories: aCommandData,
180
- hiddenChanges: aHiddenChanges,
194
+ hasDraftChanges: this._oChangeVisualizationModel.getData().draftChanges.length > 0,
195
+ hasDirtyChanges: this._oChangeVisualizationModel.getData().dirtyChanges.length > 0,
181
196
  popupInfoMessage: this._oTextBundle.getText(
182
197
  "MSG_CHANGEVISUALIZATION_HIDDEN_CHANGES_INFO",
183
- [aHiddenChanges.length]
198
+ [aHiddenChangesPerChangeState.length]
184
199
  )
185
200
  });
186
201
  };
@@ -221,6 +236,12 @@ sap.ui.define([
221
236
  oPopover.setModel(this._oChangeVisualizationModel, "visualizationModel");
222
237
  oPopover.openBy(this._oToolbarButton);
223
238
  this.setPopover(oPopover);
239
+ //Currently required because of an binding issue from the control
240
+ //At the first opening of the popover the controls don't get updated when the bound
241
+ //model changes. With the reopening this Problem gets fixed
242
+ //TODO Remove once control owners have fixed the issue
243
+ oPopover.close();
244
+ oPopover.openBy(this._oToolbarButton);
224
245
  }.bind(this));
225
246
  return;
226
247
  }
@@ -242,6 +263,11 @@ sap.ui.define([
242
263
  this._selectChangeCategory(sSelectedChangeCategory);
243
264
  };
244
265
 
266
+ ChangeVisualization.prototype.onVersioningCategoryChange = function(oEvent) {
267
+ var sSelectedChangeState = oEvent.getSource().getSelectedKey();
268
+ this._selectChangeState(sSelectedChangeState);
269
+ };
270
+
245
271
  ChangeVisualization.prototype._selectChangeCategory = function(sSelectedChangeCategory) {
246
272
  this._sSelectedChangeCategory = sSelectedChangeCategory;
247
273
 
@@ -256,6 +282,17 @@ sap.ui.define([
256
282
  this._setFocusedIndicator();
257
283
  };
258
284
 
285
+ ChangeVisualization.prototype._selectChangeState = function(sSelectedChangeState) {
286
+ this._sSelectedChangeState = sSelectedChangeState;
287
+
288
+ this._updateVisualizationModel({
289
+ changeState: sSelectedChangeState
290
+ });
291
+
292
+ this._updateChangeIndicators();
293
+ this._updateVisualizationModelMenuData();
294
+ };
295
+
259
296
  ChangeVisualization.prototype._getCommandForChange = function(oChange) {
260
297
  var sCommand = oChange.getSupportInformation().command;
261
298
  if (sCommand) {
@@ -339,7 +376,7 @@ sap.ui.define([
339
376
  difference(aCurrentChangeIds, aRegisteredChangeIds).forEach(function(sChangeIdToAdd) {
340
377
  var oChangeToAdd = oCurrentChanges[sChangeIdToAdd];
341
378
  var sCommandName = this._getCommandForChange(oChangeToAdd);
342
- aPromises.push(this._oChangeIndicatorRegistry.registerChange(oChangeToAdd, sCommandName));
379
+ aPromises.push(this._oChangeIndicatorRegistry.registerChange(oChangeToAdd, sCommandName, this.oVersionsModel));
343
380
  }.bind(this));
344
381
  return Promise.all(aPromises);
345
382
  }.bind(this));
@@ -376,47 +413,70 @@ sap.ui.define([
376
413
  var oSelectors = this._oChangeIndicatorRegistry.getSelectorsWithRegisteredChanges();
377
414
  var oIndicators = {};
378
415
  var aVisualizedChanges = [];
379
- Object.keys(oSelectors)
380
- .forEach(function(sSelectorId) {
381
- var aRelevantChanges = this._filterRelevantChanges(oSelectors[sSelectorId]);
382
- var oOverlay = OverlayRegistry.getOverlay(sSelectorId);
383
- if (!oOverlay) {
384
- // When the selector has no Overlay, check if there is a relevant container Overlay
385
- // e.g. when a SmartForm group is removed
386
- aRelevantChanges.some(function(oChange) {
387
- var oElementOverlay = OverlayRegistry.getOverlay(oChange.affectedElementId);
388
- var oRelevantContainer = oElementOverlay && oElementOverlay.getRelevantContainer();
389
- if (oRelevantContainer) {
390
- oOverlay = OverlayRegistry.getOverlay(oRelevantContainer);
391
- return true;
392
- }
393
- return false;
394
- });
395
- }
396
- if (!oOverlay || !oOverlay.getDomRef() || !oOverlay.isVisible()) {
397
- // Change is not visible
398
- return undefined;
416
+ var aActivatedChanges = [];
417
+ var aDraftChanges = [];
418
+ var aDirtyChanges = [];
419
+ var aHiddenChanges = [];
420
+ Object.keys(oSelectors).forEach(function(sSelectorId) {
421
+ oSelectors[sSelectorId].forEach(function (oChange) {
422
+ if (!oChange.dependent) {
423
+ if (oChange.changeStates.includes(ChangeStates.ACTIVATED)) {
424
+ aActivatedChanges.push(oChange.id);
425
+ } else if (oChange.changeStates.includes(ChangeStates.DIRTY)) {
426
+ aDirtyChanges.push(oChange.id);
427
+ } else if (oChange.changeStates.includes(ChangeStates.DRAFT)) {
428
+ aDraftChanges.push(oChange.id);
429
+ }
399
430
  }
400
- var oOverlayPosition = oOverlay.getDomRef().getClientRects()[0] || { left: 0, top: 0 };
401
- aRelevantChanges.forEach(function (oChange) {
402
- aVisualizedChanges.push(oChange);
431
+ });
432
+ var aChangesOnIndicator = oSelectors[sSelectorId];
433
+ var aRelevantChanges = this._filterRelevantChanges(oSelectors[sSelectorId]);
434
+ var oOverlay = OverlayRegistry.getOverlay(sSelectorId);
435
+ if (!oOverlay) {
436
+ // When the selector has no Overlay, check if there is a relevant container Overlay
437
+ // e.g. when a SmartForm group is removed
438
+ aChangesOnIndicator.some(function(oChange) {
439
+ var oElementOverlay = OverlayRegistry.getOverlay(oChange.affectedElementId);
440
+ var oRelevantContainer = oElementOverlay && oElementOverlay.getRelevantContainer();
441
+ if (oRelevantContainer) {
442
+ oOverlay = OverlayRegistry.getOverlay(oRelevantContainer);
443
+ return true;
444
+ }
445
+ return false;
446
+ });
447
+ }
448
+ if (!oOverlay || !oOverlay.getDomRef() || !oOverlay.isVisible()) {
449
+ // Change is not visible
450
+ aChangesOnIndicator.forEach(function (oChange) {
451
+ var aHiddenChangeIds = aHiddenChanges.map(function(oHiddenChange) {
452
+ return oHiddenChange.id;
453
+ });
454
+ if (!aHiddenChangeIds.includes(oChange.id)) {
455
+ aHiddenChanges.push(oChange);
456
+ }
403
457
  });
404
- oIndicators[sSelectorId] = {
405
- posX: parseInt(oOverlayPosition.left),
406
- posY: parseInt(oOverlayPosition.top),
407
- changes: aRelevantChanges
408
- };
409
-
410
- var oChangeIndicator = this._oChangeIndicatorRegistry.getChangeIndicator(sSelectorId);
411
- var sOverlayId = oOverlay.getId();
412
- if (!oChangeIndicator) {
413
- this._createChangeIndicator(oOverlay, sSelectorId);
414
- } else if (oChangeIndicator.getOverlayId() !== sOverlayId) {
415
- // Overlay id might change, e.g. during undo/redo of dirty changes
416
- oChangeIndicator.setOverlayId(sOverlayId);
417
- }
418
458
  return undefined;
419
- }.bind(this));
459
+ }
460
+ var oOverlayPosition = oOverlay.getDomRef().getClientRects()[0] || { left: 0, top: 0 };
461
+ aRelevantChanges.forEach(function (oChange) {
462
+ aVisualizedChanges.push(oChange);
463
+ });
464
+ oIndicators[sSelectorId] = {
465
+ posX: parseInt(oOverlayPosition.left),
466
+ posY: parseInt(oOverlayPosition.top),
467
+ changes: aRelevantChanges
468
+ };
469
+
470
+ var oChangeIndicator = this._oChangeIndicatorRegistry.getChangeIndicator(sSelectorId);
471
+ var sOverlayId = oOverlay.getId();
472
+ if (!oChangeIndicator) {
473
+ this._createChangeIndicator(oOverlay, sSelectorId);
474
+ } else if (oChangeIndicator.getOverlayId() !== sOverlayId) {
475
+ // Overlay id might change, e.g. during undo/redo of dirty changes
476
+ oChangeIndicator.setOverlayId(sOverlayId);
477
+ }
478
+ return undefined;
479
+ }.bind(this));
420
480
 
421
481
  if (
422
482
  !deepEqual(
@@ -425,11 +485,18 @@ sap.ui.define([
425
485
  ) || !deepEqual(
426
486
  aVisualizedChanges,
427
487
  this._oChangeVisualizationModel.getData().visualizedChanges
488
+ ) || !deepEqual(
489
+ aHiddenChanges,
490
+ this._oChangeVisualizationModel.getData().hiddenChanges
428
491
  )
429
492
  ) {
430
493
  this._updateVisualizationModel({
431
494
  content: oIndicators,
432
- visualizedChanges: aVisualizedChanges
495
+ visualizedChanges: aVisualizedChanges,
496
+ dirtyChanges: aDirtyChanges,
497
+ activatedChanges: aActivatedChanges,
498
+ draftChanges: aDraftChanges,
499
+ hiddenChanges: aHiddenChanges
433
500
  });
434
501
  }
435
502
  };
@@ -448,6 +515,11 @@ sap.ui.define([
448
515
  oRootData.changeCategory === ChangeCategories.ALL
449
516
  || oRootData.changeCategory === oChangeVizInfo.changeCategory
450
517
  )
518
+ && (
519
+ !oRootData.changeState
520
+ || oRootData.changeState === "all"
521
+ || oChangeVizInfo.changeStates.includes(oRootData.changeState)
522
+ )
451
523
  );
452
524
  });
453
525
  };
@@ -522,6 +594,16 @@ sap.ui.define([
522
594
  ChangeVisualization.prototype.triggerModeChange = function(oRootControl, oToolbar) {
523
595
  this.oMenuButton = oToolbar.getControl("toggleChangeVisualizationMenuButton");
524
596
  this.oRootOverlay = OverlayRegistry.getOverlay(oRootControl);
597
+ if (oToolbar.getModel("versions")) {
598
+ this.setVersionsModel(oToolbar);
599
+ this._updateVisualizationModel({
600
+ versioningAvailable: this.oVersionsModel.getData().versioningEnabled
601
+ });
602
+ } else {
603
+ this._updateVisualizationModel({
604
+ versioningAvailable: false
605
+ });
606
+ }
525
607
 
526
608
  if (this.getIsActive()) {
527
609
  this.setIsActive(false);
@@ -0,0 +1,39 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ "sap/ui/core/Core",
9
+ "sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils"
10
+ ], function(
11
+ Core,
12
+ ChangeVisualizationUtils
13
+ ) {
14
+ "use strict";
15
+
16
+ var CreateContainerVisualization = {};
17
+
18
+ /**
19
+ * Creates a localized description for create container, based on the provided
20
+ * payload containing the original label.
21
+ *
22
+ * @param {object} mPayload - Change visualization description payload from the change handler
23
+ * @param {string} mPayload.originalLabel - Original element label from create container change
24
+ * @param {string} sLabel - Current element label
25
+ * @returns {object} Map containing localized description text and tooltip
26
+ */
27
+ CreateContainerVisualization.getDescription = function (mPayload, sLabel) {
28
+ var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
29
+ var sElementLabel = mPayload.originalLabel || sLabel;
30
+ var sShortenedElementLabel = ChangeVisualizationUtils.shortenString(sElementLabel);
31
+ var sTextKey = "TXT_CHANGEVISUALIZATION_CHANGE_CREATECONTAINER";
32
+ return {
33
+ descriptionText: oRtaResourceBundle.getText(sTextKey, sShortenedElementLabel),
34
+ descriptionTooltip: oRtaResourceBundle.getText(sTextKey, sElementLabel)
35
+ };
36
+ };
37
+
38
+ return CreateContainerVisualization;
39
+ });
@@ -8,12 +8,14 @@ sap.ui.define([
8
8
  "sap/ui/rta/util/changeVisualization/commands/RenameVisualization",
9
9
  "sap/ui/rta/util/changeVisualization/commands/MoveVisualization",
10
10
  "sap/ui/rta/util/changeVisualization/commands/CombineVisualization",
11
- "sap/ui/rta/util/changeVisualization/commands/SplitVisualization"
11
+ "sap/ui/rta/util/changeVisualization/commands/SplitVisualization",
12
+ "sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization"
12
13
  ], function(
13
14
  RenameVisualization,
14
15
  MoveVisualization,
15
16
  CombineVisualization,
16
- SplitVisualization
17
+ SplitVisualization,
18
+ CreateContainerVisualization
17
19
  ) {
18
20
  "use strict";
19
21
 
@@ -21,7 +23,8 @@ sap.ui.define([
21
23
  rename: RenameVisualization,
22
24
  move: MoveVisualization,
23
25
  combine: CombineVisualization,
24
- split: SplitVisualization
26
+ split: SplitVisualization,
27
+ createContainer: CreateContainerVisualization
25
28
  };
26
29
 
27
30
  return function(mIndicatorInformation) {