@openui5/sap.ui.rta 1.105.0 → 1.106.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 (159) hide show
  1. package/.reuse/dep5 +20 -17
  2. package/THIRDPARTY.txt +31 -21
  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 +25 -13
  7. package/src/sap/ui/rta/Utils.js +1 -1
  8. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  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 +7 -5
  19. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  20. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  21. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  22. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  23. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  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 +2 -2
  27. package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
  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 +15 -5
  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 +89 -15
  44. package/src/sap/ui/rta/library.js +2 -2
  45. package/src/sap/ui/rta/messagebundle.properties +31 -0
  46. package/src/sap/ui/rta/messagebundle_ar.properties +13 -11
  47. package/src/sap/ui/rta/messagebundle_bg.properties +13 -11
  48. package/src/sap/ui/rta/messagebundle_ca.properties +13 -11
  49. package/src/sap/ui/rta/messagebundle_cs.properties +13 -11
  50. package/src/sap/ui/rta/messagebundle_cy.properties +13 -11
  51. package/src/sap/ui/rta/messagebundle_da.properties +13 -11
  52. package/src/sap/ui/rta/messagebundle_de.properties +3 -1
  53. package/src/sap/ui/rta/messagebundle_el.properties +13 -11
  54. package/src/sap/ui/rta/messagebundle_en.properties +4 -2
  55. package/src/sap/ui/rta/messagebundle_en_GB.properties +4 -2
  56. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +13 -1
  57. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +6 -1
  58. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +3 -1
  59. package/src/sap/ui/rta/messagebundle_es.properties +13 -11
  60. package/src/sap/ui/rta/messagebundle_es_MX.properties +13 -11
  61. package/src/sap/ui/rta/messagebundle_et.properties +13 -11
  62. package/src/sap/ui/rta/messagebundle_fi.properties +13 -11
  63. package/src/sap/ui/rta/messagebundle_fr.properties +13 -11
  64. package/src/sap/ui/rta/messagebundle_fr_CA.properties +13 -11
  65. package/src/sap/ui/rta/messagebundle_hi.properties +13 -11
  66. package/src/sap/ui/rta/messagebundle_hr.properties +13 -11
  67. package/src/sap/ui/rta/messagebundle_hu.properties +13 -11
  68. package/src/sap/ui/rta/messagebundle_id.properties +13 -11
  69. package/src/sap/ui/rta/messagebundle_it.properties +13 -11
  70. package/src/sap/ui/rta/messagebundle_iw.properties +13 -11
  71. package/src/sap/ui/rta/messagebundle_ja.properties +13 -11
  72. package/src/sap/ui/rta/messagebundle_kk.properties +13 -11
  73. package/src/sap/ui/rta/messagebundle_ko.properties +13 -11
  74. package/src/sap/ui/rta/messagebundle_lt.properties +13 -11
  75. package/src/sap/ui/rta/messagebundle_lv.properties +13 -11
  76. package/src/sap/ui/rta/messagebundle_ms.properties +13 -11
  77. package/src/sap/ui/rta/messagebundle_nl.properties +13 -11
  78. package/src/sap/ui/rta/messagebundle_no.properties +13 -11
  79. package/src/sap/ui/rta/messagebundle_pl.properties +13 -11
  80. package/src/sap/ui/rta/messagebundle_pt.properties +13 -11
  81. package/src/sap/ui/rta/messagebundle_pt_PT.properties +13 -11
  82. package/src/sap/ui/rta/messagebundle_ro.properties +13 -11
  83. package/src/sap/ui/rta/messagebundle_ru.properties +13 -11
  84. package/src/sap/ui/rta/messagebundle_sh.properties +13 -11
  85. package/src/sap/ui/rta/messagebundle_sk.properties +13 -11
  86. package/src/sap/ui/rta/messagebundle_sl.properties +13 -11
  87. package/src/sap/ui/rta/messagebundle_sv.properties +13 -11
  88. package/src/sap/ui/rta/messagebundle_th.properties +13 -11
  89. package/src/sap/ui/rta/messagebundle_tr.properties +13 -11
  90. package/src/sap/ui/rta/messagebundle_uk.properties +13 -11
  91. package/src/sap/ui/rta/messagebundle_vi.properties +13 -11
  92. package/src/sap/ui/rta/messagebundle_zh_CN.properties +13 -11
  93. package/src/sap/ui/rta/messagebundle_zh_TW.properties +13 -11
  94. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +2 -2
  95. package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
  96. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  97. package/src/sap/ui/rta/plugin/CompVariant.js +8 -6
  98. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  99. package/src/sap/ui/rta/plugin/CreateContainer.js +9 -4
  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 +3 -1
  103. package/src/sap/ui/rta/plugin/EasyRemove.js +3 -1
  104. package/src/sap/ui/rta/plugin/LocalReset.js +2 -2
  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 +3 -3
  109. package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
  110. package/src/sap/ui/rta/plugin/Resize.js +3 -3
  111. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  112. package/src/sap/ui/rta/plugin/Settings.js +2 -2
  113. package/src/sap/ui/rta/plugin/Split.js +2 -2
  114. package/src/sap/ui/rta/plugin/Stretch.js +3 -1
  115. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  116. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  117. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +9 -6
  118. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +9 -9
  119. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  120. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
  121. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +3 -3
  122. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  123. package/src/sap/ui/rta/service/Action.js +1 -1
  124. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  125. package/src/sap/ui/rta/service/Outline.js +1 -1
  126. package/src/sap/ui/rta/service/Property.js +1 -1
  127. package/src/sap/ui/rta/service/Selection.js +1 -1
  128. package/src/sap/ui/rta/service/SupportTools.js +189 -0
  129. package/src/sap/ui/rta/service/index.js +7 -6
  130. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +11 -1
  131. package/src/sap/ui/rta/toolbar/Adaptation.js +8 -1
  132. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  133. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  134. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  135. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  136. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  137. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  138. package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation.js +132 -0
  139. package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptationDialog.fragment.xml +79 -0
  140. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -5
  141. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  142. package/src/sap/ui/rta/util/BindingsExtractor.js +89 -42
  143. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  144. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  145. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  146. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  147. package/src/sap/ui/rta/util/adaptationStarter.js +13 -4
  148. package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +50 -0
  149. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +40 -37
  150. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +2 -2
  151. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +2 -1
  152. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +60 -41
  153. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +52 -81
  154. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/CombineVisualization.js +0 -0
  155. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/MoveVisualization.js +2 -0
  156. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/RenameVisualization.js +0 -0
  157. package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/SplitVisualization.js +0 -0
  158. package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +37 -0
  159. package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +0 -35
