@openui5/sap.ui.rta 1.93.3 → 1.96.1
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 +6 -11
- package/THIRDPARTY.txt +10 -16
- 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 +160 -121
- package/src/sap/ui/rta/Utils.js +73 -1
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +4 -3
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +24 -17
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +107 -78
- package/src/sap/ui/rta/appVariant/Feature.js +5 -12
- package/src/sap/ui/rta/appVariant/Utils.js +10 -2
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +35 -20
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_de.properties +1 -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 +1 -1
- package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +4 -4
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +7 -4
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +7 -7
- 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 +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 +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +23 -9
- package/src/sap/ui/rta/messagebundle_ar.properties +8 -1
- package/src/sap/ui/rta/messagebundle_bg.properties +8 -1
- package/src/sap/ui/rta/messagebundle_ca.properties +8 -1
- package/src/sap/ui/rta/messagebundle_cs.properties +8 -1
- package/src/sap/ui/rta/messagebundle_cy.properties +13 -6
- package/src/sap/ui/rta/messagebundle_da.properties +8 -1
- package/src/sap/ui/rta/messagebundle_de.properties +23 -16
- package/src/sap/ui/rta/messagebundle_el.properties +9 -2
- package/src/sap/ui/rta/messagebundle_en.properties +8 -1
- package/src/sap/ui/rta/messagebundle_en_GB.properties +8 -1
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +14 -7
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +14 -7
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +14 -7
- package/src/sap/ui/rta/messagebundle_es.properties +8 -1
- package/src/sap/ui/rta/messagebundle_es_MX.properties +8 -1
- package/src/sap/ui/rta/messagebundle_et.properties +8 -1
- package/src/sap/ui/rta/messagebundle_fi.properties +10 -3
- package/src/sap/ui/rta/messagebundle_fr.properties +8 -1
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +8 -1
- package/src/sap/ui/rta/messagebundle_hi.properties +8 -1
- package/src/sap/ui/rta/messagebundle_hr.properties +8 -1
- package/src/sap/ui/rta/messagebundle_hu.properties +8 -1
- package/src/sap/ui/rta/messagebundle_id.properties +10 -3
- package/src/sap/ui/rta/messagebundle_it.properties +8 -1
- package/src/sap/ui/rta/messagebundle_iw.properties +8 -1
- package/src/sap/ui/rta/messagebundle_ja.properties +8 -1
- package/src/sap/ui/rta/messagebundle_kk.properties +8 -1
- package/src/sap/ui/rta/messagebundle_ko.properties +9 -2
- package/src/sap/ui/rta/messagebundle_lt.properties +8 -1
- package/src/sap/ui/rta/messagebundle_lv.properties +8 -1
- package/src/sap/ui/rta/messagebundle_ms.properties +8 -1
- package/src/sap/ui/rta/messagebundle_nl.properties +8 -1
- package/src/sap/ui/rta/messagebundle_no.properties +8 -1
- package/src/sap/ui/rta/messagebundle_pl.properties +8 -1
- package/src/sap/ui/rta/messagebundle_pt.properties +8 -1
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +8 -1
- package/src/sap/ui/rta/messagebundle_ro.properties +8 -1
- package/src/sap/ui/rta/messagebundle_ru.properties +8 -1
- package/src/sap/ui/rta/messagebundle_sh.properties +8 -1
- package/src/sap/ui/rta/messagebundle_sk.properties +8 -1
- package/src/sap/ui/rta/messagebundle_sl.properties +8 -1
- package/src/sap/ui/rta/messagebundle_sv.properties +10 -3
- package/src/sap/ui/rta/messagebundle_th.properties +8 -1
- package/src/sap/ui/rta/messagebundle_tr.properties +8 -1
- package/src/sap/ui/rta/messagebundle_uk.properties +8 -1
- package/src/sap/ui/rta/messagebundle_vi.properties +8 -1
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +8 -1
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +8 -1
- 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 +1 -2
- package/src/sap/ui/rta/plugin/ControlVariant.js +10 -5
- 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 +52 -2
- 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 +18 -61
- 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 +4 -1
- package/src/sap/ui/rta/plugin/Selection.js +35 -1
- package/src/sap/ui/rta/plugin/Settings.js +15 -14
- package/src/sap/ui/rta/plugin/Split.js +1 -1
- package/src/sap/ui/rta/plugin/Stretch.js +133 -139
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +505 -0
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.fragment.xml +74 -0
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +97 -260
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +4 -2
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +136 -831
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +117 -0
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +337 -0
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +8 -5
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +31 -29
- 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 +109 -62
- 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/ChangeVisualization.less +16 -0
- package/src/sap/ui/rta/themes/base/Overlay.less +59 -58
- package/src/sap/ui/rta/{assets/InPageStyles.css → themes/base/OverlayWithScrollbar.less} +14 -12
- package/src/sap/ui/rta/themes/base/Toolbar.base.less +12 -1
- package/src/sap/ui/rta/themes/base/library.source.less +3 -1
- package/src/sap/ui/rta/themes/sap_hcb/Overlay.less +2 -3
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +67 -48
- package/src/sap/ui/rta/toolbar/Adaptation.js +43 -38
- package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +4 -5
- package/src/sap/ui/rta/toolbar/Base.js +64 -18
- package/src/sap/ui/rta/toolbar/BaseRenderer.js +2 -2
- package/src/sap/ui/rta/toolbar/Fiori.js +9 -9
- package/src/sap/ui/rta/toolbar/FioriLike.js +4 -4
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +98 -0
- package/src/sap/ui/rta/toolbar/Personalization.js +8 -8
- package/src/sap/ui/rta/toolbar/Standalone.js +4 -4
- package/src/sap/ui/rta/toolbar/translation/Translation.js +52 -39
- package/src/sap/ui/rta/util/BindingsExtractor.js +24 -27
- package/src/sap/ui/rta/util/PluginManager.js +2 -4
- 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 +3 -3
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +21 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +71 -96
- package/ui5.yaml +4 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangesListPopover.fragment.xml +0 -23
|
@@ -4,68 +4,35 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
-
"sap/base/Log",
|
|
8
|
-
"sap/m/Button",
|
|
9
|
-
"sap/m/CustomListItem",
|
|
10
|
-
"sap/m/Dialog",
|
|
11
|
-
"sap/m/Label",
|
|
12
|
-
"sap/m/library",
|
|
13
|
-
"sap/m/List",
|
|
14
|
-
"sap/m/SearchField",
|
|
15
|
-
"sap/m/Text",
|
|
16
|
-
"sap/m/ToolbarSpacer",
|
|
17
|
-
"sap/m/Toolbar",
|
|
18
|
-
"sap/m/ScrollContainer",
|
|
19
|
-
"sap/m/VBox",
|
|
20
7
|
"sap/ui/base/ManagedObject",
|
|
8
|
+
"sap/ui/core/Fragment",
|
|
21
9
|
"sap/ui/fl/write/api/FieldExtensibility",
|
|
22
|
-
"sap/ui/layout/VerticalLayout",
|
|
23
10
|
"sap/ui/model/json/JSONModel",
|
|
24
11
|
"sap/ui/model/Filter",
|
|
25
12
|
"sap/ui/model/FilterOperator",
|
|
13
|
+
"sap/ui/model/resource/ResourceModel",
|
|
26
14
|
"sap/ui/model/Sorter",
|
|
27
15
|
"sap/ui/rta/Utils"
|
|
28
16
|
], function(
|
|
29
|
-
Log,
|
|
30
|
-
Button,
|
|
31
|
-
ListItem,
|
|
32
|
-
Dialog,
|
|
33
|
-
Label,
|
|
34
|
-
mobileLibrary,
|
|
35
|
-
List,
|
|
36
|
-
SearchField,
|
|
37
|
-
Text,
|
|
38
|
-
ToolbarSpacer,
|
|
39
|
-
Toolbar,
|
|
40
|
-
ScrollContainer,
|
|
41
|
-
VBox,
|
|
42
17
|
ManagedObject,
|
|
18
|
+
Fragment,
|
|
43
19
|
FieldExtensibility,
|
|
44
|
-
VerticalLayout,
|
|
45
20
|
JSONModel,
|
|
46
21
|
Filter,
|
|
47
22
|
FilterOperator,
|
|
23
|
+
ResourceModel,
|
|
48
24
|
Sorter,
|
|
49
25
|
Utils
|
|
50
26
|
) {
|
|
51
27
|
"use strict";
|
|
52
28
|
|
|
53
|
-
// shortcut for sap.m.ButtonType
|
|
54
|
-
var ButtonType = mobileLibrary.ButtonType;
|
|
55
|
-
|
|
56
|
-
// shortcut for sap.m.ListType
|
|
57
|
-
var ListType = mobileLibrary.ListType;
|
|
58
|
-
|
|
59
|
-
// shortcut for sap.m.LabelDesign
|
|
60
|
-
var LabelDesign = mobileLibrary.LabelDesign;
|
|
61
|
-
|
|
62
29
|
/**
|
|
63
30
|
* Constructor for a new sap.ui.rta.plugin.additionalElements.AddElementsDialog control.
|
|
64
31
|
*
|
|
65
32
|
* @class Context - Dialog for available Fields in Runtime Authoring
|
|
66
33
|
* @extends sap.ui.base.ManagedObject
|
|
67
34
|
* @author SAP SE
|
|
68
|
-
* @version 1.
|
|
35
|
+
* @version 1.96.1
|
|
69
36
|
* @constructor
|
|
70
37
|
* @private
|
|
71
38
|
* @since 1.44
|
|
@@ -96,222 +63,98 @@ sap.ui.define([
|
|
|
96
63
|
}
|
|
97
64
|
});
|
|
98
65
|
|
|
66
|
+
var oRTAResourceModel;
|
|
67
|
+
|
|
99
68
|
/**
|
|
100
69
|
* Initialize the Dialog
|
|
101
70
|
*
|
|
102
71
|
* @private
|
|
103
72
|
*/
|
|
104
73
|
AddElementsDialog.prototype.init = function() {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// otherwise invalidate/filter/... is not working correctly
|
|
110
|
-
this._oDialog = new Dialog().addStyleClass("sapUIRtaFieldRepositoryDialog");
|
|
111
|
-
this._oDialog.addStyleClass(Utils.getRtaStyleClassName());
|
|
112
|
-
this._oDialog.addStyleClass("sapUiNoContentPadding");
|
|
113
|
-
this._oDialog.setModel(new JSONModel({
|
|
114
|
-
elements: []
|
|
115
|
-
}));
|
|
116
|
-
|
|
117
|
-
var aContent = this._createContent();
|
|
118
|
-
var aButtons = this._createButtons();
|
|
119
|
-
aContent.forEach(function(oContent) {
|
|
120
|
-
this._oDialog.addContent(oContent);
|
|
121
|
-
}, this);
|
|
122
|
-
aButtons.forEach(function(oButton) {
|
|
123
|
-
this._oDialog.addButton(oButton);
|
|
124
|
-
}, this);
|
|
125
|
-
this._oDialog.setInitialFocus(this._oInput);
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
AddElementsDialog.prototype.exit = function() {
|
|
129
|
-
this._oDialog.destroy();
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Create the Content of the Dialog
|
|
134
|
-
*
|
|
135
|
-
* @returns {object} list containes inputList and oScrollContainer objects
|
|
136
|
-
* @private
|
|
137
|
-
*/
|
|
138
|
-
AddElementsDialog.prototype._createContent = function() {
|
|
139
|
-
// SearchField
|
|
140
|
-
this._oInput = new SearchField({
|
|
141
|
-
width: "100%",
|
|
142
|
-
liveChange: [this._updateModelFilter, this]
|
|
74
|
+
this._oDialogPromise = Fragment.load({
|
|
75
|
+
id: this.getId(),
|
|
76
|
+
name: "sap.ui.rta.plugin.additionalElements.AddElementsDialog",
|
|
77
|
+
controller: this
|
|
143
78
|
});
|
|
144
79
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
80
|
+
this._oDialogModel = new JSONModel({
|
|
81
|
+
elements: [],
|
|
82
|
+
customFieldEnabled: false,
|
|
83
|
+
customFieldVisible: false,
|
|
84
|
+
businessContextVisible: false,
|
|
85
|
+
customFieldButtonTooltip: "",
|
|
86
|
+
businessContextTexts: [{text: ""}] //empty element in first place, to be replaced by the headerText (see: addExtensionData)
|
|
150
87
|
});
|
|
151
88
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
tooltip: "",
|
|
157
|
-
enabled: this.getCustomFieldEnabled(),
|
|
158
|
-
press: [this._redirectToCustomFieldCreation, this]
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
// Toolbar
|
|
162
|
-
this._oToolbarSpacer1 = new ToolbarSpacer();
|
|
163
|
-
this.oInputFields = new Toolbar({
|
|
164
|
-
content: [this._oInput, oResortButton, this._oToolbarSpacer1, this._oCustomFieldButton]
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
//Business Context Display
|
|
168
|
-
this._oBCContainer = new VerticalLayout({
|
|
169
|
-
visible: this.getBusinessContextVisible(),
|
|
170
|
-
content: [
|
|
171
|
-
new Text({
|
|
172
|
-
text: ""
|
|
173
|
-
})
|
|
174
|
-
]
|
|
175
|
-
}).addStyleClass("sapUIRtaBusinessContextContainer");
|
|
176
|
-
|
|
177
|
-
// Fields of the List
|
|
178
|
-
var oFieldName = new Label({
|
|
179
|
-
design: LabelDesign.Standard,
|
|
180
|
-
text: {
|
|
181
|
-
parts: [{path: "label"}, {path: "parentPropertyName"}, {path: "duplicateName"}],
|
|
182
|
-
formatter: function(sLabel, sParentPropertyName, bDuplicateName) {
|
|
183
|
-
if (bDuplicateName && sParentPropertyName) {
|
|
184
|
-
sLabel += " (" + sParentPropertyName + ")";
|
|
185
|
-
}
|
|
186
|
-
return sLabel;
|
|
187
|
-
}
|
|
89
|
+
this._oDialogPromise.then(function (oDialog) {
|
|
90
|
+
oDialog.setModel(this._oDialogModel);
|
|
91
|
+
if (!oRTAResourceModel) {
|
|
92
|
+
oRTAResourceModel = new ResourceModel({bundleName: "sap.ui.rta.messagebundle"});
|
|
188
93
|
}
|
|
189
|
-
|
|
94
|
+
oDialog.setModel(oRTAResourceModel, "i18n");
|
|
190
95
|
|
|
191
|
-
|
|
192
|
-
text: {
|
|
193
|
-
parts: [{path: "originalLabel"}],
|
|
194
|
-
formatter: function(sOriginalLabel) {
|
|
195
|
-
if (sOriginalLabel) {
|
|
196
|
-
return this._oTextResources.getText("LBL_FREP", sOriginalLabel);
|
|
197
|
-
}
|
|
198
|
-
return "";
|
|
199
|
-
}.bind(this)
|
|
200
|
-
},
|
|
201
|
-
visible: {
|
|
202
|
-
parts: [{path: "originalLabel"}],
|
|
203
|
-
formatter: function(sOriginalLabel) {
|
|
204
|
-
if (sOriginalLabel) {
|
|
205
|
-
return true;
|
|
206
|
-
}
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
var oVBox = new VBox();
|
|
213
|
-
oVBox.addItem(oFieldName);
|
|
214
|
-
oVBox.addItem(oFieldName2);
|
|
96
|
+
oDialog.addStyleClass(Utils.getRtaStyleClassName());
|
|
215
97
|
|
|
216
|
-
|
|
217
|
-
var oSorter = new Sorter("label", this._bAscendingSortOrder);
|
|
218
|
-
this._oList = new List(
|
|
219
|
-
{
|
|
220
|
-
mode: "MultiSelect",
|
|
221
|
-
includeItemInSelection: true,
|
|
222
|
-
growing: true,
|
|
223
|
-
growingScrollToLoad: true
|
|
224
|
-
}).setNoDataText(this._oTextResources.getText("MSG_NO_FIELDS", this._oTextResources.getText("MULTIPLE_CONTROL_NAME").toLowerCase()));
|
|
98
|
+
this._oDialogModel.setProperty("/listNoDataText", oRTAResourceModel.getProperty("MSG_NO_FIELDS").toLowerCase());
|
|
225
99
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
100
|
+
//retrieve List to set the sorting for the 'items' aggregation, since sap.ui.model.Sorter
|
|
101
|
+
//does not support binding to a model property...
|
|
102
|
+
this._oList = sap.ui.getCore().byId(this.getId() + "--rta_addElementsDialogList");
|
|
103
|
+
this._bDescendingSortOrder = false;
|
|
104
|
+
}.bind(this));
|
|
105
|
+
};
|
|
232
106
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
sorter: oSorter,
|
|
237
|
-
templateShareable: false,
|
|
238
|
-
//Extended Change Detection via "key" property see docs: #/topic/7cdff73f308b4b10bdf7d83b7aba72e7 -
|
|
239
|
-
key: function (oContext) {
|
|
240
|
-
switch (oContext.getProperty("type")) {
|
|
241
|
-
case "invisible":
|
|
242
|
-
return oContext.getProperty("elementId");
|
|
243
|
-
case "odata":
|
|
244
|
-
return oContext.getProperty("name");
|
|
245
|
-
case "delegate":
|
|
246
|
-
return oContext.getProperty("name");
|
|
247
|
-
case "custom":
|
|
248
|
-
return oContext.getProperty("key");
|
|
249
|
-
default:
|
|
250
|
-
Log.error("sap.ui.rta.plugin.additionalElements.AddElementsDialog#_createContent: unsupported data type");
|
|
251
|
-
}
|
|
252
|
-
}
|
|
107
|
+
AddElementsDialog.prototype.exit = function() {
|
|
108
|
+
this._oDialogPromise.then(function(oDialog) {
|
|
109
|
+
oDialog.destroy();
|
|
253
110
|
});
|
|
254
111
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
content: this._oList,
|
|
259
|
-
vertical: true,
|
|
260
|
-
horizontal: false
|
|
261
|
-
}).addStyleClass("sapUIRtaCCDialogScrollContainer");
|
|
262
|
-
|
|
263
|
-
return [this.oInputFields,
|
|
264
|
-
this._oBCContainer,
|
|
265
|
-
oScrollContainer];
|
|
112
|
+
if (ManagedObject.prototype.exit) {
|
|
113
|
+
ManagedObject.prototype.exit.apply(this, arguments);
|
|
114
|
+
}
|
|
266
115
|
};
|
|
267
116
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
*
|
|
271
|
-
* @returns {object} list containes ok button and cancel button objects
|
|
272
|
-
* @private
|
|
273
|
-
*/
|
|
274
|
-
AddElementsDialog.prototype._createButtons = function() {
|
|
275
|
-
this._oOKButton = new Button({
|
|
276
|
-
text: this._oTextResources.getText("BTN_FREP_OK"),
|
|
277
|
-
press: [this._submitDialog, this],
|
|
278
|
-
type: ButtonType.Emphasized
|
|
279
|
-
});
|
|
280
|
-
var oCancelButton = new Button({
|
|
281
|
-
text: this._oTextResources.getText("BTN_FREP_CANCEL"),
|
|
282
|
-
press: [this._cancelDialog, this]
|
|
283
|
-
});
|
|
284
|
-
return [this._oOKButton, oCancelButton];
|
|
117
|
+
AddElementsDialog.prototype.setCustomFieldButtonVisible = function(bVisible) {
|
|
118
|
+
this._oDialogModel.setProperty("/customFieldVisible", bVisible);
|
|
285
119
|
};
|
|
286
120
|
|
|
287
121
|
/**
|
|
288
122
|
* Close the dialog.
|
|
123
|
+
* @returns {Promise} a Promise that resolves (to nothing) once the dialog is loaded and closed
|
|
289
124
|
*/
|
|
290
125
|
AddElementsDialog.prototype._submitDialog = function() {
|
|
291
|
-
this.
|
|
292
|
-
|
|
126
|
+
return this._oDialogPromise.then(function(oDialog) {
|
|
127
|
+
oDialog.close();
|
|
128
|
+
this._fnResolveOnDialogConfirm();
|
|
129
|
+
}.bind(this));
|
|
130
|
+
//indicate that the dialog has been closed and the selected fields (if any) are to be added to the UI
|
|
293
131
|
};
|
|
294
132
|
|
|
295
133
|
/**
|
|
296
|
-
* Close dialog
|
|
134
|
+
* Close dialog. All sections will be reverted
|
|
297
135
|
*/
|
|
298
136
|
AddElementsDialog.prototype._cancelDialog = function() {
|
|
299
|
-
//
|
|
300
|
-
this.
|
|
301
|
-
|
|
302
|
-
|
|
137
|
+
//clear all selections
|
|
138
|
+
this._oDialogModel.getObject("/elements").forEach(function(oElem) {
|
|
139
|
+
oElem.selected = false;
|
|
140
|
+
});
|
|
141
|
+
this._oDialogPromise.then(function(oDialog) {
|
|
142
|
+
oDialog.close();
|
|
143
|
+
});
|
|
144
|
+
//indicate that the dialog has been closed without choosing to add any fields (canceled)
|
|
145
|
+
this._fnRejectOnDialogCancel();
|
|
303
146
|
};
|
|
304
147
|
|
|
305
148
|
AddElementsDialog.prototype.setElements = function(aElements) {
|
|
306
|
-
this.
|
|
149
|
+
this._oDialogModel.setProperty("/elements", aElements);
|
|
307
150
|
};
|
|
308
151
|
|
|
309
152
|
AddElementsDialog.prototype.getElements = function() {
|
|
310
|
-
return this.
|
|
153
|
+
return this._oDialogModel.getProperty("/elements");
|
|
311
154
|
};
|
|
312
155
|
|
|
313
156
|
AddElementsDialog.prototype.getSelectedElements = function() {
|
|
314
|
-
return this.
|
|
157
|
+
return this._oDialogModel.getObject("/elements").filter(function(oElement) {
|
|
315
158
|
return oElement.selected;
|
|
316
159
|
});
|
|
317
160
|
};
|
|
@@ -319,34 +162,33 @@ sap.ui.define([
|
|
|
319
162
|
/**
|
|
320
163
|
* Open the Field Repository Dialog
|
|
321
164
|
*
|
|
322
|
-
* @
|
|
323
|
-
* @returns {Promise} empty promise
|
|
165
|
+
* @returns {Promise} promise that resolves once the Fragment is loaded and the dialog is opened
|
|
324
166
|
* @public
|
|
325
167
|
*/
|
|
326
|
-
AddElementsDialog.prototype.open = function
|
|
327
|
-
return new Promise(function
|
|
328
|
-
this.
|
|
329
|
-
this.
|
|
330
|
-
|
|
331
|
-
|
|
168
|
+
AddElementsDialog.prototype.open = function() {
|
|
169
|
+
return new Promise(function(resolve, reject) {
|
|
170
|
+
this._fnResolveOnDialogConfirm = resolve;
|
|
171
|
+
this._fnRejectOnDialogCancel = reject;
|
|
172
|
+
|
|
173
|
+
this._oDialogPromise.then(function(oDialog) {
|
|
174
|
+
oDialog.attachAfterOpen(function() {
|
|
175
|
+
this.fireOpened();
|
|
176
|
+
}.bind(this));
|
|
177
|
+
oDialog.open();
|
|
332
178
|
}.bind(this));
|
|
333
|
-
// Makes sure the modal div element does not change the size of our application (which would result in
|
|
334
|
-
// recalculation of our overlays)
|
|
335
|
-
this._oDialog.open();
|
|
336
179
|
}.bind(this));
|
|
337
180
|
};
|
|
338
181
|
|
|
339
182
|
/**
|
|
340
183
|
* Resort the list
|
|
341
184
|
*
|
|
342
|
-
* @param {sap.ui.base.Event} oEvent event object
|
|
343
185
|
* @private
|
|
344
186
|
*/
|
|
345
187
|
AddElementsDialog.prototype._resortList = function () {
|
|
346
|
-
this.
|
|
188
|
+
this._bDescendingSortOrder = !this._bDescendingSortOrder;
|
|
347
189
|
var oBinding = this._oList.getBinding("items");
|
|
348
190
|
var aSorter = [];
|
|
349
|
-
aSorter.push(new Sorter("label", this.
|
|
191
|
+
aSorter.push(new Sorter("label", this._bDescendingSortOrder));
|
|
350
192
|
oBinding.sort(aSorter);
|
|
351
193
|
};
|
|
352
194
|
|
|
@@ -375,28 +217,31 @@ sap.ui.define([
|
|
|
375
217
|
/**
|
|
376
218
|
* Fire an event to redirect to custom field creation
|
|
377
219
|
*
|
|
378
|
-
* @param {sap.ui.base.Event} oEvent event object
|
|
379
220
|
* @private
|
|
380
221
|
*/
|
|
381
222
|
AddElementsDialog.prototype._redirectToCustomFieldCreation = function () {
|
|
382
223
|
this.fireOpenCustomField();
|
|
383
|
-
this.
|
|
224
|
+
this._oDialogPromise.then(function(oDialog) {
|
|
225
|
+
oDialog.close();
|
|
226
|
+
});
|
|
384
227
|
};
|
|
385
228
|
|
|
386
229
|
AddElementsDialog.prototype.setTitle = function(sTitle) {
|
|
387
230
|
ManagedObject.prototype.setProperty.call(this, "title", sTitle, true);
|
|
388
|
-
this.
|
|
231
|
+
this._oDialogPromise.then(function(oDialog) {
|
|
232
|
+
oDialog.setTitle(sTitle);
|
|
233
|
+
});
|
|
389
234
|
};
|
|
390
235
|
|
|
391
236
|
/**
|
|
392
237
|
* Enables the Custom Field Creation button
|
|
393
238
|
*
|
|
394
|
-
* @param {boolean} bCustomFieldEnabled
|
|
239
|
+
* @param {boolean} bCustomFieldEnabled field extensibility button is enabled if true, else disabled
|
|
395
240
|
* @public
|
|
396
241
|
*/
|
|
397
242
|
AddElementsDialog.prototype.setCustomFieldEnabled = function(bCustomFieldEnabled) {
|
|
398
243
|
this.setProperty("customFieldEnabled", bCustomFieldEnabled, true);
|
|
399
|
-
this.
|
|
244
|
+
this._oDialogModel.setProperty("/customFieldEnabled", this.getProperty("customFieldEnabled"));
|
|
400
245
|
};
|
|
401
246
|
|
|
402
247
|
/**
|
|
@@ -407,46 +252,41 @@ sap.ui.define([
|
|
|
407
252
|
*/
|
|
408
253
|
AddElementsDialog.prototype._setBusinessContextVisible = function(bBusinessContextVisible) {
|
|
409
254
|
this.setProperty("businessContextVisible", bBusinessContextVisible, true);
|
|
410
|
-
this.
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* Returns list control
|
|
415
|
-
* @returns {sap.m.List}
|
|
416
|
-
*/
|
|
417
|
-
AddElementsDialog.prototype.getList = function () {
|
|
418
|
-
return this._oList;
|
|
255
|
+
this._oDialogModel.setProperty("/businessContextVisible", bBusinessContextVisible);
|
|
419
256
|
};
|
|
420
257
|
|
|
421
258
|
/**
|
|
422
259
|
* Adds extension data, e.g. business contexts
|
|
423
260
|
* @param {object[]} aExtensionData - Array containing extension data
|
|
261
|
+
* @returns {Promise<undefined>} A promise resolving to undefined
|
|
424
262
|
* @public
|
|
425
263
|
*/
|
|
426
264
|
AddElementsDialog.prototype.addExtensionData = function (aExtensionData) {
|
|
427
|
-
//
|
|
265
|
+
//clear old values from last run
|
|
428
266
|
this._removeExtensionDataTexts();
|
|
429
|
-
|
|
430
|
-
var
|
|
431
|
-
text: this._oTextResources.getText("MSG_NO_BUSINESS_CONTEXTS")
|
|
432
|
-
});
|
|
267
|
+
|
|
268
|
+
var aBusinessContextTexts = this._oDialogModel.getObject("/businessContextTexts");
|
|
433
269
|
if (aExtensionData && aExtensionData.length > 0) {
|
|
434
270
|
aExtensionData.forEach(function (oContext) {
|
|
435
|
-
|
|
271
|
+
aBusinessContextTexts.push({
|
|
436
272
|
text: oContext.description
|
|
437
273
|
});
|
|
438
|
-
this._oBCContainer.addContent(oBCDescription);
|
|
439
274
|
}, this);
|
|
440
275
|
} else {
|
|
441
|
-
|
|
276
|
+
//Message "none" when no extension data is available
|
|
277
|
+
aBusinessContextTexts.push({
|
|
278
|
+
text: oRTAResourceModel.getProperty("MSG_NO_BUSINESS_CONTEXTS")
|
|
279
|
+
});
|
|
442
280
|
}
|
|
443
|
-
//
|
|
281
|
+
//set the container visible
|
|
444
282
|
this._setBusinessContextVisible(true);
|
|
445
283
|
|
|
446
284
|
return FieldExtensibility.getTexts().then(function(oFieldExtensibilityTexts) {
|
|
447
285
|
if (oFieldExtensibilityTexts) {
|
|
448
|
-
this.
|
|
449
|
-
|
|
286
|
+
this._oDialogModel.setProperty("/customFieldButtonTooltip", oFieldExtensibilityTexts.tooltip);
|
|
287
|
+
//the first entry is always the "header" to be set by the implementation of FieldExtensibility
|
|
288
|
+
//it is set during the instantiation of the model, in the 'init' function
|
|
289
|
+
this._oDialogModel.setProperty("/businessContextTexts/0/text", oFieldExtensibilityTexts.headerText);
|
|
450
290
|
}
|
|
451
291
|
}.bind(this));
|
|
452
292
|
};
|
|
@@ -457,12 +297,9 @@ sap.ui.define([
|
|
|
457
297
|
* @private
|
|
458
298
|
*/
|
|
459
299
|
AddElementsDialog.prototype._removeExtensionDataTexts = function () {
|
|
460
|
-
var
|
|
461
|
-
|
|
462
|
-
for (nIndex = 0; nIndex < nElementsCount; nIndex++) {
|
|
463
|
-
this._oBCContainer.removeContent(1);
|
|
464
|
-
}
|
|
300
|
+
var aBusinessContextTexts = this._oDialogModel.getObject("/businessContextTexts");
|
|
301
|
+
aBusinessContextTexts.splice(1);
|
|
465
302
|
};
|
|
466
303
|
|
|
467
304
|
return AddElementsDialog;
|
|
468
|
-
});
|
|
305
|
+
});
|
|
@@ -164,7 +164,8 @@ sap.ui.define([
|
|
|
164
164
|
bindingPath: oElement.__bindingPath, //used for OPA tests and debugging
|
|
165
165
|
//command relevant data
|
|
166
166
|
type: "invisible",
|
|
167
|
-
elementId: oElement.getId()
|
|
167
|
+
elementId: oElement.getId(),
|
|
168
|
+
sourceAggregation: mData.sourceAggregation
|
|
168
169
|
};
|
|
169
170
|
}
|
|
170
171
|
|
|
@@ -466,7 +467,8 @@ sap.ui.define([
|
|
|
466
467
|
if (bIncludeElement) {
|
|
467
468
|
aAllElementData.push({
|
|
468
469
|
element: oInvisibleElement,
|
|
469
|
-
action: mRevealAction
|
|
470
|
+
action: mRevealAction,
|
|
471
|
+
sourceAggregation: mInvisibleElement.sourceAggregation
|
|
470
472
|
});
|
|
471
473
|
}
|
|
472
474
|
});
|