@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.rta",
|
|
3
|
-
"version": "1.114.
|
|
3
|
+
"version": "1.114.1",
|
|
4
4
|
"description": "OpenUI5 UI Library sap.ui.rta",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"url": "https://github.com/SAP/openui5.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@openui5/sap.m": "1.114.
|
|
18
|
-
"@openui5/sap.ui.core": "1.114.
|
|
19
|
-
"@openui5/sap.ui.dt": "1.114.
|
|
20
|
-
"@openui5/sap.ui.fl": "1.114.
|
|
21
|
-
"@openui5/sap.ui.layout": "1.114.
|
|
17
|
+
"@openui5/sap.m": "1.114.1",
|
|
18
|
+
"@openui5/sap.ui.core": "1.114.1",
|
|
19
|
+
"@openui5/sap.ui.dt": "1.114.1",
|
|
20
|
+
"@openui5/sap.ui.fl": "1.114.1",
|
|
21
|
+
"@openui5/sap.ui.layout": "1.114.1"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/src/sap/ui/rta/.library
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>OpenUI5
|
|
7
7
|
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
8
8
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
|
|
9
|
-
<version>1.114.
|
|
9
|
+
<version>1.114.1</version>
|
|
10
10
|
|
|
11
11
|
<documentation>SAPUI5 library with RTA controls.</documentation>
|
|
12
12
|
|
package/src/sap/ui/rta/Client.js
CHANGED
|
@@ -120,7 +120,7 @@ sap.ui.define([
|
|
|
120
120
|
* @class The runtime authoring allows to adapt the fields of a running application.
|
|
121
121
|
* @extends sap.ui.base.ManagedObject
|
|
122
122
|
* @author SAP SE
|
|
123
|
-
* @version 1.114.
|
|
123
|
+
* @version 1.114.1
|
|
124
124
|
* @constructor
|
|
125
125
|
* @private
|
|
126
126
|
* @since 1.30
|
|
@@ -441,6 +441,7 @@ sap.ui.define([
|
|
|
441
441
|
* @public
|
|
442
442
|
*/
|
|
443
443
|
RuntimeAuthoring.prototype.start = function() {
|
|
444
|
+
var bIsAutomaticRestart = RuntimeAuthoring.needsRestart(this.getLayer());
|
|
444
445
|
var oDesignTimePromise;
|
|
445
446
|
var vError;
|
|
446
447
|
// Create DesignTime
|
|
@@ -454,8 +455,8 @@ sap.ui.define([
|
|
|
454
455
|
}
|
|
455
456
|
|
|
456
457
|
return this._loadUShellServicesPromise
|
|
457
|
-
.then(initVersioning.bind(this))
|
|
458
|
-
.then(initContextBasedAdaptations.bind(this))
|
|
458
|
+
.then(initVersioning.bind(this, bIsAutomaticRestart))
|
|
459
|
+
.then(initContextBasedAdaptations.bind(this, bIsAutomaticRestart))
|
|
459
460
|
/*
|
|
460
461
|
Check if the application has personalized changes and reload without them;
|
|
461
462
|
Also Check if the application has an available draft and if yes, reload with those changes.
|
|
@@ -575,7 +576,7 @@ sap.ui.define([
|
|
|
575
576
|
validateFlexEnabled(this);
|
|
576
577
|
}
|
|
577
578
|
this._sStatus = STARTED;
|
|
578
|
-
RuntimeAuthoring.disableRestart(
|
|
579
|
+
RuntimeAuthoring.disableRestart(this.getLayer());
|
|
579
580
|
this.fireStart({
|
|
580
581
|
editablePluginsCount: this.getPluginManager().getEditableOverlaysCount()
|
|
581
582
|
});
|
|
@@ -1063,33 +1064,30 @@ sap.ui.define([
|
|
|
1063
1064
|
* @returns {Promise} Resolves as soon as the MessageBox is closed
|
|
1064
1065
|
*/
|
|
1065
1066
|
function onStackModified() {
|
|
1066
|
-
var bBackEndDraftExists = this._oVersionsModel.getProperty("/backendDraft");
|
|
1067
|
-
var bDraftDisplayed = this._oVersionsModel.getProperty("/displayedVersion") === Version.Number.Draft;
|
|
1068
1067
|
var oCommandStack = this.getCommandStack();
|
|
1069
1068
|
var bCanUndo = oCommandStack.canUndo();
|
|
1070
1069
|
|
|
1070
|
+
// FIXME Missing check whether action is saveable e.g. switching a view should not trigger this
|
|
1071
|
+
// bCanUndo and _bUserDiscardedDraft seem to be redundant logic,
|
|
1072
|
+
// because displayedVersion would be draft already
|
|
1071
1073
|
if (
|
|
1072
1074
|
!this.getShowToolbars() ||
|
|
1073
1075
|
!bCanUndo ||
|
|
1074
|
-
this._bUserDiscardedDraft
|
|
1075
|
-
bDraftDisplayed ||
|
|
1076
|
-
!bBackEndDraftExists
|
|
1076
|
+
this._bUserDiscardedDraft
|
|
1077
1077
|
) {
|
|
1078
|
-
|
|
1078
|
+
modifyStack.call(this);
|
|
1079
|
+
return;
|
|
1079
1080
|
}
|
|
1080
1081
|
|
|
1081
1082
|
// warn the user: the existing draft would be discarded in case the user saves
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
})
|
|
1087
|
-
.then(function(sAction) {
|
|
1088
|
-
if (sAction === MessageBox.Action.OK) {
|
|
1089
|
-
discardDraftConfirmed.call(this);
|
|
1090
|
-
} else {
|
|
1091
|
-
this.undo();
|
|
1083
|
+
Utils.checkDraftOverwrite(this._oVersionsModel)
|
|
1084
|
+
.then(function(bDialogShown) {
|
|
1085
|
+
if (bDialogShown) {
|
|
1086
|
+
this._bUserDiscardedDraft = true;
|
|
1092
1087
|
}
|
|
1088
|
+
modifyStack.call(this);
|
|
1089
|
+
}.bind(this), function() {
|
|
1090
|
+
this.undo();
|
|
1093
1091
|
}.bind(this));
|
|
1094
1092
|
}
|
|
1095
1093
|
|
|
@@ -1211,6 +1209,10 @@ sap.ui.define([
|
|
|
1211
1209
|
// Save changes on the current layer and discard dirty changes on other layers
|
|
1212
1210
|
mPropertyBag.saveAsDraft = this.getLayer() === Layer.CUSTOMER;
|
|
1213
1211
|
}
|
|
1212
|
+
if (this._oContextBasedAdaptationsModel.getProperty("/contextBasedAdaptationsEnabled")) {
|
|
1213
|
+
// If an adaptation is being processed, saving without exiting must retrieve the updated state of the adaptation
|
|
1214
|
+
mPropertyBag.adaptationId = bIsExit ? undefined : this._oContextBasedAdaptationsModel.getProperty("/displayedAdaptation/id");
|
|
1215
|
+
}
|
|
1214
1216
|
|
|
1215
1217
|
return this._oSerializer.saveCommands(mPropertyBag)
|
|
1216
1218
|
.then(function() {
|
|
@@ -1344,21 +1346,22 @@ sap.ui.define([
|
|
|
1344
1346
|
emphasizedAction: MessageBox.Action.YES
|
|
1345
1347
|
}).then(function(sAction) {
|
|
1346
1348
|
if (sAction === MessageBox.Action.YES) {
|
|
1347
|
-
this._serializeToLrep()
|
|
1349
|
+
return this._serializeToLrep()
|
|
1348
1350
|
.then(callbackFn);
|
|
1349
1351
|
} else if (sAction === MessageBox.Action.NO) {
|
|
1350
1352
|
// avoids the data loss popup; a reload is triggered later and will destroy RTA & the command stack
|
|
1351
1353
|
this.getCommandStack().removeAllCommands(true);
|
|
1352
|
-
callbackFn();
|
|
1354
|
+
return callbackFn();
|
|
1353
1355
|
}
|
|
1354
|
-
return
|
|
1356
|
+
return Promise.resolve();
|
|
1355
1357
|
}.bind(this));
|
|
1356
|
-
return;
|
|
1358
|
+
return Promise.resolve();
|
|
1357
1359
|
}
|
|
1358
|
-
callbackFn();
|
|
1360
|
+
return callbackFn();
|
|
1359
1361
|
}
|
|
1360
1362
|
|
|
1361
1363
|
function onSwitchAdaptation(oEvent) {
|
|
1364
|
+
var fnCallback = oEvent.getParameter("callback") || function() {};
|
|
1362
1365
|
if (oEvent.getParameter("trigger") === "SaveAs") {
|
|
1363
1366
|
// remove all changes from command stack when triggered from saveAs dialog as they are already saved in a new adaptation
|
|
1364
1367
|
this.getCommandStack().removeAllCommands(true);
|
|
@@ -1366,15 +1369,21 @@ sap.ui.define([
|
|
|
1366
1369
|
var sAdaptationId = oEvent.getParameter("adaptationId");
|
|
1367
1370
|
this._sSwitchToAdaptationId = sAdaptationId;
|
|
1368
1371
|
return handleDataLoss.call(this, "MSG_SWITCH_VERSION_DIALOG", "BTN_SWITCH_ADAPTATIONS",
|
|
1369
|
-
switchAdaptation.bind(this, this._sSwitchToAdaptationId))
|
|
1372
|
+
switchAdaptation.bind(this, this._sSwitchToAdaptationId))
|
|
1373
|
+
.then(fnCallback)
|
|
1374
|
+
.catch(function(oError) {
|
|
1375
|
+
Utils.showMessageBox("error", "MSG_SWITCH_ADAPTATION_FAILED", {error: oError});
|
|
1376
|
+
Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
|
|
1377
|
+
});
|
|
1370
1378
|
}
|
|
1371
1379
|
|
|
1372
1380
|
function switchAdaptation(sAdaptationId) {
|
|
1373
1381
|
var sVersion = this._oVersionsModel.getProperty("/displayedVersion");
|
|
1374
|
-
switchVersion.call(this, sVersion, sAdaptationId);
|
|
1382
|
+
return switchVersion.call(this, sVersion, sAdaptationId);
|
|
1375
1383
|
}
|
|
1376
1384
|
|
|
1377
1385
|
function onSwitchVersion(oEvent) {
|
|
1386
|
+
var fnCallback = oEvent.getParameter("callback") || function() {};
|
|
1378
1387
|
var sVersion = oEvent.getParameter("version");
|
|
1379
1388
|
var sDisplayedVersion = this._oVersionsModel.getProperty("/displayedVersion");
|
|
1380
1389
|
|
|
@@ -1384,24 +1393,30 @@ sap.ui.define([
|
|
|
1384
1393
|
}
|
|
1385
1394
|
|
|
1386
1395
|
this._sSwitchToVersion = sVersion;
|
|
1387
|
-
|
|
1388
|
-
switchVersion.bind(this, this._sSwitchToVersion))
|
|
1396
|
+
handleDataLoss.call(this, "MSG_SWITCH_VERSION_DIALOG", "TIT_SWITCH_VERSION_DIALOG",
|
|
1397
|
+
switchVersion.bind(this, this._sSwitchToVersion))
|
|
1398
|
+
.then(fnCallback)
|
|
1399
|
+
.catch(function(oError) {
|
|
1400
|
+
Utils.showMessageBox("error", "MSG_SWITCH_VERSION_FAILED", {error: oError});
|
|
1401
|
+
Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
|
|
1402
|
+
});
|
|
1389
1403
|
}
|
|
1390
1404
|
|
|
1391
1405
|
function switchVersion(sVersion, sAdaptationId) {
|
|
1392
1406
|
RuntimeAuthoring.enableRestart(this.getLayer(), this.getRootControlInstance());
|
|
1393
1407
|
|
|
1394
|
-
VersionsAPI.loadVersionForApplication({
|
|
1408
|
+
return VersionsAPI.loadVersionForApplication({
|
|
1395
1409
|
control: this.getRootControlInstance(),
|
|
1396
1410
|
layer: this.getLayer(),
|
|
1397
1411
|
version: sVersion,
|
|
1398
1412
|
adaptationId: sAdaptationId
|
|
1413
|
+
}).then(function() {
|
|
1414
|
+
var oReloadInfo = {
|
|
1415
|
+
versionSwitch: true,
|
|
1416
|
+
version: sVersion
|
|
1417
|
+
};
|
|
1418
|
+
ReloadManager.triggerReload(oReloadInfo);
|
|
1399
1419
|
});
|
|
1400
|
-
var oReloadInfo = {
|
|
1401
|
-
versionSwitch: true,
|
|
1402
|
-
version: sVersion
|
|
1403
|
-
};
|
|
1404
|
-
ReloadManager.triggerReload(oReloadInfo);
|
|
1405
1420
|
}
|
|
1406
1421
|
|
|
1407
1422
|
function onPublishVersion() {
|
|
@@ -1420,11 +1435,6 @@ sap.ui.define([
|
|
|
1420
1435
|
});
|
|
1421
1436
|
}
|
|
1422
1437
|
|
|
1423
|
-
function discardDraftConfirmed() {
|
|
1424
|
-
this._bUserDiscardedDraft = true;
|
|
1425
|
-
modifyStack.call(this);
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
1438
|
function isOldVersionDisplayed() {
|
|
1429
1439
|
return VersionsAPI.isOldVersionDisplayed({
|
|
1430
1440
|
control: this.getRootControlInstance(),
|
|
@@ -1439,7 +1449,15 @@ sap.ui.define([
|
|
|
1439
1449
|
});
|
|
1440
1450
|
}
|
|
1441
1451
|
|
|
1442
|
-
|
|
1452
|
+
/**
|
|
1453
|
+
* Inits version models. Clears old state if RTA is starting from end user mode (no switch)
|
|
1454
|
+
* @param {boolean} bIsAutomaticRestart - If true this is not an RTA start but a reload due to version/adaptation switch
|
|
1455
|
+
* @returns {Promise<void>} - Promise
|
|
1456
|
+
*/
|
|
1457
|
+
function initVersioning(bIsAutomaticRestart) {
|
|
1458
|
+
if (!bIsAutomaticRestart) {
|
|
1459
|
+
VersionsAPI.clearInstances();
|
|
1460
|
+
}
|
|
1443
1461
|
return VersionsAPI.initialize({
|
|
1444
1462
|
control: this.getRootControlInstance(),
|
|
1445
1463
|
layer: this.getLayer()
|
|
@@ -1448,7 +1466,15 @@ sap.ui.define([
|
|
|
1448
1466
|
}.bind(this));
|
|
1449
1467
|
}
|
|
1450
1468
|
|
|
1451
|
-
|
|
1469
|
+
/**
|
|
1470
|
+
* Inits CBA models. Clears old state if RTA is starting from end user mode (no switch)
|
|
1471
|
+
* @param {boolean} bIsAutomaticRestart - If true this is not an RTA start but a reload due to version/adaptation switch
|
|
1472
|
+
* @returns {Promise<void>} - Promise
|
|
1473
|
+
*/
|
|
1474
|
+
function initContextBasedAdaptations(bIsAutomaticRestart) {
|
|
1475
|
+
if (!bIsAutomaticRestart) {
|
|
1476
|
+
ContextBasedAdaptationsAPI.clearInstances();
|
|
1477
|
+
}
|
|
1452
1478
|
return ContextBasedAdaptationsAPI.initialize({
|
|
1453
1479
|
control: this.getRootControlInstance(),
|
|
1454
1480
|
layer: this.getLayer()
|
package/src/sap/ui/rta/Utils.js
CHANGED
|
@@ -9,6 +9,7 @@ sap.ui.define([
|
|
|
9
9
|
"sap/ui/fl/Utils",
|
|
10
10
|
"sap/ui/fl/Layer",
|
|
11
11
|
"sap/ui/fl/LayerUtils",
|
|
12
|
+
"sap/ui/fl/write/api/Version",
|
|
12
13
|
"sap/ui/dt/OverlayUtil",
|
|
13
14
|
"sap/ui/dt/DOMUtil",
|
|
14
15
|
"sap/ui/dt/ElementUtil",
|
|
@@ -26,6 +27,7 @@ function(
|
|
|
26
27
|
FlexUtils,
|
|
27
28
|
Layer,
|
|
28
29
|
FlexLayerUtils,
|
|
30
|
+
Version,
|
|
29
31
|
OverlayUtil,
|
|
30
32
|
DOMUtil,
|
|
31
33
|
ElementUtil,
|
|
@@ -45,7 +47,7 @@ function(
|
|
|
45
47
|
*
|
|
46
48
|
* @namespace
|
|
47
49
|
* @author SAP SE
|
|
48
|
-
* @version 1.114.
|
|
50
|
+
* @version 1.114.1
|
|
49
51
|
*
|
|
50
52
|
* @private
|
|
51
53
|
* @since 1.30
|
|
@@ -644,5 +646,37 @@ function(
|
|
|
644
646
|
});
|
|
645
647
|
};
|
|
646
648
|
|
|
649
|
+
/**
|
|
650
|
+
* Check if an existing draft would be overwritten if a change is done on the currently shown version
|
|
651
|
+
* If so it opens a confirmation dialog.
|
|
652
|
+
* @param {object} oVersionsModel The versions model
|
|
653
|
+
* @return {Promise.<boolean>} It either resolves with an indicator whether a confirmation
|
|
654
|
+
* was shown or rejects with "cancel" if cancel was pressed
|
|
655
|
+
*/
|
|
656
|
+
Utils.checkDraftOverwrite = function(oVersionsModel) {
|
|
657
|
+
var bBackEndDraftExists = oVersionsModel.getProperty("/backendDraft");
|
|
658
|
+
var bDraftDisplayed = oVersionsModel.getProperty("/displayedVersion") === Version.Number.Draft;
|
|
659
|
+
|
|
660
|
+
if (
|
|
661
|
+
bDraftDisplayed ||
|
|
662
|
+
!bBackEndDraftExists
|
|
663
|
+
) {
|
|
664
|
+
return Promise.resolve(false);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
// warn the user: the existing draft would be discarded in case the user saves
|
|
668
|
+
return Utils.showMessageBox("warning", "MSG_DRAFT_DISCARD_AND_CREATE_NEW_DIALOG", {
|
|
669
|
+
titleKey: "TIT_DRAFT_DISCARD_DIALOG",
|
|
670
|
+
actions: [MessageBox.Action.OK, MessageBox.Action.CANCEL],
|
|
671
|
+
emphasizedAction: MessageBox.Action.OK
|
|
672
|
+
})
|
|
673
|
+
.then(function(sAction) {
|
|
674
|
+
if (sAction !== MessageBox.Action.OK) {
|
|
675
|
+
throw "cancel";
|
|
676
|
+
}
|
|
677
|
+
return true;
|
|
678
|
+
});
|
|
679
|
+
};
|
|
680
|
+
|
|
647
681
|
return Utils;
|
|
648
682
|
}, /* bExport= */true);
|
|
@@ -28,7 +28,7 @@ sap.ui.define([
|
|
|
28
28
|
* @class
|
|
29
29
|
* @extends sap.ui.rta.command.BaseCommand
|
|
30
30
|
* @author SAP SE
|
|
31
|
-
* @version 1.114.
|
|
31
|
+
* @version 1.114.1
|
|
32
32
|
* @constructor
|
|
33
33
|
* @private
|
|
34
34
|
* @since 1.86
|
|
@@ -66,6 +66,8 @@ sap.ui.define([
|
|
|
66
66
|
this.oModel = this.getModel();
|
|
67
67
|
this.setSourceDefaultVariant(this.oModel.getData()[this.sVariantManagementReference].defaultVariant);
|
|
68
68
|
this.sLayer = mFlexSettings.layer;
|
|
69
|
+
var mComponentPropertyBag = mFlexSettings;
|
|
70
|
+
mComponentPropertyBag.variantManagementControl = this.oVariantManagementControl;
|
|
69
71
|
|
|
70
72
|
function storeEventParameters(oEvent, oArgs) {
|
|
71
73
|
var mParameters = oEvent.getParameters();
|
|
@@ -84,7 +86,7 @@ sap.ui.define([
|
|
|
84
86
|
this.oVariantManagementControl.attachSave({resolve: resolve}, storeEventParameters, this);
|
|
85
87
|
this.oVariantManagementControl.attachCancel({resolve: resolve}, handleCancel, this);
|
|
86
88
|
this.oVariantManagementControl.openSaveAsDialogForKeyUser(rtaUtils.getRtaStyleClassName(),
|
|
87
|
-
ContextSharingAPI.createComponent(
|
|
89
|
+
ContextSharingAPI.createComponent(mComponentPropertyBag));
|
|
88
90
|
}.bind(this))
|
|
89
91
|
.then(function(bState) {
|
|
90
92
|
return bState;
|
|
@@ -27,7 +27,7 @@ sap.ui.define([
|
|
|
27
27
|
* @class
|
|
28
28
|
* @extends sap.ui.base.ManagedObject
|
|
29
29
|
* @author SAP SE
|
|
30
|
-
* @version 1.114.
|
|
30
|
+
* @version 1.114.1
|
|
31
31
|
* @constructor
|
|
32
32
|
* @private
|
|
33
33
|
* @since 1.42
|
|
@@ -152,7 +152,8 @@ sap.ui.define([
|
|
|
152
152
|
* @param {boolean} mPropertyBag.saveAsDraft - save the changes as a draft
|
|
153
153
|
* @param {string} [mPropertyBag.layer] - Layer for which the changes should be saved
|
|
154
154
|
* @param {boolean} [mPropertyBag.removeOtherLayerChanges=false] - Whether to remove changes on other layers before saving
|
|
155
|
-
* @param {string} [mPropertyBag.version] -
|
|
155
|
+
* @param {string} [mPropertyBag.version] - Version to load into Flex State after saving (e.g. undefined when exiting RTA)
|
|
156
|
+
* @param {string} [mPropertyBag.adaptationId] - Adaptation to load into Flex State after saving (e.g. undefined when exiting RTA)
|
|
156
157
|
* @returns {Promise} return empty promise
|
|
157
158
|
* @public
|
|
158
159
|
*/
|
|
@@ -172,6 +173,7 @@ sap.ui.define([
|
|
|
172
173
|
layer: mPropertyBag.layer,
|
|
173
174
|
removeOtherLayerChanges: !!mPropertyBag.removeOtherLayerChanges,
|
|
174
175
|
version: mPropertyBag.version,
|
|
176
|
+
adaptationId: mPropertyBag.adaptationId,
|
|
175
177
|
condenseAnyLayer: mPropertyBag.condenseAnyLayer
|
|
176
178
|
});
|
|
177
179
|
}.bind(this))
|