@openui5/sap.ui.rta 1.96.5 → 1.99.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 (218) hide show
  1. package/.reuse/dep5 +26 -31
  2. package/THIRDPARTY.txt +15 -21
  3. package/package.json +6 -6
  4. package/src/sap/ui/rta/.library +1 -1
  5. package/src/sap/ui/rta/Client.js +1 -1
  6. package/src/sap/ui/rta/RuntimeAuthoring.js +217 -171
  7. package/src/sap/ui/rta/Utils.js +2 -2
  8. package/src/sap/ui/rta/api/startAdaptation.js +1 -2
  9. package/src/sap/ui/rta/api/startKeyUserAdaptation.js +2 -2
  10. package/src/sap/ui/rta/appContexts/AppContextsOverviewDialog.js +76 -0
  11. package/src/sap/ui/rta/appContexts/Component.js +31 -0
  12. package/src/sap/ui/rta/appContexts/controller/ManageContexts.controller.js +323 -0
  13. package/src/sap/ui/rta/appContexts/controller/RestAPIConnector.js +22 -0
  14. package/src/sap/ui/rta/appContexts/i18n/i18n.properties +47 -0
  15. package/src/sap/ui/rta/appContexts/i18n/i18n_ar.properties +23 -0
  16. package/src/sap/ui/rta/appContexts/i18n/i18n_bg.properties +23 -0
  17. package/src/sap/ui/rta/appContexts/i18n/i18n_ca.properties +23 -0
  18. package/src/sap/ui/rta/appContexts/i18n/i18n_cs.properties +23 -0
  19. package/src/sap/ui/rta/appContexts/i18n/i18n_cy.properties +23 -0
  20. package/src/sap/ui/rta/appContexts/i18n/i18n_da.properties +23 -0
  21. package/src/sap/ui/rta/appContexts/i18n/i18n_de.properties +23 -0
  22. package/src/sap/ui/rta/appContexts/i18n/i18n_el.properties +23 -0
  23. package/src/sap/ui/rta/appContexts/i18n/i18n_en.properties +23 -0
  24. package/src/sap/ui/rta/appContexts/i18n/i18n_en_GB.properties +23 -0
  25. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_sappsd.properties +23 -0
  26. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saprigi.properties +23 -0
  27. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saptrc.properties +23 -0
  28. package/src/sap/ui/rta/appContexts/i18n/i18n_es.properties +23 -0
  29. package/src/sap/ui/rta/appContexts/i18n/i18n_es_MX.properties +23 -0
  30. package/src/sap/ui/rta/appContexts/i18n/i18n_et.properties +23 -0
  31. package/src/sap/ui/rta/appContexts/i18n/i18n_fi.properties +23 -0
  32. package/src/sap/ui/rta/appContexts/i18n/i18n_fr.properties +23 -0
  33. package/src/sap/ui/rta/appContexts/i18n/i18n_fr_CA.properties +23 -0
  34. package/src/sap/ui/rta/appContexts/i18n/i18n_hi.properties +23 -0
  35. package/src/sap/ui/rta/appContexts/i18n/i18n_hr.properties +23 -0
  36. package/src/sap/ui/rta/appContexts/i18n/i18n_hu.properties +23 -0
  37. package/src/sap/ui/rta/appContexts/i18n/i18n_id.properties +23 -0
  38. package/src/sap/ui/rta/appContexts/i18n/i18n_it.properties +23 -0
  39. package/src/sap/ui/rta/appContexts/i18n/i18n_iw.properties +23 -0
  40. package/src/sap/ui/rta/appContexts/i18n/i18n_ja.properties +23 -0
  41. package/src/sap/ui/rta/appContexts/i18n/i18n_kk.properties +23 -0
  42. package/src/sap/ui/rta/appContexts/i18n/i18n_ko.properties +23 -0
  43. package/src/sap/ui/rta/appContexts/i18n/i18n_lt.properties +23 -0
  44. package/src/sap/ui/rta/appContexts/i18n/i18n_lv.properties +23 -0
  45. package/src/sap/ui/rta/appContexts/i18n/i18n_ms.properties +23 -0
  46. package/src/sap/ui/rta/appContexts/i18n/i18n_nl.properties +23 -0
  47. package/src/sap/ui/rta/appContexts/i18n/i18n_no.properties +23 -0
  48. package/src/sap/ui/rta/appContexts/i18n/i18n_pl.properties +23 -0
  49. package/src/sap/ui/rta/appContexts/i18n/i18n_pt.properties +23 -0
  50. package/src/sap/ui/rta/appContexts/i18n/i18n_pt_PT.properties +23 -0
  51. package/src/sap/ui/rta/appContexts/i18n/i18n_ro.properties +23 -0
  52. package/src/sap/ui/rta/appContexts/i18n/i18n_ru.properties +23 -0
  53. package/src/sap/ui/rta/appContexts/i18n/i18n_sh.properties +23 -0
  54. package/src/sap/ui/rta/appContexts/i18n/i18n_sk.properties +23 -0
  55. package/src/sap/ui/rta/appContexts/i18n/i18n_sl.properties +23 -0
  56. package/src/sap/ui/rta/appContexts/i18n/i18n_sv.properties +23 -0
  57. package/src/sap/ui/rta/appContexts/i18n/i18n_th.properties +23 -0
  58. package/src/sap/ui/rta/appContexts/i18n/i18n_tr.properties +23 -0
  59. package/src/sap/ui/rta/appContexts/i18n/i18n_uk.properties +23 -0
  60. package/src/sap/ui/rta/appContexts/i18n/i18n_vi.properties +23 -0
  61. package/src/sap/ui/rta/appContexts/i18n/i18n_zh_CN.properties +23 -0
  62. package/src/sap/ui/rta/appContexts/i18n/i18n_zh_TW.properties +23 -0
  63. package/src/sap/ui/rta/appContexts/index.html +25 -0
  64. package/src/sap/ui/rta/appContexts/manifest.json +52 -0
  65. package/src/sap/ui/rta/appContexts/view/EditContextsDialog.fragment.xml +76 -0
  66. package/src/sap/ui/rta/appContexts/view/ManageContexts.view.xml +103 -0
  67. package/src/sap/ui/rta/appContexts/view/SaveAsContextsDialog.fragment.xml +76 -0
  68. package/src/sap/ui/rta/appVariant/AppVariantDialog.js +7 -2
  69. package/src/sap/ui/rta/appVariant/AppVariantManager.js +13 -15
  70. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +4 -11
  71. package/src/sap/ui/rta/appVariant/Feature.js +22 -11
  72. package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +2 -1
  73. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  74. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  75. package/src/sap/ui/rta/command/AddXML.js +1 -1
  76. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
  77. package/src/sap/ui/rta/command/AppDescriptorCommand.js +4 -3
  78. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  79. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  80. package/src/sap/ui/rta/command/Combine.js +5 -1
  81. package/src/sap/ui/rta/command/CommandFactory.js +15 -11
  82. package/src/sap/ui/rta/command/CompositeCommand.js +5 -5
  83. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  84. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  85. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  86. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  87. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -6
  88. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  89. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  90. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  91. package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
  92. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  93. package/src/sap/ui/rta/command/Move.js +1 -1
  94. package/src/sap/ui/rta/command/Property.js +1 -1
  95. package/src/sap/ui/rta/command/Remove.js +1 -1
  96. package/src/sap/ui/rta/command/Rename.js +1 -1
  97. package/src/sap/ui/rta/command/Reveal.js +1 -1
  98. package/src/sap/ui/rta/command/Settings.js +1 -1
  99. package/src/sap/ui/rta/command/Split.js +1 -1
  100. package/src/sap/ui/rta/command/Stack.js +15 -21
  101. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  102. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  103. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  104. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  105. package/src/sap/ui/rta/enablement/elementActionTest.js +2 -2
  106. package/src/sap/ui/rta/library.js +2 -2
  107. package/src/sap/ui/rta/messagebundle.properties +43 -23
  108. package/src/sap/ui/rta/messagebundle_ar.properties +25 -13
  109. package/src/sap/ui/rta/messagebundle_bg.properties +27 -15
  110. package/src/sap/ui/rta/messagebundle_ca.properties +24 -12
  111. package/src/sap/ui/rta/messagebundle_cs.properties +25 -13
  112. package/src/sap/ui/rta/messagebundle_cy.properties +25 -13
  113. package/src/sap/ui/rta/messagebundle_da.properties +25 -13
  114. package/src/sap/ui/rta/messagebundle_de.properties +24 -12
  115. package/src/sap/ui/rta/messagebundle_el.properties +25 -13
  116. package/src/sap/ui/rta/messagebundle_en.properties +25 -13
  117. package/src/sap/ui/rta/messagebundle_en_GB.properties +25 -13
  118. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +25 -13
  119. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +25 -13
  120. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +27 -15
  121. package/src/sap/ui/rta/messagebundle_es.properties +25 -13
  122. package/src/sap/ui/rta/messagebundle_es_MX.properties +29 -17
  123. package/src/sap/ui/rta/messagebundle_et.properties +26 -14
  124. package/src/sap/ui/rta/messagebundle_fi.properties +24 -12
  125. package/src/sap/ui/rta/messagebundle_fr.properties +25 -13
  126. package/src/sap/ui/rta/messagebundle_fr_CA.properties +25 -13
  127. package/src/sap/ui/rta/messagebundle_hi.properties +25 -13
  128. package/src/sap/ui/rta/messagebundle_hr.properties +25 -13
  129. package/src/sap/ui/rta/messagebundle_hu.properties +24 -12
  130. package/src/sap/ui/rta/messagebundle_id.properties +29 -17
  131. package/src/sap/ui/rta/messagebundle_it.properties +26 -14
  132. package/src/sap/ui/rta/messagebundle_iw.properties +25 -13
  133. package/src/sap/ui/rta/messagebundle_ja.properties +25 -13
  134. package/src/sap/ui/rta/messagebundle_kk.properties +25 -13
  135. package/src/sap/ui/rta/messagebundle_ko.properties +25 -13
  136. package/src/sap/ui/rta/messagebundle_lt.properties +25 -13
  137. package/src/sap/ui/rta/messagebundle_lv.properties +24 -12
  138. package/src/sap/ui/rta/messagebundle_ms.properties +25 -13
  139. package/src/sap/ui/rta/messagebundle_nl.properties +25 -13
  140. package/src/sap/ui/rta/messagebundle_no.properties +25 -13
  141. package/src/sap/ui/rta/messagebundle_pl.properties +25 -13
  142. package/src/sap/ui/rta/messagebundle_pt.properties +24 -12
  143. package/src/sap/ui/rta/messagebundle_pt_PT.properties +24 -12
  144. package/src/sap/ui/rta/messagebundle_ro.properties +25 -13
  145. package/src/sap/ui/rta/messagebundle_ru.properties +24 -12
  146. package/src/sap/ui/rta/messagebundle_sh.properties +25 -13
  147. package/src/sap/ui/rta/messagebundle_sk.properties +25 -13
  148. package/src/sap/ui/rta/messagebundle_sl.properties +25 -13
  149. package/src/sap/ui/rta/messagebundle_sv.properties +25 -13
  150. package/src/sap/ui/rta/messagebundle_th.properties +30 -18
  151. package/src/sap/ui/rta/messagebundle_tr.properties +25 -13
  152. package/src/sap/ui/rta/messagebundle_uk.properties +27 -15
  153. package/src/sap/ui/rta/messagebundle_vi.properties +25 -13
  154. package/src/sap/ui/rta/messagebundle_zh_CN.properties +25 -13
  155. package/src/sap/ui/rta/messagebundle_zh_TW.properties +25 -13
  156. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  157. package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
  158. package/src/sap/ui/rta/plugin/Combine.js +10 -3
  159. package/src/sap/ui/rta/plugin/ControlVariant.js +5 -6
  160. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  161. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  162. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  163. package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
  164. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  165. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  166. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  167. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  168. package/src/sap/ui/rta/plugin/Remove.js +2 -2
  169. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  170. package/src/sap/ui/rta/plugin/RenameHandler.js +1 -14
  171. package/src/sap/ui/rta/plugin/Selection.js +35 -33
  172. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  173. package/src/sap/ui/rta/plugin/Split.js +2 -1
  174. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  175. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +53 -121
  176. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  177. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +0 -67
  178. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +9 -10
  179. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +3 -4
  180. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +17 -47
  181. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  182. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  183. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +1 -16
  184. package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
  185. package/src/sap/ui/rta/service/Action.js +1 -1
  186. package/src/sap/ui/rta/service/ControllerExtension.js +5 -6
  187. package/src/sap/ui/rta/service/Outline.js +83 -30
  188. package/src/sap/ui/rta/service/Property.js +1 -3
  189. package/src/sap/ui/rta/service/Selection.js +2 -1
  190. package/src/sap/ui/rta/themes/base/ChangeVisualization.less +57 -75
  191. package/src/sap/ui/rta/themes/base/OverlayWithScrollbar.less +54 -35
  192. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +1 -0
  193. package/src/sap/ui/rta/toolbar/Adaptation.js +12 -12
  194. package/src/sap/ui/rta/toolbar/Base.js +3 -3
  195. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  196. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  197. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +4 -4
  198. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  199. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  200. package/src/sap/ui/rta/toolbar/translation/DownloadTranslationDialog.fragment.xml +19 -10
  201. package/src/sap/ui/rta/toolbar/translation/Translation.js +146 -56
  202. package/src/sap/ui/rta/toolbar/translation/TranslationPopover.fragment.xml +8 -13
  203. package/src/sap/ui/rta/toolbar/translation/UploadTranslationDialog.fragment.xml +41 -0
  204. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  205. package/src/sap/ui/rta/util/PopupManager.js +3 -11
  206. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  207. package/src/sap/ui/rta/util/adaptationStarter.js +41 -3
  208. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +122 -132
  209. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +19 -40
  210. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -2
  211. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +106 -115
  212. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +37 -0
  213. package/src/sap/ui/rta/util/changeVisualization/categories/MoveVisualization.js +33 -0
  214. package/src/sap/ui/rta/util/changeVisualization/categories/RenameVisualization.js +16 -3
  215. package/src/sap/ui/rta/util/changeVisualization/categories/SplitVisualization.js +33 -0
  216. package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +9 -3
  217. package/src/sap/ui/rta/util/showMessageBox.js +4 -3
  218. package/src/sap/ui/rta/util/validateFlexEnabled.js +6 -5
