@adaptabletools/adaptable 18.1.14 → 18.1.15-canary.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.
Files changed (156) hide show
  1. package/package.json +2 -2
  2. package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -5
  3. package/src/AdaptableOptions/AlertOptions.d.ts +2 -1
  4. package/src/AdaptableOptions/ChartingOptions.d.ts +5 -1
  5. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +5 -1
  6. package/src/AdaptableOptions/DashboardOptions.d.ts +5 -1
  7. package/src/AdaptableOptions/FlashingCellOptions.d.ts +5 -1
  8. package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
  9. package/src/AdaptableOptions/NotificationsOptions.d.ts +6 -2
  10. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +5 -1
  11. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -1
  12. package/src/Api/ChartingApi.d.ts +2 -2
  13. package/src/Api/ColumnApi.d.ts +6 -0
  14. package/src/Api/ConfigApi.d.ts +22 -2
  15. package/src/Api/Events/LiveDataChanged.d.ts +1 -1
  16. package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -1
  17. package/src/Api/Implementation/ChartingApiImpl.d.ts +1 -1
  18. package/src/Api/Implementation/ChartingApiImpl.js +2 -2
  19. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
  20. package/src/Api/Implementation/ColumnApiImpl.js +3 -0
  21. package/src/Api/Implementation/ConfigApiImpl.d.ts +4 -1
  22. package/src/Api/Implementation/ConfigApiImpl.js +16 -1
  23. package/src/Api/Implementation/EntitlementApiImpl.d.ts +4 -1
  24. package/src/Api/Implementation/EntitlementApiImpl.js +31 -6
  25. package/src/Api/Implementation/ExportApiImpl.js +5 -7
  26. package/src/Api/Implementation/GridApiImpl.js +1 -1
  27. package/src/Api/Implementation/TeamSharingApiImpl.js +2 -6
  28. package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -6
  29. package/src/Api/Internal/AdaptableInternalApi.js +5 -11
  30. package/src/Api/Internal/EntitlementInternalApi.d.ts +4 -0
  31. package/src/Api/Internal/EntitlementInternalApi.js +11 -0
  32. package/src/Api/Internal/ExportInternalApi.d.ts +33 -8
  33. package/src/Api/Internal/ExportInternalApi.js +576 -5
  34. package/src/Api/Internal/NamedQueryInternalApi.d.ts +0 -1
  35. package/src/Api/Internal/NamedQueryInternalApi.js +0 -4
  36. package/src/PredefinedConfig/AdaptableState.d.ts +0 -5
  37. package/src/PredefinedConfig/Common/FilterActionOnDataChange.d.ts +2 -1
  38. package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
  39. package/src/Redux/ActionsReducers/GridRedux.d.ts +6 -6
  40. package/src/Redux/ActionsReducers/GridRedux.js +8 -8
  41. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +3 -3
  42. package/src/Redux/ActionsReducers/LayoutRedux.js +9 -9
  43. package/src/Redux/ActionsReducers/NamedQueryRedux.d.ts +1 -1
  44. package/src/Redux/ActionsReducers/NamedQueryRedux.js +1 -1
  45. package/src/Redux/ActionsReducers/PluginsRedux.d.ts +2 -2
  46. package/src/Redux/ActionsReducers/PluginsRedux.js +2 -2
  47. package/src/Redux/Store/AdaptableReduxMerger.js +3 -3
  48. package/src/Redux/Store/AdaptableStore.js +2 -4
  49. package/src/Strategy/AdaptableModuleBase.js +1 -2
  50. package/src/Strategy/ColumnFilterModule.js +1 -2
  51. package/src/Strategy/ExportModule.js +17 -44
  52. package/src/Strategy/FlashingCellModule.js +2 -10
  53. package/src/Strategy/ScheduleModule.js +4 -6
  54. package/src/Strategy/SmartEditModule.js +1 -7
  55. package/src/Strategy/TeamSharingModule.js +2 -2
  56. package/src/Strategy/Utilities/Export/getExportColumnsViewItems.js +1 -1
  57. package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +1 -3
  58. package/src/Utilities/Constants/FilterConstants.d.ts +10 -0
  59. package/src/Utilities/Constants/FilterConstants.js +8 -0
  60. package/src/Utilities/Constants/GeneralConstants.d.ts +41 -4
  61. package/src/Utilities/Constants/GeneralConstants.js +42 -3
  62. package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +0 -2
  63. package/src/Utilities/Defaults/DefaultSettingsPanel.js +0 -5
  64. package/src/Utilities/Extensions/ArrayExtensions.d.ts +14 -0
  65. package/src/Utilities/Extensions/ArrayExtensions.js +65 -0
  66. package/src/Utilities/Extensions/EnumExtensions.d.ts +0 -4
  67. package/src/Utilities/Extensions/EnumExtensions.js +2 -12
  68. package/src/Utilities/Helpers/AdaptableHelper.d.ts +4 -10
  69. package/src/Utilities/Helpers/AdaptableHelper.js +7 -59
  70. package/src/Utilities/Helpers/FormatHelper.d.ts +9 -0
  71. package/src/Utilities/Helpers/FormatHelper.js +26 -14
  72. package/src/Utilities/Helpers/Helper.d.ts +0 -10
  73. package/src/Utilities/Helpers/Helper.js +0 -70
  74. package/src/Utilities/Services/ChartingService.d.ts +2 -2
  75. package/src/Utilities/Services/ChartingService.js +5 -11
  76. package/src/Utilities/Services/ModuleService.js +35 -31
  77. package/src/Utilities/Services/RowEditService.js +1 -6
  78. package/src/Utilities/Services/RowSummaryService.js +2 -2
  79. package/src/Utilities/Services/ValidationService.js +2 -16
  80. package/src/View/Alert/AlertEmptyView.js +1 -2
  81. package/src/View/Charting/ChartingStatusBarPopover.js +1 -2
  82. package/src/View/Charting/useChartingElements.js +1 -1
  83. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +2 -6
  84. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +2 -4
  85. package/src/View/Components/FilterForm/QuickFilterForm.js +2 -12
  86. package/src/View/Components/ModuleValueSelector/index.js +2 -2
  87. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +2 -5
  88. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +1 -3
  89. package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +2 -1
  90. package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -7
  91. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +6 -12
  92. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +3 -23
  93. package/src/View/Components/ToolPanel/ToolPanelPopup.js +4 -5
  94. package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -3
  95. package/src/View/Components/ValueSelector/index.js +2 -2
  96. package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +2 -2
  97. package/src/View/Dashboard/CustomDashboardButton.js +1 -6
  98. package/src/View/Dashboard/CustomToolbar.js +2 -9
  99. package/src/View/Dashboard/Dashboard.js +2 -4
  100. package/src/View/Dashboard/DashboardPopup.js +1 -3
  101. package/src/View/Dashboard/DashboardToolbarFactory.js +1 -2
  102. package/src/View/Dashboard/PinnedToolbarsSelector.js +1 -2
  103. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -3
  104. package/src/View/Export/ExportViewPanel.js +2 -4
  105. package/src/View/Export/Wizard/ReportSummaryWizard.js +2 -6
  106. package/src/View/GridFilter/GridFilterExpressionEditor.js +2 -2
  107. package/src/View/GridFilter/useGridFilterExpressionEditor.js +2 -6
  108. package/src/View/Layout/LayoutViewPanel.js +1 -1
  109. package/src/View/Layout/PivotDetailsPopoup.js +1 -7
  110. package/src/View/Layout/SaveLayoutButton.js +1 -3
  111. package/src/View/Layout/Wizard/sections/AggregationsSection.js +2 -2
  112. package/src/View/Layout/Wizard/sections/ColumnsSection.js +2 -2
  113. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +2 -2
  114. package/src/View/Layout/Wizard/sections/RowGroupingSection.js +2 -2
  115. package/src/View/Layout/Wizard/sections/RowSummarySection.js +2 -2
  116. package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
  117. package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +3 -3
  118. package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
  119. package/src/View/SystemStatus/SystemStatusPopup.js +1 -1
  120. package/src/View/Wizard/OnePageAdaptableWizard.js +2 -2
  121. package/src/agGrid/ActionColumnRenderer.js +8 -22
  122. package/src/agGrid/AdaptableAgGrid.d.ts +5 -7
  123. package/src/agGrid/AdaptableAgGrid.js +153 -145
  124. package/src/agGrid/AgGridAdapter.d.ts +0 -1
  125. package/src/agGrid/AgGridAdapter.js +8 -11
  126. package/src/agGrid/AgGridColumnAdapter.d.ts +3 -1
  127. package/src/agGrid/AgGridColumnAdapter.js +40 -14
  128. package/src/agGrid/BadgeRenderer.js +4 -22
  129. package/src/agGrid/FloatingFilterWrapper.js +21 -0
  130. package/src/agGrid/buildSortedColumnStateForLayout.d.ts +1 -1
  131. package/src/agGrid/buildSortedColumnStateForLayout.js +2 -2
  132. package/src/agGrid/defaultAdaptableOptions.js +35 -30
  133. package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -15
  134. package/src/env.js +2 -2
  135. package/src/metamodel/adaptable.metamodel.d.ts +84 -8
  136. package/src/metamodel/adaptable.metamodel.js +1 -1
  137. package/src/types.d.ts +9 -9
  138. package/tsconfig.esm.tsbuildinfo +1 -1
  139. package/src/Redux/ActionsReducers/QueryRedux.d.ts +0 -10
  140. package/src/Redux/ActionsReducers/QueryRedux.js +0 -20
  141. package/src/Utilities/Helpers/FormatContentHelper.d.ts +0 -22
  142. package/src/Utilities/Helpers/FormatContentHelper.js +0 -34
  143. package/src/Utilities/Services/EntitlementService.d.ts +0 -14
  144. package/src/Utilities/Services/EntitlementService.js +0 -63
  145. package/src/Utilities/Services/Interface/IEntitlementService.d.ts +0 -10
  146. package/src/Utilities/Services/Interface/IEntitlementService.js +0 -1
  147. package/src/Utilities/Services/Interface/IReportService.d.ts +0 -27
  148. package/src/Utilities/Services/Interface/IReportService.js +0 -1
  149. package/src/Utilities/Services/ReportService.d.ts +0 -41
  150. package/src/Utilities/Services/ReportService.js +0 -603
  151. package/src/Utilities/isAdaptableObject.d.ts +0 -2
  152. package/src/Utilities/isAdaptableObject.js +0 -4
  153. package/src/Utilities/reorder.d.ts +0 -1
  154. package/src/Utilities/reorder.js +0 -13
  155. package/src/Utilities/sortWithOrder.d.ts +0 -11
  156. package/src/Utilities/sortWithOrder.js +0 -50
