@openui5/sap.ui.rta 1.113.0 → 1.115.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 (154) hide show
  1. package/.reuse/dep5 +0 -5
  2. package/THIRDPARTY.txt +1 -7
  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 +156 -54
  7. package/src/sap/ui/rta/Utils.js +36 -2
  8. package/src/sap/ui/rta/appVariant/AppVariantManager.js +6 -5
  9. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  10. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  11. package/src/sap/ui/rta/command/AddXML.js +1 -1
  12. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  13. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  14. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  15. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  16. package/src/sap/ui/rta/command/Combine.js +1 -1
  17. package/src/sap/ui/rta/command/CommandFactory.js +1 -1
  18. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  19. package/src/sap/ui/rta/command/ControlVariantConfigure.js +4 -8
  20. package/src/sap/ui/rta/command/ControlVariantSave.js +5 -6
  21. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +7 -10
  22. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -5
  23. package/src/sap/ui/rta/command/ControlVariantSwitch.js +11 -12
  24. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  25. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  26. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  27. package/src/sap/ui/rta/command/LREPSerializer.js +4 -2
  28. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  29. package/src/sap/ui/rta/command/Move.js +1 -1
  30. package/src/sap/ui/rta/command/Property.js +1 -1
  31. package/src/sap/ui/rta/command/Remove.js +1 -1
  32. package/src/sap/ui/rta/command/Rename.js +1 -1
  33. package/src/sap/ui/rta/command/Resize.js +1 -1
  34. package/src/sap/ui/rta/command/Reveal.js +1 -1
  35. package/src/sap/ui/rta/command/Settings.js +1 -1
  36. package/src/sap/ui/rta/command/Split.js +1 -1
  37. package/src/sap/ui/rta/command/Stack.js +1 -1
  38. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  39. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  40. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  41. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  42. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  43. package/src/sap/ui/rta/enablement/elementActionTest.js +93 -76
  44. package/src/sap/ui/rta/library.js +2 -2
  45. package/src/sap/ui/rta/messagebundle.properties +30 -2
  46. package/src/sap/ui/rta/messagebundle_ar.properties +16 -4
  47. package/src/sap/ui/rta/messagebundle_bg.properties +16 -4
  48. package/src/sap/ui/rta/messagebundle_ca.properties +16 -4
  49. package/src/sap/ui/rta/messagebundle_cs.properties +16 -4
  50. package/src/sap/ui/rta/messagebundle_cy.properties +16 -4
  51. package/src/sap/ui/rta/messagebundle_da.properties +16 -4
  52. package/src/sap/ui/rta/messagebundle_de.properties +16 -4
  53. package/src/sap/ui/rta/messagebundle_el.properties +16 -4
  54. package/src/sap/ui/rta/messagebundle_en.properties +14 -2
  55. package/src/sap/ui/rta/messagebundle_en_GB.properties +14 -2
  56. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +14 -2
  57. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +14 -2
  58. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +14 -2
  59. package/src/sap/ui/rta/messagebundle_es.properties +16 -4
  60. package/src/sap/ui/rta/messagebundle_es_MX.properties +16 -4
  61. package/src/sap/ui/rta/messagebundle_et.properties +16 -4
  62. package/src/sap/ui/rta/messagebundle_fi.properties +16 -4
  63. package/src/sap/ui/rta/messagebundle_fr.properties +16 -4
  64. package/src/sap/ui/rta/messagebundle_fr_CA.properties +16 -4
  65. package/src/sap/ui/rta/messagebundle_hi.properties +16 -4
  66. package/src/sap/ui/rta/messagebundle_hr.properties +16 -4
  67. package/src/sap/ui/rta/messagebundle_hu.properties +16 -4
  68. package/src/sap/ui/rta/messagebundle_id.properties +16 -4
  69. package/src/sap/ui/rta/messagebundle_it.properties +16 -4
  70. package/src/sap/ui/rta/messagebundle_iw.properties +16 -4
  71. package/src/sap/ui/rta/messagebundle_ja.properties +33 -21
  72. package/src/sap/ui/rta/messagebundle_kk.properties +16 -4
  73. package/src/sap/ui/rta/messagebundle_ko.properties +20 -8
  74. package/src/sap/ui/rta/messagebundle_lt.properties +16 -4
  75. package/src/sap/ui/rta/messagebundle_lv.properties +16 -4
  76. package/src/sap/ui/rta/messagebundle_ms.properties +20 -8
  77. package/src/sap/ui/rta/messagebundle_nl.properties +16 -4
  78. package/src/sap/ui/rta/messagebundle_no.properties +16 -4
  79. package/src/sap/ui/rta/messagebundle_pl.properties +16 -4
  80. package/src/sap/ui/rta/messagebundle_pt.properties +16 -4
  81. package/src/sap/ui/rta/messagebundle_pt_PT.properties +16 -4
  82. package/src/sap/ui/rta/messagebundle_ro.properties +16 -4
  83. package/src/sap/ui/rta/messagebundle_ru.properties +16 -4
  84. package/src/sap/ui/rta/messagebundle_sh.properties +16 -4
  85. package/src/sap/ui/rta/messagebundle_sk.properties +16 -4
  86. package/src/sap/ui/rta/messagebundle_sl.properties +16 -4
  87. package/src/sap/ui/rta/messagebundle_sv.properties +16 -4
  88. package/src/sap/ui/rta/messagebundle_th.properties +17 -5
  89. package/src/sap/ui/rta/messagebundle_tr.properties +16 -4
  90. package/src/sap/ui/rta/messagebundle_uk.properties +16 -4
  91. package/src/sap/ui/rta/messagebundle_vi.properties +16 -4
  92. package/src/sap/ui/rta/messagebundle_zh_CN.properties +16 -4
  93. package/src/sap/ui/rta/messagebundle_zh_TW.properties +16 -4
  94. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  95. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  96. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  97. package/src/sap/ui/rta/plugin/CompVariant.js +6 -2
  98. package/src/sap/ui/rta/plugin/ControlVariant.js +4 -2
  99. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  100. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  101. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  102. package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
  103. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  104. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  105. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  106. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  107. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  108. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  109. package/src/sap/ui/rta/plugin/RenameHandler.js +1 -1
  110. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  111. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  112. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  113. package/src/sap/ui/rta/plugin/Split.js +1 -1
  114. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  115. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +2 -22
  116. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  117. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  118. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  119. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
  120. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  121. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +17 -13
  122. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +2 -2
  123. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +1 -1
  124. package/src/sap/ui/rta/service/Action.js +1 -1
  125. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  126. package/src/sap/ui/rta/service/Outline.js +4 -1
  127. package/src/sap/ui/rta/service/Property.js +1 -1
  128. package/src/sap/ui/rta/service/Selection.js +1 -1
  129. package/src/sap/ui/rta/service/SupportTools.js +11 -1
  130. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +59 -20
  131. package/src/sap/ui/rta/toolbar/Adaptation.js +115 -14
  132. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  133. package/src/sap/ui/rta/toolbar/FeedbackDialog.fragment.xml +24 -0
  134. package/src/sap/ui/rta/toolbar/Fiori.js +2 -2
  135. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  136. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  137. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  138. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  139. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +60 -36
  140. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +3 -15
  141. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +120 -33
  142. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptationDialog.fragment.xml +12 -10
  143. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  144. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +2 -2
  145. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  146. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  147. package/src/sap/ui/rta/util/ReloadManager.js +32 -21
  148. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  149. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +42 -25
  150. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +1 -1
  151. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +19 -12
  152. package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +1 -1
  153. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +67 -9
  154. package/src/sap/ui/rta/view/RemoveElementDialog.fragment.xml +1 -1
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @extends sap.m.HBox
28
28
  *
