@openui5/sap.ui.rta 1.107.0 → 1.108.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/THIRDPARTY.txt +1 -1
- 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 +14 -5
- package/src/sap/ui/rta/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +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 +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +49 -27
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +10 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +8 -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 +20 -10
- package/src/sap/ui/rta/messagebundle_ar.properties +6 -1
- package/src/sap/ui/rta/messagebundle_bg.properties +14 -9
- package/src/sap/ui/rta/messagebundle_ca.properties +6 -1
- package/src/sap/ui/rta/messagebundle_cs.properties +6 -1
- package/src/sap/ui/rta/messagebundle_cy.properties +6 -1
- package/src/sap/ui/rta/messagebundle_da.properties +6 -1
- package/src/sap/ui/rta/messagebundle_de.properties +6 -1
- package/src/sap/ui/rta/messagebundle_el.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en_GB.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
- package/src/sap/ui/rta/messagebundle_es.properties +6 -1
- package/src/sap/ui/rta/messagebundle_es_MX.properties +6 -1
- package/src/sap/ui/rta/messagebundle_et.properties +6 -1
- package/src/sap/ui/rta/messagebundle_fi.properties +6 -1
- package/src/sap/ui/rta/messagebundle_fr.properties +6 -1
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +7 -2
- package/src/sap/ui/rta/messagebundle_hi.properties +6 -1
- package/src/sap/ui/rta/messagebundle_hr.properties +6 -1
- package/src/sap/ui/rta/messagebundle_hu.properties +6 -1
- package/src/sap/ui/rta/messagebundle_id.properties +6 -1
- package/src/sap/ui/rta/messagebundle_it.properties +6 -1
- package/src/sap/ui/rta/messagebundle_iw.properties +6 -1
- package/src/sap/ui/rta/messagebundle_ja.properties +6 -1
- package/src/sap/ui/rta/messagebundle_kk.properties +6 -1
- package/src/sap/ui/rta/messagebundle_ko.properties +6 -1
- package/src/sap/ui/rta/messagebundle_lt.properties +6 -1
- package/src/sap/ui/rta/messagebundle_lv.properties +6 -1
- package/src/sap/ui/rta/messagebundle_ms.properties +6 -1
- package/src/sap/ui/rta/messagebundle_nl.properties +6 -1
- package/src/sap/ui/rta/messagebundle_no.properties +6 -1
- package/src/sap/ui/rta/messagebundle_pl.properties +6 -1
- package/src/sap/ui/rta/messagebundle_pt.properties +6 -1
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +6 -1
- package/src/sap/ui/rta/messagebundle_ro.properties +6 -1
- package/src/sap/ui/rta/messagebundle_ru.properties +6 -1
- package/src/sap/ui/rta/messagebundle_sh.properties +6 -1
- package/src/sap/ui/rta/messagebundle_sk.properties +6 -1
- package/src/sap/ui/rta/messagebundle_sl.properties +6 -1
- package/src/sap/ui/rta/messagebundle_sv.properties +6 -1
- package/src/sap/ui/rta/messagebundle_th.properties +6 -1
- package/src/sap/ui/rta/messagebundle_tr.properties +6 -1
- package/src/sap/ui/rta/messagebundle_uk.properties +6 -1
- package/src/sap/ui/rta/messagebundle_vi.properties +6 -1
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +6 -1
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +6 -1
- 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 +75 -29
- package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
- 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 +3 -1
- package/src/sap/ui/rta/plugin/Resize.js +1 -1
- package/src/sap/ui/rta/plugin/Selection.js +1 -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 +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +2 -2
- 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 +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/service/SupportTools.js +1 -1
- package/src/sap/ui/rta/toolbar/Adaptation.js +1 -1
- 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/SaveAsContextBasedAdaptation.js +7 -8
- 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 +2 -2
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- package/src/sap/ui/rta/util/ReloadManager.js +1 -1
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +16 -0
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +21 -4
- package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +28 -0
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +135 -53
- package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +39 -0
- package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +6 -3
|
@@ -40,7 +40,7 @@ sap.ui.define([
|
|
|
40
40
|
* @alias sap.ui.rta.util.changeVisualization.ChangeIndicator
|
|
41
41
|
* @author SAP SE
|
|
42
42
|
* @since 1.84.0
|
|
43
|
-
* @version 1.
|
|
43
|
+
* @version 1.108.0
|
|
44
44
|
* @private
|
|
45
45
|
*/
|
|
46
46
|
var ChangeIndicator = Control.extend("sap.ui.rta.util.changeVisualization.ChangeIndicator", {
|
package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml
CHANGED
|
@@ -5,6 +5,22 @@
|
|
|
5
5
|
<Popover
|
|
6
6
|
showHeader="false"
|
|
7
7
|
placement="Bottom">
|
|
8
|
+
<SegmentedButton selectedKey="satellite" width="420px" selectionChange=".onVersioningCategoryChange">
|
|
9
|
+
<items>
|
|
10
|
+
<SegmentedButtonItem
|
|
11
|
+
text="{i18n>BUT_CHANGEVISUALIZATION_VERSIONING_ALL}"
|
|
12
|
+
key="all"/>
|
|
13
|
+
<SegmentedButtonItem
|
|
14
|
+
text="{i18n>BUT_CHANGEVISUALIZATION_VERSIONING_DRAFT}"
|
|
15
|
+
key="draft"
|
|
16
|
+
visible="{visualizationModel>/versioningAvailable}"
|
|
17
|
+
enabled="{= ${visualizationModel>/hasDraftChanges} || ${visualizationModel>/hasDirtyChanges}}"/>
|
|
18
|
+
<SegmentedButtonItem
|
|
19
|
+
text="{i18n>BUT_CHANGEVISUALIZATION_VERSIONING_DIRTY}"
|
|
20
|
+
key="dirty"
|
|
21
|
+
enabled="{visualizationModel>/hasDirtyChanges}"/>
|
|
22
|
+
</items>
|
|
23
|
+
</SegmentedButton>
|
|
8
24
|
<MessageStrip
|
|
9
25
|
text="{visualizationModel>/popupInfoMessage}"
|
|
10
26
|
type="Information"
|
|
@@ -14,7 +14,8 @@ sap.ui.define([
|
|
|
14
14
|
"sap/ui/dt/ElementUtil",
|
|
15
15
|
"sap/ui/fl/write/api/ChangesWriteAPI",
|
|
16
16
|
"sap/ui/fl/Utils",
|
|
17
|
-
"sap/ui/fl/changeHandler/common/ChangeCategories"
|
|
17
|
+
"sap/ui/fl/changeHandler/common/ChangeCategories",
|
|
18
|
+
"sap/ui/rta/util/changeVisualization/ChangeStates"
|
|
18
19
|
], function(
|
|
19
20
|
includes,
|
|
20
21
|
values,
|
|
@@ -25,7 +26,8 @@ sap.ui.define([
|
|
|
25
26
|
ElementUtil,
|
|
26
27
|
ChangesWriteAPI,
|
|
27
28
|
FlUtils,
|
|
28
|
-
ChangeCategories
|
|
29
|
+
ChangeCategories,
|
|
30
|
+
ChangeStates
|
|
29
31
|
) {
|
|
30
32
|
"use strict";
|
|
31
33
|
|
|
@@ -37,7 +39,7 @@ sap.ui.define([
|
|
|
37
39
|
* @alias sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry
|
|
38
40
|
* @author SAP SE
|
|
39
41
|
* @since 1.86.0
|
|
40
|
-
* @version 1.
|
|
42
|
+
* @version 1.108.0
|
|
41
43
|
* @private
|
|
42
44
|
*/
|
|
43
45
|
var ChangeIndicatorRegistry = ManagedObject.extend("sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry", {
|
|
@@ -167,9 +169,10 @@ sap.ui.define([
|
|
|
167
169
|
*
|
|
168
170
|
* @param {object} oChange - The change to register
|
|
169
171
|
* @param {string} sCommandName - Command name of the change
|
|
172
|
+
* @param {string} oVersionsModel - Model with versioning data
|
|
170
173
|
* @returns {Promise<undefined>} Resolves as soon as the change is registered
|
|
171
174
|
*/
|
|
172
|
-
ChangeIndicatorRegistry.prototype.registerChange = function(oChange, sCommandName) {
|
|
175
|
+
ChangeIndicatorRegistry.prototype.registerChange = function(oChange, sCommandName, oVersionsModel) {
|
|
173
176
|
var oAppComponent = FlUtils.getAppComponentForControl(ElementUtil.getElementInstance(this.getRootControlId()));
|
|
174
177
|
return getVisualizationInfo(oChange, oAppComponent).then(function(mChangeVisualizationInfo) {
|
|
175
178
|
var aCategories = this.getChangeCategories();
|
|
@@ -185,11 +188,25 @@ sap.ui.define([
|
|
|
185
188
|
sChangeCategory = ChangeCategories.OTHER;
|
|
186
189
|
}
|
|
187
190
|
}
|
|
191
|
+
var aChangeStates;
|
|
192
|
+
var aDraftChangesList = [];
|
|
193
|
+
if (oVersionsModel) {
|
|
194
|
+
aDraftChangesList = oVersionsModel.getData().draftFilenames;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (oChange.getState() === "NEW") {
|
|
198
|
+
aChangeStates = [ChangeStates.DIRTY, ChangeStates.DRAFT];
|
|
199
|
+
} else if (aDraftChangesList && aDraftChangesList.includes(oChange.getFileName())) {
|
|
200
|
+
aChangeStates = [ChangeStates.DRAFT];
|
|
201
|
+
} else {
|
|
202
|
+
aChangeStates = [ChangeStates.ACTIVATED];
|
|
203
|
+
}
|
|
188
204
|
|
|
189
205
|
this._oRegisteredChanges[oChange.getId()] = {
|
|
190
206
|
change: oChange,
|
|
191
207
|
commandName: sCommandName,
|
|
192
208
|
changeCategory: sChangeCategory,
|
|
209
|
+
changeStates: aChangeStates,
|
|
193
210
|
visualizationInfo: mChangeVisualizationInfo
|
|
194
211
|
};
|
|
195
212
|
}.bind(this));
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
], function(
|
|
9
|
+
) {
|
|
10
|
+
"use strict";
|
|
11
|
+
|
|
12
|
+
var ChangeStates = {};
|
|
13
|
+
|
|
14
|
+
ChangeStates.ACTIVATED = "activated";
|
|
15
|
+
ChangeStates.DRAFT = "draft";
|
|
16
|
+
ChangeStates.DIRTY = "dirty";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Builds an array with the combined State of Draft and Dirty
|
|
20
|
+
*
|
|
21
|
+
* @returns {array} Array of change states.
|
|
22
|
+
*/
|
|
23
|
+
ChangeStates.getDraftState = function() {
|
|
24
|
+
return [this.DRAFT, this.DIRTY];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return ChangeStates;
|
|
28
|
+
});
|
|
@@ -19,7 +19,8 @@ sap.ui.define([
|
|
|
19
19
|
"sap/ui/model/json/JSONModel",
|
|
20
20
|
"sap/ui/rta/util/changeVisualization/ChangeIndicator",
|
|
21
21
|
"sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry",
|
|
22
|
-
"sap/ui/rta/util/changeVisualization/ChangeCategories"
|
|
22
|
+
"sap/ui/rta/util/changeVisualization/ChangeCategories",
|
|
23
|
+
"sap/ui/rta/util/changeVisualization/ChangeStates"
|
|
23
24
|
], function(
|
|
24
25
|
Fragment,
|
|
25
26
|
difference,
|
|
@@ -35,7 +36,8 @@ sap.ui.define([
|
|
|
35
36
|
JSONModel,
|
|
36
37
|
ChangeIndicator,
|
|
37
38
|
ChangeIndicatorRegistry,
|
|
38
|
-
ChangeCategories
|
|
39
|
+
ChangeCategories,
|
|
40
|
+
ChangeStates
|
|
39
41
|
) {
|
|
40
42
|
"use strict";
|
|
41
43
|
|
|
@@ -57,7 +59,7 @@ sap.ui.define([
|
|
|
57
59
|
* @alias sap.ui.rta.util.changeVisualization.ChangeVisualization
|
|
58
60
|
* @author SAP SE
|
|
59
61
|
* @since 1.84.0
|
|
60
|
-
* @version 1.
|
|
62
|
+
* @version 1.108.0
|
|
61
63
|
* @private
|
|
62
64
|
*/
|
|
63
65
|
var ChangeVisualization = Control.extend("sap.ui.rta.util.changeVisualization.ChangeVisualization", {
|
|
@@ -109,6 +111,10 @@ sap.ui.define([
|
|
|
109
111
|
}
|
|
110
112
|
});
|
|
111
113
|
|
|
114
|
+
ChangeVisualization.prototype.setVersionsModel = function(oToolbar) {
|
|
115
|
+
this.oVersionsModel = oToolbar.getModel("versions");
|
|
116
|
+
};
|
|
117
|
+
|
|
112
118
|
ChangeVisualization.prototype.setRootControlId = function(sRootControlId) {
|
|
113
119
|
if (this.getRootControlId() && this.getRootControlId() !== sRootControlId) {
|
|
114
120
|
this._reset();
|
|
@@ -144,16 +150,24 @@ sap.ui.define([
|
|
|
144
150
|
};
|
|
145
151
|
|
|
146
152
|
ChangeVisualization.prototype._updateVisualizationModelMenuData = function() {
|
|
147
|
-
var aVisualizedChanges = this._oChangeVisualizationModel.getData().visualizedChanges;
|
|
148
|
-
var aHiddenChanges = [];
|
|
149
153
|
var aAllRegisteredChanges = this._oChangeIndicatorRegistry.getAllRegisteredChanges();
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
var aHiddenChanges = this._oChangeVisualizationModel.getData().hiddenChanges;
|
|
155
|
+
var aHiddenChangeIds = aHiddenChanges.map(function(oHiddenChange) {
|
|
156
|
+
return oHiddenChange.id;
|
|
157
|
+
});
|
|
158
|
+
var sVisualizedChangeState = this._oChangeVisualizationModel.getData().changeState;
|
|
159
|
+
var aHiddenChangesPerChangeState = aHiddenChanges.filter(function (oHiddenChange) {
|
|
160
|
+
if (!sVisualizedChangeState || sVisualizedChangeState === "all") {
|
|
161
|
+
return true;
|
|
156
162
|
}
|
|
163
|
+
return oHiddenChange.changeStates.includes(sVisualizedChangeState);
|
|
164
|
+
});
|
|
165
|
+
var aVisualizedChanges = aAllRegisteredChanges.filter(function (oChange) {
|
|
166
|
+
var bIsChangeVisible = !aHiddenChangeIds.includes(oChange.change.getId());
|
|
167
|
+
if (!sVisualizedChangeState || sVisualizedChangeState === "all") {
|
|
168
|
+
return bIsChangeVisible;
|
|
169
|
+
}
|
|
170
|
+
return bIsChangeVisible && oChange.changeStates.includes(sVisualizedChangeState);
|
|
157
171
|
});
|
|
158
172
|
var aCommandData = Object.keys(ChangeCategories.getCategories()).map(function(sChangeCategoryName) {
|
|
159
173
|
var sTitle = this._getChangeCategoryLabel(
|
|
@@ -177,10 +191,11 @@ sap.ui.define([
|
|
|
177
191
|
|
|
178
192
|
this._updateVisualizationModel({
|
|
179
193
|
changeCategories: aCommandData,
|
|
180
|
-
|
|
194
|
+
hasDraftChanges: this._oChangeVisualizationModel.getData().draftChanges.length > 0,
|
|
195
|
+
hasDirtyChanges: this._oChangeVisualizationModel.getData().dirtyChanges.length > 0,
|
|
181
196
|
popupInfoMessage: this._oTextBundle.getText(
|
|
182
197
|
"MSG_CHANGEVISUALIZATION_HIDDEN_CHANGES_INFO",
|
|
183
|
-
[
|
|
198
|
+
[aHiddenChangesPerChangeState.length]
|
|
184
199
|
)
|
|
185
200
|
});
|
|
186
201
|
};
|
|
@@ -221,6 +236,12 @@ sap.ui.define([
|
|
|
221
236
|
oPopover.setModel(this._oChangeVisualizationModel, "visualizationModel");
|
|
222
237
|
oPopover.openBy(this._oToolbarButton);
|
|
223
238
|
this.setPopover(oPopover);
|
|
239
|
+
//Currently required because of an binding issue from the control
|
|
240
|
+
//At the first opening of the popover the controls don't get updated when the bound
|
|
241
|
+
//model changes. With the reopening this Problem gets fixed
|
|
242
|
+
//TODO Remove once control owners have fixed the issue
|
|
243
|
+
oPopover.close();
|
|
244
|
+
oPopover.openBy(this._oToolbarButton);
|
|
224
245
|
}.bind(this));
|
|
225
246
|
return;
|
|
226
247
|
}
|
|
@@ -242,6 +263,11 @@ sap.ui.define([
|
|
|
242
263
|
this._selectChangeCategory(sSelectedChangeCategory);
|
|
243
264
|
};
|
|
244
265
|
|
|
266
|
+
ChangeVisualization.prototype.onVersioningCategoryChange = function(oEvent) {
|
|
267
|
+
var sSelectedChangeState = oEvent.getSource().getSelectedKey();
|
|
268
|
+
this._selectChangeState(sSelectedChangeState);
|
|
269
|
+
};
|
|
270
|
+
|
|
245
271
|
ChangeVisualization.prototype._selectChangeCategory = function(sSelectedChangeCategory) {
|
|
246
272
|
this._sSelectedChangeCategory = sSelectedChangeCategory;
|
|
247
273
|
|
|
@@ -256,6 +282,17 @@ sap.ui.define([
|
|
|
256
282
|
this._setFocusedIndicator();
|
|
257
283
|
};
|
|
258
284
|
|
|
285
|
+
ChangeVisualization.prototype._selectChangeState = function(sSelectedChangeState) {
|
|
286
|
+
this._sSelectedChangeState = sSelectedChangeState;
|
|
287
|
+
|
|
288
|
+
this._updateVisualizationModel({
|
|
289
|
+
changeState: sSelectedChangeState
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
this._updateChangeIndicators();
|
|
293
|
+
this._updateVisualizationModelMenuData();
|
|
294
|
+
};
|
|
295
|
+
|
|
259
296
|
ChangeVisualization.prototype._getCommandForChange = function(oChange) {
|
|
260
297
|
var sCommand = oChange.getSupportInformation().command;
|
|
261
298
|
if (sCommand) {
|
|
@@ -339,7 +376,7 @@ sap.ui.define([
|
|
|
339
376
|
difference(aCurrentChangeIds, aRegisteredChangeIds).forEach(function(sChangeIdToAdd) {
|
|
340
377
|
var oChangeToAdd = oCurrentChanges[sChangeIdToAdd];
|
|
341
378
|
var sCommandName = this._getCommandForChange(oChangeToAdd);
|
|
342
|
-
aPromises.push(this._oChangeIndicatorRegistry.registerChange(oChangeToAdd, sCommandName));
|
|
379
|
+
aPromises.push(this._oChangeIndicatorRegistry.registerChange(oChangeToAdd, sCommandName, this.oVersionsModel));
|
|
343
380
|
}.bind(this));
|
|
344
381
|
return Promise.all(aPromises);
|
|
345
382
|
}.bind(this));
|
|
@@ -376,47 +413,70 @@ sap.ui.define([
|
|
|
376
413
|
var oSelectors = this._oChangeIndicatorRegistry.getSelectorsWithRegisteredChanges();
|
|
377
414
|
var oIndicators = {};
|
|
378
415
|
var aVisualizedChanges = [];
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
return false;
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
if (!oOverlay || !oOverlay.getDomRef() || !oOverlay.isVisible()) {
|
|
397
|
-
// Change is not visible
|
|
398
|
-
return undefined;
|
|
416
|
+
var aActivatedChanges = [];
|
|
417
|
+
var aDraftChanges = [];
|
|
418
|
+
var aDirtyChanges = [];
|
|
419
|
+
var aHiddenChanges = [];
|
|
420
|
+
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
|
+
}
|
|
399
430
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
431
|
+
});
|
|
432
|
+
var aChangesOnIndicator = oSelectors[sSelectorId];
|
|
433
|
+
var aRelevantChanges = this._filterRelevantChanges(oSelectors[sSelectorId]);
|
|
434
|
+
var oOverlay = OverlayRegistry.getOverlay(sSelectorId);
|
|
435
|
+
if (!oOverlay) {
|
|
436
|
+
// When the selector has no Overlay, check if there is a relevant container Overlay
|
|
437
|
+
// e.g. when a SmartForm group is removed
|
|
438
|
+
aChangesOnIndicator.some(function(oChange) {
|
|
439
|
+
var oElementOverlay = OverlayRegistry.getOverlay(oChange.affectedElementId);
|
|
440
|
+
var oRelevantContainer = oElementOverlay && oElementOverlay.getRelevantContainer();
|
|
441
|
+
if (oRelevantContainer) {
|
|
442
|
+
oOverlay = OverlayRegistry.getOverlay(oRelevantContainer);
|
|
443
|
+
return true;
|
|
444
|
+
}
|
|
445
|
+
return false;
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
if (!oOverlay || !oOverlay.getDomRef() || !oOverlay.isVisible()) {
|
|
449
|
+
// 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
|
+
}
|
|
403
457
|
});
|
|
404
|
-
oIndicators[sSelectorId] = {
|
|
405
|
-
posX: parseInt(oOverlayPosition.left),
|
|
406
|
-
posY: parseInt(oOverlayPosition.top),
|
|
407
|
-
changes: aRelevantChanges
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
var oChangeIndicator = this._oChangeIndicatorRegistry.getChangeIndicator(sSelectorId);
|
|
411
|
-
var sOverlayId = oOverlay.getId();
|
|
412
|
-
if (!oChangeIndicator) {
|
|
413
|
-
this._createChangeIndicator(oOverlay, sSelectorId);
|
|
414
|
-
} else if (oChangeIndicator.getOverlayId() !== sOverlayId) {
|
|
415
|
-
// Overlay id might change, e.g. during undo/redo of dirty changes
|
|
416
|
-
oChangeIndicator.setOverlayId(sOverlayId);
|
|
417
|
-
}
|
|
418
458
|
return undefined;
|
|
419
|
-
}
|
|
459
|
+
}
|
|
460
|
+
var oOverlayPosition = oOverlay.getDomRef().getClientRects()[0] || { left: 0, top: 0 };
|
|
461
|
+
aRelevantChanges.forEach(function (oChange) {
|
|
462
|
+
aVisualizedChanges.push(oChange);
|
|
463
|
+
});
|
|
464
|
+
oIndicators[sSelectorId] = {
|
|
465
|
+
posX: parseInt(oOverlayPosition.left),
|
|
466
|
+
posY: parseInt(oOverlayPosition.top),
|
|
467
|
+
changes: aRelevantChanges
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
var oChangeIndicator = this._oChangeIndicatorRegistry.getChangeIndicator(sSelectorId);
|
|
471
|
+
var sOverlayId = oOverlay.getId();
|
|
472
|
+
if (!oChangeIndicator) {
|
|
473
|
+
this._createChangeIndicator(oOverlay, sSelectorId);
|
|
474
|
+
} else if (oChangeIndicator.getOverlayId() !== sOverlayId) {
|
|
475
|
+
// Overlay id might change, e.g. during undo/redo of dirty changes
|
|
476
|
+
oChangeIndicator.setOverlayId(sOverlayId);
|
|
477
|
+
}
|
|
478
|
+
return undefined;
|
|
479
|
+
}.bind(this));
|
|
420
480
|
|
|
421
481
|
if (
|
|
422
482
|
!deepEqual(
|
|
@@ -425,11 +485,18 @@ sap.ui.define([
|
|
|
425
485
|
) || !deepEqual(
|
|
426
486
|
aVisualizedChanges,
|
|
427
487
|
this._oChangeVisualizationModel.getData().visualizedChanges
|
|
488
|
+
) || !deepEqual(
|
|
489
|
+
aHiddenChanges,
|
|
490
|
+
this._oChangeVisualizationModel.getData().hiddenChanges
|
|
428
491
|
)
|
|
429
492
|
) {
|
|
430
493
|
this._updateVisualizationModel({
|
|
431
494
|
content: oIndicators,
|
|
432
|
-
visualizedChanges: aVisualizedChanges
|
|
495
|
+
visualizedChanges: aVisualizedChanges,
|
|
496
|
+
dirtyChanges: aDirtyChanges,
|
|
497
|
+
activatedChanges: aActivatedChanges,
|
|
498
|
+
draftChanges: aDraftChanges,
|
|
499
|
+
hiddenChanges: aHiddenChanges
|
|
433
500
|
});
|
|
434
501
|
}
|
|
435
502
|
};
|
|
@@ -448,6 +515,11 @@ sap.ui.define([
|
|
|
448
515
|
oRootData.changeCategory === ChangeCategories.ALL
|
|
449
516
|
|| oRootData.changeCategory === oChangeVizInfo.changeCategory
|
|
450
517
|
)
|
|
518
|
+
&& (
|
|
519
|
+
!oRootData.changeState
|
|
520
|
+
|| oRootData.changeState === "all"
|
|
521
|
+
|| oChangeVizInfo.changeStates.includes(oRootData.changeState)
|
|
522
|
+
)
|
|
451
523
|
);
|
|
452
524
|
});
|
|
453
525
|
};
|
|
@@ -522,6 +594,16 @@ sap.ui.define([
|
|
|
522
594
|
ChangeVisualization.prototype.triggerModeChange = function(oRootControl, oToolbar) {
|
|
523
595
|
this.oMenuButton = oToolbar.getControl("toggleChangeVisualizationMenuButton");
|
|
524
596
|
this.oRootOverlay = OverlayRegistry.getOverlay(oRootControl);
|
|
597
|
+
if (oToolbar.getModel("versions")) {
|
|
598
|
+
this.setVersionsModel(oToolbar);
|
|
599
|
+
this._updateVisualizationModel({
|
|
600
|
+
versioningAvailable: this.oVersionsModel.getData().versioningEnabled
|
|
601
|
+
});
|
|
602
|
+
} else {
|
|
603
|
+
this._updateVisualizationModel({
|
|
604
|
+
versioningAvailable: false
|
|
605
|
+
});
|
|
606
|
+
}
|
|
525
607
|
|
|
526
608
|
if (this.getIsActive()) {
|
|
527
609
|
this.setIsActive(false);
|
|
@@ -0,0 +1,39 @@
|
|
|
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/rta/util/changeVisualization/ChangeVisualizationUtils"
|
|
10
|
+
], function(
|
|
11
|
+
Core,
|
|
12
|
+
ChangeVisualizationUtils
|
|
13
|
+
) {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
var CreateContainerVisualization = {};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Creates a localized description for create container, based on the provided
|
|
20
|
+
* payload containing the original label.
|
|
21
|
+
*
|
|
22
|
+
* @param {object} mPayload - Change visualization description payload from the change handler
|
|
23
|
+
* @param {string} mPayload.originalLabel - Original element label from create container change
|
|
24
|
+
* @param {string} sLabel - Current element label
|
|
25
|
+
* @returns {object} Map containing localized description text and tooltip
|
|
26
|
+
*/
|
|
27
|
+
CreateContainerVisualization.getDescription = function (mPayload, sLabel) {
|
|
28
|
+
var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
|
|
29
|
+
var sElementLabel = mPayload.originalLabel || sLabel;
|
|
30
|
+
var sShortenedElementLabel = ChangeVisualizationUtils.shortenString(sElementLabel);
|
|
31
|
+
var sTextKey = "TXT_CHANGEVISUALIZATION_CHANGE_CREATECONTAINER";
|
|
32
|
+
return {
|
|
33
|
+
descriptionText: oRtaResourceBundle.getText(sTextKey, sShortenedElementLabel),
|
|
34
|
+
descriptionTooltip: oRtaResourceBundle.getText(sTextKey, sElementLabel)
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return CreateContainerVisualization;
|
|
39
|
+
});
|
|
@@ -8,12 +8,14 @@ sap.ui.define([
|
|
|
8
8
|
"sap/ui/rta/util/changeVisualization/commands/RenameVisualization",
|
|
9
9
|
"sap/ui/rta/util/changeVisualization/commands/MoveVisualization",
|
|
10
10
|
"sap/ui/rta/util/changeVisualization/commands/CombineVisualization",
|
|
11
|
-
"sap/ui/rta/util/changeVisualization/commands/SplitVisualization"
|
|
11
|
+
"sap/ui/rta/util/changeVisualization/commands/SplitVisualization",
|
|
12
|
+
"sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization"
|
|
12
13
|
], function(
|
|
13
14
|
RenameVisualization,
|
|
14
15
|
MoveVisualization,
|
|
15
16
|
CombineVisualization,
|
|
16
|
-
SplitVisualization
|
|
17
|
+
SplitVisualization,
|
|
18
|
+
CreateContainerVisualization
|
|
17
19
|
) {
|
|
18
20
|
"use strict";
|
|
19
21
|
|
|
@@ -21,7 +23,8 @@ sap.ui.define([
|
|
|
21
23
|
rename: RenameVisualization,
|
|
22
24
|
move: MoveVisualization,
|
|
23
25
|
combine: CombineVisualization,
|
|
24
|
-
split: SplitVisualization
|
|
26
|
+
split: SplitVisualization,
|
|
27
|
+
createContainer: CreateContainerVisualization
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
return function(mIndicatorInformation) {
|