@openui5/sap.ui.rta 1.113.0 → 1.115.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 +0 -5
- package/THIRDPARTY.txt +1 -7
- 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 +156 -54
- package/src/sap/ui/rta/Utils.js +36 -2
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +6 -5
- 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 +4 -8
- package/src/sap/ui/rta/command/ControlVariantSave.js +5 -6
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +7 -10
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -5
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +11 -12
- 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 +93 -76
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +30 -2
- package/src/sap/ui/rta/messagebundle_ar.properties +16 -4
- package/src/sap/ui/rta/messagebundle_bg.properties +16 -4
- package/src/sap/ui/rta/messagebundle_ca.properties +16 -4
- package/src/sap/ui/rta/messagebundle_cs.properties +16 -4
- package/src/sap/ui/rta/messagebundle_cy.properties +16 -4
- package/src/sap/ui/rta/messagebundle_da.properties +16 -4
- package/src/sap/ui/rta/messagebundle_de.properties +16 -4
- package/src/sap/ui/rta/messagebundle_el.properties +16 -4
- package/src/sap/ui/rta/messagebundle_en.properties +14 -2
- package/src/sap/ui/rta/messagebundle_en_GB.properties +14 -2
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +14 -2
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +14 -2
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +14 -2
- package/src/sap/ui/rta/messagebundle_es.properties +16 -4
- package/src/sap/ui/rta/messagebundle_es_MX.properties +16 -4
- package/src/sap/ui/rta/messagebundle_et.properties +16 -4
- package/src/sap/ui/rta/messagebundle_fi.properties +16 -4
- package/src/sap/ui/rta/messagebundle_fr.properties +16 -4
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +16 -4
- package/src/sap/ui/rta/messagebundle_hi.properties +16 -4
- package/src/sap/ui/rta/messagebundle_hr.properties +16 -4
- package/src/sap/ui/rta/messagebundle_hu.properties +16 -4
- package/src/sap/ui/rta/messagebundle_id.properties +16 -4
- package/src/sap/ui/rta/messagebundle_it.properties +16 -4
- package/src/sap/ui/rta/messagebundle_iw.properties +16 -4
- package/src/sap/ui/rta/messagebundle_ja.properties +33 -21
- package/src/sap/ui/rta/messagebundle_kk.properties +16 -4
- package/src/sap/ui/rta/messagebundle_ko.properties +20 -8
- package/src/sap/ui/rta/messagebundle_lt.properties +16 -4
- package/src/sap/ui/rta/messagebundle_lv.properties +16 -4
- package/src/sap/ui/rta/messagebundle_ms.properties +20 -8
- package/src/sap/ui/rta/messagebundle_nl.properties +16 -4
- package/src/sap/ui/rta/messagebundle_no.properties +16 -4
- package/src/sap/ui/rta/messagebundle_pl.properties +16 -4
- package/src/sap/ui/rta/messagebundle_pt.properties +16 -4
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +16 -4
- package/src/sap/ui/rta/messagebundle_ro.properties +16 -4
- package/src/sap/ui/rta/messagebundle_ru.properties +16 -4
- package/src/sap/ui/rta/messagebundle_sh.properties +16 -4
- package/src/sap/ui/rta/messagebundle_sk.properties +16 -4
- package/src/sap/ui/rta/messagebundle_sl.properties +16 -4
- package/src/sap/ui/rta/messagebundle_sv.properties +16 -4
- package/src/sap/ui/rta/messagebundle_th.properties +17 -5
- package/src/sap/ui/rta/messagebundle_tr.properties +16 -4
- package/src/sap/ui/rta/messagebundle_uk.properties +16 -4
- package/src/sap/ui/rta/messagebundle_vi.properties +16 -4
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +16 -4
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +16 -4
- 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 +2 -22
- 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.fragment.xml +17 -13
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.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 +4 -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 +11 -1
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +59 -20
- package/src/sap/ui/rta/toolbar/Adaptation.js +115 -14
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- package/src/sap/ui/rta/toolbar/FeedbackDialog.fragment.xml +24 -0
- package/src/sap/ui/rta/toolbar/Fiori.js +2 -2
- 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 +60 -36
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +3 -15
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +120 -33
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptationDialog.fragment.xml +12 -10
- package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +2 -2
- 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 +32 -21
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +42 -25
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +19 -12
- package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +67 -9
- package/src/sap/ui/rta/view/RemoveElementDialog.fragment.xml +1 -1
package/.reuse/dep5
CHANGED
|
@@ -192,11 +192,6 @@ Copyright: 2012 Matteo Spinelli
|
|
|
192
192
|
License: MIT
|
|
193
193
|
Comment: these files belong to: cubiq.org - swipeview
|
|
194
194
|
|
|
195
|
-
Files: src/sap.ui.core/src/sap/ui/thirdparty/mobify-carousel.js
|
|
196
|
-
Copyright: Mobify R&D Inc.
|
|
197
|
-
License: MIT
|
|
198
|
-
Comment: these files belong to: Mobify.js
|
|
199
|
-
|
|
200
195
|
Files: src/sap.ui.core/src/sap/ui/thirdparty/zyngascroll.js
|
|
201
196
|
Copyright: 2011 Zynga Inc.
|
|
202
197
|
License: MIT
|
package/THIRDPARTY.txt
CHANGED
|
@@ -143,12 +143,6 @@ License: MIT
|
|
|
143
143
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
|
|
144
144
|
Contained in: src/sap.ui.core/src/sap/ui/thirdparty/swipe-view.js
|
|
145
145
|
|
|
146
|
-
Component: Mobify.js, version: 1.1
|
|
147
|
-
Copyright: Mobify R&D Inc.
|
|
148
|
-
License: MIT
|
|
149
|
-
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
|
|
150
|
-
Contained in: src/sap.ui.core/src/sap/ui/thirdparty/mobify-carousel.js
|
|
151
|
-
|
|
152
146
|
Component: Zynga Scroller, version: 1.2.1-0-g5d43806
|
|
153
147
|
Copyright: 2011 Zynga Inc.
|
|
154
148
|
License: MIT
|
|
@@ -478,7 +472,7 @@ License: Apache-2.0
|
|
|
478
472
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
479
473
|
Contained in: lib/jsdoc/ui5/plugin.js
|
|
480
474
|
|
|
481
|
-
Component: SAP Theming Base Content, version: 11.
|
|
475
|
+
Component: SAP Theming Base Content, version: 11.3.0
|
|
482
476
|
Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
|
|
483
477
|
License: Apache-2.0
|
|
484
478
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.rta",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.115.0",
|
|
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.
|
|
18
|
-
"@openui5/sap.ui.core": "1.
|
|
19
|
-
"@openui5/sap.ui.dt": "1.
|
|
20
|
-
"@openui5/sap.ui.fl": "1.
|
|
21
|
-
"@openui5/sap.ui.layout": "1.
|
|
17
|
+
"@openui5/sap.m": "1.115.0",
|
|
18
|
+
"@openui5/sap.ui.core": "1.115.0",
|
|
19
|
+
"@openui5/sap.ui.dt": "1.115.0",
|
|
20
|
+
"@openui5/sap.ui.fl": "1.115.0",
|
|
21
|
+
"@openui5/sap.ui.layout": "1.115.0"
|
|
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.
|
|
9
|
+
<version>1.115.0</version>
|
|
10
10
|
|
|
11
11
|
<documentation>SAPUI5 library with RTA controls.</documentation>
|
|
12
12
|
|
package/src/sap/ui/rta/Client.js
CHANGED
|
@@ -15,6 +15,7 @@ sap.ui.define([
|
|
|
15
15
|
"sap/ui/thirdparty/jquery",
|
|
16
16
|
"sap/ui/base/ManagedObject",
|
|
17
17
|
"sap/ui/core/BusyIndicator",
|
|
18
|
+
"sap/ui/core/Core",
|
|
18
19
|
"sap/ui/dt/DesignTime",
|
|
19
20
|
"sap/ui/dt/DOMUtil",
|
|
20
21
|
"sap/ui/dt/ElementUtil",
|
|
@@ -22,6 +23,7 @@ sap.ui.define([
|
|
|
22
23
|
"sap/ui/dt/OverlayRegistry",
|
|
23
24
|
"sap/ui/dt/Util",
|
|
24
25
|
"sap/ui/events/KeyCodes",
|
|
26
|
+
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
25
27
|
"sap/ui/fl/write/api/Version",
|
|
26
28
|
"sap/ui/fl/write/api/ContextBasedAdaptationsAPI",
|
|
27
29
|
"sap/ui/fl/write/api/ControlPersonalizationWriteAPI",
|
|
@@ -62,6 +64,7 @@ sap.ui.define([
|
|
|
62
64
|
jQuery,
|
|
63
65
|
ManagedObject,
|
|
64
66
|
BusyIndicator,
|
|
67
|
+
Core,
|
|
65
68
|
DesignTime,
|
|
66
69
|
DOMUtil,
|
|
67
70
|
ElementUtil,
|
|
@@ -69,6 +72,7 @@ sap.ui.define([
|
|
|
69
72
|
OverlayRegistry,
|
|
70
73
|
DtUtil,
|
|
71
74
|
KeyCodes,
|
|
75
|
+
ManifestUtils,
|
|
72
76
|
Version,
|
|
73
77
|
ContextBasedAdaptationsAPI,
|
|
74
78
|
ControlPersonalizationWriteAPI,
|
|
@@ -116,7 +120,7 @@ sap.ui.define([
|
|
|
116
120
|
* @class The runtime authoring allows to adapt the fields of a running application.
|
|
117
121
|
* @extends sap.ui.base.ManagedObject
|
|
118
122
|
* @author SAP SE
|
|
119
|
-
* @version 1.
|
|
123
|
+
* @version 1.115.0
|
|
120
124
|
* @constructor
|
|
121
125
|
* @private
|
|
122
126
|
* @since 1.30
|
|
@@ -437,6 +441,7 @@ sap.ui.define([
|
|
|
437
441
|
* @public
|
|
438
442
|
*/
|
|
439
443
|
RuntimeAuthoring.prototype.start = function() {
|
|
444
|
+
var bIsAutomaticRestart = RuntimeAuthoring.needsRestart(this.getLayer());
|
|
440
445
|
var oDesignTimePromise;
|
|
441
446
|
var vError;
|
|
442
447
|
// Create DesignTime
|
|
@@ -450,8 +455,8 @@ sap.ui.define([
|
|
|
450
455
|
}
|
|
451
456
|
|
|
452
457
|
return this._loadUShellServicesPromise
|
|
453
|
-
.then(initVersioning.bind(this))
|
|
454
|
-
.then(initContextBasedAdaptations.bind(this))
|
|
458
|
+
.then(initVersioning.bind(this, bIsAutomaticRestart))
|
|
459
|
+
.then(initContextBasedAdaptations.bind(this, bIsAutomaticRestart))
|
|
455
460
|
/*
|
|
456
461
|
Check if the application has personalized changes and reload without them;
|
|
457
462
|
Also Check if the application has an available draft and if yes, reload with those changes.
|
|
@@ -461,7 +466,8 @@ sap.ui.define([
|
|
|
461
466
|
layer: this.getLayer(),
|
|
462
467
|
selector: this.getRootControlInstance(),
|
|
463
468
|
versioningEnabled: this._oVersionsModel.getProperty("/versioningEnabled"),
|
|
464
|
-
developerMode: this.getFlexSettings().developerMode
|
|
469
|
+
developerMode: this.getFlexSettings().developerMode,
|
|
470
|
+
adaptationId: this._oContextBasedAdaptationsModel.getProperty("/displayedAdaptation/id")
|
|
465
471
|
});
|
|
466
472
|
}.bind(this))
|
|
467
473
|
.then(function(bReloadTriggered) {
|
|
@@ -570,7 +576,7 @@ sap.ui.define([
|
|
|
570
576
|
validateFlexEnabled(this);
|
|
571
577
|
}
|
|
572
578
|
this._sStatus = STARTED;
|
|
573
|
-
RuntimeAuthoring.disableRestart(
|
|
579
|
+
RuntimeAuthoring.disableRestart(this.getLayer());
|
|
574
580
|
this.fireStart({
|
|
575
581
|
editablePluginsCount: this.getPluginManager().getEditableOverlaysCount()
|
|
576
582
|
});
|
|
@@ -1029,10 +1035,13 @@ sap.ui.define([
|
|
|
1029
1035
|
var bIsSaveAsAvailable = aRtaFeaturesAvailability[1];
|
|
1030
1036
|
var bIsContextBasedAdaptationAvailable = aRtaFeaturesAvailability[2];
|
|
1031
1037
|
var bIsHomePage = aRtaFeaturesAvailability[3];
|
|
1038
|
+
var oManifest = FlexUtils.getAppDescriptor(oRootControl);
|
|
1039
|
+
//context based adaptation is not supported for overview pages
|
|
1040
|
+
var bIsContextBasedAdaptationSupported = oManifest && !ManifestUtils.getOvpEntry(oManifest);
|
|
1032
1041
|
return {
|
|
1033
1042
|
publishAvailable: bIsPublishAvailable,
|
|
1034
1043
|
saveAsAvailable: !bIsHomePage && bIsPublishAvailable && bIsSaveAsAvailable,
|
|
1035
|
-
contextBasedAdaptationAvailable: !bIsHomePage && bIsContextBasedAdaptationAvailable
|
|
1044
|
+
contextBasedAdaptationAvailable: !bIsHomePage && bIsContextBasedAdaptationSupported && bIsContextBasedAdaptationAvailable
|
|
1036
1045
|
};
|
|
1037
1046
|
});
|
|
1038
1047
|
}
|
|
@@ -1055,33 +1064,30 @@ sap.ui.define([
|
|
|
1055
1064
|
* @returns {Promise} Resolves as soon as the MessageBox is closed
|
|
1056
1065
|
*/
|
|
1057
1066
|
function onStackModified() {
|
|
1058
|
-
var bBackEndDraftExists = this._oVersionsModel.getProperty("/backendDraft");
|
|
1059
|
-
var bDraftDisplayed = this._oVersionsModel.getProperty("/displayedVersion") === Version.Number.Draft;
|
|
1060
1067
|
var oCommandStack = this.getCommandStack();
|
|
1061
1068
|
var bCanUndo = oCommandStack.canUndo();
|
|
1062
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
|
|
1063
1073
|
if (
|
|
1064
1074
|
!this.getShowToolbars() ||
|
|
1065
1075
|
!bCanUndo ||
|
|
1066
|
-
this._bUserDiscardedDraft
|
|
1067
|
-
bDraftDisplayed ||
|
|
1068
|
-
!bBackEndDraftExists
|
|
1076
|
+
this._bUserDiscardedDraft
|
|
1069
1077
|
) {
|
|
1070
|
-
|
|
1078
|
+
modifyStack.call(this);
|
|
1079
|
+
return;
|
|
1071
1080
|
}
|
|
1072
1081
|
|
|
1073
1082
|
// warn the user: the existing draft would be discarded in case the user saves
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
})
|
|
1079
|
-
.then(function(sAction) {
|
|
1080
|
-
if (sAction === MessageBox.Action.OK) {
|
|
1081
|
-
discardDraftConfirmed.call(this);
|
|
1082
|
-
} else {
|
|
1083
|
-
this.undo();
|
|
1083
|
+
Utils.checkDraftOverwrite(this._oVersionsModel)
|
|
1084
|
+
.then(function(bDialogShown) {
|
|
1085
|
+
if (bDialogShown) {
|
|
1086
|
+
this._bUserDiscardedDraft = true;
|
|
1084
1087
|
}
|
|
1088
|
+
modifyStack.call(this);
|
|
1089
|
+
}.bind(this), function() {
|
|
1090
|
+
this.undo();
|
|
1085
1091
|
}.bind(this));
|
|
1086
1092
|
}
|
|
1087
1093
|
|
|
@@ -1203,6 +1209,10 @@ sap.ui.define([
|
|
|
1203
1209
|
// Save changes on the current layer and discard dirty changes on other layers
|
|
1204
1210
|
mPropertyBag.saveAsDraft = this.getLayer() === Layer.CUSTOMER;
|
|
1205
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
|
+
}
|
|
1206
1216
|
|
|
1207
1217
|
return this._oSerializer.saveCommands(mPropertyBag)
|
|
1208
1218
|
.then(function() {
|
|
@@ -1286,50 +1296,125 @@ sap.ui.define([
|
|
|
1286
1296
|
return this.stop(true, true);
|
|
1287
1297
|
}
|
|
1288
1298
|
|
|
1289
|
-
function
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
// already displayed version needs no switch
|
|
1295
|
-
return;
|
|
1299
|
+
function onDeleteAdaptation() {
|
|
1300
|
+
if (this.canSave()) {
|
|
1301
|
+
showDeleteAdaptationMessageBox.call(this, "DAC_DATA_LOSS_DIALOG_DESCRIPTION", "DAC_DIALOG_HEADER", true /*bDirtyChanges*/);
|
|
1302
|
+
} else {
|
|
1303
|
+
showDeleteAdaptationMessageBox.call(this, "DAC_DIALOG_DESCRIPTION", "DAC_DIALOG_HEADER");
|
|
1296
1304
|
}
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
function showDeleteAdaptationMessageBox(sMessageKey, sTitleKey, bDirtyChanges) {
|
|
1308
|
+
Utils.showMessageBox("confirm", sMessageKey, {
|
|
1309
|
+
titleKey: sTitleKey
|
|
1310
|
+
}).then(function(sAction) {
|
|
1311
|
+
if (sAction === MessageBox.Action.OK) {
|
|
1312
|
+
BusyIndicator.show();
|
|
1313
|
+
if (bDirtyChanges) {
|
|
1314
|
+
// a reload is triggered later and will destroy RTA & the command stack
|
|
1315
|
+
this.getCommandStack().removeAllCommands(true);
|
|
1316
|
+
}
|
|
1317
|
+
deleteAdaptation.call(this);
|
|
1318
|
+
}
|
|
1319
|
+
}.bind(this));
|
|
1320
|
+
}
|
|
1297
1321
|
|
|
1322
|
+
function deleteAdaptation() {
|
|
1323
|
+
ContextBasedAdaptationsAPI.remove({
|
|
1324
|
+
control: this.getRootControlInstance(),
|
|
1325
|
+
layer: this.getLayer(),
|
|
1326
|
+
adaptationId: this._oContextBasedAdaptationsModel.getProperty("/displayedAdaptation/id")
|
|
1327
|
+
}).then(function() {
|
|
1328
|
+
BusyIndicator.hide();
|
|
1329
|
+
var sAdaptationId = this._oContextBasedAdaptationsModel.deleteAdaptation();
|
|
1330
|
+
switchAdaptation.call(this, sAdaptationId);
|
|
1331
|
+
}.bind(this)).catch(function(oError) {
|
|
1332
|
+
BusyIndicator.hide();
|
|
1333
|
+
Log.error(oError.stack);
|
|
1334
|
+
var sMessage = "MSG_LREP_TRANSFER_ERROR";
|
|
1335
|
+
var oOptions = { titleKey: "DAC_DIALOG_HEADER" };
|
|
1336
|
+
oOptions.details = oError.userMessage;
|
|
1337
|
+
Utils.showMessageBox("error", sMessage, oOptions);
|
|
1338
|
+
});
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
function handleDataLoss(sMessageKey, sTitleKey, callbackFn) {
|
|
1298
1342
|
if (this.canSave()) {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
titleKey: "TIT_SWITCH_VERSION_DIALOG",
|
|
1343
|
+
Utils.showMessageBox("warning", sMessageKey, {
|
|
1344
|
+
titleKey: sTitleKey,
|
|
1302
1345
|
actions: [MessageBox.Action.YES, MessageBox.Action.NO, MessageBox.Action.CANCEL],
|
|
1303
1346
|
emphasizedAction: MessageBox.Action.YES
|
|
1304
1347
|
}).then(function(sAction) {
|
|
1305
1348
|
if (sAction === MessageBox.Action.YES) {
|
|
1306
|
-
this._serializeToLrep()
|
|
1307
|
-
.then(
|
|
1349
|
+
return this._serializeToLrep()
|
|
1350
|
+
.then(callbackFn);
|
|
1308
1351
|
} else if (sAction === MessageBox.Action.NO) {
|
|
1309
1352
|
// avoids the data loss popup; a reload is triggered later and will destroy RTA & the command stack
|
|
1310
1353
|
this.getCommandStack().removeAllCommands(true);
|
|
1311
|
-
|
|
1354
|
+
return callbackFn();
|
|
1312
1355
|
}
|
|
1313
|
-
return
|
|
1356
|
+
return Promise.resolve();
|
|
1314
1357
|
}.bind(this));
|
|
1358
|
+
return Promise.resolve();
|
|
1359
|
+
}
|
|
1360
|
+
return callbackFn();
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
function onSwitchAdaptation(oEvent) {
|
|
1364
|
+
if (oEvent.getParameter("trigger") === "SaveAs") {
|
|
1365
|
+
// remove all changes from command stack when triggered from saveAs dialog as they are already saved in a new adaptation
|
|
1366
|
+
this.getCommandStack().removeAllCommands(true);
|
|
1367
|
+
}
|
|
1368
|
+
var sAdaptationId = oEvent.getParameter("adaptationId");
|
|
1369
|
+
this._sSwitchToAdaptationId = sAdaptationId;
|
|
1370
|
+
return handleDataLoss.call(this, "MSG_SWITCH_VERSION_DIALOG", "BTN_SWITCH_ADAPTATIONS",
|
|
1371
|
+
switchAdaptation.bind(this, this._sSwitchToAdaptationId))
|
|
1372
|
+
.catch(function(oError) {
|
|
1373
|
+
Utils.showMessageBox("error", "MSG_SWITCH_ADAPTATION_FAILED", {error: oError});
|
|
1374
|
+
Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
|
|
1375
|
+
});
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
function switchAdaptation(sAdaptationId) {
|
|
1379
|
+
var sVersion = this._oVersionsModel.getProperty("/displayedVersion");
|
|
1380
|
+
return switchVersion.call(this, sVersion, sAdaptationId);
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
function onSwitchVersion(oEvent) {
|
|
1384
|
+
var fnCallback = oEvent.getParameter("callback") || function() {};
|
|
1385
|
+
var sVersion = oEvent.getParameter("version");
|
|
1386
|
+
var sDisplayedVersion = this._oVersionsModel.getProperty("/displayedVersion");
|
|
1387
|
+
|
|
1388
|
+
if (sVersion === sDisplayedVersion) {
|
|
1389
|
+
// already displayed version needs no switch
|
|
1315
1390
|
return;
|
|
1316
1391
|
}
|
|
1317
|
-
|
|
1392
|
+
|
|
1393
|
+
this._sSwitchToVersion = sVersion;
|
|
1394
|
+
handleDataLoss.call(this, "MSG_SWITCH_VERSION_DIALOG", "TIT_SWITCH_VERSION_DIALOG",
|
|
1395
|
+
switchVersion.bind(this, this._sSwitchToVersion))
|
|
1396
|
+
.then(fnCallback)
|
|
1397
|
+
.catch(function(oError) {
|
|
1398
|
+
Utils.showMessageBox("error", "MSG_SWITCH_VERSION_FAILED", {error: oError});
|
|
1399
|
+
Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
|
|
1400
|
+
});
|
|
1318
1401
|
}
|
|
1319
1402
|
|
|
1320
|
-
function switchVersion(sVersion) {
|
|
1403
|
+
function switchVersion(sVersion, sAdaptationId) {
|
|
1321
1404
|
RuntimeAuthoring.enableRestart(this.getLayer(), this.getRootControlInstance());
|
|
1322
1405
|
|
|
1323
|
-
VersionsAPI.loadVersionForApplication({
|
|
1406
|
+
return VersionsAPI.loadVersionForApplication({
|
|
1324
1407
|
control: this.getRootControlInstance(),
|
|
1325
1408
|
layer: this.getLayer(),
|
|
1326
|
-
version: sVersion
|
|
1409
|
+
version: sVersion,
|
|
1410
|
+
adaptationId: sAdaptationId
|
|
1411
|
+
}).then(function() {
|
|
1412
|
+
var oReloadInfo = {
|
|
1413
|
+
versionSwitch: true,
|
|
1414
|
+
version: sVersion
|
|
1415
|
+
};
|
|
1416
|
+
ReloadManager.triggerReload(oReloadInfo);
|
|
1327
1417
|
});
|
|
1328
|
-
var oReloadInfo = {
|
|
1329
|
-
versionSwitch: true,
|
|
1330
|
-
version: sVersion
|
|
1331
|
-
};
|
|
1332
|
-
ReloadManager.triggerReload(oReloadInfo);
|
|
1333
1418
|
}
|
|
1334
1419
|
|
|
1335
1420
|
function onPublishVersion() {
|
|
@@ -1348,11 +1433,6 @@ sap.ui.define([
|
|
|
1348
1433
|
});
|
|
1349
1434
|
}
|
|
1350
1435
|
|
|
1351
|
-
function discardDraftConfirmed() {
|
|
1352
|
-
this._bUserDiscardedDraft = true;
|
|
1353
|
-
modifyStack.call(this);
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
1436
|
function isOldVersionDisplayed() {
|
|
1357
1437
|
return VersionsAPI.isOldVersionDisplayed({
|
|
1358
1438
|
control: this.getRootControlInstance(),
|
|
@@ -1367,7 +1447,15 @@ sap.ui.define([
|
|
|
1367
1447
|
});
|
|
1368
1448
|
}
|
|
1369
1449
|
|
|
1370
|
-
|
|
1450
|
+
/**
|
|
1451
|
+
* Inits version models. Clears old state if RTA is starting from end user mode (no switch)
|
|
1452
|
+
* @param {boolean} bIsAutomaticRestart - If true this is not an RTA start but a reload due to version/adaptation switch
|
|
1453
|
+
* @returns {Promise<void>} - Promise
|
|
1454
|
+
*/
|
|
1455
|
+
function initVersioning(bIsAutomaticRestart) {
|
|
1456
|
+
if (!bIsAutomaticRestart) {
|
|
1457
|
+
VersionsAPI.clearInstances();
|
|
1458
|
+
}
|
|
1371
1459
|
return VersionsAPI.initialize({
|
|
1372
1460
|
control: this.getRootControlInstance(),
|
|
1373
1461
|
layer: this.getLayer()
|
|
@@ -1376,7 +1464,15 @@ sap.ui.define([
|
|
|
1376
1464
|
}.bind(this));
|
|
1377
1465
|
}
|
|
1378
1466
|
|
|
1379
|
-
|
|
1467
|
+
/**
|
|
1468
|
+
* Inits CBA models. Clears old state if RTA is starting from end user mode (no switch)
|
|
1469
|
+
* @param {boolean} bIsAutomaticRestart - If true this is not an RTA start but a reload due to version/adaptation switch
|
|
1470
|
+
* @returns {Promise<void>} - Promise
|
|
1471
|
+
*/
|
|
1472
|
+
function initContextBasedAdaptations(bIsAutomaticRestart) {
|
|
1473
|
+
if (!bIsAutomaticRestart) {
|
|
1474
|
+
ContextBasedAdaptationsAPI.clearInstances();
|
|
1475
|
+
}
|
|
1380
1476
|
return ContextBasedAdaptationsAPI.initialize({
|
|
1381
1477
|
control: this.getRootControlInstance(),
|
|
1382
1478
|
layer: this.getLayer()
|
|
@@ -1407,6 +1503,8 @@ sap.ui.define([
|
|
|
1407
1503
|
oProperties.activate = onActivate.bind(this);
|
|
1408
1504
|
oProperties.discardDraft = onDiscardDraft.bind(this);
|
|
1409
1505
|
oProperties.switchVersion = onSwitchVersion.bind(this);
|
|
1506
|
+
oProperties.switchAdaptation = onSwitchAdaptation.bind(this);
|
|
1507
|
+
oProperties.deleteAdaptation = onDeleteAdaptation.bind(this);
|
|
1410
1508
|
oProperties.openChangeCategorySelectionPopover = this.getChangeVisualization
|
|
1411
1509
|
? this.getChangeVisualization().openChangeCategorySelectionPopover.bind(this.getChangeVisualization())
|
|
1412
1510
|
: function() {};
|
|
@@ -1434,6 +1532,7 @@ sap.ui.define([
|
|
|
1434
1532
|
// the "Visualization" tab should not be visible if the "fiori-tools-rta-mode" URL-parameter is set to any value but "false"
|
|
1435
1533
|
var bVisualizationButtonVisible;
|
|
1436
1534
|
bVisualizationButtonVisible = !oUriParameters.has("fiori-tools-rta-mode") || oUriParameters.get("fiori-tools-rta-mode") === "false";
|
|
1535
|
+
var bFeedbackButtonVisible = Core.getConfiguration().getFlexibilityServices()[0].connector !== "LocalStorageConnector";
|
|
1437
1536
|
this.bPersistedDataTranslatable = false;
|
|
1438
1537
|
|
|
1439
1538
|
this._oToolbarControlsModel = new JSONModel({
|
|
@@ -1481,6 +1580,9 @@ sap.ui.define([
|
|
|
1481
1580
|
visualizationButton: {
|
|
1482
1581
|
visible: bVisualizationButtonVisible,
|
|
1483
1582
|
enabled: bVisualizationButtonVisible
|
|
1583
|
+
},
|
|
1584
|
+
feedbackButton: {
|
|
1585
|
+
visible: bFeedbackButtonVisible
|
|
1484
1586
|
}
|
|
1485
1587
|
});
|
|
1486
1588
|
|
|
@@ -1513,7 +1615,7 @@ sap.ui.define([
|
|
|
1513
1615
|
}.bind(this));
|
|
1514
1616
|
|
|
1515
1617
|
this.getToolbar().setModel(this._oVersionsModel, "versions");
|
|
1516
|
-
this.getToolbar().setModel(this._oContextBasedAdaptationsModel, "
|
|
1618
|
+
this.getToolbar().setModel(this._oContextBasedAdaptationsModel, "contextBasedAdaptations");
|
|
1517
1619
|
this.getToolbar().setModel(this._oToolbarControlsModel, "controls");
|
|
1518
1620
|
|
|
1519
1621
|
return Promise.all([oTranslationPromise, oSaveAsPromise]);
|
|
@@ -1676,7 +1778,7 @@ sap.ui.define([
|
|
|
1676
1778
|
if (oError && oError.message && oError.message.indexOf("The following Change cannot be applied because of a dependency") > -1) {
|
|
1677
1779
|
Utils.showMessageBox("error", "MSG_DEPENDENCY_ERROR", {error: oError});
|
|
1678
1780
|
}
|
|
1679
|
-
Log.error("sap.ui.rta:
|
|
1781
|
+
Log.error("sap.ui.rta:", oError.message, oError.stack);
|
|
1680
1782
|
});
|
|
1681
1783
|
}
|
|
1682
1784
|
return undefined;
|
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.
|
|
50
|
+
* @version 1.115.0
|
|
49
51
|
*
|
|
50
52
|
* @private
|
|
51
53
|
* @since 1.30
|
|
@@ -407,7 +409,7 @@ function(
|
|
|
407
409
|
var oRenderer = Utils.getFiori2Renderer();
|
|
408
410
|
return oRenderer
|
|
409
411
|
&& oRenderer.getRootControl
|
|
410
|
-
&& oRenderer.getRootControl().
|
|
412
|
+
&& oRenderer.getRootControl().getShellHeader();
|
|
411
413
|
};
|
|
412
414
|
|
|
413
415
|
/**
|
|
@@ -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);
|
|
@@ -24,7 +24,7 @@ sap.ui.define([
|
|
|
24
24
|
* @class
|
|
25
25
|
* @extends sap.ui.base.ManagedObject
|
|
26
26
|
* @author SAP SE
|
|
27
|
-
* @version 1.
|
|
27
|
+
* @version 1.115.0
|
|
28
28
|
* @constructor
|
|
29
29
|
* @private
|
|
30
30
|
* @since 1.53
|
|
@@ -118,16 +118,17 @@ sap.ui.define([
|
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
aAllInlineChangeOperations.push(oInlineChangePromise);
|
|
121
|
-
|
|
122
|
-
// create a inline change using a change type 'appdescr_app_removeAllInboundsExceptOne'
|
|
123
|
-
oPropertyChange = AppVariantUtils.prepareRemoveAllInboundsExceptOneChange(sCurrentRunningInboundId);
|
|
124
|
-
aAllInlineChangeOperations.push(AppVariantUtils.createInlineChange(oPropertyChange, "appdescr_app_removeAllInboundsExceptOne", vSelector));
|
|
125
121
|
} else {
|
|
126
122
|
// create a inline change using a change type 'appdescr_app_changeInbound'
|
|
127
123
|
oPropertyChange = AppVariantUtils.prepareChangeInboundChange(sCurrentRunningInboundId, sAppVariantId, oAppVariantSpecificData);
|
|
128
124
|
aAllInlineChangeOperations.push(AppVariantUtils.createInlineChange(oPropertyChange, "appdescr_app_changeInbound", vSelector));
|
|
129
125
|
}
|
|
130
126
|
|
|
127
|
+
// remove all other inbounds except appVariant inbound
|
|
128
|
+
// create a inline change using a change type 'appdescr_app_removeAllInboundsExceptOne'
|
|
129
|
+
oPropertyChange = AppVariantUtils.prepareRemoveAllInboundsExceptOneChange(sCurrentRunningInboundId);
|
|
130
|
+
aAllInlineChangeOperations.push(AppVariantUtils.createInlineChange(oPropertyChange, "appdescr_app_removeAllInboundsExceptOne", vSelector));
|
|
131
|
+
|
|
131
132
|
return Promise.all(aAllInlineChangeOperations);
|
|
132
133
|
});
|
|
133
134
|
};
|