@@ -0,0 +1,132 @@
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/base/ManagedObject",
9
+ "sap/ui/core/Fragment",
10
+ "sap/ui/fl/Layer",
11
+ "sap/ui/fl/write/api/ContextSharingAPI",
12
+ "sap/ui/rta/Utils",
13
+ "sap/ui/model/Binding"
14
+ ], function (
15
+ ManagedObject,
16
+ Fragment,
17
+ Layer,
18
+ ContextSharingAPI,
19
+ Utils,
20
+ Binding
21
+ ) {
22
+ "use strict";
23
+
24
+ /**
25
+ * Controller for the <code>sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation</code> controls.
26
+ * Contains implementation of context-based-adaptation functionality.
27
+ *
28
+ * @class
29
+ *
30
+ * @author SAP SE
31
+ * @version 1.106.0
32
+ *
33
+ * @constructor
34
+ * @private
35
+ * @since 1.106
36
+ * @alias sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation
37
+ */
38
+ var SaveAsContextBasedAdaptation = ManagedObject.extend("sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation", {
39
+ metadata: {
40
+ properties: {
41
+ toolbar: {
42
+ type: "any" // "sap.ui.rta.toolbar.Base"
43
+ }
44
+ }
45
+ },
46
+ constructor: function () {
47
+ ManagedObject.prototype.constructor.apply(this, arguments);
48
+ this.oTextResources = this.getToolbar().getTextResources();
49
+ }
50
+ });
51
+
52
+ SaveAsContextBasedAdaptation.prototype.openAddAdaptationDialog = function (sLayer) {
53
+ if (!this._oAddAdaptationDialogPromise) {
54
+ this._oAddAdaptationDialogPromise = Fragment.load({
55
+ name: "sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptationDialog",
56
+ id: this.getToolbar().getId() + "_fragment--sapUiRta_addAdaptationDialog",
57
+ controller: {
58
+ onAdaptationTitleChange: function (oEvent) {
59
+ this.sAdaptationTitle = oEvent.getParameter("value");
60
+ _validateAddAdaptationInput.call(this);
61
+ }.bind(this),
62
+ // TODO: implementation of save as context based adaptation
63
+ onSaveAsContextBasedAdaptation: function () {
64
+ },
65
+ onCancelContextBasedAdaptationDialog: function () {
66
+ _clearContexts.call(this);
67
+ this._oAddAdaptationDialog.close();
68
+ }.bind(this)
69
+ }
70
+ }).then(function (oDialog) {
71
+ this._oAddAdaptationDialog = oDialog;
72
+ oDialog.addStyleClass(Utils.getRtaStyleClassName());
73
+ this.getToolbar().addDependent(this._oAddAdaptationDialog);
74
+ createContextSharingComponent.call(this, sLayer);
75
+ }.bind(this));
76
+ } else {
77
+ this.getToolbar().getControl("addAdaptationDialog--saveContextBasedAdaptation-title-input").setValue("");
78
+ }
79
+ return this._oAddAdaptationDialogPromise.then(function () {
80
+ return this._oAddAdaptationDialog.open();
81
+ }.bind(this));
82
+ };
83
+
84
+ function createContextSharingComponent(sLayer) {
85
+ var mPropertyBag = { layer: sLayer || Layer.CUSTOMER, isAppContext: true };
86
+ return ContextSharingAPI.createComponent(mPropertyBag).then(function (oContextSharingComponent) {
87
+ this._oContextComponent = oContextSharingComponent;
88
+ this._oContextComponentInstance = oContextSharingComponent.getComponentInstance();
89
+ this._oContextComponentInstance.setSelectedContexts({ role: [] });
90
+ this._oAddAdaptationDialog.addContent(this._oContextComponent);
91
+ var oSelectedContextsModel = this._oContextComponentInstance.getSelectedContextsModel();
92
+ this.oSelectedContextsBinding = new Binding(oSelectedContextsModel, "/", oSelectedContextsModel.getContext("/"));
93
+ this.oSelectedContextsBinding.attachChange(onSelectedContextsChange.bind(this));
94
+ }.bind(this));
95
+ }
96
+
97
+ function onSelectedContextsChange() {
98
+ this.aSelectedRoles = this._oContextComponentInstance.getSelectedContexts().role;
99
+ _validateAddAdaptationInput.call(this);
100
+ }
101
+
102
+ function _validateAddAdaptationInput() {
103
+ if (getAdaptationTitle.call(this).length > 0 && getSelectedContexts.call(this).length > 0) {
104
+ _enableSaveAsButton.call(this, true);
105
+ } else {
106
+ _enableSaveAsButton.call(this, false);
107
+ }
108
+ }
109
+
110
+ function getAdaptationTitle() {
111
+ return this.sAdaptationTitle || "";
112
+ }
113
+
114
+ function getSelectedContexts() {
115
+ return this.aSelectedRoles || [];
116
+ }
117
+
118
+ function _enableSaveAsButton(bEnable) {
119
+ this.getToolbar().getControl("addAdaptationDialog--saveContextBasedAdaptation-saveButton").setEnabled(bEnable);
120
+ }
121
+
122
+ function _clearContexts() {
123
+ if (this._oContextComponentInstance) {
124
+ if (this._oContextComponent.isDestroyed()) {
125
+ return createContextSharingComponent.call(this);
126
+ }
127
+ this._oContextComponentInstance.setSelectedContexts({ role: [] });
128
+ this._oAddAdaptationDialog.addContent(this._oContextComponent);
129
+ }
130
+ }
131
+ return SaveAsContextBasedAdaptation;
132
+ });
@@ -0,0 +1,79 @@
1
+ <core:FragmentDefinition xmlns:richtexteditor="sap.ui.richtexteditor"
2
+ xmlns:form="sap.ui.layout.form"
3
+ xmlns="sap.m"
4
+ xmlns:core="sap.ui.core">
5
+ <Dialog id="selectContextsDialog"
6
+ resizable="true"
7
+ draggable="true"
8
+ title="{i18n>SAC_DIALOG_HEADER}">
9
+ <Panel id="saveContextBasedAdaptation-information-panel">
10
+ <Toolbar id="toolbar">
11
+ <Label id="label"
12
+ text="Information"
13
+ design="Bold">
14
+ </Label>
15
+ </Toolbar>
16
+ <form:Form id="saveContextBasedAdaptation-form"
17
+ editable="true">
18
+ <form:layout>
19
+ <form:ResponsiveGridLayout labelSpanXL="3"
20
+ labelSpanL="3"
21
+ labelSpanM="3"
22
+ labelSpanS="12"
23
+ adjustLabelSpan="false"
24
+ emptySpanXL="4"
25
+ emptySpanL="4"
26
+ emptySpanM="4"
27
+ emptySpanS="0"
28
+ columnsXL="1"
29
+ columnsL="1"
30
+ columnsM="1"
31
+ singleContainerFullSize="false"/>
32
+ </form:layout>
33
+ <form:FormContainer>
34
+ <form:formElements>
35
+ <form:FormElement >
36
+ <form:label>
37
+ <Label id="saveContextBasedAdaptation-title-label"
38
+ text="{i18n>APP_DIALOG_TITLE_TEXT}"
39
+ textAlign="Left"
40
+ required="true">
41
+ </Label>
42
+ </form:label>
43
+ <Input id="saveContextBasedAdaptation-title-input"
44
+ value="{/title}"
45
+ valueLiveUpdate="true"
46
+ liveChange=".onAdaptationTitleChange"
47
+ placeholder="{i18n>SAVE_AS_DIALOG_PLACEHOLDER_TITLE_TEXT}">
48
+ </Input>
49
+ </form:FormElement>
50
+ <form:FormElement >
51
+ <form:label>
52
+ <Label id="saveContextBasedAdaptation-rank-label"
53
+ text="{i18n>CLM_HEADER_PRIORITY}"
54
+ textAlign="Left"
55
+ required="true">
56
+ </Label>
57
+ </form:label>
58
+ <Select id="saveContextBasedAdaptation-rank-select"
59
+ selectedKey="{/selected}">
60
+ </Select>
61
+ </form:FormElement>
62
+ </form:formElements>
63
+ </form:FormContainer>
64
+ </form:Form>
65
+ </Panel>
66
+ <beginButton>
67
+ <Button id="saveContextBasedAdaptation-saveButton"
68
+ type="Emphasized"
69
+ text="{i18n>APP_VARIANT_DIALOG_SAVE}"
70
+ press=".onSaveAsContextBasedAdaptation"/>
71
+ </beginButton>
72
+ <endButton>
73
+ <Button id="saveContextBasedAdaptation-cancelButton"
74
+ type="Emphasized"
75
+ text="{i18n>SAVE_AS_APP_VARIANT_DIALOG_CANCEL}"
76
+ press=".onCancelContextBasedAdaptationDialog"/>
77
+ </endButton>
78
+ </Dialog>
79
+ </core:FragmentDefinition>
@@ -11,12 +11,10 @@ sap.ui.define([
11
11
  "sap/ui/base/ManagedObject",
12
12
  "sap/ui/core/Fragment",
13
13
  "sap/ui/rta/Utils",
14
- "sap/ui/fl/Utils",
15
14
  "sap/ui/model/json/JSONModel",
16
15
  "sap/m/MessageBox",
17
16
  "sap/m/MessageToast",
18
17
  "sap/ui/fl/write/api/TranslationAPI",
19
- "sap/ui/fl/write/api/VersionsAPI",
20
18
  "sap/ui/fl/Layer",
21
19
  "sap/ui/core/util/File"
22
20
  ], function(
@@ -24,12 +22,10 @@ sap.ui.define([
24
22
  ManagedObject,
25
23
  Fragment,
26
24
  Utils,
27
- FlUtils,
28
25
  JSONModel,
29
26
  MessageBox,
30
27
  MessageToast,
31
28
  TranslationAPI,
32
- VersionsAPI,
33
29
  Layer,
34
30
  FileUtil
35
31
  ) {
@@ -53,7 +49,7 @@ sap.ui.define([
53
49
  * @class
54
50
  *
55
51
  * @author SAP SE
56
- * @version 1.105.0
52
+ * @version 1.106.0
57
53
  *
58
54
  * @constructor
59
55
  * @private
@@ -36,7 +36,7 @@ sap.ui.define([
36
36
  * @class
37
37
  *
38
38
  * @author SAP SE
39
- * @version 1.105.0
39
+ * @version 1.106.0
40
40
  *
41
41
  * @constructor
42
42
  * @private
@@ -7,12 +7,16 @@
7
7
  sap.ui.define([
8
8
  "sap/ui/dt/ElementUtil",
9
9
  "sap/ui/dt/OverlayRegistry",
10
- "sap/base/util/isPlainObject"
10
+ "sap/base/util/isPlainObject",
11
+ "sap/base/util/restricted/_uniqWith",
12
+ "sap/base/util/deepEqual"
11
13
  ],
12
14
  function(
13
15
  ElementUtil,
14
16
  OverlayRegistry,
15
- isPlainObject
17
+ isPlainObject,
18
+ _uniqWith,
19
+ deepEqual
16
20
  ) {
17
21
  "use strict";
18
22
 
@@ -35,7 +39,12 @@ function(
35
39
  };
36
40
  var sAggregationName = oElement.sParentAggregationName;
37
41
  var oParent = oElement.getParent();
38
- var aBindings = BindingsExtractor.getBindings(oElement, oModel, undefined, undefined, oRelevantContainerElement);
42
+ var aBindings = BindingsExtractor.getBindings({
43
+ element: oElement,
44
+ model: oModel,
45
+ relevantContainerElement: oRelevantContainerElement,
46
+ parent: oParent
47
+ });
39
48
 
40
49
  if (oParent) {
41
50
  var oDefaultAggregation = oParent.getMetadata().getAggregation();
@@ -52,7 +61,13 @@ function(
52
61
  if (oTemplateDefaultAggregation) {
53
62
  var sTemplateDefaultAggregationName = oTemplateDefaultAggregation.name;
54
63
  var oTemplateElement = ElementUtil.getAggregation(oTemplate, sTemplateDefaultAggregationName)[iPositionOfInvisibleElement];
55
- aBindings = aBindings.concat(BindingsExtractor.getBindings(oTemplateElement, null, true, undefined, oRelevantContainerElement));
64
+ aBindings = aBindings.concat(BindingsExtractor.getBindings({
65
+ model: oModel,
66
+ element: oTemplateElement,
67
+ template: true,
68
+ relevantContainerElement: oRelevantContainerElement,
69
+ parent: oParent
70
+ }));
56
71
  }
57
72
  }
58
73
  }
@@ -93,58 +108,77 @@ function(
93
108
 
94
109
  /**
95
110
  * Gets bindings for the whole hierarchy of children for a specified Element
96
- * and filters out bindings which are not relevant (based on the parent model)
111
+ * and filters out bindings which are not relevant (based on the given model)
97
112
  *
98
- * @param {sap.ui.core.Control} oElement - Starting point of the search
99
- * @param {sap.ui.model.Model} oParentDefaultModel - Model for filtering irrelevant binding paths
100
- * @param {boolean} [vTemplate] - Whether we should consider provided element as a template
101
- * @param {string} [sAggregationName] - if aggregation name is given then only for this aggregation bindings are returned, if not then all aggregations are considered
102
- * @param {sap.ui.core.Control} [oRelevantContainerElement] - if this element is given then only bindings from element related to the relevant container are considered
113
+ * @param {object} mPropertyBag - PropertyBag
114
+ * @param {sap.ui.core.Control} mPropertyBag.element - Starting point of the search
115
+ * @param {sap.ui.model.Model} [mPropertyBag.model] - Model for filtering irrelevant binding paths
116
+ * @param {boolean} [mPropertyBag.template] - Whether we should consider provided element as a template or part of a template
117
+ * @param {string} [mPropertyBag.aggregationName] - if aggregation name is given then only for this aggregation bindings are returned, if not then all aggregations are considered
118
+ * @param {sap.ui.core.Control} [mPropertyBag.relevantContainerElement] - if this element is given then only bindings from element related to the relevant container are considered
119
+ * @param {sap.ui.core.Control} [mPropertyBag.parent] - parent of the element being evaluated; if the element is a template, the parent is the control hosting the template
103
120
  * @returns {Array} - returns array with all relevant bindings for all properties of the element
104
121
  *
105
122
  * @private
106
123
  */
107
- BindingsExtractor.getBindings = function(oElement, oParentDefaultModel, vTemplate, sAggregationName, oRelevantContainerElement) {
124
+ BindingsExtractor.getBindings = function(mPropertyBag) {
125
+ var oElement = mPropertyBag.element;
126
+ var oModel = mPropertyBag.model;
127
+ var oParent = mPropertyBag.parent;
128
+ var sAggregationName = mPropertyBag.aggregationName;
129
+ var oRelevantContainerElement = mPropertyBag.relevantContainerElement;
108
130
  var aBindings = [];
109
131
  if (isElementRelatedToRelevantContainer(oElement, oRelevantContainerElement)) {
110
132
  aBindings = (
111
- vTemplate
112
- ? getBindingsFromTemplateProperties(oElement)
113
- : BindingsExtractor.getBindingsFromProperties(oElement, oParentDefaultModel)
133
+ mPropertyBag.template
134
+ ? getBindingsFromTemplateProperties(oElement, oParent, oModel)
135
+ : BindingsExtractor.getBindingsFromProperties(oElement, oModel)
114
136
  );
115
137
  }
116
138
  var aAggregationNames = sAggregationName ? [sAggregationName] : Object.keys(oElement.getMetadata().getAllAggregations());
117
139
 
118
140
  aAggregationNames.forEach(function (sAggregationNameInLoop) {
119
- aBindings = aBindings.concat(getBindingsForAggregation(oElement, oParentDefaultModel, vTemplate, sAggregationNameInLoop, oRelevantContainerElement));
141
+ aBindings = aBindings.concat(getBindingsForAggregation(oElement, oModel, mPropertyBag.template, sAggregationNameInLoop, oRelevantContainerElement));
120
142
  });
121
143
 
122
- return aBindings;
144
+ // Remove duplicates
145
+ return _uniqWith(aBindings, deepEqual);
123
146
  };
124
147
 
125
- function getBindingsForAggregation(oElement, oParentDefaultModel, vTemplate, sAggregationName, oRelevantContainerElement) {
148
+ function getBindingsForAggregation(oElement, oModel, bTemplate, sAggregationName, oRelevantContainerElement) {
126
149
  var aBindings = [];
127
- var oTemplate;
128
- var bTemplate;
129
- // Getting children of the current aggregation and iterating through all of them
150
+ var aElements = [];
151
+ var bIsInTemplate = bTemplate;
152
+
130
153
  var oBinding = oElement.getBindingInfo(sAggregationName);
131
- if (vTemplate !== false) {
132
- oTemplate = oBinding && oBinding.template;
133
- bTemplate = !!vTemplate;
154
+ var oTemplate = oBinding && oBinding.template;
155
+
156
+ // If a template is bound to the current element, we continue
157
+ // the evaluation on the template (as it has no direct parent)
158
+ if (oTemplate) {
159
+ bIsInTemplate = true;
160
+ aElements = [oTemplate];
161
+ } else {
162
+ aElements = ElementUtil.getAggregation(oElement, sAggregationName);
134
163
  }
135
- var aElements = oTemplate ? [oTemplate] : ElementUtil.getAggregation(oElement, sAggregationName);
136
164
 
165
+ // Getting children of the current aggregation and iterating through all of them
137
166
  aElements.forEach(function (oChildElement) {
138
167
  if (oChildElement.getMetadata) {
139
168
  if (isElementRelatedToRelevantContainer(oElement, oRelevantContainerElement)) {
140
169
  // Fetching bindings from Element and all children of Element
141
- aBindings = aBindings.concat(oTemplate || bTemplate
142
- ? getBindingsFromTemplateProperties(oChildElement, oRelevantContainerElement)
143
- : BindingsExtractor.getBindingsFromProperties(oChildElement, oParentDefaultModel));
170
+ aBindings = aBindings.concat(bIsInTemplate
171
+ ? getBindingsFromTemplateProperties(oChildElement, oElement, oModel)
172
+ : BindingsExtractor.getBindingsFromProperties(oChildElement, oModel));
144
173
  }
145
- // For children, templates should not be evaluated (because the delegate also does not consider them)
146
174
  aBindings = aBindings.concat(
147
- BindingsExtractor.getBindings(oChildElement, oParentDefaultModel, false, undefined, oRelevantContainerElement)
175
+ BindingsExtractor.getBindings({
176
+ element: oChildElement,
177
+ model: oModel,
178
+ template: bIsInTemplate,
179
+ relevantContainerElement: oRelevantContainerElement,
180
+ parent: oElement
181
+ })
148
182
  );
149
183
  }
150
184
  });
@@ -153,7 +187,7 @@ function(
153
187
  }
154
188
 
155
189
  /**
156
- * Fetches all bindings for a specified binding model
190
+ * Fetches all bindings for a specified binding model, filtering out the irrelevant ones
157
191
  *
158
192
  * @param {sap.ui.model.PropertyBinding} oBinding - Binding model to get paths from
159
193
  * @param {sap.ui.model.odata.XX.ODataModel} oParentDefaultModel - Data model (XX = '', v2, v4...)
@@ -162,13 +196,13 @@ function(
162
196
  *
163
197
  * @private
164
198
  */
165
- BindingsExtractor.flattenBindings = function(oBinding, oParentDefaultModel) {
199
+ BindingsExtractor.filterAndFlattenBindings = function(oBinding, oParentDefaultModel) {
166
200
  var aBindings = [];
167
201
  var sModelName = oBinding.getMetadata().getName();
168
202
 
169
203
  if (sModelName === "sap.ui.model.CompositeBinding") {
170
204
  oBinding.getBindings().forEach(function (oBinding) {
171
- aBindings = aBindings.concat(BindingsExtractor.flattenBindings(oBinding, oParentDefaultModel));
205
+ aBindings = aBindings.concat(BindingsExtractor.filterAndFlattenBindings(oBinding, oParentDefaultModel));
172
206
  });
173
207
  } else if (
174
208
  (
@@ -215,13 +249,13 @@ function(
215
249
  * Retrieving all bindings from all available properties for a specified element
216
250
  *
217
251
  * @param {sap.ui.core.Control} oElement - element to get bindings from
218
- * @param {sap.ui.model.Model} oParentDefaultModel - parent model to filter irrelevant bindings
252
+ * @param {sap.ui.model.Model} oModel - model to filter irrelevant bindings
219
253
  *
220
254
  * @return {Array} - returns found bindings
221
255
  *
222
256
  * @private
223
257
  */
224
- BindingsExtractor.getBindingsFromProperties = function(oElement, oParentDefaultModel) {
258
+ BindingsExtractor.getBindingsFromProperties = function(oElement, oModel) {
225
259
  var aPropertiesKeys = Object.keys(oElement.getMetadata().getAllProperties());
226
260
 
227
261
  return aPropertiesKeys
@@ -229,32 +263,45 @@ function(
229
263
  .filter(oElement.getBinding.bind(oElement))
230
264
  .reduce(function (aBindings, sPropertyName) {
231
265
  return aBindings.concat(
232
- BindingsExtractor.flattenBindings(
266
+ BindingsExtractor.filterAndFlattenBindings(
233
267
  oElement.getBinding(sPropertyName),
234
- oParentDefaultModel
268
+ oModel
235
269
  )
236
270
  );
237
271
  }, []);
238
272
  };
239
273
 
240
274
  /**
241
- * Retrieving all bindings from all available properties for a specified element of template
275
+ * Retrieving all bindings from all available properties for a template
276
+ *
277
+ * @param {sap.ui.core.Control} oTemplate - template being evaluated
278
+ * @param {sap.ui.core.Control} oTemplateParent - template "parent"; control to which it is bound
279
+ * @param {sap.ui.model.Modell} oModel - relevant model, usually the parent default model
242
280
  *
243
- * @param {sap.ui.core.Control} oElement - element to get bindings from
244
281
  * @return {Array} - returns found bindings
245
282
  * @private
246
283
  */
247
- function getBindingsFromTemplateProperties(oElement) {
248
- var aPropertiesKeys = Object.keys(oElement.getMetadata().getAllProperties());
284
+ function getBindingsFromTemplateProperties(oTemplate, oTemplateParent, oModel) {
285
+ var aPropertiesKeys = Object.keys(oTemplate.getMetadata().getAllProperties());
286
+ var bIsSameModel;
249
287
 
250
288
  return aPropertiesKeys
251
289
  .filter(function (sPropertyName) {
252
- return sPropertyName in oElement.mBindingInfos;
290
+ var mBindingInfo = oTemplate.mBindingInfos[sPropertyName];
291
+ var sModelName = mBindingInfo && mBindingInfo.parts[0] && mBindingInfo.parts[0].model;
292
+ if (!sModelName) {
293
+ var oParentDefaultModel = oTemplateParent.getDefaultModel ? oTemplateParent.getDefaultModel() : null;
294
+ var oTemplateDefaultModel = oTemplate.getDefaultModel ? oTemplate.getDefaultModel() : null;
295
+ bIsSameModel = oParentDefaultModel === oTemplateDefaultModel;
296
+ } else {
297
+ bIsSameModel = oModel === oTemplateParent.getModel(sModelName);
298
+ }
299
+ return mBindingInfo && bIsSameModel;
253
300
  })
254
301
  .reduce(function (aBindings, sPropertyName) {
255
302
  return aBindings.concat(
256
303
  flattenBindingsFromTemplate(
257
- oElement.mBindingInfos[sPropertyName]
304
+ oTemplate.mBindingInfos[sPropertyName]
258
305
  )
259
306
  );
260
307
  }, []);
@@ -68,7 +68,7 @@ sap.ui.define([
68
68
  * Constructor for a new sap.ui.rta.util.PluginManager
69
69
  * @extends sap.ui.base.ManagedObject
70
70
  * @author SAP SE
71
- * @version 1.105.0
71
+ * @version 1.106.0
72
72
  * @constructor
73
73
  * @private
74
74
  * @since 1.86
@@ -42,7 +42,7 @@ sap.ui.define([
42
42
  * Constructor for a new sap.ui.rta.util.PopupManager
43
43
  * @extends sap.ui.base.ManagedObject
44
44
  * @author SAP SE
45
- * @version 1.105.0
45
+ * @version 1.106.0
46
46
  * @constructor
47
47
  * @private
48
48
  * @since 1.48
@@ -30,7 +30,7 @@ sap.ui.define([
30
30
  * @namespace sap.ui.rta.util.ReloadManager
31
31
  * @alias sap.ui.rta.util.ReloadManager
32
32
  * @since 1.104
33
- * @version 1.105.0
33
+ * @version 1.106.0
34
34
  * @private
35
35
  * @ui5-restricted
36
36
  */
@@ -19,7 +19,7 @@ function(
19
19
  *
20
20
  * @extends sap.ui.core.EventBus
21
21
  * @author SAP SE
22
- * @version 1.105.0
22
+ * @version 1.106.0
23
23
  * @private
24
24
  * @since 1.56.0
25
25
  * @alias sap.ui.rta.util.ServiceEventBus
@@ -13,7 +13,8 @@ sap.ui.define([
13
13
  "sap/ui/fl/Layer",
14
14
  "sap/ui/fl/Utils",
15
15
  "sap/ui/rta/util/showMessageBox",
16
- "sap/ui/rta/RuntimeAuthoring"
16
+ "sap/ui/rta/RuntimeAuthoring",
17
+ "sap/ui/core/Core"
17
18
  ], function(
18
19
  UriParameters,
19
20
  Log,
@@ -24,7 +25,8 @@ sap.ui.define([
24
25
  Layer,
25
26
  FlexUtils,
26
27
  showMessageBox,
27
- RuntimeAuthoring
28
+ RuntimeAuthoring,
29
+ Core
28
30
  ) {
29
31
  "use strict";
30
32
 
@@ -33,7 +35,8 @@ sap.ui.define([
33
35
  return FeaturesAPI.isKeyUser()
34
36
  .then(function(bIsKeyUser) {
35
37
  if (!bIsKeyUser) {
36
- var oError = Error("Key user rights have not been granted to the current user");
38
+ var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
39
+ var oError = new Error(oRtaResourceBundle.getText("MSG_NO_KEY_USER_RIGHTS_ERROR_MESSAGE"));
37
40
  oError.reason = "isKeyUser";
38
41
  throw oError;
39
42
  }
@@ -122,7 +125,7 @@ sap.ui.define([
122
125
  PersistenceWriteAPI.getChangesWarning(mPropertyBag)
123
126
  .then(function(oWarningMessage) {
124
127
  if (oWarningMessage.showWarning) {
125
- var oRtaResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
128
+ var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
126
129
  var oMessageProps = oWarningMessage.warningType === "mixedChangesWarning"
127
130
  ? {
128
131
  text: "MSG_ADAPTATION_STARTER_MIXED_CHANGES_WARNING",
@@ -147,6 +150,12 @@ sap.ui.define([
147
150
  })
148
151
  .catch(function(vError) {
149
152
  if (vError !== "Reload triggered") {
153
+ var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
154
+ showMessageBox(
155
+ oRtaResourceBundle.getText("MSG_GENERIC_ERROR_MESSAGE", vError.message),
156
+ {title: oRtaResourceBundle.getText("MSG_ADAPTATION_COULD_NOT_START")},
157
+ "error"
158
+ );
150
159
  Log.error("UI Adaptation could not be started", vError.message);
151
160
  }
152
161
  throw vError;
@@ -0,0 +1,50 @@
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/fl/changeHandler/common/ChangeCategories"
9
+ ], function(
10
+ FlChangeCategories
11
+ ) {
12
+ "use strict";
13
+
14
+ var ChangeCategories = {};
15
+
16
+ ChangeCategories.ALL = "all";
17
+
18
+ // Assignment of commands to change categories
19
+ var COMMANDS = {};
20
+ COMMANDS[FlChangeCategories.ADD] = [
21
+ "createContainer",
22
+ "addDelegateProperty",
23
+ "reveal",
24
+ "addIFrame"
25
+ ];
26
+ COMMANDS[FlChangeCategories.MOVE] = ["move"];
27
+ COMMANDS[FlChangeCategories.RENAME] = ["rename"];
28
+ COMMANDS[FlChangeCategories.COMBINESPLIT] = ["combine", "split"];
29
+ COMMANDS[FlChangeCategories.REMOVE] = ["remove"];
30
+ COMMANDS[FlChangeCategories.OTHER] = [];
31
+
32
+ var CATEGORY_ICONS = {};
33
+ CATEGORY_ICONS[ChangeCategories.ALL] = "sap-icon://show";
34
+ CATEGORY_ICONS[FlChangeCategories.ADD] = "sap-icon://add";
35
+ CATEGORY_ICONS[FlChangeCategories.MOVE] = "sap-icon://move";
36
+ CATEGORY_ICONS[FlChangeCategories.RENAME] = "sap-icon://edit";
37
+ CATEGORY_ICONS[FlChangeCategories.COMBINESPLIT] = "sap-icon://combine";
38
+ CATEGORY_ICONS[FlChangeCategories.REMOVE] = "sap-icon://less";
39
+ CATEGORY_ICONS[FlChangeCategories.OTHER] = "sap-icon://key-user-settings";
40
+
41
+ ChangeCategories.getCategories = function() {
42
+ return COMMANDS;
43
+ };
44
+
45
+ ChangeCategories.getIconForCategory = function(sCategory) {
46
+ return CATEGORY_ICONS[sCategory];
47
+ };
48
+
49
+ return ChangeCategories;
50
+ });