@openui5/sap.ui.rta 1.109.0 → 1.110.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 +224 -143
- 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 +2 -2
- 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 +59 -13
- package/src/sap/ui/rta/messagebundle_ar.properties +32 -11
- package/src/sap/ui/rta/messagebundle_bg.properties +32 -11
- package/src/sap/ui/rta/messagebundle_ca.properties +32 -11
- package/src/sap/ui/rta/messagebundle_cs.properties +32 -11
- package/src/sap/ui/rta/messagebundle_cy.properties +31 -10
- package/src/sap/ui/rta/messagebundle_da.properties +31 -10
- package/src/sap/ui/rta/messagebundle_de.properties +34 -13
- package/src/sap/ui/rta/messagebundle_el.properties +31 -10
- package/src/sap/ui/rta/messagebundle_en.properties +30 -9
- package/src/sap/ui/rta/messagebundle_en_GB.properties +30 -9
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +28 -5
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +28 -5
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +28 -7
- package/src/sap/ui/rta/messagebundle_es.properties +31 -10
- package/src/sap/ui/rta/messagebundle_es_MX.properties +31 -10
- package/src/sap/ui/rta/messagebundle_et.properties +31 -10
- package/src/sap/ui/rta/messagebundle_fi.properties +31 -10
- package/src/sap/ui/rta/messagebundle_fr.properties +31 -10
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +32 -11
- package/src/sap/ui/rta/messagebundle_hi.properties +32 -11
- package/src/sap/ui/rta/messagebundle_hr.properties +32 -11
- package/src/sap/ui/rta/messagebundle_hu.properties +31 -10
- package/src/sap/ui/rta/messagebundle_id.properties +32 -11
- package/src/sap/ui/rta/messagebundle_it.properties +32 -11
- package/src/sap/ui/rta/messagebundle_iw.properties +31 -10
- package/src/sap/ui/rta/messagebundle_ja.properties +32 -11
- package/src/sap/ui/rta/messagebundle_kk.properties +31 -10
- package/src/sap/ui/rta/messagebundle_ko.properties +31 -10
- package/src/sap/ui/rta/messagebundle_lt.properties +31 -10
- package/src/sap/ui/rta/messagebundle_lv.properties +32 -11
- package/src/sap/ui/rta/messagebundle_ms.properties +32 -11
- package/src/sap/ui/rta/messagebundle_nl.properties +31 -10
- package/src/sap/ui/rta/messagebundle_no.properties +32 -11
- package/src/sap/ui/rta/messagebundle_pl.properties +32 -11
- package/src/sap/ui/rta/messagebundle_pt.properties +32 -11
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +31 -10
- package/src/sap/ui/rta/messagebundle_ro.properties +32 -11
- package/src/sap/ui/rta/messagebundle_ru.properties +32 -11
- package/src/sap/ui/rta/messagebundle_sh.properties +31 -10
- package/src/sap/ui/rta/messagebundle_sk.properties +31 -10
- package/src/sap/ui/rta/messagebundle_sl.properties +31 -10
- package/src/sap/ui/rta/messagebundle_sv.properties +32 -11
- package/src/sap/ui/rta/messagebundle_th.properties +33 -12
- package/src/sap/ui/rta/messagebundle_tr.properties +31 -10
- package/src/sap/ui/rta/messagebundle_uk.properties +31 -10
- package/src/sap/ui/rta/messagebundle_vi.properties +32 -11
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +32 -11
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +32 -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 +2 -2
- 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 +50 -13
- package/src/sap/ui/rta/plugin/RTAElementMover.js +2 -2
- package/src/sap/ui/rta/plugin/Remove.js +2 -2
- package/src/sap/ui/rta/plugin/Rename.js +2 -2
- package/src/sap/ui/rta/plugin/RenameHandler.js +28 -18
- package/src/sap/ui/rta/plugin/Resize.js +2 -2
- package/src/sap/ui/rta/plugin/Selection.js +7 -14
- 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 +1 -1
- 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 +11 -10
- 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 +263 -0
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +149 -0
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +185 -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 +3 -3
- 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 +109 -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,27 +1,37 @@
|
|
|
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
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"require",
|
|
8
9
|
"sap/ui/core/Fragment",
|
|
10
|
+
"sap/ui/core/Popup",
|
|
11
|
+
"sap/ui/core/IconPool",
|
|
9
12
|
"sap/ui/fl/write/api/Version",
|
|
10
|
-
"sap/ui/rta/toolbar/contextBased/
|
|
13
|
+
"sap/ui/rta/toolbar/contextBased/SaveAsAdaptation",
|
|
14
|
+
"sap/ui/rta/toolbar/contextBased/ManageAdaptations",
|
|
11
15
|
"sap/ui/rta/toolbar/translation/Translation",
|
|
12
16
|
"sap/ui/rta/toolbar/versioning/Versioning",
|
|
13
17
|
"sap/ui/rta/appVariant/Feature",
|
|
14
18
|
"sap/ui/rta/toolbar/Base",
|
|
19
|
+
"sap/ui/rta/Utils",
|
|
15
20
|
"sap/ui/Device",
|
|
16
21
|
"./AdaptationRenderer"
|
|
17
22
|
], function(
|
|
23
|
+
require,
|
|
18
24
|
Fragment,
|
|
25
|
+
Popup,
|
|
26
|
+
IconPool,
|
|
19
27
|
Version,
|
|
20
|
-
|
|
28
|
+
SaveAsAdaptation,
|
|
29
|
+
ManageAdaptations,
|
|
21
30
|
Translation,
|
|
22
31
|
Versioning,
|
|
23
32
|
AppVariantFeature,
|
|
24
33
|
Base,
|
|
34
|
+
Utils,
|
|
25
35
|
Device,
|
|
26
36
|
AdaptationRenderer
|
|
27
37
|
) {
|
|
@@ -35,7 +45,7 @@ sap.ui.define([
|
|
|
35
45
|
* @extends sap.ui.rta.toolbar.Base
|
|
36
46
|
*
|
|
37
47
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
48
|
+
* @version 1.110.0
|
|
39
49
|
*
|
|
40
50
|
* @constructor
|
|
41
51
|
* @private
|
|
@@ -62,7 +72,6 @@ sap.ui.define([
|
|
|
62
72
|
activate: {},
|
|
63
73
|
discardDraft: {},
|
|
64
74
|
switchVersion: {},
|
|
65
|
-
saveAsContextBasedAdaptation: {},
|
|
66
75
|
openChangeCategorySelectionPopover: {}
|
|
67
76
|
}
|
|
68
77
|
}
|
|
@@ -83,6 +92,28 @@ sap.ui.define([
|
|
|
83
92
|
}
|
|
84
93
|
Device.media.attachHandler(this._onSizeChanged, this, DEVICE_SET);
|
|
85
94
|
}.bind(this));
|
|
95
|
+
|
|
96
|
+
IconPool.registerFont({
|
|
97
|
+
collectionName: "BusinessSuiteInAppSymbols",
|
|
98
|
+
fontFamily: "BusinessSuiteInAppSymbols",
|
|
99
|
+
fontURI: require.toUrl("sap/ushell/themes/base/fonts/"),
|
|
100
|
+
lazy: true
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
Adaptation.prototype._hideElementsOnIntersection = function(aEntries) {
|
|
105
|
+
if (aEntries[0].intersectionRatio === 0) {
|
|
106
|
+
this._observeActionToolbarIntersection();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
// Actions toolbar is no longer fully visible
|
|
110
|
+
if (aEntries[0].intersectionRatio < 1) {
|
|
111
|
+
if (!this._mSizeLimits.switchToIcons) {
|
|
112
|
+
var iHiddenWidth = aEntries[0].boundingClientRect.width - aEntries[0].intersectionRect.width;
|
|
113
|
+
this._mSizeLimits.switchToIcons = window.innerWidth + iHiddenWidth;
|
|
114
|
+
this._switchToIcons();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
86
117
|
};
|
|
87
118
|
|
|
88
119
|
Adaptation.prototype.onFragmentLoaded = function() {
|
|
@@ -128,8 +159,31 @@ sap.ui.define([
|
|
|
128
159
|
return this.getExtension("versioning", Versioning).openActivateVersionDialog(sDisplayedVersion);
|
|
129
160
|
};
|
|
130
161
|
|
|
131
|
-
Adaptation.prototype.
|
|
132
|
-
|
|
162
|
+
Adaptation.prototype.showActionsMenu = function(oEvent) {
|
|
163
|
+
var oButton = oEvent.getSource();
|
|
164
|
+
if (!this._oActionsMenuFragment) {
|
|
165
|
+
return Fragment.load({
|
|
166
|
+
id: this.getId() + "_actionsMenu_fragment",
|
|
167
|
+
name: "sap.ui.rta.toolbar.ActionsMenu",
|
|
168
|
+
controller: {
|
|
169
|
+
openDownloadTranslationDialog: onOpenDownloadTranslationDialog.bind(this),
|
|
170
|
+
openUploadTranslationDialog: onOpenUploadTranslationDialog.bind(this),
|
|
171
|
+
manageApps: onManageAppsPressed.bind(this),
|
|
172
|
+
overviewForKeyUser: onOverviewForKeyUserPressed.bind(this),
|
|
173
|
+
overviewForDeveloper: onOverviewForDeveloperPressed.bind(this),
|
|
174
|
+
restore: this.eventHandler.bind(this, "Restore"),
|
|
175
|
+
formatSaveAsEnabled: formatSaveAsEnabled,
|
|
176
|
+
saveAs: onSaveAsPressed.bind(this)
|
|
177
|
+
}
|
|
178
|
+
}).then(function(oMenu) {
|
|
179
|
+
oMenu.addStyleClass(Utils.getRtaStyleClassName());
|
|
180
|
+
this.addDependent(oMenu);
|
|
181
|
+
oMenu.openBy(oButton, true, Popup.Dock.CenterTop, Popup.Dock.CenterBottom);
|
|
182
|
+
this._oActionsMenuFragment = oMenu;
|
|
183
|
+
}.bind(this));
|
|
184
|
+
}
|
|
185
|
+
this._oActionsMenuFragment.openBy(oButton, true, Popup.Dock.CenterTop, Popup.Dock.CenterBottom);
|
|
186
|
+
return Promise.resolve();
|
|
133
187
|
};
|
|
134
188
|
|
|
135
189
|
Adaptation.prototype._showButtonIcon = function(sButtonName, sIcon, sToolTipKey) {
|
|
@@ -149,7 +203,6 @@ sap.ui.define([
|
|
|
149
203
|
this._showButtonIcon("adaptationSwitcherButton", "sap-icon://wrench", "BTN_ADAPTATION");
|
|
150
204
|
this._showButtonIcon("navigationSwitcherButton", "sap-icon://explorer", "BTN_NAVIGATION");
|
|
151
205
|
this._showButtonIcon("visualizationSwitcherButton", "sap-icon://show", "BTN_VISUALIZATION");
|
|
152
|
-
this._showButtonIcon("exit", "sap-icon://decline", "BTN_EXIT");
|
|
153
206
|
};
|
|
154
207
|
|
|
155
208
|
Adaptation.prototype._switchToTexts = function () {
|
|
@@ -161,7 +214,6 @@ sap.ui.define([
|
|
|
161
214
|
this._showButtonText("adaptationSwitcherButton", "BTN_ADAPTATION");
|
|
162
215
|
this._showButtonText("navigationSwitcherButton", "BTN_NAVIGATION");
|
|
163
216
|
this._showButtonText("visualizationSwitcherButton", "BTN_VISUALIZATION");
|
|
164
|
-
this._showButtonText("exit", "BTN_EXIT");
|
|
165
217
|
};
|
|
166
218
|
|
|
167
219
|
Adaptation.prototype._onSizeChanged = function(mParams, bInitial) {
|
|
@@ -201,22 +253,17 @@ sap.ui.define([
|
|
|
201
253
|
formatDiscardDraftVisible: this.formatDiscardDraftVisible.bind(this),
|
|
202
254
|
formatPublishVersionVisibility: this.formatPublishVersionVisibility.bind(this),
|
|
203
255
|
modeChange: this.eventHandler.bind(this, "ModeChange"),
|
|
204
|
-
openDownloadTranslationDialog: onOpenDownloadTranslationDialog.bind(this),
|
|
205
|
-
openUploadTranslationDialog: onOpenUploadTranslationDialog.bind(this),
|
|
206
256
|
undo: this.eventHandler.bind(this, "Undo"),
|
|
207
257
|
redo: this.eventHandler.bind(this, "Redo"),
|
|
208
258
|
openChangeCategorySelectionPopover: this.eventHandler.bind(this, "OpenChangeCategorySelectionPopover"),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
saveAs: onSaveAsPressed.bind(this),
|
|
212
|
-
saveAsContextBasedAdaptation: onSaveAsContextBasedAdaptation.bind(this),
|
|
213
|
-
formatSaveAsEnabled: formatSaveAsEnabled,
|
|
214
|
-
restore: this.eventHandler.bind(this, "Restore"),
|
|
259
|
+
saveAsAdaptation: onSaveAsAdaptation.bind(this),
|
|
260
|
+
manageAdaptations: onManageAdaptations.bind(this),
|
|
215
261
|
publishVersion: this.eventHandler.bind(this, "PublishVersion"),
|
|
262
|
+
save: this.eventHandler.bind(this, "Save"),
|
|
216
263
|
exit: this.eventHandler.bind(this, "Exit"),
|
|
217
264
|
formatVersionButtonText: this.formatVersionButtonText.bind(this),
|
|
218
265
|
showVersionHistory: this.showVersionHistory.bind(this),
|
|
219
|
-
|
|
266
|
+
showActionsMenu: this.showActionsMenu.bind(this)
|
|
220
267
|
}
|
|
221
268
|
});
|
|
222
269
|
};
|
|
@@ -241,14 +288,20 @@ sap.ui.define([
|
|
|
241
288
|
AppVariantFeature.onSaveAs(true, true, this.getRtaInformation().flexSettings.layer, null);
|
|
242
289
|
}
|
|
243
290
|
|
|
244
|
-
function
|
|
245
|
-
this.getExtension("
|
|
291
|
+
function onSaveAsAdaptation() {
|
|
292
|
+
this.getExtension("contextBasedSaveAs", SaveAsAdaptation).openAddAdaptationDialog(this.getRtaInformation().flexSettings.layer);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function onManageAdaptations() {
|
|
296
|
+
this.getExtension("contextBasedManage", ManageAdaptations).openManageAdaptationDialog();
|
|
246
297
|
}
|
|
247
298
|
|
|
248
|
-
function
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
299
|
+
function onOverviewForKeyUserPressed() {
|
|
300
|
+
return AppVariantFeature.onGetOverview(true, this.getRtaInformation().flexSettings.layer);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function onOverviewForDeveloperPressed() {
|
|
304
|
+
return AppVariantFeature.onGetOverview(false, this.getRtaInformation().flexSettings.layer);
|
|
252
305
|
}
|
|
253
306
|
|
|
254
307
|
function onManageAppsPressed() {
|
|
@@ -256,7 +309,12 @@ sap.ui.define([
|
|
|
256
309
|
}
|
|
257
310
|
|
|
258
311
|
Adaptation.prototype.getControl = function(sName) {
|
|
259
|
-
|
|
312
|
+
var oControl = sap.ui.getCore().byId(this.getId() + "_fragment--sapUiRta_" + sName);
|
|
313
|
+
// Control is inside the ActionsMenu
|
|
314
|
+
if (!oControl && this._oActionsMenuFragment) {
|
|
315
|
+
oControl = sap.ui.getCore().byId(this._oActionsMenuFragment.getId().replace("sapUiRta_actions", "sapUiRta_") + sName);
|
|
316
|
+
}
|
|
317
|
+
return oControl;
|
|
260
318
|
};
|
|
261
319
|
|
|
262
320
|
return Adaptation;
|
|
@@ -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
|
|
|
@@ -27,7 +27,7 @@ sap.ui.define([
|
|
|
27
27
|
* @extends sap.m.HBox
|
|
28
28
|
*
|
|
29
29
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
30
|
+
* @version 1.110.0
|
|
31
31
|
*
|
|
32
32
|
* @constructor
|
|
33
33
|
* @private
|
|
@@ -203,7 +203,7 @@ sap.ui.define([
|
|
|
203
203
|
// 2) animate DomRef
|
|
204
204
|
.then(function () {
|
|
205
205
|
return this.animation
|
|
206
|
-
? Animation.waitTransition(this
|
|
206
|
+
? Animation.waitTransition(this.getDomRef(), this.addStyleClass.bind(this, "is_visible"))
|
|
207
207
|
: Promise.resolve();
|
|
208
208
|
}.bind(this))
|
|
209
209
|
// 3) focus on Toolbar
|
|
@@ -225,7 +225,7 @@ sap.ui.define([
|
|
|
225
225
|
if (bSkipTransition) {
|
|
226
226
|
this.removeStyleClass("is_visible");
|
|
227
227
|
} else {
|
|
228
|
-
oPromise = Animation.waitTransition(this
|
|
228
|
+
oPromise = Animation.waitTransition(this.getDomRef(), this.removeStyleClass.bind(this, "is_visible"));
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
return oPromise
|
|
@@ -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
|
|
|
@@ -32,7 +32,7 @@ function(
|
|
|
32
32
|
* @extends sap.ui.rta.toolbar.Adaptation
|
|
33
33
|
*
|
|
34
34
|
* @author SAP SE
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.110.0
|
|
36
36
|
*
|
|
37
37
|
* @constructor
|
|
38
38
|
* @private
|
|
@@ -65,14 +65,15 @@ function(
|
|
|
65
65
|
|
|
66
66
|
if (this._oFioriHeader.getShowLogo() && sLogoPath) {
|
|
67
67
|
// Unstable: if FLP changes ID of <img> element, logo could be not found
|
|
68
|
-
|
|
68
|
+
// $() is still needed because this._oFioriHeader does not offer a getDomRef method
|
|
69
|
+
var oLogo = this._oFioriHeader.$().find("#shell-header-icon").get(0);
|
|
69
70
|
var iWidth;
|
|
70
71
|
var iHeight;
|
|
71
72
|
|
|
72
|
-
if (
|
|
73
|
-
iWidth =
|
|
74
|
-
iHeight =
|
|
75
|
-
this._checkLogoSize(
|
|
73
|
+
if (oLogo) {
|
|
74
|
+
iWidth = oLogo.getBoundingClientRect().width;
|
|
75
|
+
iHeight = oLogo.getBoundingClientRect().height;
|
|
76
|
+
this._checkLogoSize(oLogo, iWidth, iHeight);
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
this.getControl("iconSpacer").setWidth("10%");
|
|
@@ -97,9 +98,9 @@ function(
|
|
|
97
98
|
}.bind(this));
|
|
98
99
|
};
|
|
99
100
|
|
|
100
|
-
Fiori.prototype._checkLogoSize = function(
|
|
101
|
-
var iNaturalWidth =
|
|
102
|
-
var iNaturalHeight =
|
|
101
|
+
Fiori.prototype._checkLogoSize = function(oLogo, iWidth, iHeight) {
|
|
102
|
+
var iNaturalWidth = oLogo.naturalWidth;
|
|
103
|
+
var iNaturalHeight = oLogo.naturalHeight;
|
|
103
104
|
|
|
104
105
|
if (iWidth !== iNaturalWidth || iHeight !== iNaturalHeight) {
|
|
105
106
|
Log.error([
|
|
@@ -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
|
|
|
@@ -20,7 +20,7 @@ function(
|
|
|
20
20
|
* @extends sap.ui.rta.toolbar.Adaptation
|
|
21
21
|
*
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.110.0
|
|
24
24
|
*
|
|
25
25
|
* @constructor
|
|
26
26
|
* @private
|
|
@@ -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
|
|
|
@@ -23,7 +23,7 @@ sap.ui.define([
|
|
|
23
23
|
* @extends sap.m.OverflowToolbarButton
|
|
24
24
|
*
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.110.0
|
|
27
27
|
*
|
|
28
28
|
* @constructor
|
|
29
29
|
* @private
|
|
@@ -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
|
|
|
@@ -22,7 +22,7 @@ function(
|
|
|
22
22
|
* @extends sap.ui.rta.toolbar.Base
|
|
23
23
|
*
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.110.0
|
|
26
26
|
*
|
|
27
27
|
* @constructor
|
|
28
28
|
* @private
|
|
@@ -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
|
|
|
@@ -20,7 +20,7 @@ function(
|
|
|
20
20
|
* @extends sap.ui.rta.toolbar.Adaptation
|
|
21
21
|
*
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.110.0
|
|
24
24
|
*
|
|
25
25
|
* @constructor
|
|
26
26
|
* @private
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Provides control sap.ui.rta.toolbar.contextBased.ManageAdaptationsDialog
|
|
8
|
+
sap.ui.define([
|
|
9
|
+
"sap/base/Log",
|
|
10
|
+
"sap/base/util/restricted/_isEqual",
|
|
11
|
+
"sap/ui/base/ManagedObject",
|
|
12
|
+
"sap/ui/core/Fragment",
|
|
13
|
+
"sap/ui/fl/write/api/ContextBasedAdaptationsAPI",
|
|
14
|
+
"sap/m/ColumnListItem",
|
|
15
|
+
"sap/ui/rta/Utils"
|
|
16
|
+
],
|
|
17
|
+
function(
|
|
18
|
+
Log,
|
|
19
|
+
_isEqual,
|
|
20
|
+
ManagedObject,
|
|
21
|
+
Fragment,
|
|
22
|
+
ContextBasedAdaptationsAPI,
|
|
23
|
+
ColumnListItem,
|
|
24
|
+
Utils
|
|
25
|
+
) {
|
|
26
|
+
"use strict";
|
|
27
|
+
|
|
28
|
+
var oRanking = {
|
|
29
|
+
Initial: 0,
|
|
30
|
+
Default: 1024,
|
|
31
|
+
Before: function(iRank) {
|
|
32
|
+
return iRank + 1024;
|
|
33
|
+
},
|
|
34
|
+
Between: function(iRank1, iRank2) {
|
|
35
|
+
return (iRank1 + iRank2) / 2;
|
|
36
|
+
},
|
|
37
|
+
After: function(iRank) {
|
|
38
|
+
return iRank + 0.5;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var ManageAdaptations = ManagedObject.extend("sap.ui.rta.toolbar.contextBased.ManageAdaptations", {
|
|
43
|
+
metadata: {
|
|
44
|
+
properties: {
|
|
45
|
+
toolbar: {
|
|
46
|
+
type: "any" // "sap.ui.rta.toolbar.Base"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
constructor: function() {
|
|
51
|
+
ManagedObject.prototype.constructor.apply(this, arguments);
|
|
52
|
+
this.oTextResources = this.getToolbar().getTextResources();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
ManageAdaptations.prototype.openManageAdaptationDialog = function() {
|
|
57
|
+
if (!this._oManageAdaptationDialogPromise) {
|
|
58
|
+
this._oManageAdaptationDialogPromise = Fragment.load({
|
|
59
|
+
name: "sap.ui.rta.toolbar.contextBased.ManageAdaptationsDialog",
|
|
60
|
+
id: this.getToolbar().getId() + "_fragment--sapUiRta_manageAdaptationDialog",
|
|
61
|
+
controller: {
|
|
62
|
+
formatContextColumnCell: formatContextColumnCell.bind(this),
|
|
63
|
+
formatContextColumnTooltip: formatContextColumnTooltip.bind(this),
|
|
64
|
+
moveUp: moveUp.bind(this),
|
|
65
|
+
moveDown: moveDown.bind(this),
|
|
66
|
+
onDropSelectedAdaptation: onDropSelectedAdaptation.bind(this),
|
|
67
|
+
onSaveReorderedAdaptations: onSaveReorderedAdaptations.bind(this),
|
|
68
|
+
onClose: onCloseDialog.bind(this)
|
|
69
|
+
}
|
|
70
|
+
}).then(function(oDialog) {
|
|
71
|
+
this._oManageAdaptationDialog = oDialog;
|
|
72
|
+
oDialog.addStyleClass(Utils.getRtaStyleClassName());
|
|
73
|
+
this.getToolbar().addDependent(this._oManageAdaptationDialog);
|
|
74
|
+
// TODO: discuss how to set width, height etc. when we finish implementing this dialog
|
|
75
|
+
oDialog.setContentWidth("650px");
|
|
76
|
+
oDialog.setContentHeight("450px");
|
|
77
|
+
oDialog.setHorizontalScrolling(false);
|
|
78
|
+
}.bind(this));
|
|
79
|
+
} else {
|
|
80
|
+
setEnabledPropertyOfMoveButton.call(this, false);
|
|
81
|
+
enableSaveButton.call(this, false);
|
|
82
|
+
}
|
|
83
|
+
return this._oManageAdaptationDialogPromise.then(function() {
|
|
84
|
+
var oRtaInformation = this.getToolbar().getRtaInformation();
|
|
85
|
+
return ContextBasedAdaptationsAPI.load({control: oRtaInformation.rootControl, layer: oRtaInformation.flexSettings.layer});
|
|
86
|
+
}.bind(this)).then(function(oAdaptationsModel) {
|
|
87
|
+
this.oAdaptationsModel = oAdaptationsModel;
|
|
88
|
+
this.oReferenceAdaptationsData = JSON.parse(JSON.stringify(oAdaptationsModel.getData()));
|
|
89
|
+
this._oManageAdaptationDialog.setModel(this.oAdaptationsModel, "contextBased");
|
|
90
|
+
initializeRanks(this.oAdaptationsModel);
|
|
91
|
+
getAdaptationsTable.call(this).attachSelectionChange(onSelectionChange.bind(this));
|
|
92
|
+
return this._oManageAdaptationDialog.open();
|
|
93
|
+
}.bind(this)
|
|
94
|
+
).catch(function(oError) {
|
|
95
|
+
Log.error(oError.stack);
|
|
96
|
+
var sMessage = "MSG_LREP_TRANSFER_ERROR";
|
|
97
|
+
var oOptions = { titleKey: "BTN_MANAGE_APP_CTX" };
|
|
98
|
+
oOptions.details = oError.userMessage;
|
|
99
|
+
Utils.showMessageBox("error", sMessage, oOptions);
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// ------ formatting ------
|
|
104
|
+
function formatContextColumnCell(aRoles) {
|
|
105
|
+
return aRoles.length + " " + (aRoles.length > 1 ?
|
|
106
|
+
this.oTextResources.getText("TXT_TABLE_CONTEXT_CELL_ROLES") : this.oTextResources.getText("TXT_TABLE_CONTEXT_CELL_ROLE"));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function formatContextColumnTooltip(aRoles) {
|
|
110
|
+
return aRoles.join("\n");
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function onSelectionChange(oEvent) {
|
|
114
|
+
if (oEvent.getParameter("selected") === true) {
|
|
115
|
+
setEnabledPropertyOfMoveButton.call(this, true);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function setEnabledPropertyOfMoveButton(bIsEnabled) {
|
|
120
|
+
var oUpButton = getControlInDialog.call(this, "moveUpButton");
|
|
121
|
+
var oDownButton = getControlInDialog.call(this, "moveDownButton");
|
|
122
|
+
oUpButton.setEnabled(bIsEnabled);
|
|
123
|
+
oDownButton.setEnabled(bIsEnabled);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ------ drag & drop of priority ------
|
|
127
|
+
function moveUp(oEvent) {
|
|
128
|
+
moveSelectedItem.call(this, "Up");
|
|
129
|
+
oEvent.getSource().focus();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function moveDown(oEvent) {
|
|
133
|
+
moveSelectedItem.call(this, "Down");
|
|
134
|
+
oEvent.getSource().focus();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function compareRanks(oContextA, oContextB) {
|
|
138
|
+
return oContextA.rank - oContextB.rank;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function sortByRank(oModel) {
|
|
142
|
+
var aContexts = oModel.getProperty("/adaptations") || [];
|
|
143
|
+
aContexts.sort(compareRanks);
|
|
144
|
+
oModel.setProperty("/adaptations", aContexts);
|
|
145
|
+
oModel.refresh(true);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function initializeRanks(oModel) {
|
|
149
|
+
var aContexts = oModel.getProperty("/adaptations") || [];
|
|
150
|
+
aContexts.forEach(function(oContext, iIndex) {
|
|
151
|
+
oContext.rank = iIndex + 1;
|
|
152
|
+
});
|
|
153
|
+
oModel.setProperty("/adaptations", aContexts);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function moveSelectedItem(sDirection) {
|
|
157
|
+
var oTable = getAdaptationsTable.call(this);
|
|
158
|
+
var oSelectedItem = oTable.getSelectedItem(0);
|
|
159
|
+
var oSelectedItemContext = oSelectedItem.getBindingContext("contextBased");
|
|
160
|
+
|
|
161
|
+
var iSiblingItemIndex = oTable.indexOfItem(oSelectedItem) + (sDirection === "Up" ? -1 : 1);
|
|
162
|
+
var oSiblingItem = oTable.getItems()[iSiblingItemIndex];
|
|
163
|
+
var oSiblingItemContext = oSiblingItem ? oSiblingItem.getBindingContext("contextBased") : undefined;
|
|
164
|
+
if (!oSiblingItemContext) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// swap the selected and the siblings rank
|
|
169
|
+
var iSiblingItemRank = oSiblingItemContext.getProperty("rank");
|
|
170
|
+
var iSelectedItemRank = oSelectedItemContext.getProperty("rank");
|
|
171
|
+
|
|
172
|
+
this.oAdaptationsModel.setProperty("rank", iSiblingItemRank, oSelectedItemContext);
|
|
173
|
+
this.oAdaptationsModel.setProperty("rank", iSelectedItemRank, oSiblingItemContext);
|
|
174
|
+
|
|
175
|
+
sortByRank(this.oAdaptationsModel);
|
|
176
|
+
// after move select the sibling
|
|
177
|
+
oTable.getItems()[iSiblingItemIndex].setSelected(true).focus();
|
|
178
|
+
enableSaveButton.call(this, true);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function onDropSelectedAdaptation(oEvent) {
|
|
182
|
+
var oDraggedItem = oEvent.getParameter("draggedControl");
|
|
183
|
+
var oDraggedItemContext = oDraggedItem.getBindingContext("contextBased");
|
|
184
|
+
if (!oDraggedItemContext) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
var iNewRank = oRanking.Default;
|
|
189
|
+
var oDroppedItem = oEvent.getParameter("droppedControl");
|
|
190
|
+
|
|
191
|
+
if (oDroppedItem instanceof ColumnListItem) {
|
|
192
|
+
// get the dropped row data
|
|
193
|
+
var sDropPosition = oEvent.getParameter("dropPosition");
|
|
194
|
+
var oDroppedItemContext = oDroppedItem.getBindingContext("contextBased");
|
|
195
|
+
var iDroppedItemRank = oDroppedItemContext.getProperty("rank");
|
|
196
|
+
var oDroppedTable = oDroppedItem.getParent();
|
|
197
|
+
var iDroppedItemIndex = oDroppedTable.indexOfItem(oDroppedItem);
|
|
198
|
+
if (oDroppedItemContext === oDraggedItemContext) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
// find the new index of the dragged row depending on the drop position
|
|
202
|
+
var iNewItemIndex = iDroppedItemIndex + (sDropPosition === "After" ? 1 : -1);
|
|
203
|
+
var oNewItem = oDroppedTable.getItems()[iNewItemIndex];
|
|
204
|
+
if (!oNewItem || iNewItemIndex === -1) {
|
|
205
|
+
// dropped before the first row or after the last row
|
|
206
|
+
iNewRank = iNewItemIndex === -1 ? 0.5 : oRanking[sDropPosition](iDroppedItemRank);
|
|
207
|
+
} else {
|
|
208
|
+
// dropped between first and the last row
|
|
209
|
+
var oNewItemContext = oNewItem.getBindingContext("contextBased");
|
|
210
|
+
iNewRank = oRanking.Between(iDroppedItemRank, oNewItemContext.getProperty("rank"));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// set the rank property and update the model to refresh the bindings
|
|
214
|
+
this.oAdaptationsModel.setProperty("rank", iNewRank, oDraggedItemContext);
|
|
215
|
+
sortByRank(this.oAdaptationsModel);
|
|
216
|
+
initializeRanks(this.oAdaptationsModel);
|
|
217
|
+
enableSaveButton.call(this, true);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function didAdaptationsPriorityChange() {
|
|
221
|
+
return !_isEqual(
|
|
222
|
+
this.oAdaptationsModel.getProperty("/adaptations").map(function(oAdapation) { return oAdapation.id; }),
|
|
223
|
+
this.oReferenceAdaptationsData.adaptations.map(function(oAdapation) { return oAdapation.id; })
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function enableSaveButton(bEnabled) {
|
|
228
|
+
var oSaveButton = getControlInDialog.call(this, "manageAdaptations-saveButton");
|
|
229
|
+
oSaveButton.setTooltip(bEnabled ? "" : this.oTextResources.getText("TOOLTIP_APP_CTX_DIALOG_SAVE"));
|
|
230
|
+
oSaveButton.setEnabled(bEnabled);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function getAdaptationsTable() {
|
|
234
|
+
return getControlInDialog.call(this, "manageAdaptationsTable");
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function getControlInDialog(sId) {
|
|
238
|
+
return this.getToolbar().getControl("manageAdaptationDialog--" + sId);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function onSaveReorderedAdaptations() {
|
|
242
|
+
if (didAdaptationsPriorityChange.call(this)) {
|
|
243
|
+
var oRtaInformation = this.getToolbar().getRtaInformation();
|
|
244
|
+
var aAdaptationPriorities = this.oAdaptationsModel.getProperty("/adaptations").map(function(oAdaptation) { return oAdaptation.id; });
|
|
245
|
+
ContextBasedAdaptationsAPI.reorder({control: oRtaInformation.rootControl, layer: oRtaInformation.flexSettings.layer, parameters: {priorities: aAdaptationPriorities}})
|
|
246
|
+
.catch(function(oError) {
|
|
247
|
+
Log.error(oError.stack);
|
|
248
|
+
var sMessage = "MSG_LREP_TRANSFER_ERROR";
|
|
249
|
+
var oOptions = { titleKey: "BTN_MANAGE_APP_CTX" };
|
|
250
|
+
oOptions.details = oError.userMessage;
|
|
251
|
+
Utils.showMessageBox("error", sMessage, oOptions);
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
onCloseDialog.call(this);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function onCloseDialog() {
|
|
258
|
+
this._oManageAdaptationDialog.getModel("contextBased").setData(null);
|
|
259
|
+
this._oManageAdaptationDialog.close();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return ManageAdaptations;
|
|
263
|
+
});
|