@openui5/sap.ui.rta 1.120.7 → 1.121.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 +23 -21
- package/THIRDPARTY.txt +6 -43
- 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 +507 -759
- package/src/sap/ui/rta/Utils.js +1 -146
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +3 -3
- package/src/sap/ui/rta/appVariant/Utils.js +3 -3
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +5 -3
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_bg.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saprigi.properties +27 -27
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_et.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fi.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_kk.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_lv.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_mk.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ru.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_th.properties +1 -1
- 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 +3 -3
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +7 -5
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +10 -4
- 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 +1 -1
- package/src/sap/ui/rta/command/LREPSerializer.js +4 -3
- 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 +23 -1
- 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 +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
- package/src/sap/ui/rta/enablement/elementActionTest.js +180 -258
- package/src/sap/ui/rta/library.js +3 -2
- package/src/sap/ui/rta/messagebundle.properties +8 -0
- package/src/sap/ui/rta/messagebundle_ar.properties +4 -0
- package/src/sap/ui/rta/messagebundle_bg.properties +5 -1
- package/src/sap/ui/rta/messagebundle_ca.properties +4 -0
- package/src/sap/ui/rta/messagebundle_cnr.properties +5 -1
- package/src/sap/ui/rta/messagebundle_cs.properties +4 -0
- package/src/sap/ui/rta/messagebundle_cy.properties +8 -4
- package/src/sap/ui/rta/messagebundle_da.properties +4 -0
- package/src/sap/ui/rta/messagebundle_de.properties +5 -1
- package/src/sap/ui/rta/messagebundle_el.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en_GB.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +322 -318
- package/src/sap/ui/rta/messagebundle_es.properties +4 -0
- package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -1
- package/src/sap/ui/rta/messagebundle_et.properties +6 -2
- package/src/sap/ui/rta/messagebundle_fi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_fr.properties +5 -1
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +4 -0
- package/src/sap/ui/rta/messagebundle_hi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_hr.properties +6 -2
- package/src/sap/ui/rta/messagebundle_hu.properties +4 -0
- package/src/sap/ui/rta/messagebundle_id.properties +5 -1
- package/src/sap/ui/rta/messagebundle_it.properties +10 -6
- package/src/sap/ui/rta/messagebundle_iw.properties +9 -5
- package/src/sap/ui/rta/messagebundle_ja.properties +4 -0
- package/src/sap/ui/rta/messagebundle_kk.properties +4 -0
- package/src/sap/ui/rta/messagebundle_ko.properties +4 -0
- package/src/sap/ui/rta/messagebundle_lt.properties +5 -1
- package/src/sap/ui/rta/messagebundle_lv.properties +11 -7
- package/src/sap/ui/rta/messagebundle_mk.properties +15 -11
- package/src/sap/ui/rta/messagebundle_ms.properties +5 -1
- package/src/sap/ui/rta/messagebundle_nl.properties +4 -0
- package/src/sap/ui/rta/messagebundle_no.properties +4 -0
- package/src/sap/ui/rta/messagebundle_pl.properties +5 -1
- package/src/sap/ui/rta/messagebundle_pt.properties +4 -0
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +4 -0
- package/src/sap/ui/rta/messagebundle_ro.properties +8 -4
- package/src/sap/ui/rta/messagebundle_ru.properties +5 -1
- package/src/sap/ui/rta/messagebundle_sh.properties +5 -1
- package/src/sap/ui/rta/messagebundle_sk.properties +4 -0
- package/src/sap/ui/rta/messagebundle_sl.properties +7 -3
- package/src/sap/ui/rta/messagebundle_sr.properties +6 -2
- package/src/sap/ui/rta/messagebundle_sv.properties +4 -0
- package/src/sap/ui/rta/messagebundle_th.properties +9 -5
- package/src/sap/ui/rta/messagebundle_tr.properties +7 -3
- package/src/sap/ui/rta/messagebundle_uk.properties +5 -1
- package/src/sap/ui/rta/messagebundle_vi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -1
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +6 -2
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +16 -11
- 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 +43 -1
- package/src/sap/ui/rta/plugin/ControlVariant.js +3 -2
- 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 +2 -2
- 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 +18 -10
- 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 +2 -2
- package/src/sap/ui/rta/plugin/Resize.js +1 -1
- package/src/sap/ui/rta/plugin/Selection.js +24 -9
- package/src/sap/ui/rta/plugin/Settings.js +17 -15
- package/src/sap/ui/rta/plugin/Split.js +1 -1
- package/src/sap/ui/rta/plugin/Stretch.js +14 -13
- 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/AdditionalElementsPlugin.js +134 -67
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +6 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +57 -47
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +21 -8
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +56 -41
- package/src/sap/ui/rta/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
- package/src/sap/ui/rta/service/Outline.js +22 -18
- 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/service/SupportTools.js +23 -19
- package/src/sap/ui/rta/toolbar/Adaptation.js +16 -18
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- 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/contextBased/SaveAsAdaptation.js +1 -1
- package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +12 -5
- 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 +19 -59
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/ServiceManager.js +193 -0
- package/src/sap/ui/rta/util/adaptationStarter.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +90 -45
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +32 -25
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +98 -132
- package/LICENSES/BSD-2-Clause.txt +0 -22
|
@@ -53,7 +53,7 @@ sap.ui.define([
|
|
|
53
53
|
* When clicking anywhere on the application, the menu must close
|
|
54
54
|
*/
|
|
55
55
|
function _onClick() {
|
|
56
|
-
|
|
56
|
+
const oPopover = this.getPopover();
|
|
57
57
|
if (oPopover && oPopover.isOpen()) {
|
|
58
58
|
oPopover.close();
|
|
59
59
|
}
|
|
@@ -64,12 +64,12 @@ sap.ui.define([
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
function _determineElementOverlay(oElementId, oAffectedElementId) {
|
|
67
|
-
|
|
67
|
+
let oOverlay = OverlayRegistry.getOverlay(oElementId);
|
|
68
68
|
if (!oOverlay) {
|
|
69
69
|
// When the element has no Overlay, check if there is a relevant container Overlay
|
|
70
70
|
// e.g. change on a SmartForm group (Element: parent Form; Relevant Container: SmartForm)
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
const oElementOverlay = OverlayRegistry.getOverlay(oAffectedElementId);
|
|
72
|
+
const oRelevantContainer = oElementOverlay && oElementOverlay.getRelevantContainer();
|
|
73
73
|
if (oRelevantContainer) {
|
|
74
74
|
oOverlay = OverlayRegistry.getOverlay(oRelevantContainer);
|
|
75
75
|
}
|
|
@@ -86,10 +86,10 @@ sap.ui.define([
|
|
|
86
86
|
* @alias sap.ui.rta.util.changeVisualization.ChangeVisualization
|
|
87
87
|
* @author SAP SE
|
|
88
88
|
* @since 1.84.0
|
|
89
|
-
* @version 1.
|
|
89
|
+
* @version 1.121.0
|
|
90
90
|
* @private
|
|
91
91
|
*/
|
|
92
|
-
|
|
92
|
+
const ChangeVisualization = Control.extend("sap.ui.rta.util.changeVisualization.ChangeVisualization", {
|
|
93
93
|
metadata: {
|
|
94
94
|
library: "sap.ui.rta",
|
|
95
95
|
properties: {
|
|
@@ -214,14 +214,14 @@ sap.ui.define([
|
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
216
|
// Array of all Hidden Changes
|
|
217
|
-
|
|
217
|
+
const aHiddenChanges = [];
|
|
218
218
|
// Array of all Visualized Changes
|
|
219
|
-
|
|
219
|
+
const aVisualizedChanges = [];
|
|
220
220
|
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
let bHasDraftChanges = false;
|
|
222
|
+
let bHasDirtyChanges = false;
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
const aAllRelevantChangeIds = aAllRelevantChanges.map(function(oChange) {
|
|
225
225
|
return oChange.id;
|
|
226
226
|
});
|
|
227
227
|
|
|
@@ -233,7 +233,7 @@ sap.ui.define([
|
|
|
233
233
|
bHasDraftChanges = true;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
|
|
236
|
+
const oOverlay = _determineElementOverlay(
|
|
237
237
|
oChange.visualizationInfo.displayElementIds[0],
|
|
238
238
|
oChange.visualizationInfo.affectedElementIds[0]
|
|
239
239
|
);
|
|
@@ -246,8 +246,8 @@ sap.ui.define([
|
|
|
246
246
|
aVisualizedChanges.push(oChange);
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
const aRelevantHiddenChanges = filterRelevantChanges(aHiddenChanges);
|
|
250
|
+
const aRelevantVisualizedChanges = filterRelevantChanges(aVisualizedChanges);
|
|
251
251
|
return {
|
|
252
252
|
relevantHiddenChanges: aRelevantHiddenChanges,
|
|
253
253
|
relevantVisualizedChanges: aRelevantVisualizedChanges,
|
|
@@ -258,27 +258,27 @@ sap.ui.define([
|
|
|
258
258
|
|
|
259
259
|
ChangeVisualization.prototype._updateVisualizationModelMenuData = function() {
|
|
260
260
|
// Get selected change state and change category
|
|
261
|
-
|
|
261
|
+
const sVisualizedChangeState = this._oChangeVisualizationModel.getData().changeState;
|
|
262
262
|
|
|
263
263
|
// Get all registered and relevant change ids
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
const aAllRegisteredChanges = this._oChangeIndicatorRegistry.getAllRegisteredChanges();
|
|
265
|
+
const aAllRelevantChanges = this._oChangeIndicatorRegistry.getRelevantChangesWithSelector();
|
|
266
266
|
|
|
267
267
|
// Filter allRegisteredChanges for independent changes and get the ids
|
|
268
|
-
|
|
268
|
+
const aRegisteredIndependentChanges = aAllRegisteredChanges.filter(function(oChange) {
|
|
269
269
|
if (!oChange.dependent) {
|
|
270
270
|
return true;
|
|
271
271
|
}
|
|
272
272
|
return false;
|
|
273
273
|
});
|
|
274
274
|
|
|
275
|
-
|
|
275
|
+
const oSortedChanges = this._determineChangeVisibility(
|
|
276
276
|
aRegisteredIndependentChanges,
|
|
277
277
|
aAllRelevantChanges,
|
|
278
278
|
sVisualizedChangeState
|
|
279
279
|
);
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
const aCommandData = Object.keys(ChangeCategories.getCategories()).map(function(sChangeCategoryName) {
|
|
281
|
+
const sTitle = this._getChangeCategoryLabel(
|
|
282
282
|
sChangeCategoryName,
|
|
283
283
|
this._getChangesForChangeCategory(sChangeCategoryName, oSortedChanges.relevantVisualizedChanges).length
|
|
284
284
|
);
|
|
@@ -321,19 +321,19 @@ sap.ui.define([
|
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
ChangeVisualization.prototype._getChangeCategoryLabel = function(sChangeCategoryName, iChangesCount) {
|
|
324
|
-
|
|
324
|
+
const sLabelKey = `TXT_CHANGEVISUALIZATION_OVERVIEW_${sChangeCategoryName.toUpperCase()}`;
|
|
325
325
|
return this._oTextBundle.getText(sLabelKey, [iChangesCount]);
|
|
326
326
|
};
|
|
327
327
|
|
|
328
328
|
ChangeVisualization.prototype._getChangeCategoryButton = function(sChangeCategoryName) {
|
|
329
|
-
|
|
329
|
+
const sButtonKey = `BTN_CHANGEVISUALIZATION_OVERVIEW_${sChangeCategoryName.toUpperCase()}`;
|
|
330
330
|
return this._oTextBundle.getText(sButtonKey);
|
|
331
331
|
};
|
|
332
332
|
|
|
333
333
|
ChangeVisualization.prototype.openChangeCategorySelectionPopover = function(oEvent) {
|
|
334
334
|
// Event bubbled through the toolbar, get original source
|
|
335
335
|
this._oToolbarButton ||= Element.getElementById(oEvent.getParameter("id"));
|
|
336
|
-
|
|
336
|
+
const oPopover = this.getPopover();
|
|
337
337
|
|
|
338
338
|
if (!oPopover) {
|
|
339
339
|
Fragment.load({
|
|
@@ -369,19 +369,19 @@ sap.ui.define([
|
|
|
369
369
|
* @param {event} oEvent - Event
|
|
370
370
|
*/
|
|
371
371
|
ChangeVisualization.prototype.onChangeCategorySelection = function(oEvent) {
|
|
372
|
-
|
|
372
|
+
const sSelectedChangeCategory = oEvent.getSource().getBindingContext("visualizationModel").getObject().key;
|
|
373
373
|
this._selectChangeCategory(sSelectedChangeCategory);
|
|
374
374
|
};
|
|
375
375
|
|
|
376
376
|
ChangeVisualization.prototype.onVersioningCategoryChange = function(oEvent) {
|
|
377
|
-
|
|
377
|
+
const sSelectedChangeState = oEvent.getSource().getSelectedKey();
|
|
378
378
|
this._selectChangeState(sSelectedChangeState);
|
|
379
379
|
};
|
|
380
380
|
|
|
381
381
|
ChangeVisualization.prototype._selectChangeCategory = function(sSelectedChangeCategory) {
|
|
382
382
|
this._sSelectedChangeCategory = sSelectedChangeCategory;
|
|
383
383
|
|
|
384
|
-
|
|
384
|
+
const sChangeCategoryText = this._getChangeCategoryButton(sSelectedChangeCategory);
|
|
385
385
|
|
|
386
386
|
this._updateVisualizationModel({
|
|
387
387
|
changeCategory: sSelectedChangeCategory,
|
|
@@ -404,7 +404,7 @@ sap.ui.define([
|
|
|
404
404
|
};
|
|
405
405
|
|
|
406
406
|
ChangeVisualization.prototype._getCommandForChange = function(oChange) {
|
|
407
|
-
|
|
407
|
+
const sCommand = oChange.getSupportInformation().command;
|
|
408
408
|
if (sCommand) {
|
|
409
409
|
return sCommand;
|
|
410
410
|
}
|
|
@@ -413,17 +413,17 @@ sap.ui.define([
|
|
|
413
413
|
return false;
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
416
|
+
const oComponent = this._getComponent();
|
|
417
|
+
const oSelectorControl = JsControlTreeModifier.bySelector(oChange.getSelector(), oComponent);
|
|
418
|
+
const oLastDependentSelector = oChange.getDependentSelectorList().slice(-1)[0];
|
|
419
|
+
const oLastDependentSelectorControl = JsControlTreeModifier.bySelector(oLastDependentSelector, oComponent);
|
|
420
420
|
|
|
421
421
|
// Recursively search through parent element structure
|
|
422
422
|
// This is necessary to make sure that elements that were created during runtime
|
|
423
423
|
// (e.g. for SimpleForms) are considered.
|
|
424
424
|
function searchForCommand(oOverlay, sAggregationName) {
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
const oControl = oOverlay.getElement();
|
|
426
|
+
const sCommand = oOverlay.getDesignTimeMetadata().getCommandName(
|
|
427
427
|
oChange.getChangeType(),
|
|
428
428
|
oControl,
|
|
429
429
|
sAggregationName
|
|
@@ -432,8 +432,8 @@ sap.ui.define([
|
|
|
432
432
|
return sCommand;
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
const oParentOverlay = oOverlay.getParentElementOverlay();
|
|
436
|
+
const oParentAggregationOverlay = oOverlay.getParentAggregationOverlay();
|
|
437
437
|
if (
|
|
438
438
|
oOverlay.getElement().getId() === oSelectorControl.getId()
|
|
439
439
|
|| !oParentOverlay
|
|
@@ -452,8 +452,8 @@ sap.ui.define([
|
|
|
452
452
|
};
|
|
453
453
|
|
|
454
454
|
ChangeVisualization.prototype._collectChanges = function() {
|
|
455
|
-
|
|
456
|
-
|
|
455
|
+
const oComponent = this._getComponent();
|
|
456
|
+
const mPropertyBag = {
|
|
457
457
|
selector: oComponent,
|
|
458
458
|
invalidateCache: false,
|
|
459
459
|
includeCtrlVariants: true,
|
|
@@ -474,23 +474,23 @@ sap.ui.define([
|
|
|
474
474
|
if (this._oChangeVisualizationModel.getData().displayedVersion !== "0") {
|
|
475
475
|
this._oChangeIndicatorRegistry.reset();
|
|
476
476
|
}
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
const aRegisteredChangeIds = this._oChangeIndicatorRegistry.getRegisteredChangeIds();
|
|
478
|
+
const oCurrentChanges = aChanges
|
|
479
479
|
.reduce(function(oChanges, oChange) {
|
|
480
480
|
oChanges[oChange.getId()] = oChange;
|
|
481
481
|
return oChanges;
|
|
482
482
|
}, {});
|
|
483
|
-
|
|
483
|
+
const aCurrentChangeIds = Object.keys(oCurrentChanges);
|
|
484
484
|
|
|
485
485
|
// Remove registered changes which no longer exist
|
|
486
486
|
difference(aRegisteredChangeIds, aCurrentChangeIds).forEach(function(sChangeIdToRemove) {
|
|
487
487
|
this._oChangeIndicatorRegistry.removeRegisteredChange(sChangeIdToRemove);
|
|
488
488
|
}.bind(this));
|
|
489
|
-
|
|
489
|
+
const aPromises = [];
|
|
490
490
|
// Register missing changes
|
|
491
491
|
difference(aCurrentChangeIds, aRegisteredChangeIds).forEach(function(sChangeIdToAdd) {
|
|
492
|
-
|
|
493
|
-
|
|
492
|
+
const oChangeToAdd = oCurrentChanges[sChangeIdToAdd];
|
|
493
|
+
const sCommandName = this._getCommandForChange(oChangeToAdd);
|
|
494
494
|
aPromises.push(this._oChangeIndicatorRegistry.registerChange(oChangeToAdd, sCommandName, this.oVersionsModel));
|
|
495
495
|
}.bind(this));
|
|
496
496
|
return Promise.all(aPromises);
|
|
@@ -498,14 +498,14 @@ sap.ui.define([
|
|
|
498
498
|
};
|
|
499
499
|
|
|
500
500
|
ChangeVisualization.prototype.selectChange = function(oEvent) {
|
|
501
|
-
|
|
501
|
+
const sChangeId = oEvent.getParameter("changeId");
|
|
502
502
|
this._selectChange(sChangeId);
|
|
503
503
|
};
|
|
504
504
|
|
|
505
505
|
ChangeVisualization.prototype._selectChange = function(sChangeId) {
|
|
506
|
-
|
|
506
|
+
const aDependentElements = this._oChangeIndicatorRegistry.getRegisteredChange(sChangeId).visualizationInfo.dependentElementIds;
|
|
507
507
|
aDependentElements.forEach(function(sElementId) {
|
|
508
|
-
|
|
508
|
+
const oOverlayDomRef = OverlayRegistry.getOverlay(sElementId).getDomRef();
|
|
509
509
|
oOverlayDomRef.scrollIntoView({
|
|
510
510
|
block: "nearest"
|
|
511
511
|
});
|
|
@@ -525,31 +525,33 @@ sap.ui.define([
|
|
|
525
525
|
};
|
|
526
526
|
|
|
527
527
|
ChangeVisualization.prototype._updateChangeIndicators = function() {
|
|
528
|
-
|
|
529
|
-
|
|
528
|
+
const oSelectors = this._oChangeIndicatorRegistry.getSelectorsWithRegisteredChanges();
|
|
529
|
+
const oIndicators = {};
|
|
530
530
|
this._mDisplayElementsKeyMap = {};
|
|
531
|
+
const oConnectedElements = this._oDesignTime?.getSelectionManager?.().getConnectedElements();
|
|
531
532
|
Object.keys(oSelectors).forEach(function(sSelectorId) {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
533
|
+
const aChangesOnIndicator = oSelectors[sSelectorId];
|
|
534
|
+
const aRelevantChanges = this._filterRelevantChanges(oSelectors[sSelectorId]);
|
|
535
|
+
const oOverlay = _determineElementOverlay(sSelectorId, aChangesOnIndicator[0].affectedElementId);
|
|
535
536
|
|
|
536
537
|
if (_isOverlayInvisible(oOverlay)) {
|
|
537
538
|
// Change is not visible
|
|
538
539
|
return undefined;
|
|
539
540
|
}
|
|
540
|
-
|
|
541
|
+
const oOverlayPosition = oOverlay.getDomRef().getClientRects()[0] || { left: 0, top: 0 };
|
|
541
542
|
oIndicators[sSelectorId] = {
|
|
542
543
|
posX: parseInt(oOverlayPosition.left),
|
|
543
544
|
posY: parseInt(oOverlayPosition.top),
|
|
544
545
|
changes: aRelevantChanges
|
|
545
546
|
};
|
|
546
547
|
|
|
547
|
-
|
|
548
|
-
|
|
548
|
+
const oChangeIndicator = this._oChangeIndicatorRegistry.getChangeIndicator(sSelectorId);
|
|
549
|
+
const sOverlayId = oOverlay.getId();
|
|
550
|
+
const oConnectedElement = oConnectedElements?.[oOverlay.getAssociation("element")];
|
|
549
551
|
if (!oChangeIndicator) {
|
|
550
|
-
this._createChangeIndicator(oOverlay, sSelectorId);
|
|
552
|
+
this._createChangeIndicator(oOverlay, sSelectorId, oConnectedElement);
|
|
551
553
|
// Assumption: all changes on an indicator affect the same elements
|
|
552
|
-
|
|
554
|
+
const sDisplayElementsKey = aChangesOnIndicator[0].displayElementsKey;
|
|
553
555
|
// This map is built to collect indicators with the same display elements (e.g. OP Section & AnchorBar)
|
|
554
556
|
if (!this._mDisplayElementsKeyMap[sDisplayElementsKey]) {
|
|
555
557
|
this._mDisplayElementsKeyMap[sDisplayElementsKey] = [sSelectorId];
|
|
@@ -563,8 +565,6 @@ sap.ui.define([
|
|
|
563
565
|
return undefined;
|
|
564
566
|
}.bind(this));
|
|
565
567
|
|
|
566
|
-
this._registerIndicatorBrowserEvents();
|
|
567
|
-
|
|
568
568
|
if (
|
|
569
569
|
!deepEqual(
|
|
570
570
|
oIndicators,
|
|
@@ -577,51 +577,11 @@ sap.ui.define([
|
|
|
577
577
|
}
|
|
578
578
|
};
|
|
579
579
|
|
|
580
|
-
// Multiple indicators can refer to the same control (e.g. OP Section + AnchorBar),
|
|
581
|
-
// so when one of them is hovered/focused the other must also react to show the connection between them
|
|
582
|
-
ChangeVisualization.prototype._registerIndicatorBrowserEvents = function() {
|
|
583
|
-
Object.keys(this._mDisplayElementsKeyMap).forEach(function(sDisplayElementsKey) {
|
|
584
|
-
var aIndicators = this._mDisplayElementsKeyMap[sDisplayElementsKey].map(function(sSelectorId) {
|
|
585
|
-
return this._oChangeIndicatorRegistry.getChangeIndicator(sSelectorId);
|
|
586
|
-
}.bind(this));
|
|
587
|
-
|
|
588
|
-
function onIndicatorInteraction(bActivate, oEvent) {
|
|
589
|
-
aIndicators.forEach(function(oIndicator) {
|
|
590
|
-
if (oIndicator.getVisible()) {
|
|
591
|
-
oIndicator.onIndicatorBrowserInteraction(bActivate, oEvent);
|
|
592
|
-
}
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
// When the detail popover is opened all connected overlays should be selected
|
|
597
|
-
function onDetailPopoverOpened(oEvent) {
|
|
598
|
-
aIndicators.forEach(function(oIndicator) {
|
|
599
|
-
if (oIndicator.getVisible()) {
|
|
600
|
-
oIndicator.onDetailPopoverOpened(oEvent);
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
aIndicators.forEach(function(oIndicator) {
|
|
606
|
-
oIndicator.attachBrowserEvent("mouseover", onIndicatorInteraction.bind(this, true));
|
|
607
|
-
oIndicator.attachBrowserEvent("focusin", onIndicatorInteraction.bind(this, true));
|
|
608
|
-
oIndicator.attachBrowserEvent("mouseout", onIndicatorInteraction.bind(this, false));
|
|
609
|
-
oIndicator.attachBrowserEvent("focusout", onIndicatorInteraction.bind(this, false));
|
|
610
|
-
oIndicator.attachDetailPopoverOpened(onDetailPopoverOpened.bind(this));
|
|
611
|
-
|
|
612
|
-
var oOverlay = Element.getElementById(oIndicator.getOverlayId());
|
|
613
|
-
// De-selection of connected overlays must happen when the hover/focus leaves the overlay
|
|
614
|
-
oOverlay.attachBrowserEvent("mouseout", onIndicatorInteraction.bind(this, false));
|
|
615
|
-
oOverlay.attachBrowserEvent("focusout", onIndicatorInteraction.bind(this, false));
|
|
616
|
-
});
|
|
617
|
-
}.bind(this));
|
|
618
|
-
};
|
|
619
|
-
|
|
620
580
|
ChangeVisualization.prototype._filterRelevantChanges = function(aChangeVizInfo) {
|
|
621
581
|
if (!Array.isArray(aChangeVizInfo)) {
|
|
622
582
|
return aChangeVizInfo;
|
|
623
583
|
}
|
|
624
|
-
|
|
584
|
+
const oRootData = this._oChangeVisualizationModel.getData();
|
|
625
585
|
|
|
626
586
|
return aChangeVizInfo.filter(function(oChangeVizInfo) {
|
|
627
587
|
return (
|
|
@@ -640,15 +600,16 @@ sap.ui.define([
|
|
|
640
600
|
});
|
|
641
601
|
};
|
|
642
602
|
|
|
643
|
-
ChangeVisualization.prototype._createChangeIndicator = function(oOverlay, sSelectorId) {
|
|
644
|
-
|
|
603
|
+
ChangeVisualization.prototype._createChangeIndicator = function(oOverlay, sSelectorId, oConnectedElementId) {
|
|
604
|
+
const oChangeIndicator = new ChangeIndicator({
|
|
645
605
|
changes: "{changes}",
|
|
646
606
|
posX: "{posX}",
|
|
647
607
|
posY: "{posY}",
|
|
648
608
|
visible: "{= ${/active} && (${changes} || []).length > 0}",
|
|
649
609
|
overlayId: oOverlay.getId(),
|
|
650
610
|
selectorId: sSelectorId,
|
|
651
|
-
selectChange: this.selectChange.bind(this)
|
|
611
|
+
selectChange: this.selectChange.bind(this),
|
|
612
|
+
connectedElementId: oConnectedElementId
|
|
652
613
|
});
|
|
653
614
|
oChangeIndicator.setModel(this._oChangeVisualizationModel);
|
|
654
615
|
oChangeIndicator.bindElement(`/content/${sSelectorId}`);
|
|
@@ -660,42 +621,44 @@ sap.ui.define([
|
|
|
660
621
|
// Sort the Indicators according XY-Position
|
|
661
622
|
// Set the tabindex according the sorting
|
|
662
623
|
// Focus the first visible indicator
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
624
|
+
this._oChangeIndicatorRegistry.waitForIndicatorRendering()
|
|
625
|
+
.then(() => {
|
|
626
|
+
const aVisibleIndicators = this._oChangeIndicatorRegistry.getChangeIndicators().filter((oIndicator) => {
|
|
627
|
+
// As setting the focus happens asynchronously after rendering,
|
|
628
|
+
// the overlay can be gone by the time this code is executed
|
|
629
|
+
return oIndicator.getVisible() && OverlayRegistry.getOverlay(oIndicator.getOverlayId());
|
|
630
|
+
})
|
|
631
|
+
.sort(function(oIndicator1, oIndicator2) {
|
|
632
|
+
const iDeltaY = oIndicator1.getPosY() - oIndicator2.getPosY();
|
|
633
|
+
const iDeltaX = oIndicator1.getPosX() - oIndicator2.getPosX();
|
|
634
|
+
// Only consider x value if y is the same
|
|
635
|
+
return iDeltaY || iDeltaX;
|
|
636
|
+
});
|
|
675
637
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
638
|
+
if (aVisibleIndicators.length === 0) {
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
679
641
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
642
|
+
const aVisibleIndicatorsOnScrollPosition = [];
|
|
643
|
+
aVisibleIndicators.forEach(function(oIndicator, iIndex) {
|
|
644
|
+
oIndicator.getDomRef().tabIndex = iIndex + 2;
|
|
645
|
+
// Indicators with posY < 0 are outside of the current scroll position
|
|
646
|
+
if (oIndicator.getPosY() > 0) {
|
|
647
|
+
aVisibleIndicatorsOnScrollPosition.push(oIndicator);
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
if (aVisibleIndicatorsOnScrollPosition.length > 0) {
|
|
651
|
+
// Indicators visible with the current scroll position get focus
|
|
652
|
+
// to avoid unexpected scrolling when visualization is started
|
|
653
|
+
aVisibleIndicatorsOnScrollPosition[0].focus();
|
|
654
|
+
} else {
|
|
655
|
+
aVisibleIndicators[0].focus();
|
|
686
656
|
}
|
|
687
657
|
});
|
|
688
|
-
if (aVisibleIndicatorsOnScrollPosition.length > 0) {
|
|
689
|
-
// Indicators visible with the current scroll position get focus
|
|
690
|
-
// to avoid unexpected scrolling when visualization is started
|
|
691
|
-
aVisibleIndicatorsOnScrollPosition[0].focus();
|
|
692
|
-
} else {
|
|
693
|
-
aVisibleIndicators[0].focus();
|
|
694
|
-
}
|
|
695
658
|
};
|
|
696
659
|
|
|
697
660
|
ChangeVisualization.prototype._toggleRootOverlayClickHandler = function(bEnable) {
|
|
698
|
-
|
|
661
|
+
const oRootOverlayDomRef = this.oRootOverlay && this.oRootOverlay.getDomRef();
|
|
699
662
|
if (oRootOverlayDomRef) {
|
|
700
663
|
if (bEnable) {
|
|
701
664
|
oRootOverlayDomRef.addEventListener(
|
|
@@ -755,6 +718,9 @@ sap.ui.define([
|
|
|
755
718
|
oToolbar.adjustToolbarSectionWidths();
|
|
756
719
|
|
|
757
720
|
this._updateVisualizationModelMenuData();
|
|
721
|
+
return this._oChangeIndicatorRegistry.waitForIndicatorRendering();
|
|
722
|
+
}.bind(this))
|
|
723
|
+
.then(function() {
|
|
758
724
|
oToolbar.setModel(this._oChangeVisualizationModel, "visualizationModel");
|
|
759
725
|
}.bind(this));
|
|
760
726
|
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Copyright (c) <year> <owner>. All rights reserved.
|
|
2
|
-
|
|
3
|
-
Redistribution and use in source and binary forms, with or without modification,
|
|
4
|
-
are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
1. Redistributions of source code must retain the above copyright notice,
|
|
7
|
-
this list of conditions and the following disclaimer.
|
|
8
|
-
|
|
9
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
-
this list of conditions and the following disclaimer in the documentation
|
|
11
|
-
and/or other materials provided with the distribution.
|
|
12
|
-
|
|
13
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
14
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
15
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
16
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
|
17
|
-
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
18
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
19
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
20
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
21
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
|
22
|
-
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|