@openui5/sap.ui.rta 1.115.0 → 1.116.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 +253 -248
- 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 +97 -97
- 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 +2 -2
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +22 -22
- 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 +2 -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 +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 +5 -0
- 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 +30 -30
- package/src/sap/ui/rta/service/index.js +1 -1
- package/src/sap/ui/rta/toolbar/Adaptation.js +74 -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/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 +21 -19
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +61 -61
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +73 -60
- 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
|
@@ -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.116.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
|
|
|
@@ -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,65 @@ 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
|
+
}.bind(this))
|
|
672
|
+
.catch(function(vError) {
|
|
673
|
+
if (!bUserCancelled) {
|
|
674
|
+
return showTechnicalError(vError);
|
|
675
|
+
}
|
|
676
|
+
return undefined;
|
|
677
|
+
})
|
|
678
|
+
.then(function() {
|
|
679
|
+
checkToolbarAndExecuteFunction.call(this, "setBusy", false);
|
|
680
|
+
if (!bUserCancelled) {
|
|
681
|
+
this._sStatus = STOPPED;
|
|
682
|
+
document.body.classList.remove("sapUiRtaMode");
|
|
683
|
+
}
|
|
684
|
+
}.bind(this));
|
|
685
685
|
};
|
|
686
686
|
|
|
687
687
|
/**
|
|
@@ -743,9 +743,9 @@ sap.ui.define([
|
|
|
743
743
|
var oChangeVisualization = this.getChangeVisualization && this.getChangeVisualization();
|
|
744
744
|
if (sNewMode === "visualization" || sCurrentMode === "visualization") {
|
|
745
745
|
DtUtil.waitForSynced(this._oDesignTime)()
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
746
|
+
.then(function() {
|
|
747
|
+
return oChangeVisualization.triggerModeChange(this.getRootControl(), this.getToolbar());
|
|
748
|
+
}.bind(this));
|
|
749
749
|
}
|
|
750
750
|
|
|
751
751
|
if (sCurrentMode === "adaptation") {
|
|
@@ -906,7 +906,7 @@ sap.ui.define([
|
|
|
906
906
|
|
|
907
907
|
RuntimeAuthoring.prototype.save = function() {
|
|
908
908
|
return waitForPendingActions.call(this)
|
|
909
|
-
|
|
909
|
+
.then(this._serializeToLrep.bind(this));
|
|
910
910
|
};
|
|
911
911
|
|
|
912
912
|
// ---- API ----
|
|
@@ -956,9 +956,9 @@ sap.ui.define([
|
|
|
956
956
|
function shouldValidateFlexEnabled() {
|
|
957
957
|
var sUriParam = UriParameters.fromQuery(window.location.search).get("sap-ui-rta-skip-flex-validation");
|
|
958
958
|
return Settings.getInstance()
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
959
|
+
.then(function(oSettings) {
|
|
960
|
+
return !oSettings.isCustomerSystem() && sUriParam !== "true";
|
|
961
|
+
});
|
|
962
962
|
}
|
|
963
963
|
|
|
964
964
|
function onPopupOpen(oEvent) {
|
|
@@ -1036,7 +1036,7 @@ sap.ui.define([
|
|
|
1036
1036
|
var bIsContextBasedAdaptationAvailable = aRtaFeaturesAvailability[2];
|
|
1037
1037
|
var bIsHomePage = aRtaFeaturesAvailability[3];
|
|
1038
1038
|
var oManifest = FlexUtils.getAppDescriptor(oRootControl);
|
|
1039
|
-
//context based adaptation is not supported for overview pages
|
|
1039
|
+
// context based adaptation is not supported for overview pages
|
|
1040
1040
|
var bIsContextBasedAdaptationSupported = oManifest && !ManifestUtils.getOvpEntry(oManifest);
|
|
1041
1041
|
return {
|
|
1042
1042
|
publishAvailable: bIsPublishAvailable,
|
|
@@ -1121,9 +1121,9 @@ sap.ui.define([
|
|
|
1121
1121
|
|
|
1122
1122
|
function waitForPendingActions() {
|
|
1123
1123
|
return Promise.resolve(this._oDesignTime && this._oDesignTime.waitForBusyPlugins())
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1124
|
+
.then(function() {
|
|
1125
|
+
return this._pElementModified;
|
|
1126
|
+
}.bind(this));
|
|
1127
1127
|
}
|
|
1128
1128
|
|
|
1129
1129
|
function onKeyDown(oEvent) {
|
|
@@ -1173,17 +1173,17 @@ sap.ui.define([
|
|
|
1173
1173
|
var fnCallback = oEvent.getParameter("callback") || function() {};
|
|
1174
1174
|
var bVersionsEnabled = this._oVersionsModel.getProperty("/versioningEnabled");
|
|
1175
1175
|
return this.save()
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1176
|
+
.then(function() {
|
|
1177
|
+
showMessageToast.call(
|
|
1178
|
+
this,
|
|
1179
|
+
bVersionsEnabled ? "MSG_SAVE_DRAFT_SUCCESS" : "MSG_SAVE_SUCCESS",
|
|
1180
|
+
{ duration: 5000 }
|
|
1181
|
+
);
|
|
1182
|
+
}.bind(this))
|
|
1183
|
+
.catch(function(vError) {
|
|
1184
|
+
return showTechnicalError(vError);
|
|
1185
|
+
})
|
|
1186
|
+
.then(fnCallback);
|
|
1187
1187
|
}
|
|
1188
1188
|
|
|
1189
1189
|
function serializeAndSave(bActivateVersion, bCondenseAnyLayer, bIsExit) {
|
|
@@ -1215,14 +1215,14 @@ sap.ui.define([
|
|
|
1215
1215
|
}
|
|
1216
1216
|
|
|
1217
1217
|
return this._oSerializer.saveCommands(mPropertyBag)
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1218
|
+
.then(function() {
|
|
1219
|
+
if (!bIsExit) {
|
|
1220
|
+
// clean CViz after Save
|
|
1221
|
+
var oToolbar = this.getToolbar();
|
|
1222
|
+
var oChangeVisualization = this.getChangeVisualization();
|
|
1223
|
+
oChangeVisualization.updateAfterSave(oToolbar);
|
|
1224
|
+
}
|
|
1225
|
+
}.bind(this));
|
|
1226
1226
|
}
|
|
1227
1227
|
|
|
1228
1228
|
function onActivate(oEvent) {
|
|
@@ -1298,7 +1298,7 @@ sap.ui.define([
|
|
|
1298
1298
|
|
|
1299
1299
|
function onDeleteAdaptation() {
|
|
1300
1300
|
if (this.canSave()) {
|
|
1301
|
-
showDeleteAdaptationMessageBox.call(this, "DAC_DATA_LOSS_DIALOG_DESCRIPTION", "DAC_DIALOG_HEADER", true /*bDirtyChanges*/);
|
|
1301
|
+
showDeleteAdaptationMessageBox.call(this, "DAC_DATA_LOSS_DIALOG_DESCRIPTION", "DAC_DIALOG_HEADER", true /* bDirtyChanges */);
|
|
1302
1302
|
} else {
|
|
1303
1303
|
showDeleteAdaptationMessageBox.call(this, "DAC_DIALOG_DESCRIPTION", "DAC_DIALOG_HEADER");
|
|
1304
1304
|
}
|
|
@@ -1347,7 +1347,7 @@ sap.ui.define([
|
|
|
1347
1347
|
}).then(function(sAction) {
|
|
1348
1348
|
if (sAction === MessageBox.Action.YES) {
|
|
1349
1349
|
return this._serializeToLrep()
|
|
1350
|
-
|
|
1350
|
+
.then(callbackFn);
|
|
1351
1351
|
} else if (sAction === MessageBox.Action.NO) {
|
|
1352
1352
|
// avoids the data loss popup; a reload is triggered later and will destroy RTA & the command stack
|
|
1353
1353
|
this.getCommandStack().removeAllCommands(true);
|
|
@@ -1361,6 +1361,7 @@ sap.ui.define([
|
|
|
1361
1361
|
}
|
|
1362
1362
|
|
|
1363
1363
|
function onSwitchAdaptation(oEvent) {
|
|
1364
|
+
var fnCallback = oEvent.getParameter("callback") || function() {};
|
|
1364
1365
|
if (oEvent.getParameter("trigger") === "SaveAs") {
|
|
1365
1366
|
// remove all changes from command stack when triggered from saveAs dialog as they are already saved in a new adaptation
|
|
1366
1367
|
this.getCommandStack().removeAllCommands(true);
|
|
@@ -1369,10 +1370,11 @@ sap.ui.define([
|
|
|
1369
1370
|
this._sSwitchToAdaptationId = sAdaptationId;
|
|
1370
1371
|
return handleDataLoss.call(this, "MSG_SWITCH_VERSION_DIALOG", "BTN_SWITCH_ADAPTATIONS",
|
|
1371
1372
|
switchAdaptation.bind(this, this._sSwitchToAdaptationId))
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1373
|
+
.then(fnCallback)
|
|
1374
|
+
.catch(function(oError) {
|
|
1375
|
+
Utils.showMessageBox("error", "MSG_SWITCH_ADAPTATION_FAILED", {error: oError});
|
|
1376
|
+
Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
|
|
1377
|
+
});
|
|
1376
1378
|
}
|
|
1377
1379
|
|
|
1378
1380
|
function switchAdaptation(sAdaptationId) {
|
|
@@ -1393,11 +1395,11 @@ sap.ui.define([
|
|
|
1393
1395
|
this._sSwitchToVersion = sVersion;
|
|
1394
1396
|
handleDataLoss.call(this, "MSG_SWITCH_VERSION_DIALOG", "TIT_SWITCH_VERSION_DIALOG",
|
|
1395
1397
|
switchVersion.bind(this, this._sSwitchToVersion))
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1398
|
+
.then(fnCallback)
|
|
1399
|
+
.catch(function(oError) {
|
|
1400
|
+
Utils.showMessageBox("error", "MSG_SWITCH_VERSION_FAILED", {error: oError});
|
|
1401
|
+
Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
|
|
1402
|
+
});
|
|
1401
1403
|
}
|
|
1402
1404
|
|
|
1403
1405
|
function switchVersion(sVersion, sAdaptationId) {
|
|
@@ -1524,102 +1526,105 @@ sap.ui.define([
|
|
|
1524
1526
|
this.addDependent(oToolbar, "toolbar");
|
|
1525
1527
|
|
|
1526
1528
|
return Promise.all([oToolbar.onFragmentLoaded(), FeaturesAPI.isKeyUserTranslationEnabled(this.getLayer())])
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1529
|
+
.then(function(aArguments) {
|
|
1530
|
+
var bTranslationAvailable = aArguments[1];
|
|
1531
|
+
var bAppVariantsAvailable = mButtonsAvailability.saveAsAvailable;
|
|
1532
|
+
var bExtendedOverview = bAppVariantsAvailable && RtaAppVariantFeature.isOverviewExtended();
|
|
1533
|
+
var oUriParameters = UriParameters.fromURL(window.location.href);
|
|
1534
|
+
// the "Visualization" tab should not be visible if the "fiori-tools-rta-mode" URL-parameter is set to any value but "false"
|
|
1535
|
+
var bVisualizationButtonVisible;
|
|
1536
|
+
bVisualizationButtonVisible = !oUriParameters.has("fiori-tools-rta-mode") || oUriParameters.get("fiori-tools-rta-mode") === "false";
|
|
1537
|
+
var bFeedbackButtonVisible = Core.getConfiguration().getFlexibilityServices()[0].connector !== "LocalStorageConnector";
|
|
1538
|
+
this.bPersistedDataTranslatable = false;
|
|
1539
|
+
|
|
1540
|
+
this._oToolbarControlsModel = new JSONModel({
|
|
1541
|
+
modeSwitcher: this.getMode(),
|
|
1542
|
+
undo: {
|
|
1543
|
+
enabled: false
|
|
1544
|
+
},
|
|
1545
|
+
redo: {
|
|
1546
|
+
enabled: false
|
|
1547
|
+
},
|
|
1548
|
+
save: {
|
|
1549
|
+
enabled: false
|
|
1550
|
+
},
|
|
1551
|
+
translation: {
|
|
1552
|
+
visible: bTranslationAvailable,
|
|
1553
|
+
enabled: this.bPersistedDataTranslatable
|
|
1554
|
+
},
|
|
1555
|
+
appVariantMenu: {
|
|
1556
|
+
visible: bAppVariantsAvailable,
|
|
1557
|
+
enabled: bAppVariantsAvailable,
|
|
1558
|
+
overview: {
|
|
1559
|
+
visible: bAppVariantsAvailable && bExtendedOverview,
|
|
1560
|
+
enabled: bAppVariantsAvailable && bExtendedOverview
|
|
1542
1561
|
},
|
|
1543
|
-
|
|
1544
|
-
|
|
1562
|
+
manageApps: {
|
|
1563
|
+
visible: bAppVariantsAvailable && !bExtendedOverview,
|
|
1564
|
+
enabled: bAppVariantsAvailable && !bExtendedOverview
|
|
1545
1565
|
},
|
|
1546
|
-
|
|
1547
|
-
enabled: false
|
|
1548
|
-
},
|
|
1549
|
-
translation: {
|
|
1550
|
-
visible: bTranslationAvailable,
|
|
1551
|
-
enabled: this.bPersistedDataTranslatable
|
|
1552
|
-
},
|
|
1553
|
-
appVariantMenu: {
|
|
1566
|
+
saveAs: {
|
|
1554
1567
|
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
|
|
1568
|
+
enabled: bAppVariantsAvailable
|
|
1586
1569
|
}
|
|
1587
|
-
}
|
|
1570
|
+
},
|
|
1571
|
+
restore: {
|
|
1572
|
+
visible: !this._oVersionsModel.getProperty("/versioningEnabled"),
|
|
1573
|
+
enabled: this.bInitialResetEnabled
|
|
1574
|
+
},
|
|
1575
|
+
contextBasedAdaptation: {
|
|
1576
|
+
visible: mButtonsAvailability.contextBasedAdaptationAvailable,
|
|
1577
|
+
enabled: mButtonsAvailability.contextBasedAdaptationAvailable
|
|
1578
|
+
},
|
|
1579
|
+
actionsMenuButton: {
|
|
1580
|
+
enabled: true
|
|
1581
|
+
},
|
|
1582
|
+
visualizationButton: {
|
|
1583
|
+
visible: bVisualizationButtonVisible,
|
|
1584
|
+
enabled: bVisualizationButtonVisible
|
|
1585
|
+
},
|
|
1586
|
+
feedbackButton: {
|
|
1587
|
+
visible: bFeedbackButtonVisible
|
|
1588
|
+
}
|
|
1589
|
+
});
|
|
1588
1590
|
|
|
1589
|
-
|
|
1591
|
+
this._oVersionsModel.setProperty("/publishVersionVisible", mButtonsAvailability.publishAvailable);
|
|
1590
1592
|
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1593
|
+
var oTranslationPromise = new Promise(function(resolve) {
|
|
1594
|
+
if (!bTranslationAvailable) {
|
|
1595
|
+
resolve();
|
|
1596
|
+
return;
|
|
1597
|
+
}
|
|
1596
1598
|
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1599
|
+
TranslationAPI.getSourceLanguages({selector: this.getRootControlInstance(), layer: this.getLayer()})
|
|
1600
|
+
.then(function(aSourceLanguages) {
|
|
1601
|
+
this.bPersistedDataTranslatable = aSourceLanguages.length > 0;
|
|
1602
|
+
this._oToolbarControlsModel.setProperty("/translation/enabled", this.bPersistedDataTranslatable);
|
|
1603
|
+
}.bind(this)).finally(resolve);
|
|
1604
|
+
}.bind(this));
|
|
1603
1605
|
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1606
|
+
var oSaveAsPromise = new Promise(function(resolve) {
|
|
1607
|
+
if (!bAppVariantsAvailable) {
|
|
1608
|
+
resolve();
|
|
1609
|
+
return;
|
|
1610
|
+
}
|
|
1609
1611
|
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1612
|
+
RtaAppVariantFeature.isManifestSupported().then(function(bResult) {
|
|
1613
|
+
if (FlexUtils.isVariantByStartupParameter(this.getRootControlInstance())) {
|
|
1614
|
+
bResult = false;
|
|
1615
|
+
}
|
|
1616
|
+
this._oToolbarControlsModel.setProperty("/appVariantMenu/saveAs/enabled", bResult);
|
|
1617
|
+
this._oToolbarControlsModel.setProperty("/appVariantMenu/overview/enabled", bResult);
|
|
1618
|
+
this._oToolbarControlsModel.setProperty("/appVariantMenu/manageApps/enabled", bResult);
|
|
1619
|
+
}.bind(this)).finally(resolve);
|
|
1620
|
+
}.bind(this));
|
|
1616
1621
|
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1622
|
+
this.getToolbar().setModel(this._oVersionsModel, "versions");
|
|
1623
|
+
this.getToolbar().setModel(this._oContextBasedAdaptationsModel, "contextBasedAdaptations");
|
|
1624
|
+
this.getToolbar().setModel(this._oToolbarControlsModel, "controls");
|
|
1620
1625
|
|
|
1621
|
-
|
|
1622
|
-
|
|
1626
|
+
return Promise.all([oTranslationPromise, oSaveAsPromise]);
|
|
1627
|
+
}.bind(this));
|
|
1623
1628
|
}
|
|
1624
1629
|
return Promise.resolve();
|
|
1625
1630
|
}
|
|
@@ -1662,7 +1667,7 @@ sap.ui.define([
|
|
|
1662
1667
|
* @param {Function} fnCallback - Callback to execute when the conditions are met, the overlay is the only parameter
|
|
1663
1668
|
*/
|
|
1664
1669
|
function scheduleOnCreated(sNewControlID, fnCallback) {
|
|
1665
|
-
function onElementOverlayCreated
|
|
1670
|
+
function onElementOverlayCreated(oEvent) {
|
|
1666
1671
|
var oNewOverlay = oEvent.getParameter("elementOverlay");
|
|
1667
1672
|
if (oNewOverlay.getElement().getId() === sNewControlID) {
|
|
1668
1673
|
this._oDesignTime.detachEvent("elementOverlayCreated", onElementOverlayCreated, this);
|
|
@@ -1680,7 +1685,7 @@ sap.ui.define([
|
|
|
1680
1685
|
* @param {Function} fnCallback - Callback to execute when the conditions are met, the overlay is the only parameter
|
|
1681
1686
|
*/
|
|
1682
1687
|
function scheduleOnCreatedAndVisible(sNewControlID, fnCallback) {
|
|
1683
|
-
function onGeometryChanged
|
|
1688
|
+
function onGeometryChanged(oEvent) {
|
|
1684
1689
|
var oElementOverlay = oEvent.getSource();
|
|
1685
1690
|
if (oElementOverlay.getGeometry() && oElementOverlay.getGeometry().visible) {
|
|
1686
1691
|
oElementOverlay.detachEvent("geometryChanged", onGeometryChanged);
|
|
@@ -1688,7 +1693,7 @@ sap.ui.define([
|
|
|
1688
1693
|
}
|
|
1689
1694
|
}
|
|
1690
1695
|
|
|
1691
|
-
function onGeometryCheck
|
|
1696
|
+
function onGeometryCheck(oElementOverlay) {
|
|
1692
1697
|
// the control can be set to visible, but still have no size when we do the check
|
|
1693
1698
|
// that's why we also attach to 'geometryChanged' and check if the overlay has a size
|
|
1694
1699
|
if (!oElementOverlay.getGeometry() || !oElementOverlay.getGeometry().visible) {
|
|
@@ -1773,13 +1778,13 @@ sap.ui.define([
|
|
|
1773
1778
|
}
|
|
1774
1779
|
}
|
|
1775
1780
|
return this.getCommandStack().pushAndExecute(oCommand)
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1781
|
+
// Error handling when a command fails is done in the Stack
|
|
1782
|
+
.catch(function(oError) {
|
|
1783
|
+
if (oError && oError.message && oError.message.indexOf("The following Change cannot be applied because of a dependency") > -1) {
|
|
1784
|
+
Utils.showMessageBox("error", "MSG_DEPENDENCY_ERROR", {error: oError});
|
|
1785
|
+
}
|
|
1786
|
+
Log.error("sap.ui.rta:", oError.message, oError.stack);
|
|
1787
|
+
});
|
|
1783
1788
|
}
|
|
1784
1789
|
return undefined;
|
|
1785
1790
|
}.bind(this));
|
|
@@ -1877,51 +1882,51 @@ sap.ui.define([
|
|
|
1877
1882
|
this,
|
|
1878
1883
|
this._oServiceEventBus.publish.bind(this._oServiceEventBus, sName)
|
|
1879
1884
|
)
|
|
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), {})
|
|
1885
|
+
.then(function(oService) {
|
|
1886
|
+
if (this.bIsDestroyed) {
|
|
1887
|
+
throw DtUtil.createError(
|
|
1888
|
+
"RuntimeAuthoring#startService",
|
|
1889
|
+
DtUtil.printf("RuntimeAuthoring instance is destroyed while initializing the service '{0}'", sName),
|
|
1890
|
+
"sap.ui.rta"
|
|
1891
|
+
);
|
|
1892
|
+
}
|
|
1893
|
+
if (!isPlainObject(oService)) {
|
|
1894
|
+
throw DtUtil.createError(
|
|
1895
|
+
"RuntimeAuthoring#startService",
|
|
1896
|
+
DtUtil.printf("Invalid service format. Service should return simple javascript object after initialization. Service name = '{0}'", sName),
|
|
1897
|
+
"sap.ui.rta"
|
|
1919
1898
|
);
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
mService.service = oService;
|
|
1902
|
+
mService.exports = {};
|
|
1903
|
+
|
|
1904
|
+
// Expose events API if there is at least one event
|
|
1905
|
+
if (Array.isArray(oService.events) && oService.events.length > 0) {
|
|
1906
|
+
Object.assign(mService.exports, {
|
|
1907
|
+
attachEvent: this._oServiceEventBus.subscribe.bind(this._oServiceEventBus, sName),
|
|
1908
|
+
detachEvent: this._oServiceEventBus.unsubscribe.bind(this._oServiceEventBus, sName),
|
|
1909
|
+
attachEventOnce: this._oServiceEventBus.subscribeOnce.bind(this._oServiceEventBus, sName)
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1920
1912
|
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1913
|
+
// Expose methods/properties from exports object if any
|
|
1914
|
+
var mExports = oService.exports || {};
|
|
1915
|
+
Object.assign(
|
|
1916
|
+
mService.exports,
|
|
1917
|
+
Object.keys(mExports).reduce(function(mResult, sKey) {
|
|
1918
|
+
var vValue = mExports[sKey];
|
|
1919
|
+
mResult[sKey] = typeof vValue === "function"
|
|
1920
|
+
? DtUtil.waitForSynced(this._oDesignTime, vValue)
|
|
1921
|
+
: vValue;
|
|
1922
|
+
return mResult;
|
|
1923
|
+
}.bind(this), {})
|
|
1924
|
+
);
|
|
1925
|
+
|
|
1926
|
+
mService.status = SERVICE_STARTED;
|
|
1927
|
+
fnResolve(Object.freeze(mService.exports));
|
|
1928
|
+
}.bind(this))
|
|
1929
|
+
.catch(fnReject);
|
|
1925
1930
|
}.bind(this),
|
|
1926
1931
|
function(vError) {
|
|
1927
1932
|
mService.status = SERVICE_FAILED;
|