@openui5/sap.ui.mdc 1.92.0 → 1.93.3

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.
Files changed (180) hide show
  1. package/.reuse/dep5 +5 -0
  2. package/THIRDPARTY.txt +10 -1
  3. package/package.json +4 -4
  4. package/src/sap/ui/mdc/.library +1 -1
  5. package/src/sap/ui/mdc/ActionToolbar.js +1 -1
  6. package/src/sap/ui/mdc/Chart.js +1 -1
  7. package/src/sap/ui/mdc/ChartDelegate.js +1 -1
  8. package/src/sap/ui/mdc/ChartNew.js +67 -9
  9. package/src/sap/ui/mdc/Control.js +1 -1
  10. package/src/sap/ui/mdc/Element.js +1 -1
  11. package/src/sap/ui/mdc/Field.js +15 -2
  12. package/src/sap/ui/mdc/FilterBar.js +11 -1
  13. package/src/sap/ui/mdc/FilterField.js +2 -2
  14. package/src/sap/ui/mdc/Link.js +2 -2
  15. package/src/sap/ui/mdc/MultiValueField.js +406 -0
  16. package/src/sap/ui/mdc/Table.js +73 -46
  17. package/src/sap/ui/mdc/TableDelegate.js +10 -18
  18. package/src/sap/ui/mdc/chartNew/ChartSelectionDetailsNew.js +1 -1
  19. package/src/sap/ui/mdc/chartNew/ChartToolbarNew.js +9 -18
  20. package/src/sap/ui/mdc/chartNew/ItemNew.js +1 -1
  21. package/src/sap/ui/mdc/chartNew/PropertyHelperNew.js +1 -1
  22. package/src/sap/ui/mdc/condition/Condition.js +2 -2
  23. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  24. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  25. package/src/sap/ui/mdc/condition/FilterConverter.js +27 -15
  26. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +3 -3
  27. package/src/sap/ui/mdc/condition/Operator.js +10 -5
  28. package/src/sap/ui/mdc/condition/RangeOperator.js +3 -6
  29. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  30. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +5 -4
  31. package/src/sap/ui/mdc/field/ConditionType.js +51 -30
  32. package/src/sap/ui/mdc/field/ConditionsType.js +4 -3
  33. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  34. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  35. package/src/sap/ui/mdc/field/DefineConditionPanel.js +1 -11
  36. package/src/sap/ui/mdc/field/FieldBase.js +29 -9
  37. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +16 -0
  38. package/src/sap/ui/mdc/field/FieldHelpBase.js +1 -1
  39. package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
  40. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  41. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  42. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  43. package/src/sap/ui/mdc/field/FieldValueHelp.js +49 -33
  44. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  45. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
  46. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +52 -32
  47. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +7 -9
  48. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +2 -1
  49. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  50. package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
  51. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  52. package/src/sap/ui/mdc/field/MultiValueFieldDelegate.js +49 -0
  53. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +70 -0
  54. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  55. package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
  56. package/src/sap/ui/mdc/field/content/ContentFactory.js +2 -2
  57. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +49 -37
  58. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +51 -26
  59. package/src/sap/ui/mdc/filterbar/p13n/FilterGroupLayout.js +9 -3
  60. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +1 -1
  61. package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +55 -39
  62. package/src/sap/ui/mdc/flexibility/AggregateFlex.js +31 -22
  63. package/src/sap/ui/mdc/flexibility/AggregationConfigFlex.js +33 -29
  64. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +10 -5
  65. package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +18 -6
  66. package/src/sap/ui/mdc/flexibility/ColumnFlex.js +15 -4
  67. package/src/sap/ui/mdc/flexibility/ConditionFlex.js +84 -82
  68. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  69. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  70. package/src/sap/ui/mdc/flexibility/GroupFlex.js +70 -52
  71. package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +203 -140
  72. package/src/sap/ui/mdc/flexibility/Panel.flexibility.js +59 -41
  73. package/src/sap/ui/mdc/flexibility/SortFlex.js +72 -54
  74. package/src/sap/ui/mdc/flp/FlpLinkDelegate.js +2 -1
  75. package/src/sap/ui/mdc/library.js +46 -5
  76. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  77. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  78. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  79. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  80. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  81. package/src/sap/ui/mdc/link/Factory.js +1 -1
  82. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  83. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  84. package/src/sap/ui/mdc/link/Panel.js +1 -1
  85. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  86. package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
  87. package/src/sap/ui/mdc/link/SelectionDialog.js +1 -1
  88. package/src/sap/ui/mdc/link/SelectionDialogItem.js +1 -1
  89. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  90. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  91. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  92. package/src/sap/ui/mdc/messagebundle.properties +7 -3
  93. package/src/sap/ui/mdc/messagebundle_ar.properties +6 -3
  94. package/src/sap/ui/mdc/messagebundle_bg.properties +6 -3
  95. package/src/sap/ui/mdc/messagebundle_ca.properties +6 -3
  96. package/src/sap/ui/mdc/messagebundle_cs.properties +6 -3
  97. package/src/sap/ui/mdc/messagebundle_cy.properties +6 -3
  98. package/src/sap/ui/mdc/messagebundle_da.properties +6 -3
  99. package/src/sap/ui/mdc/messagebundle_de.properties +12 -9
  100. package/src/sap/ui/mdc/messagebundle_el.properties +6 -3
  101. package/src/sap/ui/mdc/messagebundle_en.properties +5 -2
  102. package/src/sap/ui/mdc/messagebundle_en_GB.properties +6 -3
  103. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +3 -1
  104. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +3 -1
  105. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +3 -2
  106. package/src/sap/ui/mdc/messagebundle_es.properties +6 -3
  107. package/src/sap/ui/mdc/messagebundle_es_MX.properties +6 -3
  108. package/src/sap/ui/mdc/messagebundle_et.properties +6 -3
  109. package/src/sap/ui/mdc/messagebundle_fi.properties +6 -3
  110. package/src/sap/ui/mdc/messagebundle_fr.properties +6 -3
  111. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +6 -3
  112. package/src/sap/ui/mdc/messagebundle_hi.properties +4 -1
  113. package/src/sap/ui/mdc/messagebundle_hr.properties +6 -3
  114. package/src/sap/ui/mdc/messagebundle_hu.properties +6 -3
  115. package/src/sap/ui/mdc/messagebundle_id.properties +4 -1
  116. package/src/sap/ui/mdc/messagebundle_it.properties +6 -3
  117. package/src/sap/ui/mdc/messagebundle_iw.properties +6 -3
  118. package/src/sap/ui/mdc/messagebundle_ja.properties +4 -1
  119. package/src/sap/ui/mdc/messagebundle_kk.properties +6 -3
  120. package/src/sap/ui/mdc/messagebundle_ko.properties +4 -1
  121. package/src/sap/ui/mdc/messagebundle_lt.properties +6 -3
  122. package/src/sap/ui/mdc/messagebundle_lv.properties +6 -3
  123. package/src/sap/ui/mdc/messagebundle_ms.properties +4 -1
  124. package/src/sap/ui/mdc/messagebundle_nl.properties +6 -3
  125. package/src/sap/ui/mdc/messagebundle_no.properties +6 -3
  126. package/src/sap/ui/mdc/messagebundle_pl.properties +6 -3
  127. package/src/sap/ui/mdc/messagebundle_pt.properties +6 -3
  128. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +5 -2
  129. package/src/sap/ui/mdc/messagebundle_ro.properties +6 -3
  130. package/src/sap/ui/mdc/messagebundle_ru.properties +6 -3
  131. package/src/sap/ui/mdc/messagebundle_sh.properties +6 -3
  132. package/src/sap/ui/mdc/messagebundle_sk.properties +6 -3
  133. package/src/sap/ui/mdc/messagebundle_sl.properties +6 -3
  134. package/src/sap/ui/mdc/messagebundle_sv.properties +6 -3
  135. package/src/sap/ui/mdc/messagebundle_th.properties +4 -1
  136. package/src/sap/ui/mdc/messagebundle_tr.properties +6 -3
  137. package/src/sap/ui/mdc/messagebundle_uk.properties +7 -4
  138. package/src/sap/ui/mdc/messagebundle_vi.properties +6 -3
  139. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +4 -1
  140. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +4 -1
  141. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
  142. package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
  143. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +26 -14
  144. package/src/sap/ui/mdc/odata/json/FilterBarDelegate.js +9 -8
  145. package/src/sap/ui/mdc/odata/v4/ChartDelegate.js +5 -5
  146. package/src/sap/ui/mdc/odata/v4/ChartPropertyHelperNew.js +1 -1
  147. package/src/sap/ui/mdc/odata/v4/FieldBaseDelegate.js +9 -0
  148. package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +82 -74
  149. package/src/sap/ui/mdc/odata/v4/TypeUtil.js +17 -0
  150. package/src/sap/ui/mdc/odata/v4/util/DelegateUtil.js +45 -53
  151. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegateNew.js +31 -17
  152. package/src/sap/ui/mdc/p13n/DefaultProviderRegistry.js +1 -1
  153. package/src/sap/ui/mdc/p13n/Engine.js +21 -16
  154. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  155. package/src/sap/ui/mdc/p13n/UIManager.js +1 -1
  156. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +133 -54
  157. package/src/sap/ui/mdc/p13n/panels/BasePanel.js +5 -5
  158. package/src/sap/ui/mdc/p13n/panels/GroupPanel.js +1 -1
  159. package/src/sap/ui/mdc/p13n/panels/GroupView.js +9 -6
  160. package/src/sap/ui/mdc/p13n/panels/ListView.js +58 -2
  161. package/src/sap/ui/mdc/p13n/panels/QueryPanel.js +2 -2
  162. package/src/sap/ui/mdc/p13n/panels/SortQueryPanel.js +6 -1
  163. package/src/sap/ui/mdc/p13n/panels/Wrapper.js +1 -1
  164. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
  165. package/src/sap/ui/mdc/p13n/subcontroller/ColumnController.js +10 -11
  166. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +1 -1
  167. package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +1 -1
  168. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +11 -2
  169. package/src/sap/ui/mdc/table/CreationRow.js +1 -1
  170. package/src/sap/ui/mdc/table/PropertyHelper.js +1 -1
  171. package/src/sap/ui/mdc/table/ResponsiveTableType.js +4 -0
  172. package/src/sap/ui/mdc/table/RowSettings.js +1 -1
  173. package/src/sap/ui/mdc/table/TableSettings.js +4 -49
  174. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
  175. package/src/sap/ui/mdc/themes/base/FieldBase.less +4 -0
  176. package/src/sap/ui/mdc/ui/Container.js +3 -3
  177. package/src/sap/ui/mdc/ui/ContainerItem.js +2 -2
  178. package/src/sap/ui/mdc/util/FilterUtil.js +56 -15
  179. package/src/sap/ui/mdc/util/PropertyHelper.js +6 -2
  180. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +17 -17
