@openui5/sap.ui.mdc 1.94.0 → 1.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.reuse/dep5 +1 -6
- package/THIRDPARTY.txt +3 -9
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +1 -1
- package/src/sap/ui/mdc/Chart.js +12 -5
- package/src/sap/ui/mdc/ChartNew.js +1 -1
- package/src/sap/ui/mdc/Control.js +1 -1
- package/src/sap/ui/mdc/Element.js +2 -2
- package/src/sap/ui/mdc/Field.js +2 -2
- package/src/sap/ui/mdc/FilterBar.js +1 -1
- package/src/sap/ui/mdc/FilterField.js +28 -4
- package/src/sap/ui/mdc/Link.js +1 -1
- package/src/sap/ui/mdc/MultiValueField.js +1 -1
- package/src/sap/ui/mdc/Table.js +44 -29
- package/src/sap/ui/mdc/ValueHelp.js +1459 -0
- package/src/sap/ui/mdc/ValueHelpDelegate.js +41 -0
- package/src/sap/ui/mdc/chart/ToolbarHandler.js +233 -224
- package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/ChartTypeButtonNew.js +1 -1
- package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/condition/Condition.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
- package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +1 -1
- package/src/sap/ui/mdc/condition/Operator.js +1 -1
- package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
- package/src/sap/ui/mdc/enum/SelectType.js +43 -0
- package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ConditionType.js +61 -29
- package/src/sap/ui/mdc/field/ConditionsType.js +2 -1
- package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DefineConditionPanel.js +13 -2
- package/src/sap/ui/mdc/field/FieldBase.js +81 -35
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +9 -2
- package/src/sap/ui/mdc/field/FieldHelpBase.js +64 -4
- package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
- package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelp.js +7 -1
- package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
- package/src/sap/ui/mdc/field/InParameter.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
- package/src/sap/ui/mdc/field/OutParameter.js +1 -1
- package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +17 -9
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +1 -1
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
- package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +203 -197
- package/src/sap/ui/mdc/library.js +576 -4
- package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
- package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
- package/src/sap/ui/mdc/link/Factory.js +1 -1
- package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
- package/src/sap/ui/mdc/link/LinkItem.js +1 -1
- package/src/sap/ui/mdc/link/Panel.js +1 -1
- package/src/sap/ui/mdc/link/PanelItem.js +1 -1
- package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
- package/src/sap/ui/mdc/link/SelectionDialog.js +1 -1
- package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
- package/src/sap/ui/mdc/messagebundle.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_ar.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_bg.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_ca.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_cs.properties +11 -4
- package/src/sap/ui/mdc/messagebundle_cy.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_da.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_de.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_el.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_en.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +7 -2
- package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +7 -2
- package/src/sap/ui/mdc/messagebundle_es.properties +33 -26
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_et.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_fi.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_fr.properties +16 -9
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_hi.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_hr.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_hu.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_id.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_it.properties +32 -25
- package/src/sap/ui/mdc/messagebundle_iw.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_ja.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_kk.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_ko.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_lt.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_lv.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_ms.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_nl.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_no.properties +16 -9
- package/src/sap/ui/mdc/messagebundle_pl.properties +13 -6
- package/src/sap/ui/mdc/messagebundle_pt.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_ro.properties +12 -5
- package/src/sap/ui/mdc/messagebundle_ru.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_sh.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_sk.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_sl.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_sv.properties +10 -3
- package/src/sap/ui/mdc/messagebundle_th.properties +15 -8
- package/src/sap/ui/mdc/messagebundle_tr.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_uk.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_vi.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +9 -2
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +9 -2
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +94 -0
- package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
- package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +94 -0
- package/src/sap/ui/mdc/p13n/DefaultProviderRegistry.js +1 -1
- package/src/sap/ui/mdc/p13n/Engine.js +1 -1
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/BasePanel.js +2 -2
- package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/ListView.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/Wrapper.js +1 -1
- package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
- package/src/sap/ui/mdc/table/Column.js +20 -4
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/PropertyHelper.js +176 -4
- package/src/sap/ui/mdc/table/RowSettings.js +1 -1
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
- package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +51 -21
- package/src/sap/ui/mdc/ui/Container.js +2 -2
- package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
- package/src/sap/ui/mdc/util/Common.js +26 -0
- package/src/sap/ui/mdc/util/PromiseCache.js +266 -0
- package/src/sap/ui/mdc/util/PropertyHelper.js +19 -1
- package/src/sap/ui/mdc/valuehelp/Dialog.js +475 -0
- package/src/sap/ui/mdc/valuehelp/Popover.js +346 -0
- package/src/sap/ui/mdc/valuehelp/base/Container.js +440 -0
- package/src/sap/ui/mdc/valuehelp/base/Content.js +442 -0
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +96 -0
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +537 -0
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +105 -0
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +232 -0
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +250 -0
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +504 -0
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +619 -0
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +881 -0
- package/test/sap/ui/mdc/testutils/opa/TestLibrary.js +2 -2
- package/test/sap/ui/mdc/testutils/opa/filterbar/Actions.js +250 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Assertions.js +91 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +137 -0
- package/test/sap/ui/mdc/testutils/opa/filterbar/Util.js +25 -0
- package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +239 -77
- package/test/sap/ui/mdc/testutils/opa/p13n/Util.js +2 -1
- package/test/sap/ui/mdc/testutils/opa/p13n/{waitForP13nButtonWithParentAndIcon.js → waitForP13nButtonWithMatchers.js} +5 -18
- package/test/sap/ui/mdc/testutils/opa/table/TestObjects.js +0 -1
|
@@ -60,7 +60,7 @@ sap.ui.define([
|
|
|
60
60
|
* @class The <code>FilterBarBase</code> control is used as a faceless base class for common functionality of any MDC FilterBar derivation.
|
|
61
61
|
* @extends sap.ui.mdc.Control
|
|
62
62
|
* @author SAP SE
|
|
63
|
-
* @version 1.
|
|
63
|
+
* @version 1.95.0
|
|
64
64
|
* @constructor
|
|
65
65
|
* @private
|
|
66
66
|
* @ui5-restricted sap.ui.mdc
|
|
@@ -1024,8 +1024,15 @@ sap.ui.define([
|
|
|
1024
1024
|
}
|
|
1025
1025
|
|
|
1026
1026
|
if (vRetErrorState === ErrorState.NoError) {
|
|
1027
|
-
this.
|
|
1028
|
-
|
|
1027
|
+
if (this._isChangeApplying()) {
|
|
1028
|
+
this._oFlexPromise.then(function() {
|
|
1029
|
+
this._fResolvedSearchPromise();
|
|
1030
|
+
fnCleanup();
|
|
1031
|
+
}.bind(this));
|
|
1032
|
+
} else {
|
|
1033
|
+
this._fResolvedSearchPromise();
|
|
1034
|
+
fnCleanup();
|
|
1035
|
+
}
|
|
1029
1036
|
} else {
|
|
1030
1037
|
if (vRetErrorState === ErrorState.RequiredHasNoValue) {
|
|
1031
1038
|
sErrorMessage = this._oRb.getText("filterbar.REQUIRED_CONDITION_MISSING");
|
|
@@ -1052,8 +1059,9 @@ sap.ui.define([
|
|
|
1052
1059
|
|
|
1053
1060
|
/**
|
|
1054
1061
|
* Assigns conditions to the inner condition model.
|
|
1055
|
-
* This method is only called for filling the in parameters for value help scenarios.
|
|
1056
|
-
* @
|
|
1062
|
+
* <br><b>Note:</b>This method is only called for filling the in parameters for value help scenarios.
|
|
1063
|
+
* @private
|
|
1064
|
+
* @ui5-restricted sap.ui.mdc
|
|
1057
1065
|
* @param {map} mConditions A map containing the conditions
|
|
1058
1066
|
*/
|
|
1059
1067
|
FilterBarBase.prototype.setInternalConditions = function(mConditions) {
|
|
@@ -1064,9 +1072,9 @@ sap.ui.define([
|
|
|
1064
1072
|
};
|
|
1065
1073
|
|
|
1066
1074
|
/**
|
|
1067
|
-
* Returns the conditions of the inner condition model
|
|
1068
|
-
*
|
|
1069
|
-
* @
|
|
1075
|
+
* Returns the conditions of the inner condition model.
|
|
1076
|
+
* @private
|
|
1077
|
+
* @ui5-restricted sap.ui.mdc
|
|
1070
1078
|
* @returns {map} A map containing the conditions
|
|
1071
1079
|
*/
|
|
1072
1080
|
FilterBarBase.prototype.getInternalConditions = function() {
|
|
@@ -1503,7 +1511,7 @@ sap.ui.define([
|
|
|
1503
1511
|
|
|
1504
1512
|
FilterBarBase.prototype._cleanUpFilterFieldInErrorState = function(oFilterField) {
|
|
1505
1513
|
|
|
1506
|
-
if (oFilterField
|
|
1514
|
+
if (oFilterField && (oFilterField.getValueState() !== ValueState.None)) {
|
|
1507
1515
|
oFilterField.setValueState(ValueState.None);
|
|
1508
1516
|
}
|
|
1509
1517
|
|
|
@@ -33,7 +33,7 @@ sap.ui.define(
|
|
|
33
33
|
* The metadata information is provided via the {@link sap.ui.mdc.FilterBarDelegate FilterBarDelegate} implementation. This implementation has to be provided by the application.
|
|
34
34
|
* @extends sap.ui.mdc.filterbar.FilterBarBase
|
|
35
35
|
* @author SAP SE
|
|
36
|
-
* @version 1.
|
|
36
|
+
* @version 1.95.0
|
|
37
37
|
* @constructor
|
|
38
38
|
* @private
|
|
39
39
|
* @since 1.84.0
|
|
@@ -108,22 +108,22 @@ sap.ui.define([
|
|
|
108
108
|
|
|
109
109
|
_getExistingAggregationItem: function(oChangeContent, mPropertyBag, oControl) {
|
|
110
110
|
var oModifier = mPropertyBag.modifier;
|
|
111
|
-
return
|
|
112
|
-
|
|
113
|
-
.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}.bind(this));
|
|
111
|
+
return this.determineAggregation(oModifier, oControl)
|
|
112
|
+
.then(function(oAggregation) {
|
|
113
|
+
var oExistingItem, aAggregationItems = oAggregation.items;
|
|
114
|
+
if (aAggregationItems) {
|
|
115
|
+
oExistingItem = this.findItem(oModifier, aAggregationItems, oChangeContent.name); //can return a promise
|
|
116
|
+
}
|
|
117
|
+
return oExistingItem;
|
|
118
|
+
}.bind(this));
|
|
120
119
|
},
|
|
121
120
|
|
|
122
|
-
_getDelegate: function(sDelegatePath
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
_getDelegate: function(sDelegatePath) {
|
|
122
|
+
return new Promise(function(fResolveLoad, fRejectLoad){
|
|
123
|
+
sap.ui.require([
|
|
124
|
+
sDelegatePath
|
|
125
|
+
], fResolveLoad, fRejectLoad);
|
|
126
|
+
});
|
|
127
127
|
},
|
|
128
128
|
|
|
129
129
|
// Get appropriate text for revert/apply operation
|
|
@@ -161,86 +161,79 @@ sap.ui.define([
|
|
|
161
161
|
if (this._bSupressFlickering) {
|
|
162
162
|
this._delayInvalidate(oControl);
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
164
|
+
var oModifier = mPropertyBag.modifier, oChangeContent = bIsRevert ? oChange.getRevertData() : oChange.getContent();
|
|
165
|
+
var sDataPropertyName = oChangeContent.name;
|
|
166
|
+
var iIndex;
|
|
167
|
+
var aDefaultAggregation;
|
|
168
|
+
var oAggregation;
|
|
169
|
+
|
|
170
|
+
var pAdd = this.determineAggregation(oModifier, oControl)
|
|
171
|
+
|
|
172
|
+
// 1) Check for existing item in the controls aggregation
|
|
173
|
+
.then(function(oRetrievedAggregation){
|
|
174
|
+
oAggregation = oRetrievedAggregation;
|
|
175
|
+
aDefaultAggregation = oAggregation.items;
|
|
176
|
+
iIndex = oChangeContent.index > -1 ? oChangeContent.index : aDefaultAggregation.length;
|
|
177
|
+
return this._getExistingAggregationItem(oChangeContent, mPropertyBag, oControl);
|
|
178
|
+
}.bind(this))
|
|
179
|
+
|
|
180
|
+
// 2) Provide either the existing item or request a new instance through AggregationBaseDelegate#addItem
|
|
181
|
+
.then(function(oControlAggregationItem){
|
|
182
|
+
|
|
183
|
+
if (oControlAggregationItem) {
|
|
184
|
+
// a) Item is already existing in aggregation
|
|
185
|
+
return oControlAggregationItem;
|
|
186
|
+
} else {
|
|
187
|
+
// b) A new item instance needs to be requested
|
|
188
|
+
return oModifier.getProperty(oControl, "delegate")
|
|
189
|
+
.then(function(oDelegate){
|
|
190
|
+
return this._getDelegate(oDelegate.name);
|
|
177
191
|
}.bind(this))
|
|
178
|
-
.then(function(
|
|
179
|
-
return
|
|
180
|
-
if (oControlAggregationItem) {
|
|
181
|
-
resolveCreation(oControlAggregationItem);
|
|
182
|
-
|
|
183
|
-
} else {
|
|
184
|
-
Promise.resolve()
|
|
185
|
-
.then(oModifier.getProperty.bind(oModifier, oControl, "delegate"))
|
|
186
|
-
.then(function(oDelegate) {
|
|
187
|
-
this._getDelegate(oDelegate.name, function(Delegate) {
|
|
188
|
-
this.beforeAddItem(Delegate, sDataPropertyName, oControl, mPropertyBag, oChangeContent).then(function(oItem) {
|
|
189
|
-
if (oItem) {
|
|
190
|
-
// API returns a item from default aggregation --> resolve
|
|
191
|
-
resolveCreation(oItem);
|
|
192
|
-
} else {
|
|
193
|
-
//item from default aggregation not returned --> reject the promise
|
|
194
|
-
rejectCreation();
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
}.bind(this), rejectCreation);
|
|
198
|
-
}.bind(this));
|
|
199
|
-
}
|
|
200
|
-
}.bind(this))
|
|
201
|
-
.then(function(oControlAggregationItem) {
|
|
202
|
-
if (!oControlAggregationItem) {
|
|
203
|
-
reject(new Error("No item in" + oAggregation.name + " created. Change to " + this._getChangeTypeText(!bIsRevert) + "cannot be " + this._getOperationText(bIsRevert) + "at this moment"));
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
return Promise.resolve()
|
|
207
|
-
.then(function() {
|
|
208
|
-
// check if the item is already existing in the aggregation
|
|
209
|
-
if (aDefaultAggregation.indexOf(oControlAggregationItem) < 0) {
|
|
210
|
-
return oModifier.insertAggregation(oControl, oAggregation.name, oControlAggregationItem, iIndex);
|
|
211
|
-
} else {
|
|
212
|
-
// mark the change as not applicable since the item is already existing
|
|
213
|
-
Log.warning("Specified change is already existing");
|
|
214
|
-
//return FLBase.markAsNotApplicable("Specified change is already existing", true);
|
|
215
|
-
}
|
|
216
|
-
})
|
|
217
|
-
.then(function() {
|
|
218
|
-
if (bIsRevert) {
|
|
219
|
-
// Clear the revert data on the change
|
|
220
|
-
oChange.resetRevertData();
|
|
221
|
-
} else {
|
|
222
|
-
// Set revert data on the change
|
|
223
|
-
oChange.setRevertData({
|
|
224
|
-
//id: oModifier.getId(oControlAggregationItem),
|
|
225
|
-
name: oChangeContent.name,
|
|
226
|
-
index: iIndex
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
//Custom function after apply (for example table rebind)
|
|
231
|
-
this.afterApply(oChange.getChangeType(), oControl, bIsRevert);
|
|
232
|
-
|
|
233
|
-
resolve();
|
|
234
|
-
}.bind(this));
|
|
235
|
-
}.bind(this))
|
|
236
|
-
.catch(function() {
|
|
237
|
-
reject(new Error("Change to " + this._getChangeTypeText(!bIsRevert) + "cannot be" + this._getOperationText(bIsRevert) + "at this moment"));
|
|
238
|
-
}.bind(this));
|
|
192
|
+
.then(function(Delegate){
|
|
193
|
+
return this.beforeAddItem(Delegate, sDataPropertyName, oControl, mPropertyBag, oChangeContent);
|
|
239
194
|
}.bind(this))
|
|
240
|
-
.
|
|
241
|
-
|
|
195
|
+
.then(function(oRequestedItem){
|
|
196
|
+
return oRequestedItem;
|
|
242
197
|
});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
}.bind(this))
|
|
201
|
+
|
|
202
|
+
// 3) Check & insert the item in the controls according aggregation
|
|
203
|
+
.then(function(oControlAggregationItem){
|
|
204
|
+
if (!oControlAggregationItem) {
|
|
205
|
+
throw new Error("No item in" + oAggregation.name + " created. Change to " + this._getChangeTypeText(!bIsRevert) + "cannot be " + this._getOperationText(bIsRevert) + "at this moment");
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (aDefaultAggregation.indexOf(oControlAggregationItem) < 0) {
|
|
209
|
+
oModifier.insertAggregation(oControl, oAggregation.name, oControlAggregationItem, iIndex);
|
|
210
|
+
} else {
|
|
211
|
+
// In case the specified change is already existing we need to react gracefully --> no error
|
|
212
|
+
Log.warning("The specified change is already existing - change appliance ignored");
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return oControlAggregationItem;
|
|
216
|
+
}.bind(this))
|
|
217
|
+
|
|
218
|
+
// 4) prepare revert data & call 'afterApply' hook
|
|
219
|
+
.then(function(){
|
|
220
|
+
if (bIsRevert) {
|
|
221
|
+
// Clear the revert data on the change
|
|
222
|
+
oChange.resetRevertData();
|
|
223
|
+
} else {
|
|
224
|
+
// Set revert data on the change
|
|
225
|
+
oChange.setRevertData({
|
|
226
|
+
name: oChangeContent.name,
|
|
227
|
+
index: iIndex
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
//Custom function after apply (for example table rebind)
|
|
232
|
+
this.afterApply(oChange.getChangeType(), oControl, bIsRevert);
|
|
243
233
|
}.bind(this));
|
|
234
|
+
|
|
235
|
+
return pAdd;
|
|
236
|
+
|
|
244
237
|
},
|
|
245
238
|
|
|
246
239
|
_applyRemove: function(oChange, oControl, mPropertyBag, bIsRevert) {
|
|
@@ -248,68 +241,75 @@ sap.ui.define([
|
|
|
248
241
|
if (this._bSupressFlickering) {
|
|
249
242
|
this._delayInvalidate(oControl);
|
|
250
243
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
244
|
+
|
|
245
|
+
var oModifier = mPropertyBag.modifier, oChangeContent = bIsRevert ? oChange.getRevertData() : oChange.getContent();
|
|
246
|
+
var oAggregation;
|
|
247
|
+
var iIndex;
|
|
248
|
+
var oControlAggregationItem;
|
|
249
|
+
|
|
250
|
+
// 1) Fetch the existimg item from the control
|
|
251
|
+
var pRemove = this.determineAggregation(oModifier, oControl)
|
|
252
|
+
.then(function(oDeterminedAggregation){
|
|
253
|
+
oAggregation = oDeterminedAggregation;
|
|
254
|
+
return this._getExistingAggregationItem(oChangeContent, mPropertyBag, oControl);
|
|
255
|
+
}.bind(this))
|
|
256
|
+
|
|
257
|
+
// 2) Check the existence of the item
|
|
258
|
+
.then(function(oRetrievedControlAggregationItem){
|
|
259
|
+
oControlAggregationItem = oRetrievedControlAggregationItem;
|
|
260
|
+
if (!oControlAggregationItem) {
|
|
261
|
+
if (bIsRevert) {
|
|
262
|
+
throw new Error("No item found in " + oAggregation.name + ". Change to " + this._getChangeTypeText(bIsRevert) + "cannot be " + this._getOperationText(bIsRevert) + "at this moment");
|
|
263
|
+
} else {
|
|
264
|
+
// In case the specified change is already existing we need to react gracefully --> no error
|
|
265
|
+
Log.warning("The specified change is already existing - change appliance ignored");
|
|
266
|
+
}
|
|
267
|
+
return -1;
|
|
268
|
+
}
|
|
269
|
+
return oModifier.findIndexInParentAggregation(oControlAggregationItem);
|
|
270
|
+
}.bind(this))
|
|
271
|
+
|
|
272
|
+
// 3) Remove the item from the aggregation (no destroy yet)
|
|
273
|
+
.then(function(iFoundIndex) {
|
|
274
|
+
iIndex = iFoundIndex;
|
|
275
|
+
return oModifier.removeAggregation(oControl, oAggregation.name, oControlAggregationItem);
|
|
276
|
+
})
|
|
277
|
+
|
|
278
|
+
// 4) Execute the AggregationBaseDelegate#removeItem hook which decides whether the item should be kept or destroyed
|
|
279
|
+
.then(function(){
|
|
280
|
+
|
|
281
|
+
return oModifier.getProperty(oControl, "delegate")
|
|
282
|
+
.then(function(oDelegate){
|
|
283
|
+
return this._getDelegate(oDelegate.name);
|
|
284
|
+
}.bind(this))
|
|
285
|
+
.then(function(Delegate){
|
|
286
|
+
return this.afterRemoveItem(Delegate, oControlAggregationItem, oControl, mPropertyBag).then(function(bContinue) {
|
|
287
|
+
// Continue? --> destroy the item (but only if it exists, it may not exist if an earlier layer removed it already)
|
|
288
|
+
if (bContinue && oControlAggregationItem) {
|
|
289
|
+
// destroy the item
|
|
290
|
+
oModifier.destroy(oControlAggregationItem);
|
|
292
291
|
}
|
|
293
|
-
|
|
294
|
-
})
|
|
295
|
-
.then(function(oDelegate) {
|
|
296
|
-
// Trigger a callback via delegate on remove to enable consumers to optionally preserved some items (as they see fit)
|
|
297
|
-
return this._getDelegate(oDelegate.name, function(Delegate) {
|
|
298
|
-
this.afterRemoveItem(Delegate, oControlAggregationItem, oControl, mPropertyBag).then(function(bContinue) {
|
|
299
|
-
// Continue? --> destroy the item
|
|
300
|
-
if (bContinue && oControlAggregationItem) {
|
|
301
|
-
// destroy the item
|
|
302
|
-
oModifier.destroy(oControlAggregationItem);
|
|
303
|
-
}
|
|
304
|
-
this.afterApply(oChange.getChangeType(), oControl, bIsRevert);
|
|
305
|
-
resolve();
|
|
306
|
-
}.bind(this));
|
|
307
|
-
}.bind(this), reject);
|
|
308
|
-
}.bind(this))
|
|
309
|
-
.catch(function(oError) {
|
|
310
|
-
reject(oError);
|
|
311
|
-
});
|
|
292
|
+
this.afterApply(oChange.getChangeType(), oControl, bIsRevert);
|
|
293
|
+
}.bind(this));
|
|
312
294
|
}.bind(this));
|
|
295
|
+
}.bind(this))
|
|
296
|
+
|
|
297
|
+
// 5) Prepare revert data
|
|
298
|
+
.then(function() {
|
|
299
|
+
if (bIsRevert) {
|
|
300
|
+
// Clear the revert data on the change
|
|
301
|
+
oChange.resetRevertData();
|
|
302
|
+
} else {
|
|
303
|
+
// Set revert data on the change
|
|
304
|
+
oChange.setRevertData({
|
|
305
|
+
name: oChangeContent.name,
|
|
306
|
+
index: iIndex
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
return pRemove;
|
|
312
|
+
|
|
313
313
|
},
|
|
314
314
|
|
|
315
315
|
_applyMove: function(oChange, oControl, mPropertyBag, bIsRevert) {
|
|
@@ -317,54 +317,60 @@ sap.ui.define([
|
|
|
317
317
|
if (this._bSupressFlickering) {
|
|
318
318
|
this._delayInvalidate(oControl);
|
|
319
319
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
.
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
320
|
+
|
|
321
|
+
var oModifier = mPropertyBag.modifier;
|
|
322
|
+
var oChangeContent = bIsRevert ? oChange.getRevertData() : oChange.getContent();
|
|
323
|
+
var oControlAggregationItem;
|
|
324
|
+
var oAggregation;
|
|
325
|
+
var iOldIndex;
|
|
326
|
+
|
|
327
|
+
// 1) Fetch existing item
|
|
328
|
+
var pMove = this.determineAggregation(oModifier, oControl)
|
|
329
|
+
.then(function(oRetrievedAggregation){
|
|
330
|
+
oAggregation = oRetrievedAggregation;
|
|
331
|
+
return this._getExistingAggregationItem(oChangeContent, mPropertyBag, oControl);
|
|
332
|
+
}.bind(this))
|
|
333
|
+
.then(function(oRetrievedControlAggregationItem){
|
|
334
|
+
oControlAggregationItem = oRetrievedControlAggregationItem;
|
|
335
|
+
})
|
|
336
|
+
|
|
337
|
+
// 2) Throw error if for some reason no item could be found (should not happen for a move operation)
|
|
338
|
+
.then(function() {
|
|
339
|
+
if (!oControlAggregationItem) {
|
|
340
|
+
throw new Error("No corresponding item in " + oAggregation.name + " found. Change to move item cannot be " + this._getOperationText(bIsRevert) + "at this moment");
|
|
341
|
+
}
|
|
342
|
+
return oModifier.findIndexInParentAggregation(oControlAggregationItem);
|
|
343
|
+
}.bind(this))
|
|
344
|
+
|
|
345
|
+
// 3) Trigger the move (remove&insert)
|
|
346
|
+
.then(function(iRetrievedIndex) {
|
|
347
|
+
iOldIndex = iRetrievedIndex;
|
|
348
|
+
// Call optimized JS API for runtime changes
|
|
349
|
+
if (oControl.moveColumn) {
|
|
350
|
+
return oControl.moveColumn(oControlAggregationItem, oChangeContent.index);
|
|
351
|
+
} else {
|
|
352
|
+
return oModifier.removeAggregation(oControl, oAggregation.name, oControlAggregationItem)
|
|
353
|
+
.then(function(){
|
|
354
|
+
return oModifier.insertAggregation(oControl, oAggregation.name, oControlAggregationItem, oChangeContent.index);
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
})
|
|
358
|
+
|
|
359
|
+
// 4) Prepare the revert data
|
|
360
|
+
.then(function() {
|
|
361
|
+
if (bIsRevert) {
|
|
362
|
+
// Clear the revert data on the change
|
|
363
|
+
oChange.resetRevertData();
|
|
364
|
+
} else {
|
|
365
|
+
oChange.setRevertData({
|
|
366
|
+
name: oChangeContent.name,
|
|
367
|
+
index: iOldIndex
|
|
366
368
|
});
|
|
369
|
+
}
|
|
370
|
+
this.afterApply(oChange.getChangeType(), oControl, bIsRevert);
|
|
367
371
|
}.bind(this));
|
|
372
|
+
|
|
373
|
+
return pMove;
|
|
368
374
|
},
|
|
369
375
|
|
|
370
376
|
_removeIndexFromChange: function(oChange) {
|
|
@@ -423,4 +429,4 @@ sap.ui.define([
|
|
|
423
429
|
|
|
424
430
|
return ItemBaseFlex;
|
|
425
431
|
|
|
426
|
-
});
|
|
432
|
+
});
|