@openui5/sap.ui.rta 1.101.0 → 1.103.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/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 +144 -93
- 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 +2 -2
- package/src/sap/ui/rta/appVariant/Feature.js +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +7 -7
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +2 -2
- 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 +18 -11
- 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 +178 -36
- 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 +57 -242
- package/src/sap/ui/rta/toolbar/Base.js +5 -15
- 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/translation/DownloadTranslationDialog.fragment.xml +20 -17
- package/src/sap/ui/rta/toolbar/translation/Translation.js +105 -99
- package/src/sap/ui/rta/toolbar/translation/UploadTranslationDialog.fragment.xml +4 -2
- package/src/sap/ui/rta/toolbar/{VersionHistory.fragment.xml → versioning/VersionHistory.fragment.xml} +6 -4
- package/src/sap/ui/rta/toolbar/{VersionTitleDialog.fragment.xml → versioning/VersionTitleDialog.fragment.xml} +3 -2
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +271 -0
- 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 +102 -80
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +9 -3
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +1 -1
- 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 +24 -11
- package/src/sap/ui/rta/themes/sap_hcb/Toolbar.standalone.less +0 -9
|
@@ -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.103.0
|
|
42
57
|
*
|
|
43
58
|
* @constructor
|
|
44
59
|
* @private
|
|
@@ -49,79 +64,92 @@ sap.ui.define([
|
|
|
49
64
|
metadata: {
|
|
50
65
|
properties: {
|
|
51
66
|
toolbar: {
|
|
52
|
-
type: "sap.ui.rta.toolbar.Base"
|
|
67
|
+
type: "any" // "sap.ui.rta.toolbar.Base"
|
|
53
68
|
}
|
|
54
69
|
}
|
|
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>
|
|
@@ -2,24 +2,26 @@
|
|
|
2
2
|
xmlns="sap.m"
|
|
3
3
|
xmlns:core="sap.ui.core" >
|
|
4
4
|
<Popover
|
|
5
|
+
id="popover"
|
|
5
6
|
class="sapUiRtaVersionHistory"
|
|
6
7
|
showHeader="false"
|
|
7
8
|
placement="Bottom" >
|
|
8
9
|
<List
|
|
10
|
+
id="versionList"
|
|
9
11
|
class="sapUiRtaVersionsList"
|
|
10
|
-
visible="{
|
|
11
|
-
items="{versions>/versions}" >
|
|
12
|
+
visible="{= ${versions>/versions/length} > 0}"
|
|
13
|
+
items="{path: 'versions>/versions', groupHeaderFactory: '.getGroupHeaderFactory'}" >
|
|
12
14
|
<FeedListItem
|
|
13
15
|
text="{parts: [{path: 'versions>title'}, {path: 'versions>type'}], formatter: '.formatVersionTitle'}"
|
|
14
16
|
info="{versions>activatedBy}"
|
|
15
|
-
timestamp="{
|
|
17
|
+
timestamp="{parts: ['versions>activatedAt', 'versions>importedAt'], formatter: '.formatVersionTimeStamp'}"
|
|
16
18
|
type="Active"
|
|
17
19
|
press=".versionSelected"
|
|
18
20
|
highlight="{path: 'versions>type', formatter: '.formatHighlight'}"
|
|
19
21
|
highlightText="{path: 'versions>type', formatter: '.formatHighlightText'}"
|
|
20
22
|
showIcon="false" />
|
|
21
23
|
</List>
|
|
22
|
-
<List>
|
|
24
|
+
<List id="originalVersionList">
|
|
23
25
|
<FeedListItem
|
|
24
26
|
text="{i18n>TIT_ORIGINAL_APP}"
|
|
25
27
|
type="Active"
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
xmlns="sap.m"
|
|
3
3
|
xmlns:core="sap.ui.core" >
|
|
4
4
|
<Dialog
|
|
5
|
+
id="dialog"
|
|
5
6
|
title="{i18n>TIT_VERSION_TITLE_DIALOG}"
|
|
6
7
|
type="Message" >
|
|
7
8
|
<content>
|
|
8
9
|
<Input
|
|
9
|
-
id="
|
|
10
|
+
id="versionTitleInput"
|
|
10
11
|
type="Text"
|
|
11
12
|
maxLength="200"
|
|
12
13
|
liveChange=".onVersionTitleLiveChange"
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
</content>
|
|
16
17
|
<beginButton>
|
|
17
18
|
<Button
|
|
18
|
-
id="
|
|
19
|
+
id="confirmVersionTitleButton"
|
|
19
20
|
text="{i18n>BUT_VERSION_TITLE_DIALOG_CONFIRM}"
|
|
20
21
|
type="Emphasized"
|
|
21
22
|
enabled="false"
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/m/GroupHeaderListItem",
|
|
9
|
+
"sap/ui/base/ManagedObject",
|
|
10
|
+
"sap/ui/core/format/DateFormat",
|
|
11
|
+
"sap/ui/core/Fragment",
|
|
12
|
+
"sap/ui/core/library",
|
|
13
|
+
"sap/ui/fl/write/api/Version",
|
|
14
|
+
"sap/ui/model/Sorter",
|
|
15
|
+
"sap/ui/rta/Utils"
|
|
16
|
+
], function(
|
|
17
|
+
GroupHeaderListItem,
|
|
18
|
+
ManagedObject,
|
|
19
|
+
DateFormat,
|
|
20
|
+
Fragment,
|
|
21
|
+
coreLibrary,
|
|
22
|
+
Version,
|
|
23
|
+
Sorter,
|
|
24
|
+
Utils
|
|
25
|
+
) {
|
|
26
|
+
"use strict";
|
|
27
|
+
|
|
28
|
+
var MessageType = coreLibrary.MessageType;
|
|
29
|
+
var DRAFT_ACCENT_COLOR = "sapUiRtaDraftVersionAccent";
|
|
30
|
+
var ACTIVE_ACCENT_COLOR = "sapUiRtaActiveVersionAccent";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Controller for the <code>sap.ui.rta.toolbar.versioning.Versioning</code> controls.
|
|
34
|
+
* Contains implementation of versioning functionality.
|
|
35
|
+
*
|
|
36
|
+
* @class
|
|
37
|
+
*
|
|
38
|
+
* @author SAP SE
|
|
39
|
+
* @version 1.103.0
|
|
40
|
+
*
|
|
41
|
+
* @constructor
|
|
42
|
+
* @private
|
|
43
|
+
* @since 1.103
|
|
44
|
+
* @alias sap.ui.rta.toolbar.versioning.Versioning
|
|
45
|
+
*/
|
|
46
|
+
var Versioning = ManagedObject.extend("sap.ui.rta.toolbar.versioning.Versioning", {
|
|
47
|
+
metadata: {
|
|
48
|
+
properties: {
|
|
49
|
+
toolbar: {
|
|
50
|
+
type: "any" // "sap.ui.rta.toolbar.Base"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
constructor: function() {
|
|
55
|
+
ManagedObject.prototype.constructor.apply(this, arguments);
|
|
56
|
+
this.oTextResources = this.getToolbar().getTextResources();
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
function versionSelected(oEvent) {
|
|
61
|
+
var oVersionsBindingContext = oEvent.getSource().getBindingContext("versions");
|
|
62
|
+
var sVersion = Version.Number.Original;
|
|
63
|
+
|
|
64
|
+
if (oVersionsBindingContext) {
|
|
65
|
+
// the original Version does not have a version binding Context
|
|
66
|
+
sVersion = oVersionsBindingContext.getProperty("version");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
this.getToolbar().fireEvent("switchVersion", {version: sVersion});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function doesActiveVersionExists (aVersions) {
|
|
73
|
+
return aVersions.some(function (oVersion) {
|
|
74
|
+
return oVersion.type === Version.Type.Active;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ------ formatting ------
|
|
79
|
+
function formatOriginalAppHighlight(aVersions) {
|
|
80
|
+
return doesActiveVersionExists(aVersions) ? MessageType.None : MessageType.Success;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function formatOriginalAppHighlightText(aVersions) {
|
|
84
|
+
return doesActiveVersionExists(aVersions) ? this.oTextResources.getText("LBL_INACTIVE") : this.oTextResources.getText("LBL_ACTIVE");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function formatHighlight(sType) {
|
|
88
|
+
switch (sType) {
|
|
89
|
+
case Version.Type.Draft:
|
|
90
|
+
return MessageType.Warning;
|
|
91
|
+
case Version.Type.Active:
|
|
92
|
+
return MessageType.Success;
|
|
93
|
+
default:
|
|
94
|
+
return MessageType.None;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function formatHighlightText(sType) {
|
|
99
|
+
switch (sType) {
|
|
100
|
+
case Version.Type.Draft:
|
|
101
|
+
return this.oTextResources.getText("TIT_DRAFT");
|
|
102
|
+
case Version.Type.Active:
|
|
103
|
+
return this.oTextResources.getText("LBL_ACTIVE");
|
|
104
|
+
default:
|
|
105
|
+
return this.oTextResources.getText("LBL_INACTIVE");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function formatVersionTitle(sTitle, sType) {
|
|
110
|
+
if (sType === Version.Type.Draft) {
|
|
111
|
+
return this.oTextResources.getText("TIT_DRAFT");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return sTitle || this.oTextResources.getText("TIT_VERSION_1");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function formatVersionTimeStamp(sActivatedAtTimeStamp, sImportedAtTimeStamp) {
|
|
118
|
+
var sTimeStamp = sImportedAtTimeStamp || sActivatedAtTimeStamp;
|
|
119
|
+
|
|
120
|
+
if (!sTimeStamp) {
|
|
121
|
+
// in case of "Original App" and "Draft" no timestamp is set
|
|
122
|
+
return "";
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return DateFormat.getInstance({
|
|
126
|
+
format: "yMMMdjm"
|
|
127
|
+
}).format(new Date(sTimeStamp));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function getGroupHeaderFactory(oGroup) {
|
|
131
|
+
return new GroupHeaderListItem({
|
|
132
|
+
title: oGroup.key ? this.oTextResources.getText("TIT_VERSION_HISTORY_PUBLISHED") : this.oTextResources.getText("TIT_VERSION_HISTORY_UNPUBLISHED"),
|
|
133
|
+
upperCase: false,
|
|
134
|
+
visible: this.getToolbar().getModel("controls").getProperty("/publishVisible")
|
|
135
|
+
}).addStyleClass("sapUiRtaVersionHistoryGrouping").addStyleClass("sapUiRtaVersionHistory");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function setVersionButtonAccentColor(oVersionButton, sType) {
|
|
139
|
+
switch (sType) {
|
|
140
|
+
case Version.Type.Draft:
|
|
141
|
+
oVersionButton.addStyleClass(DRAFT_ACCENT_COLOR);
|
|
142
|
+
oVersionButton.removeStyleClass(ACTIVE_ACCENT_COLOR);
|
|
143
|
+
break;
|
|
144
|
+
case Version.Type.Active:
|
|
145
|
+
oVersionButton.addStyleClass(ACTIVE_ACCENT_COLOR);
|
|
146
|
+
oVersionButton.removeStyleClass(DRAFT_ACCENT_COLOR);
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
oVersionButton.removeStyleClass(ACTIVE_ACCENT_COLOR);
|
|
150
|
+
oVersionButton.removeStyleClass(DRAFT_ACCENT_COLOR);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
Versioning.prototype.formatVersionButtonText = function(aVersions, sDisplayedVersion) {
|
|
155
|
+
var sText = "";
|
|
156
|
+
var sType = "Active";
|
|
157
|
+
aVersions = aVersions || [];
|
|
158
|
+
|
|
159
|
+
if (sDisplayedVersion === undefined || sDisplayedVersion === Version.Number.Original) {
|
|
160
|
+
sText = this.oTextResources.getText("TIT_ORIGINAL_APP");
|
|
161
|
+
sType = Version.Type.Inactive;
|
|
162
|
+
if (aVersions.length === 0 || (aVersions.length === 1 && aVersions[0].type === Version.Type.Draft)) {
|
|
163
|
+
sType = Version.Type.Active;
|
|
164
|
+
}
|
|
165
|
+
} else {
|
|
166
|
+
var oDisplayedVersion = aVersions.find(function (oVersion) {
|
|
167
|
+
return oVersion.version === sDisplayedVersion;
|
|
168
|
+
});
|
|
169
|
+
if (oDisplayedVersion) {
|
|
170
|
+
sType = oDisplayedVersion.type;
|
|
171
|
+
if (sDisplayedVersion === Version.Number.Draft) {
|
|
172
|
+
sText = this.oTextResources.getText("TIT_DRAFT");
|
|
173
|
+
} else {
|
|
174
|
+
sText = oDisplayedVersion.title || this.oTextResources.getText("TIT_VERSION_1");
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
setVersionButtonAccentColor(this.getToolbar().getControl("versionButton"), sType);
|
|
179
|
+
return sText;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
Versioning.prototype.formatPublishVersionVisibility = function(bPublishVisible, bVersioningEnabled, sDisplayedVersion, sModeSwitcher) {
|
|
183
|
+
return bPublishVisible && bVersioningEnabled && sDisplayedVersion !== Version.Number.Draft && sModeSwitcher === "adaptation";
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
Versioning.prototype.formatDiscardDraftVisible = function(sDisplayedVersion, bVersioningEnabled, sModeSwitcher) {
|
|
187
|
+
return sDisplayedVersion === Version.Number.Draft && bVersioningEnabled && sModeSwitcher === "adaptation";
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
// ------ Dialog handling ------
|
|
191
|
+
Versioning.prototype.showVersionHistory = function(oEvent) {
|
|
192
|
+
var oVersionButton = oEvent.getSource();
|
|
193
|
+
|
|
194
|
+
if (!this._oVersionHistoryDialogPromise) {
|
|
195
|
+
this._oVersionHistoryDialogPromise = Fragment.load({
|
|
196
|
+
name: "sap.ui.rta.toolbar.versioning.VersionHistory",
|
|
197
|
+
id: this.getToolbar().getId() + "_fragment--sapUiRta_versionHistoryDialog",
|
|
198
|
+
controller: {
|
|
199
|
+
formatVersionTitle: formatVersionTitle.bind(this),
|
|
200
|
+
formatVersionTimeStamp: formatVersionTimeStamp,
|
|
201
|
+
formatHighlight: formatHighlight,
|
|
202
|
+
formatHighlightText: formatHighlightText.bind(this),
|
|
203
|
+
formatOriginalAppHighlight: formatOriginalAppHighlight,
|
|
204
|
+
formatOriginalAppHighlightText: formatOriginalAppHighlightText.bind(this),
|
|
205
|
+
versionSelected: versionSelected.bind(this),
|
|
206
|
+
getGroupHeaderFactory: getGroupHeaderFactory.bind(this)
|
|
207
|
+
}
|
|
208
|
+
}).then(function(oDialog) {
|
|
209
|
+
this.getToolbar().addDependent(oDialog);
|
|
210
|
+
return oDialog;
|
|
211
|
+
}.bind(this));
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return this._oVersionHistoryDialogPromise.then(function(oVersionsDialog) {
|
|
215
|
+
if (!oVersionsDialog.isOpen()) {
|
|
216
|
+
oVersionsDialog.openBy(oVersionButton);
|
|
217
|
+
if (this.getToolbar().getModel("controls").getProperty("/publishVisible")) {
|
|
218
|
+
var oList = this.getToolbar().getControl("versionHistoryDialog--versionList");
|
|
219
|
+
var oSorter = new Sorter({
|
|
220
|
+
path: "isPublished",
|
|
221
|
+
group: true
|
|
222
|
+
});
|
|
223
|
+
oList.getBinding("items").sort(oSorter);
|
|
224
|
+
}
|
|
225
|
+
} else {
|
|
226
|
+
oVersionsDialog.close();
|
|
227
|
+
}
|
|
228
|
+
}.bind(this));
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
Versioning.prototype.openActivateVersionDialog = function(sDisplayedVersion) {
|
|
232
|
+
if (!this._oActivateVersionDialogPromise) {
|
|
233
|
+
this._oActivateVersionDialogPromise = Fragment.load({
|
|
234
|
+
name: "sap.ui.rta.toolbar.versioning.VersionTitleDialog",
|
|
235
|
+
id: this.getToolbar().getId() + "_fragment--sapUiRta_activateVersionDialog",
|
|
236
|
+
controller: {
|
|
237
|
+
onConfirmVersioningDialog: function () {
|
|
238
|
+
var sVersionTitle = this.getToolbar().getControl("activateVersionDialog--versionTitleInput").getValue();
|
|
239
|
+
this.getToolbar().fireEvent("activate", {versionTitle: sVersionTitle});
|
|
240
|
+
this._oActivateVersionDialog.close();
|
|
241
|
+
}.bind(this),
|
|
242
|
+
onCancelVersioningDialog: function () {
|
|
243
|
+
this._oActivateVersionDialog.close();
|
|
244
|
+
}.bind(this),
|
|
245
|
+
onVersionTitleLiveChange: function (oEvent) {
|
|
246
|
+
var sValue = oEvent.getParameter("value");
|
|
247
|
+
this.getToolbar().getControl("activateVersionDialog--confirmVersionTitleButton").setEnabled(!!sValue);
|
|
248
|
+
}.bind(this)
|
|
249
|
+
}
|
|
250
|
+
}).then(function (oDialog) {
|
|
251
|
+
this._oActivateVersionDialog = oDialog;
|
|
252
|
+
oDialog.addStyleClass(Utils.getRtaStyleClassName());
|
|
253
|
+
this.getToolbar().addDependent(this._oActivateVersionDialog);
|
|
254
|
+
}.bind(this));
|
|
255
|
+
} else {
|
|
256
|
+
this.getToolbar().getControl("activateVersionDialog--versionTitleInput").setValue("");
|
|
257
|
+
this.getToolbar().getControl("activateVersionDialog--confirmVersionTitleButton").setEnabled(false);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
return this._oActivateVersionDialogPromise.then(function () {
|
|
261
|
+
var sTitle = this.oTextResources.getText("TIT_VERSION_TITLE_DIALOG");
|
|
262
|
+
if (sDisplayedVersion !== Version.Number.Draft) {
|
|
263
|
+
sTitle = this.oTextResources.getText("TIT_REACTIVATE_VERSION_TITLE_DIALOG");
|
|
264
|
+
}
|
|
265
|
+
this._oActivateVersionDialog.setTitle(sTitle);
|
|
266
|
+
return this._oActivateVersionDialog.open();
|
|
267
|
+
}.bind(this));
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
return Versioning;
|
|
271
|
+
});
|
|
@@ -68,7 +68,7 @@ sap.ui.define([
|
|
|
68
68
|
* Constructor for a new sap.ui.rta.util.PluginManager
|
|
69
69
|
* @extends sap.ui.base.ManagedObject
|
|
70
70
|
* @author SAP SE
|
|
71
|
-
* @version 1.
|
|
71
|
+
* @version 1.103.0
|
|
72
72
|
* @constructor
|
|
73
73
|
* @private
|
|
74
74
|
* @since 1.86
|
|
@@ -213,7 +213,7 @@ sap.ui.define([
|
|
|
213
213
|
if (
|
|
214
214
|
oFlexSettings.layer === Layer.CUSTOMER
|
|
215
215
|
&& oSettings
|
|
216
|
-
&&
|
|
216
|
+
&& oSettings.isPublicLayerAvailable()
|
|
217
217
|
) {
|
|
218
218
|
this._mDefaultPlugins["localReset"] = new LocalResetPlugin({
|
|
219
219
|
commandFactory: this._oCommandFactory
|