@openui5/sap.ui.rta 1.114.0 → 1.114.1
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/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 +68 -42
- package/src/sap/ui/rta/Utils.js +35 -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 +4 -2
- 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 +4 -2
- 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 +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
- package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +19 -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 +6 -2
- package/src/sap/ui/rta/plugin/ControlVariant.js +4 -2
- package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
- package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
- package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
- package/src/sap/ui/rta/plugin/EasyAdd.js +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 +1 -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 +10 -3
- 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 +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
- 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 +78 -11
- 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/ManageAdaptations.js +61 -24
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +2 -8
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +4 -4
- 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 +1 -1
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- package/src/sap/ui/rta/util/ReloadManager.js +30 -22
- 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/ChangeIndicatorRegistry.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +1 -1
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"./AdaptationRenderer",
|
|
9
9
|
"sap/base/Log",
|
|
10
|
-
"sap/m/MessageBox",
|
|
11
10
|
"sap/ui/core/BusyIndicator",
|
|
12
11
|
"sap/ui/core/Fragment",
|
|
13
12
|
"sap/ui/core/Popup",
|
|
@@ -15,18 +14,17 @@ sap.ui.define([
|
|
|
15
14
|
"sap/ui/fl/write/api/ContextBasedAdaptationsAPI",
|
|
16
15
|
"sap/ui/fl/write/api/Version",
|
|
17
16
|
"sap/ui/model/json/JSONModel",
|
|
18
|
-
"sap/ui/model/resource/ResourceModel",
|
|
19
17
|
"sap/ui/rta/appVariant/Feature",
|
|
20
18
|
"sap/ui/rta/toolbar/Base",
|
|
21
19
|
"sap/ui/rta/toolbar/contextBased/ManageAdaptations",
|
|
22
20
|
"sap/ui/rta/toolbar/contextBased/SaveAsAdaptation",
|
|
23
21
|
"sap/ui/rta/toolbar/translation/Translation",
|
|
24
22
|
"sap/ui/rta/toolbar/versioning/Versioning",
|
|
25
|
-
"sap/ui/rta/Utils"
|
|
23
|
+
"sap/ui/rta/Utils",
|
|
24
|
+
"sap/m/MessageBox"
|
|
26
25
|
], function(
|
|
27
26
|
AdaptationRenderer,
|
|
28
27
|
Log,
|
|
29
|
-
MessageBox,
|
|
30
28
|
BusyIndicator,
|
|
31
29
|
Fragment,
|
|
32
30
|
Popup,
|
|
@@ -34,14 +32,14 @@ sap.ui.define([
|
|
|
34
32
|
ContextBasedAdaptationsAPI,
|
|
35
33
|
Version,
|
|
36
34
|
JSONModel,
|
|
37
|
-
ResourceModel,
|
|
38
35
|
AppVariantFeature,
|
|
39
36
|
Base,
|
|
40
37
|
ManageAdaptations,
|
|
41
38
|
SaveAsAdaptation,
|
|
42
39
|
Translation,
|
|
43
40
|
Versioning,
|
|
44
|
-
Utils
|
|
41
|
+
Utils,
|
|
42
|
+
MessageBox
|
|
45
43
|
) {
|
|
46
44
|
"use strict";
|
|
47
45
|
|
|
@@ -53,7 +51,7 @@ sap.ui.define([
|
|
|
53
51
|
* @extends sap.ui.rta.toolbar.Base
|
|
54
52
|
*
|
|
55
53
|
* @author SAP SE
|
|
56
|
-
* @version 1.114.
|
|
54
|
+
* @version 1.114.1
|
|
57
55
|
*
|
|
58
56
|
* @constructor
|
|
59
57
|
* @private
|
|
@@ -351,16 +349,85 @@ sap.ui.define([
|
|
|
351
349
|
AppVariantFeature.onSaveAs(true, true, this.getRtaInformation().flexSettings.layer, null);
|
|
352
350
|
}
|
|
353
351
|
|
|
352
|
+
function confirmMigration(oRtaInformation) {
|
|
353
|
+
var bDirty = oRtaInformation.commandStack.canSave();
|
|
354
|
+
|
|
355
|
+
Utils.showMessageBox("confirm", (bDirty) ? "DAC_DIALOG_MIGRATION_DIRTY_DESCRIPTION" : "DAC_DIALOG_MIGRATION_DESCRIPTION", {
|
|
356
|
+
titleKey: "DAC_DIALOG_MIGRATION_HEADER",
|
|
357
|
+
actionKeys: ["DAC_DIALOG_MIGRATION_HEADER"],
|
|
358
|
+
showCancel: true
|
|
359
|
+
})
|
|
360
|
+
.then(function(sAction) {
|
|
361
|
+
if (sAction !== MessageBox.Action.CANCEL) {
|
|
362
|
+
BusyIndicator.show();
|
|
363
|
+
|
|
364
|
+
if (bDirty) {
|
|
365
|
+
oRtaInformation.commandStack.removeAllCommands(true);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
ContextBasedAdaptationsAPI.migrate({
|
|
369
|
+
control: oRtaInformation.rootControl,
|
|
370
|
+
layer: oRtaInformation.flexSettings.layer
|
|
371
|
+
})
|
|
372
|
+
.finally(function() {
|
|
373
|
+
BusyIndicator.hide();
|
|
374
|
+
})
|
|
375
|
+
.then(Utils.showMessageBox.bind(undefined, "information", "DAC_DIALOG_MIGRATION_SUCCESSFULL_DESCRIPTION", {
|
|
376
|
+
titleKey: "DAC_DIALOG_MIGRATION_HEADER"
|
|
377
|
+
}))
|
|
378
|
+
.then(function() {
|
|
379
|
+
return new Promise(function(resolve) {
|
|
380
|
+
this.fireEvent("switchAdaptation", {adaptationId: "DEFAULT", callback: resolve});
|
|
381
|
+
}.bind(this));
|
|
382
|
+
}.bind(this))
|
|
383
|
+
.catch(function(oError) {
|
|
384
|
+
Log.error(oError.stack || oError);
|
|
385
|
+
var sMessage = "DAC_DIALOG_MIGRATION_ERROR_DESCRIPTION";
|
|
386
|
+
var oOptions = {
|
|
387
|
+
titleKey: "DAC_DIALOG_MIGRATION_HEADER",
|
|
388
|
+
details: oError.userMessage || oError
|
|
389
|
+
};
|
|
390
|
+
Utils.showMessageBox("error", sMessage, oOptions);
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
}.bind(this));
|
|
394
|
+
}
|
|
395
|
+
|
|
354
396
|
function onSaveAsAdaptation() {
|
|
355
|
-
|
|
397
|
+
var oRtaInformation = this.getRtaInformation();
|
|
398
|
+
Utils.checkDraftOverwrite(this.getModel("versions")).then(function() {
|
|
399
|
+
return ContextBasedAdaptationsAPI.canMigrate({ control: oRtaInformation.rootControl, layer: oRtaInformation.flexSettings.layer });
|
|
400
|
+
}).then(function(bCanMigrate) {
|
|
401
|
+
if (bCanMigrate) {
|
|
402
|
+
confirmMigration.call(this, oRtaInformation);
|
|
403
|
+
} else {
|
|
404
|
+
this.getExtension("contextBasedSaveAs", SaveAsAdaptation).openAddAdaptationDialog(oRtaInformation.flexSettings.layer);
|
|
405
|
+
}
|
|
406
|
+
}.bind(this))
|
|
407
|
+
.catch(handleError);
|
|
356
408
|
}
|
|
357
409
|
|
|
358
410
|
function onEditAdaptation() {
|
|
359
|
-
this.
|
|
411
|
+
Utils.checkDraftOverwrite(this.getModel("versions"))
|
|
412
|
+
.then(function() {
|
|
413
|
+
this.getExtension("contextBasedSaveAs", SaveAsAdaptation).openAddAdaptationDialog(this.getRtaInformation().flexSettings.layer, true /*bIsEditMode*/);
|
|
414
|
+
}.bind(this))
|
|
415
|
+
.catch(handleError);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
function handleError(oError) {
|
|
419
|
+
if (oError !== "cancel") {
|
|
420
|
+
Utils.showMessageBox("error", "MSG_LREP_TRANSFER_ERROR", {error: oError});
|
|
421
|
+
Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
|
|
422
|
+
}
|
|
360
423
|
}
|
|
361
424
|
|
|
362
425
|
function onDeleteAdaptation() {
|
|
363
|
-
this.
|
|
426
|
+
Utils.checkDraftOverwrite(this.getModel("versions"))
|
|
427
|
+
.then(function() {
|
|
428
|
+
this.fireEvent("deleteAdaptation");
|
|
429
|
+
}.bind(this))
|
|
430
|
+
.catch(handleError);
|
|
364
431
|
}
|
|
365
432
|
|
|
366
433
|
function onManageAdaptations() {
|
|
@@ -374,7 +441,7 @@ sap.ui.define([
|
|
|
374
441
|
function formatAdaptationsMenuText(iCount, sTitle) {
|
|
375
442
|
if (iCount > 0) {
|
|
376
443
|
if (sTitle === "") {
|
|
377
|
-
|
|
444
|
+
return this.getTextResources().getText("TXT_DEFAULT_APP");
|
|
378
445
|
}
|
|
379
446
|
return this.getTextResources().getText("BTN_ADAPTING_FOR", sTitle);
|
|
380
447
|
}
|
|
@@ -77,7 +77,9 @@ function(
|
|
|
77
77
|
moveDown: moveDown.bind(this),
|
|
78
78
|
onDropSelectedAdaptation: onDropSelectedAdaptation.bind(this),
|
|
79
79
|
onSaveReorderedAdaptations: onSaveReorderedAdaptations.bind(this),
|
|
80
|
-
|
|
80
|
+
isAdaptationsSelected: isAdaptationsSelected.bind(this),
|
|
81
|
+
getIndexOfSelectedAdaptation: getIndexOfSelectedAdaptation.bind(this),
|
|
82
|
+
onCancel: onCancelDialog.bind(this)
|
|
81
83
|
}
|
|
82
84
|
}).then(function(oDialog) {
|
|
83
85
|
this._oManageAdaptationDialog = oDialog;
|
|
@@ -85,7 +87,7 @@ function(
|
|
|
85
87
|
this.getToolbar().addDependent(this._oManageAdaptationDialog);
|
|
86
88
|
}.bind(this));
|
|
87
89
|
} else {
|
|
88
|
-
|
|
90
|
+
syncEnabledPropertyOfMoveButtons.call(this);
|
|
89
91
|
enableDragAndDropForAdaptationTable.call(this, true);
|
|
90
92
|
enableSaveButton.call(this, false);
|
|
91
93
|
}
|
|
@@ -97,6 +99,7 @@ function(
|
|
|
97
99
|
this.oAdaptationsModel = ContextBasedAdaptationsAPI.getAdaptationsModel({control: this._oRtaInformation.rootControl, layer: this._oRtaInformation.flexSettings.layer});
|
|
98
100
|
this.oAdaptationsModel.updateAdaptations(oAdaptations.adaptations);
|
|
99
101
|
this.oReferenceAdaptationsData = JSON.parse(JSON.stringify(this.oAdaptationsModel.getProperty("/adaptations")));
|
|
102
|
+
this._oOriginAdaptationsData = JSON.parse(JSON.stringify(this.oAdaptationsModel.getProperty("/allAdaptations")));
|
|
100
103
|
this._oControlConfigurationModel = new JSONModel({isTableItemSelected: false});
|
|
101
104
|
this._oManageAdaptationDialog.setModel(this.oAdaptationsModel, "contextBased");
|
|
102
105
|
this._oManageAdaptationDialog.setModel(this._oControlConfigurationModel, "controlConfiguration");
|
|
@@ -127,26 +130,36 @@ function(
|
|
|
127
130
|
var oOptions = {
|
|
128
131
|
year: "numeric",
|
|
129
132
|
month: "short",
|
|
130
|
-
day: "numeric"
|
|
133
|
+
day: "numeric",
|
|
134
|
+
hour: "numeric",
|
|
135
|
+
minute: "numeric"
|
|
131
136
|
};
|
|
132
137
|
var sLanguage = sap.ui.getCore().getConfiguration().getLanguage();
|
|
133
|
-
return sModifiedBy + "\n" + oUi5Date.
|
|
138
|
+
return sModifiedBy + "\n" + oUi5Date.toLocaleTimeString(sLanguage, oOptions);
|
|
134
139
|
}
|
|
135
140
|
|
|
136
141
|
function onSelectionChange(oEvent) {
|
|
137
142
|
if (oEvent.getParameter("selected") === true) {
|
|
138
143
|
this._oControlConfigurationModel.setProperty("/isTableItemSelected", true);
|
|
139
|
-
|
|
140
|
-
setEnabledPropertyOfMoveButton.call(this, true);
|
|
141
|
-
}
|
|
144
|
+
syncEnabledPropertyOfMoveButtons.call(this);
|
|
142
145
|
}
|
|
143
146
|
}
|
|
144
147
|
|
|
145
|
-
function
|
|
148
|
+
function syncEnabledPropertyOfMoveButtons() {
|
|
146
149
|
var oUpButton = getControlInDialog.call(this, "moveUpButton");
|
|
147
150
|
var oDownButton = getControlInDialog.call(this, "moveDownButton");
|
|
148
|
-
|
|
149
|
-
|
|
151
|
+
if (isSearchFieldValueEmpty.call(this)) {
|
|
152
|
+
if (isAdaptationsSelected.call(this)) {
|
|
153
|
+
oUpButton.setEnabled(getIndexOfSelectedAdaptation.call(this) > 0);
|
|
154
|
+
oDownButton.setEnabled(getIndexOfSelectedAdaptation.call(this) < this.oAdaptationsModel.getProperty("/count") - 1);
|
|
155
|
+
} else {
|
|
156
|
+
oUpButton.setEnabled(false);
|
|
157
|
+
oDownButton.setEnabled(false);
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
oUpButton.setEnabled(false);
|
|
161
|
+
oDownButton.setEnabled(false);
|
|
162
|
+
}
|
|
150
163
|
}
|
|
151
164
|
|
|
152
165
|
// ------ search field ------
|
|
@@ -157,7 +170,7 @@ function(
|
|
|
157
170
|
var oDefaultApplicationTable = getDefaultApplicationTable.call(this);
|
|
158
171
|
var sDefaultTableText = getDefaultApplicationTitle.call(this);
|
|
159
172
|
if (sQuery && sQuery.length > 0) {
|
|
160
|
-
|
|
173
|
+
syncEnabledPropertyOfMoveButtons.call(this);
|
|
161
174
|
enableDragAndDropForAdaptationTable.call(this, false);
|
|
162
175
|
//filter Table context
|
|
163
176
|
var oFilterByTitle = new Filter("title", FilterOperator.Contains, sQuery);
|
|
@@ -181,7 +194,7 @@ function(
|
|
|
181
194
|
} else {
|
|
182
195
|
enableDragAndDropForAdaptationTable.call(this, true);
|
|
183
196
|
if (this._oControlConfigurationModel.getProperty("/isTableItemSelected")) {
|
|
184
|
-
|
|
197
|
+
syncEnabledPropertyOfMoveButtons.call(this);
|
|
185
198
|
}
|
|
186
199
|
oDefaultApplicationTable.setVisible(true);
|
|
187
200
|
}
|
|
@@ -235,6 +248,7 @@ function(
|
|
|
235
248
|
// after move select the sibling
|
|
236
249
|
oTable.getItems()[iSiblingItemIndex].setSelected(true).focus();
|
|
237
250
|
enableSaveButton.call(this, didAdaptationsPriorityChange.call(this));
|
|
251
|
+
syncEnabledPropertyOfMoveButtons.call(this);
|
|
238
252
|
}
|
|
239
253
|
|
|
240
254
|
function onDropSelectedAdaptation(oEvent) {
|
|
@@ -279,8 +293,8 @@ function(
|
|
|
279
293
|
|
|
280
294
|
function didAdaptationsPriorityChange() {
|
|
281
295
|
return !_isEqual(
|
|
282
|
-
this.oAdaptationsModel.getProperty("/adaptations").map(function(
|
|
283
|
-
this.oReferenceAdaptationsData.map(function(
|
|
296
|
+
this.oAdaptationsModel.getProperty("/adaptations").map(function(oAdaptation) { return oAdaptation.id; }),
|
|
297
|
+
this.oReferenceAdaptationsData.map(function(oAdaptation) { return oAdaptation.id; })
|
|
284
298
|
);
|
|
285
299
|
}
|
|
286
300
|
|
|
@@ -318,19 +332,42 @@ function(
|
|
|
318
332
|
getAdaptationsTable.call(this).getDragDropConfig()[0].setEnabled(bIsEnabled);
|
|
319
333
|
}
|
|
320
334
|
|
|
335
|
+
function isAdaptationsSelected() {
|
|
336
|
+
var oAdaptationsTable = getAdaptationsTable.call(this);
|
|
337
|
+
return oAdaptationsTable.getSelectedContextPaths().length > 0;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
function getIndexOfSelectedAdaptation() {
|
|
341
|
+
var oAdaptationsTable = getAdaptationsTable.call(this);
|
|
342
|
+
if (oAdaptationsTable.getSelectedContextPaths().length > 0) {
|
|
343
|
+
var aSplitedPath = oAdaptationsTable.getSelectedContextPaths()[0].split("/");
|
|
344
|
+
var iIndexOfSelectedItem = Number(aSplitedPath[aSplitedPath.length - 1]);
|
|
345
|
+
return iIndexOfSelectedItem;
|
|
346
|
+
}
|
|
347
|
+
return -1;
|
|
348
|
+
}
|
|
349
|
+
|
|
321
350
|
function onSaveReorderedAdaptations() {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
351
|
+
Utils.checkDraftOverwrite(this.getToolbar().getModel("versions")).then(function() {
|
|
352
|
+
var oRtaInformation = this.getToolbar().getRtaInformation();
|
|
353
|
+
var aAdaptationPriorities = this.oAdaptationsModel.getProperty("/adaptations").map(function(oAdaptation) { return oAdaptation.id; });
|
|
354
|
+
return ContextBasedAdaptationsAPI.reorder({control: oRtaInformation.rootControl, layer: oRtaInformation.flexSettings.layer, parameters: {priorities: aAdaptationPriorities}});
|
|
355
|
+
}.bind(this)).then(function() {
|
|
356
|
+
var oAllUpdatedAdaptations = Object.assign(this.oAdaptationsModel.getProperty("/allAdaptations"), this.oAdaptationsModel.getProperty("/adaptations"));
|
|
357
|
+
this.oAdaptationsModel.updateAdaptations(oAllUpdatedAdaptations);
|
|
358
|
+
onCloseDialog.call(this);
|
|
359
|
+
}.bind(this))
|
|
325
360
|
.catch(function(oError) {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
Utils.showMessageBox("error", sMessage, oOptions);
|
|
361
|
+
if (oError !== "cancel") {
|
|
362
|
+
Utils.showMessageBox("error", "MSG_LREP_TRANSFER_ERROR", { titleKey: "BTN_MANAGE_APP_CTX", error: oError});
|
|
363
|
+
Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
|
|
364
|
+
}
|
|
331
365
|
});
|
|
332
|
-
|
|
333
|
-
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function onCancelDialog() {
|
|
369
|
+
// the adaptationsModel has to be set to its origin as no reorder has taken place
|
|
370
|
+
this.oAdaptationsModel.updateAdaptations(this._oOriginAdaptationsData);
|
|
334
371
|
onCloseDialog.call(this);
|
|
335
372
|
}
|
|
336
373
|
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
hAlign="Left">
|
|
49
49
|
<Text text="{i18n>CLM_HEADER_ADAPTATIONS_TITLE}" />
|
|
50
50
|
</Column>
|
|
51
|
-
<Column width="
|
|
51
|
+
<Column width="6rem"
|
|
52
52
|
minScreenWidth="tablet"
|
|
53
53
|
demandPopin="true"
|
|
54
54
|
popinDisplay="Inline"
|
|
@@ -87,14 +87,8 @@
|
|
|
87
87
|
<ColumnListItem>
|
|
88
88
|
<cells>
|
|
89
89
|
<Text text="{contextBased>rank}"/>
|
|
90
|
-
<CustomListItem>
|
|
91
|
-
<HBox>
|
|
92
|
-
<VBox class="sapUiSmallMarginTopBottom">
|
|
93
90
|
<Text wrapping="false" maxLines="1" text="{contextBased>title}"
|
|
94
91
|
tooltip="{contextBased>title}"/>
|
|
95
|
-
</VBox>
|
|
96
|
-
</HBox>
|
|
97
|
-
</CustomListItem>
|
|
98
92
|
<Text text="{ parts: ['contextBased>contexts/role'], formatter: '.formatContextColumnCell'}"
|
|
99
93
|
tooltip="{ parts: ['contextBased>contexts/role'], formatter: '.formatContextColumnTooltip'}" />
|
|
100
94
|
<Text text="{ parts: ['contextBased>createdBy', 'contextBased>createdAt'], formatter: '.formatCreatedChangedOnColumnCell'}"/>
|
|
@@ -151,7 +145,7 @@
|
|
|
151
145
|
<endButton>
|
|
152
146
|
<Button id="manageAdaptations-closeButton"
|
|
153
147
|
text="{i18n>APP_CTX_DIALOG_CANCEL}"
|
|
154
|
-
press=".
|
|
148
|
+
press=".onCancel"/>
|
|
155
149
|
</endButton>
|
|
156
150
|
</Dialog>
|
|
157
151
|
</core:FragmentDefinition>
|
|
@@ -15,7 +15,6 @@ sap.ui.define([
|
|
|
15
15
|
"sap/ui/fl/write/api/ContextBasedAdaptationsAPI",
|
|
16
16
|
"sap/ui/fl/write/api/ContextSharingAPI",
|
|
17
17
|
"sap/ui/rta/Utils",
|
|
18
|
-
"sap/ui/model/Binding",
|
|
19
18
|
"sap/ui/model/json/JSONModel"
|
|
20
19
|
], function(
|
|
21
20
|
ManagedObject,
|
|
@@ -28,7 +27,6 @@ sap.ui.define([
|
|
|
28
27
|
ContextBasedAdaptationsAPI,
|
|
29
28
|
ContextSharingAPI,
|
|
30
29
|
Utils,
|
|
31
|
-
Binding,
|
|
32
30
|
JSONModel
|
|
33
31
|
) {
|
|
34
32
|
"use strict";
|
|
@@ -43,7 +41,7 @@ sap.ui.define([
|
|
|
43
41
|
* @class
|
|
44
42
|
*
|
|
45
43
|
* @author SAP SE
|
|
46
|
-
* @version 1.114.
|
|
44
|
+
* @version 1.114.1
|
|
47
45
|
*
|
|
48
46
|
* @constructor
|
|
49
47
|
* @private
|
|
@@ -167,6 +165,7 @@ sap.ui.define([
|
|
|
167
165
|
oContextBasedAdaptation.priority = getAdaptationPriority.call(this);
|
|
168
166
|
var oRtaInformation = this.getToolbar().getRtaInformation();
|
|
169
167
|
if (this._bIsEditMode) {
|
|
168
|
+
oContextBasedAdaptation.adaptationId = this._mEditProperties.adaptationId;
|
|
170
169
|
ContextBasedAdaptationsAPI.update({
|
|
171
170
|
control: oRtaInformation.rootControl,
|
|
172
171
|
layer: oRtaInformation.flexSettings.layer,
|
|
@@ -279,7 +278,8 @@ sap.ui.define([
|
|
|
279
278
|
var oInputField = this.getToolbar().getControl("addAdaptationDialog--saveAdaptation-title-input");
|
|
280
279
|
var bEnable;
|
|
281
280
|
var bRolesSelectedAndValidTitle = this._oContextComponentInstance.getSelectedContexts().role.length > 0
|
|
282
|
-
&& oInputField.getValueState() === ValueState.None
|
|
281
|
+
&& oInputField.getValueState() === ValueState.None
|
|
282
|
+
&& oInputField.getValue().length > 0;
|
|
283
283
|
if (this._bIsEditMode && this._mEditProperties && this.oDialogModel) {
|
|
284
284
|
bEnable = bRolesSelectedAndValidTitle
|
|
285
285
|
// check that some of the properties title, priority, roles have been changed
|
|
@@ -30,7 +30,7 @@ sap.ui.define([
|
|
|
30
30
|
* @namespace sap.ui.rta.util.ReloadManager
|
|
31
31
|
* @alias sap.ui.rta.util.ReloadManager
|
|
32
32
|
* @since 1.104
|
|
33
|
-
* @version 1.114.
|
|
33
|
+
* @version 1.114.1
|
|
34
34
|
* @private
|
|
35
35
|
* @ui5-restricted
|
|
36
36
|
*/
|
|
@@ -77,7 +77,7 @@ sap.ui.define([
|
|
|
77
77
|
sReason = "MSG_DRAFT_EXISTS";
|
|
78
78
|
} else if (oReloadInfo.allContexts) {
|
|
79
79
|
sReason = "MSG_RESTRICTED_CONTEXT_EXIST";
|
|
80
|
-
}
|
|
80
|
+
}// TODO add app descr changes case for start?
|
|
81
81
|
return sReason;
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -94,6 +94,9 @@ sap.ui.define([
|
|
|
94
94
|
if (oReloadInfo.allContexts) {
|
|
95
95
|
return "MSG_RELOAD_WITH_PERSONALIZATION_AND_RESTRICTED_CONTEXT";
|
|
96
96
|
}
|
|
97
|
+
if (oReloadInfo.switchEndUserAdaptation) {
|
|
98
|
+
return "MSG_RELOAD_WITH_PERSONALIZATION_AND_CONTEXT_BASED_ADAPTATION";
|
|
99
|
+
}
|
|
97
100
|
return "MSG_RELOAD_WITH_PERSONALIZATION_AND_VIEWS";
|
|
98
101
|
}
|
|
99
102
|
|
|
@@ -112,6 +115,10 @@ sap.ui.define([
|
|
|
112
115
|
if (oReloadInfo.allContexts) {
|
|
113
116
|
return "MSG_RELOAD_WITHOUT_ALL_CONTEXT";
|
|
114
117
|
}
|
|
118
|
+
|
|
119
|
+
if (oReloadInfo.switchEndUserAdaptation) {
|
|
120
|
+
return "MSG_RELOAD_OTHER_CONTEXT_BASED_ADAPTATION";
|
|
121
|
+
}
|
|
115
122
|
return undefined;
|
|
116
123
|
}
|
|
117
124
|
|
|
@@ -127,33 +134,34 @@ sap.ui.define([
|
|
|
127
134
|
}
|
|
128
135
|
|
|
129
136
|
function triggerReloadOnStart(oReloadInfo, bVersioningEnabled, bDeveloperMode) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
return Promise.resolve().then(function() {
|
|
138
|
+
if (mUShellServices.CrossApplicationNavigation && bVersioningEnabled) {
|
|
139
|
+
// clears FlexState and triggers reloading of the flex data without blocking
|
|
140
|
+
if (oReloadInfo.isDraftAvailable) {
|
|
141
|
+
return VersionsAPI.loadDraftForApplication({
|
|
142
|
+
control: oReloadInfo.selector,
|
|
143
|
+
layer: oReloadInfo.layer,
|
|
144
|
+
allContexts: oReloadInfo.allContexts,
|
|
145
|
+
adaptationId: oReloadInfo.adaptationId
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
return VersionsAPI.loadVersionForApplication({
|
|
141
149
|
control: oReloadInfo.selector,
|
|
142
150
|
layer: oReloadInfo.layer,
|
|
143
151
|
allContexts: oReloadInfo.allContexts,
|
|
144
152
|
adaptationId: oReloadInfo.adaptationId
|
|
145
153
|
});
|
|
146
154
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
155
|
+
return undefined;
|
|
156
|
+
}).then(function() {
|
|
157
|
+
var sReason = getReloadMessageOnStart(oReloadInfo);
|
|
158
|
+
// showing messages in visual editor is leading to blocked screen. In this case we should reload without message
|
|
159
|
+
return bDeveloperMode ? undefined : Utils.showMessageBox("information", sReason);
|
|
160
|
+
}).then(function() {
|
|
152
161
|
ReloadManager.enableAutomaticStart(oReloadInfo.layer, oReloadInfo.selector);
|
|
153
162
|
oReloadInfo.onStart = true;
|
|
154
163
|
return ReloadManager.triggerReload(oReloadInfo);
|
|
155
|
-
})
|
|
156
|
-
.then(function() {
|
|
164
|
+
}).then(function() {
|
|
157
165
|
return true;
|
|
158
166
|
});
|
|
159
167
|
}
|
|
@@ -270,6 +278,7 @@ sap.ui.define([
|
|
|
270
278
|
* @param {sap.ui.fl.Selector} mProperties.selector - Root control
|
|
271
279
|
* @param {boolean} mProperties.versioningEnabled - Whether versioning is enabled
|
|
272
280
|
* @param {boolean} mProperties.developerMode - Whether the developer mode is set
|
|
281
|
+
* @param {string} mProperties.adaptationId - Context-based adaptation ID of the currently displayed adaptation
|
|
273
282
|
*
|
|
274
283
|
* @return {Promise<boolean>} Resolving to <code>false</code> means that reload is not necessary
|
|
275
284
|
*/
|
|
@@ -282,8 +291,7 @@ sap.ui.define([
|
|
|
282
291
|
URLParsingService: mUShellServices.URLParsing
|
|
283
292
|
});
|
|
284
293
|
return ReloadInfoAPI.getReloadReasonsForStart(mProperties).then(function(oReloadInfo) {
|
|
285
|
-
|
|
286
|
-
if (oReloadInfo.hasHigherLayerChanges || oReloadInfo.isDraftAvailable || oReloadInfo.allContexts) {
|
|
294
|
+
if (oReloadInfo.hasHigherLayerChanges || oReloadInfo.isDraftAvailable || oReloadInfo.allContexts || oReloadInfo.switchAdaptation) {
|
|
287
295
|
return triggerReloadOnStart(oReloadInfo, mProperties.versioningEnabled, mProperties.developerMode);
|
|
288
296
|
}
|
|
289
297
|
return undefined;
|
|
@@ -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.114.
|
|
43
|
+
* @version 1.114.1
|
|
44
44
|
* @private
|
|
45
45
|
*/
|
|
46
46
|
var ChangeIndicator = Control.extend("sap.ui.rta.util.changeVisualization.ChangeIndicator", {
|
|
@@ -39,7 +39,7 @@ sap.ui.define([
|
|
|
39
39
|
* @alias sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry
|
|
40
40
|
* @author SAP SE
|
|
41
41
|
* @since 1.86.0
|
|
42
|
-
* @version 1.114.
|
|
42
|
+
* @version 1.114.1
|
|
43
43
|
* @private
|
|
44
44
|
*/
|
|
45
45
|
var ChangeIndicatorRegistry = ManagedObject.extend("sap.ui.rta.util.changeVisualization.ChangeIndicatorRegistry", {
|
|
@@ -67,7 +67,7 @@ sap.ui.define([
|
|
|
67
67
|
* @alias sap.ui.rta.util.changeVisualization.ChangeVisualization
|
|
68
68
|
* @author SAP SE
|
|
69
69
|
* @since 1.84.0
|
|
70
|
-
* @version 1.114.
|
|
70
|
+
* @version 1.114.1
|
|
71
71
|
* @private
|
|
72
72
|
*/
|
|
73
73
|
var ChangeVisualization = Control.extend("sap.ui.rta.util.changeVisualization.ChangeVisualization", {
|