@@ -22,8 +22,6 @@ sap.ui.define([
22
22
  * @alias sap.ui.mdc.filterbar.vh.GenericFilterBarDelegate
23
23
  */
24
24
  var GenericFilterBarDelegate = Object.assign({}, FilterBarDelegate);
25
- var _oObserver;
26
- var _aProperties = [];
27
25
 
28
26
  /**
29
27
  * Fetches the relevant metadata (from the FilterItems of the FiterBar) for the FilterBar and returns property info array
@@ -32,26 +30,26 @@ sap.ui.define([
32
30
  * @returns {Array} array of property info
33
31
  */
34
32
  GenericFilterBarDelegate.fetchProperties = function(oFilterBar) {
35
- if (!_oObserver) {
36
- _oObserver = new ManagedObjectObserver(_observeChanges);
37
- _oObserver.observe(oFilterBar, {
33
+ if (!oFilterBar.__oObserver) {
34
+ oFilterBar.__oObserver = new ManagedObjectObserver(_observeChanges);
35
+ oFilterBar.__oObserver.observe(oFilterBar, {
38
36
  aggregations: ["filterItems"]
39
37
  });
40
38
  }
41
39
 
42
40
  return new Promise(function(fResolve) {
43
41
  var aFilterItems = oFilterBar.getFilterItems();
44
- _aProperties = [];
42
+ oFilterBar.__aProperties = [];
45
43
  aFilterItems.forEach(function(oFF){
46
- addFilterField(oFF);
44
+ addFilterField(oFF, oFilterBar.__aProperties);
47
45
  });
48
46
 
49
- fResolve(_aProperties);
47
+ fResolve(oFilterBar.__aProperties);
50
48
  });
51
49
 
52
50
  };
53
51
 
54
- function addFilterField(oFF) {
52
+ function addFilterField(oFF, aProperties) {
55
53
  var sPath = oFF.getBindingPath("conditions");
56
54
  if (!sPath) {
57
55
  return;
@@ -59,7 +57,7 @@ sap.ui.define([
59
57
  var aPathParts = sPath.split("/");
60
58
  var sFieldPath = aPathParts[aPathParts.length - 1];
61
59
 
62
- _aProperties.push({
60
+ aProperties.push({
63
61
  name: sFieldPath,
64
62
  label: oFF.getLabel() || sFieldPath,
65
63
  type: oFF.getDataType(),
@@ -74,61 +72,79 @@ sap.ui.define([
74
72
  });
75
73
  }
76
74
 
77
- function removeFilterField(oFF) {
75
+ function removeFilterField(oFF, aProperties) {
78
76
  var sPath = oFF.getBindingPath("conditions");
79
77
  if (!sPath) {
80
78
  return;
81
79
  }
82
- var aPathParts = sPath.split("/");
83
- var sFieldPath = aPathParts[aPathParts.length - 1];
84
- if (_getProperty(sFieldPath)) {
85
- _removeProperty(sFieldPath);
86
- }
87
- }
88
80
 
89
- function _getProperty(sName) {
90
- var oNamedProperty = null;
91
- _aProperties.some(function(oProperty) {
92
- if (oProperty.name === sName) {
93
- oNamedProperty = oProperty;
94
- }
95
- return oNamedProperty !== null;
96
- });
81
+ function _getProperty(sName) {
82
+ var oNamedProperty = null;
83
+ aProperties.some(function(oProperty) {
84
+ if (oProperty.name === sName) {
85
+ oNamedProperty = oProperty;
86
+ }
87
+ return oNamedProperty !== null;
88
+ });
97
89
 
98
- return oNamedProperty;
99
- }
90
+ return oNamedProperty;
91
+ }
92
+
93
+ function _removeProperty(sName) {
94
+ var nIdx = -1;
95
+ aProperties.some(function(oProperty, index) {
96
+ if (oProperty.name === sName) {
97
+ nIdx = index;
98
+ }
99
+ return nIdx !== -1;
100
+ });
100
101
 
101
- function _removeProperty(sName) {
102
- var nIdx = -1;
103
- _aProperties.some(function(oProperty, index) {
104
- if (oProperty.name === sName) {
105
- nIdx = index;
102
+ if (nIdx >= 0) {
103
+ aProperties.splice(nIdx, 1);
106
104
  }
107
- return nIdx !== -1;
108
- });
109
105
 
110
- if (nIdx >= 0) {
111
- _aProperties.splice(nIdx, 1);
106
+ return nIdx;
112
107
  }
113
108
 
114
- return nIdx;
109
+ var aPathParts = sPath.split("/");
110
+ var sFieldPath = aPathParts[aPathParts.length - 1];
111
+ if (_getProperty(sFieldPath)) {
112
+ _removeProperty(sFieldPath);
113
+ }
115
114
  }
116
115
 
116
+
117
+
117
118
  function _observeChanges(oChanges) {
119
+ var oFilterBar, aProperties;
118
120
 
119
121
  if (oChanges.name === "filterItems") {
120
122
  if (oChanges.mutation === "insert") {
121
123
  var oNewFF = oChanges.child;
122
- addFilterField(oNewFF);
124
+ oFilterBar = oNewFF.getParent();
125
+ aProperties = oFilterBar.__aProperties;
126
+ addFilterField(oNewFF, aProperties);
123
127
  return;
124
128
  }
125
129
  if (oChanges.mutation === "remove") {
126
130
  var oRemoveFF = oChanges.child;
127
- removeFilterField(oRemoveFF);
131
+ oFilterBar = oRemoveFF.getParent();
132
+ aProperties = oFilterBar.__aProperties;
133
+ removeFilterField(oRemoveFF, aProperties);
128
134
  return;
129
135
  }
130
136
  }
131
137
  }
132
138
 
139
+ GenericFilterBarDelegate.cleanup = function(oFilterBar) {
140
+
141
+ if (oFilterBar.__oObserver) {
142
+ oFilterBar.__oObserver.disconnect();
143
+ delete oFilterBar.__oObserver;
144
+ delete oFilterBar.__aProperties;
145
+ }
146
+
147
+ };
148
+
133
149
  return GenericFilterBarDelegate;
134
150
  });
@@ -42,17 +42,21 @@ sap.ui.define(["sap/ui/fl/apply/api/FlexRuntimeInfoAPI"], function (FlexRuntimeI
42
42
  return new Promise(function (resolve, reject) {
43
43
  var oModifier = mPropertyBag.modifier;
44
44
  var oChangeContent = bIsRevert ? oChange.getRevertData() : oChange.getContent();
45
- var oAggregateConditions = oModifier.getProperty(oControl, "aggregateConditions");
46
- var oAggregations = oAggregateConditions ? oAggregateConditions : {};
47
- oAggregations[oChangeContent.name] = {};
48
-
49
- var oAggregateContent = {
50
- name: oChangeContent.name
51
- };
52
- oModifier.setProperty(oControl, "aggregateConditions", oAggregations);
53
-
54
- fFinalizeAggregateChange(oChange, oControl, oAggregateContent, bIsRevert);
55
- resolve();
45
+ Promise.resolve()
46
+ .then(oModifier.getProperty.bind(oModifier, oControl, "aggregateConditions"))
47
+ .then(function(oAggregateConditions) {
48
+ var oAggregations = oAggregateConditions ? oAggregateConditions : {};
49
+ oAggregations[oChangeContent.name] = {};
50
+ var oAggregateContent = {
51
+ name: oChangeContent.name
52
+ };
53
+ oModifier.setProperty(oControl, "aggregateConditions", oAggregations);
54
+ fFinalizeAggregateChange(oChange, oControl, oAggregateContent, bIsRevert);
55
+ resolve();
56
+ })
57
+ .catch(function(oError) {
58
+ reject(oError);
59
+ });
56
60
  });
57
61
  };
58
62
 
@@ -60,19 +64,24 @@ sap.ui.define(["sap/ui/fl/apply/api/FlexRuntimeInfoAPI"], function (FlexRuntimeI
60
64
  return new Promise(function (resolve, reject) {
61
65
  var oModifier = mPropertyBag.modifier;
62
66
  var oChangeContent = bIsRevert ? oChange.getRevertData() : oChange.getContent();
63
- var oAggregateConditions = oModifier.getProperty(oControl, "aggregateConditions");
64
- var aValue = oAggregateConditions ? oAggregateConditions : {};
67
+ Promise.resolve()
68
+ .then(oModifier.getProperty.bind(oModifier, oControl, "aggregateConditions"))
69
+ .then(function(oAggregateConditions) {
70
+ var aValue = oAggregateConditions ? oAggregateConditions : {};
65
71
 
66
- if (!aValue) {
67
- // Nothing to remove
68
- reject();
69
- }
70
-
71
- delete aValue[oChangeContent.name];
72
- oModifier.setProperty(oControl, "aggregateConditions", aValue);
72
+ if (!aValue) {
73
+ // Nothing to remove
74
+ reject();
75
+ }
73
76
 
74
- fFinalizeAggregateChange(oChange, oControl, oChangeContent, bIsRevert);
75
- resolve();
77
+ delete aValue[oChangeContent.name];
78
+ oModifier.setProperty(oControl, "aggregateConditions", aValue);
79
+ fFinalizeAggregateChange(oChange, oControl, oChangeContent, bIsRevert);
80
+ resolve();
81
+ })
82
+ .catch(function(oError) {
83
+ reject(oError);
84
+ });
76
85
  });
77
86
  };
78
87
 
@@ -58,42 +58,45 @@ sap.ui.define([
58
58
  "changeHandler": {
59
59
  applyChange: function (oChange, oControl, mPropertyBag) {
60
60
 
61
- var oPriorAggregationConfig = Engine.getInstance().readXConfig(oControl, {
61
+ return Engine.getInstance().readXConfig(oControl, {
62
62
  propertyBag: mPropertyBag
63
- });
64
- var sOldValue = null;
63
+ })
64
+ .then(function(oPriorAggregationConfig) {
65
+ var sOldValue = null;
65
66
 
66
- if (oPriorAggregationConfig
67
- && oPriorAggregationConfig.aggregations
68
- && oPriorAggregationConfig.aggregations[sAffectedAggregation]
69
- && oPriorAggregationConfig.aggregations[sAffectedAggregation][oChange.getContent().name]
70
- && oPriorAggregationConfig.aggregations[sAffectedAggregation][oChange.getContent().name][sAffectedProperty]
71
- ){
72
- sOldValue = oPriorAggregationConfig.aggregations[sAffectedAggregation][oChange.getContent().name][sAffectedProperty];
73
- }
67
+ if (oPriorAggregationConfig
68
+ && oPriorAggregationConfig.aggregations
69
+ && oPriorAggregationConfig.aggregations[sAffectedAggregation]
70
+ && oPriorAggregationConfig.aggregations[sAffectedAggregation][oChange.getContent().name]
71
+ && oPriorAggregationConfig.aggregations[sAffectedAggregation][oChange.getContent().name][sAffectedProperty]
72
+ ){
73
+ sOldValue = oPriorAggregationConfig.aggregations[sAffectedAggregation][oChange.getContent().name][sAffectedProperty];
74
+ }
74
75
 
75
- oChange.setRevertData({
76
- name: oChange.getContent().name,
77
- value: sOldValue
78
- });
76
+ oChange.setRevertData({
77
+ name: oChange.getContent().name,
78
+ value: sOldValue
79
+ });
79
80
 
80
- Engine.getInstance().enhanceXConfig(oControl, {
81
- controlMeta: {
82
- aggregation: sAffectedAggregation,
83
- property: sAffectedProperty
84
- },
85
- name: oChange.getContent().name,
86
- value: oChange.getContent().value,
87
- propertyBag: mPropertyBag
81
+ return Engine.getInstance().enhanceXConfig(oControl, {
82
+ controlMeta: {
83
+ aggregation: sAffectedAggregation,
84
+ property: sAffectedProperty
85
+ },
86
+ name: oChange.getContent().name,
87
+ value: oChange.getContent().value,
88
+ propertyBag: mPropertyBag
89
+ });
90
+ })
91
+ .then(function() {
92
+ fConfigModified(oControl);
88
93
  });
89
- fConfigModified(oControl);
90
-
91
94
  },
92
95
  completeChangeContent: function (oChange, mChangeSpecificInfo, mPropertyBag) {
93
96
  // Not used, but needs to be there
94
97
  },
95
98
  revertChange: function (oChange, oControl, mPropertyBag) {
96
- Engine.getInstance().enhanceXConfig(oControl, {
99
+ return Engine.getInstance().enhanceXConfig(oControl, {
97
100
  controlMeta: {
98
101
  aggregation: sAffectedAggregation,
99
102
  property: sAffectedProperty
@@ -101,10 +104,11 @@ sap.ui.define([
101
104
  name: oChange.getRevertData().name,
102
105
  value: oChange.getRevertData().value,
103
106
  propertyBag: mPropertyBag
107
+ })
108
+ .then(function() {
109
+ oChange.resetRevertData();
110
+ fConfigModified(oControl);
104
111
  });
105
-
106
- oChange.resetRevertData();
107
- fConfigModified(oControl);
108
112
  }
109
113
  },
110
114
  "layers": {
@@ -12,7 +12,7 @@ sap.ui.define([
12
12
  *
13
13
  * @alias sap.ui.mdc.flexibility.Chart
14
14
  * @author SAP SE
15
- * @version 1.92.0
15
+ * @version 1.93.3
16
16
  */
17
17
  return {
18
18
  addItem: ChartItemFlex.addItem,
@@ -40,10 +40,15 @@ sap.ui.define([
40
40
  completeChangeContent: function(oChange, mSpecificChangeInfo) {
41
41
  },
42
42
  applyChange: function(oChange, oChart, mPropertyBag) {
43
- // First store the old value for revert
44
- oChange.setRevertData(mPropertyBag.modifier.getProperty(oChart, "chartType"));
45
- // Then set the new value
46
- mPropertyBag.modifier.setProperty(oChart, "chartType", oChange.getContent().chartType);
43
+ var oModifier = mPropertyBag.modifier;
44
+ return Promise.resolve()
45
+ .then(oModifier.getProperty.bind(oModifier, oChart, "chartType"))
46
+ .then(function(vOldValue) {
47
+ // First store the old value for revert
48
+ oChange.setRevertData(vOldValue);
49
+ // Then set the new value
50
+ oModifier.setProperty(oChart, "chartType", oChange.getContent().chartType);
51
+ });
47
52
  },
48
53
  revertChange: function(oChange, oChart, mPropertyBag) {
49
54
  mPropertyBag.modifier.setProperty(oChart, "chartType", oChange.getRevertData());
@@ -16,11 +16,23 @@ sap.ui.define([
16
16
  };
17
17
 
18
18
  oChartItemFlex.findItem = function(oModifier, aItems, sName) {
19
- return aItems.find(function(oItem) {
20
- var sKey = oModifier.getProperty(oItem, "key");
21
- var sKeyNew = oModifier.getProperty(oItem, "name"); // for chart remake
22
- return (sKey === sName || sKeyNew === sName);
23
- });
19
+ return aItems.reduce(function(oPreviousPromise, oItem) {
20
+ return oPreviousPromise
21
+ .then(function(oFoundItem) {
22
+ if (!oFoundItem) {
23
+ return Promise.all([
24
+ oModifier.getProperty(oItem, "key"),
25
+ oModifier.getProperty(oItem, "name") // for chart remake
26
+ ])
27
+ .then(function(aProperties) {
28
+ if (aProperties[0] === sName || aProperties[1] === sName) {
29
+ return oItem;
30
+ }
31
+ });
32
+ }
33
+ return oFoundItem;
34
+ });
35
+ }, Promise.resolve());
24
36
  };
25
37
 
26
38
  oChartItemFlex.addItem = oChartItemFlex.createAddChangeHandler();
@@ -29,4 +41,4 @@ sap.ui.define([
29
41
 
30
42
  return oChartItemFlex;
31
43
 
32
- });
44
+ });
@@ -26,10 +26,21 @@ sap.ui.define([
26
26
  };
27
27
 
28
28
  ColumnFlex.findItem = function(oModifier, aColumns, sName) {
29
- return aColumns.find(function(oColumn) {
30
- var sDataProperty = oModifier.getProperty(oColumn, "dataProperty");
31
- return sDataProperty === sName;
32
- });
29
+ return aColumns.reduce(function(oPreviousPromise, oColumn) {
30
+ return oPreviousPromise
31
+ .then(function(oFoundColumn) {
32
+ if (!oFoundColumn) {
33
+ return Promise.resolve()
34
+ .then(oModifier.getProperty.bind(oModifier, oColumn, "dataProperty"))
35
+ .then(function(sDataProperty) {
36
+ if (sDataProperty === sName) {
37
+ return oColumn;
38
+ }
39
+ });
40
+ }
41
+ return oFoundColumn;
42
+ });
43
+ }, Promise.resolve());
33
44
  };
34
45
 
35
46
  ColumnFlex.afterApply = function(sChangeType, oTable, bIsRevert) {
@@ -21,52 +21,54 @@ sap.ui.define([
21
21
  oFilterControl.applyConditionsAfterChangesApplied();
22
22
  }
23
23
 
24
- return new Promise(function(resolve) {
24
+ return new Promise(function(resolve, reject) {
25
25
 
26
26
  var mConditionsData, aConditions = null, oModifier = mPropertyBag.modifier;
27
27
 
28
- // 'filterConditions' property needs to be updated for change selector
29
- mConditionsData = merge({}, oModifier.getProperty(oControl, "filterConditions"));
30
- if (mConditionsData) {
31
- for (var sFieldPath in mConditionsData) {
32
- if (sFieldPath === oChangeContent.name) {
33
- aConditions = mConditionsData[sFieldPath];
34
- break;
28
+ Promise.resolve()
29
+ .then(oModifier.getProperty.bind(oModifier, oControl, "filterConditions"))
30
+ .then(function(mFilterConditions) {
31
+ // 'filterConditions' property needs to be updated for change selector
32
+ mConditionsData = merge({}, mFilterConditions);
33
+ if (mConditionsData) {
34
+ for (var sFieldPath in mConditionsData) {
35
+ if (sFieldPath === oChangeContent.name) {
36
+ aConditions = mConditionsData[sFieldPath];
37
+ break;
38
+ }
39
+ }
35
40
  }
36
- }
37
- }
38
41
 
39
- if (!aConditions) {
40
- mConditionsData[oChangeContent.name] = [];
41
- aConditions = mConditionsData[oChangeContent.name];
42
- }
42
+ if (!aConditions) {
43
+ mConditionsData[oChangeContent.name] = [];
44
+ aConditions = mConditionsData[oChangeContent.name];
45
+ }
43
46
 
44
- var nConditionIdx = FilterOperatorUtil.indexOfCondition(oChangeContent.condition, aConditions);
45
- if (nConditionIdx < 0) {
46
- aConditions.push(oChangeContent.condition);
47
-
48
- // 'filterConditions' property needs to be updated for change selector
49
- oModifier.setProperty(oControl, "filterConditions", mConditionsData);
50
-
51
- if (!bIsRevert) {
52
- // Set revert data on the change
53
- oChange.setRevertData({
54
- name: oChangeContent.name,
55
- condition: oChangeContent.condition
56
- });
57
- }
58
-
59
- // the control providing the filter functionality needs to be used to update the ConditionModel
60
- if (oFilterControl && oFilterControl.addCondition) {
61
- oFilterControl.addCondition(oChangeContent.name, oChangeContent.condition).then(function() {
62
- resolve();
63
- });
64
- } else {
65
- resolve();
66
- }
67
- } else {
68
- resolve();
69
- }
47
+ var nConditionIdx = FilterOperatorUtil.indexOfCondition(oChangeContent.condition, aConditions);
48
+ if (nConditionIdx < 0) {
49
+ aConditions.push(oChangeContent.condition);
50
+
51
+ // 'filterConditions' property needs to be updated for change selector
52
+ oModifier.setProperty(oControl, "filterConditions", mConditionsData);
53
+
54
+ if (!bIsRevert) {
55
+ // Set revert data on the change
56
+ oChange.setRevertData({
57
+ name: oChangeContent.name,
58
+ condition: oChangeContent.condition
59
+ });
60
+ }
61
+
62
+ // the control providing the filter functionality needs to be used to update the ConditionModel
63
+ if (oFilterControl && oFilterControl.addCondition) {
64
+ return oFilterControl.addCondition(oChangeContent.name, oChangeContent.condition);
65
+ }
66
+ }
67
+ })
68
+ .then(resolve)
69
+ .catch(function(oError) {
70
+ reject(oError);
71
+ });
70
72
  });
71
73
  };
72
74
 
@@ -78,54 +80,54 @@ sap.ui.define([
78
80
  oFilterControl.applyConditionsAfterChangesApplied();
79
81
  }
80
82
 
81
- return new Promise(function(resolve) {
83
+ return new Promise(function(resolve, reject) {
82
84
  var mConditionsData, aConditions, nDelIndex = -1, oModifier = mPropertyBag.modifier;
83
85
 
84
- // 'filterConditions' property needs to be updated for change selector
85
- mConditionsData = merge({}, oModifier.getProperty(oControl, "filterConditions"));
86
- if (mConditionsData) {
87
- for (var sFieldPath in mConditionsData) {
88
- if (sFieldPath === oChangeContent.name) {
89
- aConditions = mConditionsData[sFieldPath];
90
- break;
91
- }
92
- }
93
- }
94
-
95
- if (aConditions && (aConditions.length > 0)) {
96
-
97
- nDelIndex = FilterOperatorUtil.indexOfCondition(oChangeContent.condition, aConditions);
98
- if (nDelIndex >= 0) {
99
- aConditions.splice(nDelIndex, 1);
100
- // if (aConditions.length === 0) {
101
- // delete mConditionsData[oChangeContent.name];
102
- // }
86
+ Promise.resolve()
87
+ .then(oModifier.getProperty.bind(oModifier, oControl, "filterConditions"))
88
+ .then(function(mFilterConditions) {
103
89
  // 'filterConditions' property needs to be updated for change selector
104
- oModifier.setProperty(oControl, "filterConditions", mConditionsData);
105
-
106
- if (!bIsRevert) {
107
- // Set revert data on the change
108
- oChange.setRevertData({
109
- name: oChangeContent.name,
110
- condition: oChangeContent.condition
111
- });
90
+ mConditionsData = merge({}, mFilterConditions);
91
+
92
+ if (mConditionsData) {
93
+ for (var sFieldPath in mConditionsData) {
94
+ if (sFieldPath === oChangeContent.name) {
95
+ aConditions = mConditionsData[sFieldPath];
96
+ break;
97
+ }
98
+ }
112
99
  }
113
100
 
114
- // the control providing the filter functionality needs to be used to update the ConditionModel
115
- if (oFilterControl && oFilterControl.removeCondition) {
116
- oFilterControl.removeCondition(oChangeContent.name, oChangeContent.condition).then(function() {
117
- resolve();
118
- });
119
- } else {
120
- resolve();
101
+ if (aConditions && (aConditions.length > 0)) {
102
+
103
+ nDelIndex = FilterOperatorUtil.indexOfCondition(oChangeContent.condition, aConditions);
104
+ if (nDelIndex >= 0) {
105
+ aConditions.splice(nDelIndex, 1);
106
+ // if (aConditions.length === 0) {
107
+ // delete mConditionsData[oChangeContent.name];
108
+ // }
109
+ // 'filterConditions' property needs to be updated for change selector
110
+ oModifier.setProperty(oControl, "filterConditions", mConditionsData);
111
+
112
+ if (!bIsRevert) {
113
+ // Set revert data on the change
114
+ oChange.setRevertData({
115
+ name: oChangeContent.name,
116
+ condition: oChangeContent.condition
117
+ });
118
+ }
119
+
120
+ // the control providing the filter functionality needs to be used to update the ConditionModel
121
+ if (oFilterControl && oFilterControl.removeCondition) {
122
+ return oFilterControl.removeCondition(oChangeContent.name, oChangeContent.condition);
123
+ }
124
+ }
121
125
  }
122
- } else {
123
- resolve();
124
- }
125
- } else {
126
- resolve();
127
- }
128
-
126
+ })
127
+ .then(resolve)
128
+ .catch(function(oError) {
129
+ reject(oError);
130
+ });
129
131
  });
130
132
  };
131
133
 
@@ -12,7 +12,7 @@ sap.ui.define(['./FilterItemFlex', './ConditionFlex'], function(FilterItemFlex,
12
12
  *
13
13
  * @alias sap.ui.mdc.flexibility.FilterBar
14
14
  * @author SAP SE
15
- * @version 1.92.0
15
+ * @version 1.93.3
16
16
  */
17
17
 
18
18
  return {
@@ -12,7 +12,7 @@ sap.ui.define(['./ItemBaseFlex'], function(ItemBaseFlex) {
12
12
  *
13
13
  * @alias sap.ui.mdc.flexibility.FilterBar
14
14
  * @author SAP SE
15
- * @version 1.92.0
15
+ * @version 1.93.3
16
16
  */
17
17
 
18
18
  var oFilterItemFlex = Object.assign({}, ItemBaseFlex);