@openui5/sap.ui.rta 1.115.1 → 1.117.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/.eslintrc.json +33 -2
- 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 +60 -59
- package/src/sap/ui/rta/RuntimeAuthoring.js +256 -254
- package/src/sap/ui/rta/Utils.js +42 -42
- package/src/sap/ui/rta/api/startAdaptation.js +2 -2
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +3 -3
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +27 -27
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +100 -103
- package/src/sap/ui/rta/appVariant/Feature.js +75 -77
- package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +6 -7
- package/src/sap/ui/rta/appVariant/Utils.js +17 -17
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +36 -36
- package/src/sap/ui/rta/command/AddIFrame.js +7 -7
- package/src/sap/ui/rta/command/AddProperty.js +7 -7
- package/src/sap/ui/rta/command/AddXML.js +1 -1
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +7 -7
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +18 -18
- package/src/sap/ui/rta/command/BaseCommand.js +1 -2
- 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 +11 -11
- package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +28 -3
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +26 -24
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +7 -7
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +11 -11
- package/src/sap/ui/rta/command/CreateContainer.js +2 -2
- package/src/sap/ui/rta/command/CustomAdd.js +1 -1
- package/src/sap/ui/rta/command/FlexCommand.js +30 -30
- package/src/sap/ui/rta/command/LREPSerializer.js +20 -10
- 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 +4 -4
- 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/TestDelegate.js +92 -92
- package/src/sap/ui/rta/enablement/elementActionTest.js +230 -112
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +11 -1
- package/src/sap/ui/rta/messagebundle_ar.properties +5 -0
- package/src/sap/ui/rta/messagebundle_bg.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ca.properties +5 -0
- package/src/sap/ui/rta/messagebundle_cs.properties +5 -0
- package/src/sap/ui/rta/messagebundle_cy.properties +5 -0
- package/src/sap/ui/rta/messagebundle_da.properties +5 -0
- package/src/sap/ui/rta/messagebundle_de.properties +6 -1
- package/src/sap/ui/rta/messagebundle_el.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_GB.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
- package/src/sap/ui/rta/messagebundle_es.properties +5 -0
- package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -0
- package/src/sap/ui/rta/messagebundle_et.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hu.properties +5 -0
- package/src/sap/ui/rta/messagebundle_id.properties +5 -0
- package/src/sap/ui/rta/messagebundle_it.properties +5 -0
- package/src/sap/ui/rta/messagebundle_iw.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ja.properties +5 -0
- package/src/sap/ui/rta/messagebundle_kk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ko.properties +5 -0
- package/src/sap/ui/rta/messagebundle_lt.properties +5 -0
- package/src/sap/ui/rta/messagebundle_lv.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ms.properties +5 -0
- package/src/sap/ui/rta/messagebundle_nl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_no.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pt.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ro.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ru.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sh.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sv.properties +5 -0
- package/src/sap/ui/rta/messagebundle_th.properties +5 -0
- package/src/sap/ui/rta/messagebundle_tr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_uk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_vi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -0
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +5 -0
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +44 -44
- package/src/sap/ui/rta/plugin/BaseCreate.js +29 -29
- package/src/sap/ui/rta/plugin/Combine.js +9 -9
- package/src/sap/ui/rta/plugin/ControlVariant.js +21 -21
- package/src/sap/ui/rta/plugin/CreateContainer.js +6 -6
- package/src/sap/ui/rta/plugin/CutPaste.js +46 -46
- package/src/sap/ui/rta/plugin/DragDrop.js +2 -2
- package/src/sap/ui/rta/plugin/EasyAdd.js +4 -4
- package/src/sap/ui/rta/plugin/EasyRemove.js +5 -5
- package/src/sap/ui/rta/plugin/LocalReset.js +25 -25
- package/src/sap/ui/rta/plugin/Plugin.js +20 -20
- package/src/sap/ui/rta/plugin/RTAElementMover.js +42 -42
- package/src/sap/ui/rta/plugin/Remove.js +11 -11
- package/src/sap/ui/rta/plugin/Rename.js +7 -7
- package/src/sap/ui/rta/plugin/RenameHandler.js +17 -17
- package/src/sap/ui/rta/plugin/Resize.js +62 -62
- package/src/sap/ui/rta/plugin/Selection.js +14 -14
- package/src/sap/ui/rta/plugin/Settings.js +20 -20
- package/src/sap/ui/rta/plugin/Split.js +7 -7
- package/src/sap/ui/rta/plugin/Stretch.js +4 -4
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +94 -87
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +18 -18
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +98 -99
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +144 -144
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +3 -4
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +67 -67
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +38 -39
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +1 -0
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +29 -29
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +5 -5
- package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
- package/src/sap/ui/rta/service/Action.js +36 -37
- package/src/sap/ui/rta/service/ControllerExtension.js +4 -4
- package/src/sap/ui/rta/service/Outline.js +59 -59
- package/src/sap/ui/rta/service/Property.js +125 -125
- package/src/sap/ui/rta/service/Receiver.js +78 -77
- package/src/sap/ui/rta/service/Selection.js +6 -6
- package/src/sap/ui/rta/service/SupportTools.js +188 -37
- package/src/sap/ui/rta/service/index.js +1 -1
- package/src/sap/ui/rta/themes/base/FlexSupportExtension.less +14 -0
- package/src/sap/ui/rta/themes/base/library.source.less +2 -1
- package/src/sap/ui/rta/toolbar/Adaptation.js +81 -26
- package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
- package/src/sap/ui/rta/toolbar/Base.js +17 -15
- package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -2
- package/src/sap/ui/rta/toolbar/Fiori.js +8 -8
- package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +4 -4
- package/src/sap/ui/rta/toolbar/Personalization.js +2 -2
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +13 -6
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +2 -8
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +2 -3
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptationDialog.fragment.xml +0 -2
- package/src/sap/ui/rta/toolbar/translation/Translation.js +41 -41
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +9 -9
- package/src/sap/ui/rta/util/Animation.js +5 -5
- package/src/sap/ui/rta/util/BindingsExtractor.js +33 -33
- package/src/sap/ui/rta/util/PluginManager.js +25 -25
- package/src/sap/ui/rta/util/PopupManager.js +27 -27
- package/src/sap/ui/rta/util/ReloadManager.js +1 -1
- package/src/sap/ui/rta/util/ServiceEventBus.js +3 -4
- package/src/sap/ui/rta/util/StylesLoader.js +9 -9
- package/src/sap/ui/rta/util/UrlParser.js +19 -19
- package/src/sap/ui/rta/util/adaptationStarter.js +34 -31
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +23 -19
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +61 -61
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +76 -63
- package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +6 -6
- package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
- package/src/sap/ui/rta/util/hasStableId.js +2 -2
- package/src/sap/ui/rta/util/showMessageBox.js +4 -5
- package/src/sap/ui/rta/util/validateFlexEnabled.js +5 -5
- package/src/sap/ui/rta/util/validateStableIds.js +8 -8
- package/ui5.yaml +1 -1
|
@@ -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.
|
|
123
|
+
* @version 1.117.0
|
|
124
124
|
* @constructor
|
|
125
125
|
* @private
|
|
126
126
|
* @since 1.30
|
|
@@ -219,7 +219,7 @@ sap.ui.define([
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
},
|
|
222
|
-
/**Event fired when the runtime authoring mode is changed */
|
|
222
|
+
/** Event fired when the runtime authoring mode is changed */
|
|
223
223
|
modeChanged: {},
|
|
224
224
|
|
|
225
225
|
/**
|
|
@@ -258,10 +258,10 @@ sap.ui.define([
|
|
|
258
258
|
this.startService("supportTools");
|
|
259
259
|
|
|
260
260
|
this._loadUShellServicesPromise = FlexUtils.getUShellServices(["URLParsing", "AppLifeCycle", "CrossApplicationNavigation"])
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
261
|
+
.then(function(mUShellServices) {
|
|
262
|
+
this._mUShellServices = mUShellServices;
|
|
263
|
+
ReloadManager.setUShellServices(mUShellServices);
|
|
264
|
+
}.bind(this));
|
|
265
265
|
}
|
|
266
266
|
});
|
|
267
267
|
|
|
@@ -455,7 +455,7 @@ sap.ui.define([
|
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
return this._loadUShellServicesPromise
|
|
458
|
-
.then(initVersioning.bind(this
|
|
458
|
+
.then(initVersioning.bind(this))
|
|
459
459
|
.then(initContextBasedAdaptations.bind(this, bIsAutomaticRestart))
|
|
460
460
|
/*
|
|
461
461
|
Check if the application has personalized changes and reload without them;
|
|
@@ -497,10 +497,10 @@ sap.ui.define([
|
|
|
497
497
|
|
|
498
498
|
addOrRemoveStyleClass(this.getRootControlInstance(), true);
|
|
499
499
|
|
|
500
|
-
//add root control is triggering overlay creation, so we need to wait for the scope to be set.
|
|
500
|
+
// add root control is triggering overlay creation, so we need to wait for the scope to be set.
|
|
501
501
|
this._oDesignTime.addRootElement(this._oRootControl);
|
|
502
502
|
|
|
503
|
-
//TODO: remove when Overlay.getOverlayContainer() does not return jQuery any more
|
|
503
|
+
// TODO: remove when Overlay.getOverlayContainer() does not return jQuery any more
|
|
504
504
|
Overlay.getOverlayContainer().get(0).classList.add("sapUiRta");
|
|
505
505
|
if (this.getLayer() === Layer.USER) {
|
|
506
506
|
Overlay.getOverlayContainer().get(0).classList.add("sapUiRtaPersonalize");
|
|
@@ -531,14 +531,14 @@ sap.ui.define([
|
|
|
531
531
|
if (this.getShowToolbars()) {
|
|
532
532
|
// Create ToolsMenu
|
|
533
533
|
return getToolbarButtonsVisibility(this.getRootControlInstance(), this.getLayer(), this._oSerializer)
|
|
534
|
-
|
|
534
|
+
.then(createToolsMenu.bind(this));
|
|
535
535
|
}
|
|
536
536
|
return undefined;
|
|
537
537
|
}.bind(this))
|
|
538
538
|
// this is needed to initially check if undo is available, e.g. when the stack gets initialized with changes
|
|
539
539
|
.then(onStackModified.bind(this))
|
|
540
540
|
.then(function() {
|
|
541
|
-
//Resolve the CSS variable set in themes/base/OverlayWithScrollbar.css
|
|
541
|
+
// Resolve the CSS variable set in themes/base/OverlayWithScrollbar.css
|
|
542
542
|
Overlay.getOverlayContainer().get(0).style.setProperty("--sap-ui-rta-scrollbar-scrollWidth", DOMUtil.getScrollbarWidth() + "px");
|
|
543
543
|
Overlay.getOverlayContainer().get(0).style.setProperty("--sap-ui-rta-scrollbar-scrollWidthPlusTwo", DOMUtil.getScrollbarWidth() + 2 + "px");
|
|
544
544
|
return oDesignTimePromise;
|
|
@@ -623,65 +623,66 @@ sap.ui.define([
|
|
|
623
623
|
var oReloadInfo;
|
|
624
624
|
checkToolbarAndExecuteFunction.call(this, "setBusy", true);
|
|
625
625
|
return waitForPendingActions.call(this)
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
}
|
|
626
|
+
.then(function() {
|
|
627
|
+
var sLayer = this.getLayer();
|
|
628
|
+
if (sLayer !== Layer.USER && !bSkipSave && this.canSave()) {
|
|
629
|
+
return showSaveConfirmation.call(this)
|
|
630
|
+
.then(function(sAction) {
|
|
631
|
+
if (sAction === MessageBox.Action.CANCEL) {
|
|
632
|
+
bUserCancelled = true;
|
|
633
|
+
return Promise.reject();
|
|
634
|
+
}
|
|
635
|
+
if (sAction === this._getTextResources().getText("BTN_UNSAVED_CHANGES_ON_CLOSE_DONT_SAVE")) {
|
|
636
|
+
return this._oSerializer.clearCommandStack(/* bRemoveChanges = */true);
|
|
637
|
+
}
|
|
638
|
+
return undefined;
|
|
639
|
+
}.bind(this));
|
|
640
|
+
}
|
|
641
|
+
return undefined;
|
|
642
|
+
}.bind(this))
|
|
643
|
+
.then(function() {
|
|
644
|
+
if (bSkipRestart) {
|
|
645
|
+
return {};
|
|
646
|
+
}
|
|
647
|
+
// Reload check must happen before _serializeToLrep is called
|
|
648
|
+
return ReloadManager.checkReloadOnExit({
|
|
649
|
+
layer: this.getLayer(),
|
|
650
|
+
selector: this.getRootControlInstance(),
|
|
651
|
+
isDraftAvailable: this._oVersionsModel.getProperty("/draftAvailable"),
|
|
652
|
+
versioningEnabled: this._oVersionsModel.getProperty("/versioningEnabled"),
|
|
653
|
+
activeVersion: this._oVersionsModel.getProperty("/activeVersion"),
|
|
654
|
+
changesNeedReloadPromise: this._bSavedChangesNeedReload ? Promise.resolve(true) : this._oSerializer.needsReload()
|
|
655
|
+
});
|
|
656
|
+
}.bind(this))
|
|
657
|
+
.then(function(oReturn) {
|
|
658
|
+
oReloadInfo = oReturn;
|
|
659
|
+
if (!bSkipSave) {
|
|
660
|
+
// serializeToLrep has to be called on exit even when no changes were made -> to invalidate cache
|
|
661
|
+
return this._serializeToLrep(/* bCondenseAnyLayer= */false, /* bIsExit= */true);
|
|
662
|
+
}
|
|
663
|
+
return undefined;
|
|
664
|
+
}.bind(this))
|
|
665
|
+
.then(function() {
|
|
666
|
+
checkToolbarAndExecuteFunction.call(this, "hide", bSkipSave);
|
|
667
|
+
this.fireStop();
|
|
668
|
+
if (!bSkipRestart) {
|
|
669
|
+
ReloadManager.handleUrlParametersOnExit(oReloadInfo);
|
|
670
|
+
}
|
|
671
|
+
VersionsAPI.clearInstances();
|
|
672
|
+
}.bind(this))
|
|
673
|
+
.catch(function(vError) {
|
|
674
|
+
if (!bUserCancelled) {
|
|
675
|
+
return showTechnicalError(vError);
|
|
676
|
+
}
|
|
677
|
+
return undefined;
|
|
678
|
+
})
|
|
679
|
+
.then(function() {
|
|
680
|
+
checkToolbarAndExecuteFunction.call(this, "setBusy", false);
|
|
681
|
+
if (!bUserCancelled) {
|
|
682
|
+
this._sStatus = STOPPED;
|
|
683
|
+
document.body.classList.remove("sapUiRtaMode");
|
|
684
|
+
}
|
|
685
|
+
}.bind(this));
|
|
685
686
|
};
|
|
686
687
|
|
|
687
688
|
/**
|
|
@@ -743,9 +744,9 @@ sap.ui.define([
|
|
|
743
744
|
var oChangeVisualization = this.getChangeVisualization && this.getChangeVisualization();
|
|
744
745
|
if (sNewMode === "visualization" || sCurrentMode === "visualization") {
|
|
745
746
|
DtUtil.waitForSynced(this._oDesignTime)()
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
747
|
+
.then(function() {
|
|
748
|
+
return oChangeVisualization.triggerModeChange(this.getRootControl(), this.getToolbar());
|
|
749
|
+
}.bind(this));
|
|
749
750
|
}
|
|
750
751
|
|
|
751
752
|
if (sCurrentMode === "adaptation") {
|
|
@@ -906,7 +907,7 @@ sap.ui.define([
|
|
|
906
907
|
|
|
907
908
|
RuntimeAuthoring.prototype.save = function() {
|
|
908
909
|
return waitForPendingActions.call(this)
|
|
909
|
-
|
|
910
|
+
.then(this._serializeToLrep.bind(this));
|
|
910
911
|
};
|
|
911
912
|
|
|
912
913
|
// ---- API ----
|
|
@@ -956,9 +957,9 @@ sap.ui.define([
|
|
|
956
957
|
function shouldValidateFlexEnabled() {
|
|
957
958
|
var sUriParam = UriParameters.fromQuery(window.location.search).get("sap-ui-rta-skip-flex-validation");
|
|
958
959
|
return Settings.getInstance()
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
960
|
+
.then(function(oSettings) {
|
|
961
|
+
return !oSettings.isCustomerSystem() && sUriParam !== "true";
|
|
962
|
+
});
|
|
962
963
|
}
|
|
963
964
|
|
|
964
965
|
function onPopupOpen(oEvent) {
|
|
@@ -1036,7 +1037,7 @@ sap.ui.define([
|
|
|
1036
1037
|
var bIsContextBasedAdaptationAvailable = aRtaFeaturesAvailability[2];
|
|
1037
1038
|
var bIsHomePage = aRtaFeaturesAvailability[3];
|
|
1038
1039
|
var oManifest = FlexUtils.getAppDescriptor(oRootControl);
|
|
1039
|
-
//context based adaptation is not supported for overview pages
|
|
1040
|
+
// context based adaptation is not supported for overview pages
|
|
1040
1041
|
var bIsContextBasedAdaptationSupported = oManifest && !ManifestUtils.getOvpEntry(oManifest);
|
|
1041
1042
|
return {
|
|
1042
1043
|
publishAvailable: bIsPublishAvailable,
|
|
@@ -1121,9 +1122,9 @@ sap.ui.define([
|
|
|
1121
1122
|
|
|
1122
1123
|
function waitForPendingActions() {
|
|
1123
1124
|
return Promise.resolve(this._oDesignTime && this._oDesignTime.waitForBusyPlugins())
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1125
|
+
.then(function() {
|
|
1126
|
+
return this._pElementModified;
|
|
1127
|
+
}.bind(this));
|
|
1127
1128
|
}
|
|
1128
1129
|
|
|
1129
1130
|
function onKeyDown(oEvent) {
|
|
@@ -1173,17 +1174,17 @@ sap.ui.define([
|
|
|
1173
1174
|
var fnCallback = oEvent.getParameter("callback") || function() {};
|
|
1174
1175
|
var bVersionsEnabled = this._oVersionsModel.getProperty("/versioningEnabled");
|
|
1175
1176
|
return this.save()
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1177
|
+
.then(function() {
|
|
1178
|
+
showMessageToast.call(
|
|
1179
|
+
this,
|
|
1180
|
+
bVersionsEnabled ? "MSG_SAVE_DRAFT_SUCCESS" : "MSG_SAVE_SUCCESS",
|
|
1181
|
+
{ duration: 5000 }
|
|
1182
|
+
);
|
|
1183
|
+
}.bind(this))
|
|
1184
|
+
.catch(function(vError) {
|
|
1185
|
+
return showTechnicalError(vError);
|
|
1186
|
+
})
|
|
1187
|
+
.then(fnCallback);
|
|
1187
1188
|
}
|
|
1188
1189
|
|
|
1189
1190
|
function serializeAndSave(bActivateVersion, bCondenseAnyLayer, bIsExit) {
|
|
@@ -1215,14 +1216,14 @@ sap.ui.define([
|
|
|
1215
1216
|
}
|
|
1216
1217
|
|
|
1217
1218
|
return this._oSerializer.saveCommands(mPropertyBag)
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1219
|
+
.then(function() {
|
|
1220
|
+
if (!bIsExit) {
|
|
1221
|
+
// clean CViz after Save
|
|
1222
|
+
var oToolbar = this.getToolbar();
|
|
1223
|
+
var oChangeVisualization = this.getChangeVisualization();
|
|
1224
|
+
oChangeVisualization.updateAfterSave(oToolbar);
|
|
1225
|
+
}
|
|
1226
|
+
}.bind(this));
|
|
1226
1227
|
}
|
|
1227
1228
|
|
|
1228
1229
|
function onActivate(oEvent) {
|
|
@@ -1298,7 +1299,7 @@ sap.ui.define([
|
|
|
1298
1299
|
|
|
1299
1300
|
function onDeleteAdaptation() {
|
|
1300
1301
|
if (this.canSave()) {
|
|
1301
|
-
showDeleteAdaptationMessageBox.call(this, "DAC_DATA_LOSS_DIALOG_DESCRIPTION", "DAC_DIALOG_HEADER", true /*bDirtyChanges*/);
|
|
1302
|
+
showDeleteAdaptationMessageBox.call(this, "DAC_DATA_LOSS_DIALOG_DESCRIPTION", "DAC_DIALOG_HEADER", true /* bDirtyChanges */);
|
|
1302
1303
|
} else {
|
|
1303
1304
|
showDeleteAdaptationMessageBox.call(this, "DAC_DIALOG_DESCRIPTION", "DAC_DIALOG_HEADER");
|
|
1304
1305
|
}
|
|
@@ -1347,7 +1348,7 @@ sap.ui.define([
|
|
|
1347
1348
|
}).then(function(sAction) {
|
|
1348
1349
|
if (sAction === MessageBox.Action.YES) {
|
|
1349
1350
|
return this._serializeToLrep()
|
|
1350
|
-
|
|
1351
|
+
.then(callbackFn);
|
|
1351
1352
|
} else if (sAction === MessageBox.Action.NO) {
|
|
1352
1353
|
// avoids the data loss popup; a reload is triggered later and will destroy RTA & the command stack
|
|
1353
1354
|
this.getCommandStack().removeAllCommands(true);
|
|
@@ -1361,6 +1362,7 @@ sap.ui.define([
|
|
|
1361
1362
|
}
|
|
1362
1363
|
|
|
1363
1364
|
function onSwitchAdaptation(oEvent) {
|
|
1365
|
+
var fnCallback = oEvent.getParameter("callback") || function() {};
|
|
1364
1366
|
if (oEvent.getParameter("trigger") === "SaveAs") {
|
|
1365
1367
|
// remove all changes from command stack when triggered from saveAs dialog as they are already saved in a new adaptation
|
|
1366
1368
|
this.getCommandStack().removeAllCommands(true);
|
|
@@ -1369,10 +1371,11 @@ sap.ui.define([
|
|
|
1369
1371
|
this._sSwitchToAdaptationId = sAdaptationId;
|
|
1370
1372
|
return handleDataLoss.call(this, "MSG_SWITCH_VERSION_DIALOG", "BTN_SWITCH_ADAPTATIONS",
|
|
1371
1373
|
switchAdaptation.bind(this, this._sSwitchToAdaptationId))
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1374
|
+
.then(fnCallback)
|
|
1375
|
+
.catch(function(oError) {
|
|
1376
|
+
Utils.showMessageBox("error", "MSG_SWITCH_ADAPTATION_FAILED", {error: oError});
|
|
1377
|
+
Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
|
|
1378
|
+
});
|
|
1376
1379
|
}
|
|
1377
1380
|
|
|
1378
1381
|
function switchAdaptation(sAdaptationId) {
|
|
@@ -1393,11 +1396,11 @@ sap.ui.define([
|
|
|
1393
1396
|
this._sSwitchToVersion = sVersion;
|
|
1394
1397
|
handleDataLoss.call(this, "MSG_SWITCH_VERSION_DIALOG", "TIT_SWITCH_VERSION_DIALOG",
|
|
1395
1398
|
switchVersion.bind(this, this._sSwitchToVersion))
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1399
|
+
.then(fnCallback)
|
|
1400
|
+
.catch(function(oError) {
|
|
1401
|
+
Utils.showMessageBox("error", "MSG_SWITCH_VERSION_FAILED", {error: oError});
|
|
1402
|
+
Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
|
|
1403
|
+
});
|
|
1401
1404
|
}
|
|
1402
1405
|
|
|
1403
1406
|
function switchVersion(sVersion, sAdaptationId) {
|
|
@@ -1449,13 +1452,9 @@ sap.ui.define([
|
|
|
1449
1452
|
|
|
1450
1453
|
/**
|
|
1451
1454
|
* 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
1455
|
* @returns {Promise<void>} - Promise
|
|
1454
1456
|
*/
|
|
1455
|
-
function initVersioning(
|
|
1456
|
-
if (!bIsAutomaticRestart) {
|
|
1457
|
-
VersionsAPI.clearInstances();
|
|
1458
|
-
}
|
|
1457
|
+
function initVersioning() {
|
|
1459
1458
|
return VersionsAPI.initialize({
|
|
1460
1459
|
control: this.getRootControlInstance(),
|
|
1461
1460
|
layer: this.getLayer()
|
|
@@ -1524,102 +1523,105 @@ sap.ui.define([
|
|
|
1524
1523
|
this.addDependent(oToolbar, "toolbar");
|
|
1525
1524
|
|
|
1526
1525
|
return Promise.all([oToolbar.onFragmentLoaded(), FeaturesAPI.isKeyUserTranslationEnabled(this.getLayer())])
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1526
|
+
.then(function(aArguments) {
|
|
1527
|
+
var bTranslationAvailable = aArguments[1];
|
|
1528
|
+
var bAppVariantsAvailable = mButtonsAvailability.saveAsAvailable;
|
|
1529
|
+
var bExtendedOverview = bAppVariantsAvailable && RtaAppVariantFeature.isOverviewExtended();
|
|
1530
|
+
var oUriParameters = UriParameters.fromURL(window.location.href);
|
|
1531
|
+
// the "Visualization" tab should not be visible if the "fiori-tools-rta-mode" URL-parameter is set to any value but "false"
|
|
1532
|
+
var bVisualizationButtonVisible;
|
|
1533
|
+
bVisualizationButtonVisible = !oUriParameters.has("fiori-tools-rta-mode") || oUriParameters.get("fiori-tools-rta-mode") === "false";
|
|
1534
|
+
var bFeedbackButtonVisible = Core.getConfiguration().getFlexibilityServices()[0].connector !== "LocalStorageConnector";
|
|
1535
|
+
this.bPersistedDataTranslatable = false;
|
|
1536
|
+
|
|
1537
|
+
this._oToolbarControlsModel = new JSONModel({
|
|
1538
|
+
modeSwitcher: this.getMode(),
|
|
1539
|
+
undo: {
|
|
1540
|
+
enabled: false
|
|
1541
|
+
},
|
|
1542
|
+
redo: {
|
|
1543
|
+
enabled: false
|
|
1544
|
+
},
|
|
1545
|
+
save: {
|
|
1546
|
+
enabled: false
|
|
1547
|
+
},
|
|
1548
|
+
translation: {
|
|
1549
|
+
visible: bTranslationAvailable,
|
|
1550
|
+
enabled: this.bPersistedDataTranslatable
|
|
1551
|
+
},
|
|
1552
|
+
appVariantMenu: {
|
|
1553
|
+
visible: bAppVariantsAvailable,
|
|
1554
|
+
enabled: bAppVariantsAvailable,
|
|
1555
|
+
overview: {
|
|
1556
|
+
visible: bAppVariantsAvailable && bExtendedOverview,
|
|
1557
|
+
enabled: bAppVariantsAvailable && bExtendedOverview
|
|
1548
1558
|
},
|
|
1549
|
-
|
|
1550
|
-
visible:
|
|
1551
|
-
enabled:
|
|
1559
|
+
manageApps: {
|
|
1560
|
+
visible: bAppVariantsAvailable && !bExtendedOverview,
|
|
1561
|
+
enabled: bAppVariantsAvailable && !bExtendedOverview
|
|
1552
1562
|
},
|
|
1553
|
-
|
|
1563
|
+
saveAs: {
|
|
1554
1564
|
visible: bAppVariantsAvailable,
|
|
1555
|
-
enabled: bAppVariantsAvailable
|
|
1556
|
-
overview: {
|
|
1557
|
-
visible: bAppVariantsAvailable && bExtendedOverview,
|
|
1558
|
-
enabled: bAppVariantsAvailable && bExtendedOverview
|
|
1559
|
-
},
|
|
1560
|
-
manageApps: {
|
|
1561
|
-
visible: bAppVariantsAvailable && !bExtendedOverview,
|
|
1562
|
-
enabled: bAppVariantsAvailable && !bExtendedOverview
|
|
1563
|
-
},
|
|
1564
|
-
saveAs: {
|
|
1565
|
-
visible: bAppVariantsAvailable,
|
|
1566
|
-
enabled: bAppVariantsAvailable
|
|
1567
|
-
}
|
|
1568
|
-
},
|
|
1569
|
-
restore: {
|
|
1570
|
-
visible: !this._oVersionsModel.getProperty("/versioningEnabled"),
|
|
1571
|
-
enabled: this.bInitialResetEnabled
|
|
1572
|
-
},
|
|
1573
|
-
contextBasedAdaptation: {
|
|
1574
|
-
visible: mButtonsAvailability.contextBasedAdaptationAvailable,
|
|
1575
|
-
enabled: mButtonsAvailability.contextBasedAdaptationAvailable
|
|
1576
|
-
},
|
|
1577
|
-
actionsMenuButton: {
|
|
1578
|
-
enabled: true
|
|
1579
|
-
},
|
|
1580
|
-
visualizationButton: {
|
|
1581
|
-
visible: bVisualizationButtonVisible,
|
|
1582
|
-
enabled: bVisualizationButtonVisible
|
|
1583
|
-
},
|
|
1584
|
-
feedbackButton: {
|
|
1585
|
-
visible: bFeedbackButtonVisible
|
|
1565
|
+
enabled: bAppVariantsAvailable
|
|
1586
1566
|
}
|
|
1587
|
-
}
|
|
1567
|
+
},
|
|
1568
|
+
restore: {
|
|
1569
|
+
visible: !this._oVersionsModel.getProperty("/versioningEnabled"),
|
|
1570
|
+
enabled: this.bInitialResetEnabled
|
|
1571
|
+
},
|
|
1572
|
+
contextBasedAdaptation: {
|
|
1573
|
+
visible: mButtonsAvailability.contextBasedAdaptationAvailable,
|
|
1574
|
+
enabled: mButtonsAvailability.contextBasedAdaptationAvailable
|
|
1575
|
+
},
|
|
1576
|
+
actionsMenuButton: {
|
|
1577
|
+
enabled: true
|
|
1578
|
+
},
|
|
1579
|
+
visualizationButton: {
|
|
1580
|
+
visible: bVisualizationButtonVisible,
|
|
1581
|
+
enabled: bVisualizationButtonVisible
|
|
1582
|
+
},
|
|
1583
|
+
feedbackButton: {
|
|
1584
|
+
visible: bFeedbackButtonVisible
|
|
1585
|
+
}
|
|
1586
|
+
});
|
|
1588
1587
|
|
|
1589
|
-
|
|
1588
|
+
this._oVersionsModel.setProperty("/publishVersionVisible", mButtonsAvailability.publishAvailable);
|
|
1590
1589
|
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1590
|
+
var oTranslationPromise = new Promise(function(resolve) {
|
|
1591
|
+
if (!bTranslationAvailable) {
|
|
1592
|
+
resolve();
|
|
1593
|
+
return;
|
|
1594
|
+
}
|
|
1596
1595
|
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1596
|
+
TranslationAPI.getSourceLanguages({selector: this.getRootControlInstance(), layer: this.getLayer()})
|
|
1597
|
+
.then(function(aSourceLanguages) {
|
|
1598
|
+
this.bPersistedDataTranslatable = aSourceLanguages.length > 0;
|
|
1599
|
+
this._oToolbarControlsModel.setProperty("/translation/enabled", this.bPersistedDataTranslatable);
|
|
1600
|
+
}.bind(this)).finally(resolve);
|
|
1601
|
+
}.bind(this));
|
|
1603
1602
|
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1603
|
+
var oSaveAsPromise = new Promise(function(resolve) {
|
|
1604
|
+
if (!bAppVariantsAvailable) {
|
|
1605
|
+
resolve();
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1609
1608
|
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1609
|
+
RtaAppVariantFeature.isManifestSupported().then(function(bResult) {
|
|
1610
|
+
if (FlexUtils.isVariantByStartupParameter(this.getRootControlInstance())) {
|
|
1611
|
+
bResult = false;
|
|
1612
|
+
}
|
|
1613
|
+
this._oToolbarControlsModel.setProperty("/appVariantMenu/saveAs/enabled", bResult);
|
|
1614
|
+
this._oToolbarControlsModel.setProperty("/appVariantMenu/overview/enabled", bResult);
|
|
1615
|
+
this._oToolbarControlsModel.setProperty("/appVariantMenu/manageApps/enabled", bResult);
|
|
1616
|
+
}.bind(this)).finally(resolve);
|
|
1617
|
+
}.bind(this));
|
|
1616
1618
|
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1619
|
+
this.getToolbar().setModel(this._oVersionsModel, "versions");
|
|
1620
|
+
this.getToolbar().setModel(this._oContextBasedAdaptationsModel, "contextBasedAdaptations");
|
|
1621
|
+
this.getToolbar().setModel(this._oToolbarControlsModel, "controls");
|
|
1620
1622
|
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
+
return Promise.all([oTranslationPromise, oSaveAsPromise]);
|
|
1624
|
+
}.bind(this));
|
|
1623
1625
|
}
|
|
1624
1626
|
return Promise.resolve();
|
|
1625
1627
|
}
|
|
@@ -1662,7 +1664,7 @@ sap.ui.define([
|
|
|
1662
1664
|
* @param {Function} fnCallback - Callback to execute when the conditions are met, the overlay is the only parameter
|
|
1663
1665
|
*/
|
|
1664
1666
|
function scheduleOnCreated(sNewControlID, fnCallback) {
|
|
1665
|
-
function onElementOverlayCreated
|
|
1667
|
+
function onElementOverlayCreated(oEvent) {
|
|
1666
1668
|
var oNewOverlay = oEvent.getParameter("elementOverlay");
|
|
1667
1669
|
if (oNewOverlay.getElement().getId() === sNewControlID) {
|
|
1668
1670
|
this._oDesignTime.detachEvent("elementOverlayCreated", onElementOverlayCreated, this);
|
|
@@ -1680,7 +1682,7 @@ sap.ui.define([
|
|
|
1680
1682
|
* @param {Function} fnCallback - Callback to execute when the conditions are met, the overlay is the only parameter
|
|
1681
1683
|
*/
|
|
1682
1684
|
function scheduleOnCreatedAndVisible(sNewControlID, fnCallback) {
|
|
1683
|
-
function onGeometryChanged
|
|
1685
|
+
function onGeometryChanged(oEvent) {
|
|
1684
1686
|
var oElementOverlay = oEvent.getSource();
|
|
1685
1687
|
if (oElementOverlay.getGeometry() && oElementOverlay.getGeometry().visible) {
|
|
1686
1688
|
oElementOverlay.detachEvent("geometryChanged", onGeometryChanged);
|
|
@@ -1688,7 +1690,7 @@ sap.ui.define([
|
|
|
1688
1690
|
}
|
|
1689
1691
|
}
|
|
1690
1692
|
|
|
1691
|
-
function onGeometryCheck
|
|
1693
|
+
function onGeometryCheck(oElementOverlay) {
|
|
1692
1694
|
// the control can be set to visible, but still have no size when we do the check
|
|
1693
1695
|
// that's why we also attach to 'geometryChanged' and check if the overlay has a size
|
|
1694
1696
|
if (!oElementOverlay.getGeometry() || !oElementOverlay.getGeometry().visible) {
|
|
@@ -1773,13 +1775,13 @@ sap.ui.define([
|
|
|
1773
1775
|
}
|
|
1774
1776
|
}
|
|
1775
1777
|
return this.getCommandStack().pushAndExecute(oCommand)
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1778
|
+
// Error handling when a command fails is done in the Stack
|
|
1779
|
+
.catch(function(oError) {
|
|
1780
|
+
if (oError && oError.message && oError.message.indexOf("The following Change cannot be applied because of a dependency") > -1) {
|
|
1781
|
+
Utils.showMessageBox("error", "MSG_DEPENDENCY_ERROR", {error: oError});
|
|
1782
|
+
}
|
|
1783
|
+
Log.error("sap.ui.rta:", oError.message, oError.stack);
|
|
1784
|
+
});
|
|
1783
1785
|
}
|
|
1784
1786
|
return undefined;
|
|
1785
1787
|
}.bind(this));
|
|
@@ -1877,51 +1879,51 @@ sap.ui.define([
|
|
|
1877
1879
|
this,
|
|
1878
1880
|
this._oServiceEventBus.publish.bind(this._oServiceEventBus, sName)
|
|
1879
1881
|
)
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
);
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
mService.service = oService;
|
|
1897
|
-
mService.exports = {};
|
|
1898
|
-
|
|
1899
|
-
// Expose events API if there is at least one event
|
|
1900
|
-
if (Array.isArray(oService.events) && oService.events.length > 0) {
|
|
1901
|
-
Object.assign(mService.exports, {
|
|
1902
|
-
attachEvent: this._oServiceEventBus.subscribe.bind(this._oServiceEventBus, sName),
|
|
1903
|
-
detachEvent: this._oServiceEventBus.unsubscribe.bind(this._oServiceEventBus, sName),
|
|
1904
|
-
attachEventOnce: this._oServiceEventBus.subscribeOnce.bind(this._oServiceEventBus, sName)
|
|
1905
|
-
});
|
|
1906
|
-
}
|
|
1907
|
-
|
|
1908
|
-
// Expose methods/properties from exports object if any
|
|
1909
|
-
var mExports = oService.exports || {};
|
|
1910
|
-
Object.assign(
|
|
1911
|
-
mService.exports,
|
|
1912
|
-
Object.keys(mExports).reduce(function(mResult, sKey) {
|
|
1913
|
-
var vValue = mExports[sKey];
|
|
1914
|
-
mResult[sKey] = typeof vValue === "function"
|
|
1915
|
-
? DtUtil.waitForSynced(this._oDesignTime, vValue)
|
|
1916
|
-
: vValue;
|
|
1917
|
-
return mResult;
|
|
1918
|
-
}.bind(this), {})
|
|
1882
|
+
.then(function(oService) {
|
|
1883
|
+
if (this.bIsDestroyed) {
|
|
1884
|
+
throw DtUtil.createError(
|
|
1885
|
+
"RuntimeAuthoring#startService",
|
|
1886
|
+
DtUtil.printf("RuntimeAuthoring instance is destroyed while initializing the service '{0}'", sName),
|
|
1887
|
+
"sap.ui.rta"
|
|
1888
|
+
);
|
|
1889
|
+
}
|
|
1890
|
+
if (!isPlainObject(oService)) {
|
|
1891
|
+
throw DtUtil.createError(
|
|
1892
|
+
"RuntimeAuthoring#startService",
|
|
1893
|
+
DtUtil.printf("Invalid service format. Service should return simple javascript object after initialization. Service name = '{0}'", sName),
|
|
1894
|
+
"sap.ui.rta"
|
|
1919
1895
|
);
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
mService.service = oService;
|
|
1899
|
+
mService.exports = {};
|
|
1900
|
+
|
|
1901
|
+
// Expose events API if there is at least one event
|
|
1902
|
+
if (Array.isArray(oService.events) && oService.events.length > 0) {
|
|
1903
|
+
Object.assign(mService.exports, {
|
|
1904
|
+
attachEvent: this._oServiceEventBus.subscribe.bind(this._oServiceEventBus, sName),
|
|
1905
|
+
detachEvent: this._oServiceEventBus.unsubscribe.bind(this._oServiceEventBus, sName),
|
|
1906
|
+
attachEventOnce: this._oServiceEventBus.subscribeOnce.bind(this._oServiceEventBus, sName)
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1920
1909
|
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1910
|
+
// Expose methods/properties from exports object if any
|
|
1911
|
+
var mExports = oService.exports || {};
|
|
1912
|
+
Object.assign(
|
|
1913
|
+
mService.exports,
|
|
1914
|
+
Object.keys(mExports).reduce(function(mResult, sKey) {
|
|
1915
|
+
var vValue = mExports[sKey];
|
|
1916
|
+
mResult[sKey] = typeof vValue === "function"
|
|
1917
|
+
? DtUtil.waitForSynced(this._oDesignTime, vValue)
|
|
1918
|
+
: vValue;
|
|
1919
|
+
return mResult;
|
|
1920
|
+
}.bind(this), {})
|
|
1921
|
+
);
|
|
1922
|
+
|
|
1923
|
+
mService.status = SERVICE_STARTED;
|
|
1924
|
+
fnResolve(Object.freeze(mService.exports));
|
|
1925
|
+
}.bind(this))
|
|
1926
|
+
.catch(fnReject);
|
|
1925
1927
|
}.bind(this),
|
|
1926
1928
|
function(vError) {
|
|
1927
1929
|
mService.status = SERVICE_FAILED;
|