@openui5/sap.ui.rta 1.101.0 → 1.102.2
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/THIRDPARTY.txt +1 -1
- 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 +132 -83
- package/src/sap/ui/rta/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +6 -7
- package/src/sap/ui/rta/appVariant/Feature.js +3 -11
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +0 -17
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n.properties +0 -4
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ar.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_bg.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ca.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_cs.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_cy.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_da.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_de.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_el.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_GB.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_sappsd.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saprigi.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saptrc.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_es.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_es_MX.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_et.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fi.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr_CA.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_hi.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_hr.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_hu.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_id.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_it.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_iw.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ja.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_kk.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ko.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_lt.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_lv.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ms.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_nl.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_no.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_pl.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_pt.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_pt_PT.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ro.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ru.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_sh.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_sk.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_sl.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_sv.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_th.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_tr.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_uk.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_vi.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_zh_CN.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_zh_TW.properties +0 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/view/ManageApps.view.xml +0 -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 +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/command/CommandFactory.js +5 -2
- package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
- 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 -1
- 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 +3 -3
- package/src/sap/ui/rta/command/LocalReset.js +1 -1
- package/src/sap/ui/rta/command/Move.js +1 -1
- package/src/sap/ui/rta/command/Property.js +1 -1
- package/src/sap/ui/rta/command/Remove.js +1 -1
- package/src/sap/ui/rta/command/Rename.js +1 -1
- package/src/sap/ui/rta/command/Resize.js +1 -1
- package/src/sap/ui/rta/command/Reveal.js +1 -1
- package/src/sap/ui/rta/command/Settings.js +1 -1
- package/src/sap/ui/rta/command/Split.js +1 -1
- package/src/sap/ui/rta/command/Stack.js +1 -1
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +82 -0
- 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 +1 -1
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +11 -1
- package/src/sap/ui/rta/messagebundle_ar.properties +5 -0
- package/src/sap/ui/rta/messagebundle_bg.properties +7 -2
- package/src/sap/ui/rta/messagebundle_ca.properties +5 -0
- package/src/sap/ui/rta/messagebundle_cs.properties +5 -0
- package/src/sap/ui/rta/messagebundle_cy.properties +5 -0
- package/src/sap/ui/rta/messagebundle_da.properties +5 -0
- package/src/sap/ui/rta/messagebundle_de.properties +5 -0
- package/src/sap/ui/rta/messagebundle_el.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_GB.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +5 -0
- package/src/sap/ui/rta/messagebundle_es.properties +5 -0
- package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -0
- package/src/sap/ui/rta/messagebundle_et.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hu.properties +5 -0
- package/src/sap/ui/rta/messagebundle_id.properties +5 -0
- package/src/sap/ui/rta/messagebundle_it.properties +5 -0
- package/src/sap/ui/rta/messagebundle_iw.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ja.properties +5 -0
- package/src/sap/ui/rta/messagebundle_kk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ko.properties +5 -0
- package/src/sap/ui/rta/messagebundle_lt.properties +5 -0
- package/src/sap/ui/rta/messagebundle_lv.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ms.properties +5 -0
- package/src/sap/ui/rta/messagebundle_nl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_no.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pt.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ro.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ru.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sh.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sv.properties +5 -0
- package/src/sap/ui/rta/messagebundle_th.properties +5 -0
- package/src/sap/ui/rta/messagebundle_tr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_uk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_vi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -0
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +5 -0
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
- package/src/sap/ui/rta/plugin/Combine.js +1 -1
- package/src/sap/ui/rta/plugin/CompVariant.js +85 -66
- package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/plugin/Rename.js +1 -1
- package/src/sap/ui/rta/plugin/RenameHandler.js +3 -1
- package/src/sap/ui/rta/plugin/Resize.js +1 -1
- package/src/sap/ui/rta/plugin/Selection.js +1 -1
- package/src/sap/ui/rta/plugin/Settings.js +1 -1
- package/src/sap/ui/rta/plugin/Split.js +1 -1
- package/src/sap/ui/rta/plugin/Stretch.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +20 -10
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
- 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/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
- package/src/sap/ui/rta/service/Outline.js +1 -1
- package/src/sap/ui/rta/service/Property.js +1 -1
- package/src/sap/ui/rta/service/Selection.js +1 -1
- package/src/sap/ui/rta/themes/base/AddIFrame.less +37 -29
- package/src/sap/ui/rta/themes/base/ChangeVisualization.less +65 -62
- package/src/sap/ui/rta/themes/base/ContextMenu.less +25 -0
- package/src/sap/ui/rta/themes/base/Dialogs.less +79 -0
- package/src/sap/ui/rta/themes/base/FieldRepository.less +14 -61
- package/src/sap/ui/rta/themes/base/Overlay.less +52 -104
- package/src/sap/ui/rta/themes/base/OverlayWithScrollbar.less +7 -1
- package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +195 -38
- package/src/sap/ui/rta/themes/base/Toolbar.base.less +23 -154
- package/src/sap/ui/rta/themes/base/Toolbar.fiori.less +2 -21
- package/src/sap/ui/rta/themes/base/Toolbar.personalization.less +3 -14
- package/src/sap/ui/rta/themes/base/Toolbar.standalone.less +0 -9
- package/src/sap/ui/rta/themes/base/library.source.less +2 -0
- package/src/sap/ui/rta/themes/sap_hcb/ChangeVisualization.less +7 -0
- package/src/sap/ui/rta/themes/sap_hcb/ContextMenu.less +5 -0
- package/src/sap/ui/rta/themes/sap_hcb/Dialogs.less +28 -0
- package/src/sap/ui/rta/themes/sap_hcb/FieldRepository.less +18 -0
- package/src/sap/ui/rta/themes/sap_hcb/Overlay.less +52 -12
- package/src/sap/ui/rta/themes/sap_hcb/Toolbar.adaptation.less +38 -0
- package/src/sap/ui/rta/themes/sap_hcb/Toolbar.base.less +14 -2
- package/src/sap/ui/rta/themes/sap_hcb/Toolbar.personalization.less +8 -2
- package/src/sap/ui/rta/themes/sap_hcb/library.source.less +5 -2
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +29 -14
- package/src/sap/ui/rta/toolbar/Adaptation.js +65 -22
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- 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 +1 -1
- 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/VersionHistory.fragment.xml +2 -1
- package/src/sap/ui/rta/toolbar/translation/DownloadTranslationDialog.fragment.xml +20 -17
- package/src/sap/ui/rta/toolbar/translation/Translation.js +104 -98
- package/src/sap/ui/rta/toolbar/translation/UploadTranslationDialog.fragment.xml +4 -2
- package/src/sap/ui/rta/util/PluginManager.js +2 -2
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +108 -80
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +9 -3
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -6
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +23 -10
- package/src/sap/ui/rta/themes/sap_hcb/Toolbar.standalone.less +0 -9
|
@@ -5,31 +5,35 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/m/GroupHeaderListItem",
|
|
8
9
|
"sap/ui/core/format/DateFormat",
|
|
9
10
|
"sap/ui/core/Fragment",
|
|
10
11
|
"sap/ui/core/library",
|
|
11
|
-
"sap/ui/fl/
|
|
12
|
+
"sap/ui/fl/write/api/Version",
|
|
12
13
|
"sap/ui/rta/Utils",
|
|
13
14
|
"sap/ui/rta/toolbar/translation/Translation",
|
|
15
|
+
"sap/ui/fl/write/api/FeaturesAPI",
|
|
14
16
|
"sap/ui/rta/appVariant/Feature",
|
|
15
17
|
"sap/ui/rta/toolbar/Base",
|
|
18
|
+
"sap/ui/model/Sorter",
|
|
16
19
|
"sap/ui/Device"
|
|
17
|
-
],
|
|
18
|
-
|
|
20
|
+
], function(
|
|
21
|
+
GroupHeaderListItem,
|
|
19
22
|
DateFormat,
|
|
20
23
|
Fragment,
|
|
21
24
|
coreLibrary,
|
|
22
|
-
|
|
25
|
+
Version,
|
|
23
26
|
Utils,
|
|
24
27
|
Translation,
|
|
28
|
+
FeaturesAPI,
|
|
25
29
|
AppVariantFeature,
|
|
26
30
|
Base,
|
|
31
|
+
Sorter,
|
|
27
32
|
Device
|
|
28
33
|
) {
|
|
29
34
|
"use strict";
|
|
30
35
|
|
|
31
36
|
var MessageType = coreLibrary.MessageType;
|
|
32
|
-
var Versions = flexLibrary.Versions;
|
|
33
37
|
|
|
34
38
|
/**
|
|
35
39
|
* Constructor for a new sap.ui.rta.toolbar.Adaptation control
|
|
@@ -39,7 +43,7 @@ function(
|
|
|
39
43
|
* @extends sap.ui.rta.toolbar.Base
|
|
40
44
|
*
|
|
41
45
|
* @author SAP SE
|
|
42
|
-
* @version 1.
|
|
46
|
+
* @version 1.102.2
|
|
43
47
|
*
|
|
44
48
|
* @constructor
|
|
45
49
|
* @private
|
|
@@ -62,6 +66,7 @@ function(
|
|
|
62
66
|
save: {},
|
|
63
67
|
restore: {},
|
|
64
68
|
transport: {},
|
|
69
|
+
publishVersion: {},
|
|
65
70
|
modeChange: {},
|
|
66
71
|
activate: {},
|
|
67
72
|
discardDraft: {},
|
|
@@ -114,8 +119,13 @@ function(
|
|
|
114
119
|
oButton.setIcon(sIcon || "");
|
|
115
120
|
}
|
|
116
121
|
|
|
117
|
-
Adaptation.prototype.
|
|
118
|
-
return sDisplayedVersion
|
|
122
|
+
Adaptation.prototype.formatPublishVersionVisibility = function (bPublishVisible, bVersioningEnabled, sDisplayedVersion, sModeSwitcher) {
|
|
123
|
+
return bPublishVisible && bVersioningEnabled && sDisplayedVersion !== Version.Number.Draft && sModeSwitcher === "adaptation";
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
Adaptation.prototype.formatDiscardDraftVisible = function (sDisplayedVersion, bVersioningEnabled, sModeSwitcher) {
|
|
128
|
+
return sDisplayedVersion === Version.Number.Draft && bVersioningEnabled && sModeSwitcher === "adaptation";
|
|
119
129
|
};
|
|
120
130
|
|
|
121
131
|
Adaptation.prototype.formatVersionButtonText = function (aVersions, sDisplayedVersion) {
|
|
@@ -124,7 +134,7 @@ function(
|
|
|
124
134
|
var sType = "Active";
|
|
125
135
|
aVersions = aVersions || [];
|
|
126
136
|
|
|
127
|
-
if (sDisplayedVersion === undefined || sDisplayedVersion ===
|
|
137
|
+
if (sDisplayedVersion === undefined || sDisplayedVersion === Version.Number.Original) {
|
|
128
138
|
sText = oTextResources.getText("TIT_ORIGINAL_APP");
|
|
129
139
|
sType = "inactive";
|
|
130
140
|
if (aVersions.length === 0 || (aVersions.length === 1 && aVersions[0].type === "draft")) {
|
|
@@ -136,7 +146,7 @@ function(
|
|
|
136
146
|
});
|
|
137
147
|
if (oDisplayedVersion) {
|
|
138
148
|
sType = oDisplayedVersion.type;
|
|
139
|
-
if (sDisplayedVersion ===
|
|
149
|
+
if (sDisplayedVersion === Version.Number.Draft) {
|
|
140
150
|
sText = oTextResources.getText("TIT_DRAFT");
|
|
141
151
|
} else {
|
|
142
152
|
sText = oDisplayedVersion.title || oTextResources.getText("TIT_VERSION_1");
|
|
@@ -213,7 +223,7 @@ function(
|
|
|
213
223
|
|
|
214
224
|
Adaptation.prototype.versionSelected = function (oEvent) {
|
|
215
225
|
var oVersionsBindingContext = oEvent.getSource().getBindingContext("versions");
|
|
216
|
-
var sVersion =
|
|
226
|
+
var sVersion = Version.Number.Original;
|
|
217
227
|
|
|
218
228
|
if (oVersionsBindingContext) {
|
|
219
229
|
// the original Version does not have a version binding Context
|
|
@@ -229,7 +239,7 @@ function(
|
|
|
229
239
|
if (!this.oVersionDialogPromise) {
|
|
230
240
|
this.oVersionDialogPromise = Fragment.load({
|
|
231
241
|
name: "sap.ui.rta.toolbar.VersionHistory",
|
|
232
|
-
id: this.getId() + "
|
|
242
|
+
id: this.getId() + "_fragment--sapUiRta_versionHistoryDialog",
|
|
233
243
|
controller: {
|
|
234
244
|
formatVersionTitle: this.formatVersionTitle.bind(this),
|
|
235
245
|
formatVersionTimeStamp: this.formatVersionTimeStamp.bind(this),
|
|
@@ -238,26 +248,39 @@ function(
|
|
|
238
248
|
formatHighlightText: this.formatHighlightText.bind(this),
|
|
239
249
|
formatOriginalAppHighlight: this.formatOriginalAppHighlight.bind(this),
|
|
240
250
|
formatOriginalAppHighlightText: this.formatOriginalAppHighlightText.bind(this),
|
|
241
|
-
versionSelected: this.versionSelected.bind(this)
|
|
251
|
+
versionSelected: this.versionSelected.bind(this),
|
|
252
|
+
getGroupHeaderFactory: this.getGroupHeaderFactory.bind(this)
|
|
242
253
|
}
|
|
243
|
-
}).then(function
|
|
244
|
-
oVersionButton.addDependent(
|
|
245
|
-
return
|
|
254
|
+
}).then(function(oDialog) {
|
|
255
|
+
oVersionButton.addDependent(oDialog);
|
|
256
|
+
return oDialog;
|
|
246
257
|
});
|
|
247
258
|
}
|
|
248
259
|
|
|
249
260
|
return this.oVersionDialogPromise.then(function (oVersionsDialog) {
|
|
250
261
|
if (!oVersionsDialog.isOpen()) {
|
|
251
262
|
oVersionsDialog.openBy(oVersionButton);
|
|
263
|
+
if (this.getModel("controls").getProperty("/publishVisible")) {
|
|
264
|
+
var oList = this.getControl("versionHistoryDialog--versionList");
|
|
265
|
+
var oSorter = new Sorter({
|
|
266
|
+
path: "isPublished",
|
|
267
|
+
group: true
|
|
268
|
+
});
|
|
269
|
+
oList.getBinding("items").sort(oSorter);
|
|
270
|
+
}
|
|
252
271
|
} else {
|
|
253
272
|
oVersionsDialog.close();
|
|
254
273
|
}
|
|
255
|
-
});
|
|
274
|
+
}.bind(this));
|
|
256
275
|
};
|
|
257
276
|
|
|
258
|
-
Adaptation.prototype.
|
|
259
|
-
var
|
|
260
|
-
return
|
|
277
|
+
Adaptation.prototype.getGroupHeaderFactory = function (oGroup) {
|
|
278
|
+
var oTextResources = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
279
|
+
return new GroupHeaderListItem({
|
|
280
|
+
title: oGroup.key ? oTextResources.getText("TIT_VERSION_HISTORY_PUBLISHED") : oTextResources.getText("TIT_VERSION_HISTORY_UNPUBLISHED"),
|
|
281
|
+
upperCase: false,
|
|
282
|
+
visible: this.getModel("controls").getProperty("/publishVisible")
|
|
283
|
+
}).addStyleClass("sapUiRtaVersionHistoryGrouping").addStyleClass("sapUiRtaVersionHistory");
|
|
261
284
|
};
|
|
262
285
|
|
|
263
286
|
Adaptation.prototype.showRestore = function (bVersioningEnabled) {
|
|
@@ -332,16 +355,20 @@ function(
|
|
|
332
355
|
activate: this._openVersionTitleDialog.bind(this),
|
|
333
356
|
discardDraft: this.eventHandler.bind(this, "DiscardDraft"),
|
|
334
357
|
formatDiscardDraftVisible: this.formatDiscardDraftVisible.bind(this),
|
|
358
|
+
formatPublishVersionVisibility: this.formatPublishVersionVisibility.bind(this),
|
|
335
359
|
modeChange: this.eventHandler.bind(this, "ModeChange"),
|
|
336
|
-
|
|
360
|
+
openDownloadTranslationDialog: onOpenDownloadTranslationDialog.bind(this),
|
|
361
|
+
openUploadTranslationDialog: onOpenUploadTranslationDialog.bind(this),
|
|
337
362
|
undo: this.eventHandler.bind(this, "Undo"),
|
|
338
363
|
redo: this.eventHandler.bind(this, "Redo"),
|
|
339
364
|
openChangeCategorySelectionPopover: this.eventHandler.bind(this, "OpenChangeCategorySelectionPopover"),
|
|
340
365
|
manageApps: onManageAppsPressed.bind(this),
|
|
341
366
|
appVariantOverview: onOverviewPressed.bind(this),
|
|
342
367
|
saveAs: onSaveAsPressed.bind(this),
|
|
368
|
+
formatSaveAsEnabled: formatSaveAsEnabled,
|
|
343
369
|
restore: this.eventHandler.bind(this, "Restore"),
|
|
344
370
|
publish: this.eventHandler.bind(this, "Transport"),
|
|
371
|
+
publishVersion: this.eventHandler.bind(this, "PublishVersion"),
|
|
345
372
|
exit: this.eventHandler.bind(this, "Exit"),
|
|
346
373
|
formatVersionButtonText: this.formatVersionButtonText.bind(this),
|
|
347
374
|
showVersionHistory: this.showVersionHistory.bind(this),
|
|
@@ -350,6 +377,22 @@ function(
|
|
|
350
377
|
});
|
|
351
378
|
};
|
|
352
379
|
|
|
380
|
+
function onOpenDownloadTranslationDialog() {
|
|
381
|
+
var mPropertyBag = {
|
|
382
|
+
layer: this.getRtaInformation().flexSettings.layer,
|
|
383
|
+
selector: this.getRtaInformation().rootControl
|
|
384
|
+
};
|
|
385
|
+
this.addExtension("translation", Translation).openDownloadTranslationDialog(mPropertyBag);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function onOpenUploadTranslationDialog() {
|
|
389
|
+
this.addExtension("translation", Translation).openUploadTranslationDialog();
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function formatSaveAsEnabled(bGeneralSaveAsEnabled, sDisplayedVersion) {
|
|
393
|
+
return bGeneralSaveAsEnabled && sDisplayedVersion !== Version.Number.Draft;
|
|
394
|
+
}
|
|
395
|
+
|
|
353
396
|
function onSaveAsPressed() {
|
|
354
397
|
AppVariantFeature.onSaveAs(true, true, this.getRtaInformation().flexSettings.layer, null);
|
|
355
398
|
}
|
|
@@ -411,7 +454,7 @@ function(
|
|
|
411
454
|
return oDialogPromise.then(function () {
|
|
412
455
|
var oTextResources = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
413
456
|
var sTitle = oTextResources.getText("TIT_VERSION_TITLE_DIALOG");
|
|
414
|
-
if (sDisplayedVersion !==
|
|
457
|
+
if (sDisplayedVersion !== Version.Number.Draft) {
|
|
415
458
|
sTitle = oTextResources.getText("TIT_REACTIVATE_VERSION_TITLE_DIALOG");
|
|
416
459
|
}
|
|
417
460
|
this._oDialog.setTitle(sTitle);
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
showHeader="false"
|
|
7
7
|
placement="Bottom" >
|
|
8
8
|
<List
|
|
9
|
+
id="versionList"
|
|
9
10
|
class="sapUiRtaVersionsList"
|
|
10
11
|
visible="{path: 'versions>/versions/length', formatter: '.formatVersionTableVisibility'}"
|
|
11
|
-
items="{versions>/versions}" >
|
|
12
|
+
items="{path: 'versions>/versions', groupHeaderFactory: '.getGroupHeaderFactory'}" >
|
|
12
13
|
<FeedListItem
|
|
13
14
|
text="{parts: [{path: 'versions>title'}, {path: 'versions>type'}], formatter: '.formatVersionTitle'}"
|
|
14
15
|
info="{versions>activatedBy}"
|
|
@@ -13,26 +13,28 @@
|
|
|
13
13
|
text="{i18n>MSG_DOWNLOAD_CHANGED_TEXTS}"
|
|
14
14
|
class="sapUiTinyMarginBottom">
|
|
15
15
|
</Label>
|
|
16
|
-
<
|
|
16
|
+
<MessageStrip
|
|
17
|
+
id="dirtyChangesExistsMessage"
|
|
18
|
+
text="{i18n>MSG_DOWNLOAD_CHANGED_TEXTS_DIRTY_CHANGES_EXIST}"
|
|
19
|
+
class="sapUiTinyMarginBottom"
|
|
20
|
+
visible="{translation>/translationRelevantDirtyChangesExist}">
|
|
21
|
+
</MessageStrip>
|
|
22
|
+
<Select
|
|
17
23
|
width="100%"
|
|
18
|
-
id="
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
value="{translation>/targetLanguage}"
|
|
30
|
-
placeholder="{i18n>TXT_TARGET_LANGUAGE}">
|
|
31
|
-
</Input>
|
|
32
|
-
</VBox>
|
|
24
|
+
id="selectedSourceLanguage"
|
|
25
|
+
items="{translation>/sourceLanguages}"
|
|
26
|
+
selectedKey="{translation>/sourceLanguage}">
|
|
27
|
+
<core:Item key="{translation>}" text="{translation>}"/>
|
|
28
|
+
</Select>
|
|
29
|
+
<Input
|
|
30
|
+
width="100%"
|
|
31
|
+
id="selectedTargetLanguage"
|
|
32
|
+
value="{translation>/targetLanguage}"
|
|
33
|
+
placeholder="{i18n>TXT_TARGET_LANGUAGE}">
|
|
34
|
+
</Input>
|
|
33
35
|
<beginButton>
|
|
34
36
|
<Button
|
|
35
|
-
id="
|
|
37
|
+
id="downloadTranslation"
|
|
36
38
|
text="{i18n>BTN_DOWNLOAD_CHANGED_TEXTS}"
|
|
37
39
|
type="Emphasized"
|
|
38
40
|
icon="sap-icon://download"
|
|
@@ -41,6 +43,7 @@
|
|
|
41
43
|
</beginButton>
|
|
42
44
|
<endButton>
|
|
43
45
|
<Button
|
|
46
|
+
id="cancelDownloadTranslation"
|
|
44
47
|
text="{i18n>BUT_DOWNLOAD_CHANGED_TEXTS_CANCEL}"
|
|
45
48
|
press=".onCancelDownloadDialog" />
|
|
46
49
|
</endButton>
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
/* global FormData */
|
|
8
8
|
|
|
9
9
|
sap.ui.define([
|
|
10
|
+
"sap/base/Log",
|
|
10
11
|
"sap/ui/base/ManagedObject",
|
|
11
12
|
"sap/ui/core/Fragment",
|
|
12
13
|
"sap/ui/rta/Utils",
|
|
@@ -15,9 +16,11 @@ sap.ui.define([
|
|
|
15
16
|
"sap/m/MessageBox",
|
|
16
17
|
"sap/m/MessageToast",
|
|
17
18
|
"sap/ui/fl/write/api/TranslationAPI",
|
|
19
|
+
"sap/ui/fl/write/api/VersionsAPI",
|
|
18
20
|
"sap/ui/fl/Layer",
|
|
19
21
|
"sap/ui/core/util/File"
|
|
20
22
|
], function(
|
|
23
|
+
Log,
|
|
21
24
|
ManagedObject,
|
|
22
25
|
Fragment,
|
|
23
26
|
Utils,
|
|
@@ -26,11 +29,23 @@ sap.ui.define([
|
|
|
26
29
|
MessageBox,
|
|
27
30
|
MessageToast,
|
|
28
31
|
TranslationAPI,
|
|
32
|
+
VersionsAPI,
|
|
29
33
|
Layer,
|
|
30
34
|
FileUtil
|
|
31
35
|
) {
|
|
32
36
|
"use strict";
|
|
33
37
|
|
|
38
|
+
function showError (vError) {
|
|
39
|
+
var sErrorMessage = vError.userMessage || vError.stack || vError.message || vError.status || vError;
|
|
40
|
+
var oTextResources = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
41
|
+
Log.error(sErrorMessage);
|
|
42
|
+
var sMsg = oTextResources.getText("MSG_LREP_TRANSFER_ERROR") + "\n"
|
|
43
|
+
+ oTextResources.getText("MSG_ERROR_REASON", sErrorMessage);
|
|
44
|
+
MessageBox.error(sMsg, {
|
|
45
|
+
styleClass: Utils.getRtaStyleClassName()
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
34
49
|
/**
|
|
35
50
|
* Controller for the <code>sap.ui.rta.toolbar.translation.Translation</code> controls.
|
|
36
51
|
* Contains implementation of translation functionality.
|
|
@@ -38,7 +53,7 @@ sap.ui.define([
|
|
|
38
53
|
* @class
|
|
39
54
|
*
|
|
40
55
|
* @author SAP SE
|
|
41
|
-
* @version 1.
|
|
56
|
+
* @version 1.102.2
|
|
42
57
|
*
|
|
43
58
|
* @constructor
|
|
44
59
|
* @private
|
|
@@ -55,73 +70,86 @@ sap.ui.define([
|
|
|
55
70
|
},
|
|
56
71
|
constructor: function () {
|
|
57
72
|
ManagedObject.prototype.constructor.apply(this, arguments);
|
|
58
|
-
this._oTranslationModel = new JSONModel(
|
|
73
|
+
this._oTranslationModel = new JSONModel(getInitialTranslationModelData());
|
|
59
74
|
}
|
|
60
75
|
});
|
|
61
76
|
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
function downloadFile(oEvent) {
|
|
78
|
+
var oModel = oEvent.getSource().getModel("translation");
|
|
79
|
+
var sSourceLanguage = oModel.getProperty("/sourceLanguage");
|
|
80
|
+
var sTargetLanguage = oModel.getProperty("/targetLanguage");
|
|
81
|
+
var sFileName = sSourceLanguage + "_" + sTargetLanguage + "_" + "TranslationXLIFF";
|
|
82
|
+
|
|
83
|
+
var mPropertyBag = {
|
|
84
|
+
layer: Layer.CUSTOMER,
|
|
85
|
+
sourceLanguage: sSourceLanguage,
|
|
86
|
+
targetLanguage: sTargetLanguage,
|
|
87
|
+
selector: this.getToolbar().getRtaInformation().rootControl
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
var oSavePromise = new Promise(function (resolve) {
|
|
91
|
+
if (oModel.getProperty("/translationRelevantDirtyChangesExist")) {
|
|
92
|
+
oSavePromise = this.getToolbar().fireSave({
|
|
93
|
+
callback: resolve
|
|
94
|
+
});
|
|
95
|
+
} else {
|
|
96
|
+
resolve();
|
|
97
|
+
}
|
|
98
|
+
}.bind(this));
|
|
65
99
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
100
|
+
oSavePromise
|
|
101
|
+
.then(TranslationAPI.getTexts.bind(undefined, mPropertyBag))
|
|
102
|
+
.then(function (translationTextsXML) {
|
|
103
|
+
FileUtil.save(translationTextsXML, sFileName, "xml", "application/xml");
|
|
104
|
+
this._oDownloadDialog.close();
|
|
105
|
+
}.bind(this)).catch(function (e) {
|
|
106
|
+
showError(e);
|
|
107
|
+
});
|
|
69
108
|
}
|
|
70
109
|
|
|
71
|
-
function
|
|
110
|
+
Translation.prototype._createDownloadTranslationDialog = function() {
|
|
72
111
|
return Fragment.load({
|
|
73
112
|
name: "sap.ui.rta.toolbar.translation.DownloadTranslationDialog",
|
|
74
113
|
id: this.getToolbar().getId() + "_download_translation_fragment",
|
|
75
114
|
controller: {
|
|
76
|
-
onDownloadFile:
|
|
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),
|
|
115
|
+
onDownloadFile: downloadFile.bind(this),
|
|
94
116
|
onCancelDownloadDialog: function () {
|
|
95
|
-
this.
|
|
117
|
+
this._oDownloadDialog.close();
|
|
96
118
|
}.bind(this)
|
|
97
119
|
}
|
|
98
|
-
}).then(function (
|
|
99
|
-
this.
|
|
100
|
-
this.
|
|
101
|
-
this.getToolbar().addDependent(this.
|
|
120
|
+
}).then(function (oDownloadDialog) {
|
|
121
|
+
this._oDownloadDialog = oDownloadDialog;
|
|
122
|
+
this._oDownloadDialog.setModel(this._oTranslationModel, "translation");
|
|
123
|
+
this.getToolbar().addDependent(this._oDownloadDialog);
|
|
124
|
+
return oDownloadDialog;
|
|
102
125
|
}.bind(this));
|
|
103
|
-
}
|
|
126
|
+
};
|
|
104
127
|
|
|
105
|
-
function
|
|
128
|
+
Translation.prototype._createUploadTranslationDialog = function() {
|
|
106
129
|
var sUploadId = this.getToolbar().getId() + "_upload_translation_fragment";
|
|
107
130
|
return Fragment.load({
|
|
108
131
|
name: "sap.ui.rta.toolbar.translation.UploadTranslationDialog",
|
|
109
132
|
id: sUploadId,
|
|
110
133
|
controller: {
|
|
111
134
|
onCancelUploadDialog: function () {
|
|
112
|
-
this.
|
|
135
|
+
this._oUploadDialog.close();
|
|
136
|
+
}.bind(this),
|
|
137
|
+
formatUploadEnabled: function () {
|
|
138
|
+
var oFileUploader = sap.ui.getCore().byId(sUploadId + "--fileUploader");
|
|
139
|
+
return oFileUploader.checkFileReadable();
|
|
140
|
+
},
|
|
141
|
+
saveFiles: function(oEvent) {
|
|
142
|
+
this._oTranslationModel.setProperty("/file", oEvent.getParameter("files")[0]);
|
|
113
143
|
}.bind(this),
|
|
114
|
-
saveFiles: saveFiles.bind(this),
|
|
115
144
|
handleUploadPress: handleUploadPress.bind(this, sUploadId)
|
|
116
145
|
}
|
|
117
|
-
}).then(function (
|
|
118
|
-
this.
|
|
119
|
-
this.
|
|
120
|
-
this.getToolbar().addDependent(this.
|
|
121
|
-
return
|
|
146
|
+
}).then(function (oUploadDialog) {
|
|
147
|
+
this._oUploadDialog = oUploadDialog;
|
|
148
|
+
this._oUploadDialog.setModel(this._oTranslationModel, "translation");
|
|
149
|
+
this.getToolbar().addDependent(this._oUploadDialog);
|
|
150
|
+
return this._oUploadDialog;
|
|
122
151
|
}.bind(this));
|
|
123
|
-
}
|
|
124
|
-
|
|
152
|
+
};
|
|
125
153
|
|
|
126
154
|
function handleUploadPress(sUploadId) {
|
|
127
155
|
var oFileUploader = sap.ui.getCore().byId(sUploadId + "--fileUploader");
|
|
@@ -132,16 +160,21 @@ sap.ui.define([
|
|
|
132
160
|
payload: new FormData()
|
|
133
161
|
};
|
|
134
162
|
mPropertyBag.payload.append("file", this._oTranslationModel.getProperty("/file"), oFileUploader.getValue());
|
|
135
|
-
TranslationAPI.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
163
|
+
return TranslationAPI.uploadTranslationTexts(mPropertyBag).then(function () {
|
|
164
|
+
var oTextResources = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
165
|
+
var sMsg = oTextResources.getText("MSG_UPLOAD_TRANSLATION_SUCCESS");
|
|
166
|
+
MessageToast.show(sMsg, {
|
|
167
|
+
styleClass: Utils.getRtaStyleClassName()
|
|
168
|
+
});
|
|
169
|
+
this._oUploadDialog.close();
|
|
170
|
+
}.bind(this)).catch(function (e) {
|
|
171
|
+
showError(e);
|
|
139
172
|
}).finally(oFileUploader.clear.bind(oFileUploader));
|
|
140
173
|
}
|
|
141
174
|
}.bind(this));
|
|
142
175
|
}
|
|
143
176
|
|
|
144
|
-
function
|
|
177
|
+
function getInitialTranslationModelData() {
|
|
145
178
|
return Object.assign({}, {
|
|
146
179
|
sourceLanguage: "",
|
|
147
180
|
sourceLanguages: [],
|
|
@@ -150,67 +183,40 @@ sap.ui.define([
|
|
|
150
183
|
});
|
|
151
184
|
}
|
|
152
185
|
|
|
153
|
-
Translation.prototype.
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
-
if (!this._oPopoverPromise) {
|
|
157
|
-
this._oPopoverPromise = Fragment.load({
|
|
158
|
-
name: "sap.ui.rta.toolbar.translation.TranslationPopover",
|
|
159
|
-
id: this.getToolbar().getId() + "_translationPopoverDialog",
|
|
160
|
-
controller: {
|
|
161
|
-
openDownloadTranslationDialog: this.openDownloadTranslationDialog.bind(this),
|
|
162
|
-
openUploadTranslationDialog: this.openUploadTranslationDialog.bind(this)
|
|
163
|
-
}
|
|
164
|
-
}).then(function (oTranslationPopover) {
|
|
165
|
-
this._oPopover = oTranslationPopover;
|
|
166
|
-
oTranslationButton.addDependent(this._oPopover);
|
|
167
|
-
return this._oPopover;
|
|
168
|
-
}.bind(this));
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return this._oPopoverPromise.then(function (oTranslationDialog) {
|
|
172
|
-
if (!oTranslationDialog.isOpen()) {
|
|
173
|
-
oTranslationDialog.openBy(oTranslationButton);
|
|
174
|
-
} else {
|
|
175
|
-
oTranslationDialog.close();
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
};
|
|
186
|
+
Translation.prototype.openDownloadTranslationDialog = function (mPropertyBag) {
|
|
187
|
+
var bHasTranslationRelevantDirtyChange = TranslationAPI.hasTranslationRelevantDirtyChanges(mPropertyBag);
|
|
188
|
+
this._oTranslationModel.setProperty("/translationRelevantDirtyChangesExist", bHasTranslationRelevantDirtyChange);
|
|
179
189
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
this._oDialogPromise = resetDownloadTranslationDialog.call(this);
|
|
183
|
-
} else {
|
|
184
|
-
this._oDialogPromise = createDownloadTranslationDialog.call(this);
|
|
185
|
-
}
|
|
186
|
-
return this._oDialogPromise.then(function () {
|
|
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;
|
|
190
|
+
return TranslationAPI.getSourceLanguages(mPropertyBag)
|
|
191
|
+
.then(function (aSourceLanguages) {
|
|
193
192
|
if (aSourceLanguages) {
|
|
194
193
|
this._oTranslationModel.setProperty("/sourceLanguages", aSourceLanguages);
|
|
195
194
|
this._oTranslationModel.setProperty("/sourceLanguage", aSourceLanguages[0] || "");
|
|
196
195
|
}
|
|
197
|
-
this.getToolbar().addDependent(this._oDialogDownload);
|
|
198
|
-
this._oDialogDownload.open();
|
|
199
196
|
}.bind(this))
|
|
200
|
-
.
|
|
201
|
-
|
|
197
|
+
.then(function () {
|
|
198
|
+
if (this._oDownloadDialogPromise) {
|
|
199
|
+
this._oTranslationModel.setProperty("/targetLanguage", "");
|
|
200
|
+
} else {
|
|
201
|
+
this._oDownloadDialogPromise = this._createDownloadTranslationDialog();
|
|
202
|
+
}
|
|
203
|
+
return this._oDownloadDialogPromise;
|
|
204
|
+
}.bind(this))
|
|
205
|
+
.then(function (oDialog) {
|
|
206
|
+
return oDialog.open();
|
|
207
|
+
})
|
|
208
|
+
.catch(function (vError) {
|
|
209
|
+
showError(vError);
|
|
202
210
|
});
|
|
203
|
-
return this._oDialogDownload;
|
|
204
|
-
}.bind(this));
|
|
205
211
|
};
|
|
206
212
|
|
|
207
213
|
Translation.prototype.openUploadTranslationDialog = function () {
|
|
208
|
-
if (!this.
|
|
209
|
-
this.
|
|
214
|
+
if (!this._oUploadDialogPromise) {
|
|
215
|
+
this._oUploadDialogPromise = this._createUploadTranslationDialog();
|
|
210
216
|
}
|
|
211
|
-
return this.
|
|
212
|
-
this.getToolbar().addDependent(
|
|
213
|
-
return
|
|
217
|
+
return this._oUploadDialogPromise.then(function (oUploadDialog) {
|
|
218
|
+
this.getToolbar().addDependent(oUploadDialog);
|
|
219
|
+
return oUploadDialog.open();
|
|
214
220
|
}.bind(this));
|
|
215
221
|
};
|
|
216
222
|
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
sameFilenameAllowed="true"
|
|
19
19
|
fileType="xml"
|
|
20
20
|
width="100%"
|
|
21
|
+
value="{translation>/filePath}"
|
|
21
22
|
icon="sap-icon://upload"
|
|
22
23
|
change=".saveFiles">
|
|
23
24
|
<u:xhrSettings>
|
|
@@ -26,14 +27,15 @@
|
|
|
26
27
|
</u:FileUploader>
|
|
27
28
|
<beginButton>
|
|
28
29
|
<Button
|
|
29
|
-
id="
|
|
30
|
+
id="uploadTranslation"
|
|
30
31
|
text="{i18n>BTN_UPLOAD_CHANGED_TEXTS}"
|
|
32
|
+
enabled="{= !!${translation>/filePath}}"
|
|
31
33
|
type="Emphasized"
|
|
32
|
-
enabled="{= ${translation>/uploadChangedTexts}}"
|
|
33
34
|
press=".handleUploadPress" />
|
|
34
35
|
</beginButton>
|
|
35
36
|
<endButton>
|
|
36
37
|
<Button
|
|
38
|
+
id="cancelTranslationUpload"
|
|
37
39
|
text="{i18n>BUT_UPLOAD_CHANGED_TEXTS_CANCEL}"
|
|
38
40
|
press=".onCancelUploadDialog" />
|
|
39
41
|
</endButton>
|