@@ -1,4 +1,3 @@
1
- import { Events } from '@ag-grid-community/core';
2
1
  import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
3
2
  import ObjectFactory from '../ObjectFactory';
4
3
  export class ChartingService {
@@ -10,7 +9,7 @@ export class ChartingService {
10
9
  const currentChartModel = models.find((model) => model.chartId === params.chartId);
11
10
  const currentChartDefinition = allChartDefinitions.find((chartDefinition) => chartDefinition.Model.chartId === params.chartId);
12
11
  switch (eventType) {
13
- case Events.EVENT_CHART_CREATED:
12
+ case 'chartCreated':
14
13
  const createParams = params;
15
14
  if (allChartDefinitions.some((chartDefinition) => chartDefinition.Model.chartId === createParams.chartId)) {
16
15
  // chart already exists
@@ -20,8 +19,8 @@ export class ChartingService {
20
19
  this.saveNewChart(chartModel);
21
20
  }
22
21
  break;
23
- case Events.EVENT_CHART_OPTIONS_CHANGED:
24
- case Events.EVENT_CHART_RANGE_SELECTION_CHANGED:
22
+ case 'chartOptionsChanged':
23
+ case 'chartRangeSelectionChanged':
25
24
  if (!currentChartDefinition) {
26
25
  // editing a non-saved chart
27
26
  break;
@@ -42,18 +41,13 @@ export class ChartingService {
42
41
  */
43
42
  emitAdaptableChartDefinitonChange() {
44
43
  const chartingOpenState = this.api.chartingApi.getChartingOpenState();
45
- const chartChangedInfo = {
46
- chartingOpenState: chartingOpenState,
47
- adaptableApi: this.api,
48
- userName: this.api.optionsApi.getUserName(),
49
- adaptableId: this.api.optionsApi.getAdaptableId(),
50
- };
44
+ const chartChangedInfo = Object.assign({ chartingOpenState: chartingOpenState }, this.api.internalApi.buildBaseContext());
51
45
  this.api.eventApi.emit('ChartChanged', chartChangedInfo);
52
46
  }
53
47
  saveNewChart(chartModel) {
54
48
  var _a, _b;
55
49
  const chartingOptions = (_a = this.api.optionsApi.getChartingOptions()) !== null && _a !== void 0 ? _a : {};
56
- const saveStragegy = (_b = chartingOptions.saveStrategy) !== null && _b !== void 0 ? _b : 'manual';
50
+ const saveStragegy = (_b = chartingOptions.saveChartBehaviour) !== null && _b !== void 0 ? _b : 'manual';
57
51
  if (saveStragegy === 'none') {
58
52
  return;
59
53
  }
@@ -7,25 +7,25 @@ export class ModuleService {
7
7
  this.adaptableApi = adaptableApi;
8
8
  }
9
9
  createModuleMenus() {
10
- const settingsPanelMenuItems = [];
11
- const buttonMenuItems = [];
10
+ const settingsPanelItems = [];
11
+ const adaptableMenuItems = [];
12
12
  this.getModuleCollection().forEach((module) => {
13
13
  const settingsPanelMenuItem = module.createModuleMenuItem('ModuleMenu');
14
14
  if (Helper.objectExists(settingsPanelMenuItem)) {
15
- if (settingsPanelMenuItems.findIndex((m) => m.module == settingsPanelMenuItem.module) == -1) {
16
- settingsPanelMenuItems.push(settingsPanelMenuItem);
15
+ if (settingsPanelItems.findIndex((m) => m.module == settingsPanelMenuItem.module) == -1) {
16
+ settingsPanelItems.push(settingsPanelMenuItem);
17
17
  }
18
18
  }
19
- const buttonMenuItem = module.createModuleMenuItem('ModuleButton');
20
- if (Helper.objectExists(buttonMenuItem)) {
21
- if (buttonMenuItems.findIndex((m) => m.module == buttonMenuItem.module) == -1) {
22
- buttonMenuItems.push(buttonMenuItem);
19
+ const adaptableMenuItem = module.createModuleMenuItem('ModuleButton');
20
+ if (Helper.objectExists(adaptableMenuItem)) {
21
+ if (adaptableMenuItems.findIndex((m) => m.module == adaptableMenuItem.module) == -1) {
22
+ adaptableMenuItems.push(adaptableMenuItem);
23
23
  }
24
24
  }
25
25
  });
26
26
  // store the main menu as we will re-use (and it never changes)
27
- this.adaptableApi.internalApi.setSettingPanelModuleMenuItems(settingsPanelMenuItems);
28
- this.adaptableApi.internalApi.setModuleButtonMenuItems(buttonMenuItems);
27
+ this.adaptableApi.internalApi.setSettingsPanelItems(settingsPanelItems);
28
+ this.adaptableApi.internalApi.setMenuModuleItems(adaptableMenuItems);
29
29
  }
30
30
  isModuleAvailable(adaptableModule) {
31
31
  let module = this.getModuleCollection().get(adaptableModule);
@@ -87,52 +87,62 @@ export class ModuleService {
87
87
  return learnUrl + 'handbook-calculated-column';
88
88
  case 'CellSummary':
89
89
  return learnUrl + 'handbook-summarising';
90
+ case 'Charting':
91
+ return learnUrl + 'handbook-charts';
92
+ case 'ColumnFilter':
93
+ return learnUrl + 'handbook-column-filter';
94
+ case 'ColumnInfo':
95
+ return learnUrl + 'dev-guide-tutorial-grid-column-info';
96
+ case 'Comment':
97
+ return learnUrl + 'handbook-comments';
90
98
  case 'CustomSort':
91
- return learnUrl + 'handbook-sorting';
99
+ return learnUrl + 'handbook-sorting-custom';
92
100
  case 'Dashboard':
93
101
  return learnUrl + 'ui-dashboard';
94
- case 'DataSet':
95
- return learnUrl + 'handbook-data-sets';
96
- case 'DataImport':
97
- return learnUrl + 'handbook-importing';
98
102
  case 'DataChangeHistory':
99
103
  return learnUrl + 'handbook-monitoring-data-change-history';
104
+ case 'DataImport':
105
+ return learnUrl + 'handbook-importing';
106
+ case 'DataSet':
107
+ return learnUrl + 'handbook-data-sets';
100
108
  case 'Export':
101
109
  return learnUrl + 'handbook-exporting';
102
- case 'ColumnFilter':
103
- return learnUrl + 'handbook-column-filter';
104
- case 'Comment':
105
- return learnUrl + 'handbook-comments';
106
- case 'GridFilter':
107
- return learnUrl + 'handbook-grid-filter';
110
+ case 'Fdc3':
111
+ return learnUrl + 'handbook-fdc3';
108
112
  case 'FlashingCell':
109
113
  return learnUrl + 'handbook-flashing-cell';
110
114
  case 'FormatColumn':
111
115
  return learnUrl + 'handbook-column-formatting';
112
116
  case 'FreeTextColumn':
113
117
  return learnUrl + 'handbook-freetext-column';
118
+ case 'GridFilter':
119
+ return learnUrl + 'handbook-grid-filter';
114
120
  case 'GridInfo':
115
- return learnUrl + 'handbook-monitoring-grid-info';
121
+ return learnUrl + 'dev-guide-tutorial-grid-column-info';
116
122
  case 'Layout':
117
123
  return learnUrl + 'handbook-layouts';
124
+ case 'NamedQuery':
125
+ return learnUrl + 'handbook-named-queries';
118
126
  case 'Note':
119
127
  return learnUrl + 'handbook-notes';
120
128
  case 'PlusMinus':
121
129
  return learnUrl + 'handbook-editing-plus-minus';
122
- case 'NamedQuery':
123
- return learnUrl + 'handbook-named-queries';
124
130
  case 'QuickSearch':
125
131
  return learnUrl + 'handbook-quick-search';
126
132
  case 'Schedule':
127
133
  return learnUrl + 'handbook-scheduling';
134
+ case 'SettingsPanel':
135
+ return learnUrl + 'ui-settings-panel';
128
136
  case 'Shortcut':
129
137
  return learnUrl + 'handbook-editing-shortcut';
130
138
  case 'SmartEdit':
131
139
  return learnUrl + 'handbook-editing-smart-edit';
132
140
  case 'StateManagement':
133
- return learnUrl + 'dev-guide-adaptable-state';
141
+ return learnUrl + 'dev-guide-adaptable-state-management';
134
142
  case 'StatusBar':
135
143
  return learnUrl + 'ui-status-bar';
144
+ case 'StyledColumn':
145
+ return learnUrl + 'handbook-styled-column-overview';
136
146
  case 'SystemStatus':
137
147
  return learnUrl + 'handbook-system-status-message';
138
148
  case 'TeamSharing':
@@ -145,12 +155,6 @@ export class ModuleService {
145
155
  return learnUrl + 'integrations-ipushpull';
146
156
  case 'OpenFin':
147
157
  return learnUrl + 'integrations-openfin';
148
- case 'StyledColumn':
149
- return learnUrl + 'handbook-styled-column-overview';
150
- case 'Charting':
151
- return learnUrl + 'handbook-charts';
152
- case 'DataImport':
153
- return learnUrl + 'handbook-data-import';
154
158
  default:
155
159
  return 'good';
156
160
  }
@@ -23,12 +23,7 @@ export class RowEditService {
23
23
  const setPrimaryKeyValueFunction = adaptableApi.internalApi.getAdaptableInstance().adaptableOptions.actionRowOptions
24
24
  .setPrimaryKeyValue;
25
25
  const newRowData = typeof setPrimaryKeyValueFunction === 'function'
26
- ? setPrimaryKeyValueFunction({
27
- rowData: formData,
28
- adaptableApi,
29
- userName: this.adaptableApi.optionsApi.getUserName(),
30
- adaptableId: this.adaptableApi.optionsApi.getAdaptableId(),
31
- })
26
+ ? setPrimaryKeyValueFunction(Object.assign({ rowData: formData }, adaptableApi.internalApi.buildBaseContext()))
32
27
  : Object.assign({}, formData);
33
28
  const config = {
34
29
  addIndex: 0,
@@ -96,7 +96,7 @@ export class RowSummaryService {
96
96
  const rowSummaries = (_a = this.api.layoutApi.getCurrentLayout().RowSummaries) !== null && _a !== void 0 ? _a : [];
97
97
  const rowSummariesResults = rowSummaries
98
98
  .filter((rowSummary) => !rowSummary.IsSuspended)
99
- .map((rowSummary) => {
99
+ .map((rowSummary, index) => {
100
100
  const { ColumnsMap, Position,
101
101
  // it defaults to true
102
102
  IncludeOnlyFilteredRows = true, } = rowSummary;
@@ -159,7 +159,7 @@ export class RowSummaryService {
159
159
  acc = this.api.internalApi.setValueUsingField(acc, fieldName, value);
160
160
  return acc;
161
161
  }, {
162
- [ROW_SUMMARY_ROW_ID]: true,
162
+ [ROW_SUMMARY_ROW_ID]: `row-summary-${index}`,
163
163
  }),
164
164
  };
165
165
  });
@@ -70,25 +70,11 @@ export class ValidationService {
70
70
  IsAlertDefinitionTriggered(alertDefinition, dataChangedEvent) {
71
71
  var _a;
72
72
  const displayValue = this.adaptableApi.gridApi.getDisplayValueFromRowNode(dataChangedEvent.rowNode, dataChangedEvent.column.columnId);
73
- const predicateDefHandlerContext = {
74
- value: dataChangedEvent.newValue,
75
- oldValue: dataChangedEvent.oldValue,
76
- displayValue,
77
- node: dataChangedEvent.rowNode,
78
- column: dataChangedEvent.column,
79
- adaptableApi: this.adaptableApi,
80
- userName: this.adaptableApi.optionsApi.getUserName(),
81
- adaptableId: this.adaptableApi.optionsApi.getAdaptableId(),
82
- };
73
+ const predicateDefHandlerContext = Object.assign({ value: dataChangedEvent.newValue, oldValue: dataChangedEvent.oldValue, displayValue, node: dataChangedEvent.rowNode, column: dataChangedEvent.column }, this.adaptableApi.internalApi.buildBaseContext());
83
74
  return this.adaptableApi.predicateApi.handlePredicates((_a = alertDefinition.Rule) === null || _a === void 0 ? void 0 : _a.Predicates, predicateDefHandlerContext, false);
84
75
  }
85
76
  performServerValidation(cellDataChangedInfo, config) {
86
- const serverValidationContext = {
87
- cellDataChangedInfo: cellDataChangedInfo,
88
- adaptableApi: this.adaptableApi,
89
- userName: this.adaptableApi.optionsApi.getUserName(),
90
- adaptableId: this.adaptableApi.optionsApi.getAdaptableId(),
91
- };
77
+ const serverValidationContext = Object.assign({ cellDataChangedInfo: cellDataChangedInfo }, this.adaptableApi.internalApi.buildBaseContext());
92
78
  return () => {
93
79
  this.adaptableApi.optionsApi
94
80
  .getEditOptions()
@@ -2,8 +2,7 @@ import * as React from 'react';
2
2
  import { useAdaptable } from '../AdaptableContext';
3
3
  export const AlertEmptyView = (props) => {
4
4
  const adaptable = useAdaptable();
5
- const accessLevel = adaptable.api.internalApi
6
- .getEntitlementService()
5
+ const accessLevel = adaptable.api.entitlementApi
7
6
  .getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
8
7
  const text = accessLevel == 'ReadOnly'
9
8
  ? 'You have no Alert Definitions.'
@@ -5,8 +5,7 @@ import { useChartingElements } from './useChartingElements';
5
5
  import { Box, Flex } from 'rebass';
6
6
  export const ChartingStatusBarPopover = (props) => {
7
7
  const adaptable = useAdaptable();
8
- const accessLevel = adaptable.api.internalApi
9
- .getEntitlementService()
8
+ const accessLevel = adaptable.api.entitlementApi
10
9
  .getEntitlementAccessLevelForModule(ModuleConstants.ChartingModuleId);
11
10
  const { chartSelector, containerSelector, chartButton, deleteButton, editButton } = useChartingElements({
12
11
  elementType: 'Statusbar',
@@ -24,7 +24,7 @@ export const useChartingElements = ({ elementType, accessLevel, size = 'normal',
24
24
  });
25
25
  const selectedChart = allChartDefinitions.find((chart) => chart.Uuid === selectedChartId);
26
26
  const isAgChart = isAgChartDefinition(selectedChart);
27
- const chartAccessLevel = AdaptableHelper.getAppropriateAccessLevel(selectedChart, accessLevel);
27
+ const chartAccessLevel = AdaptableHelper.getAccessLevelForObject(selectedChart, accessLevel);
28
28
  const [selectedContainer, setSelectedContainer] = React.useState(null);
29
29
  // Need to always call as they the rule for hooks
30
30
  const { isOpen: isAgChartOpen, showChart: showAgChart, closeChart: hideAgChart, } = useAgChartState(isAgChart ? selectedChart : undefined);
@@ -13,9 +13,7 @@ export const AdaptableObjectCompactListItem = (props) => {
13
13
  const objectView = props.module.toViewCompact(props.abObject);
14
14
  const viewOptions = (_b = (_a = props.module) === null || _a === void 0 ? void 0 : _a.getViewProperties) === null || _b === void 0 ? void 0 : _b.call(_a);
15
15
  const deleteAction = (_c = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.getCompactDeleteAction) === null || _c === void 0 ? void 0 : _c.call(viewOptions, props.abObject);
16
- const moduleAccessLevel = adaptable.api.internalApi
17
- .getEntitlementService()
18
- .getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
16
+ const moduleAccessLevel = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
19
17
  const suspendAction = (_d = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.getCompactSuspendAction) === null || _d === void 0 ? void 0 : _d.call(viewOptions, props.abObject);
20
18
  const unSuspendAction = (_e = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.getCompactUnSuspendAction) === null || _e === void 0 ? void 0 : _e.call(viewOptions, props.abObject);
21
19
  const isSuspended = props.abObject.IsSuspended;
@@ -60,9 +58,7 @@ export const AdaptableObjectCompactList = (props) => {
60
58
  const suspendAllAction = (_d = viewProperties === null || viewProperties === void 0 ? void 0 : viewProperties.getSuspendAllAction) === null || _d === void 0 ? void 0 : _d.call(viewProperties);
61
59
  const unSuspendAllAction = (_e = viewProperties === null || viewProperties === void 0 ? void 0 : viewProperties.getUnSuspendAllAction) === null || _e === void 0 ? void 0 : _e.call(viewProperties);
62
60
  const dispatch = useDispatch();
63
- const accessLevel = adaptable.api.internalApi
64
- .getEntitlementService()
65
- .getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
61
+ const accessLevel = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
66
62
  const isAtLeastOneAbObjectActive = props.abObjects.some((abObject) => {
67
63
  return !abObject.IsSuspended;
68
64
  });
@@ -88,10 +88,8 @@ export const AdaptableObjectListItem = (props) => {
88
88
  adaptable.api.teamSharingApi.isTeamSharingAvailable() &&
89
89
  adaptable.api.teamSharingApi.hasTeamSharingFullRights();
90
90
  const entityType = props.module.moduleInfo.FriendlyName;
91
- const moduleAccessLevel = adaptable.api.internalApi
92
- .getEntitlementService()
93
- .getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
94
- const accessLevel = AdaptableHelper.getAppropriateAccessLevel(props.data.abObject, moduleAccessLevel);
91
+ const moduleAccessLevel = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
92
+ const accessLevel = AdaptableHelper.getAccessLevelForObject(props.data.abObject, moduleAccessLevel);
95
93
  const itemClassName = join(props.data.className, ITEM_BASE_CLASS_NAME, props.data.abObject.IsSuspended &&
96
94
  `${ITEM_BASE_CLASS_NAME}--is-suspended`);
97
95
  const handleCloseWizard = React.useCallback(() => {
@@ -57,23 +57,13 @@ class QuickFilterFormComponent extends React.Component {
57
57
  let hideQuickFilterDropdownFunction = this.props.api.optionsApi.getColumnFilterOptions().quickFilterOptions
58
58
  .hideQuickFilterDropdown;
59
59
  if (hideQuickFilterDropdownFunction) {
60
- const columnFilterContext = {
61
- column: this.props.currentColumn,
62
- adaptableApi: this.props.api,
63
- userName: this.props.api.optionsApi.getUserName(),
64
- adaptableId: this.props.api.optionsApi.getAdaptableId(),
65
- };
60
+ const columnFilterContext = Object.assign({ column: this.props.currentColumn }, this.props.api.internalApi.buildBaseContext());
66
61
  showQuickFilterDropdown = !hideQuickFilterDropdownFunction(columnFilterContext);
67
62
  }
68
63
  let showQuickFilterInput = true;
69
64
  let hideQuickFilterInputFunction = this.props.api.optionsApi.getColumnFilterOptions().quickFilterOptions.hideQuickFilterInput;
70
65
  if (hideQuickFilterInputFunction) {
71
- const columnFilterContext = {
72
- column: this.props.currentColumn,
73
- adaptableApi: this.props.api,
74
- userName: this.props.api.optionsApi.getUserName(),
75
- adaptableId: this.props.api.optionsApi.getAdaptableId(),
76
- };
66
+ const columnFilterContext = Object.assign({ column: this.props.currentColumn }, this.props.api.internalApi.buildBaseContext());
77
67
  showQuickFilterInput = !hideQuickFilterInputFunction(columnFilterContext);
78
68
  }
79
69
  return (React.createElement(React.Fragment, null,
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { ValueSelector } from '../ValueSelector';
4
4
  import { useAdaptable } from '../../AdaptableContext';
5
5
  import { useMemo, useCallback } from 'react';
6
- import { sortWithOrderArray } from '../../../Utilities/sortWithOrder';
6
+ import ArrayExtensions from '../../../Utilities/Extensions/ArrayExtensions';
7
7
  export const ModuleValueSelector = (props) => {
8
8
  const { options, value, onChange, selectionBoxPosition = 'top' } = props, valueSelectorProps = __rest(props, ["options", "value", "onChange", "selectionBoxPosition"]);
9
9
  const { api } = useAdaptable();
@@ -25,7 +25,7 @@ export const ModuleValueSelector = (props) => {
25
25
  return labelMap;
26
26
  }, [options]);
27
27
  const sortedOptions = useMemo(() => {
28
- return sortWithOrderArray(options, value, { sortUnorderedItems: true });
28
+ return ArrayExtensions.sortArrayWithOrder(options, value, { sortUnorderedItems: true });
29
29
  }, [allowReorder, options, value]);
30
30
  return (React.createElement(ValueSelector, Object.assign({}, valueSelectorProps, { options: sortedOptions, value: value, onChange: onChange, allowReorder: allowReorder, toIdentifier: (module) => module, toLabel: (module) => moduleLabelMap.get(module), selectionBoxPosition: selectionBoxPosition, isOptionDisabled: props.isOptionDisabled, disabled: props.disabled })));
31
31
  };
@@ -6,7 +6,6 @@ import join from '../../../../components/utils/join';
6
6
  import { Navigation } from './Navigation';
7
7
  import PopupContext from './PopupContext';
8
8
  import { AdaptablePopupBody } from './AdaptablePopupBody';
9
- import { STANDALONE_MODULE_POPUPS } from '../../../../Utilities/Defaults/DefaultSettingsPanel';
10
9
  import { useAdaptable } from '../../../AdaptableContext';
11
10
  import { CustomSettingsPanelView } from './CustomSettingsPanelView';
12
11
  import { useMenuItems } from './useMenuItems';
@@ -50,13 +49,11 @@ export const AdaptablePopup = (props) => {
50
49
  else {
51
50
  const module = props.api.internalApi.getModuleService().getModuleById(componentModule);
52
51
  const moduleInfo = module === null || module === void 0 ? void 0 : module.moduleInfo;
53
- accessLevel = props.api.internalApi
54
- .getEntitlementService()
55
- .getEntitlementAccessLevelForModule(componentModule);
52
+ accessLevel = props.api.entitlementApi.getEntitlementAccessLevelForModule(componentModule);
56
53
  friendlyName = moduleInfo.FriendlyName;
57
54
  isStandalone =
58
55
  moduleInfo &&
59
- (STANDALONE_MODULE_POPUPS.includes(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.ModuleName) ||
56
+ (GeneralConstants.STANDALONE_MODULE_POPUPS.includes(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.ModuleName) ||
60
57
  (props.componentName && props.componentName !== (moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.Popup)));
61
58
  activeItem = moduleInfo.ModuleName;
62
59
  moduleViewContent = (React.createElement(AdaptablePopupBody, { api: props.api, module: module, componentName: props.componentName, moduleParams: props.moduleParams, onClearParams: props.onClearParams, onHide: props.onHide }));
@@ -6,9 +6,7 @@ export const AdaptablePopupBody = (props) => {
6
6
  var _a;
7
7
  const modalContainer = UIHelper.getModalContainer(props.api.optionsApi.getAdaptableOptions(), document);
8
8
  const moduleName = props.module.moduleInfo.ModuleName;
9
- const accessLevel = props.api.internalApi
10
- .getEntitlementService()
11
- .getEntitlementAccessLevelForModule(moduleName);
9
+ const accessLevel = props.api.entitlementApi.getEntitlementAccessLevelForModule(moduleName);
12
10
  const moduleInfo = props.api.internalApi.getModuleService().getModuleInfoByModule(moduleName);
13
11
  const moduleProps = {
14
12
  popupParams: props.moduleParams,
@@ -1,8 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { useSelector } from 'react-redux';
3
- import { STANDALONE_MODULE_POPUPS, DEFAULT_SETTINGS_PANEL_NAVIGATION_ITEMS, } from '../../../../Utilities/Defaults/DefaultSettingsPanel';
3
+ import { DEFAULT_SETTINGS_PANEL_NAVIGATION_ITEMS } from '../../../../Utilities/Defaults/DefaultSettingsPanel';
4
4
  import { useAdaptable } from '../../../AdaptableContext';
5
5
  import * as PopupRedux from '../../../../Redux/ActionsReducers/PopupRedux';
6
+ import { STANDALONE_MODULE_POPUPS } from '../../../../Utilities/Constants/GeneralConstants';
6
7
  export const useMenuItems = () => {
7
8
  const adaptable = useAdaptable();
8
9
  const settingsPanelOptions = adaptable.adaptableOptions.settingsPanelOptions;
@@ -24,13 +24,7 @@ export const AdaptablePopupAlert = (props) => {
24
24
  }, []);
25
25
  const [formData, setFormData] = useState({});
26
26
  const context = React.useMemo(() => {
27
- return {
28
- alert: props.adaptableAlert,
29
- adaptableApi: api,
30
- formData: formData,
31
- userName: api.optionsApi.getUserName(),
32
- adaptableId: api.optionsApi.getAdaptableId(),
33
- };
27
+ return Object.assign(Object.assign({ alert: props.adaptableAlert }, api.internalApi.buildBaseContext()), { formData: formData });
34
28
  }, [JSON.stringify(formData), props.adaptableAlert]);
35
29
  const adaptableForm = React.useMemo(() => {
36
30
  if (api.isDestroyed()) {
@@ -21,27 +21,26 @@ const preventDefault = (e) => e.preventDefault();
21
21
  const AdaptableToolPanelComponent = (props) => {
22
22
  var _a;
23
23
  const toolPanelsGlyph = React.createElement(Icon, { name: 'align-justify' });
24
- const entitlementService = props.api.internalApi.getEntitlementService();
25
24
  const moduleService = props.api.internalApi.getModuleService();
26
25
  const adaptableOptions = props.api.optionsApi.getAdaptableOptions();
27
26
  const toolPanelOptions = adaptableOptions.toolPanelOptions;
28
27
  const settingsPanelOptions = adaptableOptions.settingsPanelOptions;
29
- if (entitlementService.isModuleHiddenEntitlement('ToolPanel')) {
28
+ if (props.api.entitlementApi.isModuleHiddenEntitlement('ToolPanel')) {
30
29
  // do NOT show any toolPanel content if the required entitlements are missing
31
30
  return (React.createElement(HelpBlock, { mt: 2, mb: 2, p: 2, style: { fontSize: 'var(--ab-font-size-3)' } }, "Not enough rights"));
32
31
  }
33
32
  const availableModuleItems = props.MainMenuItems.filter((menuItem) => menuItem.isVisible);
34
33
  const availableModules = availableModuleItems.map((menuItem) => menuItem.module);
35
34
  // 'Dashboard' is a special case because it's not available in the dashboard menu items, s we have to add it manually
36
- if (!entitlementService.isModuleHiddenEntitlement('Dashboard')) {
35
+ if (!props.api.entitlementApi.isModuleHiddenEntitlement('Dashboard')) {
37
36
  availableModules.push('Dashboard');
38
37
  }
39
38
  if (props.api.pluginsApi.getipushpullPluginApi() &&
40
- !entitlementService.isModuleHiddenEntitlement('IPushPull')) {
39
+ !props.api.entitlementApi.isModuleHiddenEntitlement('IPushPull')) {
41
40
  availableModules.push('IPushPull');
42
41
  }
43
42
  if (props.api.pluginsApi.getOpenFinPluginApi() &&
44
- !entitlementService.isModuleHiddenEntitlement('OpenFin')) {
43
+ !props.api.entitlementApi.isModuleHiddenEntitlement('OpenFin')) {
45
44
  availableModules.push('OpenFin');
46
45
  }
47
46
  const availableModuleToolPanels = ALL_TOOL_PANELS.filter((moduleToolPanel) => ArrayExtensions.ContainsItem(availableModules, moduleToolPanel));
@@ -125,7 +124,7 @@ const AdaptableToolPanelComponent = (props) => {
125
124
  const toolPanelButtons = [];
126
125
  let moduleButtons = props.ModuleButtons;
127
126
  const shouldAddSettingsPanel = settingsPanelOptions.alwaysShowInToolPanel &&
128
- !props.api.internalApi.getEntitlementService().isModuleHiddenEntitlement('SettingsPanel');
127
+ !props.api.entitlementApi.isModuleHiddenEntitlement('SettingsPanel');
129
128
  if (shouldAddSettingsPanel && !moduleButtons.includes('SettingsPanel')) {
130
129
  moduleButtons = ['SettingsPanel', ...moduleButtons];
131
130
  }
@@ -143,12 +142,7 @@ const AdaptableToolPanelComponent = (props) => {
143
142
  return props.api.toolPanelApi.getCustomToolPanelButtons().map((button) => {
144
143
  // TODO: variants of this mapping are present in several places (just search for api.internalApi.getStyleForButton() usages)
145
144
  // with the next opportunity we should abstract it
146
- const toolPanelContext = {
147
- adaptableApi: props.api,
148
- userName: props.api.optionsApi.getUserName(),
149
- adaptableId: props.api.optionsApi.getAdaptableId(),
150
- toolPanelState: props.api.toolPanelApi.getToolPanelState(),
151
- };
145
+ const toolPanelContext = Object.assign(Object.assign({}, props.api.internalApi.buildBaseContext()), { toolPanelState: props.api.toolPanelApi.getToolPanelState() });
152
146
  const buttonIcon = props.api.internalApi.getIconForButton(button, toolPanelContext);
153
147
  let buttonStyle = props.api.internalApi.getStyleForButton(button, toolPanelContext);
154
148
  let buttonLabel = props.api.internalApi.getLabelForButton(button, toolPanelContext);
@@ -15,14 +15,7 @@ export const CustomToolPanelContent = (props) => {
15
15
  useLayoutEffect(() => {
16
16
  const element = contentsDivDomRef.current;
17
17
  if (hasCustomRenderFn(customToolPanel)) {
18
- const customRenderContext = {
19
- visible: true,
20
- phase: 'onMount',
21
- element,
22
- adaptableApi: api,
23
- userName: api.optionsApi.getUserName(),
24
- adaptableId: api.optionsApi.getAdaptableId(),
25
- };
18
+ const customRenderContext = Object.assign({ visible: true, phase: 'onMount', element }, api.internalApi.buildBaseContext());
26
19
  const html = customToolPanel.render(customRenderContext);
27
20
  setContentsHTML(html);
28
21
  }
@@ -31,14 +24,7 @@ export const CustomToolPanelContent = (props) => {
31
24
  }
32
25
  return () => {
33
26
  if (hasCustomRenderFn(customToolPanel)) {
34
- customToolPanel.render({
35
- visible: false,
36
- phase: 'onDestroy',
37
- element,
38
- adaptableApi: api,
39
- userName: api.optionsApi.getUserName(),
40
- adaptableId: api.optionsApi.getAdaptableId(),
41
- });
27
+ customToolPanel.render(Object.assign({ visible: false, phase: 'onDestroy', element }, api.internalApi.buildBaseContext()));
42
28
  }
43
29
  else if (hasCustomFrameworkComponent(customToolPanel) && !api.isDestroyed()) {
44
30
  api.internalApi.destroyFrameworkComponent(element, customToolPanel.frameworkComponent, 'toolPanel');
@@ -50,13 +36,7 @@ export const CustomToolPanelContent = (props) => {
50
36
  ((_a = customToolPanel.buttons) === null || _a === void 0 ? void 0 : _a.length) && (React.createElement("div", { id: buttonsDivId, className: `ab-ToolPanel__custom-content__buttons ${buttonsDivId}` }, customToolPanel.buttons.map((button) => {
51
37
  // TODO: variants of this mapping are present in several places (just search for api.internalApi.getStyleForButton() usages)
52
38
  // with the next opportunity we should abstract it
53
- const toolPanelContext = {
54
- adaptableApi: api,
55
- userName: api.optionsApi.getUserName(),
56
- adaptableId: api.optionsApi.getAdaptableId(),
57
- toolPanelState: api.toolPanelApi.getToolPanelState(),
58
- customToolPanel: customToolPanel,
59
- };
39
+ const toolPanelContext = Object.assign(Object.assign({}, api.internalApi.buildBaseContext()), { toolPanelState: api.toolPanelApi.getToolPanelState(), customToolPanel: customToolPanel });
60
40
  const buttonIcon = api.internalApi.getIconForButton(button, toolPanelContext);
61
41
  let buttonStyle = api.internalApi.getStyleForButton(button, toolPanelContext);
62
42
  let buttonLabel = api.internalApi.getLabelForButton(button, toolPanelContext);
@@ -22,7 +22,6 @@ class ToolPanelPopupComponent extends React.Component {
22
22
  };
23
23
  }
24
24
  render() {
25
- const entitlementService = this.props.api.internalApi.getEntitlementService();
26
25
  // 1. process module buttons
27
26
  const selectedModuleButtons = [];
28
27
  if (ArrayExtensions.IsNotNullOrEmpty(this.props.ToolPanelState.ModuleButtons)) {
@@ -37,15 +36,15 @@ class ToolPanelPopupComponent extends React.Component {
37
36
  // 2. process tool panels
38
37
  const availableModules = this.props.GridState.SettingPanelModuleMenuItems.filter((menuItem) => menuItem.isVisible).map((menuItem) => menuItem.module);
39
38
  // 'Dashboard' is a special case because it's not available in the dashboard menu items, s we have to add it manually
40
- if (!entitlementService.isModuleHiddenEntitlement('Dashboard')) {
39
+ if (!this.props.api.entitlementApi.isModuleHiddenEntitlement('Dashboard')) {
41
40
  availableModules.push('Dashboard');
42
41
  }
43
42
  if (this.props.api.pluginsApi.getipushpullPluginApi() &&
44
- !entitlementService.isModuleHiddenEntitlement('IPushPull')) {
43
+ !this.props.api.entitlementApi.isModuleHiddenEntitlement('IPushPull')) {
45
44
  availableModules.push('IPushPull');
46
45
  }
47
46
  if (this.props.api.pluginsApi.getOpenFinPluginApi() &&
48
- !entitlementService.isModuleHiddenEntitlement('OpenFin')) {
47
+ !this.props.api.entitlementApi.isModuleHiddenEntitlement('OpenFin')) {
49
48
  availableModules.push('OpenFin');
50
49
  }
51
50
  const availableModuleToolPanels = ALL_TOOL_PANELS.filter((moduleToolPanel) => ArrayExtensions.ContainsItem(availableModules, moduleToolPanel));
@@ -59,7 +58,7 @@ class ToolPanelPopupComponent extends React.Component {
59
58
  const selectedToolPanels = this.props.ToolPanelState.ToolPanels.map((toolPanelDefinition) => toolPanelDefinition.Name)
60
59
  // ensure that the visible state has only valid tool panels
61
60
  .filter((visibleToolPanel) => availableToolPanels.includes(visibleToolPanel));
62
- const isToolPanelReadOnly = entitlementService.isModuleReadOnlyEntitlement('ToolPanel');
61
+ const isToolPanelReadOnly = this.props.api.entitlementApi.isModuleReadOnlyEntitlement('ToolPanel');
63
62
  const isModuleCheckboxDisabled = (module) => {
64
63
  if (module === 'SettingsPanel') {
65
64
  return this.props.api.optionsApi.getSettingsPanelOptions().alwaysShowInDashboard;
@@ -13,9 +13,7 @@ export const ToolPanelWrapper = (props) => {
13
13
  const getToolPanelConfiguration = () => {
14
14
  var _a;
15
15
  if (adaptableToolPanel) {
16
- const accessLevel = api.internalApi
17
- .getEntitlementService()
18
- .getEntitlementAccessLevelForModule(adaptableToolPanel);
16
+ const accessLevel = api.entitlementApi.getEntitlementAccessLevelForModule(adaptableToolPanel);
19
17
  const moduleInfo = api.internalApi
20
18
  .getModuleService()
21
19
  .getModuleInfoByModule(adaptableToolPanel);
@@ -7,9 +7,9 @@ import { Icon } from '../../../components/icons';
7
7
  import { EllipsisContainer } from '../../../components/EllipsisContainer';
8
8
  import SimpleButton from '../../../components/SimpleButton';
9
9
  import Radio from '../../../components/Radio';
10
- import { reorder } from '../../../Utilities/reorder';
11
10
  import { Tag } from '../../../components/Tag';
12
11
  import { AdaptableFormControlTextClear } from '../Forms/AdaptableFormControlTextClear';
12
+ import ArrayExtensions from '../../../Utilities/Extensions/ArrayExtensions';
13
13
  function useValuesMap({ options, value, toIdentifier, selectedMap, }) {
14
14
  const optionsMap = useMemo(() => {
15
15
  if (selectedMap) {
@@ -130,7 +130,7 @@ export function ValueSelector(props) {
130
130
  }
131
131
  }
132
132
  const clone = new Map(selectedMap);
133
- const newSelection = reorder(selection, source.index, destination.index);
133
+ const newSelection = ArrayExtensions.reorderArray(selection, source.index, destination.index);
134
134
  // and then pushed back in the new order, at the end
135
135
  newSelection.push(...extraKeys);
136
136
  selectedMap.clear();
@@ -5,9 +5,9 @@ import { Loader } from '../../../components/Loader';
5
5
  import { Tabs } from '../../../components/Tabs';
6
6
  import join from '../../../components/utils/join';
7
7
  import { runIfNotResolvedIn } from '../../../Utilities/runIfNotResolvedIn';
8
- import { sortWithOrderArray } from '../../../Utilities/sortWithOrder';
9
8
  import { ValueOptionsTags, ValueSelector } from '../../Components/ValueSelector';
10
9
  import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
10
+ import ArrayExtensions from '../../.././Utilities/Extensions/ArrayExtensions';
11
11
  export const isValidCustomSortOrder = (data) => {
12
12
  if (!data.SortedValues || !data.SortedValues.length) {
13
13
  return 'You have to specify at least one value for Custom Sort order';
@@ -51,7 +51,7 @@ export const CustomSortValuesWizardSection = (props) => {
51
51
  return sortedValuesMap.has(option);
52
52
  }, [sortedValuesMap]);
53
53
  const options = useMemo(() => {
54
- return sortWithOrderArray(distinctValues, data.SortedValues, {
54
+ return ArrayExtensions.sortArrayWithOrder(distinctValues, data.SortedValues, {
55
55
  sortUnorderedItems: false,
56
56
  });
57
57
  }, [allowReorder, distinctValues, data.SortedValues]);
@@ -7,12 +7,7 @@ export const CustomDashboardButton = (props) => {
7
7
  const [componentRevision, setComponentRevision] = useState(1);
8
8
  // TODO: variants of this mapping are present in several places (just search for api.internalApi.getStyleForButton() usages)
9
9
  // with the next opportunity we should abstract it
10
- const dashboardContext = {
11
- adaptableApi: props.api,
12
- userName: props.api.optionsApi.getUserName(),
13
- adaptableId: props.api.optionsApi.getAdaptableId(),
14
- dashboardState: props.api.dashboardApi.getDashboardState(),
15
- };
10
+ const dashboardContext = Object.assign(Object.assign({}, props.api.internalApi.buildBaseContext()), { dashboardState: props.api.dashboardApi.getDashboardState() });
16
11
  const buttonIcon = props.api.internalApi.getIconForButton(button, dashboardContext);
17
12
  let buttonStyle = props.api.internalApi.getStyleForButton(button, dashboardContext);
18
13
  let buttonLabel = props.api.internalApi.getLabelForButton(button, dashboardContext);