@openui5/sap.ui.rta 1.109.0 → 1.111.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 +16 -16
- package/THIRDPARTY.txt +2 -2
- package/package.json +6 -6
- package/src/sap/ui/rta/.library +2 -2
- package/src/sap/ui/rta/Client.js +2 -2
- package/src/sap/ui/rta/RuntimeAuthoring.js +251 -151
- package/src/sap/ui/rta/Utils.js +40 -19
- package/src/sap/ui/rta/api/startAdaptation.js +1 -1
- package/src/sap/ui/rta/api/startKeyUserAdaptation.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +2 -2
- package/src/sap/ui/rta/appVariant/AppVariantOverviewDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +1 -1
- package/src/sap/ui/rta/appVariant/Feature.js +2 -8
- package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +1 -1
- package/src/sap/ui/rta/appVariant/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/Component.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/index.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/model/models.js +1 -1
- package/src/sap/ui/rta/command/AddIFrame.js +2 -2
- package/src/sap/ui/rta/command/AddProperty.js +2 -2
- package/src/sap/ui/rta/command/AddXML.js +2 -2
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +2 -2
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +2 -2
- package/src/sap/ui/rta/command/BaseCommand.js +2 -2
- package/src/sap/ui/rta/command/BindProperty.js +2 -2
- package/src/sap/ui/rta/command/Combine.js +2 -2
- package/src/sap/ui/rta/command/CommandFactory.js +2 -2
- package/src/sap/ui/rta/command/CompositeCommand.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantSave.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +15 -13
- package/src/sap/ui/rta/command/CreateContainer.js +2 -2
- package/src/sap/ui/rta/command/CustomAdd.js +2 -2
- package/src/sap/ui/rta/command/FlexCommand.js +2 -2
- package/src/sap/ui/rta/command/LREPSerializer.js +27 -12
- package/src/sap/ui/rta/command/LocalReset.js +2 -2
- package/src/sap/ui/rta/command/Move.js +2 -2
- package/src/sap/ui/rta/command/Property.js +2 -2
- package/src/sap/ui/rta/command/Remove.js +2 -2
- package/src/sap/ui/rta/command/Rename.js +2 -2
- package/src/sap/ui/rta/command/Resize.js +2 -2
- package/src/sap/ui/rta/command/Reveal.js +2 -2
- package/src/sap/ui/rta/command/Settings.js +2 -2
- package/src/sap/ui/rta/command/Split.js +2 -2
- package/src/sap/ui/rta/command/Stack.js +11 -3
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +2 -2
- package/src/sap/ui/rta/enablement/TestDelegate.js +1 -1
- package/src/sap/ui/rta/enablement/elementActionTest.js +2 -2
- package/src/sap/ui/rta/library.js +3 -3
- package/src/sap/ui/rta/messagebundle.properties +65 -13
- package/src/sap/ui/rta/messagebundle_ar.properties +35 -11
- package/src/sap/ui/rta/messagebundle_bg.properties +35 -11
- package/src/sap/ui/rta/messagebundle_ca.properties +35 -11
- package/src/sap/ui/rta/messagebundle_cs.properties +35 -11
- package/src/sap/ui/rta/messagebundle_cy.properties +34 -10
- package/src/sap/ui/rta/messagebundle_da.properties +34 -10
- package/src/sap/ui/rta/messagebundle_de.properties +37 -13
- package/src/sap/ui/rta/messagebundle_el.properties +34 -10
- package/src/sap/ui/rta/messagebundle_en.properties +33 -9
- package/src/sap/ui/rta/messagebundle_en_GB.properties +33 -9
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +31 -5
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +37 -5
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +31 -7
- package/src/sap/ui/rta/messagebundle_es.properties +34 -10
- package/src/sap/ui/rta/messagebundle_es_MX.properties +34 -10
- package/src/sap/ui/rta/messagebundle_et.properties +34 -10
- package/src/sap/ui/rta/messagebundle_fi.properties +34 -10
- package/src/sap/ui/rta/messagebundle_fr.properties +34 -10
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +35 -11
- package/src/sap/ui/rta/messagebundle_hi.properties +35 -11
- package/src/sap/ui/rta/messagebundle_hr.properties +35 -11
- package/src/sap/ui/rta/messagebundle_hu.properties +34 -10
- package/src/sap/ui/rta/messagebundle_id.properties +35 -11
- package/src/sap/ui/rta/messagebundle_it.properties +35 -11
- package/src/sap/ui/rta/messagebundle_iw.properties +34 -10
- package/src/sap/ui/rta/messagebundle_ja.properties +35 -11
- package/src/sap/ui/rta/messagebundle_kk.properties +34 -10
- package/src/sap/ui/rta/messagebundle_ko.properties +34 -10
- package/src/sap/ui/rta/messagebundle_lt.properties +34 -10
- package/src/sap/ui/rta/messagebundle_lv.properties +35 -11
- package/src/sap/ui/rta/messagebundle_ms.properties +35 -11
- package/src/sap/ui/rta/messagebundle_nl.properties +34 -10
- package/src/sap/ui/rta/messagebundle_no.properties +35 -11
- package/src/sap/ui/rta/messagebundle_pl.properties +35 -11
- package/src/sap/ui/rta/messagebundle_pt.properties +35 -11
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +34 -10
- package/src/sap/ui/rta/messagebundle_ro.properties +35 -11
- package/src/sap/ui/rta/messagebundle_ru.properties +35 -11
- package/src/sap/ui/rta/messagebundle_sh.properties +34 -10
- package/src/sap/ui/rta/messagebundle_sk.properties +34 -10
- package/src/sap/ui/rta/messagebundle_sl.properties +34 -10
- package/src/sap/ui/rta/messagebundle_sv.properties +35 -11
- package/src/sap/ui/rta/messagebundle_th.properties +36 -12
- package/src/sap/ui/rta/messagebundle_tr.properties +34 -10
- package/src/sap/ui/rta/messagebundle_uk.properties +34 -10
- package/src/sap/ui/rta/messagebundle_vi.properties +35 -11
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +35 -11
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +35 -11
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +2 -2
- package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
- package/src/sap/ui/rta/plugin/Combine.js +2 -2
- package/src/sap/ui/rta/plugin/CompVariant.js +4 -6
- package/src/sap/ui/rta/plugin/ControlVariant.js +2 -2
- package/src/sap/ui/rta/plugin/CreateContainer.js +3 -3
- package/src/sap/ui/rta/plugin/CutPaste.js +2 -2
- package/src/sap/ui/rta/plugin/DragDrop.js +4 -4
- package/src/sap/ui/rta/plugin/EasyAdd.js +30 -21
- package/src/sap/ui/rta/plugin/EasyRemove.js +13 -11
- package/src/sap/ui/rta/plugin/LocalReset.js +2 -2
- package/src/sap/ui/rta/plugin/Plugin.js +57 -13
- package/src/sap/ui/rta/plugin/RTAElementMover.js +2 -2
- package/src/sap/ui/rta/plugin/Remove.js +3 -3
- package/src/sap/ui/rta/plugin/Rename.js +2 -2
- package/src/sap/ui/rta/plugin/RenameHandler.js +30 -19
- package/src/sap/ui/rta/plugin/Resize.js +2 -2
- package/src/sap/ui/rta/plugin/Selection.js +8 -15
- package/src/sap/ui/rta/plugin/Settings.js +2 -2
- package/src/sap/ui/rta/plugin/Split.js +2 -2
- package/src/sap/ui/rta/plugin/Stretch.js +17 -16
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +28 -7
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.fragment.xml +1 -0
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +2 -2
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +4 -2
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +5 -5
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +2 -2
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +7 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +4 -4
- package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
- package/src/sap/ui/rta/service/Action.js +2 -2
- package/src/sap/ui/rta/service/ControllerExtension.js +2 -2
- package/src/sap/ui/rta/service/Outline.js +2 -2
- package/src/sap/ui/rta/service/Property.js +2 -2
- package/src/sap/ui/rta/service/Receiver.js +1 -1
- package/src/sap/ui/rta/service/Selection.js +2 -2
- package/src/sap/ui/rta/service/SupportTools.js +2 -2
- package/src/sap/ui/rta/service/index.js +1 -1
- package/src/sap/ui/rta/themes/base/AddIFrame.less +1 -1
- package/src/sap/ui/rta/themes/base/Dialogs.less +1 -1
- package/src/sap/ui/rta/themes/base/FieldRepository.less +1 -1
- package/src/sap/ui/rta/themes/base/library.source.less +1 -1
- package/src/sap/ui/rta/themes/sap_hcb/library.source.less +1 -1
- package/src/sap/ui/rta/toolbar/ActionsMenu.fragment.xml +82 -0
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +35 -79
- package/src/sap/ui/rta/toolbar/Adaptation.js +83 -25
- package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
- package/src/sap/ui/rta/toolbar/Base.js +4 -4
- package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +15 -11
- package/src/sap/ui/rta/toolbar/FioriLike.js +2 -2
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +2 -2
- package/src/sap/ui/rta/toolbar/Personalization.js +2 -2
- package/src/sap/ui/rta/toolbar/Standalone.js +2 -2
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +340 -0
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +152 -0
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +225 -0
- package/src/sap/ui/rta/toolbar/contextBased/{SaveAsContextBasedAdaptationDialog.fragment.xml → SaveAsAdaptationDialog.fragment.xml} +19 -15
- package/src/sap/ui/rta/toolbar/translation/Translation.js +2 -2
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +4 -4
- package/src/sap/ui/rta/util/Animation.js +5 -9
- package/src/sap/ui/rta/util/BindingsExtractor.js +1 -1
- package/src/sap/ui/rta/util/PluginManager.js +2 -2
- package/src/sap/ui/rta/util/PopupManager.js +2 -2
- package/src/sap/ui/rta/util/ReloadManager.js +2 -2
- package/src/sap/ui/rta/util/ServiceEventBus.js +2 -2
- package/src/sap/ui/rta/util/StylesLoader.js +1 -1
- package/src/sap/ui/rta/util/UrlParser.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +4 -6
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +27 -3
- package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +127 -71
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/MoveVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/RenameVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +1 -1
- package/src/sap/ui/rta/util/hasStableId.js +1 -1
- package/src/sap/ui/rta/util/showMessageBox.js +1 -1
- package/src/sap/ui/rta/util/validateFlexEnabled.js +1 -1
- package/src/sap/ui/rta/util/validateStableIds.js +1 -1
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation.js +0 -124
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -51,6 +51,10 @@ sap.ui.define([
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
function _isOverlayVisible(oOverlay) {
|
|
55
|
+
return !oOverlay || !oOverlay.getDomRef() || !oOverlay.isVisible();
|
|
56
|
+
}
|
|
57
|
+
|
|
54
58
|
/**
|
|
55
59
|
* @class
|
|
56
60
|
* Root control for RTA change visualization.
|
|
@@ -59,7 +63,7 @@ sap.ui.define([
|
|
|
59
63
|
* @alias sap.ui.rta.util.changeVisualization.ChangeVisualization
|
|
60
64
|
* @author SAP SE
|
|
61
65
|
* @since 1.84.0
|
|
62
|
-
* @version 1.
|
|
66
|
+
* @version 1.111.0
|
|
63
67
|
* @private
|
|
64
68
|
*/
|
|
65
69
|
var ChangeVisualization = Control.extend("sap.ui.rta.util.changeVisualization.ChangeVisualization", {
|
|
@@ -145,38 +149,106 @@ sap.ui.define([
|
|
|
145
149
|
this._toggleRootOverlayClickHandler(false);
|
|
146
150
|
};
|
|
147
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Updates CViz after save
|
|
154
|
+
*
|
|
155
|
+
* @param {sap.ui.rta.toolbar.Base} oToolbar - Toolbar of RTA
|
|
156
|
+
*/
|
|
157
|
+
ChangeVisualization.prototype.updateAfterSave = function(oToolbar) {
|
|
158
|
+
if (this.getProperty("rootControlId")) {
|
|
159
|
+
this._oChangeIndicatorRegistry.reset();
|
|
160
|
+
this._updateChangeRegistry()
|
|
161
|
+
.then(function() {
|
|
162
|
+
this._selectChangeCategory(this._sSelectedChangeCategory);
|
|
163
|
+
this._selectChangeState(ChangeStates.ALL);
|
|
164
|
+
this._updateVisualizationModelMenuData();
|
|
165
|
+
oToolbar.setModel(this._oChangeVisualizationModel, "visualizationModel");
|
|
166
|
+
}.bind(this));
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
148
170
|
ChangeVisualization.prototype._reset = function() {
|
|
149
171
|
this._oChangeIndicatorRegistry.reset();
|
|
150
172
|
};
|
|
151
173
|
|
|
152
|
-
ChangeVisualization.prototype.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
174
|
+
ChangeVisualization.prototype._determineChangeVisibility = function(aRegisteredIndependentChanges, aAllRelevantChanges, sVisualizedChangeState) {
|
|
175
|
+
function filterRelevantChanges(aChanges) {
|
|
176
|
+
return aChanges.filter(function(oChange) {
|
|
177
|
+
if (!sVisualizedChangeState || sVisualizedChangeState === "all" || oChange.changeStates.includes(sVisualizedChangeState)) {
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
return false;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
// Array of all Hidden Changes
|
|
184
|
+
var aHiddenChanges = [];
|
|
185
|
+
// Array of all Visualized Changes
|
|
186
|
+
var aVisualizedChanges = [];
|
|
187
|
+
|
|
188
|
+
var bHasDraftChanges = false;
|
|
189
|
+
var bHasDirtyChanges = false;
|
|
190
|
+
|
|
191
|
+
var aAllRelevantChangeIds = aAllRelevantChanges.map(function(oChange) {
|
|
192
|
+
return oChange.id;
|
|
157
193
|
});
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (
|
|
161
|
-
|
|
194
|
+
|
|
195
|
+
aRegisteredIndependentChanges.forEach(function (oChange) {
|
|
196
|
+
if (oChange.changeStates.includes(ChangeStates.DIRTY)) {
|
|
197
|
+
bHasDraftChanges = true;
|
|
198
|
+
bHasDirtyChanges = true;
|
|
199
|
+
} else if (oChange.changeStates.includes(ChangeStates.DRAFT)) {
|
|
200
|
+
bHasDraftChanges = true;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
var oOverlay = OverlayRegistry.getOverlay(oChange.visualizationInfo.displayElementIds[0]);
|
|
204
|
+
|
|
205
|
+
if (!aAllRelevantChangeIds.includes(oChange.change.getId())) {
|
|
206
|
+
aHiddenChanges.push(oChange);
|
|
207
|
+
} else if (_isOverlayVisible(oOverlay)) {
|
|
208
|
+
aHiddenChanges.push(oChange);
|
|
209
|
+
} else {
|
|
210
|
+
aVisualizedChanges.push(oChange);
|
|
162
211
|
}
|
|
163
|
-
return oHiddenChange.changeStates.includes(sVisualizedChangeState);
|
|
164
212
|
});
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
213
|
+
var aRelevantHiddenChanges = filterRelevantChanges(aHiddenChanges);
|
|
214
|
+
var aRelevantVisualizedChanges = filterRelevantChanges(aVisualizedChanges);
|
|
215
|
+
return {
|
|
216
|
+
relevantHiddenChanges: aRelevantHiddenChanges,
|
|
217
|
+
relevantVisualizedChanges: aRelevantVisualizedChanges,
|
|
218
|
+
hasDirtyChanges: bHasDirtyChanges,
|
|
219
|
+
hasDraftChanges: bHasDraftChanges
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
ChangeVisualization.prototype._updateVisualizationModelMenuData = function() {
|
|
224
|
+
// Get selected change state and change category
|
|
225
|
+
var sVisualizedChangeState = this._oChangeVisualizationModel.getData().changeState;
|
|
226
|
+
|
|
227
|
+
// Get all registered and relevant change ids
|
|
228
|
+
var aAllRegisteredChanges = this._oChangeIndicatorRegistry.getAllRegisteredChanges();
|
|
229
|
+
var aAllRelevantChanges = this._oChangeIndicatorRegistry.getRelevantChangesWithSelector();
|
|
230
|
+
|
|
231
|
+
// Filter allRegisteredChanges for independent changes and get the ids
|
|
232
|
+
var aRegisteredIndependentChanges = aAllRegisteredChanges.filter(function(oChange) {
|
|
233
|
+
if (!oChange.dependent) {
|
|
234
|
+
return true;
|
|
169
235
|
}
|
|
170
|
-
return
|
|
236
|
+
return false;
|
|
171
237
|
});
|
|
238
|
+
|
|
239
|
+
var oSortedChanges = this._determineChangeVisibility(
|
|
240
|
+
aRegisteredIndependentChanges,
|
|
241
|
+
aAllRelevantChanges,
|
|
242
|
+
sVisualizedChangeState
|
|
243
|
+
);
|
|
172
244
|
var aCommandData = Object.keys(ChangeCategories.getCategories()).map(function(sChangeCategoryName) {
|
|
173
245
|
var sTitle = this._getChangeCategoryLabel(
|
|
174
246
|
sChangeCategoryName,
|
|
175
|
-
this._getChangesForChangeCategory(sChangeCategoryName,
|
|
247
|
+
this._getChangesForChangeCategory(sChangeCategoryName, oSortedChanges.relevantVisualizedChanges).length
|
|
176
248
|
);
|
|
177
249
|
return {
|
|
178
250
|
key: sChangeCategoryName,
|
|
179
|
-
count: this._getChangesForChangeCategory(sChangeCategoryName,
|
|
251
|
+
count: this._getChangesForChangeCategory(sChangeCategoryName, oSortedChanges.relevantVisualizedChanges).length,
|
|
180
252
|
title: sTitle,
|
|
181
253
|
icon: ChangeCategories.getIconForCategory(sChangeCategoryName)
|
|
182
254
|
};
|
|
@@ -184,19 +256,20 @@ sap.ui.define([
|
|
|
184
256
|
|
|
185
257
|
aCommandData.unshift({
|
|
186
258
|
key: ChangeCategories.ALL,
|
|
187
|
-
count: this._getChangesForChangeCategory(ChangeCategories.ALL,
|
|
188
|
-
title: this._getChangeCategoryLabel(ChangeCategories.ALL, this._getChangesForChangeCategory(ChangeCategories.ALL,
|
|
259
|
+
count: this._getChangesForChangeCategory(ChangeCategories.ALL, oSortedChanges.relevantVisualizedChanges).length,
|
|
260
|
+
title: this._getChangeCategoryLabel(ChangeCategories.ALL, this._getChangesForChangeCategory(ChangeCategories.ALL, oSortedChanges.relevantVisualizedChanges).length),
|
|
189
261
|
icon: ChangeCategories.getIconForCategory(ChangeCategories.ALL)
|
|
190
262
|
});
|
|
191
263
|
|
|
192
264
|
this._updateVisualizationModel({
|
|
193
265
|
changeCategories: aCommandData,
|
|
194
|
-
hasDraftChanges:
|
|
195
|
-
hasDirtyChanges:
|
|
266
|
+
hasDraftChanges: oSortedChanges.hasDraftChanges,
|
|
267
|
+
hasDirtyChanges: oSortedChanges.hasDirtyChanges,
|
|
196
268
|
popupInfoMessage: this._oTextBundle.getText(
|
|
197
269
|
"MSG_CHANGEVISUALIZATION_HIDDEN_CHANGES_INFO",
|
|
198
|
-
[
|
|
199
|
-
)
|
|
270
|
+
[oSortedChanges.relevantHiddenChanges.length]
|
|
271
|
+
),
|
|
272
|
+
sortedChanges: oSortedChanges
|
|
200
273
|
});
|
|
201
274
|
};
|
|
202
275
|
|
|
@@ -352,7 +425,14 @@ sap.ui.define([
|
|
|
352
425
|
|
|
353
426
|
ChangeVisualization.prototype._updateChangeRegistry = function() {
|
|
354
427
|
return this._collectChanges().then(function(aChanges) {
|
|
428
|
+
// remove updated changes
|
|
355
429
|
this._oChangeIndicatorRegistry.removeOutdatedRegisteredChanges();
|
|
430
|
+
// remove changes with incomplete vizInfo
|
|
431
|
+
this._oChangeIndicatorRegistry.removeRegisteredChangesWithoutVizInfo();
|
|
432
|
+
// remove all registered changes after versions activation
|
|
433
|
+
if (this._oChangeVisualizationModel.getData().displayedVersion !== "0") {
|
|
434
|
+
this._oChangeIndicatorRegistry.reset();
|
|
435
|
+
}
|
|
356
436
|
var aRegisteredChangeIds = this._oChangeIndicatorRegistry.getRegisteredChangeIds();
|
|
357
437
|
var oCurrentChanges = aChanges
|
|
358
438
|
.filter(function(oChange) {
|
|
@@ -370,7 +450,6 @@ sap.ui.define([
|
|
|
370
450
|
difference(aRegisteredChangeIds, aCurrentChangeIds).forEach(function(sChangeIdToRemove) {
|
|
371
451
|
this._oChangeIndicatorRegistry.removeRegisteredChange(sChangeIdToRemove);
|
|
372
452
|
}.bind(this));
|
|
373
|
-
|
|
374
453
|
var aPromises = [];
|
|
375
454
|
// Register missing changes
|
|
376
455
|
difference(aCurrentChangeIds, aRegisteredChangeIds).forEach(function(sChangeIdToAdd) {
|
|
@@ -412,23 +491,7 @@ sap.ui.define([
|
|
|
412
491
|
ChangeVisualization.prototype._updateChangeIndicators = function() {
|
|
413
492
|
var oSelectors = this._oChangeIndicatorRegistry.getSelectorsWithRegisteredChanges();
|
|
414
493
|
var oIndicators = {};
|
|
415
|
-
var aVisualizedChanges = [];
|
|
416
|
-
var aActivatedChanges = [];
|
|
417
|
-
var aDraftChanges = [];
|
|
418
|
-
var aDirtyChanges = [];
|
|
419
|
-
var aHiddenChanges = [];
|
|
420
494
|
Object.keys(oSelectors).forEach(function(sSelectorId) {
|
|
421
|
-
oSelectors[sSelectorId].forEach(function (oChange) {
|
|
422
|
-
if (!oChange.dependent) {
|
|
423
|
-
if (oChange.changeStates.includes(ChangeStates.ACTIVATED)) {
|
|
424
|
-
aActivatedChanges.push(oChange.id);
|
|
425
|
-
} else if (oChange.changeStates.includes(ChangeStates.DIRTY)) {
|
|
426
|
-
aDirtyChanges.push(oChange.id);
|
|
427
|
-
} else if (oChange.changeStates.includes(ChangeStates.DRAFT)) {
|
|
428
|
-
aDraftChanges.push(oChange.id);
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
495
|
var aChangesOnIndicator = oSelectors[sSelectorId];
|
|
433
496
|
var aRelevantChanges = this._filterRelevantChanges(oSelectors[sSelectorId]);
|
|
434
497
|
var oOverlay = OverlayRegistry.getOverlay(sSelectorId);
|
|
@@ -445,22 +508,11 @@ sap.ui.define([
|
|
|
445
508
|
return false;
|
|
446
509
|
});
|
|
447
510
|
}
|
|
448
|
-
if (
|
|
511
|
+
if (_isOverlayVisible(oOverlay)) {
|
|
449
512
|
// Change is not visible
|
|
450
|
-
aChangesOnIndicator.forEach(function (oChange) {
|
|
451
|
-
var aHiddenChangeIds = aHiddenChanges.map(function(oHiddenChange) {
|
|
452
|
-
return oHiddenChange.id;
|
|
453
|
-
});
|
|
454
|
-
if (!aHiddenChangeIds.includes(oChange.id)) {
|
|
455
|
-
aHiddenChanges.push(oChange);
|
|
456
|
-
}
|
|
457
|
-
});
|
|
458
513
|
return undefined;
|
|
459
514
|
}
|
|
460
515
|
var oOverlayPosition = oOverlay.getDomRef().getClientRects()[0] || { left: 0, top: 0 };
|
|
461
|
-
aRelevantChanges.forEach(function (oChange) {
|
|
462
|
-
aVisualizedChanges.push(oChange);
|
|
463
|
-
});
|
|
464
516
|
oIndicators[sSelectorId] = {
|
|
465
517
|
posX: parseInt(oOverlayPosition.left),
|
|
466
518
|
posY: parseInt(oOverlayPosition.top),
|
|
@@ -482,21 +534,10 @@ sap.ui.define([
|
|
|
482
534
|
!deepEqual(
|
|
483
535
|
oIndicators,
|
|
484
536
|
this._oChangeVisualizationModel.getData().content
|
|
485
|
-
) || !deepEqual(
|
|
486
|
-
aVisualizedChanges,
|
|
487
|
-
this._oChangeVisualizationModel.getData().visualizedChanges
|
|
488
|
-
) || !deepEqual(
|
|
489
|
-
aHiddenChanges,
|
|
490
|
-
this._oChangeVisualizationModel.getData().hiddenChanges
|
|
491
537
|
)
|
|
492
538
|
) {
|
|
493
539
|
this._updateVisualizationModel({
|
|
494
|
-
content: oIndicators
|
|
495
|
-
visualizedChanges: aVisualizedChanges,
|
|
496
|
-
dirtyChanges: aDirtyChanges,
|
|
497
|
-
activatedChanges: aActivatedChanges,
|
|
498
|
-
draftChanges: aDraftChanges,
|
|
499
|
-
hiddenChanges: aHiddenChanges
|
|
540
|
+
content: oIndicators
|
|
500
541
|
});
|
|
501
542
|
}
|
|
502
543
|
};
|
|
@@ -560,10 +601,22 @@ sap.ui.define([
|
|
|
560
601
|
if (aVisibleIndicators.length === 0) {
|
|
561
602
|
return;
|
|
562
603
|
}
|
|
604
|
+
|
|
605
|
+
var aVisibleIndicatorsOnScrollPosition = [];
|
|
563
606
|
aVisibleIndicators.forEach(function(oIndicator, iIndex) {
|
|
564
607
|
oIndicator.getDomRef().tabIndex = iIndex + 2;
|
|
608
|
+
// Indicators with posY < 0 are outside of the current scroll position
|
|
609
|
+
if (oIndicator.getPosY() > 0) {
|
|
610
|
+
aVisibleIndicatorsOnScrollPosition.push(oIndicator);
|
|
611
|
+
}
|
|
565
612
|
});
|
|
566
|
-
|
|
613
|
+
if (aVisibleIndicatorsOnScrollPosition.length > 0) {
|
|
614
|
+
// Indicators visible with the current scroll position get focus
|
|
615
|
+
// to avoid unexpected scrolling when visualization is started
|
|
616
|
+
aVisibleIndicatorsOnScrollPosition[0].focus();
|
|
617
|
+
} else {
|
|
618
|
+
aVisibleIndicators[0].focus();
|
|
619
|
+
}
|
|
567
620
|
};
|
|
568
621
|
|
|
569
622
|
ChangeVisualization.prototype._toggleRootOverlayClickHandler = function (bEnable) {
|
|
@@ -594,14 +647,17 @@ sap.ui.define([
|
|
|
594
647
|
ChangeVisualization.prototype.triggerModeChange = function(oRootControl, oToolbar) {
|
|
595
648
|
this.oMenuButton = oToolbar.getControl("toggleChangeVisualizationMenuButton");
|
|
596
649
|
this.oRootOverlay = OverlayRegistry.getOverlay(oRootControl);
|
|
597
|
-
|
|
598
|
-
|
|
650
|
+
this.setVersionsModel(oToolbar);
|
|
651
|
+
if (this.oVersionsModel && this.oVersionsModel.getData().versioningEnabled) {
|
|
599
652
|
this._updateVisualizationModel({
|
|
600
|
-
versioningAvailable: this.oVersionsModel.getData().versioningEnabled
|
|
653
|
+
versioningAvailable: this.oVersionsModel.getData().versioningEnabled,
|
|
654
|
+
displayedVersion: this.oVersionsModel.getData().displayedVersion
|
|
601
655
|
});
|
|
602
656
|
} else {
|
|
657
|
+
// no versioning available, setting draft version id for caching to be working
|
|
603
658
|
this._updateVisualizationModel({
|
|
604
|
-
versioningAvailable: false
|
|
659
|
+
versioningAvailable: false,
|
|
660
|
+
displayedVersion: "0"
|
|
605
661
|
});
|
|
606
662
|
}
|
|
607
663
|
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
sap.ui.define([
|
|
8
|
-
"sap/ui/base/ManagedObject",
|
|
9
|
-
"sap/ui/core/Fragment",
|
|
10
|
-
"sap/ui/fl/Layer",
|
|
11
|
-
"sap/ui/fl/write/api/ContextSharingAPI",
|
|
12
|
-
"sap/ui/rta/Utils",
|
|
13
|
-
"sap/ui/model/Binding"
|
|
14
|
-
], function (
|
|
15
|
-
ManagedObject,
|
|
16
|
-
Fragment,
|
|
17
|
-
Layer,
|
|
18
|
-
ContextSharingAPI,
|
|
19
|
-
Utils,
|
|
20
|
-
Binding
|
|
21
|
-
) {
|
|
22
|
-
"use strict";
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Controller for the <code>sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation</code> controls.
|
|
26
|
-
* Contains implementation of context-based-adaptation functionality.
|
|
27
|
-
*
|
|
28
|
-
* @class
|
|
29
|
-
*
|
|
30
|
-
* @author SAP SE
|
|
31
|
-
* @version 1.109.0
|
|
32
|
-
*
|
|
33
|
-
* @constructor
|
|
34
|
-
* @private
|
|
35
|
-
* @since 1.106
|
|
36
|
-
* @alias sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation
|
|
37
|
-
*/
|
|
38
|
-
var SaveAsContextBasedAdaptation = ManagedObject.extend("sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation", {
|
|
39
|
-
metadata: {
|
|
40
|
-
properties: {
|
|
41
|
-
toolbar: {
|
|
42
|
-
type: "any" // "sap.ui.rta.toolbar.Base"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
constructor: function () {
|
|
47
|
-
ManagedObject.prototype.constructor.apply(this, arguments);
|
|
48
|
-
this.oTextResources = this.getToolbar().getTextResources();
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
SaveAsContextBasedAdaptation.prototype.openAddAdaptationDialog = function (sLayer) {
|
|
53
|
-
if (!this._oAddAdaptationDialogPromise) {
|
|
54
|
-
this._oAddAdaptationDialogPromise = Fragment.load({
|
|
55
|
-
name: "sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptationDialog",
|
|
56
|
-
id: this.getToolbar().getId() + "_fragment--sapUiRta_addAdaptationDialog",
|
|
57
|
-
controller: {
|
|
58
|
-
onAdaptationTitleChange: _onAdaptationTitleChange.bind(this),
|
|
59
|
-
onSaveAsContextBasedAdaptation: _onSaveAsContextBasedAdaptation.bind(this),
|
|
60
|
-
onCancelContextBasedAdaptationDialog: _onCancelContextBasedAdaptationDialog.bind(this)
|
|
61
|
-
}
|
|
62
|
-
}).then(function (oDialog) {
|
|
63
|
-
this._oAddAdaptationDialog = oDialog;
|
|
64
|
-
this._oAddAdaptationDialog.attachBeforeClose(_clearComponent.bind(this));
|
|
65
|
-
oDialog.addStyleClass(Utils.getRtaStyleClassName());
|
|
66
|
-
this.getToolbar().addDependent(this._oAddAdaptationDialog);
|
|
67
|
-
}.bind(this));
|
|
68
|
-
} else {
|
|
69
|
-
this.getToolbar().getControl("addAdaptationDialog--saveContextBasedAdaptation-title-input").setValue("");
|
|
70
|
-
}
|
|
71
|
-
return this._oAddAdaptationDialogPromise.then(function () {
|
|
72
|
-
return createContextSharingComponent.call(this, sLayer);
|
|
73
|
-
}.bind(this)).then(function () {
|
|
74
|
-
this._oContextComponentInstance.showMessageStrip(false);
|
|
75
|
-
return this._oAddAdaptationDialog.open();
|
|
76
|
-
}.bind(this));
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
function _onAdaptationTitleChange(oEvent) {
|
|
80
|
-
this.sAdaptationTitle = oEvent.getParameter("value");
|
|
81
|
-
_enableSaveAsButton.call(this);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function _onCancelContextBasedAdaptationDialog() {
|
|
85
|
-
this._oAddAdaptationDialog.close();
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function _onSaveAsContextBasedAdaptation() {
|
|
89
|
-
var oContextBasedAdaptation = {};
|
|
90
|
-
oContextBasedAdaptation.title = getAdaptationTitle.call(this);
|
|
91
|
-
oContextBasedAdaptation.contexts = this._oContextComponentInstance.getSelectedContexts();
|
|
92
|
-
this.getToolbar().fireEvent("saveAsContextBasedAdaptation", oContextBasedAdaptation);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function createContextSharingComponent(sLayer) {
|
|
96
|
-
var mPropertyBag = { layer: sLayer || Layer.CUSTOMER };
|
|
97
|
-
return ContextSharingAPI.createComponent(mPropertyBag).then(function (oContextSharingComponent) {
|
|
98
|
-
this._oContextComponent = oContextSharingComponent;
|
|
99
|
-
this._oContextComponentInstance = oContextSharingComponent.getComponentInstance();
|
|
100
|
-
this._oContextComponentInstance.resetSelectedContexts();
|
|
101
|
-
this._oAddAdaptationDialog.addContent(this._oContextComponent);
|
|
102
|
-
var oSelectedContextsModel = this._oContextComponentInstance.getSelectedContextsModel();
|
|
103
|
-
this.oSelectedContextsBinding = new Binding(oSelectedContextsModel, "/", oSelectedContextsModel.getContext("/"));
|
|
104
|
-
this.oSelectedContextsBinding.attachChange(_enableSaveAsButton.bind(this));
|
|
105
|
-
}.bind(this));
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function getAdaptationTitle() {
|
|
109
|
-
return this.sAdaptationTitle || "";
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function _enableSaveAsButton() {
|
|
113
|
-
var bEnable = getAdaptationTitle.call(this).length > 0 && this._oContextComponentInstance.getSelectedContexts().role.length > 0;
|
|
114
|
-
this.getToolbar().getControl("addAdaptationDialog--saveContextBasedAdaptation-saveButton").setEnabled(bEnable);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function _clearComponent() {
|
|
118
|
-
if (this._oContextComponentInstance) {
|
|
119
|
-
this._oContextComponentInstance.showMessageStrip(true);
|
|
120
|
-
this._oContextComponentInstance.resetSelectedContexts();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return SaveAsContextBasedAdaptation;
|
|
124
|
-
});
|