@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.
Files changed (178) hide show
  1. package/.eslintrc.json +33 -2
  2. package/.reuse/dep5 +0 -5
  3. package/THIRDPARTY.txt +1 -7
  4. package/package.json +6 -6
  5. package/src/sap/ui/rta/.library +1 -1
  6. package/src/sap/ui/rta/Client.js +60 -59
  7. package/src/sap/ui/rta/RuntimeAuthoring.js +256 -254
  8. package/src/sap/ui/rta/Utils.js +42 -42
  9. package/src/sap/ui/rta/api/startAdaptation.js +2 -2
  10. package/src/sap/ui/rta/appVariant/AppVariantDialog.js +3 -3
  11. package/src/sap/ui/rta/appVariant/AppVariantManager.js +27 -27
  12. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +100 -103
  13. package/src/sap/ui/rta/appVariant/Feature.js +75 -77
  14. package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +6 -7
  15. package/src/sap/ui/rta/appVariant/Utils.js +17 -17
  16. package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +36 -36
  17. package/src/sap/ui/rta/command/AddIFrame.js +7 -7
  18. package/src/sap/ui/rta/command/AddProperty.js +7 -7
  19. package/src/sap/ui/rta/command/AddXML.js +1 -1
  20. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +7 -7
  21. package/src/sap/ui/rta/command/AppDescriptorCommand.js +18 -18
  22. package/src/sap/ui/rta/command/BaseCommand.js +1 -2
  23. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  24. package/src/sap/ui/rta/command/Combine.js +1 -1
  25. package/src/sap/ui/rta/command/CommandFactory.js +11 -11
  26. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  27. package/src/sap/ui/rta/command/ControlVariantConfigure.js +28 -3
  28. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  29. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +26 -24
  30. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +7 -7
  31. package/src/sap/ui/rta/command/ControlVariantSwitch.js +11 -11
  32. package/src/sap/ui/rta/command/CreateContainer.js +2 -2
  33. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  34. package/src/sap/ui/rta/command/FlexCommand.js +30 -30
  35. package/src/sap/ui/rta/command/LREPSerializer.js +20 -10
  36. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  37. package/src/sap/ui/rta/command/Move.js +1 -1
  38. package/src/sap/ui/rta/command/Property.js +1 -1
  39. package/src/sap/ui/rta/command/Remove.js +1 -1
  40. package/src/sap/ui/rta/command/Rename.js +1 -1
  41. package/src/sap/ui/rta/command/Resize.js +1 -1
  42. package/src/sap/ui/rta/command/Reveal.js +1 -1
  43. package/src/sap/ui/rta/command/Settings.js +1 -1
  44. package/src/sap/ui/rta/command/Split.js +1 -1
  45. package/src/sap/ui/rta/command/Stack.js +4 -4
  46. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  47. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  48. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  49. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  50. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  51. package/src/sap/ui/rta/enablement/TestDelegate.js +92 -92
  52. package/src/sap/ui/rta/enablement/elementActionTest.js +230 -112
  53. package/src/sap/ui/rta/library.js +2 -2
  54. package/src/sap/ui/rta/messagebundle.properties +11 -1
  55. package/src/sap/ui/rta/messagebundle_ar.properties +5 -0
  56. package/src/sap/ui/rta/messagebundle_bg.properties +5 -0
  57. package/src/sap/ui/rta/messagebundle_ca.properties +5 -0
  58. package/src/sap/ui/rta/messagebundle_cs.properties +5 -0
  59. package/src/sap/ui/rta/messagebundle_cy.properties +5 -0
  60. package/src/sap/ui/rta/messagebundle_da.properties +5 -0
  61. package/src/sap/ui/rta/messagebundle_de.properties +6 -1
  62. package/src/sap/ui/rta/messagebundle_el.properties +5 -0
  63. package/src/sap/ui/rta/messagebundle_en.properties +5 -0
  64. package/src/sap/ui/rta/messagebundle_en_GB.properties +5 -0
  65. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +5 -0
  66. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +5 -0
  67. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
  68. package/src/sap/ui/rta/messagebundle_es.properties +5 -0
  69. package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -0
  70. package/src/sap/ui/rta/messagebundle_et.properties +5 -0
  71. package/src/sap/ui/rta/messagebundle_fi.properties +5 -0
  72. package/src/sap/ui/rta/messagebundle_fr.properties +5 -0
  73. package/src/sap/ui/rta/messagebundle_fr_CA.properties +5 -0
  74. package/src/sap/ui/rta/messagebundle_hi.properties +5 -0
  75. package/src/sap/ui/rta/messagebundle_hr.properties +5 -0
  76. package/src/sap/ui/rta/messagebundle_hu.properties +5 -0
  77. package/src/sap/ui/rta/messagebundle_id.properties +5 -0
  78. package/src/sap/ui/rta/messagebundle_it.properties +5 -0
  79. package/src/sap/ui/rta/messagebundle_iw.properties +5 -0
  80. package/src/sap/ui/rta/messagebundle_ja.properties +5 -0
  81. package/src/sap/ui/rta/messagebundle_kk.properties +5 -0
  82. package/src/sap/ui/rta/messagebundle_ko.properties +5 -0
  83. package/src/sap/ui/rta/messagebundle_lt.properties +5 -0
  84. package/src/sap/ui/rta/messagebundle_lv.properties +5 -0
  85. package/src/sap/ui/rta/messagebundle_ms.properties +5 -0
  86. package/src/sap/ui/rta/messagebundle_nl.properties +5 -0
  87. package/src/sap/ui/rta/messagebundle_no.properties +5 -0
  88. package/src/sap/ui/rta/messagebundle_pl.properties +5 -0
  89. package/src/sap/ui/rta/messagebundle_pt.properties +5 -0
  90. package/src/sap/ui/rta/messagebundle_pt_PT.properties +5 -0
  91. package/src/sap/ui/rta/messagebundle_ro.properties +5 -0
  92. package/src/sap/ui/rta/messagebundle_ru.properties +5 -0
  93. package/src/sap/ui/rta/messagebundle_sh.properties +5 -0
  94. package/src/sap/ui/rta/messagebundle_sk.properties +5 -0
  95. package/src/sap/ui/rta/messagebundle_sl.properties +5 -0
  96. package/src/sap/ui/rta/messagebundle_sv.properties +5 -0
  97. package/src/sap/ui/rta/messagebundle_th.properties +5 -0
  98. package/src/sap/ui/rta/messagebundle_tr.properties +5 -0
  99. package/src/sap/ui/rta/messagebundle_uk.properties +5 -0
  100. package/src/sap/ui/rta/messagebundle_vi.properties +5 -0
  101. package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -0
  102. package/src/sap/ui/rta/messagebundle_zh_TW.properties +5 -0
  103. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +44 -44
  104. package/src/sap/ui/rta/plugin/BaseCreate.js +29 -29
  105. package/src/sap/ui/rta/plugin/Combine.js +9 -9
  106. package/src/sap/ui/rta/plugin/ControlVariant.js +21 -21
  107. package/src/sap/ui/rta/plugin/CreateContainer.js +6 -6
  108. package/src/sap/ui/rta/plugin/CutPaste.js +46 -46
  109. package/src/sap/ui/rta/plugin/DragDrop.js +2 -2
  110. package/src/sap/ui/rta/plugin/EasyAdd.js +4 -4
  111. package/src/sap/ui/rta/plugin/EasyRemove.js +5 -5
  112. package/src/sap/ui/rta/plugin/LocalReset.js +25 -25
  113. package/src/sap/ui/rta/plugin/Plugin.js +20 -20
  114. package/src/sap/ui/rta/plugin/RTAElementMover.js +42 -42
  115. package/src/sap/ui/rta/plugin/Remove.js +11 -11
  116. package/src/sap/ui/rta/plugin/Rename.js +7 -7
  117. package/src/sap/ui/rta/plugin/RenameHandler.js +17 -17
  118. package/src/sap/ui/rta/plugin/Resize.js +62 -62
  119. package/src/sap/ui/rta/plugin/Selection.js +14 -14
  120. package/src/sap/ui/rta/plugin/Settings.js +20 -20
  121. package/src/sap/ui/rta/plugin/Split.js +7 -7
  122. package/src/sap/ui/rta/plugin/Stretch.js +4 -4
  123. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +94 -87
  124. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +18 -18
  125. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +98 -99
  126. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +144 -144
  127. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +3 -4
  128. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +67 -67
  129. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +38 -39
  130. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +1 -0
  131. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +29 -29
  132. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +5 -5
  133. package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
  134. package/src/sap/ui/rta/service/Action.js +36 -37
  135. package/src/sap/ui/rta/service/ControllerExtension.js +4 -4
  136. package/src/sap/ui/rta/service/Outline.js +59 -59
  137. package/src/sap/ui/rta/service/Property.js +125 -125
  138. package/src/sap/ui/rta/service/Receiver.js +78 -77
  139. package/src/sap/ui/rta/service/Selection.js +6 -6
  140. package/src/sap/ui/rta/service/SupportTools.js +188 -37
  141. package/src/sap/ui/rta/service/index.js +1 -1
  142. package/src/sap/ui/rta/themes/base/FlexSupportExtension.less +14 -0
  143. package/src/sap/ui/rta/themes/base/library.source.less +2 -1
  144. package/src/sap/ui/rta/toolbar/Adaptation.js +81 -26
  145. package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
  146. package/src/sap/ui/rta/toolbar/Base.js +17 -15
  147. package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -2
  148. package/src/sap/ui/rta/toolbar/Fiori.js +8 -8
  149. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  150. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +4 -4
  151. package/src/sap/ui/rta/toolbar/Personalization.js +2 -2
  152. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  153. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +13 -6
  154. package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +2 -8
  155. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +2 -3
  156. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptationDialog.fragment.xml +0 -2
  157. package/src/sap/ui/rta/toolbar/translation/Translation.js +41 -41
  158. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +9 -9
  159. package/src/sap/ui/rta/util/Animation.js +5 -5
  160. package/src/sap/ui/rta/util/BindingsExtractor.js +33 -33
  161. package/src/sap/ui/rta/util/PluginManager.js +25 -25
  162. package/src/sap/ui/rta/util/PopupManager.js +27 -27
  163. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  164. package/src/sap/ui/rta/util/ServiceEventBus.js +3 -4
  165. package/src/sap/ui/rta/util/StylesLoader.js +9 -9
  166. package/src/sap/ui/rta/util/UrlParser.js +19 -19
  167. package/src/sap/ui/rta/util/adaptationStarter.js +34 -31
  168. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +23 -19
  169. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +61 -61
  170. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +76 -63
  171. package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +6 -6
  172. package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
  173. package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
  174. package/src/sap/ui/rta/util/hasStableId.js +2 -2
  175. package/src/sap/ui/rta/util/showMessageBox.js +4 -5
  176. package/src/sap/ui/rta/util/validateFlexEnabled.js +5 -5
  177. package/src/sap/ui/rta/util/validateStableIds.js +8 -8
  178. 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.115.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
