@openui5/sap.ui.rta 1.103.0 → 1.105.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 +18 -1
- package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
- package/THIRDPARTY.txt +36 -3
- 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 +83 -406
- package/src/sap/ui/rta/Utils.js +2 -2
- package/src/sap/ui/rta/api/startAdaptation.js +2 -2
- package/src/sap/ui/rta/api/startKeyUserAdaptation.js +2 -2
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +6 -22
- package/src/sap/ui/rta/appVariant/Feature.js +4 -12
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +5 -3
- 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 +8 -3
- 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 -2
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +5 -3
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +5 -4
- 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 +4 -2
- package/src/sap/ui/rta/command/LREPSerializer.js +11 -8
- 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 +3 -3
- 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 +6 -4
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +6 -4
- 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 +15 -11
- package/src/sap/ui/rta/messagebundle_ar.properties +23 -9
- package/src/sap/ui/rta/messagebundle_bg.properties +24 -10
- package/src/sap/ui/rta/messagebundle_ca.properties +24 -10
- package/src/sap/ui/rta/messagebundle_cs.properties +23 -9
- package/src/sap/ui/rta/messagebundle_cy.properties +21 -7
- package/src/sap/ui/rta/messagebundle_da.properties +25 -11
- package/src/sap/ui/rta/messagebundle_de.properties +25 -11
- package/src/sap/ui/rta/messagebundle_el.properties +24 -10
- package/src/sap/ui/rta/messagebundle_en.properties +25 -11
- package/src/sap/ui/rta/messagebundle_en_GB.properties +25 -11
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +18 -11
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +14 -2
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +26 -12
- package/src/sap/ui/rta/messagebundle_es.properties +21 -7
- package/src/sap/ui/rta/messagebundle_es_MX.properties +19 -5
- package/src/sap/ui/rta/messagebundle_et.properties +21 -7
- package/src/sap/ui/rta/messagebundle_fi.properties +25 -11
- package/src/sap/ui/rta/messagebundle_fr.properties +22 -8
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +24 -10
- package/src/sap/ui/rta/messagebundle_hi.properties +24 -10
- package/src/sap/ui/rta/messagebundle_hr.properties +23 -9
- package/src/sap/ui/rta/messagebundle_hu.properties +17 -3
- package/src/sap/ui/rta/messagebundle_id.properties +23 -9
- package/src/sap/ui/rta/messagebundle_it.properties +24 -10
- package/src/sap/ui/rta/messagebundle_iw.properties +24 -10
- package/src/sap/ui/rta/messagebundle_ja.properties +24 -10
- package/src/sap/ui/rta/messagebundle_kk.properties +24 -10
- package/src/sap/ui/rta/messagebundle_ko.properties +24 -10
- package/src/sap/ui/rta/messagebundle_lt.properties +23 -9
- package/src/sap/ui/rta/messagebundle_lv.properties +21 -7
- package/src/sap/ui/rta/messagebundle_ms.properties +25 -11
- package/src/sap/ui/rta/messagebundle_nl.properties +25 -11
- package/src/sap/ui/rta/messagebundle_no.properties +24 -10
- package/src/sap/ui/rta/messagebundle_pl.properties +23 -9
- package/src/sap/ui/rta/messagebundle_pt.properties +24 -10
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +23 -9
- package/src/sap/ui/rta/messagebundle_ro.properties +23 -9
- package/src/sap/ui/rta/messagebundle_ru.properties +24 -10
- package/src/sap/ui/rta/messagebundle_sh.properties +25 -11
- package/src/sap/ui/rta/messagebundle_sk.properties +23 -9
- package/src/sap/ui/rta/messagebundle_sl.properties +21 -7
- package/src/sap/ui/rta/messagebundle_sv.properties +25 -11
- package/src/sap/ui/rta/messagebundle_th.properties +27 -13
- package/src/sap/ui/rta/messagebundle_tr.properties +24 -10
- package/src/sap/ui/rta/messagebundle_uk.properties +25 -11
- package/src/sap/ui/rta/messagebundle_vi.properties +24 -10
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +24 -10
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +23 -9
- 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 +2 -2
- package/src/sap/ui/rta/plugin/ControlVariant.js +21 -15
- 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 +23 -5
- package/src/sap/ui/rta/plugin/Resize.js +1 -1
- package/src/sap/ui/rta/plugin/Selection.js +12 -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 +5 -3
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +5 -5
- 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 +8 -9
- 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/themes/base/Toolbar.adaptation.less +19 -4
- package/src/sap/ui/rta/toolbar/Adaptation.js +6 -4
- package/src/sap/ui/rta/toolbar/Base.js +8 -4
- 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/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 +331 -0
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +14 -8
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +100 -51
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +100 -55
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +41 -106
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/categories/CombineVisualization.js +87 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/MoveVisualization.js +4 -4
- package/src/sap/ui/rta/util/changeVisualization/categories/RenameVisualization.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/categories/SplitVisualization.js +6 -4
- package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +11 -3
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
// Provides class sap.ui.rta.RuntimeAuthoring.
|
|
8
8
|
sap.ui.define([
|
|
9
9
|
"sap/base/strings/capitalize",
|
|
10
|
+
"sap/base/util/isPlainObject",
|
|
10
11
|
"sap/base/util/UriParameters",
|
|
11
12
|
"sap/base/Log",
|
|
12
13
|
"sap/m/MessageBox",
|
|
@@ -22,7 +23,6 @@ sap.ui.define([
|
|
|
22
23
|
"sap/ui/dt/Util",
|
|
23
24
|
"sap/ui/events/KeyCodes",
|
|
24
25
|
"sap/ui/fl/write/api/Version",
|
|
25
|
-
"sap/ui/fl/apply/api/FlexRuntimeInfoAPI",
|
|
26
26
|
"sap/ui/fl/apply/api/SmartVariantManagementApplyAPI",
|
|
27
27
|
"sap/ui/fl/write/api/ControlPersonalizationWriteAPI",
|
|
28
28
|
"sap/ui/fl/write/api/FeaturesAPI",
|
|
@@ -31,7 +31,6 @@ sap.ui.define([
|
|
|
31
31
|
"sap/ui/fl/write/api/VersionsAPI",
|
|
32
32
|
"sap/ui/fl/write/api/TranslationAPI",
|
|
33
33
|
"sap/ui/fl/Layer",
|
|
34
|
-
"sap/ui/fl/LayerUtils",
|
|
35
34
|
"sap/ui/fl/registry/Settings",
|
|
36
35
|
"sap/ui/fl/Utils",
|
|
37
36
|
"sap/ui/model/json/JSONModel",
|
|
@@ -48,12 +47,14 @@ sap.ui.define([
|
|
|
48
47
|
"sap/ui/rta/util/changeVisualization/ChangeVisualization",
|
|
49
48
|
"sap/ui/rta/util/PluginManager",
|
|
50
49
|
"sap/ui/rta/util/PopupManager",
|
|
50
|
+
"sap/ui/rta/util/ReloadManager",
|
|
51
51
|
"sap/ui/rta/util/ServiceEventBus",
|
|
52
52
|
"sap/ui/rta/util/validateFlexEnabled",
|
|
53
53
|
"sap/ui/rta/Utils",
|
|
54
54
|
"sap/ui/Device"
|
|
55
55
|
], function(
|
|
56
56
|
capitalize,
|
|
57
|
+
isPlainObject,
|
|
57
58
|
UriParameters,
|
|
58
59
|
Log,
|
|
59
60
|
MessageBox,
|
|
@@ -69,7 +70,6 @@ sap.ui.define([
|
|
|
69
70
|
DtUtil,
|
|
70
71
|
KeyCodes,
|
|
71
72
|
Version,
|
|
72
|
-
FlexRuntimeInfoAPI,
|
|
73
73
|
SmartVariantManagementApplyAPI,
|
|
74
74
|
ControlPersonalizationWriteAPI,
|
|
75
75
|
FeaturesAPI,
|
|
@@ -78,7 +78,6 @@ sap.ui.define([
|
|
|
78
78
|
VersionsAPI,
|
|
79
79
|
TranslationAPI,
|
|
80
80
|
Layer,
|
|
81
|
-
LayerUtils,
|
|
82
81
|
Settings,
|
|
83
82
|
FlexUtils,
|
|
84
83
|
JSONModel,
|
|
@@ -95,6 +94,7 @@ sap.ui.define([
|
|
|
95
94
|
ChangeVisualization,
|
|
96
95
|
PluginManager,
|
|
97
96
|
PopupManager,
|
|
97
|
+
ReloadManager,
|
|
98
98
|
ServiceEventBus,
|
|
99
99
|
validateFlexEnabled,
|
|
100
100
|
Utils,
|
|
@@ -116,7 +116,7 @@ sap.ui.define([
|
|
|
116
116
|
* @class The runtime authoring allows to adapt the fields of a running application.
|
|
117
117
|
* @extends sap.ui.base.ManagedObject
|
|
118
118
|
* @author SAP SE
|
|
119
|
-
* @version 1.
|
|
119
|
+
* @version 1.105.0
|
|
120
120
|
* @constructor
|
|
121
121
|
* @private
|
|
122
122
|
* @since 1.30
|
|
@@ -240,7 +240,6 @@ sap.ui.define([
|
|
|
240
240
|
|
|
241
241
|
this._dependents = {};
|
|
242
242
|
this._mServices = {};
|
|
243
|
-
this._mCustomServicesDictinary = {};
|
|
244
243
|
this._mUShellServices = {};
|
|
245
244
|
this._pElementModified = Promise.resolve();
|
|
246
245
|
|
|
@@ -262,12 +261,8 @@ sap.ui.define([
|
|
|
262
261
|
this._loadUShellServicesPromise = FlexUtils.getUShellServices(["URLParsing", "AppLifeCycle", "CrossApplicationNavigation"])
|
|
263
262
|
.then(function (mUShellServices) {
|
|
264
263
|
this._mUShellServices = mUShellServices;
|
|
264
|
+
ReloadManager.setUShellServices(mUShellServices);
|
|
265
265
|
}.bind(this));
|
|
266
|
-
},
|
|
267
|
-
_RELOAD: {
|
|
268
|
-
NOT_NEEDED: "NO_RELOAD",
|
|
269
|
-
VIA_HASH: "CROSS_APP_NAVIGATION",
|
|
270
|
-
RELOAD_PAGE: "HARD_RELOAD"
|
|
271
266
|
}
|
|
272
267
|
});
|
|
273
268
|
|
|
@@ -465,15 +460,25 @@ sap.ui.define([
|
|
|
465
460
|
return this._loadUShellServicesPromise
|
|
466
461
|
.then(this._initVersioning.bind(this))
|
|
467
462
|
/*
|
|
468
|
-
|
|
469
|
-
|
|
463
|
+
Check if the application has personalized changes and reload without them;
|
|
464
|
+
Also Check if the application has an available draft and if yes, reload with those changes.
|
|
470
465
|
*/
|
|
471
|
-
.then(
|
|
466
|
+
.then(function() {
|
|
467
|
+
return ReloadManager.handleReloadOnStart({
|
|
468
|
+
layer: this.getLayer(),
|
|
469
|
+
selector: this.getRootControlInstance(),
|
|
470
|
+
versioningEnabled: this._oVersionsModel.getProperty("/versioningEnabled"),
|
|
471
|
+
developerMode: this.getFlexSettings().developerMode
|
|
472
|
+
});
|
|
473
|
+
}.bind(this))
|
|
472
474
|
.then(function(bReloadTriggered) {
|
|
473
475
|
if (bReloadTriggered) {
|
|
474
476
|
// FLP Plugin reacts on this error string and doesn't pass the error on the UI
|
|
475
477
|
return Promise.reject("Reload triggered");
|
|
476
478
|
}
|
|
479
|
+
var oFlexInfoSession = PersistenceWriteAPI.getResetAndPublishInfoFromSession(this.getRootControlInstance());
|
|
480
|
+
this.bInitialResetEnabled = !!oFlexInfoSession.isResetEnabled;
|
|
481
|
+
this.bInitialPublishEnabled = !!oFlexInfoSession.isPublishEnabled;
|
|
477
482
|
|
|
478
483
|
this._oSerializer = new LREPSerializer({commandStack: this.getCommandStack(), rootControl: this.getRootControl()});
|
|
479
484
|
|
|
@@ -778,21 +783,31 @@ sap.ui.define([
|
|
|
778
783
|
*/
|
|
779
784
|
RuntimeAuthoring.prototype.stop = function(bDontSaveChanges, bSkipRestart) {
|
|
780
785
|
this._checkToolbarAndExecuteFunction("setBusy", true);
|
|
786
|
+
var oReloadInfo;
|
|
781
787
|
return waitForPendingActions.call(this)
|
|
782
|
-
.then(
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
.
|
|
787
|
-
this.
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
788
|
+
.then(function() {
|
|
789
|
+
if (bSkipRestart) {
|
|
790
|
+
return {};
|
|
791
|
+
}
|
|
792
|
+
return ReloadManager.checkReloadOnExit({
|
|
793
|
+
layer: this.getLayer(),
|
|
794
|
+
selector: this.getRootControlInstance(),
|
|
795
|
+
isDraftAvailable: this._oVersionsModel.getProperty("/draftAvailable"),
|
|
796
|
+
versioningEnabled: this._oVersionsModel.getProperty("/versioningEnabled"),
|
|
797
|
+
activeVersion: this._oVersionsModel.getProperty("/activeVersion"),
|
|
798
|
+
changesNeedReloadPromise: this._bSavedChangesNeedReload ? Promise.resolve(true) : this._oSerializer.needsReload()
|
|
799
|
+
});
|
|
800
|
+
}.bind(this))
|
|
801
|
+
.then(function(oReturn) {
|
|
802
|
+
oReloadInfo = oReturn;
|
|
803
|
+
return bDontSaveChanges ? Promise.resolve() : this._serializeToLrep(this);
|
|
804
|
+
}.bind(this))
|
|
805
|
+
.then(this._checkToolbarAndExecuteFunction.bind(this, "hide", bDontSaveChanges))
|
|
806
|
+
.then(function() {
|
|
807
|
+
this.fireStop();
|
|
808
|
+
if (!bSkipRestart) {
|
|
809
|
+
ReloadManager.handleUrlParametersOnExit(oReloadInfo);
|
|
810
|
+
}
|
|
796
811
|
}.bind(this))
|
|
797
812
|
.catch(showTechnicalError)
|
|
798
813
|
.then(function () {
|
|
@@ -879,7 +894,7 @@ sap.ui.define([
|
|
|
879
894
|
*/
|
|
880
895
|
RuntimeAuthoring.prototype._onUnload = function() {
|
|
881
896
|
var oCommandStack = this.getCommandStack();
|
|
882
|
-
var bUnsaved = oCommandStack.canUndo()
|
|
897
|
+
var bUnsaved = oCommandStack.canUndo();
|
|
883
898
|
if (bUnsaved && this.getShowWindowUnloadDialog()) {
|
|
884
899
|
return this._getTextResources().getText("MSG_UNSAVED_CHANGES");
|
|
885
900
|
}
|
|
@@ -894,19 +909,27 @@ sap.ui.define([
|
|
|
894
909
|
.then(fnCallback);
|
|
895
910
|
};
|
|
896
911
|
|
|
897
|
-
RuntimeAuthoring.prototype._serializeAndSave = function() {
|
|
912
|
+
RuntimeAuthoring.prototype._serializeAndSave = function(bActivateVersion) {
|
|
898
913
|
if (this.getShowToolbars()) {
|
|
899
914
|
this.bPersistedDataTranslatable = this._oToolbarControlsModel.getProperty("/translationEnabled");
|
|
900
915
|
}
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
916
|
+
var mPropertyBag = {
|
|
917
|
+
// Save changes on the current layer and discard dirty changes on other layers
|
|
918
|
+
saveAsDraft: this._oVersionsModel.getProperty("/versioningEnabled") && this.getLayer() === Layer.CUSTOMER,
|
|
919
|
+
layer: this.getLayer(),
|
|
920
|
+
removeOtherLayerChanges: true,
|
|
921
|
+
version: bActivateVersion ? this._oVersionsModel.getProperty("/displayedVersion") : undefined
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
return this._oSerializer.saveCommands(mPropertyBag);
|
|
904
925
|
};
|
|
905
926
|
|
|
906
927
|
RuntimeAuthoring.prototype._serializeToLrep = function() {
|
|
907
|
-
|
|
928
|
+
// when saving a change that requires a reload, the information has to be cached
|
|
929
|
+
// to do the reload when exiting UI Adaptation as then the change will not be available anymore
|
|
930
|
+
if (!this._bSavedChangesNeedReload) {
|
|
908
931
|
return this._oSerializer.needsReload().then(function(bReloadNeeded) {
|
|
909
|
-
this.
|
|
932
|
+
this._bSavedChangesNeedReload = bReloadNeeded;
|
|
910
933
|
return this._serializeAndSave();
|
|
911
934
|
}.bind(this));
|
|
912
935
|
}
|
|
@@ -943,12 +966,14 @@ sap.ui.define([
|
|
|
943
966
|
RuntimeAuthoring.prototype._activate = function(sVersionTitle) {
|
|
944
967
|
var sLayer = this.getLayer();
|
|
945
968
|
var oSelector = this.getRootControlInstance();
|
|
946
|
-
|
|
969
|
+
var sDisplayedVersion = this._oVersionsModel.getProperty("/displayedVersion");
|
|
970
|
+
return this._serializeAndSave(true)
|
|
947
971
|
.then(function () {
|
|
948
972
|
return VersionsAPI.activate({
|
|
949
973
|
layer: sLayer,
|
|
950
974
|
control: oSelector,
|
|
951
|
-
title: sVersionTitle
|
|
975
|
+
title: sVersionTitle,
|
|
976
|
+
displayedVersion: sDisplayedVersion
|
|
952
977
|
});
|
|
953
978
|
}).then(function () {
|
|
954
979
|
this._showMessageToast("MSG_DRAFT_ACTIVATION_SUCCESS");
|
|
@@ -964,18 +989,12 @@ sap.ui.define([
|
|
|
964
989
|
RuntimeAuthoring.prototype._handleDiscard = function() {
|
|
965
990
|
var sLayer = this.getLayer();
|
|
966
991
|
var oReloadInfo = {
|
|
967
|
-
|
|
968
|
-
|
|
992
|
+
layer: sLayer,
|
|
993
|
+
removeDraft: true
|
|
969
994
|
};
|
|
970
995
|
RuntimeAuthoring.enableRestart(sLayer, this.getRootControlInstance());
|
|
971
|
-
if (!FlexUtils.getUshellContainer()) {
|
|
972
|
-
this.getCommandStack().removeAllCommands();
|
|
973
|
-
return this._triggerHardReload(oReloadInfo);
|
|
974
|
-
}
|
|
975
|
-
var bTriggerReload = true;
|
|
976
996
|
this.getCommandStack().removeAllCommands();
|
|
977
|
-
|
|
978
|
-
this._triggerCrossAppNavigation(mParsedHash);
|
|
997
|
+
ReloadManager.triggerReload(oReloadInfo);
|
|
979
998
|
return this.stop(true, true);
|
|
980
999
|
};
|
|
981
1000
|
|
|
@@ -1031,39 +1050,16 @@ sap.ui.define([
|
|
|
1031
1050
|
RuntimeAuthoring.prototype._switchVersion = function (sVersion) {
|
|
1032
1051
|
RuntimeAuthoring.enableRestart(this.getLayer(), this.getRootControlInstance());
|
|
1033
1052
|
|
|
1034
|
-
if (!FlexUtils.getUshellContainer()) {
|
|
1035
|
-
if (!ReloadInfoAPI.hasVersionParameterWithValue({value: sVersion}, this._getUShellService("URLParsing"))) {
|
|
1036
|
-
var oReloadInfo = {
|
|
1037
|
-
versionSwitch: true,
|
|
1038
|
-
version: sVersion
|
|
1039
|
-
};
|
|
1040
|
-
return this._triggerHardReload(oReloadInfo);
|
|
1041
|
-
}
|
|
1042
|
-
return this._reloadPage();
|
|
1043
|
-
}
|
|
1044
|
-
var mParsedHash = FlexUtils.getParsedURLHash(this._getUShellService("URLParsing"));
|
|
1045
1053
|
VersionsAPI.loadVersionForApplication({
|
|
1046
1054
|
control: this.getRootControlInstance(),
|
|
1047
1055
|
layer: this.getLayer(),
|
|
1048
1056
|
version: sVersion
|
|
1049
1057
|
});
|
|
1050
|
-
var
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
) {
|
|
1056
|
-
// RTA was started with a version parameter, the displayed version has changed and the key user switches back
|
|
1057
|
-
this._getUShellService("AppLifeCycle").reloadCurrentApp();
|
|
1058
|
-
} else {
|
|
1059
|
-
mParsedHash.params[Version.UrlParameter] = sVersion;
|
|
1060
|
-
this._triggerCrossAppNavigation(mParsedHash);
|
|
1061
|
-
}
|
|
1062
|
-
return undefined;
|
|
1063
|
-
};
|
|
1064
|
-
|
|
1065
|
-
RuntimeAuthoring.prototype._setUriParameter = function (sParameters) {
|
|
1066
|
-
document.location.search = sParameters;
|
|
1058
|
+
var oReloadInfo = {
|
|
1059
|
+
versionSwitch: true,
|
|
1060
|
+
version: sVersion
|
|
1061
|
+
};
|
|
1062
|
+
ReloadManager.triggerReload(oReloadInfo);
|
|
1067
1063
|
};
|
|
1068
1064
|
|
|
1069
1065
|
RuntimeAuthoring.prototype._createToolsMenu = function(aButtonsVisibility) {
|
|
@@ -1288,7 +1284,7 @@ sap.ui.define([
|
|
|
1288
1284
|
* the changes for both places will be deleted. For App Variants all the changes are saved in one place.
|
|
1289
1285
|
*
|
|
1290
1286
|
* @private
|
|
1291
|
-
* @returns {Promise} Resolves when change persistence is
|
|
1287
|
+
* @returns {Promise} Resolves when change persistence is reset
|
|
1292
1288
|
*/
|
|
1293
1289
|
RuntimeAuthoring.prototype._deleteChanges = function() {
|
|
1294
1290
|
var sLayer = this.getLayer();
|
|
@@ -1301,12 +1297,11 @@ sap.ui.define([
|
|
|
1301
1297
|
this.getCommandStack().removeAllCommands(true);
|
|
1302
1298
|
ReloadInfoAPI.removeInfoSessionStorage(oSelector);
|
|
1303
1299
|
var oReloadInfo = {
|
|
1304
|
-
isDraftAvailable: ReloadInfoAPI.hasVersionParameterWithValue({value: sLayer}, this._getUShellService("URLParsing")),
|
|
1305
1300
|
layer: sLayer,
|
|
1306
|
-
|
|
1301
|
+
ignoreMaxLayerParameter: true,
|
|
1307
1302
|
triggerHardReload: true
|
|
1308
1303
|
};
|
|
1309
|
-
return
|
|
1304
|
+
return ReloadManager.triggerReload(oReloadInfo);
|
|
1310
1305
|
}.bind(this))
|
|
1311
1306
|
.catch(function (oError) {
|
|
1312
1307
|
if (oError !== "cancel") {
|
|
@@ -1315,14 +1310,6 @@ sap.ui.define([
|
|
|
1315
1310
|
});
|
|
1316
1311
|
};
|
|
1317
1312
|
|
|
1318
|
-
/**
|
|
1319
|
-
* Reloads the page.
|
|
1320
|
-
* @private
|
|
1321
|
-
*/
|
|
1322
|
-
RuntimeAuthoring.prototype._reloadPage = function() {
|
|
1323
|
-
window.location.reload();
|
|
1324
|
-
};
|
|
1325
|
-
|
|
1326
1313
|
/**
|
|
1327
1314
|
* Shows a message toast.
|
|
1328
1315
|
* @param {string} sMessageKey - The text key for the message
|
|
@@ -1344,7 +1331,7 @@ sap.ui.define([
|
|
|
1344
1331
|
* @returns {boolean} Returns true if restart is needed
|
|
1345
1332
|
*/
|
|
1346
1333
|
RuntimeAuthoring.needsRestart = function(sLayer) {
|
|
1347
|
-
return
|
|
1334
|
+
return ReloadManager.needsAutomaticStart(sLayer);
|
|
1348
1335
|
};
|
|
1349
1336
|
|
|
1350
1337
|
/**
|
|
@@ -1357,9 +1344,7 @@ sap.ui.define([
|
|
|
1357
1344
|
* @param {sap.ui.core.Control} oRootControl - Root control for which RTA was started
|
|
1358
1345
|
*/
|
|
1359
1346
|
RuntimeAuthoring.enableRestart = function(sLayer, oRootControl) {
|
|
1360
|
-
|
|
1361
|
-
var vParameter = sFlexReference || true;
|
|
1362
|
-
window.sessionStorage.setItem("sap.ui.rta.restart." + sLayer, vParameter);
|
|
1347
|
+
ReloadManager.enableAutomaticStart(sLayer, oRootControl);
|
|
1363
1348
|
};
|
|
1364
1349
|
|
|
1365
1350
|
/**
|
|
@@ -1370,7 +1355,7 @@ sap.ui.define([
|
|
|
1370
1355
|
* @param {sap.ui.fl.Layer} sLayer - Active layer
|
|
1371
1356
|
*/
|
|
1372
1357
|
RuntimeAuthoring.disableRestart = function(sLayer) {
|
|
1373
|
-
|
|
1358
|
+
ReloadManager.disableAutomaticStart(sLayer);
|
|
1374
1359
|
};
|
|
1375
1360
|
|
|
1376
1361
|
/**
|
|
@@ -1486,7 +1471,7 @@ sap.ui.define([
|
|
|
1486
1471
|
* Function to handle modification of an element
|
|
1487
1472
|
*
|
|
1488
1473
|
* @param {sap.ui.base.Event} oEvent Event object
|
|
1489
|
-
* @returns {Promise} Returns promise that resolves after command was executed
|
|
1474
|
+
* @returns {Promise} Returns promise that resolves after command was executed successfully
|
|
1490
1475
|
* @private
|
|
1491
1476
|
*/
|
|
1492
1477
|
RuntimeAuthoring.prototype._handleElementModified = function(oEvent) {
|
|
@@ -1524,314 +1509,6 @@ sap.ui.define([
|
|
|
1524
1509
|
return this._pElementModified;
|
|
1525
1510
|
};
|
|
1526
1511
|
|
|
1527
|
-
/**
|
|
1528
|
-
* Build the navigation arguments object required to trigger the navigation
|
|
1529
|
-
* using the CrossApplicationNavigation ushell service.
|
|
1530
|
-
*
|
|
1531
|
-
* @param {Object} mParsedHash Parsed URL hash
|
|
1532
|
-
* @return {Object} Returns argument map ("oArg" parameter of the "toExternal" function)
|
|
1533
|
-
*/
|
|
1534
|
-
RuntimeAuthoring.prototype._buildNavigationArguments = function(mParsedHash) {
|
|
1535
|
-
return {
|
|
1536
|
-
target: {
|
|
1537
|
-
semanticObject: mParsedHash.semanticObject,
|
|
1538
|
-
action: mParsedHash.action,
|
|
1539
|
-
context: mParsedHash.contextRaw
|
|
1540
|
-
},
|
|
1541
|
-
params: mParsedHash.params,
|
|
1542
|
-
appSpecificRoute: mParsedHash.appSpecificRoute,
|
|
1543
|
-
writeHistory: false
|
|
1544
|
-
};
|
|
1545
|
-
};
|
|
1546
|
-
|
|
1547
|
-
RuntimeAuthoring.prototype._triggerCrossAppNavigation = function(mParsedHash) {
|
|
1548
|
-
if (
|
|
1549
|
-
(this.getLayer() !== Layer.USER) &&
|
|
1550
|
-
this._getUShellService("CrossApplicationNavigation")
|
|
1551
|
-
) {
|
|
1552
|
-
this._getUShellService("CrossApplicationNavigation")
|
|
1553
|
-
.toExternal(this._buildNavigationArguments(mParsedHash));
|
|
1554
|
-
return true;
|
|
1555
|
-
}
|
|
1556
|
-
return false;
|
|
1557
|
-
};
|
|
1558
|
-
|
|
1559
|
-
RuntimeAuthoring.prototype._removeVersionParameterForFLP = function(oReloadInfo, mParsedHash, bTriggerReload) {
|
|
1560
|
-
var sLayer = this.getLayer();
|
|
1561
|
-
if (sLayer === Layer.USER) {
|
|
1562
|
-
return mParsedHash;
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
var sVersionParameter = FlexUtils.getParameter(Version.UrlParameter, this._getUShellService("URLParsing"));
|
|
1566
|
-
if (sVersionParameter) {
|
|
1567
|
-
delete mParsedHash.params[Version.UrlParameter];
|
|
1568
|
-
} else if (
|
|
1569
|
-
(this._isDraftAvailable() || bTriggerReload /* for discarding of dirty changes */) &&
|
|
1570
|
-
!oReloadInfo.hasHigherLayerChanges &&
|
|
1571
|
-
this._getUShellService("AppLifeCycle")
|
|
1572
|
-
) {
|
|
1573
|
-
// reloading this way only works when we dont have to remove max-layer parameter, see _removeMaxLayerParameterForFLP
|
|
1574
|
-
this._getUShellService("AppLifeCycle").reloadCurrentApp();
|
|
1575
|
-
}
|
|
1576
|
-
return mParsedHash;
|
|
1577
|
-
};
|
|
1578
|
-
|
|
1579
|
-
RuntimeAuthoring.prototype._removeMaxLayerParameterForFLP = function(oReloadInfo, mParsedHash) {
|
|
1580
|
-
// keep max layer parameter when reset was called, remove it on save & exit
|
|
1581
|
-
if (oReloadInfo.deleteMaxLayer && oReloadInfo.hasHigherLayerChanges) {
|
|
1582
|
-
delete mParsedHash.params[LayerUtils.FL_MAX_LAYER_PARAM];
|
|
1583
|
-
}
|
|
1584
|
-
return mParsedHash;
|
|
1585
|
-
};
|
|
1586
|
-
|
|
1587
|
-
/**
|
|
1588
|
-
* Reload the app inside FLP or Standalone by removing max layer / draft parameter;
|
|
1589
|
-
*
|
|
1590
|
-
* @param {boolean} oReloadInfo - Information needed to
|
|
1591
|
-
* @param {boolean} oReloadInfo.deleteMaxLayer - Indicates if the <code>sap-ui-fl-max-layer</code> parameter should be removed or not (reset / exit)
|
|
1592
|
-
* @param {sap.ui.fl.Layer} oReloadInfo.layer - Current layer
|
|
1593
|
-
* @param {boolean} oReloadInfo.hasHigherLayerChanges - Indicates if higher layer changes exist
|
|
1594
|
-
*
|
|
1595
|
-
* @return {map} parsedHash
|
|
1596
|
-
*/
|
|
1597
|
-
RuntimeAuthoring.prototype._handleUrlParameterOnExit = function(oReloadInfo) {
|
|
1598
|
-
if (!FlexUtils.getUshellContainer()) {
|
|
1599
|
-
return this._triggerHardReload(oReloadInfo);
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
var mParsedHash = FlexUtils.getParsedURLHash(this._getUShellService("URLParsing"));
|
|
1603
|
-
if (!mParsedHash) {
|
|
1604
|
-
return undefined;
|
|
1605
|
-
}
|
|
1606
|
-
|
|
1607
|
-
if (oReloadInfo.hasHigherLayerChanges || oReloadInfo.hasVersionUrlParameter) {
|
|
1608
|
-
mParsedHash = this._removeMaxLayerParameterForFLP(oReloadInfo, mParsedHash);
|
|
1609
|
-
mParsedHash = this._removeVersionParameterForFLP(oReloadInfo, mParsedHash, false);
|
|
1610
|
-
this._triggerCrossAppNavigation(mParsedHash);
|
|
1611
|
-
} else {
|
|
1612
|
-
this._getUShellService("AppLifeCycle").reloadCurrentApp();
|
|
1613
|
-
}
|
|
1614
|
-
// In FLP scenario we need to remove all parameters and also trigger an hard reload on reset
|
|
1615
|
-
if (oReloadInfo.triggerHardReload) {
|
|
1616
|
-
this._reloadPage();
|
|
1617
|
-
}
|
|
1618
|
-
return undefined;
|
|
1619
|
-
};
|
|
1620
|
-
|
|
1621
|
-
/**
|
|
1622
|
-
* Returns the correct message - why a reload is needed.
|
|
1623
|
-
*
|
|
1624
|
-
* @param {object} oReloadInfo - Contains the information needed to return the correct reload message
|
|
1625
|
-
* @param {boolean} oReloadInfo.hasHigherLayerChanges - Indicates if higher layer changes exist
|
|
1626
|
-
* @param {boolean} oReloadInfo.isDraftAvailable - Indicates if a draft is available
|
|
1627
|
-
* @param {boolean} oReloadInfo.allContexts - Indicates if a all contexts is visible
|
|
1628
|
-
* @param {sap.ui.fl.Layer} oReloadInfo.layer - Current layer
|
|
1629
|
-
*
|
|
1630
|
-
* @return {string} sReason Reload message
|
|
1631
|
-
*/
|
|
1632
|
-
RuntimeAuthoring.prototype._getReloadMessageOnStart = function(oReloadInfo) {
|
|
1633
|
-
var sReason;
|
|
1634
|
-
var bIsCustomerLayer = oReloadInfo.layer === Layer.CUSTOMER;
|
|
1635
|
-
|
|
1636
|
-
if (oReloadInfo.hasHigherLayerChanges && oReloadInfo.isDraftAvailable) {
|
|
1637
|
-
sReason = bIsCustomerLayer ? "MSG_VIEWS_OR_PERSONALIZATION_AND_DRAFT_EXISTS" : "MSG_HIGHER_LAYER_CHANGES_AND_DRAFT_EXISTS";
|
|
1638
|
-
} else if (oReloadInfo.hasHigherLayerChanges && oReloadInfo.allContexts) {
|
|
1639
|
-
sReason = "MSG_RESTRICTED_CONTEXT_EXIST_AND_PERSONALIZATION";
|
|
1640
|
-
} else if (oReloadInfo.hasHigherLayerChanges) {
|
|
1641
|
-
sReason = bIsCustomerLayer ? "MSG_PERSONALIZATION_OR_PUBLIC_VIEWS_EXISTS" : "MSG_HIGHER_LAYER_CHANGES_EXIST";
|
|
1642
|
-
} else if (oReloadInfo.isDraftAvailable) {
|
|
1643
|
-
sReason = "MSG_DRAFT_EXISTS";
|
|
1644
|
-
} else if (oReloadInfo.allContexts) {
|
|
1645
|
-
sReason = "MSG_RESTRICTED_CONTEXT_EXIST";
|
|
1646
|
-
} // TODO add app descr changes case for start?
|
|
1647
|
-
return sReason;
|
|
1648
|
-
};
|
|
1649
|
-
|
|
1650
|
-
/**
|
|
1651
|
-
* Returns the correct message - why a reload is needed.
|
|
1652
|
-
*
|
|
1653
|
-
* @param {object} oReloadInfo - Contains the information needed to return the correct reload message
|
|
1654
|
-
* @param {boolean} oReloadInfo.hasHigherLayerChanges - Indicates if sap-ui-fl-max-layer parameter is present in the url
|
|
1655
|
-
* @param {boolean} oReloadInfo.isDraftAvailable - Indicates if a draft is available
|
|
1656
|
-
* @param {boolean} oReloadInfo.changesNeedReload - Indicates if app descriptor changes need hard reload
|
|
1657
|
-
* @param {boolean} oReloadInfo.initialDraftGotActivated - Indicates if a draft got activated and had a draft initially when entering UI adaptation
|
|
1658
|
-
* @param {boolean} oReloadInfo.allContexts - Indicates if restricted contexts is visible
|
|
1659
|
-
* @param {sap.ui.fl.Layer} oReloadInfo.layer - Current layer
|
|
1660
|
-
*
|
|
1661
|
-
* @returns {string} sReason Reload message
|
|
1662
|
-
*/
|
|
1663
|
-
RuntimeAuthoring.prototype._getReloadMessageOnExit = function(oReloadInfo) {
|
|
1664
|
-
var bIsCustomerLayer = oReloadInfo.layer === Layer.CUSTOMER;
|
|
1665
|
-
|
|
1666
|
-
if (oReloadInfo.hasHigherLayerChanges) {
|
|
1667
|
-
if (!bIsCustomerLayer) {
|
|
1668
|
-
return "MSG_RELOAD_WITH_ALL_CHANGES";
|
|
1669
|
-
}
|
|
1670
|
-
if (oReloadInfo.isDraftAvailable) {
|
|
1671
|
-
return "MSG_RELOAD_WITH_VIEWS_PERSONALIZATION_AND_WITHOUT_DRAFT";
|
|
1672
|
-
}
|
|
1673
|
-
if (oReloadInfo.allContexts) {
|
|
1674
|
-
return "MSG_RELOAD_WITH_PERSONALIZATION_AND_RESTRICTED_CONTEXT";
|
|
1675
|
-
}
|
|
1676
|
-
return "MSG_RELOAD_WITH_PERSONALIZATION_AND_VIEWS";
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
if (oReloadInfo.initialDraftGotActivated) {
|
|
1680
|
-
return "MSG_RELOAD_ACTIVATED_DRAFT";
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1683
|
-
if (oReloadInfo.isDraftAvailable) {
|
|
1684
|
-
return "MSG_RELOAD_WITHOUT_DRAFT";
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
if (oReloadInfo.changesNeedReload) {
|
|
1688
|
-
return "MSG_RELOAD_NEEDED";
|
|
1689
|
-
}
|
|
1690
|
-
|
|
1691
|
-
if (oReloadInfo.allContexts) {
|
|
1692
|
-
return "MSG_RELOAD_WITHOUT_ALL_CONTEXT";
|
|
1693
|
-
}
|
|
1694
|
-
return undefined;
|
|
1695
|
-
};
|
|
1696
|
-
|
|
1697
|
-
/**
|
|
1698
|
-
* Handler for the message box warning the user that personalization changes exist
|
|
1699
|
-
* and the app will be reloaded
|
|
1700
|
-
*
|
|
1701
|
-
* @param {Object} oReloadReasons Information to determine which message to show
|
|
1702
|
-
* @returns {Promise} Resolving when the user clicks on OK
|
|
1703
|
-
*/
|
|
1704
|
-
RuntimeAuthoring.prototype._handleReloadMessageBoxOnExit = function(oReloadReasons) {
|
|
1705
|
-
var sReason = this._getReloadMessageOnExit(oReloadReasons);
|
|
1706
|
-
|
|
1707
|
-
if (sReason) {
|
|
1708
|
-
return Utils.showMessageBox("information", sReason, {
|
|
1709
|
-
titleKey: "HEADER_RELOAD_NEEDED"
|
|
1710
|
-
});
|
|
1711
|
-
}
|
|
1712
|
-
return Promise.resolve();
|
|
1713
|
-
};
|
|
1714
|
-
|
|
1715
|
-
RuntimeAuthoring.prototype._triggerReloadOnStart = function(oReloadInfo) {
|
|
1716
|
-
if (this._getUShellService("CrossApplicationNavigation") && this._oVersionsModel.getProperty("/versioningEnabled")) {
|
|
1717
|
-
if (oReloadInfo.isDraftAvailable) {
|
|
1718
|
-
// clears FlexState and triggers reloading of the flex data without blocking
|
|
1719
|
-
VersionsAPI.loadDraftForApplication({
|
|
1720
|
-
control: oReloadInfo.selector,
|
|
1721
|
-
layer: oReloadInfo.layer
|
|
1722
|
-
});
|
|
1723
|
-
} else {
|
|
1724
|
-
VersionsAPI.loadVersionForApplication({
|
|
1725
|
-
control: oReloadInfo.selector,
|
|
1726
|
-
layer: oReloadInfo.layer,
|
|
1727
|
-
allContexts: oReloadInfo.allContexts
|
|
1728
|
-
});
|
|
1729
|
-
}
|
|
1730
|
-
}
|
|
1731
|
-
var sReason = this._getReloadMessageOnStart(oReloadInfo);
|
|
1732
|
-
if (!sReason) {
|
|
1733
|
-
return Promise.resolve();
|
|
1734
|
-
}
|
|
1735
|
-
// showing messages in visual editor is leading to blocked screen. In this case we should reload without message
|
|
1736
|
-
return (this.getFlexSettings().developerMode ? Promise.resolve() : Utils.showMessageBox("information", sReason))
|
|
1737
|
-
.then(function() {
|
|
1738
|
-
RuntimeAuthoring.enableRestart(oReloadInfo.layer, this.getRootControlInstance());
|
|
1739
|
-
// allContexts do not change the url parameter to trigger a reload
|
|
1740
|
-
if (
|
|
1741
|
-
oReloadInfo.allContexts &&
|
|
1742
|
-
!oReloadInfo.hasHigherLayerChanges &&
|
|
1743
|
-
!oReloadInfo.isDraftAvailable &&
|
|
1744
|
-
this._getUShellService("AppLifeCycle")
|
|
1745
|
-
) {
|
|
1746
|
-
this._getUShellService("AppLifeCycle").reloadCurrentApp();
|
|
1747
|
-
}
|
|
1748
|
-
if (FlexUtils.getUshellContainer()) {
|
|
1749
|
-
// clears FlexState and triggers reloading of the flex data without blocking
|
|
1750
|
-
var oParsedHash = ReloadInfoAPI.handleParametersOnStart(oReloadInfo);
|
|
1751
|
-
return this._triggerCrossAppNavigation(oParsedHash);
|
|
1752
|
-
}
|
|
1753
|
-
return this._triggerHardReload(oReloadInfo);
|
|
1754
|
-
}.bind(this));
|
|
1755
|
-
};
|
|
1756
|
-
|
|
1757
|
-
/**
|
|
1758
|
-
* Check if there are personalization changes/draft changes and restart the application without/with them;
|
|
1759
|
-
* Warn the user that the application will be restarted without personalization / with draft changes;
|
|
1760
|
-
* Check if it is neccessary to load all contexts
|
|
1761
|
-
* This is only valid when a UShell is present;
|
|
1762
|
-
*
|
|
1763
|
-
* @return {Promise<boolean>} Resolving to false means that reload is not necessary
|
|
1764
|
-
*/
|
|
1765
|
-
RuntimeAuthoring.prototype._determineReload = function() {
|
|
1766
|
-
var oReloadInfo = {
|
|
1767
|
-
hasHigherLayerChanges: false,
|
|
1768
|
-
isDraftAvailable: false,
|
|
1769
|
-
layer: this.getLayer(),
|
|
1770
|
-
selector: this.getRootControlInstance(),
|
|
1771
|
-
ignoreMaxLayerParameter: false,
|
|
1772
|
-
includeCtrlVariants: true,
|
|
1773
|
-
URLParsingService: this._getUShellService("URLParsing")
|
|
1774
|
-
};
|
|
1775
|
-
return ReloadInfoAPI.getReloadReasonsForStart(oReloadInfo)
|
|
1776
|
-
.then(function (oReloadInfo) {
|
|
1777
|
-
var oFlexInfoSession = PersistenceWriteAPI.getResetAndPublishInfoFromSession(oReloadInfo.selector);
|
|
1778
|
-
this.bInitialResetEnabled = !!oFlexInfoSession.isResetEnabled;
|
|
1779
|
-
this.bInitialPublishEnabled = !!oFlexInfoSession.isPublishEnabled;
|
|
1780
|
-
if (oReloadInfo.hasHigherLayerChanges || oReloadInfo.isDraftAvailable || oReloadInfo.allContexts) {
|
|
1781
|
-
return this._triggerReloadOnStart(oReloadInfo);
|
|
1782
|
-
}
|
|
1783
|
-
return undefined;
|
|
1784
|
-
}.bind(this));
|
|
1785
|
-
};
|
|
1786
|
-
|
|
1787
|
-
/**
|
|
1788
|
-
* Change URL parameters if necessary, which will trigger an reload;
|
|
1789
|
-
* This function must only be called outside of the ushell.
|
|
1790
|
-
*
|
|
1791
|
-
* @param {Object} oReloadInfo - Information to determine reload is needed
|
|
1792
|
-
* @returns {Promise} Resolves when page reload is triggered
|
|
1793
|
-
*/
|
|
1794
|
-
RuntimeAuthoring.prototype._triggerHardReload = function(oReloadInfo) {
|
|
1795
|
-
oReloadInfo.parameters = document.location.search;
|
|
1796
|
-
oReloadInfo.URLParsingService = this._getUShellService("URLParsing");
|
|
1797
|
-
var sParameters = ReloadInfoAPI.handleUrlParametersForStandalone(oReloadInfo);
|
|
1798
|
-
if (document.location.search !== sParameters) {
|
|
1799
|
-
this._setUriParameter(sParameters);
|
|
1800
|
-
return Promise.resolve();
|
|
1801
|
-
}
|
|
1802
|
-
return this._reloadPage();
|
|
1803
|
-
};
|
|
1804
|
-
|
|
1805
|
-
/**
|
|
1806
|
-
* When exiting RTA and personalization changes exist, the user can choose to
|
|
1807
|
-
* reload the app with personalization or stay in the app without the personalization
|
|
1808
|
-
* @param {boolean} bSkipRestart - Stop RTA without reloading the app in any way
|
|
1809
|
-
*
|
|
1810
|
-
* @return {Promise<object>} Resolving to an object containing information about if an reload is needed and how to handle it
|
|
1811
|
-
*/
|
|
1812
|
-
RuntimeAuthoring.prototype._handleReloadOnExit = function(bSkipRestart) {
|
|
1813
|
-
if (bSkipRestart) {
|
|
1814
|
-
return Promise.resolve({reloadMethod: this._RELOAD.NOT_NEEDED});
|
|
1815
|
-
}
|
|
1816
|
-
|
|
1817
|
-
var oReloadPromise = this._bReloadNeeded ? Promise.resolve(this._bReloadNeeded) : this._oSerializer.needsReload();
|
|
1818
|
-
return oReloadPromise.then(function (bChangesNeedReload) {
|
|
1819
|
-
var oReloadInfo = {
|
|
1820
|
-
layer: this.getLayer(),
|
|
1821
|
-
selector: this.getRootControlInstance(),
|
|
1822
|
-
changesNeedReload: bChangesNeedReload,
|
|
1823
|
-
isDraftAvailable: this._oVersionsModel.getProperty("/draftAvailable"),
|
|
1824
|
-
versioningEnabled: this._oVersionsModel.getProperty("/versioningEnabled"),
|
|
1825
|
-
activeVersion: this._oVersionsModel.getProperty("/activeVersion"),
|
|
1826
|
-
URLParsingService: this._getUShellService("URLParsing")
|
|
1827
|
-
};
|
|
1828
|
-
oReloadInfo = ReloadInfoAPI.getReloadMethod(oReloadInfo);
|
|
1829
|
-
return this._handleReloadMessageBoxOnExit(oReloadInfo).then(function () {
|
|
1830
|
-
return oReloadInfo;
|
|
1831
|
-
});
|
|
1832
|
-
}.bind(this));
|
|
1833
|
-
};
|
|
1834
|
-
|
|
1835
1512
|
RuntimeAuthoring.prototype._onModeChange = function(oEvent) {
|
|
1836
1513
|
this.setMode(oEvent.getParameter("item").getKey());
|
|
1837
1514
|
};
|
|
@@ -1850,7 +1527,7 @@ sap.ui.define([
|
|
|
1850
1527
|
var oTabHandlingPlugin = this.getPluginManager().getPlugin("tabHandling");
|
|
1851
1528
|
var oSelectionPlugin = this.getPluginManager().getPlugin("selection");
|
|
1852
1529
|
|
|
1853
|
-
// Switch between another mode and navigation -> toggle overlay & App-
|
|
1530
|
+
// Switch between another mode and navigation -> toggle overlay & App-TabIndex enablement
|
|
1854
1531
|
if (sCurrentMode === "navigation" || sNewMode === "navigation") {
|
|
1855
1532
|
this._oDesignTime.setEnabled(sNewMode !== "navigation");
|
|
1856
1533
|
oTabHandlingPlugin[(sNewMode === "navigation") ? "restoreTabIndex" : "removeTabIndex"]();
|
|
@@ -1882,7 +1559,7 @@ sap.ui.define([
|
|
|
1882
1559
|
*/
|
|
1883
1560
|
RuntimeAuthoring.prototype.setMetadataScope = function (sScope) {
|
|
1884
1561
|
// We do not support scope change after creation of DesignTime instance
|
|
1885
|
-
// as this requires
|
|
1562
|
+
// as this requires re-initialization of all overlays
|
|
1886
1563
|
if (this._sStatus !== STOPPED) {
|
|
1887
1564
|
Log.error("sap.ui.rta: Failed to set metadata scope on RTA instance after RTA is started");
|
|
1888
1565
|
return;
|
|
@@ -1982,14 +1659,14 @@ sap.ui.define([
|
|
|
1982
1659
|
if (this.bIsDestroyed) {
|
|
1983
1660
|
throw DtUtil.createError(
|
|
1984
1661
|
"RuntimeAuthoring#startService",
|
|
1985
|
-
DtUtil.printf("RuntimeAuthoring instance is destroyed while
|
|
1662
|
+
DtUtil.printf("RuntimeAuthoring instance is destroyed while initializing the service '{0}'", sName),
|
|
1986
1663
|
"sap.ui.rta"
|
|
1987
1664
|
);
|
|
1988
1665
|
}
|
|
1989
|
-
if (!
|
|
1666
|
+
if (!isPlainObject(oService)) {
|
|
1990
1667
|
throw DtUtil.createError(
|
|
1991
1668
|
"RuntimeAuthoring#startService",
|
|
1992
|
-
DtUtil.printf("Invalid service format. Service should return simple javascript object after
|
|
1669
|
+
DtUtil.printf("Invalid service format. Service should return simple javascript object after initialization. Service name = '{0}'", sName),
|
|
1993
1670
|
"sap.ui.rta"
|
|
1994
1671
|
);
|
|
1995
1672
|
}
|
|
@@ -2043,7 +1720,7 @@ sap.ui.define([
|
|
|
2043
1720
|
DtUtil.propagateError(
|
|
2044
1721
|
vError,
|
|
2045
1722
|
"RuntimeAuthoring#startService",
|
|
2046
|
-
DtUtil.printf("Error during service '{0}'
|
|
1723
|
+
DtUtil.printf("Error during service '{0}' initialization.", sName),
|
|
2047
1724
|
"sap.ui.rta"
|
|
2048
1725
|
)
|
|
2049
1726
|
);
|