@openui5/sap.ui.mdc 1.99.0 → 1.100.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.
Files changed (173) hide show
  1. package/THIRDPARTY.txt +2 -2
  2. package/package.json +4 -4
  3. package/src/sap/ui/mdc/.library +1 -1
  4. package/src/sap/ui/mdc/ActionToolbar.js +1 -1
  5. package/src/sap/ui/mdc/Chart.js +50 -32
  6. package/src/sap/ui/mdc/ChartDelegate.js +66 -21
  7. package/src/sap/ui/mdc/ChartRenderer.js +1 -1
  8. package/src/sap/ui/mdc/Control.js +11 -6
  9. package/src/sap/ui/mdc/Element.js +10 -6
  10. package/src/sap/ui/mdc/Field.js +19 -4
  11. package/src/sap/ui/mdc/FilterBar.js +1 -1
  12. package/src/sap/ui/mdc/FilterBarDelegate.js +26 -0
  13. package/src/sap/ui/mdc/FilterField.js +41 -3
  14. package/src/sap/ui/mdc/Link.js +3 -3
  15. package/src/sap/ui/mdc/MultiValueField.js +11 -1
  16. package/src/sap/ui/mdc/Table.js +73 -39
  17. package/src/sap/ui/mdc/TableDelegate.js +28 -1
  18. package/src/sap/ui/mdc/ValueHelp.js +8 -3
  19. package/src/sap/ui/mdc/ValueHelpDelegate.js +2 -1
  20. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -1
  21. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarActionRenderer.js +1 -1
  22. package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
  23. package/src/sap/ui/mdc/chart/ChartToolbar.js +13 -6
  24. package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +7 -7
  25. package/src/sap/ui/mdc/chart/DrillStackHandler.js +6 -6
  26. package/src/sap/ui/mdc/chart/PropertyHelper.js +1 -1
  27. package/src/sap/ui/mdc/condition/Condition.js +1 -1
  28. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  29. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  30. package/src/sap/ui/mdc/condition/FilterConverter.js +4 -2
  31. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +133 -25
  32. package/src/sap/ui/mdc/condition/Operator.js +4 -2
  33. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +78 -24
  34. package/src/sap/ui/mdc/condition/RangeOperator.js +5 -5
  35. package/src/sap/ui/mdc/designtime/Util.js +63 -0
  36. package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +23 -30
  37. package/src/sap/ui/mdc/designtime/chart/Chart.designtime.js +3 -0
  38. package/src/sap/ui/mdc/designtime/link/PanelItem.designtime.js +3 -1
  39. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +39 -52
  40. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  41. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
  42. package/src/sap/ui/mdc/field/ConditionType.js +15 -4
  43. package/src/sap/ui/mdc/field/ConditionsType.js +2 -1
  44. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  45. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  46. package/src/sap/ui/mdc/field/DefineConditionPanel.js +16 -5
  47. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +76 -19
  48. package/src/sap/ui/mdc/field/FieldBase.js +62 -11
  49. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +1 -1
  50. package/src/sap/ui/mdc/field/FieldHelpBase.js +1 -1
  51. package/src/sap/ui/mdc/field/FieldInfoBase.js +2 -1
  52. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  53. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  54. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  55. package/src/sap/ui/mdc/field/FieldValueHelp.js +4 -1
  56. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  57. package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +1 -1
  58. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +5 -4
  59. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +5 -3
  60. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +1 -1
  61. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +7 -7
  62. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  63. package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
  64. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  65. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  66. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  67. package/src/sap/ui/mdc/field/TokenDisplay.js +1 -1
  68. package/src/sap/ui/mdc/field/TokenizerDisplay.js +1 -1
  69. package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
  70. package/src/sap/ui/mdc/field/content/ContentFactory.js +5 -1
  71. package/src/sap/ui/mdc/field/content/DateContent.js +27 -19
  72. package/src/sap/ui/mdc/field/content/DateTimeContent.js +0 -6
  73. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +76 -208
  74. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +27 -2
  75. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +127 -57
  76. package/src/sap/ui/mdc/filterbar/p13n/FilterColumnLayout.js +2 -2
  77. package/src/sap/ui/mdc/filterbar/p13n/GroupContainer.js +7 -3
  78. package/src/sap/ui/mdc/filterbar/p13n/TableContainer.js +52 -14
  79. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +37 -19
  80. package/src/sap/ui/mdc/filterbar/vh/FilterContainer.js +1 -1
  81. package/src/sap/ui/mdc/flexibility/AggregationConfigFlex.js +48 -31
  82. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
  83. package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +36 -0
  84. package/src/sap/ui/mdc/flexibility/ConditionFlex.js +47 -10
  85. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  86. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  87. package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +0 -1
  88. package/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js +2 -85
  89. package/src/sap/ui/mdc/library.js +11 -4
  90. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  91. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  92. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  93. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  94. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  95. package/src/sap/ui/mdc/link/Factory.js +1 -1
  96. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  97. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  98. package/src/sap/ui/mdc/link/Panel.js +1 -1
  99. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  100. package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
  101. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  102. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  103. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  104. package/src/sap/ui/mdc/messagebundle.properties +2 -1
  105. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +20 -19
  106. package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -141
  107. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -9
  108. package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
  109. package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +348 -0
  110. package/src/sap/ui/mdc/odata/TypeUtil.js +1 -1
  111. package/src/sap/ui/mdc/odata/v4/ChartPropertyHelper.js +70 -3
  112. package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +116 -20
  113. package/src/sap/ui/mdc/odata/v4/ODataMetaModelUtil.js +2 -2
  114. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +11 -33
  115. package/src/sap/ui/mdc/odata/v4/TypeUtil.js +2 -4
  116. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +1 -1
  117. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +281 -263
  118. package/src/sap/ui/mdc/p13n/AdaptationProvider.js +1 -1
  119. package/src/sap/ui/mdc/p13n/Engine.js +21 -18
  120. package/src/sap/ui/mdc/p13n/FlexUtil.js +0 -5
  121. package/src/sap/ui/mdc/p13n/PropertyHelper.js +2 -2
  122. package/src/sap/ui/mdc/p13n/StateUtil.js +4 -0
  123. package/src/sap/ui/mdc/p13n/UIManager.js +16 -13
  124. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +18 -14
  125. package/src/sap/ui/mdc/p13n/modules/DefaultProviderRegistry.js +1 -1
  126. package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +6 -6
  127. package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +49 -27
  128. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +4 -3
  129. package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +136 -0
  130. package/src/sap/ui/mdc/p13n/panels/GroupView.js +53 -28
  131. package/src/sap/ui/mdc/p13n/panels/LinkSelectionPanel.js +54 -18
  132. package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +4 -7
  133. package/src/sap/ui/mdc/p13n/subcontroller/AdaptFiltersController.js +1 -2
  134. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
  135. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +8 -4
  136. package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +1 -0
  137. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +2 -2
  138. package/src/sap/ui/mdc/table/CreationRow.js +1 -1
  139. package/src/sap/ui/mdc/table/GridTableType.js +75 -27
  140. package/src/sap/ui/mdc/table/PropertyHelper.js +20 -13
  141. package/src/sap/ui/mdc/table/ResponsiveTableType.js +86 -13
  142. package/src/sap/ui/mdc/table/RowActionItem.js +119 -0
  143. package/src/sap/ui/mdc/table/RowSettings.js +42 -1
  144. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +2 -2
  145. package/src/sap/ui/mdc/themes/base/Chart.less +2 -0
  146. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +1 -0
  147. package/src/sap/ui/mdc/util/DateUtil.js +32 -7
  148. package/src/sap/ui/mdc/util/FilterUtil.js +1 -1
  149. package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
  150. package/src/sap/ui/mdc/util/PropertyHelper.js +201 -76
  151. package/src/sap/ui/mdc/util/TypeUtil.js +1 -1
  152. package/src/sap/ui/mdc/valuehelp/Dialog.js +1 -1
  153. package/src/sap/ui/mdc/valuehelp/Popover.js +5 -3
  154. package/src/sap/ui/mdc/valuehelp/base/Container.js +1 -1
  155. package/src/sap/ui/mdc/valuehelp/base/Content.js +1 -1
  156. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
  157. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +4 -4
  158. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +1 -1
  159. package/src/sap/ui/mdc/valuehelp/content/Bool.js +1 -1
  160. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +1 -1
  161. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +13 -10
  162. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +4 -10
  163. package/src/sap/ui/mdc/valuehelp/content/MTable.js +6 -4
  164. package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +2 -0
  165. package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +0 -1
  166. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +8 -6
  167. package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +0 -150
  168. package/src/sap/ui/mdc/p13n/panels/BasePanel.js +0 -721
  169. package/src/sap/ui/mdc/p13n/panels/ListView.js +0 -408
  170. package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -92
  171. package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -150
  172. package/src/sap/ui/mdc/ui/Container.js +0 -240
  173. package/src/sap/ui/mdc/ui/ContainerItem.js +0 -79
