@openui5/sap.ui.rta 1.145.0 → 1.146.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 (160) hide show
  1. package/THIRDPARTY.txt +7 -7
  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 +18 -1
  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/AnnotationCommand.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/ExtendControllerCommand.js +1 -1
  26. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  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/ManifestCommand.js +1 -1
  30. package/src/sap/ui/rta/command/Move.js +1 -1
  31. package/src/sap/ui/rta/command/Property.js +1 -1
  32. package/src/sap/ui/rta/command/Remove.js +1 -1
  33. package/src/sap/ui/rta/command/Rename.js +1 -1
  34. package/src/sap/ui/rta/command/Resize.js +1 -1
  35. package/src/sap/ui/rta/command/Reveal.js +1 -1
  36. package/src/sap/ui/rta/command/Settings.js +1 -1
  37. package/src/sap/ui/rta/command/Split.js +1 -1
  38. package/src/sap/ui/rta/command/Stack.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/command/manifest/AddLibrary.js +1 -1
  44. package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
  45. package/src/sap/ui/rta/library.js +2 -2
  46. package/src/sap/ui/rta/messagebundle.properties +5 -3
  47. package/src/sap/ui/rta/messagebundle_ar.properties +3 -3
  48. package/src/sap/ui/rta/messagebundle_bg.properties +3 -3
  49. package/src/sap/ui/rta/messagebundle_ca.properties +3 -3
  50. package/src/sap/ui/rta/messagebundle_cnr.properties +3 -3
  51. package/src/sap/ui/rta/messagebundle_cs.properties +2 -2
  52. package/src/sap/ui/rta/messagebundle_cy.properties +3 -3
  53. package/src/sap/ui/rta/messagebundle_da.properties +3 -3
  54. package/src/sap/ui/rta/messagebundle_de.properties +3 -3
  55. package/src/sap/ui/rta/messagebundle_el.properties +3 -3
  56. package/src/sap/ui/rta/messagebundle_en.properties +3 -3
  57. package/src/sap/ui/rta/messagebundle_en_GB.properties +3 -3
  58. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +2 -1
  59. package/src/sap/ui/rta/messagebundle_es.properties +2 -2
  60. package/src/sap/ui/rta/messagebundle_es_MX.properties +3 -3
  61. package/src/sap/ui/rta/messagebundle_et.properties +3 -3
  62. package/src/sap/ui/rta/messagebundle_fi.properties +3 -3
  63. package/src/sap/ui/rta/messagebundle_fr.properties +3 -3
  64. package/src/sap/ui/rta/messagebundle_fr_CA.properties +3 -3
  65. package/src/sap/ui/rta/messagebundle_hi.properties +3 -3
  66. package/src/sap/ui/rta/messagebundle_hr.properties +3 -3
  67. package/src/sap/ui/rta/messagebundle_hu.properties +2 -2
  68. package/src/sap/ui/rta/messagebundle_id.properties +4 -4
  69. package/src/sap/ui/rta/messagebundle_it.properties +4 -4
  70. package/src/sap/ui/rta/messagebundle_iw.properties +3 -3
  71. package/src/sap/ui/rta/messagebundle_ja.properties +3 -3
  72. package/src/sap/ui/rta/messagebundle_kk.properties +3 -3
  73. package/src/sap/ui/rta/messagebundle_ko.properties +3 -3
  74. package/src/sap/ui/rta/messagebundle_lt.properties +3 -3
  75. package/src/sap/ui/rta/messagebundle_lv.properties +3 -3
  76. package/src/sap/ui/rta/messagebundle_mk.properties +3 -3
  77. package/src/sap/ui/rta/messagebundle_ms.properties +3 -3
  78. package/src/sap/ui/rta/messagebundle_nl.properties +3 -3
  79. package/src/sap/ui/rta/messagebundle_no.properties +4 -4
  80. package/src/sap/ui/rta/messagebundle_pl.properties +3 -3
  81. package/src/sap/ui/rta/messagebundle_pt.properties +3 -3
  82. package/src/sap/ui/rta/messagebundle_pt_PT.properties +3 -3
  83. package/src/sap/ui/rta/messagebundle_ro.properties +3 -3
  84. package/src/sap/ui/rta/messagebundle_ru.properties +5 -5
  85. package/src/sap/ui/rta/messagebundle_sh.properties +3 -3
  86. package/src/sap/ui/rta/messagebundle_sk.properties +3 -3
  87. package/src/sap/ui/rta/messagebundle_sl.properties +3 -3
  88. package/src/sap/ui/rta/messagebundle_sr.properties +3 -3
  89. package/src/sap/ui/rta/messagebundle_sv.properties +3 -3
  90. package/src/sap/ui/rta/messagebundle_th.properties +3 -3
  91. package/src/sap/ui/rta/messagebundle_tr.properties +3 -3
  92. package/src/sap/ui/rta/messagebundle_uk.properties +3 -3
  93. package/src/sap/ui/rta/messagebundle_vi.properties +3 -3
  94. package/src/sap/ui/rta/messagebundle_zh_CN.properties +3 -3
  95. package/src/sap/ui/rta/messagebundle_zh_TW.properties +3 -3
  96. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  97. package/src/sap/ui/rta/plugin/AddXMLPlugin.js +1 -1
  98. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  99. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  100. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  101. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  102. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  103. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  104. package/src/sap/ui/rta/plugin/ExtendControllerPlugin.js +1 -1
  105. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  106. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  107. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  108. package/src/sap/ui/rta/plugin/Remove.js +1 -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.fragment.xml +2 -0
  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/annotations/AnnotationChangeDialog.js +1 -1
  121. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +1 -1
  122. package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +1 -1
  123. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  124. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +12 -91
  125. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +15 -3
  126. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +257 -89
  127. package/src/sap/ui/rta/plugin/rename/Rename.js +1 -1
  128. package/src/sap/ui/rta/plugin/rename/RenameDialog.fragment.xml +1 -0
  129. package/src/sap/ui/rta/plugin/rename/RenameDialog.js +1 -1
  130. package/src/sap/ui/rta/service/Action.js +1 -1
  131. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  132. package/src/sap/ui/rta/service/Outline.js +1 -1
  133. package/src/sap/ui/rta/service/Property.js +1 -1
  134. package/src/sap/ui/rta/service/Selection.js +1 -1
  135. package/src/sap/ui/rta/service/SupportTools.js +1 -1
  136. package/src/sap/ui/rta/themes/base/ContextMenu.less +1 -1
  137. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +9 -4
  138. package/src/sap/ui/rta/toolbar/Adaptation.js +54 -2
  139. package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +7 -9
  140. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  141. package/src/sap/ui/rta/toolbar/BaseRenderer.js +12 -17
  142. package/src/sap/ui/rta/toolbar/Fiori.js +5 -1
  143. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  144. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  145. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  146. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
  147. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  148. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  149. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  150. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  151. package/src/sap/ui/rta/util/ReloadManager.js +15 -12
  152. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  153. package/src/sap/ui/rta/util/ServiceManager.js +1 -1
  154. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
  155. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
  156. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +1 -1
  157. package/src/sap/ui/rta/util/changeVisualization/resolveBinding.js +1 -1
  158. package/src/sap/ui/rta/util/guidedTour/GuidedTour.js +3 -1
  159. package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +1 -1
  160. package/src/sap/ui/rta/util/whatsNew/whatsNewContent/whatsNewImages/ExtendedActions.png +0 -0
