@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
|
@@ -0,0 +1,340 @@
|
|
|
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
|
+
"sap/ui/model/Filter",
|
|
17
|
+
"sap/ui/model/FilterOperator",
|
|
18
|
+
"sap/ui/model/json/JSONModel"
|
|
19
|
+
],
|
|
20
|
+
function(
|
|
21
|
+
Log,
|
|
22
|
+
_isEqual,
|
|
23
|
+
ManagedObject,
|
|
24
|
+
Fragment,
|
|
25
|
+
ContextBasedAdaptationsAPI,
|
|
26
|
+
ColumnListItem,
|
|
27
|
+
Utils,
|
|
28
|
+
Filter,
|
|
29
|
+
FilterOperator,
|
|
30
|
+
JSONModel
|
|
31
|
+
) {
|
|
32
|
+
"use strict";
|
|
33
|
+
|
|
34
|
+
var oRanking = {
|
|
35
|
+
Initial: 0,
|
|
36
|
+
Default: 1024,
|
|
37
|
+
Before: function(iRank) {
|
|
38
|
+
return iRank + 1024;
|
|
39
|
+
},
|
|
40
|
+
Between: function(iRank1, iRank2) {
|
|
41
|
+
return (iRank1 + iRank2) / 2;
|
|
42
|
+
},
|
|
43
|
+
After: function(iRank) {
|
|
44
|
+
return iRank + 0.5;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var ManageAdaptations = ManagedObject.extend("sap.ui.rta.toolbar.contextBased.ManageAdaptations", {
|
|
49
|
+
metadata: {
|
|
50
|
+
properties: {
|
|
51
|
+
toolbar: {
|
|
52
|
+
type: "any" // "sap.ui.rta.toolbar.Base"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
constructor: function() {
|
|
57
|
+
ManagedObject.prototype.constructor.apply(this, arguments);
|
|
58
|
+
this.oTextResources = this.getToolbar().getTextResources();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
ManageAdaptations.prototype.openManageAdaptationDialog = function() {
|
|
63
|
+
if (!this._oManageAdaptationDialogPromise) {
|
|
64
|
+
this._oManageAdaptationDialogPromise = Fragment.load({
|
|
65
|
+
name: "sap.ui.rta.toolbar.contextBased.ManageAdaptationsDialog",
|
|
66
|
+
id: this.getToolbar().getId() + "_fragment--sapUiRta_manageAdaptationDialog",
|
|
67
|
+
controller: {
|
|
68
|
+
formatContextColumnCell: formatContextColumnCell.bind(this),
|
|
69
|
+
formatContextColumnTooltip: formatContextColumnTooltip.bind(this),
|
|
70
|
+
onLiveSearch: onLiveSearch.bind(this),
|
|
71
|
+
moveUp: moveUp.bind(this),
|
|
72
|
+
moveDown: moveDown.bind(this),
|
|
73
|
+
onDropSelectedAdaptation: onDropSelectedAdaptation.bind(this),
|
|
74
|
+
onSaveReorderedAdaptations: onSaveReorderedAdaptations.bind(this),
|
|
75
|
+
onClose: onCloseDialog.bind(this)
|
|
76
|
+
}
|
|
77
|
+
}).then(function(oDialog) {
|
|
78
|
+
this._oManageAdaptationDialog = oDialog;
|
|
79
|
+
oDialog.addStyleClass(Utils.getRtaStyleClassName());
|
|
80
|
+
this.getToolbar().addDependent(this._oManageAdaptationDialog);
|
|
81
|
+
// TODO: discuss how to set width, height etc. when we finish implementing this dialog
|
|
82
|
+
oDialog.setContentWidth("650px");
|
|
83
|
+
oDialog.setContentHeight("450px");
|
|
84
|
+
oDialog.setHorizontalScrolling(false);
|
|
85
|
+
}.bind(this));
|
|
86
|
+
} else {
|
|
87
|
+
setEnabledPropertyOfMoveButton.call(this, false);
|
|
88
|
+
enableDragAndDropForAdaptationTable.call(this, true);
|
|
89
|
+
enableSaveButton.call(this, false);
|
|
90
|
+
}
|
|
91
|
+
return this._oManageAdaptationDialogPromise.then(function() {
|
|
92
|
+
var oRtaInformation = this.getToolbar().getRtaInformation();
|
|
93
|
+
return ContextBasedAdaptationsAPI.load({control: oRtaInformation.rootControl, layer: oRtaInformation.flexSettings.layer});
|
|
94
|
+
}.bind(this)).then(function(oAdaptationsModel) {
|
|
95
|
+
this.oAdaptationsModel = oAdaptationsModel;
|
|
96
|
+
this.oReferenceAdaptationsData = JSON.parse(JSON.stringify(oAdaptationsModel.getData()));
|
|
97
|
+
this._oControlConfigurationModel = new JSONModel({isTableItemSelected: false});
|
|
98
|
+
this._oManageAdaptationDialog.setModel(this.oAdaptationsModel, "contextBased");
|
|
99
|
+
this._oManageAdaptationDialog.setModel(this._oControlConfigurationModel, "controlConfiguration");
|
|
100
|
+
initializeRanks(this.oAdaptationsModel);
|
|
101
|
+
getAdaptationsTable.call(this).attachSelectionChange(onSelectionChange.bind(this));
|
|
102
|
+
return this._oManageAdaptationDialog.open();
|
|
103
|
+
}.bind(this)
|
|
104
|
+
).catch(function(oError) {
|
|
105
|
+
Log.error(oError.stack);
|
|
106
|
+
var sMessage = "MSG_LREP_TRANSFER_ERROR";
|
|
107
|
+
var oOptions = { titleKey: "BTN_MANAGE_APP_CTX" };
|
|
108
|
+
oOptions.details = oError.userMessage;
|
|
109
|
+
Utils.showMessageBox("error", sMessage, oOptions);
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// ------ formatting ------
|
|
114
|
+
function formatContextColumnCell(aRoles) {
|
|
115
|
+
return aRoles.length + " " + (aRoles.length > 1 ?
|
|
116
|
+
this.oTextResources.getText("TXT_TABLE_CONTEXT_CELL_ROLES") : this.oTextResources.getText("TXT_TABLE_CONTEXT_CELL_ROLE"));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function formatContextColumnTooltip(aRoles) {
|
|
120
|
+
return aRoles.join("\n");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function onSelectionChange(oEvent) {
|
|
124
|
+
if (oEvent.getParameter("selected") === true) {
|
|
125
|
+
this._oControlConfigurationModel.setProperty("/isTableItemSelected", true);
|
|
126
|
+
if (isSearchFieldValueEmpty.call(this)) {
|
|
127
|
+
setEnabledPropertyOfMoveButton.call(this, true);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function setEnabledPropertyOfMoveButton(bIsEnabled) {
|
|
133
|
+
var oUpButton = getControlInDialog.call(this, "moveUpButton");
|
|
134
|
+
var oDownButton = getControlInDialog.call(this, "moveDownButton");
|
|
135
|
+
oUpButton.setEnabled(bIsEnabled);
|
|
136
|
+
oDownButton.setEnabled(bIsEnabled);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// ------ search field ------
|
|
140
|
+
function onLiveSearch(oEvent) {
|
|
141
|
+
var oFilters;
|
|
142
|
+
var sQuery = oEvent.getSource().getValue();
|
|
143
|
+
var oAdaptationsTable = getAdaptationsTable.call(this);
|
|
144
|
+
var oDefaultApplicationTable = getDefaultApplicationTable.call(this);
|
|
145
|
+
var sDefaultTableText = getDefaultApplicationTitle.call(this);
|
|
146
|
+
if (sQuery && sQuery.length > 0) {
|
|
147
|
+
setEnabledPropertyOfMoveButton.call(this, false);
|
|
148
|
+
enableDragAndDropForAdaptationTable.call(this, false);
|
|
149
|
+
//filter Table context
|
|
150
|
+
var oFilterByTitle = new Filter("title", FilterOperator.Contains, sQuery);
|
|
151
|
+
var oFilterByContextId = new Filter({
|
|
152
|
+
path: "contexts/role",
|
|
153
|
+
test: function(aRoles) {
|
|
154
|
+
return aRoles.some(function(sRole) {
|
|
155
|
+
return sRole.includes(sQuery.toUpperCase());
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
var oFilterCreatedBy = new Filter("createdBy", FilterOperator.Contains, sQuery);
|
|
160
|
+
var oFilterChangedBy = new Filter("changedBy", FilterOperator.Contains, sQuery);
|
|
161
|
+
oFilters = new Filter([oFilterByTitle, oFilterByContextId, oFilterCreatedBy, oFilterChangedBy]);
|
|
162
|
+
//Filter default Table context
|
|
163
|
+
if (sDefaultTableText.toUpperCase().includes(sQuery.toUpperCase())) {
|
|
164
|
+
oDefaultApplicationTable.setVisible(true);
|
|
165
|
+
} else {
|
|
166
|
+
oDefaultApplicationTable.setVisible(false);
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
enableDragAndDropForAdaptationTable.call(this, true);
|
|
170
|
+
if (this._oControlConfigurationModel.getProperty("/isTableItemSelected")) {
|
|
171
|
+
setEnabledPropertyOfMoveButton.call(this, true);
|
|
172
|
+
}
|
|
173
|
+
oDefaultApplicationTable.setVisible(true);
|
|
174
|
+
}
|
|
175
|
+
// update list binding
|
|
176
|
+
var oBindingTableContext = oAdaptationsTable.getBinding("items");
|
|
177
|
+
oBindingTableContext.filter(oFilters, "Application");
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// ------ drag & drop of priority ------
|
|
181
|
+
function moveUp(oEvent) {
|
|
182
|
+
moveSelectedItem.call(this, "Up");
|
|
183
|
+
oEvent.getSource().focus();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function moveDown(oEvent) {
|
|
187
|
+
moveSelectedItem.call(this, "Down");
|
|
188
|
+
oEvent.getSource().focus();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function compareRanks(oContextA, oContextB) {
|
|
192
|
+
return oContextA.rank - oContextB.rank;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function sortByRank(oModel) {
|
|
196
|
+
var aContexts = oModel.getProperty("/adaptations") || [];
|
|
197
|
+
aContexts.sort(compareRanks);
|
|
198
|
+
oModel.setProperty("/adaptations", aContexts);
|
|
199
|
+
oModel.refresh(true);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function initializeRanks(oModel) {
|
|
203
|
+
var aContexts = oModel.getProperty("/adaptations") || [];
|
|
204
|
+
aContexts.forEach(function(oContext, iIndex) {
|
|
205
|
+
oContext.rank = iIndex + 1;
|
|
206
|
+
});
|
|
207
|
+
oModel.setProperty("/adaptations", aContexts);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function moveSelectedItem(sDirection) {
|
|
211
|
+
var oTable = getAdaptationsTable.call(this);
|
|
212
|
+
var oSelectedItem = oTable.getSelectedItem(0);
|
|
213
|
+
var oSelectedItemContext = oSelectedItem.getBindingContext("contextBased");
|
|
214
|
+
|
|
215
|
+
var iSiblingItemIndex = oTable.indexOfItem(oSelectedItem) + (sDirection === "Up" ? -1 : 1);
|
|
216
|
+
var oSiblingItem = oTable.getItems()[iSiblingItemIndex];
|
|
217
|
+
var oSiblingItemContext = oSiblingItem ? oSiblingItem.getBindingContext("contextBased") : undefined;
|
|
218
|
+
if (!oSiblingItemContext) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// swap the selected and the siblings rank
|
|
223
|
+
var iSiblingItemRank = oSiblingItemContext.getProperty("rank");
|
|
224
|
+
var iSelectedItemRank = oSelectedItemContext.getProperty("rank");
|
|
225
|
+
|
|
226
|
+
this.oAdaptationsModel.setProperty("rank", iSiblingItemRank, oSelectedItemContext);
|
|
227
|
+
this.oAdaptationsModel.setProperty("rank", iSelectedItemRank, oSiblingItemContext);
|
|
228
|
+
|
|
229
|
+
sortByRank(this.oAdaptationsModel);
|
|
230
|
+
// after move select the sibling
|
|
231
|
+
oTable.getItems()[iSiblingItemIndex].setSelected(true).focus();
|
|
232
|
+
enableSaveButton.call(this, true);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function onDropSelectedAdaptation(oEvent) {
|
|
236
|
+
var oDraggedItem = oEvent.getParameter("draggedControl");
|
|
237
|
+
var oDraggedItemContext = oDraggedItem.getBindingContext("contextBased");
|
|
238
|
+
if (!oDraggedItemContext) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
var iNewRank = oRanking.Default;
|
|
243
|
+
var oDroppedItem = oEvent.getParameter("droppedControl");
|
|
244
|
+
|
|
245
|
+
if (oDroppedItem instanceof ColumnListItem) {
|
|
246
|
+
// get the dropped row data
|
|
247
|
+
var sDropPosition = oEvent.getParameter("dropPosition");
|
|
248
|
+
var oDroppedItemContext = oDroppedItem.getBindingContext("contextBased");
|
|
249
|
+
var iDroppedItemRank = oDroppedItemContext.getProperty("rank");
|
|
250
|
+
var oDroppedTable = oDroppedItem.getParent();
|
|
251
|
+
var iDroppedItemIndex = oDroppedTable.indexOfItem(oDroppedItem);
|
|
252
|
+
if (oDroppedItemContext === oDraggedItemContext) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
// find the new index of the dragged row depending on the drop position
|
|
256
|
+
var iNewItemIndex = iDroppedItemIndex + (sDropPosition === "After" ? 1 : -1);
|
|
257
|
+
var oNewItem = oDroppedTable.getItems()[iNewItemIndex];
|
|
258
|
+
if (!oNewItem || iNewItemIndex === -1) {
|
|
259
|
+
// dropped before the first row or after the last row
|
|
260
|
+
iNewRank = iNewItemIndex === -1 ? 0.5 : oRanking[sDropPosition](iDroppedItemRank);
|
|
261
|
+
} else {
|
|
262
|
+
// dropped between first and the last row
|
|
263
|
+
var oNewItemContext = oNewItem.getBindingContext("contextBased");
|
|
264
|
+
iNewRank = oRanking.Between(iDroppedItemRank, oNewItemContext.getProperty("rank"));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
// set the rank property and update the model to refresh the bindings
|
|
268
|
+
this.oAdaptationsModel.setProperty("rank", iNewRank, oDraggedItemContext);
|
|
269
|
+
sortByRank(this.oAdaptationsModel);
|
|
270
|
+
initializeRanks(this.oAdaptationsModel);
|
|
271
|
+
enableSaveButton.call(this, true);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function didAdaptationsPriorityChange() {
|
|
275
|
+
return !_isEqual(
|
|
276
|
+
this.oAdaptationsModel.getProperty("/adaptations").map(function(oAdapation) { return oAdapation.id; }),
|
|
277
|
+
this.oReferenceAdaptationsData.adaptations.map(function(oAdapation) { return oAdapation.id; })
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function enableSaveButton(bEnabled) {
|
|
282
|
+
var oSaveButton = getControlInDialog.call(this, "manageAdaptations-saveButton");
|
|
283
|
+
oSaveButton.setTooltip(bEnabled ? "" : this.oTextResources.getText("TOOLTIP_APP_CTX_DIALOG_SAVE"));
|
|
284
|
+
oSaveButton.setEnabled(bEnabled);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function getAdaptationsTable() {
|
|
288
|
+
return getControlInDialog.call(this, "manageAdaptationsTable");
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function getControlInDialog(sId) {
|
|
292
|
+
return this.getToolbar().getControl("manageAdaptationDialog--" + sId);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function getDefaultApplicationTable() {
|
|
296
|
+
return getControlInDialog.call(this, "defaultContext");
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function getDefaultApplicationTitle() {
|
|
300
|
+
return getControlInDialog.call(this, "defaultApplicationTitle").getProperty("text");
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function getSearchField() {
|
|
304
|
+
return getControlInDialog.call(this, "searchField");
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function isSearchFieldValueEmpty() {
|
|
308
|
+
return getSearchField.call(this).getValue().length === 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function enableDragAndDropForAdaptationTable(bIsEnabled) {
|
|
312
|
+
getAdaptationsTable.call(this).getDragDropConfig()[0].setEnabled(bIsEnabled);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function onSaveReorderedAdaptations() {
|
|
316
|
+
if (didAdaptationsPriorityChange.call(this)) {
|
|
317
|
+
var oRtaInformation = this.getToolbar().getRtaInformation();
|
|
318
|
+
var aAdaptationPriorities = this.oAdaptationsModel.getProperty("/adaptations").map(function(oAdaptation) { return oAdaptation.id; });
|
|
319
|
+
ContextBasedAdaptationsAPI.reorder({control: oRtaInformation.rootControl, layer: oRtaInformation.flexSettings.layer, parameters: {priorities: aAdaptationPriorities}})
|
|
320
|
+
.catch(function(oError) {
|
|
321
|
+
Log.error(oError.stack);
|
|
322
|
+
var sMessage = "MSG_LREP_TRANSFER_ERROR";
|
|
323
|
+
var oOptions = { titleKey: "BTN_MANAGE_APP_CTX" };
|
|
324
|
+
oOptions.details = oError.userMessage;
|
|
325
|
+
Utils.showMessageBox("error", sMessage, oOptions);
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
onCloseDialog.call(this);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function onCloseDialog() {
|
|
332
|
+
this._oControlConfigurationModel.setProperty("/isTableItemSelected", false);
|
|
333
|
+
getSearchField.call(this).setValue("");
|
|
334
|
+
getDefaultApplicationTable.call(this).setVisible(true);
|
|
335
|
+
this._oManageAdaptationDialog.getModel("contextBased").setData(null);
|
|
336
|
+
this._oManageAdaptationDialog.close();
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
return ManageAdaptations;
|
|
340
|
+
});
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<core:FragmentDefinition
|
|
2
|
+
xmlns:core="sap.ui.core"
|
|
3
|
+
xmlns:dnd="sap.ui.core.dnd"
|
|
4
|
+
xmlns="sap.m">
|
|
5
|
+
<Dialog
|
|
6
|
+
resizable="true"
|
|
7
|
+
draggable="true"
|
|
8
|
+
title="{i18n>MANAGE_ADAPTATIONS_DIALOG_HEADER}">
|
|
9
|
+
<Table id="manageAdaptationsTable"
|
|
10
|
+
showNoData="false"
|
|
11
|
+
inset="false"
|
|
12
|
+
sticky="HeaderToolbar"
|
|
13
|
+
mode="SingleSelectMaster"
|
|
14
|
+
items="{
|
|
15
|
+
path: 'contextBased>/adaptations',
|
|
16
|
+
sorter: {path: 'rank', descending: false}
|
|
17
|
+
}">
|
|
18
|
+
<headerToolbar>
|
|
19
|
+
<OverflowToolbar>
|
|
20
|
+
<SearchField id="searchField" liveChange=".onLiveSearch" width="80%" />
|
|
21
|
+
<ToolbarSpacer/>
|
|
22
|
+
<Button id="moveUpButton"
|
|
23
|
+
icon="sap-icon://navigation-up-arrow"
|
|
24
|
+
tooltip="{i18n>BTN_TOOLTIP_MOVE_UP}"
|
|
25
|
+
press=".moveUp"
|
|
26
|
+
enabled="false"/>
|
|
27
|
+
<Button id="moveDownButton"
|
|
28
|
+
icon="sap-icon://navigation-down-arrow"
|
|
29
|
+
tooltip="{i18n>BTN_TOOLTIP_MOVE_DOWN}"
|
|
30
|
+
press=".moveDown"
|
|
31
|
+
enabled="false"/>
|
|
32
|
+
</OverflowToolbar>
|
|
33
|
+
</headerToolbar>
|
|
34
|
+
<columns>
|
|
35
|
+
<Column width="5rem"
|
|
36
|
+
minScreenWidth="tablet"
|
|
37
|
+
demandPopin="true"
|
|
38
|
+
popinDisplay="Inline"
|
|
39
|
+
hAlign="Left">
|
|
40
|
+
<Text text="{i18n>CLM_HEADER_PRIORITY}" />
|
|
41
|
+
</Column>
|
|
42
|
+
<Column minScreenWidth="tablet"
|
|
43
|
+
demandPopin="true"
|
|
44
|
+
popinDisplay="Inline"
|
|
45
|
+
hAlign="Left">
|
|
46
|
+
<Text text="{i18n>CLM_HEADER_ADAPTATIONS_TITLE}" />
|
|
47
|
+
</Column>
|
|
48
|
+
<Column width="8rem"
|
|
49
|
+
minScreenWidth="tablet"
|
|
50
|
+
demandPopin="true"
|
|
51
|
+
popinDisplay="Inline"
|
|
52
|
+
hAlign="Left">
|
|
53
|
+
<Text text="{i18n>CLM_HEADER_CONTEXT}" />
|
|
54
|
+
</Column>
|
|
55
|
+
<Column width="7rem"
|
|
56
|
+
minScreenWidth="tablet"
|
|
57
|
+
demandPopin="true"
|
|
58
|
+
popinDisplay="Inline"
|
|
59
|
+
hAlign="Left">
|
|
60
|
+
<Text text="{i18n>CLM_HEADER_ADAPTATIONS_ACTIONS}" />
|
|
61
|
+
</Column>
|
|
62
|
+
</columns>
|
|
63
|
+
<dragDropConfig>
|
|
64
|
+
<dnd:DragDropInfo sourceAggregation="items"
|
|
65
|
+
targetAggregation="items"
|
|
66
|
+
dropPosition="Between"
|
|
67
|
+
drop=".onDropSelectedAdaptation"/>
|
|
68
|
+
</dragDropConfig>
|
|
69
|
+
<items>
|
|
70
|
+
<ColumnListItem>
|
|
71
|
+
<cells>
|
|
72
|
+
<Text text="{contextBased>rank}"/>
|
|
73
|
+
<CustomListItem>
|
|
74
|
+
<HBox>
|
|
75
|
+
<VBox class="sapUiSmallMarginTopBottom">
|
|
76
|
+
<Text wrapping="false" maxLines="1" text="{contextBased>title}"
|
|
77
|
+
tooltip="{contextBased>title}"/>
|
|
78
|
+
</VBox>
|
|
79
|
+
</HBox>
|
|
80
|
+
</CustomListItem>
|
|
81
|
+
<Text text="{ parts: ['contextBased>contexts/role'], formatter: '.formatContextColumnCell'}"
|
|
82
|
+
tooltip="{ parts: ['contextBased>contexts/role'], formatter: '.formatContextColumnTooltip'}" />
|
|
83
|
+
<MenuButton text="{i18n>CLM_HEADER_ADAPTATIONS_ACTIONS}">
|
|
84
|
+
<menu>
|
|
85
|
+
<Menu itemSelected="onMenuAction">
|
|
86
|
+
</Menu>
|
|
87
|
+
</menu>
|
|
88
|
+
</MenuButton>
|
|
89
|
+
</cells>
|
|
90
|
+
</ColumnListItem>
|
|
91
|
+
</items>
|
|
92
|
+
</Table>
|
|
93
|
+
<Table id="defaultContext">
|
|
94
|
+
<columns>
|
|
95
|
+
<Column width="4.195rem"
|
|
96
|
+
minScreenWidth="tablet"
|
|
97
|
+
demandPopin="true"
|
|
98
|
+
popinDisplay="Inline"
|
|
99
|
+
hAlign="Left">
|
|
100
|
+
</Column>
|
|
101
|
+
<Column minScreenWidth="tablet"
|
|
102
|
+
demandPopin="true"
|
|
103
|
+
popinDisplay="Inline"
|
|
104
|
+
hAlign="Left">
|
|
105
|
+
</Column>
|
|
106
|
+
<Column width="8rem"
|
|
107
|
+
minScreenWidth="tablet"
|
|
108
|
+
demandPopin="true"
|
|
109
|
+
popinDisplay="Inline"
|
|
110
|
+
hAlign="Left">
|
|
111
|
+
</Column>
|
|
112
|
+
<Column width="7rem"
|
|
113
|
+
minScreenWidth="tablet"
|
|
114
|
+
demandPopin="true"
|
|
115
|
+
popinDisplay="Inline"
|
|
116
|
+
hAlign="Left">
|
|
117
|
+
</Column>
|
|
118
|
+
</columns>
|
|
119
|
+
<items>
|
|
120
|
+
<ColumnListItem highlight="Information">
|
|
121
|
+
<cells>
|
|
122
|
+
<Text text=""/>
|
|
123
|
+
<CustomListItem>
|
|
124
|
+
<HBox>
|
|
125
|
+
<VBox class="sapUiSmallMarginTopBottom">
|
|
126
|
+
<Text id="defaultApplicationTitle" text="{i18n>TXT_DEFAULT_APP}"/>
|
|
127
|
+
<FormattedText htmlText=""/>
|
|
128
|
+
</VBox>
|
|
129
|
+
</HBox>
|
|
130
|
+
</CustomListItem>
|
|
131
|
+
<Text text="" />
|
|
132
|
+
<MenuButton text="{i18n>CLM_HEADER_ADAPTATIONS_ACTIONS}">
|
|
133
|
+
</MenuButton>
|
|
134
|
+
</cells>
|
|
135
|
+
</ColumnListItem>
|
|
136
|
+
</items>
|
|
137
|
+
</Table>
|
|
138
|
+
<beginButton>
|
|
139
|
+
<Button id="manageAdaptations-saveButton"
|
|
140
|
+
enabled="false"
|
|
141
|
+
type="Emphasized"
|
|
142
|
+
text="{i18n>APP_CTX_DIALOG_SAVE}"
|
|
143
|
+
tooltip="{i18n>TOOLTIP_APP_CTX_DIALOG_SAVE}"
|
|
144
|
+
press=".onSaveReorderedAdaptations"/>
|
|
145
|
+
</beginButton>
|
|
146
|
+
<endButton>
|
|
147
|
+
<Button id="manageAdaptations-closeButton"
|
|
148
|
+
text="{i18n>APP_CTX_DIALOG_CANCEL}"
|
|
149
|
+
press=".onClose"/>
|
|
150
|
+
</endButton>
|
|
151
|
+
</Dialog>
|
|
152
|
+
</core:FragmentDefinition>
|