@@ -25,7 +25,9 @@ sap.ui.define([
25
25
  "sap/m/MessageStrip",
26
26
  "../TypeUtil",
27
27
  "../FilterBarDelegate",
28
- "sap/ui/model/Filter"
28
+ "sap/ui/model/Filter",
29
+ "sap/ui/mdc/odata/v4/ChartPropertyHelper",
30
+ "sap/ui/thirdparty/jquery"
29
31
  ], function (
30
32
  V4ChartDelegate,
31
33
  loadModules,
@@ -47,7 +49,9 @@ sap.ui.define([
47
49
  MessageStrip,
48
50
  V4TypeUtil,
49
51
  V4FilterBarDelegate,
50
- Filter
52
+ Filter,
53
+ PropertyHelper,
54
+ jQuery
51
55
  ) {
52
56
  "use strict";
53
57
  /**
@@ -96,6 +100,36 @@ sap.ui.define([
96
100
  return V4FilterBarDelegate;
97
101
  };
98
102
 
103
+ /**
104
+ * This methods is called during the appliance of the add condition change.
105
+ * This intention is to update the propertyInfo property.
106
+ *
107
+ * @param {string} sPropertyName The name of a property.
108
+ * @param {sap.ui.mdc.Control} oControl - the instance of the mdc control
109
+ * @param {Object} mPropertyBag Instance of property bag from Flex change API
110
+ * @returns {Promise} Promise that resolves once the properyInfo property was updated
111
+ */
112
+ ChartDelegate.addCondition = function(sPropertyName, oControl, mPropertyBag) {
113
+ //return this.getFilterDelegate().addCondition(sPropertyName, oControl, mPropertyBag);
114
+ // will be activated, once mdc.Chart has the property propertyInfo.
115
+ return Promise.resolve();
116
+ };
117
+
118
+ /**
119
+ * This methods is called during the appliance of the remove condition change.
120
+ * This intention is to update the propertyInfo property.
121
+ *
122
+ * @param {string} sPropertyName The name of a property.
123
+ * @param {sap.ui.mdc.Control} oControl - the instance of the mdc control
124
+ * @param {Object} mPropertyBag Instance of property bag from Flex change API
125
+ * @returns {Promise} Promise that resolves once the properyInfo property was updated
126
+ */
127
+ ChartDelegate.removeCondition = function(sPropertyName, oControl, mPropertyBag) {
128
+ //return this.getFilterDelegate().removeCondition(sPropertyName, oControl, mPropertyBag);
129
+ // will be activated, once mdc.Chart has the property propertyInfo.
130
+ return Promise.resolve();
131
+ };
132
+
99
133
  ChartDelegate._deleteState = function(oMDCChart) {
100
134
 
101
135
  if (this._getState(oMDCChart).vizTooltip) {
@@ -213,7 +247,7 @@ sap.ui.define([
213
247
 
214
248
  /**
215
249
  * Gets the current zooming information for the inner chart
216
- * @returns {integer} Current zoom level on the inner chart
250
+ * @returns {int} Current zoom level on the inner chart
217
251
  */
218
252
  ChartDelegate.getZoomState = function (oMDCChart) {
219
253
 
@@ -296,6 +330,10 @@ sap.ui.define([
296
330
 
297
331
  ChartDelegate.getAdaptionUI = function(oMDCChart) {
298
332
 
333
+ return Promise.resolve(this._setupAdaptionUI(oMDCChart));
334
+ };
335
+
336
+ ChartDelegate._setupAdaptionUI = function(oMDCChart) {
299
337
  var oLayoutConfig = this.getChartTypeLayoutConfig().find(function(it){return it.key === oMDCChart.getChartType();});
300
338
 
301
339
  //Default case -> everything allowed
@@ -322,12 +360,13 @@ sap.ui.define([
322
360
  oPanel.setMessageStrip(new MessageStrip({text: MDCRb.getText("chart.PERSONALIZATION_DIALOG_MEASURE_WARNING"), type:"Warning"}));
323
361
  }
324
362
 
325
- return Promise.resolve(oPanel);
363
+ return oPanel;
326
364
  };
327
365
 
328
366
  /**
329
367
  * Sets the visibility of the legend
330
368
  * This is called by the MDC Chart, do not call it directly!
369
+ * @param {sap.ui.mdc.Chart} oMDCChart Chart to the set the legend visibility on
331
370
  * @param {boolean} bVisible true to show legend, false to hide
332
371
  *
333
372
  * @experimental
@@ -370,7 +409,8 @@ sap.ui.define([
370
409
  /**
371
410
  * Inserts an MDC Chart Item (in case of sap.chart.Chart a Measure/Dimension) on the inner chart
372
411
  * This function is called by MDC Chart on a change of the <code>Items</code> aggregation
373
- * @param {sap.ui.mdc.chart-Item} oMDCChartItem the MDC CHart Item to insert into the inner chart
412
+ * @param {sap.ui.mdc.Chart} oMDCChart the MDC Chart to insert the item into
413
+ * @param {sap.ui.mdc.chart.Item} oMDCChartItem the MDC Chart Item to insert into the inner chart
374
414
  * @param {int} iIndex the index to insert into
375
415
  */
376
416
  ChartDelegate.insertItemToInnerChart = function (oMDCChart, oMDCChartItem, iIndex) {
@@ -404,14 +444,14 @@ sap.ui.define([
404
444
  this._updateColoring(oMDCChart, this._getChart(oMDCChart).getVisibleDimensions(), this._getChart(oMDCChart).getVisibleMeasures());
405
445
  }.bind(this));
406
446
 
407
- this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
408
- this._updateSemanticalPattern(oMDCChart, aProperties);
409
- }.bind(this));
447
+ this._updateSemanticalPattern(oMDCChart);
448
+
410
449
  };
411
450
 
412
451
  /**
413
452
  * Removes an Item (in case of sap.chart.Chart a Measure/Dimension) from the inner chart
414
453
  * This function is called by MDC Chart on a change of the <code>Items</code> aggregation
454
+ * @param {sap.ui.mdc.Chart} oMDCChart the MDC Chart to remove the item from
415
455
  * @param {sap.ui.mdc.chart.Item} oMDCChartItem The Item to remove from the inner chart
416
456
  */
417
457
  ChartDelegate.removeItemFromInnerChart = function (oMDCChart, oMDCChartItem) {
@@ -441,9 +481,8 @@ sap.ui.define([
441
481
 
442
482
  //Update coloring and semantical patterns on Item change
443
483
  this._updateColoring(oMDCChart, this._getChart(oMDCChart).getVisibleDimensions(), this._getChart(oMDCChart).getVisibleMeasures());
444
- this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
445
- this._updateSemanticalPattern(oMDCChart, aProperties);
446
- }.bind(this));
484
+
485
+ this._updateSemanticalPattern(oMDCChart);
447
486
  };
448
487
 
449
488
  /**
@@ -458,29 +497,64 @@ sap.ui.define([
458
497
  if (oMDCChart.getModel) {
459
498
  return Promise.resolve(this._createMDCChartItem(sPropertyName, oMDCChart, sRole));
460
499
  }
461
- return Promise.resolve(null);
462
500
  };
463
501
 
464
502
  ChartDelegate.removeItem = function (oProperty, oMDCChart) {
465
503
  return Promise.resolve(true);
466
504
  };
467
505
 
468
- ChartDelegate._createMDCChartItem = function (sPropertyName, oMDCChart, sRole) {
469
- return this.fetchProperties(oMDCChart).then(function (aProperties) {
506
+ /**
507
+ * This will iterate over all items of the MDC Chart to make sure all necessary information is available on them
508
+ * If something is missing, this method will update the item accordingly
509
+ * @param {sap.ui.mdc.Chart} oMDCChart the MDC Chart to check the items on
510
+ * @returns {Promise} resolves once check is complete
511
+ */
512
+ ChartDelegate.checkAndUpdateMDCItems = function(oMDCChart) {
513
+ return new Promise(function(resolve, reject){
514
+ var aPropPromises = [];
515
+
516
+ oMDCChart.getItems().forEach(function(oMDCItem){
517
+ var bIsComplete = oMDCItem.getName() && oMDCItem.getLabel() && oMDCItem.getType() && oMDCItem.getRole();
518
+
519
+ if (!bIsComplete) {
520
+ aPropPromises.push(this._getPropertyInfosByName(oMDCItem.getName(), oMDCChart).then(function(oPropertyInfo){
521
+ oMDCItem.setLabel(oPropertyInfo.label);
522
+
523
+ if (oPropertyInfo.groupable) {
524
+ oMDCItem.setType("groupable");
525
+ oMDCItem.setRole(oMDCItem.getRole() ? oMDCItem.getRole() : "category");
526
+ } else if (oPropertyInfo.aggregatable) {
527
+ oMDCItem.setType("aggregatable");
528
+ oMDCItem.setRole(oMDCItem.getRole() ? oMDCItem.getRole() : "axis1");
529
+ }
530
+ }));
531
+ }
532
+ }.bind(this));
470
533
 
471
- //Uses excact MDC Chart Item id
472
- var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
473
- return oCurrentPropertyInfo.name === sPropertyName;
534
+ Promise.all(aPropPromises).then(function(){
535
+ resolve();
474
536
  });
537
+ }.bind(this));
538
+
539
+ };
475
540
 
541
+ ChartDelegate._createMDCChartItem = function (sPropertyName, oMDCChart, sRole) {
542
+
543
+ return this._getPropertyInfosByName(sPropertyName, oMDCChart).then(function(oPropertyInfo){
476
544
  if (!oPropertyInfo) {
477
545
  return null;
478
546
  }
479
547
 
548
+ return this._createMDCItemFromProperty(oPropertyInfo, oMDCChart.getId(), sRole);
549
+
550
+ }.bind(this));
551
+
552
+ };
553
+
554
+ ChartDelegate._createMDCItemFromProperty = function(oPropertyInfo, idPrefix, sRole) {
480
555
 
481
- //TODO: Check for case: both aggegatable and groupable
482
556
  if (oPropertyInfo.groupable) {
483
- return new MDCChartItem(oMDCChart.getId() + "--GroupableItem--" + oPropertyInfo.name, {
557
+ return new MDCChartItem(idPrefix + "--GroupableItem--" + oPropertyInfo.name, {
484
558
  name: oPropertyInfo.name,
485
559
  label: oPropertyInfo.label,
486
560
  type: "groupable",
@@ -490,14 +564,15 @@ sap.ui.define([
490
564
 
491
565
  if (oPropertyInfo.aggregatable) {
492
566
 
493
- return new MDCChartItem(oMDCChart.getId() + "--AggregatableItem--" + oPropertyInfo.name, {
567
+ return new MDCChartItem(idPrefix + "--AggregatableItem--" + oPropertyInfo.name, {
494
568
  name: oPropertyInfo.name,
495
569
  label: oPropertyInfo.label,
496
570
  type: "aggregatable",
497
571
  role: sRole ? sRole : "axis1"
498
572
  });
499
573
  }
500
- });
574
+
575
+ return null;
501
576
  };
502
577
 
503
578
  /**
@@ -542,114 +617,121 @@ sap.ui.define([
542
617
  };
543
618
 
544
619
  ChartDelegate._createContentFromItems = function (oMDCChart) {
545
- //This is done so the user doesn't have to specify property path & aggregation method in the XML
546
- this.fetchProperties(oMDCChart).then(function (aProperties) {
620
+ return new Promise(function(resolve, reject){
621
+ //This is done so the user doesn't have to specify property path & aggregation method in the XML
547
622
  var aColorPromises = [];
623
+ var aPropPromises = [];
548
624
 
549
625
  var aVisibleDimensions = [];
550
626
  var aVisibleMeasures = [];
551
627
  oMDCChart.getItems().forEach(function (oItem, iIndex) {
552
628
 
553
629
  //Uses excact mdc chart item id
554
- var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
555
- return oCurrentPropertyInfo.name === oItem.getName();
556
- });
630
+ aPropPromises.push(this._getPropertyInfosByName( oItem.getName(), oMDCChart).then(function(oPropertyInfo){
631
+ //Skip a Item if there is no property representing the Item inside the backend
632
+ if (!oPropertyInfo){
633
+ Log.error("sap.ui.mdc.Chart: Item " + oItem.getName() + " has no property info representing it in the metadata. Make sure the name is correct and the metadata is defined correctly. Skipping the item!");
634
+ return;
635
+ }
557
636
 
558
- //Skip a Item if there is no property representing the Item inside the backend
559
- if (!oPropertyInfo){
560
- Log.error("sap.ui.mdc.Chart: Item " + oItem.getName() + " has no property info representing it in the metadata. Make sure the name is correct and the metadata is defined correctly. Skipping the item!");
561
- return;
562
- }
637
+ switch (oItem.getType()) {
638
+ case "groupable":
639
+ aVisibleDimensions.push(this.getInternalChartNameFromPropertyNameAndKind(oItem.getName(), "groupable", oMDCChart));
563
640
 
564
- switch (oItem.getType()) {
565
- case "groupable":
566
- aVisibleDimensions.push(this.getInternalChartNameFromPropertyNameAndKind(oItem.getName(), "groupable", oMDCChart));
641
+ this._addInnerDimension(oMDCChart, oItem, oPropertyInfo);
642
+ break;
643
+ case "aggregatable":
567
644
 
568
- this._addInnerDimension(oMDCChart, oItem, oPropertyInfo);
569
- break;
570
- case "aggregatable":
645
+ //TODO: Alias might be changing after backend request
646
+ aVisibleMeasures.push(this._getAggregatedMeasureNameForMDCItem(oItem));
571
647
 
572
- //TODO: Alias might be changing after backend request
573
- aVisibleMeasures.push(this._getAggregatedMeasureNameForMDCItem(oItem));
648
+ this._addInnerMeasure(oMDCChart, oItem, oPropertyInfo);
649
+ break;
574
650
 
575
- this._addInnerMeasure(oMDCChart, oItem, oPropertyInfo);
576
- break;
651
+ default:
652
+ Log.error("MDC Chart Item " + oItem.getId() + " with label " + oItem.getLabel() + " has no known type. Supported typed are: \"groupable\" & \"aggregatable\"");
653
+ }
577
654
 
578
- default:
579
- Log.error("MDC Chart Item " + oItem.getId() + " with label " + oItem.getLabel() + " has no known type. Supported typed are: \"groupable\" & \"aggregatable\"");
580
- }
655
+ aColorPromises.push(this._prepareColoringForItem(oItem));
656
+ }.bind(this)));
581
657
 
582
- aColorPromises.push(this._prepareColoringForItem(oItem));
583
658
  }.bind(this));
584
659
 
585
- this._getState(oMDCChart).aColMeasures.forEach(function(sKey) {
660
+ Promise.all(aPropPromises).then(function(){
661
+ this._getState(oMDCChart).aColMeasures.forEach(function(sKey) {
586
662
 
587
- if (this._getState(oMDCChart).aInSettings.indexOf(sKey) == -1) {
663
+ if (this._getState(oMDCChart).aInSettings.indexOf(sKey) == -1) {
588
664
 
589
- var oPropertyInfo = oMDCChart.getPropertyHelper().getProperty(sKey); //this.getPropertyFromNameAndKind not used as the key is the name of the MDC Chart Item
665
+ aColorPromises.push(new Promise(function(resolve, reject){
666
+ oMDCChart._getPropertyByNameAsync(sKey).then(function(oPropertyInfo){
667
+ var aggregationMethod = oPropertyInfo.aggregationMethod;
668
+ var propertyPath = oPropertyInfo.propertyPath;
669
+ var sName = this.getInternalChartNameFromPropertyNameAndKind(sKey, "aggregatable", oMDCChart);
590
670
 
591
- var aggregationMethod = oPropertyInfo.aggregationMethod;
592
- var propertyPath = oPropertyInfo.propertyPath;
593
- var sName = this.getInternalChartNameFromPropertyNameAndKind(sKey, "aggregatable", oMDCChart);
671
+ var oMeasureSettings = {
672
+ name: sName,
673
+ label: oPropertyInfo.label,
674
+ role: "axis1"
675
+ };
594
676
 
595
- var oMeasureSettings = {
596
- name: sName,
597
- label: oPropertyInfo.label,
598
- role: "axis1"
599
- };
677
+ if (aggregationMethod && propertyPath) {
678
+ oMeasureSettings.analyticalInfo = {
679
+ propertyPath: propertyPath,
680
+ "with": aggregationMethod
681
+ };
682
+ }
600
683
 
601
- if (aggregationMethod && propertyPath) {
602
- oMeasureSettings.analyticalInfo = {
603
- propertyPath: propertyPath,
604
- "with": aggregationMethod
605
- };
606
- }
684
+ var oMeasure = new Measure(oMeasureSettings);
607
685
 
608
- var oMeasure = new Measure(oMeasureSettings);
686
+ aVisibleMeasures.push(oMeasure);
687
+ this._getChart(oMDCChart).addMeasure(oMeasure);
688
+ resolve();
689
+ }); //this.getPropertyFromNameAndKind not used as the key is the name of the MDC Chart Item
609
690
 
610
- aVisibleMeasures.push(oMeasure);
611
- this._getChart(oMDCChart).addMeasure(oMeasure);
612
- }
691
+ }));
692
+ }
613
693
 
614
- }.bind(this));
694
+ }.bind(this));
615
695
 
616
- Promise.all(aColorPromises).then(function(){
617
- this._getChart(oMDCChart).setVisibleDimensions(aVisibleDimensions);
618
- this._getChart(oMDCChart).setVisibleMeasures(aVisibleMeasures);
696
+ Promise.all(aColorPromises).then(function(){
697
+ this._getChart(oMDCChart).setVisibleDimensions(aVisibleDimensions);
698
+ this._getChart(oMDCChart).setVisibleMeasures(aVisibleMeasures);
619
699
 
620
- var aInResultDimensions = oMDCChart.getDelegate().inResultDimensions; //TODO: Does this use internal name? If so, change _getPropertyInfosByName below; Most likely not the case
621
- if (aInResultDimensions && aInResultDimensions instanceof Array && aInResultDimensions.length != 0) {
700
+ var aInResultDimensions = oMDCChart.getDelegate().inResultDimensions; //TODO: Does this use internal name? If so, change _getPropertyInfosByName below; Most likely not the case
701
+ if (aInResultDimensions && aInResultDimensions instanceof Array && aInResultDimensions.length != 0) {
622
702
 
623
- var aInResultPromises = [];
703
+ var aInResultPromises = [];
624
704
 
625
- aInResultDimensions.forEach(function(sInResultDim){
705
+ aInResultDimensions.forEach(function(sInResultDim){
626
706
 
627
- aInResultPromises.push(this._getPropertyInfosByName(sInResultDim, oMDCChart).then(function(oPropertyInfos){
628
- var sName = this.getInternalChartNameFromPropertyNameAndKind(oPropertyInfos.name, "groupable", oMDCChart);
707
+ aInResultPromises.push(this._getPropertyInfosByName(sInResultDim, oMDCChart).then(function(oPropertyInfos){
708
+ var sName = this.getInternalChartNameFromPropertyNameAndKind(oPropertyInfos.name, "groupable", oMDCChart);
629
709
 
630
- var oDim = new Dimension({
631
- name: sName,
632
- label: oPropertyInfos.label
633
- });
710
+ var oDim = new Dimension({
711
+ name: sName,
712
+ label: oPropertyInfos.label
713
+ });
634
714
 
635
- this._getState(oMDCChart).inResultDimensions.push(sName);
636
- this._getChart(oMDCChart).addDimension(oDim);
637
- }.bind(this)));
715
+ this._getState(oMDCChart).inResultDimensions.push(sName);
716
+ this._getChart(oMDCChart).addDimension(oDim);
717
+ }.bind(this)));
638
718
 
639
- }.bind(this));
719
+ }.bind(this));
640
720
 
641
- Promise.all(aInResultPromises).then(function(){
642
- this._getChart(oMDCChart).setInResultDimensions(this._getState(oMDCChart).inResultDimensions);
643
- }.bind(this));
721
+ Promise.all(aInResultPromises).then(function(){
722
+ this._getChart(oMDCChart).setInResultDimensions(this._getState(oMDCChart).inResultDimensions);
723
+ }.bind(this));
644
724
 
645
- }
725
+ }
726
+
727
+ this._updateColoring(oMDCChart, aVisibleDimensions, aVisibleMeasures);
728
+ this._updateSemanticalPattern(oMDCChart);
646
729
 
647
- this._updateColoring(oMDCChart, aVisibleDimensions, aVisibleMeasures);
648
- this._updateSemanticalPattern(oMDCChart, aProperties);
730
+ resolve();
731
+ }.bind(this));
649
732
  }.bind(this));
650
733
 
651
734
  }.bind(this));
652
-
653
735
  };
654
736
 
655
737
  ChartDelegate.getInnerChart = function (oMDCChart) {
@@ -752,7 +834,7 @@ sap.ui.define([
752
834
 
753
835
  /**
754
836
  * Updates the coloring on the inner chart
755
- * @param {sap.chart.Chart} oChart inner chart
837
+ * @param {sap.chart.Chart} oMDCChart inner chart
756
838
  * @param {array} aVisibleDimensions visible dimensions for inner chart
757
839
  * @param {array} aVisibleMeasures visible measures for inner chart
758
840
  *
@@ -810,15 +892,14 @@ sap.ui.define([
810
892
  /**
811
893
  * Updates the semantical pattern for given measures
812
894
  *
813
- * @param {sap.chart.Chart} oChart the inner chart
814
- * @param {array} aVisibleMeasures array containing the visible measures on the inner chart
815
- * @param {*} mDataPoints data points of the inner chart
895
+ * @param {sap.chart.Chart} oMDCChart the inner chart
896
+ * @param {*} aProperties // TODO what is this parameter used for?
816
897
  *
817
898
  * @experimental
818
899
  * @private
819
900
  * @ui5-restricted Fiori Elements, sap.ui.mdc
820
901
  */
821
- ChartDelegate._updateSemanticalPattern = function (oMDCChart, aProperties) {
902
+ ChartDelegate._updateSemanticalPattern = function (oMDCChart) {
822
903
 
823
904
  var aVisibleMeasures = this._getChart(oMDCChart).getVisibleMeasures();
824
905
 
@@ -969,23 +1050,31 @@ sap.ui.define([
969
1050
  */
970
1051
  ChartDelegate.getSortedDimensions = function (oMDCChart) {
971
1052
  return new Promise(function (resolve, reject) {
972
- this.fetchProperties(oMDCChart).then(function (aProperties) {
973
1053
 
974
- var aDimensions = aProperties.filter(function (oItem) {
975
- return oItem.groupable; //Groupable means "Dimension" for sap.chart.Chart
976
- });
1054
+ if (oMDCChart.isPropertyHelperFinal()){
1055
+ resolve(this._sortPropertyDimensions(oMDCChart.getPropertyHelper().getProperties()));
1056
+ } else {
1057
+ oMDCChart.finalizePropertyHelper().then(function(){
1058
+ resolve(this._sortPropertyDimensions(oMDCChart.getPropertyHelper().getProperties()));
1059
+ }.bind(this));
1060
+ }
1061
+ }.bind(this));
1062
+ };
977
1063
 
978
- if (aDimensions) {
979
- aDimensions.sort(function (a, b) {
980
- if (a.label && b.label) {
981
- return a.label.localeCompare(b.label);
982
- }
983
- });
984
- }
1064
+ ChartDelegate._sortPropertyDimensions = function(aProperties) {
1065
+ var aDimensions = aProperties.filter(function (oItem) {
1066
+ return oItem.groupable; //Groupable means "Dimension" for sap.chart.Chart
1067
+ });
985
1068
 
986
- resolve(aDimensions);
1069
+ if (aDimensions) {
1070
+ aDimensions.sort(function (a, b) {
1071
+ if (a.label && b.label) {
1072
+ return a.label.localeCompare(b.label);
1073
+ }
987
1074
  });
988
- }.bind(this));
1075
+ }
1076
+
1077
+ return aDimensions;
989
1078
  };
990
1079
 
991
1080
  /**
@@ -1006,6 +1095,7 @@ sap.ui.define([
1006
1095
  /**
1007
1096
  * Sets the chart type of the inner chart
1008
1097
  * Is called by MDC Chart when <code>chartType</code> property is updated
1098
+ * @param {sap.ui.mdc.Chart} oMDCChart the MDC Chart to set the chart type for
1009
1099
  * @param {string} sChartType the new chart type
1010
1100
  */
1011
1101
  ChartDelegate.setChartType = function (oMDCChart, sChartType) {
@@ -1017,53 +1107,60 @@ sap.ui.define([
1017
1107
  */
1018
1108
  ChartDelegate.createInnerChartContent = function (oMDCChart, fnCallbackDataLoaded) {
1019
1109
 
1020
- this._setChart(oMDCChart, new Chart({
1021
- id: oMDCChart.getId() + "--innerChart",
1022
- chartType: "column",
1023
- width: "100%",
1024
- isAnalytical: true//,
1025
- }));
1110
+ return new Promise(function(resolve,reject){
1111
+ this._setChart(oMDCChart, new Chart({
1112
+ id: oMDCChart.getId() + "--innerChart",
1113
+ chartType: "column",
1114
+ width: "100%",
1115
+ isAnalytical: true//,
1116
+ }));
1026
1117
 
1027
- //Initialize empty; will get filled later on
1028
- this._getState(oMDCChart).inResultDimensions = [];
1118
+ //Initialize empty; will get filled later on
1119
+ this._getState(oMDCChart).inResultDimensions = [];
1029
1120
 
1030
- if (oMDCChart.getHeight()){
1031
- this._getChart(oMDCChart).setHeight(this._calculateInnerChartHeight(oMDCChart));
1032
- }
1121
+ if (oMDCChart.getHeight()){
1122
+ this._getChart(oMDCChart).setHeight(this._calculateInnerChartHeight(oMDCChart));
1123
+ }
1033
1124
 
1034
- //Set height correctly again if chart changes
1035
- ResizeHandler.register(oMDCChart, function(){
1036
- this.adjustChartHeight(oMDCChart);
1037
- }.bind(this));
1125
+ //Set height correctly again if chart changes
1126
+ ResizeHandler.register(oMDCChart, function(){
1127
+ this.adjustChartHeight(oMDCChart);
1128
+ }.bind(this));
1038
1129
 
1039
- var oState = this._getState(oMDCChart);
1040
- oState.aColMeasures = [];
1041
- oState.aInSettings = [];
1042
- this._setState(oMDCChart, oState);
1043
-
1044
- //Create initial content during pre-processing
1045
- this._createContentFromItems(oMDCChart);
1046
-
1047
- //Since zoom information is not yet available for sap.chart.Chart after data load is complete, do it on renderComplete instead
1048
- //This is a workaround which is hopefully not needed in other chart libraries
1049
- this._getChart(oMDCChart).attachRenderComplete(function () {
1050
- if (this._getState(oMDCChart).toolbarUpdateRequested){
1051
- oMDCChart._updateToolbar();
1052
- this._getState(oMDCChart).toolbarUpdateRequested = false;
1053
- }
1054
- }.bind(this));
1130
+ var oState = this._getState(oMDCChart);
1131
+ oState.aColMeasures = [];
1132
+ oState.aInSettings = [];
1133
+ this._setState(oMDCChart, oState);
1134
+
1135
+ //Create initial content during pre-processing
1136
+ this._createContentFromItems(oMDCChart).then(function(){
1137
+ //Since zoom information is not yet available for sap.chart.Chart after data load is complete, do it on renderComplete instead
1138
+ //This is a workaround which is hopefully not needed in other chart libraries
1139
+ this._getChart(oMDCChart).attachRenderComplete(function () {
1140
+ if (this._getState(oMDCChart).toolbarUpdateRequested){
1141
+ oMDCChart._updateToolbar();
1142
+ this._getState(oMDCChart).toolbarUpdateRequested = false;
1143
+ }
1144
+ }.bind(this));
1145
+
1146
+ this._getInnerStructure(oMDCChart).removeAllItems();
1147
+ this._getInnerStructure(oMDCChart).setJustifyContent(FlexJustifyContent.Start);
1148
+ this._getInnerStructure(oMDCChart).setAlignItems(FlexAlignItems.Stretch);
1149
+ this._getInnerStructure(oMDCChart).addItem(this._getChart(oMDCChart));
1055
1150
 
1056
- this._getInnerStructure(oMDCChart).removeAllItems();
1057
- this._getInnerStructure(oMDCChart).setJustifyContent(FlexJustifyContent.Start);
1058
- this._getInnerStructure(oMDCChart).setAlignItems(FlexAlignItems.Stretch);
1059
- this._getInnerStructure(oMDCChart).addItem(this._getChart(oMDCChart));
1151
+ oState.dataLoadedCallback = fnCallbackDataLoaded;
1060
1152
 
1061
- oState.dataLoadedCallback = fnCallbackDataLoaded;
1153
+ this._setState(oMDCChart, oState);
1154
+ var oBindingInfo = this._getBindingInfo(oMDCChart);
1155
+ this.updateBindingInfo(oMDCChart, oBindingInfo); //Applies filters
1156
+ this.rebind(oMDCChart, oBindingInfo);
1157
+
1158
+ resolve();
1159
+ }.bind(this));
1160
+
1161
+
1162
+ }.bind(this));
1062
1163
 
1063
- this._setState(oMDCChart, oState);
1064
- var oBindingInfo = this._getBindingInfo(oMDCChart);
1065
- this.updateBindingInfo(oMDCChart, oBindingInfo); //Applies filters
1066
- this.rebind(oMDCChart, oBindingInfo);
1067
1164
  };
1068
1165
 
1069
1166
  ChartDelegate._calculateInnerChartHeight = function(oMDCChart) {
@@ -1110,32 +1207,18 @@ sap.ui.define([
1110
1207
  //TODO: Check for Hierachy and Time
1111
1208
  //TODO: Check for role annotation
1112
1209
 
1113
- this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
1114
-
1115
- //Uses MDC Chart Item ID to identify preoperty, not internal chart id
1116
- var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
1117
- return oCurrentPropertyInfo.name === oMDCChartItem.getName();
1118
- });
1119
-
1120
- this._addInnerDimension(oMDCChart, oMDCChartItem, oPropertyInfo);
1121
-
1210
+ this._getPropertyInfosByName(oMDCChartItem.getName(), oMDCChart).then(function(oPropInfo){
1211
+ this._addInnerDimension(oMDCChart, oMDCChartItem, oPropInfo);
1122
1212
  }.bind(this));
1123
1213
 
1214
+
1124
1215
  };
1125
1216
 
1126
1217
  ChartDelegate.createInnerMeasure = function (oMDCChart, oMDCChartItem) {
1127
1218
 
1128
- this.fetchProperties(oMDCChartItem.getParent()).then(function (aProperties) {
1129
-
1130
- //Uses MDC Chart Item ID to identify preoperty, not internal chart id
1131
- var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
1132
- return oCurrentPropertyInfo.name === oMDCChartItem.getName();
1133
- });
1134
-
1135
- this._addInnerMeasure(oMDCChart, oMDCChartItem, oPropertyInfo);
1136
-
1219
+ this._getPropertyInfosByName(oMDCChartItem.getName(), oMDCChart).then(function(oPropInfo){
1220
+ this._addInnerMeasure(oMDCChart, oMDCChartItem, oPropInfo);
1137
1221
  }.bind(this));
1138
-
1139
1222
  };
1140
1223
 
1141
1224
  /**
@@ -1151,7 +1234,7 @@ sap.ui.define([
1151
1234
  if (oPropertyInfo.textProperty){
1152
1235
  oDimension.setTextProperty(oPropertyInfo.textProperty);
1153
1236
  if (oPropertyInfo.textFormatter){
1154
- oDimension.setTextFormatter(oPropertyInfo.textFormatter);
1237
+ oDimension.setTextFormatter(this._formatText.bind(oPropertyInfo));
1155
1238
  }
1156
1239
  oDimension.setDisplayText(true);
1157
1240
  }
@@ -1357,41 +1440,6 @@ sap.ui.define([
1357
1440
  return oMDCChart.getPropertyHelper().getProperty(sName);
1358
1441
  };
1359
1442
 
1360
- /**
1361
- * This returns the layout options for a specific type of Item (measure/dimension,groupable/aggregatable)
1362
- * It is used by p13n to determine which layout options to show in the p13n panel
1363
- * @param {string} sType the type for which the layout options are requested
1364
- */
1365
- ChartDelegate._getLayoutOptionsForType = function(sType){
1366
- var MDCRb = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
1367
- var oAvailableRoles = {
1368
- groupable: [
1369
- {
1370
- key: MDCLib.ChartItemRoleType.category,
1371
- text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_CATEGORY')
1372
- }, {
1373
- key: MDCLib.ChartItemRoleType.category2,
1374
- text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_CATEGORY2')
1375
- }, {
1376
- key: MDCLib.ChartItemRoleType.series,
1377
- text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_SERIES')
1378
- }
1379
- ],
1380
- aggregatable: [
1381
- {
1382
- key: MDCLib.ChartItemRoleType.axis1,
1383
- text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS1')
1384
- }, {
1385
- key: MDCLib.ChartItemRoleType.axis2,
1386
- text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS2')
1387
- }, {
1388
- key: MDCLib.ChartItemRoleType.axis3,
1389
- text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS3')
1390
- }
1391
- ]
1392
- };
1393
- return oAvailableRoles[sType];
1394
- };
1395
1443
 
1396
1444
  /**
1397
1445
  * Adds an item to the inner chart (measure/dimension)
@@ -1417,6 +1465,7 @@ sap.ui.define([
1417
1465
 
1418
1466
  /**
1419
1467
  * Sets tooltips visible/invisible on inner chart
1468
+ * @param {sap.ui.mdc.Chart} oMDCChart the MDC Chart
1420
1469
  * @param {boolean} bFlag true for visible, false for invisible
1421
1470
  */
1422
1471
  ChartDelegate.setChartTooltipVisibility = function (oMDCChart, bFlag) {
@@ -1468,44 +1517,24 @@ sap.ui.define([
1468
1517
  };
1469
1518
 
1470
1519
  /**
1471
- * Initializes a new table property helper for V4 analytics with the property extensions merged into the property infos.
1472
- *
1473
- * @param {sap.ui.mdc.Chart} oMDCChart reference to the MDC Chart
1474
- * @returns {Promise<sap.ui.mdc.table.V4AnalyticsPropertyHelper>} A promise that resolves with the property helper.
1475
- * @private
1476
- * @ui5-restricted sap.ui.mdc
1520
+ * Returns the propertyHelper used for the chart delegate
1521
+ * @returns {Promise} Promise with the property helper reference
1477
1522
  */
1478
- ChartDelegate.initPropertyHelper = function (oMDCChart) {
1479
- // TODO: Do this in the DelegateMixin, or provide a function in the base delegate to merge properties and extensions
1480
- return Promise.all([
1481
- this.fetchProperties(oMDCChart),
1482
- loadModules("sap/ui/mdc/odata/v4/ChartPropertyHelper")
1483
- ]).then(function (aResult) {
1484
- return Promise.all(aResult.concat(this.fetchPropertyExtensions(oMDCChart, aResult[0])));
1485
- }.bind(this)).then(function (aResult) {
1486
- var aProperties = aResult[0];
1487
- var PropertyHelper = aResult[1][0];
1488
- var mExtensions = aResult[2];
1489
- var iMatchingExtensions = 0;
1490
- var aPropertiesWithExtension = [];
1491
-
1492
- for (var i = 0; i < aProperties.length; i++) {
1493
- aPropertiesWithExtension.push(Object.assign({}, aProperties[i], {
1494
- extension: mExtensions[aProperties[i].name] || {}
1495
- }));
1496
-
1497
- if (aProperties[i].name in mExtensions) {
1498
- iMatchingExtensions++;
1499
- }
1500
- }
1501
-
1502
- if (iMatchingExtensions !== Object.keys(mExtensions).length) {
1503
- throw new Error("At least one property extension does not point to an existing property");
1504
- }
1523
+ ChartDelegate.getPropertyHelperClass = function () {
1524
+ return PropertyHelper;
1525
+ };
1505
1526
 
1506
- return new PropertyHelper(aPropertiesWithExtension, oMDCChart);
1507
- });
1527
+ /**
1528
+ * This allows formatting for axis labels of the inner sap.chart.Chart.
1529
+ * Note: As the inner chart has no association to the propertyInfo, "this" will be bound to the propertyInfo object when calling this method
1530
+ * @param {string} sKey the key of the dimension
1531
+ * @param {string} SDesc the description provided by the metadata
1532
+ * @returns {string} the label which should be shown on the chart axis
1533
+ */
1534
+ ChartDelegate._formatText = function(sKey, SDesc) {
1535
+ return sKey;
1508
1536
  };
1537
+
1509
1538
  /**
1510
1539
  * Returns the relevant propery infos based on the metadata used with the MDC Chart instance.
1511
1540
  *
@@ -1513,6 +1542,7 @@ sap.ui.define([
1513
1542
  * @returns {array} Array of the property infos to be used within MDC Chart
1514
1543
  */
1515
1544
  ChartDelegate.fetchProperties = function (oMDCChart) {
1545
+
1516
1546
  var oModel = this._getModel(oMDCChart);
1517
1547
  var pCreatePropertyInfos;
1518
1548
 
@@ -1522,10 +1552,10 @@ sap.ui.define([
1522
1552
  resolver: resolve
1523
1553
  }, onModelContextChange, this);
1524
1554
  }.bind(this)).then(function (oModel) {
1525
- return this._createPropertyInfos(oMDCChart, oModel);
1555
+ return this._createPropertyInfos(oMDCChart.getDelegate().payload, oModel);
1526
1556
  }.bind(this));
1527
1557
  } else {
1528
- pCreatePropertyInfos = this._createPropertyInfos(oMDCChart, oModel);
1558
+ pCreatePropertyInfos = this._createPropertyInfos(oMDCChart.getDelegate().payload, oModel);
1529
1559
  }
1530
1560
 
1531
1561
  return pCreatePropertyInfos.then(function (aProperties) {
@@ -1546,10 +1576,10 @@ sap.ui.define([
1546
1576
  }
1547
1577
  }
1548
1578
 
1549
- ChartDelegate._createPropertyInfos = function (oMDCChart, oModel) {
1550
- var oMetadataInfo = oMDCChart.getDelegate().payload;
1579
+ ChartDelegate._createPropertyInfos = function (oDelegatePayload, oModel) {
1580
+ //var oMetadataInfo = oMDCChart.getDelegate().payload;
1551
1581
  var aProperties = [];
1552
- var sEntitySetPath = "/" + oMetadataInfo.collectionName;
1582
+ var sEntitySetPath = "/" + oDelegatePayload.collectionName;
1553
1583
  var oMetaModel = oModel.getMetaModel();
1554
1584
 
1555
1585
  return Promise.all([
@@ -1598,13 +1628,13 @@ sap.ui.define([
1598
1628
  aggregatable: false,
1599
1629
  maxConditions: ODataMetaModelUtil.isMultiValueFilterExpression(oFilterRestrictionsInfo.propertyInfo[sKey]) ? -1 : 1,
1600
1630
  sortKey: sKey,
1601
- typeConfig: this.getTypeUtil().getTypeConfig(oObj.$Type, null, {}),
1602
- kind: "Groupable", //TODO: Rename in type; Only needed for P13n Item Panel
1603
- availableRoles: this._getLayoutOptionsForType("groupable"), //for p13n
1631
+ dataType: oObj.$Type,
1632
+ //formatOptions: null,
1633
+ //constraints: {},
1604
1634
  role: MDCLib.ChartItemRoleType.category, //standard, normally this should be interpreted from UI.Chart annotation
1605
1635
  criticality: null ,//To be implemented by FE
1606
1636
  textProperty: oPropertyAnnotations["@com.sap.vocabularies.Common.v1.Text"] ? oPropertyAnnotations["@com.sap.vocabularies.Common.v1.Text"].$Path : null //To be implemented by FE
1607
- //textFormatter: function(){} -> can be used to provide a custom formatter for the textProperty
1637
+ //textFormatter: string-> can be used to provide a custom formatter for the textProperty
1608
1638
  });
1609
1639
  }
1610
1640
  }
@@ -1628,14 +1658,10 @@ sap.ui.define([
1628
1658
  aggregatable: oPropertyAnnotations["@Org.OData.Aggregation.V1.Aggregatable"],
1629
1659
  aggregationMethod: sAggregationMethod,
1630
1660
  maxConditions: ODataMetaModelUtil.isMultiValueFilterExpression(oFilterRestrictionsInfo.propertyInfo[sKey]) ? -1 : 1,
1631
- sortKey: oPropertyAnnotations["@Org.OData.Aggregation.V1.RecommendedAggregationMethod"] + sKey,
1632
- typeConfig: this.getTypeUtil().getTypeConfig(oObj.$Type, null, {}),
1633
- kind: "Aggregatable",//Only needed for P13n Item Panel
1634
- availableRoles: this._getLayoutOptionsForType("aggregatable"), //for p13n
1635
- role: MDCLib.ChartItemRoleType.axis1,
1661
+ dataType: oObj.$Type,
1636
1662
  datapoint: null //To be implemented by FE
1637
1663
  });
1638
- }.bind(this));
1664
+ });
1639
1665
  }
1640
1666
 
1641
1667
  return aProperties;
@@ -1643,15 +1669,7 @@ sap.ui.define([
1643
1669
 
1644
1670
  //Gets internal property infos by excact property name
1645
1671
  ChartDelegate._getPropertyInfosByName = function(sName, oMDCChart){
1646
- return new Promise(function(resolve){
1647
- this.fetchProperties(oMDCChart).then(function(aProperties){
1648
- var oPropertyInfo = aProperties.find(function (oCurrentPropertyInfo) {
1649
- return oCurrentPropertyInfo.name === sName;
1650
- });
1651
-
1652
- resolve(oPropertyInfo);
1653
- });
1654
- }.bind(this));
1672
+ return oMDCChart._getPropertyByNameAsync(sName);
1655
1673
  };
1656
1674
 
1657
1675