@@ -6,7 +6,12 @@
6
6
  sap.ui.define([
7
7
  "sap/base/util/Deferred",
8
8
  "sap/base/Log",
9
+ "sap/m/HBox",
10
+ "sap/m/Label",
11
+ "sap/m/MultiInput",
12
+ "sap/m/Switch",
9
13
  "sap/m/Token",
14
+ "sap/m/VBox",
10
15
  "sap/ui/core/mvc/Controller",
11
16
  "sap/ui/core/Element",
12
17
  "sap/ui/core/Lib",
@@ -19,7 +24,12 @@ sap.ui.define([
19
24
  ], function(
20
25
  Deferred,
21
26
  Log,
27
+ HBox,
28
+ Label,
29
+ MultiInput,
30
+ Switch,
22
31
  Token,
32
+ VBox,
23
33
  Controller,
24
34
  Element,
25
35
  Lib,
@@ -33,13 +43,14 @@ sap.ui.define([
33
43
  "use strict";
34
44
 
35
45
  // shortcut for sap.ui.core.ValueState
36
- var { ValueState } = coreLibrary;
46
+ const { ValueState } = coreLibrary;
37
47
 
38
48
  const _oTextResources = Lib.getResourceBundleFor("sap.ui.rta");
39
49
 
40
- var _aTextInputFields = ["frameUrl", "title"];
41
- var _aNumericInputFields = ["frameWidth", "frameHeight"];
42
- var _aOtherInputFields = ["frameWidthUnit", "frameHeightUnit", "advancedSettings"];
50
+ const _aTextInputFields = ["frameUrl", "title"];
51
+ const _aNumericInputFields = ["frameWidth", "frameHeight"];
52
+ const _aUnitInputFields = ["frameWidthUnit", "frameHeightUnit"];
53
+ const _aAllConfigFields = _aTextInputFields.concat(_aNumericInputFields, _aUnitInputFields, ["advancedSettings"]);
43
54
 
44
55
  function isValidUrl(sUrl) {
45
56
  if (
@@ -67,6 +78,17 @@ sap.ui.define([
67
78
  oIFramePreview.setProperty(sIFramePropertyName, sValue + sUnit);
68
79
  }
69
80
 
81
+ function setURLErrorMessage(sError) {
82
+ const sErrorKey = {
83
+ [IFrame.VALIDATION_ERROR.UNSAFE_PROTOCOL]: "IFRAME_ADDIFRAME_ERROR_UNSAFE_PROTOCOL",
84
+ [IFrame.VALIDATION_ERROR.MIXED_CONTENT]: "IFRAME_ADDIFRAME_ERROR_MIXED_CONTENT",
85
+ [IFrame.VALIDATION_ERROR.FORBIDDEN_URL]: "IFRAME_ADDIFRAME_ERROR_FORBIDDEN_URL",
86
+ [IFrame.VALIDATION_ERROR.INVALID_URL]: "IFRAME_ADDIFRAME_ERROR_INVALID_URL"
87
+ }[sError];
88
+ const sErrorText = _oTextResources.getText(sErrorKey);
89
+ this._oJSONModel.setProperty("/frameUrlError/value", sErrorText);
90
+ }
91
+
70
92
  return Controller.extend("sap.ui.rta.plugin.iframe.AddIFrameDialogController", {
71
93
  constructor: function(oJSONModel, mSettings) {
72
94
  this._oJSONModel = oJSONModel;
@@ -75,17 +97,84 @@ sap.ui.define([
75
97
 
76
98
  onBeforeOpen() {
77
99
  this._oJSONModel.setProperty("/initialFrameUrl/value", this._oJSONModel.getProperty("/frameUrl/value"));
100
+ this._storeInitialConfiguration();
78
101
  // Configure the MultiInput field
79
102
  // This syntax is the suggested way by the UI5 documentation to trigger a submit on the input field on focus loss
80
103
  const oMultiInput = Element.getElementById("sapUiRtaAddIFrameDialog_AddAdditionalParametersInput");
81
104
  oMultiInput.addValidator(multiInputValidator);
82
105
  },
83
106
 
107
+ /**
108
+ * Factory function to create controls for advanced settings Grid content
109
+ * @param {string} sId - Generated ID for the control
110
+ * @param {sap.ui.model.Context} oContext - Binding context
111
+ * @returns {sap.ui.core.Control} Control (HBox with Switch or VBox with MultiInput)
112
+ */
113
+ createAdvancedSettingsControl(sId, oContext) {
114
+ const oSetting = oContext.getObject();
115
+
116
+ // MultiInput for additional sandbox parameters
117
+ if (oSetting.isMultiInput) {
118
+ const oLabel = new Label("sapUiRtaAddIFrameDialog_AddAdditionalParametersLabel", {
119
+ text: "{i18n>IFRAME_ADDIFRAME_ADD_ADDITIONAL_SANDBOX_PARAMETERS_LABEL}",
120
+ labelFor: "sapUiRtaAddIFrameDialog_AddAdditionalParametersInput"
121
+ });
122
+
123
+ const oMultiInput = new MultiInput("sapUiRtaAddIFrameDialog_AddAdditionalParametersInput", {
124
+ placeholder: "{i18n>IFRAME_ADDIFRAME_ADD_ADDITIONAL_SANDBOX_PARAMETERS_PLACEHOLDER}",
125
+ showValueHelp: false,
126
+ tokenUpdate: this.onTokenUpdate.bind(this)
127
+ });
128
+
129
+ // Set up token binding programmatically
130
+ oMultiInput.bindAggregation("tokens", {
131
+ path: "dialogInfo>/advancedSettings/value/additionalSandboxParameters",
132
+ template: new Token({
133
+ text: "{dialogInfo>}",
134
+ key: "{dialogInfo>}"
135
+ }),
136
+ templateShareable: false
137
+ });
138
+
139
+ return new VBox(sId, {
140
+ items: [oLabel, oMultiInput]
141
+ });
142
+ }
143
+
144
+ // Switch for boolean settings
145
+ const oSwitch = new Switch(`sapUiRtaAddIFrameDialog_${oSetting.key}Switch`, {
146
+ state: `{dialogInfo>/advancedSettings/value/${oSetting.key}}`,
147
+ customTextOn: " ",
148
+ customTextOff: " ",
149
+ change: this.onSwitchChange.bind(this)
150
+ });
151
+
152
+ const oLabel = new Label({
153
+ text: oSetting.label
154
+ });
155
+
156
+ return new HBox(sId, {
157
+ alignItems: "Center",
158
+ items: [oSwitch, oLabel]
159
+ });
160
+ },
161
+
84
162
  onSwitchChange() {
85
- this._checkIfAllFieldsValid(true);
163
+ this._checkIfSaveIsEnabled(true);
86
164
  this._oJSONModel.setProperty("/settingsUpdate/value", true);
87
165
  },
88
166
 
167
+ /**
168
+ * Event handler for URL live change
169
+ * Enables the Save button immediately when content is typed
170
+ */
171
+ onUrlLiveChange() {
172
+ // Clear any previous URL error to make typing user friendly
173
+ this._oJSONModel.setProperty("/frameUrlError/value", "");
174
+ // Check if save should be enabled based on changes (without full URL validation)
175
+ this._checkIfSaveIsEnabled(true);
176
+ },
177
+
89
178
  /**
90
179
  * Event handler for token update
91
180
  * @param {sap.ui.base.Event} oEvent - Event
@@ -94,20 +183,18 @@ sap.ui.define([
94
183
  let aSandboxParameters = this._oJSONModel.getProperty("/advancedSettings/value/additionalSandboxParameters");
95
184
 
96
185
  if (oEvent.getParameter("type") === "added") {
97
- oEvent.getParameter("addedTokens").forEach(function(oToken) {
186
+ oEvent.getParameter("addedTokens").forEach((oToken) => {
98
187
  aSandboxParameters = [...aSandboxParameters, oToken.getText()];
99
188
  });
100
189
  } else if (oEvent.getParameter("type") === "removed") {
101
- oEvent.getParameter("removedTokens").forEach(function(oToken) {
102
- aSandboxParameters = aSandboxParameters.filter(function(sText) {
103
- return sText !== oToken.getText();
104
- });
190
+ oEvent.getParameter("removedTokens").forEach((oToken) => {
191
+ aSandboxParameters = aSandboxParameters.filter((sText) => sText !== oToken.getText());
105
192
  });
106
193
  }
107
194
 
108
195
  this._oJSONModel.setProperty("/advancedSettings/value/additionalSandboxParameters", aSandboxParameters);
109
196
  this._oJSONModel.setProperty("/settingsUpdate/value", true);
110
- this._checkIfAllFieldsValid(true);
197
+ this._checkIfSaveIsEnabled(true);
111
198
  },
112
199
 
113
200
  /**
@@ -116,7 +203,7 @@ sap.ui.define([
116
203
  */
117
204
  onValidationSuccess(oEvent) {
118
205
  oEvent.getSource().setValueState(ValueState.None);
119
- this._checkIfAllFieldsValid(true);
206
+ this._checkIfSaveIsEnabled(true);
120
207
  },
121
208
 
122
209
  /**
@@ -125,16 +212,25 @@ sap.ui.define([
125
212
  */
126
213
  onValidationError(oEvent) {
127
214
  oEvent.getSource().setValueState(ValueState.Error);
128
- this._checkIfAllFieldsValid(false);
215
+ this._checkIfSaveIsEnabled(false);
129
216
  this._setFocusOnInvalidInput();
130
217
  },
131
218
 
132
219
  /**
133
220
  * Event handler for save button
221
+ * Validates the URL before saving - if invalid, shows error and disables Save button
134
222
  */
135
223
  async onSavePress() {
136
224
  const sUrl = await this._buildPreviewURL();
137
- if (isValidUrl(sUrl).result && this._areAllTextFieldsValid() && this._areAllValueStateNones()) {
225
+ const { result: bResult, error: sError } = isValidUrl(sUrl);
226
+
227
+ if (!bResult) {
228
+ setURLErrorMessage.call(this, sError);
229
+ this._checkIfSaveIsEnabled(false);
230
+ return;
231
+ }
232
+
233
+ if (this._areAllTextFieldsValid() && this._areAllValueStateNones()) {
138
234
  this._close(this._buildReturnedSettings());
139
235
  } else {
140
236
  this._setFocusOnInvalidInput();
@@ -191,8 +287,8 @@ sap.ui.define([
191
287
  * @param {sap.ui.base.Event} oEvent - Event
192
288
  */
193
289
  onLiveChange(oEvent) {
194
- var oFilter = new Filter("label", FilterOperator.Contains, oEvent.getParameter("newValue"));
195
- var oBinding = Element.getElementById("sapUiRtaAddIFrameDialog_ParameterTable").getBinding("items");
290
+ const oFilter = new Filter("label", FilterOperator.Contains, oEvent.getParameter("newValue"));
291
+ const oBinding = Element.getElementById("sapUiRtaAddIFrameDialog_ParameterTable").getBinding("items");
196
292
  oBinding.filter([oFilter]);
197
293
  },
198
294
 
@@ -208,7 +304,7 @@ sap.ui.define([
208
304
  // Extract "/frameWidth" or "/frameHeight" from the binding path (e.g. /frameWidth/value)
209
305
  const sPropertyName = sPropertyPath.replace(/\/value$/, "");
210
306
  setNewPreviewSize.call(this, sPropertyName);
211
- this._checkIfAllFieldsValid(true);
307
+ this._checkIfSaveIsEnabled(true);
212
308
  },
213
309
 
214
310
  /**
@@ -223,7 +319,7 @@ sap.ui.define([
223
319
  // Extract "/frameWidth" or "/frameHeight" from the binding path (e.g. /frameWidthUnit/value)
224
320
  const sPropertyName = sPropertyPath.replace(/Unit\/value$/, "");
225
321
  setNewPreviewSize.call(this, sPropertyName);
226
- this._checkIfAllFieldsValid(true);
322
+ this._checkIfSaveIsEnabled(true);
227
323
  },
228
324
 
229
325
  /**
@@ -272,13 +368,17 @@ sap.ui.define([
272
368
  _addURLParameter(oObject) {
273
369
  const sParameterKey = oObject.key;
274
370
  let sParameterString;
275
- // If the type is available, this is an OData V4 Model and the target type must be set to 'any' when adding the parameter
276
- // to the URL to prevent it from being resolved to a localized value.
277
- // E.g. boolean is resolved to "yes/no" in a system with English locale - but we need to add "true/false" to the URL
278
- // The only type that does not require this special handling is Edm.String
371
+ const [, sParameter] = sParameterKey.match(/\{(.+?)\}/);
279
372
  if (oObject.type && oObject.type !== "Edm.String") {
280
- const [, sParameter] = sParameterKey.match(/\{(.+?)\}/);
373
+ // If the type is available, this is an OData V4 Model and the target type must be set to 'any' when adding the parameter
374
+ // to the URL to prevent it from being resolved to a localized value.
375
+ // E.g. boolean is resolved to "yes/no" in a system with English locale - but we need to add "true/false" to the URL
376
+ // The only type that does not require this special handling is Edm.String
281
377
  sParameterString = `{path:'${sParameter}',targetType:'any'}`;
378
+ } else if (sParameter.startsWith("@")) {
379
+ // Parameters starting with "@" (e.g. @odata.context) need special handling
380
+ // to avoid issues with the binding syntax
381
+ sParameterString = `{=%{${sParameter}}}`;
282
382
  } else {
283
383
  sParameterString = sParameterKey;
284
384
  }
@@ -300,19 +400,101 @@ sap.ui.define([
300
400
  },
301
401
 
302
402
  /**
303
- * Triggers the validation of all fields and updates the "areAllFieldsValid" property in the model
304
- * This property is also used to enable/disable the Save button, hence the check must be called after every update on the dialog
403
+ * Stores the initial configuration values when the dialog opens.
404
+ * This is used to detect if any changes were made.
405
+ *
406
+ * @private
407
+ */
408
+ _storeInitialConfiguration() {
409
+ this._mInitialConfiguration = {};
410
+ const aAdvancedSettingsConfig = this._oJSONModel.getProperty("/advancedSettingsConfig");
411
+ _aAllConfigFields.forEach((sFieldName) => {
412
+ const vValue = this._oJSONModel.getProperty(`/${sFieldName}/value`);
413
+ // For advancedSettings, store each property individually to avoid reference issues
414
+ if (sFieldName === "advancedSettings") {
415
+ const mStoredSettings = {};
416
+ // Use explicit false for undefined boolean values since switches default to false
417
+ aAdvancedSettingsConfig.forEach((oSetting) => {
418
+ mStoredSettings[oSetting.key] = vValue[oSetting.key] ?? false;
419
+ });
420
+ mStoredSettings.additionalSandboxParameters = vValue.additionalSandboxParameters
421
+ ? [...vValue.additionalSandboxParameters]
422
+ : [];
423
+ this._mInitialConfiguration.advancedSettings = mStoredSettings;
424
+ } else if (vValue !== null && typeof vValue === "object") {
425
+ // Deep copy for other objects using JSON parse/stringify
426
+ this._mInitialConfiguration[sFieldName] = JSON.parse(JSON.stringify(vValue));
427
+ } else {
428
+ this._mInitialConfiguration[sFieldName] = vValue;
429
+ }
430
+ });
431
+ },
432
+
433
+ /**
434
+ * Checks if any configuration field has been modified compared to the initial state.
435
+ *
436
+ * @returns {boolean} True if any configuration was modified
437
+ * @private
438
+ */
439
+ _hasConfigurationChanged() {
440
+ if (!this._mInitialConfiguration) {
441
+ return true; // No initial config stored (e.g. new iframe)
442
+ }
443
+
444
+ const aAdvancedSettingsConfig = this._oJSONModel.getProperty("/advancedSettingsConfig");
445
+ return _aAllConfigFields.some((sFieldName) => {
446
+ const vCurrentValue = this._oJSONModel.getProperty(`/${sFieldName}/value`);
447
+ const vInitialValue = this._mInitialConfiguration[sFieldName];
448
+
449
+ // Handle advancedSettings by comparing each property individually
450
+ if (sFieldName === "advancedSettings") {
451
+ // Compare boolean switches using nullish coalescing to handle undefined values
452
+ const bSwitchChanged = aAdvancedSettingsConfig.some((oSetting) => {
453
+ if (oSetting.key === "additionalSandboxParameters") {
454
+ return false; // Array comparison is handled below
455
+ }
456
+ return (vCurrentValue[oSetting.key] ?? false) !== vInitialValue[oSetting.key];
457
+ });
458
+ if (bSwitchChanged) {
459
+ return true;
460
+ }
461
+ // Compare additionalSandboxParameters array
462
+ const aCurrentParams = vCurrentValue.additionalSandboxParameters || [];
463
+ const aInitialParams = vInitialValue.additionalSandboxParameters || [];
464
+ if (aCurrentParams.length !== aInitialParams.length) {
465
+ return true;
466
+ }
467
+ return aCurrentParams.some((vParam, iCounter) => vParam !== aInitialParams[iCounter]);
468
+ }
469
+
470
+ // Handle other objects by comparing JSON strings
471
+ if (vCurrentValue !== null && typeof vCurrentValue === "object") {
472
+ return JSON.stringify(vCurrentValue) !== JSON.stringify(vInitialValue);
473
+ }
474
+
475
+ return vCurrentValue !== vInitialValue;
476
+ });
477
+ },
478
+
479
+ /**
480
+ * Triggers the validation of all fields and updates the "saveEnabled" property in the model
481
+ * This property is used to enable/disable the Save button
482
+ * The Save button is only enabled if:
483
+ * 1. All validation checks pass
484
+ * 2. At least one configuration field was modified
305
485
  *
306
486
  * @param {boolean} bExternalValidationSuccess - Whether external validation was successful
307
487
  */
308
- _checkIfAllFieldsValid(bExternalValidationSuccess) {
309
- const bAllFieldsValid = (
488
+ _checkIfSaveIsEnabled(bExternalValidationSuccess) {
489
+ const bAllValidationsPass = (
310
490
  bExternalValidationSuccess
311
491
  && !this._oJSONModel.getProperty("/frameUrlError/value")
312
492
  && this._areAllTextFieldsValid()
313
493
  && this._areAllValueStateNones()
314
494
  );
315
- this._oJSONModel.setProperty("/areAllFieldsValid", bAllFieldsValid);
495
+ const bHasChanges = this._hasConfigurationChanged();
496
+ const bSaveEnabled = bAllValidationsPass && bHasChanges;
497
+ this._oJSONModel.setProperty("/saveEnabled", bSaveEnabled);
316
498
  },
317
499
 
318
500
  async onValidateUrl() {
@@ -321,16 +503,9 @@ sap.ui.define([
321
503
  if (bResult) {
322
504
  this._oJSONModel.setProperty("/frameUrlError/value", "");
323
505
  } else {
324
- const sErrorKey = {
325
- [IFrame.VALIDATION_ERROR.UNSAFE_PROTOCOL]: "IFRAME_ADDIFRAME_ERROR_UNSAFE_PROTOCOL",
326
- [IFrame.VALIDATION_ERROR.MIXED_CONTENT]: "IFRAME_ADDIFRAME_ERROR_MIXED_CONTENT",
327
- [IFrame.VALIDATION_ERROR.FORBIDDEN_URL]: "IFRAME_ADDIFRAME_ERROR_FORBIDDEN_URL",
328
- [IFrame.VALIDATION_ERROR.INVALID_URL]: "IFRAME_ADDIFRAME_ERROR_INVALID_URL"
329
- }[sError];
330
- const sErrorText = _oTextResources.getText(sErrorKey);
331
- this._oJSONModel.setProperty("/frameUrlError/value", sErrorText);
506
+ setURLErrorMessage.call(this, sError);
332
507
  }
333
- this._checkIfAllFieldsValid(bResult);
508
+ this._checkIfSaveIsEnabled(bResult);
334
509
  },
335
510
 
336
511
  /**
@@ -341,28 +516,25 @@ sap.ui.define([
341
516
  },
342
517
 
343
518
  onContainerTitleChange(oEvent) {
344
- var oInput = oEvent.getSource();
345
- var sValueState = "None";
346
- var bValidationError = false;
347
- var sValue = oInput.getValue();
519
+ const oInput = oEvent.getSource();
520
+ const sValue = oInput.getValue();
521
+ let sValueState = ValueState.None;
348
522
 
349
523
  if (sValue.trim() === "") {
350
- sValueState = "Error";
351
- oInput.setValueState(sValueState);
352
- this._oJSONModel.setProperty("/areAllFieldsValid", false);
524
+ oInput.setValueState(ValueState.Error);
525
+ this._oJSONModel.setProperty("/saveEnabled", false);
353
526
  return true;
354
527
  }
355
528
 
356
529
  try {
357
530
  validateText(sValue);
358
531
  } catch (oException) {
359
- sValueState = "Error";
360
- bValidationError = true;
532
+ sValueState = ValueState.Error;
361
533
  }
362
534
 
363
- this._checkIfAllFieldsValid(!bValidationError);
364
535
  oInput.setValueState(sValueState);
365
- return bValidationError;
536
+ this._checkIfSaveIsEnabled(sValueState === ValueState.None);
537
+ return sValueState === ValueState.Error;
366
538
  },
367
539
 
368
540
  /**
@@ -372,7 +544,7 @@ sap.ui.define([
372
544
  * @private
373
545
  */
374
546
  _close(mSettings) {
375
- var oAddIFrameDialog = Element.getElementById("sapUiRtaAddIFrameDialog");
547
+ const oAddIFrameDialog = Element.getElementById("sapUiRtaAddIFrameDialog");
376
548
  this._mSettings = mSettings;
377
549
  oAddIFrameDialog.close();
378
550
  },
@@ -388,37 +560,33 @@ sap.ui.define([
388
560
  },
389
561
 
390
562
  _areAllValueStateNones() {
391
- var oData = this._oJSONModel.getData();
392
- return _aTextInputFields.concat(_aNumericInputFields).every(function(sFieldName) {
563
+ const oData = this._oJSONModel.getData();
564
+ return _aTextInputFields.concat(_aNumericInputFields).every((sFieldName) => {
393
565
  return oData[sFieldName].valueState === ValueState.None;
394
- }, this);
566
+ });
395
567
  },
396
568
 
397
569
  _areAllTextFieldsValid() {
398
- var oJSONModel = this._oJSONModel;
399
- var bAsContainer = this._oJSONModel.getProperty("asContainer/value");
400
- return _aTextInputFields.reduce(function(bAllValid, sFieldName) {
570
+ const bAsContainer = this._oJSONModel.getProperty("asContainer/value");
571
+ return _aTextInputFields.every((sFieldName) => {
401
572
  // The title field is only available on add as Section
402
573
  if (sFieldName === "title" && !bAsContainer) {
403
574
  return true;
404
575
  }
405
- var sValuePath = `/${sFieldName}/value`;
406
- var sValueState;
407
- if (oJSONModel.getProperty(sValuePath).trim() === "") {
408
- sValueState = ValueState.Error;
409
- } else {
410
- sValueState = ValueState.None;
411
- }
412
- oJSONModel.setProperty(`${sValuePath}State`, sValueState);
413
- return bAllValid && sValueState === ValueState.None;
414
- }, true);
576
+ const sValuePath = `/${sFieldName}/value`;
577
+ const sValueState = this._oJSONModel.getProperty(sValuePath).trim() === ""
578
+ ? ValueState.Error
579
+ : ValueState.None;
580
+ this._oJSONModel.setProperty(`${sValuePath}State`, sValueState);
581
+ return sValueState === ValueState.None;
582
+ });
415
583
  },
416
584
 
417
585
  _buildReturnedSettings() {
418
- var mSettings = {};
419
- var oData = this._oJSONModel.getData();
420
- _aTextInputFields.concat(_aNumericInputFields, _aOtherInputFields).forEach(function(sFieldName) {
421
- var sValue = oData[sFieldName].value;
586
+ const mSettings = {};
587
+ const oData = this._oJSONModel.getData();
588
+ _aAllConfigFields.forEach((sFieldName) => {
589
+ let sValue = oData[sFieldName].value;
422
590
  if (sFieldName === "frameUrl") {
423
591
  sValue = urlCleaner(sValue);
424
592
  }
@@ -434,29 +602,30 @@ sap.ui.define([
434
602
  * @private
435
603
  */
436
604
  _importSettings(mSettings) {
437
- if (mSettings) {
438
- Object.keys(mSettings).forEach(function(sFieldName) {
439
- if (sFieldName === "frameWidth" || sFieldName === "frameHeight") {
440
- this._importIFrameSize(sFieldName, mSettings[sFieldName]);
441
- // legacy iframes do not have advancedSettings properties so we need to skip the setProperty
442
- // on the json model to not overwrite the default values with undefined
443
- } else if (sFieldName === "advancedSettings" && !mSettings[sFieldName]) {
444
- return;
445
- } else {
446
- this._oJSONModel.setProperty(`/${sFieldName}/value`, mSettings[sFieldName]);
447
- }
448
- }, this);
605
+ if (!mSettings) {
606
+ return;
449
607
  }
608
+ Object.keys(mSettings).forEach((sFieldName) => {
609
+ if (sFieldName === "frameWidth" || sFieldName === "frameHeight") {
610
+ this._importIFrameSize(sFieldName, mSettings[sFieldName]);
611
+ // Legacy iframes do not have advancedSettings properties so we need to skip the setProperty
612
+ // on the json model to not overwrite the default values with undefined
613
+ } else if (sFieldName === "advancedSettings" && !mSettings[sFieldName]) {
614
+ return;
615
+ } else {
616
+ this._oJSONModel.setProperty(`/${sFieldName}/value`, mSettings[sFieldName]);
617
+ }
618
+ });
450
619
  },
451
620
 
452
621
  /**
453
622
  * Import IFrame size
454
623
  *
455
- * @param {string} sFieldName - Field name
456
- * @param {string} sSize - Size to import
624
+ * @param {string} sFieldName - Field name
625
+ * @param {string} sSize - Size to import
457
626
  */
458
627
  _importIFrameSize(sFieldName, sSize) {
459
- var aResults = sSize.split(/(px|rem|%|vh)/);
628
+ const aResults = sSize.split(/(px|rem|%|vh)/);
460
629
  if (aResults.length >= 2) {
461
630
  this._oJSONModel.setProperty(`/${sFieldName}/value`, parseFloat(aResults[0]));
462
631
  this._oJSONModel.setProperty(`/${sFieldName}Unit/value`, aResults[1]);
@@ -468,18 +637,17 @@ sap.ui.define([
468
637
  * Processed on saving the dialog
469
638
  * Only numerical values are checked
470
639
  * An empty URL field disables the Save button and does not need to be checked
471
- *
472
640
  */
473
641
  _setFocusOnInvalidInput() {
474
- var oData = this._oJSONModel.getData();
475
- _aNumericInputFields.some(function(sFieldName) {
642
+ const oData = this._oJSONModel.getData();
643
+ _aNumericInputFields.some((sFieldName) => {
476
644
  if (oData[sFieldName].valueState === ValueState.Error) {
477
- var oElement = Element.getElementById(oData[sFieldName].id);
645
+ const oElement = Element.getElementById(oData[sFieldName].id);
478
646
  oElement.focus();
479
647
  return true;
480
648
  }
481
649
  return false;
482
- }, this);
650
+ });
483
651
  }
484
652
  });
485
653
  });
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  * @extends sap.ui.rta.plugin.Plugin
29
29
  *
30
30
  * @author SAP SE
31
- * @version 1.145.0
31
+ * @version 1.146.0
32
32
  *
33
33
  * @constructor
34
34
  * @private
@@ -22,6 +22,7 @@
22
22
  text="{i18n>RENAME_DIALOG_LABEL}"
23
23
  labelFor="sapUiRtaRenameDialog_input"
24
24
  wrapping="true"
25
+ showColon="true"
25
26
  >
26
27
  <layoutData>
27
28
  <FlexItemData maxWidth="10rem" />
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @class Constructor for a new sap.ui.rta.plugin.rename.RenameDialog.
28
28
  * @extends sap.ui.base.ManagedObject
29
29
  * @author SAP SE
30
- * @version 1.145.0
30
+ * @version 1.146.0
31
31
  * @constructor
32
32
  * @since 1.136
33
33
  * @private
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @name sap.ui.rta.service.Action
25
25
  * @author SAP SE
26
26
  * @since 1.58
27
- * @version 1.145.0
27
+ * @version 1.146.0
28
28
  * @private
29
29
  * @ui5-restricted
30
30
  *
@@ -30,7 +30,7 @@ sap.ui.define([
30
30
  * @name sap.ui.rta.service.ControllerExtension
31
31
  * @author SAP SE
32
32
  * @since 1.58
33
- * @version 1.145.0
33
+ * @version 1.146.0
34
34
  * @private
35
35
  * @ui5-restricted
36
36
  */
@@ -43,7 +43,7 @@ sap.ui.define([
43
43
  * @name sap.ui.rta.service.Outline
44
44
  * @author SAP SE
45
45
  * @since 1.56
46
- * @version 1.145.0
46
+ * @version 1.146.0
47
47
  * @private
48
48
  * @ui5-restricted
49
49
  */
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @name sap.ui.rta.service.Property
28
28
  * @author SAP SE
29
29
  * @since 1.58
30
- * @version 1.145.0
30
+ * @version 1.146.0
31
31
  * @private
32
32
  * @ui5-restricted
33
33
  */
@@ -14,7 +14,7 @@ sap.ui.define(function() {
14
14
  * @name sap.ui.rta.service.Selection
15
15
  * @author SAP SE
16
16
  * @since 1.58
17
- * @version 1.145.0
17
+ * @version 1.146.0
18
18
  * @private
19
19
  * @ui5-restricted
20
20
  */
@@ -30,7 +30,7 @@ sap.ui.define([
30
30
  * @name sap.ui.rta.service.SupportTools
31
31
  * @author SAP SE
32
32
  * @since 1.106
33
- * @version 1.145.0
33
+ * @version 1.146.0
34
34
  * @private
35
35
  * @ui5-restricted
36
36
  */
@@ -16,7 +16,7 @@
16
16
  @_sap_ui_rta_ContextMenu_BorderDarkColor 0.25rem,
17
17
  @_sap_ui_rta_ContextMenu_BorderLightColor 0.25rem,
18
18
  @_sap_ui_rta_ContextMenu_BorderLightColor 0.375rem) 4;
19
- box-shadow: var(--sapContent_Shadow2);
19
+ box-shadow: var(--sapContent_Shadow1);
20
20
  }
21
21
  }
22
22
  }