- .then(function(mUShellServices) {
262
- this._mUShellServices = mUShellServices;
263
- ReloadManager.setUShellServices(mUShellServices);
264
- }.bind(this));
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, bIsAutomaticRestart))
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
- .then(createToolsMenu.bind(this));
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
- .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));
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
- .then(function() {
747
- return oChangeVisualization.triggerModeChange(this.getRootControl(), this.getToolbar());
748
- }.bind(this));
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
- .then(this._serializeToLrep.bind(this));
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
- .then(function(oSettings) {
960
- return !oSettings.isCustomerSystem() && sUriParam !== "true";
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
- .then(function() {
1125
- return this._pElementModified;
1126
- }.bind(this));
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
- .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);
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
- .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));
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
- .then(callbackFn);
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
- .catch(function(oError) {
1373
- Utils.showMessageBox("error", "MSG_SWITCH_ADAPTATION_FAILED", {error: oError});
1374
- Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
1375
- });
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
- .then(fnCallback)
1397
- .catch(function(oError) {
1398
- Utils.showMessageBox("error", "MSG_SWITCH_VERSION_FAILED", {error: oError});
1399
- Log.error("sap.ui.rta: " + oError.stack || oError.message || oError);
1400
- });
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(bIsAutomaticRestart) {
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
- .then(function(aArguments) {
1528
- var bTranslationAvailable = aArguments[1];
1529
- var bAppVariantsAvailable = mButtonsAvailability.saveAsAvailable;
1530
- var bExtendedOverview = bAppVariantsAvailable && RtaAppVariantFeature.isOverviewExtended();
1531
- var oUriParameters = UriParameters.fromURL(window.location.href);
1532
- // the "Visualization" tab should not be visible if the "fiori-tools-rta-mode" URL-parameter is set to any value but "false"
1533
- var bVisualizationButtonVisible;
1534
- bVisualizationButtonVisible = !oUriParameters.has("fiori-tools-rta-mode") || oUriParameters.get("fiori-tools-rta-mode") === "false";
1535
- var bFeedbackButtonVisible = Core.getConfiguration().getFlexibilityServices()[0].connector !== "LocalStorageConnector";
1536
- this.bPersistedDataTranslatable = false;
1537
-
1538
- this._oToolbarControlsModel = new JSONModel({
1539
- modeSwitcher: this.getMode(),
1540
- undo: {
1541
- enabled: false
1542
- },
1543
- redo: {
1544
- enabled: false
1545
- },
1546
- save: {
1547
- enabled: false
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
- translation: {
1550
- visible: bTranslationAvailable,
1551
- enabled: this.bPersistedDataTranslatable
1559
+ manageApps: {
1560
+ visible: bAppVariantsAvailable && !bExtendedOverview,
1561
+ enabled: bAppVariantsAvailable && !bExtendedOverview
1552
1562
  },
1553
- appVariantMenu: {
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
- this._oVersionsModel.setProperty("/publishVersionVisible", mButtonsAvailability.publishAvailable);
1588
+ this._oVersionsModel.setProperty("/publishVersionVisible", mButtonsAvailability.publishAvailable);
1590
1589
 
1591
- var oTranslationPromise = new Promise(function(resolve) {
1592
- if (!bTranslationAvailable) {
1593
- resolve();
1594
- return;
1595
- }
1590
+ var oTranslationPromise = new Promise(function(resolve) {
1591
+ if (!bTranslationAvailable) {
1592
+ resolve();
1593
+ return;
1594
+ }
1596
1595
 
1597
- TranslationAPI.getSourceLanguages({selector: this.getRootControlInstance(), layer: this.getLayer()})
1598
- .then(function(aSourceLanguages) {
1599
- this.bPersistedDataTranslatable = aSourceLanguages.length > 0;
1600
- this._oToolbarControlsModel.setProperty("/translation/enabled", this.bPersistedDataTranslatable);
1601
- }.bind(this)).finally(resolve);
1602
- }.bind(this));
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
- var oSaveAsPromise = new Promise(function(resolve) {
1605
- if (!bAppVariantsAvailable) {
1606
- resolve();
1607
- return;
1608
- }
1603
+ var oSaveAsPromise = new Promise(function(resolve) {
1604
+ if (!bAppVariantsAvailable) {
1605
+ resolve();
1606
+ return;
1607
+ }
1609
1608
 
1610
- RtaAppVariantFeature.isManifestSupported().then(function(bResult) {
1611
- this._oToolbarControlsModel.setProperty("/appVariantMenu/saveAs/enabled", bResult);
1612
- this._oToolbarControlsModel.setProperty("/appVariantMenu/overview/enabled", bResult);
1613
- this._oToolbarControlsModel.setProperty("/appVariantMenu/manageApps/enabled", bResult);
1614
- }.bind(this)).finally(resolve);
1615
- }.bind(this));
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
- this.getToolbar().setModel(this._oVersionsModel, "versions");
1618
- this.getToolbar().setModel(this._oContextBasedAdaptationsModel, "contextBasedAdaptations");
1619
- this.getToolbar().setModel(this._oToolbarControlsModel, "controls");
1619
+ this.getToolbar().setModel(this._oVersionsModel, "versions");
1620
+ this.getToolbar().setModel(this._oContextBasedAdaptationsModel, "contextBasedAdaptations");
1621
+ this.getToolbar().setModel(this._oToolbarControlsModel, "controls");
1620
1622
 
1621
- return Promise.all([oTranslationPromise, oSaveAsPromise]);
1622
- }.bind(this));
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 (oEvent) {
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 (oEvent) {
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 (oElementOverlay) {
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
- // Error handling when a command fails is done in the Stack
1777
- .catch(function(oError) {
1778
- if (oError && oError.message && oError.message.indexOf("The following Change cannot be applied because of a dependency") > -1) {
1779
- Utils.showMessageBox("error", "MSG_DEPENDENCY_ERROR", {error: oError});
1780
- }
1781
- Log.error("sap.ui.rta:", oError.message, oError.stack);
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
- .then(function(oService) {
1881
- if (this.bIsDestroyed) {
1882
- throw DtUtil.createError(
1883
- "RuntimeAuthoring#startService",
1884
- DtUtil.printf("RuntimeAuthoring instance is destroyed while initializing the service '{0}'", sName),
1885
- "sap.ui.rta"
1886
- );
1887
- }
1888
- if (!isPlainObject(oService)) {
1889
- throw DtUtil.createError(
1890
- "RuntimeAuthoring#startService",
1891
- DtUtil.printf("Invalid service format. Service should return simple javascript object after initialization. Service name = '{0}'", sName),
1892
- "sap.ui.rta"
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
- mService.status = SERVICE_STARTED;
1922
- fnResolve(Object.freeze(mService.exports));
1923
- }.bind(this))
1924
- .catch(fnReject);
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;