29
29
  * @author SAP SE
30
- * @version 1.113.0
30
+ * @version 1.115.0
31
31
  *
32
32
  * @constructor
33
33
  * @private
@@ -0,0 +1,24 @@
1
+ <core:FragmentDefinition
2
+ xmlns:core="sap.ui.core"
3
+ xmlns="sap.m"
4
+ xmlns:util="sap.ui.fl.util">
5
+ <Dialog
6
+ id="sapUiRtaFeedbackIFrameDialog"
7
+ title="{i18n>TIT_FEEDBACK}"
8
+ contentWidth="50rem"
9
+ contentHeight="50rem"
10
+ draggable="true">
11
+ <content>
12
+ <util:IFrame
13
+ id="sapUiRtaFeedbackIFrameDialog_iFrame"
14
+ url="{= ${feedbackModel>/url}}"
15
+ height="46rem"/>
16
+ </content>
17
+ <buttons>
18
+ <Button
19
+ id="sapUiRtaFeedbackIFrameDialog_ButtonClose"
20
+ text="{i18n>BTN_CLOSE_FEEDBACK_DIALOG}"
21
+ press=".closeFeedbackForm"/>
22
+ </buttons>
23
+ </Dialog>
24
+ </core:FragmentDefinition>
@@ -32,7 +32,7 @@ function(
32
32
  * @extends sap.ui.rta.toolbar.Adaptation
33
33
  *
34
34
  * @author SAP SE
35
- * @version 1.113.0
35
+ * @version 1.115.0
36
36
  *
37
37
  * @constructor
38
38
  * @private
@@ -50,7 +50,7 @@ function(
50
50
 
51
51
  Fiori.prototype.init = function () {
52
52
  this._oRenderer = Utils.getFiori2Renderer();
53
- this._oFioriHeader = this._oRenderer.getRootControl().getOUnifiedShell().getHeader();
53
+ this._oFioriHeader = this._oRenderer.getRootControl().getShellHeader();
54
54
  Adaptation.prototype.init.apply(this, arguments);
55
55
  };
56
56
 
@@ -20,7 +20,7 @@ function(
20
20
  * @extends sap.ui.rta.toolbar.Adaptation
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.113.0
23
+ * @version 1.115.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.113.0
26
+ * @version 1.115.0
27
27
  *
28
28
  * @constructor
29
29
  * @private
@@ -22,7 +22,7 @@ function(
22
22
  * @extends sap.ui.rta.toolbar.Base
23
23
  *
24
24
  * @author SAP SE
25
- * @version 1.113.0
25
+ * @version 1.115.0
26
26
  *
27
27
  * @constructor
28
28
  * @private
@@ -20,7 +20,7 @@ function(
20
20
  * @extends sap.ui.rta.toolbar.Adaptation
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.113.0
23
+ * @version 1.115.0
24
24
  *
25
25
  * @constructor
26
26
  * @private
@@ -13,6 +13,7 @@ sap.ui.define([
13
13
  "sap/ui/fl/write/api/ContextBasedAdaptationsAPI",
14
14
  "sap/m/ColumnListItem",
15
15
  "sap/ui/rta/Utils",
16
+ "sap/ui/rta/toolbar/contextBased/SaveAsAdaptation",
16
17
  "sap/ui/model/Filter",
17
18
  "sap/ui/model/FilterOperator",
18
19
  "sap/ui/model/json/JSONModel",
@@ -26,6 +27,7 @@ function(
26
27
  ContextBasedAdaptationsAPI,
27
28
  ColumnListItem,
28
29
  Utils,
30
+ SaveAsAdaptation,
29
31
  Filter,
30
32
  FilterOperator,
31
33
  JSONModel,
@@ -75,6 +77,8 @@ function(
75
77
  moveDown: moveDown.bind(this),
76
78
  onDropSelectedAdaptation: onDropSelectedAdaptation.bind(this),
77
79
  onSaveReorderedAdaptations: onSaveReorderedAdaptations.bind(this),
80
+ isAdaptationsSelected: isAdaptationsSelected.bind(this),
81
+ getIndexOfSelectedAdaptation: getIndexOfSelectedAdaptation.bind(this),
78
82
  onClose: onCloseDialog.bind(this)
79
83
  }
80
84
  }).then(function(oDialog) {
@@ -83,7 +87,7 @@ function(
83
87
  this.getToolbar().addDependent(this._oManageAdaptationDialog);
84
88
  }.bind(this));
85
89
  } else {
86
- setEnabledPropertyOfMoveButton.call(this, false);
90
+ syncEnabledPropertyOfMoveButtons.call(this);
87
91
  enableDragAndDropForAdaptationTable.call(this, true);
88
92
  enableSaveButton.call(this, false);
89
93
  }
@@ -94,11 +98,10 @@ function(
94
98
  }.bind(this)).then(function(oAdaptations) {
95
99
  this.oAdaptationsModel = ContextBasedAdaptationsAPI.getAdaptationsModel({control: this._oRtaInformation.rootControl, layer: this._oRtaInformation.flexSettings.layer});
96
100
  this.oAdaptationsModel.updateAdaptations(oAdaptations.adaptations);
97
- this.oReferenceAdaptationsData = JSON.parse(JSON.stringify(oAdaptations));
101
+ this.oReferenceAdaptationsData = JSON.parse(JSON.stringify(this.oAdaptationsModel.getProperty("/adaptations")));
98
102
  this._oControlConfigurationModel = new JSONModel({isTableItemSelected: false});
99
103
  this._oManageAdaptationDialog.setModel(this.oAdaptationsModel, "contextBased");
100
104
  this._oManageAdaptationDialog.setModel(this._oControlConfigurationModel, "controlConfiguration");
101
- initializeRanks(this.oAdaptationsModel);
102
105
  getAdaptationsTable.call(this).attachSelectionChange(onSelectionChange.bind(this));
103
106
  return this._oManageAdaptationDialog.open();
104
107
  }.bind(this)
@@ -126,26 +129,36 @@ function(
126
129
  var oOptions = {
127
130
  year: "numeric",
128
131
  month: "short",
129
- day: "numeric"
132
+ day: "numeric",
133
+ hour: "numeric",
134
+ minute: "numeric"
130
135
  };
131
136
  var sLanguage = sap.ui.getCore().getConfiguration().getLanguage();
132
- return sModifiedBy + "\n" + oUi5Date.toLocaleDateString(sLanguage, oOptions);
137
+ return sModifiedBy + "\n" + oUi5Date.toLocaleTimeString(sLanguage, oOptions);
133
138
  }
134
139
 
135
140
  function onSelectionChange(oEvent) {
136
141
  if (oEvent.getParameter("selected") === true) {
137
142
  this._oControlConfigurationModel.setProperty("/isTableItemSelected", true);
138
- if (isSearchFieldValueEmpty.call(this)) {
139
- setEnabledPropertyOfMoveButton.call(this, true);
140
- }
143
+ syncEnabledPropertyOfMoveButtons.call(this);
141
144
  }
142
145
  }
143
146
 
144
- function setEnabledPropertyOfMoveButton(bIsEnabled) {
147
+ function syncEnabledPropertyOfMoveButtons() {
145
148
  var oUpButton = getControlInDialog.call(this, "moveUpButton");
146
149
  var oDownButton = getControlInDialog.call(this, "moveDownButton");
147
- oUpButton.setEnabled(bIsEnabled);
148
- oDownButton.setEnabled(bIsEnabled);
150
+ if (isSearchFieldValueEmpty.call(this)) {
151
+ if (isAdaptationsSelected.call(this)) {
152
+ oUpButton.setEnabled(getIndexOfSelectedAdaptation.call(this) > 0);
153
+ oDownButton.setEnabled(getIndexOfSelectedAdaptation.call(this) < this.oAdaptationsModel.getProperty("/count") - 1);
154
+ } else {
155
+ oUpButton.setEnabled(false);
156
+ oDownButton.setEnabled(false);
157
+ }
158
+ } else {
159
+ oUpButton.setEnabled(false);
160
+ oDownButton.setEnabled(false);
161
+ }
149
162
  }
150
163
 
151
164
  // ------ search field ------
@@ -156,7 +169,7 @@ function(
156
169
  var oDefaultApplicationTable = getDefaultApplicationTable.call(this);
157
170
  var sDefaultTableText = getDefaultApplicationTitle.call(this);
158
171
  if (sQuery && sQuery.length > 0) {
159
- setEnabledPropertyOfMoveButton.call(this, false);
172
+ syncEnabledPropertyOfMoveButtons.call(this);
160
173
  enableDragAndDropForAdaptationTable.call(this, false);
161
174
  //filter Table context
162
175
  var oFilterByTitle = new Filter("title", FilterOperator.Contains, sQuery);
@@ -180,7 +193,7 @@ function(
180
193
  } else {
181
194
  enableDragAndDropForAdaptationTable.call(this, true);
182
195
  if (this._oControlConfigurationModel.getProperty("/isTableItemSelected")) {
183
- setEnabledPropertyOfMoveButton.call(this, true);
196
+ syncEnabledPropertyOfMoveButtons.call(this);
184
197
  }
185
198
  oDefaultApplicationTable.setVisible(true);
186
199
  }
@@ -211,14 +224,6 @@ function(
211
224
  oModel.refresh(true);
212
225
  }
213
226
 
214
- function initializeRanks(oModel) {
215
- var aContexts = oModel.getProperty("/adaptations") || [];
216
- aContexts.forEach(function(oContext, iIndex) {
217
- oContext.rank = iIndex + 1;
218
- });
219
- oModel.setProperty("/adaptations", aContexts);
220
- }
221
-
222
227
  function moveSelectedItem(sDirection) {
223
228
  var oTable = getAdaptationsTable.call(this);
224
229
  var oSelectedItem = oTable.getSelectedItem(0);
@@ -241,7 +246,8 @@ function(
241
246
  sortByRank(this.oAdaptationsModel);
242
247
  // after move select the sibling
243
248
  oTable.getItems()[iSiblingItemIndex].setSelected(true).focus();
244
- enableSaveButton.call(this, true);
249
+ enableSaveButton.call(this, didAdaptationsPriorityChange.call(this));
250
+ syncEnabledPropertyOfMoveButtons.call(this);
245
251
  }
246
252
 
247
253
  function onDropSelectedAdaptation(oEvent) {
@@ -279,14 +285,15 @@ function(
279
285
  // set the rank property and update the model to refresh the bindings
280
286
  this.oAdaptationsModel.setProperty("rank", iNewRank, oDraggedItemContext);
281
287
  sortByRank(this.oAdaptationsModel);
282
- initializeRanks(this.oAdaptationsModel);
283
- enableSaveButton.call(this, true);
288
+ var oAllUpdatedAdaptations = Object.assign(this.oAdaptationsModel.getProperty("/allAdaptations"), this.oAdaptationsModel.getProperty("/adaptations"));
289
+ this.oAdaptationsModel.updateAdaptations(oAllUpdatedAdaptations);
290
+ enableSaveButton.call(this, didAdaptationsPriorityChange.call(this));
284
291
  }
285
292
 
286
293
  function didAdaptationsPriorityChange() {
287
294
  return !_isEqual(
288
295
  this.oAdaptationsModel.getProperty("/adaptations").map(function(oAdapation) { return oAdapation.id; }),
289
- this.oReferenceAdaptationsData.adaptations.map(function(oAdapation) { return oAdapation.id; })
296
+ this.oReferenceAdaptationsData.map(function(oAdapation) { return oAdapation.id; })
290
297
  );
291
298
  }
292
299
 
@@ -324,20 +331,37 @@ function(
324
331
  getAdaptationsTable.call(this).getDragDropConfig()[0].setEnabled(bIsEnabled);
325
332
  }
326
333
 
334
+ function isAdaptationsSelected() {
335
+ var oAdaptationsTable = getAdaptationsTable.call(this);
336
+ return oAdaptationsTable.getSelectedContextPaths().length > 0;
337
+ }
338
+
339
+ function getIndexOfSelectedAdaptation() {
340
+ var oAdaptationsTable = getAdaptationsTable.call(this);
341
+ if (oAdaptationsTable.getSelectedContextPaths().length > 0) {
342
+ var aSplitedPath = oAdaptationsTable.getSelectedContextPaths()[0].split("/");
343
+ var iIndexOfSelectedItem = Number(aSplitedPath[aSplitedPath.length - 1]);
344
+ return iIndexOfSelectedItem;
345
+ }
346
+ return -1;
347
+ }
348
+
327
349
  function onSaveReorderedAdaptations() {
328
- if (didAdaptationsPriorityChange.call(this)) {
350
+ Utils.checkDraftOverwrite(this.getModel("versions")).then(function() {
329
351
  var oRtaInformation = this.getToolbar().getRtaInformation();
330
352
  var aAdaptationPriorities = this.oAdaptationsModel.getProperty("/adaptations").map(function(oAdaptation) { return oAdaptation.id; });
331
- ContextBasedAdaptationsAPI.reorder({control: oRtaInformation.rootControl, layer: oRtaInformation.flexSettings.layer, parameters: {priorities: aAdaptationPriorities}})
332
- .catch(function(oError) {
333
- Log.error(oError.stack);
334
- var sMessage = "MSG_LREP_TRANSFER_ERROR";
335
- var oOptions = { titleKey: "BTN_MANAGE_APP_CTX" };
336
- oOptions.details = oError.userMessage;
337
- Utils.showMessageBox("error", sMessage, oOptions);
338
- });
339
- }
340
- onCloseDialog.call(this);
353
+ return ContextBasedAdaptationsAPI.reorder({control: oRtaInformation.rootControl, layer: oRtaInformation.flexSettings.layer, parameters: {priorities: aAdaptationPriorities}});
354
+ }.bind(this)).then(function() {
355
+ var oAllUpdatedAdaptations = Object.assign(this.oAdaptationsModel.getProperty("/allAdaptations"), this.oAdaptationsModel.getProperty("/adaptations"));
356
+ this.oAdaptationsModel.updateAdaptations(oAllUpdatedAdaptations);
357
+ onCloseDialog.call(this);
358
+ }.bind(this))
359
+ .catch(function(oError) {
360
+ if (oError !== "cancel") {
361
+ Utils.showMessageBox("error", "MSG_LREP_TRANSFER_ERROR", { titleKey: "BTN_MANAGE_APP_CTX", error: oError});
362
+ Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
363
+ }
364
+ });
341
365
  }
342
366
 
343
367
  function onCloseDialog() {
@@ -67,6 +67,7 @@
67
67
  hAlign="Left">
68
68
  <Text text="{i18n>CLM_HEADER_ADAPTATIONS_CHANGED_ON}" />
69
69
  </Column>
70
+ <!--
70
71
  <Column width="7rem"
71
72
  minScreenWidth="tablet"
72
73
  demandPopin="true"
@@ -74,6 +75,7 @@
74
75
  hAlign="Left">
75
76
  <Text text="{i18n>CLM_HEADER_ADAPTATIONS_ACTIONS}" />
76
77
  </Column>
78
+ -->
77
79
  </columns>
78
80
  <dragDropConfig>
79
81
  <dnd:DragDropInfo sourceAggregation="items"
@@ -96,13 +98,7 @@
96
98
  <Text text="{ parts: ['contextBased>contexts/role'], formatter: '.formatContextColumnCell'}"
97
99
  tooltip="{ parts: ['contextBased>contexts/role'], formatter: '.formatContextColumnTooltip'}" />
98
100
  <Text text="{ parts: ['contextBased>createdBy', 'contextBased>createdAt'], formatter: '.formatCreatedChangedOnColumnCell'}"/>
99
- <Text text="{ parts: ['contextBased>changedBy', 'contextBased>changedAt'], formatter: '.formatCreatedChangedOnColumnCell'}"/>
100
- <MenuButton text="{i18n>CLM_HEADER_ADAPTATIONS_ACTIONS}">
101
- <menu>
102
- <Menu itemSelected="onMenuAction">
103
- </Menu>
104
- </menu>
105
- </MenuButton>
101
+ <Text text="{ parts: ['contextBased>changedBy', 'contextBased>changedAt'], formatter: '.formatCreatedChangedOnColumnCell'}"/>
106
102
  </cells>
107
103
  </ColumnListItem>
108
104
  </items>
@@ -126,12 +122,6 @@
126
122
  popinDisplay="Inline"
127
123
  hAlign="Left">
128
124
  </Column>
129
- <Column width="7rem"
130
- minScreenWidth="tablet"
131
- demandPopin="true"
132
- popinDisplay="Inline"
133
- hAlign="Left">
134
- </Column>
135
125
  </columns>
136
126
  <items>
137
127
  <ColumnListItem highlight="Information">
@@ -146,8 +136,6 @@
146
136
  </HBox>
147
137
  </CustomListItem>
148
138
  <Text text="" />
149
- <MenuButton text="{i18n>CLM_HEADER_ADAPTATIONS_ACTIONS}">
150
- </MenuButton>
151
139
  </cells>
152
140
  </ColumnListItem>
153
141
  </items>
@@ -8,6 +8,7 @@ sap.ui.define([
8
8
  "sap/ui/base/ManagedObject",
9
9
  "sap/base/Log",
10
10
  "sap/base/strings/formatMessage",
11
+ "sap/ui/core/BusyIndicator",
11
12
  "sap/ui/core/Fragment",
12
13
  "sap/ui/core/library",
13
14
  "sap/ui/fl/Layer",
@@ -20,6 +21,7 @@ sap.ui.define([
20
21
  ManagedObject,
21
22
  Log,
22
23
  formatMessage,
24
+ BusyIndicator,
23
25
  Fragment,
24
26
  coreLibrary,
25
27
  Layer,
@@ -41,7 +43,7 @@ sap.ui.define([
41
43
  * @class
42
44
  *
43
45
  * @author SAP SE
44
- * @version 1.113.0
46
+ * @version 1.115.0
45
47
  *
46
48
  * @constructor
47
49
  * @private
@@ -62,7 +64,8 @@ sap.ui.define([
62
64
  }
63
65
  });
64
66
 
65
- SaveAsAdaptation.prototype.openAddAdaptationDialog = function(sLayer) {
67
+ SaveAsAdaptation.prototype.openAddAdaptationDialog = function(sLayer, bIsEditMode) {
68
+ this._bIsEditMode = bIsEditMode;
66
69
  if (!this._oAddAdaptationDialogPromise) {
67
70
  this._oAddAdaptationDialogPromise = Fragment.load({
68
71
  name: "sap.ui.rta.toolbar.contextBased.SaveAsAdaptationDialog",
@@ -78,15 +81,25 @@ sap.ui.define([
78
81
  this._oAddAdaptationDialog.attachBeforeClose(clearComponent.bind(this));
79
82
  oDialog.addStyleClass(Utils.getRtaStyleClassName());
80
83
  this.getToolbar().addDependent(this._oAddAdaptationDialog);
84
+ this.oDialogModel = new JSONModel();
85
+ this._oAddAdaptationDialog.setModel(this.oDialogModel, "dialogModel");
81
86
  }.bind(this));
82
87
  } else {
83
- this.getToolbar().getControl("addAdaptationDialog--saveAdaptation-title-input").setValue("");
88
+ var oInputField = this.getToolbar().getControl("addAdaptationDialog--saveAdaptation-title-input");
89
+ oInputField.setValue("");
90
+ oInputField.setValueState(ValueState.None);
84
91
  }
85
92
  return this._oAddAdaptationDialogPromise.then(function() {
86
93
  return createContextSharingComponent.call(this, sLayer);
87
94
  }.bind(this)).then(function() {
88
95
  var oRtaInformation = this.getToolbar().getRtaInformation();
89
96
  this.oAdaptationsModel = ContextBasedAdaptationsAPI.getAdaptationsModel({ control: oRtaInformation.rootControl, layer: oRtaInformation.flexSettings.layer });
97
+ if (bIsEditMode) {
98
+ enableEditMode.call(this);
99
+ } else {
100
+ this.oDialogModel.setProperty("/title", this.oTextResources.getText("SAC_DIALOG_HEADER"));
101
+ this.oDialogModel.refresh(true);
102
+ }
90
103
  return openDialog.call(this);
91
104
  }.bind(this));
92
105
  };
@@ -97,24 +110,49 @@ sap.ui.define([
97
110
  return this._oAddAdaptationDialog.open();
98
111
  }
99
112
 
113
+ // ------ enables dialog for editing -----
114
+ function enableEditMode() {
115
+ this.oDialogModel.setProperty("/title", this.oTextResources.getText("EAC_DIALOG_HEADER"));
116
+ this.oDialogModel.refresh(true);
117
+ var oDisplayedAdaptation = this.oAdaptationsModel.getProperty("/displayedAdaptation");
118
+ this._mEditProperties = {
119
+ adaptationId: oDisplayedAdaptation.id,
120
+ title: oDisplayedAdaptation.title,
121
+ priority: oDisplayedAdaptation.rank - 1,
122
+ roles: oDisplayedAdaptation.contexts.role
123
+ };
124
+ this.getToolbar().getControl("addAdaptationDialog--saveAdaptation-title-input").setValue(this._mEditProperties.title);
125
+ this._oContextComponentInstance.setSelectedContexts({role: this._mEditProperties.roles});
126
+ }
127
+
100
128
  // ------ formatting ------
101
129
  function formatPriorityText(aAdaptations) {
102
- var aItems = [{ key: 0, title: this.oTextResources.getText("TXT_SELECT_FIRST_PRIO") }];
130
+ var aItems = [{ key: "0", title: this.oTextResources.getText("TXT_SELECT_FIRST_PRIO") }];
103
131
  var sPriorityTextTemplate = this.oTextResources.getText("TXT_SELECT_PRIO");
132
+ var iCurrentPriority = this._mEditProperties ? this._mEditProperties.priority : undefined;
133
+ // create the data for the priority selection model
134
+ // selected is the currently or by default selected priority
135
+ // priority is the array with all available priorities together with the displayed text defined in text template
104
136
  aAdaptations.forEach(function(oAdaptation, iIndex) {
137
+ if (iCurrentPriority !== undefined && iCurrentPriority === iIndex) {
138
+ return;
139
+ }
140
+ var iKey = aItems.length;
105
141
  aItems.push({
106
- key: (iIndex + 1).toString(),
107
- title: formatMessage(sPriorityTextTemplate, [oAdaptation.title, iIndex + 2])
142
+ key: iKey.toString(),
143
+ title: formatMessage(sPriorityTextTemplate, [oAdaptation.title, iKey + 1])
108
144
  });
109
145
  });
110
- this.oPrioritySelectionModel = new JSONModel({
111
- selected: this.oTextResources.getText("TXT_SELECT_FIRST_PRIO"),
112
- priority: aItems
113
- });
114
- this._oAddAdaptationDialog.setModel(this.oPrioritySelectionModel, "prioritySelectionModel");
146
+ this.oDialogModel.setProperty("/selected", iCurrentPriority ? aItems[iCurrentPriority].key : aItems[0].key);
147
+ this.oDialogModel.setProperty("/priority", aItems);
115
148
  }
116
149
 
117
150
  function onAdaptationTitleChange() {
151
+ checkAdaptationsNameConstraints.call(this);
152
+ enableSaveAsButton.call(this);
153
+ }
154
+
155
+ function onContextRoleChange() {
118
156
  enableSaveAsButton.call(this);
119
157
  }
120
158
 
@@ -128,25 +166,51 @@ sap.ui.define([
128
166
  oContextBasedAdaptation.contexts = this._oContextComponentInstance.getSelectedContexts();
129
167
  oContextBasedAdaptation.priority = getAdaptationPriority.call(this);
130
168
  var oRtaInformation = this.getToolbar().getRtaInformation();
131
- ContextBasedAdaptationsAPI.create({
132
- control: oRtaInformation.rootControl,
133
- layer: oRtaInformation.flexSettings.layer,
134
- contextBasedAdaptation: oContextBasedAdaptation
135
- }).catch(function(oError) {
136
- Log.error(oError.stack);
137
- var sMessage = "MSG_LREP_TRANSFER_ERROR";
138
- var oOptions = { titleKey: "SAC_DIALOG_HEADER" };
139
- oOptions.details = oError.userMessage;
140
- Utils.showMessageBox("error", sMessage, oOptions);
141
- });
169
+ if (this._bIsEditMode) {
170
+ ContextBasedAdaptationsAPI.update({
171
+ control: oRtaInformation.rootControl,
172
+ layer: oRtaInformation.flexSettings.layer,
173
+ contextBasedAdaptation: oContextBasedAdaptation,
174
+ adaptationId: this._mEditProperties.adaptationId
175
+ })
176
+ .then(function(oContextBasedAdaptation, oResponse) {
177
+ if (oResponse.status === 200) {
178
+ this.oAdaptationsModel.updateAdaptationContent(oContextBasedAdaptation);
179
+ }
180
+ }.bind(this, oContextBasedAdaptation))
181
+ .catch(function(oError) {
182
+ Log.error(oError.stack);
183
+ var sMessage = "MSG_LREP_TRANSFER_ERROR";
184
+ var oOptions = { titleKey: "EAC_DIALOG_HEADER" };
185
+ oOptions.details = oError.userMessage;
186
+ Utils.showMessageBox("error", sMessage, oOptions);
187
+ });
188
+ } else {
189
+ BusyIndicator.show();
190
+ ContextBasedAdaptationsAPI.create({
191
+ control: oRtaInformation.rootControl,
192
+ layer: oRtaInformation.flexSettings.layer,
193
+ contextBasedAdaptation: oContextBasedAdaptation
194
+ }).then(function() {
195
+ BusyIndicator.hide();
196
+ this.getToolbar().fireEvent("switchAdaptation", {adaptationId: oContextBasedAdaptation.id, trigger: "SaveAs"});
197
+ }.bind(this)).catch(function(oError) {
198
+ BusyIndicator.hide();
199
+ Log.error(oError.stack);
200
+ var sMessage = "MSG_LREP_TRANSFER_ERROR";
201
+ var oOptions = { titleKey: "SAC_DIALOG_HEADER" };
202
+ oOptions.details = oError.userMessage;
203
+ Utils.showMessageBox("error", sMessage, oOptions);
204
+ });
205
+ }
142
206
  this._oAddAdaptationDialog.close();
143
207
  }
144
208
 
145
209
  function onPriorityChange(oEvent) {
210
+ enableSaveAsButton.call(this);
146
211
  this.sPriority = oEvent.getParameters().selectedItem.getProperty("key");
147
212
  }
148
213
 
149
-
150
214
  function checkAdaptationsNameConstraints() {
151
215
  // check for empty adaptations title
152
216
  if (this._oAddAdaptationDialog && this._oAddAdaptationDialog.isOpen()) {
@@ -165,10 +229,14 @@ sap.ui.define([
165
229
  // check for duplicates
166
230
  var iIndexOfDuplicate = this.oAdaptationsModel.getProperty("/adaptations").findIndex(function(adaptation) {
167
231
  if (adaptation.title.trim().toLowerCase() === oInputField.getValue().trim().toLowerCase()) {
232
+ // allow matching in case of edit mode with already used title
233
+ if (this._mEditProperties && this._mEditProperties.title.toLowerCase() === oInputField.getValue().toLowerCase()) {
234
+ return false;
235
+ }
168
236
  return true;
169
237
  }
170
238
  return false;
171
- });
239
+ }.bind(this));
172
240
  if (iIndexOfDuplicate > -1) {
173
241
  oInputField.setValueState(ValueState.Error);
174
242
  oInputField.setValueStateText(this.oTextResources.getText("TXT_CTX_ERROR_DUPLICATE_TITLE"));
@@ -187,9 +255,10 @@ sap.ui.define([
187
255
  this._oContextComponentInstance = oContextSharingComponent.getComponentInstance();
188
256
  this._oContextComponentInstance.resetSelectedContexts();
189
257
  this._oAddAdaptationDialog.addContent(this._oContextComponent);
190
- var oSelectedContextsModel = this._oContextComponentInstance.getSelectedContextsModel();
191
- this.oSelectedContextsBinding = new Binding(oSelectedContextsModel, "/", oSelectedContextsModel.getContext("/"));
192
- this.oSelectedContextsBinding.attachChange(enableSaveAsButton.bind(this));
258
+ var oContextsList = sap.ui.getCore().byId("contextSharing---ContextVisibility--selectedContextsList");
259
+ oContextsList.attachUpdateFinished(onContextRoleChange.bind(this));
260
+ oContextsList.getHeaderToolbar().getContent()[0].setRequired(true);
261
+ this._oContextComponentInstance.setEmptyListTextWithAdvice();
193
262
  this._oContextComponentInstance.showMessageStrip(false);
194
263
  }.bind(this));
195
264
  }
@@ -200,21 +269,39 @@ sap.ui.define([
200
269
  }
201
270
 
202
271
  function getAdaptationPriority() {
272
+ if (this._bIsEditMode && !this.sPriority) {
273
+ this.sPriority = this.oDialogModel.getProperty("/selected");
274
+ }
203
275
  return Number(this.sPriority) || 0;
204
276
  }
205
277
 
206
278
  function enableSaveAsButton() {
207
- checkAdaptationsNameConstraints.call(this);
208
279
  var oInputField = this.getToolbar().getControl("addAdaptationDialog--saveAdaptation-title-input");
209
- var bEnable = oInputField.getValueState() === ValueState.None && this._oContextComponentInstance.getSelectedContexts().role.length > 0;
280
+ var bEnable;
281
+ var bRolesSelectedAndValidTitle = this._oContextComponentInstance.getSelectedContexts().role.length > 0
282
+ && oInputField.getValueState() === ValueState.None
283
+ && oInputField.getValue().length > 0;
284
+ if (this._bIsEditMode && this._mEditProperties && this.oDialogModel) {
285
+ bEnable = bRolesSelectedAndValidTitle
286
+ // check that some of the properties title, priority, roles have been changed
287
+ && (oInputField.getValue() !== this._mEditProperties.title
288
+ || this.oDialogModel.getProperty("/selected") !== (this._mEditProperties.priority).toString()
289
+ || this._oContextComponentInstance.getSelectedContexts().role.length !== this._mEditProperties.roles.length
290
+ || !this._oContextComponentInstance.getSelectedContexts().role.every(function(sRole) {
291
+ return this._mEditProperties.roles.indexOf(sRole) > -1;
292
+ }.bind(this)));
293
+ } else {
294
+ bEnable = bRolesSelectedAndValidTitle;
295
+ }
210
296
  this.getToolbar().getControl("addAdaptationDialog--saveAdaptation-saveButton").setEnabled(bEnable);
211
297
  }
212
298
 
213
299
  function clearComponent() {
214
- if (this._oContextComponentInstance) {
215
- this._oContextComponentInstance.showMessageStrip(true);
216
- this._oContextComponentInstance.resetSelectedContexts();
217
- }
300
+ this._mEditProperties = undefined;
301
+ this._oAddAdaptationDialog.removeContent(this._oContextComponent);
302
+ this._oContextComponentInstance.destroy();
303
+ this._oContextComponent.destroy();
218
304
  }
305
+
219
306
  return SaveAsAdaptation;
220
307
  });
@@ -5,14 +5,16 @@
5
5
  <Dialog id="selectContextsDialog"
6
6
  resizable="true"
7
7
  draggable="true"
8
- title="{i18n>SAC_DIALOG_HEADER}">
8
+ title="{dialogModel>/title}">
9
9
  <Panel id="saveAdaptation-information-panel">
10
- <Toolbar id="toolbar">
11
- <Label id="label"
12
- text="Information"
13
- design="Bold">
14
- </Label>
15
- </Toolbar>
10
+ <headerToolbar>
11
+ <Toolbar id="toolbar">
12
+ <Label id="label"
13
+ text="Information"
14
+ design="Bold">
15
+ </Label>
16
+ </Toolbar>
17
+ </headerToolbar>
16
18
  <form:Form id="saveAdaptation-form"
17
19
  editable="true">
18
20
  <form:layout>
@@ -58,10 +60,10 @@
58
60
  <Select
59
61
  id="saveAdaptation-rank-select"
60
62
  forceSelection="true"
61
- selectedKey="{prioritySelectionModel>/selected}"
62
- items="{prioritySelectionModel>/priority}"
63
+ selectedKey="{dialogModel>/selected}"
64
+ items="{dialogModel>/priority}"
63
65
  change=".onPriorityChange">
64
- <core:Item key="{prioritySelectionModel>key}" text="{prioritySelectionModel>title}" />
66
+ <core:Item key="{dialogModel>key}" text="{dialogModel>title}" />
65
67
  </Select>
66
68
  </form:FormElement>
67
69
  </form:formElements>
@@ -49,7 +49,7 @@ sap.ui.define([
49
49
  * @class
50
50
  *
51
51
  * @author SAP SE
52
- * @version 1.113.0
52
+ * @version 1.115.0
53
53
  *
54
54
  * @constructor
55
55
  * @private
@@ -36,7 +36,7 @@ sap.ui.define([
36
36
  * @class
37
37
  *
38
38
  * @author SAP SE
39
- * @version 1.113.0
39
+ * @version 1.115.0
40
40
  *
41
41
  * @constructor
42
42
  * @private
@@ -124,7 +124,7 @@ sap.ui.define([
124
124
 
125
125
  return DateFormat.getInstance({
126
126
  format: "yMMMdjm"
127
- }).format(new Date(sTimeStamp));
127
+ }).format(new Date(sTimeStamp + "Z"));
128
128
  }
129
129
 
130
130
  function getGroupHeaderFactory(oGroup) {