@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.
- package/.reuse/dep5 +26 -31
- package/THIRDPARTY.txt +15 -21
- package/package.json +6 -6
- package/src/sap/ui/rta/.library +1 -1
- package/src/sap/ui/rta/Client.js +1 -1
- package/src/sap/ui/rta/RuntimeAuthoring.js +217 -171
- package/src/sap/ui/rta/Utils.js +2 -2
- package/src/sap/ui/rta/api/startAdaptation.js +1 -2
- package/src/sap/ui/rta/api/startKeyUserAdaptation.js +2 -2
- package/src/sap/ui/rta/appContexts/AppContextsOverviewDialog.js +76 -0
- package/src/sap/ui/rta/appContexts/Component.js +31 -0
- package/src/sap/ui/rta/appContexts/controller/ManageContexts.controller.js +323 -0
- package/src/sap/ui/rta/appContexts/controller/RestAPIConnector.js +22 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n.properties +47 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ar.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_bg.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ca.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_cs.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_cy.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_da.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_de.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_el.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_en.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_GB.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_sappsd.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saprigi.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saptrc.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_es.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_es_MX.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_et.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_fi.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_fr.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_fr_CA.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_hi.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_hr.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_hu.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_id.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_it.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_iw.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ja.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_kk.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ko.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_lt.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_lv.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ms.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_nl.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_no.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_pl.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_pt.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_pt_PT.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ro.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_ru.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_sh.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_sk.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_sl.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_sv.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_th.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_tr.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_uk.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_vi.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_zh_CN.properties +23 -0
- package/src/sap/ui/rta/appContexts/i18n/i18n_zh_TW.properties +23 -0
- package/src/sap/ui/rta/appContexts/index.html +25 -0
- package/src/sap/ui/rta/appContexts/manifest.json +52 -0
- package/src/sap/ui/rta/appContexts/view/EditContextsDialog.fragment.xml +76 -0
- package/src/sap/ui/rta/appContexts/view/ManageContexts.view.xml +103 -0
- package/src/sap/ui/rta/appContexts/view/SaveAsContextsDialog.fragment.xml +76 -0
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +7 -2
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +13 -15
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +4 -11
- package/src/sap/ui/rta/appVariant/Feature.js +22 -11
- package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +2 -1
- package/src/sap/ui/rta/command/AddIFrame.js +1 -1
- package/src/sap/ui/rta/command/AddProperty.js +1 -1
- package/src/sap/ui/rta/command/AddXML.js +1 -1
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +4 -3
- package/src/sap/ui/rta/command/BaseCommand.js +1 -1
- package/src/sap/ui/rta/command/BindProperty.js +1 -1
- package/src/sap/ui/rta/command/Combine.js +5 -1
- package/src/sap/ui/rta/command/CommandFactory.js +15 -11
- package/src/sap/ui/rta/command/CompositeCommand.js +5 -5
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -6
- package/src/sap/ui/rta/command/CreateContainer.js +1 -1
- package/src/sap/ui/rta/command/CustomAdd.js +1 -1
- package/src/sap/ui/rta/command/FlexCommand.js +1 -1
- package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
- 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/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 +15 -21
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.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/elementActionTest.js +2 -2
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +43 -23
- package/src/sap/ui/rta/messagebundle_ar.properties +25 -13
- package/src/sap/ui/rta/messagebundle_bg.properties +27 -15
- package/src/sap/ui/rta/messagebundle_ca.properties +24 -12
- package/src/sap/ui/rta/messagebundle_cs.properties +25 -13
- package/src/sap/ui/rta/messagebundle_cy.properties +25 -13
- package/src/sap/ui/rta/messagebundle_da.properties +25 -13
- package/src/sap/ui/rta/messagebundle_de.properties +24 -12
- package/src/sap/ui/rta/messagebundle_el.properties +25 -13
- package/src/sap/ui/rta/messagebundle_en.properties +25 -13
- package/src/sap/ui/rta/messagebundle_en_GB.properties +25 -13
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +25 -13
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +25 -13
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +27 -15
- package/src/sap/ui/rta/messagebundle_es.properties +25 -13
- package/src/sap/ui/rta/messagebundle_es_MX.properties +29 -17
- package/src/sap/ui/rta/messagebundle_et.properties +26 -14
- package/src/sap/ui/rta/messagebundle_fi.properties +24 -12
- package/src/sap/ui/rta/messagebundle_fr.properties +25 -13
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +25 -13
- package/src/sap/ui/rta/messagebundle_hi.properties +25 -13
- package/src/sap/ui/rta/messagebundle_hr.properties +25 -13
- package/src/sap/ui/rta/messagebundle_hu.properties +24 -12
- package/src/sap/ui/rta/messagebundle_id.properties +29 -17
- package/src/sap/ui/rta/messagebundle_it.properties +26 -14
- package/src/sap/ui/rta/messagebundle_iw.properties +25 -13
- package/src/sap/ui/rta/messagebundle_ja.properties +25 -13
- package/src/sap/ui/rta/messagebundle_kk.properties +25 -13
- package/src/sap/ui/rta/messagebundle_ko.properties +25 -13
- package/src/sap/ui/rta/messagebundle_lt.properties +25 -13
- package/src/sap/ui/rta/messagebundle_lv.properties +24 -12
- package/src/sap/ui/rta/messagebundle_ms.properties +25 -13
- package/src/sap/ui/rta/messagebundle_nl.properties +25 -13
- package/src/sap/ui/rta/messagebundle_no.properties +25 -13
- package/src/sap/ui/rta/messagebundle_pl.properties +25 -13
- package/src/sap/ui/rta/messagebundle_pt.properties +24 -12
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +24 -12
- package/src/sap/ui/rta/messagebundle_ro.properties +25 -13
- package/src/sap/ui/rta/messagebundle_ru.properties +24 -12
- package/src/sap/ui/rta/messagebundle_sh.properties +25 -13
- package/src/sap/ui/rta/messagebundle_sk.properties +25 -13
- package/src/sap/ui/rta/messagebundle_sl.properties +25 -13
- package/src/sap/ui/rta/messagebundle_sv.properties +25 -13
- package/src/sap/ui/rta/messagebundle_th.properties +30 -18
- package/src/sap/ui/rta/messagebundle_tr.properties +25 -13
- package/src/sap/ui/rta/messagebundle_uk.properties +27 -15
- package/src/sap/ui/rta/messagebundle_vi.properties +25 -13
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +25 -13
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +25 -13
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
- package/src/sap/ui/rta/plugin/Combine.js +10 -3
- package/src/sap/ui/rta/plugin/ControlVariant.js +5 -6
- package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
- package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
- package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
- package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
- package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
- package/src/sap/ui/rta/plugin/Plugin.js +1 -1
- package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
- package/src/sap/ui/rta/plugin/Remove.js +2 -2
- package/src/sap/ui/rta/plugin/Rename.js +1 -1
- package/src/sap/ui/rta/plugin/RenameHandler.js +1 -14
- package/src/sap/ui/rta/plugin/Selection.js +35 -33
- package/src/sap/ui/rta/plugin/Settings.js +1 -1
- package/src/sap/ui/rta/plugin/Split.js +2 -1
- package/src/sap/ui/rta/plugin/Stretch.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +53 -121
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +0 -67
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +9 -10
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +3 -4
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +17 -47
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +1 -16
- package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
- package/src/sap/ui/rta/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +5 -6
- package/src/sap/ui/rta/service/Outline.js +83 -30
- package/src/sap/ui/rta/service/Property.js +1 -3
- package/src/sap/ui/rta/service/Selection.js +2 -1
- package/src/sap/ui/rta/themes/base/ChangeVisualization.less +57 -75
- package/src/sap/ui/rta/themes/base/OverlayWithScrollbar.less +54 -35
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +1 -0
- package/src/sap/ui/rta/toolbar/Adaptation.js +12 -12
- package/src/sap/ui/rta/toolbar/Base.js +3 -3
- package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
- package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +4 -4
- package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/translation/DownloadTranslationDialog.fragment.xml +19 -10
- package/src/sap/ui/rta/toolbar/translation/Translation.js +146 -56
- package/src/sap/ui/rta/toolbar/translation/TranslationPopover.fragment.xml +8 -13
- package/src/sap/ui/rta/toolbar/translation/UploadTranslationDialog.fragment.xml +41 -0
- package/src/sap/ui/rta/util/PluginManager.js +1 -1
- package/src/sap/ui/rta/util/PopupManager.js +3 -11
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +41 -3
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +122 -132
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +19 -40
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +106 -115
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +37 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/MoveVisualization.js +33 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/RenameVisualization.js +16 -3
- package/src/sap/ui/rta/util/changeVisualization/categories/SplitVisualization.js +33 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +9 -3
- package/src/sap/ui/rta/util/showMessageBox.js +4 -3
- package/src/sap/ui/rta/util/validateFlexEnabled.js +6 -5
|
@@ -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
|
|
15
|
-
|
|
16
|
+
<VBox
|
|
17
|
+
width="100%"
|
|
18
|
+
id="languageSelection">
|
|
19
|
+
<Select
|
|
16
20
|
width="100%"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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="
|
|
23
|
-
|
|
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
|
-
|
|
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/
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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.
|
|
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
|
-
|
|
101
|
-
oTranslationButton.addDependent(
|
|
102
|
-
return
|
|
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 (
|
|
117
|
-
this._oDialogPromise =
|
|
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
|
-
|
|
123
|
-
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
<List
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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>
|
|
@@ -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.
|
|
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}
|
|
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}
|
|
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();
|
|
@@ -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.
|
|
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) {
|