@openui5/sap.ui.rta 1.103.0 → 1.105.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.
- package/.reuse/dep5 +18 -1
- package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
- package/THIRDPARTY.txt +36 -3
- package/package.json +6 -6
- package/src/sap/ui/rta/.library +1 -1
- package/src/sap/ui/rta/Client.js +1 -1
- package/src/sap/ui/rta/RuntimeAuthoring.js +83 -406
- package/src/sap/ui/rta/Utils.js +2 -2
- package/src/sap/ui/rta/api/startAdaptation.js +2 -2
- package/src/sap/ui/rta/api/startKeyUserAdaptation.js +2 -2
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +6 -22
- package/src/sap/ui/rta/appVariant/Feature.js +4 -12
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +5 -3
- package/src/sap/ui/rta/command/AddIFrame.js +1 -1
- package/src/sap/ui/rta/command/AddProperty.js +1 -1
- package/src/sap/ui/rta/command/AddXML.js +1 -1
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +8 -3
- package/src/sap/ui/rta/command/BaseCommand.js +1 -1
- package/src/sap/ui/rta/command/BindProperty.js +1 -1
- package/src/sap/ui/rta/command/Combine.js +1 -1
- package/src/sap/ui/rta/command/CommandFactory.js +1 -1
- package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +4 -2
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +5 -3
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +5 -4
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/CreateContainer.js +1 -1
- package/src/sap/ui/rta/command/CustomAdd.js +1 -1
- package/src/sap/ui/rta/command/FlexCommand.js +4 -2
- package/src/sap/ui/rta/command/LREPSerializer.js +11 -8
- package/src/sap/ui/rta/command/LocalReset.js +1 -1
- package/src/sap/ui/rta/command/Move.js +1 -1
- package/src/sap/ui/rta/command/Property.js +1 -1
- package/src/sap/ui/rta/command/Remove.js +1 -1
- package/src/sap/ui/rta/command/Rename.js +1 -1
- package/src/sap/ui/rta/command/Resize.js +1 -1
- package/src/sap/ui/rta/command/Reveal.js +1 -1
- package/src/sap/ui/rta/command/Settings.js +1 -1
- package/src/sap/ui/rta/command/Split.js +1 -1
- package/src/sap/ui/rta/command/Stack.js +3 -3
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +6 -4
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +6 -4
- package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +15 -11
- package/src/sap/ui/rta/messagebundle_ar.properties +23 -9
- package/src/sap/ui/rta/messagebundle_bg.properties +24 -10
- package/src/sap/ui/rta/messagebundle_ca.properties +24 -10
- package/src/sap/ui/rta/messagebundle_cs.properties +23 -9
- package/src/sap/ui/rta/messagebundle_cy.properties +21 -7
- package/src/sap/ui/rta/messagebundle_da.properties +25 -11
- package/src/sap/ui/rta/messagebundle_de.properties +25 -11
- package/src/sap/ui/rta/messagebundle_el.properties +24 -10
- package/src/sap/ui/rta/messagebundle_en.properties +25 -11
- package/src/sap/ui/rta/messagebundle_en_GB.properties +25 -11
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +18 -11
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +14 -2
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +26 -12
- package/src/sap/ui/rta/messagebundle_es.properties +21 -7
- package/src/sap/ui/rta/messagebundle_es_MX.properties +19 -5
- package/src/sap/ui/rta/messagebundle_et.properties +21 -7
- package/src/sap/ui/rta/messagebundle_fi.properties +25 -11
- package/src/sap/ui/rta/messagebundle_fr.properties +22 -8
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +24 -10
- package/src/sap/ui/rta/messagebundle_hi.properties +24 -10
- package/src/sap/ui/rta/messagebundle_hr.properties +23 -9
- package/src/sap/ui/rta/messagebundle_hu.properties +17 -3
- package/src/sap/ui/rta/messagebundle_id.properties +23 -9
- package/src/sap/ui/rta/messagebundle_it.properties +24 -10
- package/src/sap/ui/rta/messagebundle_iw.properties +24 -10
- package/src/sap/ui/rta/messagebundle_ja.properties +24 -10
- package/src/sap/ui/rta/messagebundle_kk.properties +24 -10
- package/src/sap/ui/rta/messagebundle_ko.properties +24 -10
- package/src/sap/ui/rta/messagebundle_lt.properties +23 -9
- package/src/sap/ui/rta/messagebundle_lv.properties +21 -7
- package/src/sap/ui/rta/messagebundle_ms.properties +25 -11
- package/src/sap/ui/rta/messagebundle_nl.properties +25 -11
- package/src/sap/ui/rta/messagebundle_no.properties +24 -10
- package/src/sap/ui/rta/messagebundle_pl.properties +23 -9
- package/src/sap/ui/rta/messagebundle_pt.properties +24 -10
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +23 -9
- package/src/sap/ui/rta/messagebundle_ro.properties +23 -9
- package/src/sap/ui/rta/messagebundle_ru.properties +24 -10
- package/src/sap/ui/rta/messagebundle_sh.properties +25 -11
- package/src/sap/ui/rta/messagebundle_sk.properties +23 -9
- package/src/sap/ui/rta/messagebundle_sl.properties +21 -7
- package/src/sap/ui/rta/messagebundle_sv.properties +25 -11
- package/src/sap/ui/rta/messagebundle_th.properties +27 -13
- package/src/sap/ui/rta/messagebundle_tr.properties +24 -10
- package/src/sap/ui/rta/messagebundle_uk.properties +25 -11
- package/src/sap/ui/rta/messagebundle_vi.properties +24 -10
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +24 -10
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +23 -9
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
- package/src/sap/ui/rta/plugin/Combine.js +1 -1
- package/src/sap/ui/rta/plugin/CompVariant.js +2 -2
- package/src/sap/ui/rta/plugin/ControlVariant.js +21 -15
- package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
- package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
- package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
- package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
- package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
- package/src/sap/ui/rta/plugin/Plugin.js +1 -1
- package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
- package/src/sap/ui/rta/plugin/Remove.js +1 -1
- package/src/sap/ui/rta/plugin/Rename.js +1 -1
- package/src/sap/ui/rta/plugin/RenameHandler.js +23 -5
- package/src/sap/ui/rta/plugin/Resize.js +1 -1
- package/src/sap/ui/rta/plugin/Selection.js +12 -1
- package/src/sap/ui/rta/plugin/Settings.js +1 -1
- package/src/sap/ui/rta/plugin/Split.js +1 -1
- package/src/sap/ui/rta/plugin/Stretch.js +5 -3
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +5 -5
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
- package/src/sap/ui/rta/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +8 -9
- package/src/sap/ui/rta/service/Outline.js +1 -1
- package/src/sap/ui/rta/service/Property.js +1 -1
- package/src/sap/ui/rta/service/Selection.js +1 -1
- package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +19 -4
- package/src/sap/ui/rta/toolbar/Adaptation.js +6 -4
- package/src/sap/ui/rta/toolbar/Base.js +8 -4
- package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
- package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
- package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
- package/src/sap/ui/rta/util/PluginManager.js +1 -1
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- package/src/sap/ui/rta/util/ReloadManager.js +331 -0
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +14 -8
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +100 -51
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +100 -55
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +41 -106
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/categories/CombineVisualization.js +87 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/MoveVisualization.js +4 -4
- package/src/sap/ui/rta/util/changeVisualization/categories/RenameVisualization.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/categories/SplitVisualization.js +6 -4
- package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +11 -3
|
@@ -8,13 +8,10 @@ sap.ui.define([
|
|
|
8
8
|
"sap/ui/core/Fragment",
|
|
9
9
|
"sap/base/util/restricted/_difference",
|
|
10
10
|
"sap/base/util/deepEqual",
|
|
11
|
-
"sap/base/Log",
|
|
12
11
|
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
13
12
|
"sap/ui/core/Control",
|
|
14
13
|
"sap/ui/dt/OverlayRegistry",
|
|
15
14
|
"sap/ui/dt/ElementUtil",
|
|
16
|
-
"sap/ui/fl/apply/_internal/changes/Utils",
|
|
17
|
-
"sap/ui/fl/write/api/ChangesWriteAPI",
|
|
18
15
|
"sap/ui/fl/write/api/PersistenceWriteAPI",
|
|
19
16
|
"sap/ui/fl/Layer",
|
|
20
17
|
"sap/ui/fl/Utils",
|
|
@@ -26,13 +23,10 @@ sap.ui.define([
|
|
|
26
23
|
Fragment,
|
|
27
24
|
difference,
|
|
28
25
|
deepEqual,
|
|
29
|
-
Log,
|
|
30
26
|
JsControlTreeModifier,
|
|
31
27
|
Control,
|
|
32
28
|
OverlayRegistry,
|
|
33
29
|
ElementUtil,
|
|
34
|
-
ChangesUtils,
|
|
35
|
-
ChangesWriteAPI,
|
|
36
30
|
PersistenceWriteAPI,
|
|
37
31
|
Layer,
|
|
38
32
|
FlUtils,
|
|
@@ -93,7 +87,7 @@ sap.ui.define([
|
|
|
93
87
|
* @alias sap.ui.rta.util.changeVisualization.ChangeVisualization
|
|
94
88
|
* @author SAP SE
|
|
95
89
|
* @since 1.84.0
|
|
96
|
-
* @version 1.
|
|
90
|
+
* @version 1.105.0
|
|
97
91
|
* @private
|
|
98
92
|
*/
|
|
99
93
|
var ChangeVisualization = Control.extend("sap.ui.rta.util.changeVisualization.ChangeVisualization", {
|
|
@@ -122,11 +116,12 @@ sap.ui.define([
|
|
|
122
116
|
}
|
|
123
117
|
},
|
|
124
118
|
constructor: function() {
|
|
125
|
-
Control.prototype.constructor.apply(this, arguments);
|
|
126
|
-
|
|
127
119
|
this._oChangeIndicatorRegistry = new ChangeIndicatorRegistry({
|
|
128
120
|
commandCategories: VALID_COMMANDS
|
|
129
121
|
});
|
|
122
|
+
|
|
123
|
+
Control.prototype.constructor.apply(this, arguments);
|
|
124
|
+
|
|
130
125
|
this._oTextBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
131
126
|
this.setModel(new ResourceModel({
|
|
132
127
|
bundle: this._oTextBundle
|
|
@@ -149,6 +144,7 @@ sap.ui.define([
|
|
|
149
144
|
this._reset();
|
|
150
145
|
}
|
|
151
146
|
this.setProperty("rootControlId", sRootControlId);
|
|
147
|
+
this._oChangeIndicatorRegistry.setRootControlId(sRootControlId);
|
|
152
148
|
};
|
|
153
149
|
|
|
154
150
|
ChangeVisualization.prototype._getComponent = function() {
|
|
@@ -274,15 +270,12 @@ sap.ui.define([
|
|
|
274
270
|
*/
|
|
275
271
|
ChangeVisualization.prototype.onCommandCategorySelection = function(oEvent) {
|
|
276
272
|
var sSelectedCommandCategory = oEvent.getSource().getBindingContext("visualizationModel").getObject().key;
|
|
277
|
-
|
|
273
|
+
this._selectCommandCategory(sSelectedCommandCategory);
|
|
278
274
|
};
|
|
279
275
|
|
|
280
276
|
ChangeVisualization.prototype._selectCommandCategory = function(sSelectedCommandCategory) {
|
|
281
277
|
this._sSelectedCommandCategory = sSelectedCommandCategory;
|
|
282
278
|
|
|
283
|
-
var aRegisteredChanges = this._oChangeIndicatorRegistry.getChanges();
|
|
284
|
-
var aRelevantChanges = this._getChangesForCommandCategory(sSelectedCommandCategory, aRegisteredChanges);
|
|
285
|
-
|
|
286
279
|
var sCommandCategoryText = this._getCommandCategoryButton(sSelectedCommandCategory);
|
|
287
280
|
|
|
288
281
|
this._updateVisualizationModel({
|
|
@@ -290,52 +283,8 @@ sap.ui.define([
|
|
|
290
283
|
commandCategoryText: sCommandCategoryText
|
|
291
284
|
});
|
|
292
285
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
.then(function(mVisualizationInfo) {
|
|
296
|
-
this._oChangeIndicatorRegistry.addVisualizationInfo(
|
|
297
|
-
oChange.change.getId(),
|
|
298
|
-
mVisualizationInfo
|
|
299
|
-
);
|
|
300
|
-
}.bind(this));
|
|
301
|
-
}.bind(this)))
|
|
302
|
-
.then(function() {
|
|
303
|
-
this._updateChangeIndicators();
|
|
304
|
-
this._setFocusedIndicator();
|
|
305
|
-
}.bind(this));
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
ChangeVisualization.prototype._getVisualizationInfo = function(mChangeInformation) {
|
|
309
|
-
var oComponent = this._getComponent();
|
|
310
|
-
|
|
311
|
-
function getSelectorIds(aSelectorList) {
|
|
312
|
-
if (!aSelectorList) {
|
|
313
|
-
return undefined;
|
|
314
|
-
}
|
|
315
|
-
return aSelectorList
|
|
316
|
-
.map(function(vSelector) {
|
|
317
|
-
var oElement = typeof vSelector.getId === "function"
|
|
318
|
-
? vSelector
|
|
319
|
-
: JsControlTreeModifier.bySelector(vSelector, oComponent);
|
|
320
|
-
return oElement && oElement.getId();
|
|
321
|
-
})
|
|
322
|
-
.filter(Boolean);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
return this._getInfoFromChangeHandler(oComponent, mChangeInformation.change)
|
|
326
|
-
.then(function(oInfoFromChangeHandler) {
|
|
327
|
-
var mVisualizationInfo = oInfoFromChangeHandler || {};
|
|
328
|
-
var aAffectedElementIds = (
|
|
329
|
-
getSelectorIds(mVisualizationInfo.affectedControls || [mChangeInformation.change.getSelector()])
|
|
330
|
-
);
|
|
331
|
-
|
|
332
|
-
return {
|
|
333
|
-
affectedElementIds: aAffectedElementIds,
|
|
334
|
-
dependentElementIds: getSelectorIds(mVisualizationInfo.dependentControls) || [],
|
|
335
|
-
displayElementIds: getSelectorIds(mVisualizationInfo.displayControls) || aAffectedElementIds,
|
|
336
|
-
payload: mVisualizationInfo.payload
|
|
337
|
-
};
|
|
338
|
-
});
|
|
286
|
+
this._updateChangeIndicators();
|
|
287
|
+
this._setFocusedIndicator();
|
|
339
288
|
};
|
|
340
289
|
|
|
341
290
|
ChangeVisualization.prototype._getCommandForChange = function(oChange) {
|
|
@@ -382,36 +331,6 @@ sap.ui.define([
|
|
|
382
331
|
&& searchForCommand(OverlayRegistry.getOverlay(oLastDependentSelectorControl));
|
|
383
332
|
};
|
|
384
333
|
|
|
385
|
-
ChangeVisualization.prototype._getInfoFromChangeHandler = function(oAppComponent, oChange) {
|
|
386
|
-
var oControl = JsControlTreeModifier.bySelector(oChange.getSelector(), oAppComponent);
|
|
387
|
-
if (oControl) {
|
|
388
|
-
var mPropertyBag = {
|
|
389
|
-
modifier: JsControlTreeModifier,
|
|
390
|
-
appComponent: oAppComponent,
|
|
391
|
-
view: FlUtils.getViewForControl(oControl)
|
|
392
|
-
};
|
|
393
|
-
var mControl = ChangesUtils.getControlIfTemplateAffected(oChange, oControl, mPropertyBag);
|
|
394
|
-
return ChangesWriteAPI.getChangeHandler({
|
|
395
|
-
changeType: oChange.getChangeType(),
|
|
396
|
-
element: mControl.control,
|
|
397
|
-
modifier: JsControlTreeModifier,
|
|
398
|
-
layer: oChange.getLayer()
|
|
399
|
-
})
|
|
400
|
-
.then(function(oChangeHandler) {
|
|
401
|
-
if (oChangeHandler && typeof oChangeHandler.getChangeVisualizationInfo === "function") {
|
|
402
|
-
return oChangeHandler.getChangeVisualizationInfo(oChange, oAppComponent);
|
|
403
|
-
}
|
|
404
|
-
return undefined;
|
|
405
|
-
})
|
|
406
|
-
.catch(function(vErr) {
|
|
407
|
-
Log.error(vErr);
|
|
408
|
-
return undefined;
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
return Promise.resolve();
|
|
413
|
-
};
|
|
414
|
-
|
|
415
334
|
ChangeVisualization.prototype._collectChanges = function() {
|
|
416
335
|
var oComponent = this._getComponent();
|
|
417
336
|
var mPropertyBag = {
|
|
@@ -430,7 +349,7 @@ sap.ui.define([
|
|
|
430
349
|
var aRegisteredChangeIds = this._oChangeIndicatorRegistry.getChangeIds();
|
|
431
350
|
var oCurrentChanges = aChanges
|
|
432
351
|
.filter(function(oChange) {
|
|
433
|
-
return oChange.getFileType() ===
|
|
352
|
+
return oChange.getFileType() === "change";
|
|
434
353
|
})
|
|
435
354
|
.reduce(function(oChanges, oChange) {
|
|
436
355
|
oChanges[oChange.getId()] = oChange;
|
|
@@ -443,12 +362,14 @@ sap.ui.define([
|
|
|
443
362
|
this._oChangeIndicatorRegistry.removeChange(sChangeIdToRemove);
|
|
444
363
|
}.bind(this));
|
|
445
364
|
|
|
365
|
+
var aPromises = [];
|
|
446
366
|
// Register missing changes
|
|
447
367
|
difference(aCurrentChangeIds, aRegisteredChangeIds).forEach(function(sChangeIdToAdd) {
|
|
448
368
|
var oChangeToAdd = oCurrentChanges[sChangeIdToAdd];
|
|
449
369
|
var sCommandName = this._getCommandForChange(oChangeToAdd);
|
|
450
|
-
this._oChangeIndicatorRegistry.registerChange(oChangeToAdd, sCommandName);
|
|
370
|
+
aPromises.push(this._oChangeIndicatorRegistry.registerChange(oChangeToAdd, sCommandName));
|
|
451
371
|
}.bind(this));
|
|
372
|
+
return Promise.all(aPromises);
|
|
452
373
|
}.bind(this));
|
|
453
374
|
};
|
|
454
375
|
|
|
@@ -483,14 +404,26 @@ sap.ui.define([
|
|
|
483
404
|
var aVisualizedChanges = [];
|
|
484
405
|
Object.keys(oSelectors)
|
|
485
406
|
.forEach(function(sSelectorId) {
|
|
486
|
-
var
|
|
407
|
+
var aRelevantChanges = this._filterRelevantChanges(oSelectors[sSelectorId]);
|
|
487
408
|
var oOverlay = OverlayRegistry.getOverlay(sSelectorId);
|
|
409
|
+
if (!oOverlay) {
|
|
410
|
+
// When the selector has no Overlay, check if there is a relevant container Overlay
|
|
411
|
+
// e.g. when a SmartForm group is removed
|
|
412
|
+
aRelevantChanges.some(function(oChange) {
|
|
413
|
+
var oElementOverlay = OverlayRegistry.getOverlay(oChange.affectedElementId);
|
|
414
|
+
var oRelevantContainer = oElementOverlay && oElementOverlay.getRelevantContainer();
|
|
415
|
+
if (oRelevantContainer) {
|
|
416
|
+
oOverlay = OverlayRegistry.getOverlay(oRelevantContainer);
|
|
417
|
+
return true;
|
|
418
|
+
}
|
|
419
|
+
return false;
|
|
420
|
+
});
|
|
421
|
+
}
|
|
488
422
|
if (!oOverlay || !oOverlay.getDomRef() || !oOverlay.isVisible()) {
|
|
489
423
|
// Change is not visible
|
|
490
424
|
return undefined;
|
|
491
425
|
}
|
|
492
426
|
var oOverlayPosition = oOverlay.getDomRef().getClientRects()[0] || { left: 0, top: 0 };
|
|
493
|
-
var aRelevantChanges = this._filterRelevantChanges(aChanges);
|
|
494
427
|
aRelevantChanges.forEach(function (oChange) {
|
|
495
428
|
aVisualizedChanges.push(oChange);
|
|
496
429
|
});
|
|
@@ -500,8 +433,13 @@ sap.ui.define([
|
|
|
500
433
|
changes: aRelevantChanges
|
|
501
434
|
};
|
|
502
435
|
|
|
503
|
-
|
|
436
|
+
var oChangeIndicator = this._oChangeIndicatorRegistry.getChangeIndicator(sSelectorId);
|
|
437
|
+
var sOverlayId = oOverlay.getId();
|
|
438
|
+
if (!oChangeIndicator) {
|
|
504
439
|
this._createChangeIndicator(oOverlay, sSelectorId);
|
|
440
|
+
} else if (oChangeIndicator.getOverlayId() !== sOverlayId) {
|
|
441
|
+
// Overlay id might change, e.g. during undo/redo of dirty changes
|
|
442
|
+
oChangeIndicator.setOverlayId(sOverlayId);
|
|
505
443
|
}
|
|
506
444
|
return undefined;
|
|
507
445
|
}.bind(this));
|
|
@@ -522,18 +460,19 @@ sap.ui.define([
|
|
|
522
460
|
}
|
|
523
461
|
};
|
|
524
462
|
|
|
525
|
-
ChangeVisualization.prototype._filterRelevantChanges = function(
|
|
526
|
-
if (!Array.isArray(
|
|
527
|
-
return
|
|
463
|
+
ChangeVisualization.prototype._filterRelevantChanges = function(aChangeVizInfo) {
|
|
464
|
+
if (!Array.isArray(aChangeVizInfo)) {
|
|
465
|
+
return aChangeVizInfo;
|
|
528
466
|
}
|
|
529
467
|
var oRootData = this._oChangeVisualizationModel.getData();
|
|
530
468
|
|
|
531
|
-
return
|
|
469
|
+
return aChangeVizInfo.filter(function(oChangeVizInfo) {
|
|
532
470
|
return (
|
|
533
|
-
!
|
|
471
|
+
!oChangeVizInfo.dependent
|
|
472
|
+
&& oChangeVizInfo.commandCategory
|
|
534
473
|
&& (
|
|
535
|
-
oRootData.commandCategory ===
|
|
536
|
-
|| oRootData.commandCategory ===
|
|
474
|
+
oRootData.commandCategory === CATEGORY_ALL
|
|
475
|
+
|| oRootData.commandCategory === oChangeVizInfo.commandCategory
|
|
537
476
|
)
|
|
538
477
|
);
|
|
539
478
|
});
|
|
@@ -552,10 +491,6 @@ sap.ui.define([
|
|
|
552
491
|
oChangeIndicator.setModel(this._oChangeVisualizationModel);
|
|
553
492
|
oChangeIndicator.bindElement("/content/" + sSelectorId);
|
|
554
493
|
oChangeIndicator.setModel(this.getModel("i18n"), "i18n");
|
|
555
|
-
|
|
556
|
-
// Temporarily place the indicator in the static area
|
|
557
|
-
// It will move itself to the correct overlay after rendering
|
|
558
|
-
oChangeIndicator.placeAt(sap.ui.getCore().getStaticAreaRef());
|
|
559
494
|
this._oChangeIndicatorRegistry.registerChangeIndicator(sSelectorId, oChangeIndicator);
|
|
560
495
|
};
|
|
561
496
|
|
|
@@ -626,8 +561,8 @@ sap.ui.define([
|
|
|
626
561
|
this.setIsActive(true);
|
|
627
562
|
// show all change visualizations at startup
|
|
628
563
|
this._updateChangeRegistry()
|
|
629
|
-
.then(this._selectCommandCategory.bind(this, this._sSelectedCommandCategory))
|
|
630
564
|
.then(function() {
|
|
565
|
+
this._selectCommandCategory(this._sSelectedCommandCategory);
|
|
631
566
|
this._updateVisualizationModelMenuData();
|
|
632
567
|
oToolbar.setModel(this._oChangeVisualizationModel, "visualizationModel");
|
|
633
568
|
}.bind(this));
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/ui/core/Core",
|
|
9
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
10
|
+
"sap/ui/dt/ElementUtil",
|
|
11
|
+
"sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils"
|
|
12
|
+
], function(
|
|
13
|
+
Core,
|
|
14
|
+
JsControlTreeModifier,
|
|
15
|
+
ElementUtil,
|
|
16
|
+
ChangeVisualizationUtils
|
|
17
|
+
) {
|
|
18
|
+
"use strict";
|
|
19
|
+
|
|
20
|
+
var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
|
|
21
|
+
|
|
22
|
+
var CombineVisualization = {};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Creates a localized description for combine changes based on the provided
|
|
26
|
+
* payload containing the combined elements.
|
|
27
|
+
*
|
|
28
|
+
* @param {object} mPayload - Change visualization payload from the change handler
|
|
29
|
+
* @param {array.<string>} mPayload.originalSelectors - Selectors of the elements that were combined
|
|
30
|
+
* @param {string} sLabel - Current element label
|
|
31
|
+
* @param {object} mPropertyBag - Additional properties
|
|
32
|
+
* @param {sap.ui.core.Component} mPropertyBag.appComponent - Application component
|
|
33
|
+
* @returns {object} Map containing localized description text and tooltip
|
|
34
|
+
*/
|
|
35
|
+
CombineVisualization.getDescription = function (mPayload, sLabel, mPropertyBag) {
|
|
36
|
+
var iOriginalSelectorCount = (mPayload.originalSelectors || []).length;
|
|
37
|
+
if (iOriginalSelectorCount < 2) {
|
|
38
|
+
// Fallback if no payload was provided
|
|
39
|
+
return {
|
|
40
|
+
descriptionText: oRtaResourceBundle.getText(
|
|
41
|
+
"TXT_CHANGEVISUALIZATION_CHANGE_COMBINE",
|
|
42
|
+
[ChangeVisualizationUtils.shortenString(sLabel)]
|
|
43
|
+
),
|
|
44
|
+
descriptionTooltip: oRtaResourceBundle.getText(
|
|
45
|
+
"TXT_CHANGEVISUALIZATION_CHANGE_COMBINE",
|
|
46
|
+
[sLabel]
|
|
47
|
+
)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var oAppComponent = mPropertyBag.appComponent;
|
|
52
|
+
var aOriginalSelectors = mPayload.originalSelectors;
|
|
53
|
+
var aLabels = aOriginalSelectors.map(function (oSelector) {
|
|
54
|
+
var sId = JsControlTreeModifier.getControlIdBySelector(oSelector, oAppComponent);
|
|
55
|
+
var oControl = Core.byId(sId);
|
|
56
|
+
return oControl ? ElementUtil.getLabelForElement(oControl) : sId;
|
|
57
|
+
});
|
|
58
|
+
var aShortLabels = aLabels.map(ChangeVisualizationUtils.shortenString);
|
|
59
|
+
|
|
60
|
+
if (iOriginalSelectorCount === 2) {
|
|
61
|
+
return {
|
|
62
|
+
descriptionText: oRtaResourceBundle.getText(
|
|
63
|
+
"TXT_CHANGEVISUALIZATION_CHANGE_COMBINE_TWO",
|
|
64
|
+
aShortLabels
|
|
65
|
+
),
|
|
66
|
+
descriptionTooltip: oRtaResourceBundle.getText(
|
|
67
|
+
"TXT_CHANGEVISUALIZATION_CHANGE_COMBINE_TWO",
|
|
68
|
+
aLabels
|
|
69
|
+
)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
descriptionText: oRtaResourceBundle.getText(
|
|
75
|
+
"TXT_CHANGEVISUALIZATION_CHANGE_COMBINE_MANY",
|
|
76
|
+
[aLabels.length]
|
|
77
|
+
),
|
|
78
|
+
descriptionTooltip: aLabels
|
|
79
|
+
.map(function(sLabel) {
|
|
80
|
+
return "\"" + sLabel + "\"";
|
|
81
|
+
})
|
|
82
|
+
.join(",\n")
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return CombineVisualization;
|
|
87
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
3
|
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
@@ -40,9 +40,9 @@ sap.ui.define([
|
|
|
40
40
|
);
|
|
41
41
|
|
|
42
42
|
if (sSourceParentId !== sTargetParentId) {
|
|
43
|
-
sButtonText = oRtaResourceBundle.getText("BTN_CHANGEVISUALIZATION_SHOW_DEPENDENT_CONTAINER_MOVE");
|
|
44
43
|
sDescriptionText = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_MOVE", ChangeVisualizationUtils.shortenString(sLabel));
|
|
45
|
-
sDescriptionTooltip = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_MOVE", sLabel);
|
|
44
|
+
sDescriptionTooltip = (sSourceParentId && oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_MOVE", sLabel)) || "";
|
|
45
|
+
sButtonText = sSourceParentId && oRtaResourceBundle.getText("BTN_CHANGEVISUALIZATION_SHOW_DEPENDENT_CONTAINER_MOVE");
|
|
46
46
|
}
|
|
47
47
|
return { descriptionText: sDescriptionText, descriptionTooltip: sDescriptionTooltip, buttonText: sButtonText };
|
|
48
48
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
3
|
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/ui/core/Core",
|
|
8
9
|
"sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils"
|
|
9
10
|
], function(
|
|
11
|
+
Core,
|
|
10
12
|
ChangeVisualizationUtils
|
|
11
13
|
) {
|
|
12
14
|
"use strict";
|
|
@@ -18,11 +20,11 @@ sap.ui.define([
|
|
|
18
20
|
* current element label
|
|
19
21
|
*
|
|
20
22
|
* @param {object} mPayload - Change visualization payload from the change handler
|
|
21
|
-
* @param {string} sLabel -
|
|
23
|
+
* @param {string} sLabel - Current element label
|
|
22
24
|
* @returns {object} Localized description text and button text
|
|
23
25
|
*/
|
|
24
26
|
SplitVisualization.getDescription = function (mPayload, sLabel) {
|
|
25
|
-
var oRtaResourceBundle =
|
|
27
|
+
var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
|
|
26
28
|
var sDescriptionText = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_SPLIT", ChangeVisualizationUtils.shortenString(sLabel));
|
|
27
29
|
var sDescriptionTooltip = oRtaResourceBundle.getText("TXT_CHANGEVISUALIZATION_CHANGE_SPLIT", sLabel);
|
|
28
30
|
var sButtonText = oRtaResourceBundle.getText("BTN_CHANGEVISUALIZATION_SHOW_DEPENDENT_CONTAINER_SPLIT");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
3
|
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/rta/util/changeVisualization/categories/RenameVisualization",
|
|
9
9
|
"sap/ui/rta/util/changeVisualization/categories/MoveVisualization",
|
|
10
|
+
"sap/ui/rta/util/changeVisualization/categories/CombineVisualization",
|
|
10
11
|
"sap/ui/rta/util/changeVisualization/categories/SplitVisualization"
|
|
11
12
|
], function(
|
|
12
13
|
RenameVisualization,
|
|
13
14
|
MoveVisualization,
|
|
15
|
+
CombineVisualization,
|
|
14
16
|
SplitVisualization
|
|
15
17
|
) {
|
|
16
18
|
"use strict";
|
|
@@ -18,10 +20,16 @@ sap.ui.define([
|
|
|
18
20
|
var mCategories = {
|
|
19
21
|
rename: RenameVisualization,
|
|
20
22
|
move: MoveVisualization,
|
|
23
|
+
combine: CombineVisualization,
|
|
21
24
|
split: SplitVisualization
|
|
22
25
|
};
|
|
23
26
|
|
|
24
|
-
return function(
|
|
27
|
+
return function(mIndicatorInformation) {
|
|
28
|
+
var sCategoryName = mIndicatorInformation.commandName;
|
|
29
|
+
// to enable e.g. move changes in settings commands to show the 'Show Source' button
|
|
30
|
+
if (sCategoryName === "settings") {
|
|
31
|
+
sCategoryName = mIndicatorInformation.commandCategory;
|
|
32
|
+
}
|
|
25
33
|
return mCategories[sCategoryName];
|
|
26
34
|
};
|
|
27
35
|
});
|