@@ -22,7 +22,7 @@ function(
22
22
  * @extends sap.ui.rta.toolbar.Base
23
23
  *
24
24
  * @author SAP SE
25
- * @version 1.96.5
25
+ * @version 1.99.0
26
26
  *
27
27
  * @constructor
28
28
  * @private
@@ -20,7 +20,7 @@ function(
20
20
  * @extends sap.ui.rta.toolbar.Adaptation
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.96.5
23
+ * @version 1.99.0
24
24
  *
25
25
  * @constructor
26
26
  * @private
@@ -6,28 +6,37 @@
6
6
  type="Message"
7
7
  contentWidth="33%">
8
8
  <Label
9
+ labelFor="languageSelection"
9
10
  wrappingType="Hyphenated"
10
11
  wrapping="true"
11
12
  width="auto"
12
- text="{i18n>MSG_DOWNLOAD_CHANGED_TEXTS}">
13
+ text="{i18n>MSG_DOWNLOAD_CHANGED_TEXTS}"
14
+ class="sapUiTinyMarginBottom">
13
15
  </Label>
14
- <VBox width="100%">
15
- <ComboBox
16
+ <VBox
17
+ width="100%"
18
+ id="languageSelection">
19
+ <Select
16
20
  width="100%"
17
- value="{translation>/sourceLanguage}"
18
- id="sapUiRta_selectSourceLanguage"
19
- placeholder="{i18n>TXT_SOURCE_LANGUAGE}" />
20
- <ComboBox
21
+ id="selectedSourceLanguage"
22
+ items="{translation>/sourceLanguages}"
23
+ selectedKey="{translation>/sourceLanguage}">
24
+ <core:Item key="{translation>}" text="{translation>}"/>
25
+ </Select>
26
+ <Input
21
27
  width="100%"
22
- id="sapUiRta_selectTargetLanguage"
23
- placeholder="{i18n>TXT_TARGET_LANGUAGE}" />
28
+ id="selectedTargetLanguage"
29
+ value="{translation>/targetLanguage}"
30
+ placeholder="{i18n>TXT_TARGET_LANGUAGE}">
31
+ </Input>
24
32
  </VBox>
25
33
  <beginButton>
26
34
  <Button
27
35
  id="sapUiRta_downloadChangedTextsButton"
28
36
  text="{i18n>BTN_DOWNLOAD_CHANGED_TEXTS}"
29
37
  type="Emphasized"
30
- enabled="{= ${translation>/downloadChangedTexts}}"
38
+ icon="sap-icon://download"
39
+ enabled="{= !!${translation>/sourceLanguages}.length}"
31
40
  press=".onDownloadFile" />
32
41
  </beginButton>
33
42
  <endButton>
@@ -4,48 +4,33 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
 
7
+ /* global FormData */
8
+
7
9
  sap.ui.define([
8
10
  "sap/ui/base/ManagedObject",
9
11
  "sap/ui/core/Fragment",
10
12
  "sap/ui/rta/Utils",
11
- "sap/ui/model/json/JSONModel"
13
+ "sap/ui/fl/Utils",
14
+ "sap/ui/model/json/JSONModel",
15
+ "sap/m/MessageBox",
16
+ "sap/m/MessageToast",
17
+ "sap/ui/fl/write/api/TranslationAPI",
18
+ "sap/ui/fl/Layer",
19
+ "sap/ui/core/util/File"
12
20
  ], function(
13
21
  ManagedObject,
14
22
  Fragment,
15
23
  Utils,
16
- JSONModel
24
+ FlUtils,
25
+ JSONModel,
26
+ MessageBox,
27
+ MessageToast,
28
+ TranslationAPI,
29
+ Layer,
30
+ FileUtil
17
31
  ) {
18
32
  "use strict";
19
33
 
20
- var oDialog;
21
- var oPopover;
22
-
23
- function resetTranslationDialog() {
24
- this._oTranslationModel.setProperty("/sourceLanguage", "");
25
- this._oTranslationModel.setProperty("/downloadChangedTexts", false);
26
- return Promise.resolve(oDialog);
27
- }
28
-
29
- function createDownloadTranslationDialog() {
30
- return Fragment.load({
31
- name: "sap.ui.rta.toolbar.translation.DownloadTranslationDialog",
32
- id: this.getContext().getId() + "_download_translation_fragment",
33
- controller: {
34
- onDownloadFile: function () {
35
- oDialog.close();
36
- },
37
- onCancelDownloadDialog: function () {
38
- oDialog.close();
39
- }
40
- }
41
- }).then(function (oTranslationDialog) {
42
- oDialog = oTranslationDialog;
43
- oDialog.setModel(this._oTranslationModel, "translation");
44
- oDialog.addStyleClass(Utils.getRtaStyleClassName());
45
- this.getContext().addDependent(oDialog);
46
- }.bind(this));
47
- }
48
-
49
34
  /**
50
35
  * Controller for the <code>sap.ui.rta.toolbar.translation.Translation</code> controls.
51
36
  * Contains implementation of translation functionality.
@@ -53,7 +38,7 @@ sap.ui.define([
53
38
  * @class
54
39
  *
55
40
  * @author SAP SE
56
- * @version 1.96.5
41
+ * @version 1.99.0
57
42
  *
58
43
  * @constructor
59
44
  * @private
@@ -63,28 +48,107 @@ sap.ui.define([
63
48
  var Translation = ManagedObject.extend("sap.ui.rta.toolbar.translation.Translation", {
64
49
  metadata: {
65
50
  properties: {
66
- context: {
51
+ toolbar: {
67
52
  type: "sap.ui.rta.toolbar.Base"
68
53
  }
69
54
  }
70
55
  },
71
- constructor: function() {
56
+ constructor: function () {
72
57
  ManagedObject.prototype.constructor.apply(this, arguments);
73
- this._oTranslationModel = new JSONModel({
74
- sourceLanguage: "",
75
- downloadChangedTexts: false
76
- });
58
+ this._oTranslationModel = new JSONModel(getTranslationModelData());
77
59
  }
78
60
  });
79
61
 
80
- Translation.prototype.exit = function() {
81
- if (this._oDialogPromise) {
82
- this._oDialogPromise.then(oDialog.destroy.bind(oDialog));
83
- }
84
- if (this._oPopoverPromise) {
85
- this._oPopoverPromise.then(oPopover.destroy.bind(oPopover));
86
- }
87
- };
62
+ function saveFiles(oEvent) {
63
+ this._oTranslationModel.setProperty("/file", oEvent.getParameter("files")[0]);
64
+ }
65
+
66
+ function resetDownloadTranslationDialog() {
67
+ this._oTranslationModel.setData(getTranslationModelData());
68
+ return Promise.resolve(this._oDialogDownload);
69
+ }
70
+
71
+ function createDownloadTranslationDialog() {
72
+ return Fragment.load({
73
+ name: "sap.ui.rta.toolbar.translation.DownloadTranslationDialog",
74
+ id: this.getToolbar().getId() + "_download_translation_fragment",
75
+ controller: {
76
+ onDownloadFile: function (oEvent) {
77
+ var oModel = oEvent.getSource().getModel("translation");
78
+ var sSourceLanguage = oModel.getProperty("/sourceLanguage");
79
+ var sTargetLanguage = oModel.getProperty("/targetLanguage");
80
+ var sFileName = sSourceLanguage + "_" + sTargetLanguage + "_" + "TranslationXLIFF";
81
+
82
+ var mPropertyBag = {
83
+ layer: Layer.CUSTOMER,
84
+ sourceLanguage: sSourceLanguage,
85
+ targetLanguage: sTargetLanguage,
86
+ selector: this.getToolbar().getRtaInformation().rootControl
87
+ };
88
+ TranslationAPI.getTexts(mPropertyBag).then(function (translationTextsXML) {
89
+ FileUtil.save(translationTextsXML, sFileName, "xml", "application/xml");
90
+ }).catch(function (e) {
91
+ MessageBox.error("Translation texts export failed: " + e);
92
+ });
93
+ }.bind(this),
94
+ onCancelDownloadDialog: function () {
95
+ this._oDialogDownload.close();
96
+ }.bind(this)
97
+ }
98
+ }).then(function (oTranslationDialog) {
99
+ this._oDialogDownload = oTranslationDialog;
100
+ this._oDialogDownload.setModel(this._oTranslationModel, "translation");
101
+ this.getToolbar().addDependent(this._oDialogDownload);
102
+ }.bind(this));
103
+ }
104
+
105
+ function createUploadTranslationDialog() {
106
+ var sUploadId = this.getToolbar().getId() + "_upload_translation_fragment";
107
+ return Fragment.load({
108
+ name: "sap.ui.rta.toolbar.translation.UploadTranslationDialog",
109
+ id: sUploadId,
110
+ controller: {
111
+ onCancelUploadDialog: function () {
112
+ this._oDialogUpload.close();
113
+ }.bind(this),
114
+ saveFiles: saveFiles.bind(this),
115
+ handleUploadPress: handleUploadPress.bind(this, sUploadId)
116
+ }
117
+ }).then(function (oTranslationDialog) {
118
+ this._oDialogUpload = oTranslationDialog;
119
+ this._oDialogUpload.setModel(this._oTranslationModel, "translation");
120
+ this.getToolbar().addDependent(this._oDialogUpload);
121
+ return sUploadId;
122
+ }.bind(this));
123
+ }
124
+
125
+
126
+ function handleUploadPress(sUploadId) {
127
+ var oFileUploader = sap.ui.getCore().byId(sUploadId + "--fileUploader");
128
+ oFileUploader.checkFileReadable().then(function() {
129
+ if (this._oTranslationModel.getProperty("/file")) {
130
+ var mPropertyBag = {
131
+ layer: Layer.CUSTOMER,
132
+ payload: new FormData()
133
+ };
134
+ mPropertyBag.payload.append("file", this._oTranslationModel.getProperty("/file"), oFileUploader.getValue());
135
+ TranslationAPI.postTranslationTexts(mPropertyBag).then(function () {
136
+ MessageToast.show("Translation texts import successful");
137
+ }).catch(function (sError) {
138
+ MessageBox.error("Translation texts import failed: " + sError);
139
+ }).finally(oFileUploader.clear.bind(oFileUploader));
140
+ }
141
+ }.bind(this));
142
+ }
143
+
144
+ function getTranslationModelData() {
145
+ return Object.assign({}, {
146
+ sourceLanguage: "",
147
+ sourceLanguages: [],
148
+ downloadChangedTexts: false,
149
+ file: undefined
150
+ });
151
+ }
88
152
 
89
153
  Translation.prototype.showTranslationPopover = function (oEvent) {
90
154
  var oTranslationButton = oEvent.getSource();
@@ -92,15 +156,16 @@ sap.ui.define([
92
156
  if (!this._oPopoverPromise) {
93
157
  this._oPopoverPromise = Fragment.load({
94
158
  name: "sap.ui.rta.toolbar.translation.TranslationPopover",
95
- id: this.getContext().getId() + "_translationPopoverDialog",
159
+ id: this.getToolbar().getId() + "_translationPopoverDialog",
96
160
  controller: {
97
- openDownloadTranslationDialog: this.openDownloadTranslationDialog.bind(this)
161
+ openDownloadTranslationDialog: this.openDownloadTranslationDialog.bind(this),
162
+ openUploadTranslationDialog: this.openUploadTranslationDialog.bind(this)
98
163
  }
99
164
  }).then(function (oTranslationPopover) {
100
- oPopover = oTranslationPopover;
101
- oTranslationButton.addDependent(oTranslationPopover);
102
- return oTranslationPopover;
103
- });
165
+ this._oPopover = oTranslationPopover;
166
+ oTranslationButton.addDependent(this._oPopover);
167
+ return this._oPopover;
168
+ }.bind(this));
104
169
  }
105
170
 
106
171
  return this._oPopoverPromise.then(function (oTranslationDialog) {
@@ -113,14 +178,39 @@ sap.ui.define([
113
178
  };
114
179
 
115
180
  Translation.prototype.openDownloadTranslationDialog = function () {
116
- if (oDialog) {
117
- this._oDialogPromise = resetTranslationDialog.call(this);
181
+ if (this._oDialogDownload) {
182
+ this._oDialogPromise = resetDownloadTranslationDialog.call(this);
118
183
  } else {
119
184
  this._oDialogPromise = createDownloadTranslationDialog.call(this);
120
185
  }
121
186
  return this._oDialogPromise.then(function () {
122
- this.getContext().addDependent(oDialog);
123
- return oDialog.open();
187
+ var mPropertyBag = {
188
+ layer: Layer.CUSTOMER,
189
+ selector: this.getToolbar().getRtaInformation().rootControl
190
+ };
191
+ TranslationAPI.getSourceLanguages(mPropertyBag).then(function (oResponse) {
192
+ var aSourceLanguages = oResponse.sourceLanguages;
193
+ if (aSourceLanguages) {
194
+ this._oTranslationModel.setProperty("/sourceLanguages", aSourceLanguages);
195
+ this._oTranslationModel.setProperty("/sourceLanguage", aSourceLanguages[0] || "");
196
+ }
197
+ this.getToolbar().addDependent(this._oDialogDownload);
198
+ this._oDialogDownload.open();
199
+ }.bind(this))
200
+ .catch(function (e) {
201
+ MessageBox.error("Get translation source languages failed: " + e);
202
+ });
203
+ return this._oDialogDownload;
204
+ }.bind(this));
205
+ };
206
+
207
+ Translation.prototype.openUploadTranslationDialog = function () {
208
+ if (!this._oDialogUpload) {
209
+ this._oDialogPromise = createUploadTranslationDialog.call(this);
210
+ }
211
+ return this._oDialogPromise.then(function () {
212
+ this.getToolbar().addDependent(this._oDialogUpload);
213
+ return this._oDialogUpload.open();
124
214
  }.bind(this));
125
215
  };
126
216
 
@@ -2,18 +2,13 @@
2
2
  xmlns="sap.m"
3
3
  xmlns:core="sap.ui.core" >
4
4
  <Popover
5
- showHeader="false"
6
- placement="Bottom" >
7
- <List
8
- visible="true">
9
- <ActionListItem
10
- text="{i18n>TXT_DOWNLOAD_CHANGED_TEXTS}"
11
- type="Active"
12
- press=".openDownloadTranslationDialog"/>
13
- <ActionListItem
14
- text="{i18n>TXT_UPLOAD_TRANSLATIONS}"
15
- type="Active"
16
- press=".openDownloadTranslationDialog"/>
5
+ placement="Bottom"
6
+ showHeader="false">
7
+ <List>
8
+ <ActionListItem text="{i18n>BTN_OPEN_DOWNLOAD_TRANSLATION}"
9
+ press=".openDownloadTranslationDialog"/>
10
+ <ActionListItem text="{i18n>BTN_OPEN_UPLOAD_TRANSLATION}"
11
+ press=".openUploadTranslationDialog"/>
17
12
  </List>
18
13
  </Popover>
19
- </core:FragmentDefinition>
14
+ </core:FragmentDefinition>
@@ -0,0 +1,41 @@
1
+ <core:FragmentDefinition
2
+ xmlns="sap.m"
3
+ xmlns:core="sap.ui.core"
4
+ xmlns:u="sap.ui.unified">
5
+ <Dialog
6
+ title="{i18n>TIT_UPLOAD_CHANGED_TEXTS}"
7
+ type="Message">
8
+ <Label
9
+ labelFor="fileUploader"
10
+ wrappingType="Hyphenated"
11
+ wrapping="true"
12
+ width="auto"
13
+ text="{i18n>MSG_UPLOAD_CHANGED_TEXTS}"
14
+ class="sapUiTinyMarginBottom">
15
+ </Label>
16
+ <u:FileUploader
17
+ id="fileUploader"
18
+ sameFilenameAllowed="true"
19
+ fileType="xml"
20
+ width="100%"
21
+ icon="sap-icon://upload"
22
+ change=".saveFiles">
23
+ <u:xhrSettings>
24
+ <u:FileUploaderXHRSettings withCredentials = "true"/>
25
+ </u:xhrSettings>
26
+ </u:FileUploader>
27
+ <beginButton>
28
+ <Button
29
+ id="sapUiRta_uploadChangedTextsButton"
30
+ text="{i18n>BTN_UPLOAD_CHANGED_TEXTS}"
31
+ type="Emphasized"
32
+ enabled="{= ${translation>/uploadChangedTexts}}"
33
+ press=".handleUploadPress" />
34
+ </beginButton>
35
+ <endButton>
36
+ <Button
37
+ text="{i18n>BUT_UPLOAD_CHANGED_TEXTS_CANCEL}"
38
+ press=".onCancelUploadDialog" />
39
+ </endButton>
40
+ </Dialog>
41
+ </core:FragmentDefinition>
@@ -66,7 +66,7 @@ sap.ui.define([
66
66
  * Constructor for a new sap.ui.rta.util.PluginManager
67
67
  * @extends sap.ui.base.ManagedObject
68
68
  * @author SAP SE
69
- * @version 1.96.5
69
+ * @version 1.99.0
70
70
  * @constructor
71
71
  * @private
72
72
  * @since 1.86
@@ -4,7 +4,6 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
 
7
- /* global Map */
8
7
  sap.ui.define([
9
8
  "sap/ui/base/ManagedObject",
10
9
  "sap/m/InstanceManager",
@@ -41,7 +40,7 @@ sap.ui.define([
41
40
  * Constructor for a new sap.ui.rta.util.PopupManager
42
41
  * @extends sap.ui.base.ManagedObject
43
42
  * @author SAP SE
44
- * @version 1.96.5
43
+ * @version 1.99.0
45
44
  * @constructor
46
45
  * @private
47
46
  * @since 1.48
@@ -243,7 +242,7 @@ sap.ui.define([
243
242
 
244
243
  /**
245
244
  * Apply focus events to all open popups and set focus on the first.
246
- * @param {function} fnFocusEvent Function to apply to open popups
245
+ * @param {function} fnEvent - Function to apply to open popups
247
246
  * @private
248
247
  */
249
248
  PopupManager.prototype._applyPatchesToOpenPopups = function(fnEvent) {
@@ -256,7 +255,7 @@ sap.ui.define([
256
255
 
257
256
  /**
258
257
  * Remove focus events from all open popups.
259
- * @param {function} fnFocusEvent Function to apply to open popups
258
+ * @param {function} fnEvent - Function to apply to open popups
260
259
  * @private
261
260
  */
262
261
  PopupManager.prototype._removePatchesToOpenPopups = function(fnEvent) {
@@ -337,13 +336,6 @@ sap.ui.define([
337
336
  }
338
337
  };
339
338
 
340
- /**
341
- * Applies the passed function to the relevant open popups.
342
- *
343
- * @param {function} fnPopupMethod specifies function to be applied
344
- * @param {boolean} bFocus Set to true if the popup is in focus
345
- * @private
346
- */
347
339
  PopupManager.prototype._applyPopupAttributes = function(mPropertyBag) {
348
340
  //check if popups are open
349
341
  var oRelevantPopups = this.getCategorizedOpenPopups();
@@ -19,7 +19,7 @@ function(
19
19
  *
20
20
  * @extends sap.ui.core.EventBus
21
21
  * @author SAP SE
22
- * @version 1.96.5
22
+ * @version 1.99.0
23
23
  * @private
24
24
  * @since 1.56.0
25
25
  * @alias sap.ui.rta.util.ServiceEventBus
@@ -10,7 +10,9 @@ sap.ui.define([
10
10
  "sap/ui/fl/Layer",
11
11
  "sap/ui/fl/write/api/FeaturesAPI",
12
12
  "sap/ui/core/UIComponent",
13
- "sap/base/Log"
13
+ "sap/base/Log",
14
+ "sap/ui/fl/write/api/PersistenceWriteAPI",
15
+ "sap/ui/rta/util/showMessageBox"
14
16
  ], function(
15
17
  RuntimeAuthoring,
16
18
  Control,
@@ -18,7 +20,9 @@ sap.ui.define([
18
20
  Layer,
19
21
  FeaturesAPI,
20
22
  UIComponent,
21
- Log
23
+ Log,
24
+ PersistenceWriteAPI,
25
+ showMessageBox
22
26
  ) {
23
27
  "use strict";
24
28
 
@@ -38,7 +42,7 @@ sap.ui.define([
38
42
  * Starter util for UI adaptation.
39
43
  * With this API you are also able to modify the UI adaptation plugins list and or add some event handler functions to be called on start, failed and stop events.
40
44
  * @param {object} mOptions - Object with properties
41
- * @param {sap.ui.core.Element|sap.ui.core.UIComponent} mOptions.rootControl - Control instance from where UI adaptation should be started
45
+ * @param {sap.ui.core.Control|sap.ui.core.UIComponent} mOptions.rootControl - Control instance to get the AppComponent. This then is used to start UI adaptation.
42
46
  * @param {function} [loadPlugins] - Callback function that enables the modification of the default plugin list of UI adaptation. UI adaptation is passed to this function and it should return a promise
43
47
  * @param {function} [onStart] - Event handler function called on start event
44
48
  * @param {function} [onFailed] - Event handler function called on failed event
@@ -77,6 +81,40 @@ sap.ui.define([
77
81
  return oRta.start();
78
82
  })
79
83
  .then(function() {
84
+ if (mOptions.flexSettings.layer === "CUSTOMER") {
85
+ var mPropertyBag = {
86
+ oComponent: mOptions.rootControl,
87
+ selector: mOptions.rootControl,
88
+ invalidateCache: false,
89
+ includeVariants: true,
90
+ includeCtrlVariants: true,
91
+ currentLayer: Layer.CUSTOMER
92
+ };
93
+
94
+ PersistenceWriteAPI.getChangesWarning(mPropertyBag)
95
+ .then(function(oWarningMessage) {
96
+ if (oWarningMessage.showWarning) {
97
+ var oRtaResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
98
+ var oMessageProps = oWarningMessage.warningType === "mixedChangesWarning"
99
+ ? {
100
+ text: "MSG_ADAPTATION_STARTER_MIXED_CHANGES_WARNING",
101
+ title: "TIT_ADAPTATION_STARTER_MIXED_CHANGES_TITLE"
102
+ }
103
+ : {
104
+ text: "MSG_ADAPTATION_STARTER_NO_CHANGES_IN_P_WARNING",
105
+ title: "TIT_ADAPTATION_STARTER_NO_CHANGES_IN_P_TITLE"
106
+ };
107
+
108
+ showMessageBox(
109
+ oRtaResourceBundle.getText(oMessageProps.text),
110
+ {
111
+ title: oRtaResourceBundle.getText(oMessageProps.title)
112
+ },
113
+ "warning"
114
+ );
115
+ }
116
+ });
117
+ }
80
118
  return oRta;
81
119
  })
82
120
  .catch(function(vError) {