@adaptabletools/adaptable-cjs 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 +15 -0
  32. package/src/Api/Internal/ExportInternalApi.d.ts +33 -8
  33. package/src/Api/Internal/ExportInternalApi.js +577 -5
  34. package/src/Api/Internal/NamedQueryInternalApi.d.ts +0 -1
  35. package/src/Api/Internal/NamedQueryInternalApi.js +0 -5
  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 +11 -11
  41. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +3 -3
  42. package/src/Redux/ActionsReducers/LayoutRedux.js +10 -10
  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 +3 -3
  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 +11 -0
  60. package/src/Utilities/Constants/GeneralConstants.d.ts +41 -4
  61. package/src/Utilities/Constants/GeneralConstants.js +44 -5
  62. package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +0 -2
  63. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -6
  64. package/src/Utilities/Extensions/ArrayExtensions.d.ts +14 -0
  65. package/src/Utilities/Extensions/ArrayExtensions.js +68 -1
  66. package/src/Utilities/Extensions/EnumExtensions.d.ts +0 -4
  67. package/src/Utilities/Extensions/EnumExtensions.js +3 -15
  68. package/src/Utilities/Helpers/AdaptableHelper.d.ts +4 -10
  69. package/src/Utilities/Helpers/AdaptableHelper.js +10 -64
  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 +1 -76
  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 +152 -144
  124. package/src/agGrid/AgGridAdapter.d.ts +0 -1
  125. package/src/agGrid/AgGridAdapter.js +7 -10
  126. package/src/agGrid/AgGridColumnAdapter.d.ts +3 -1
  127. package/src/agGrid/AgGridColumnAdapter.js +39 -13
  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.cjs.tsbuildinfo +1 -1
  139. package/src/Redux/ActionsReducers/QueryRedux.d.ts +0 -10
  140. package/src/Redux/ActionsReducers/QueryRedux.js +0 -25
  141. package/src/Utilities/Helpers/FormatContentHelper.d.ts +0 -22
  142. package/src/Utilities/Helpers/FormatContentHelper.js +0 -39
  143. package/src/Utilities/Services/EntitlementService.d.ts +0 -14
  144. package/src/Utilities/Services/EntitlementService.js +0 -67
  145. package/src/Utilities/Services/Interface/IEntitlementService.d.ts +0 -10
  146. package/src/Utilities/Services/Interface/IEntitlementService.js +0 -2
  147. package/src/Utilities/Services/Interface/IReportService.d.ts +0 -27
  148. package/src/Utilities/Services/Interface/IReportService.js +0 -2
  149. package/src/Utilities/Services/ReportService.d.ts +0 -41
  150. package/src/Utilities/Services/ReportService.js +0 -608
  151. package/src/Utilities/isAdaptableObject.d.ts +0 -2
  152. package/src/Utilities/isAdaptableObject.js +0 -8
  153. package/src/Utilities/reorder.d.ts +0 -1
  154. package/src/Utilities/reorder.js +0 -17
  155. package/src/Utilities/sortWithOrder.d.ts +0 -11
  156. package/src/Utilities/sortWithOrder.js +0 -54
@@ -12,11 +12,6 @@ export declare function isInputNullOrEmpty(itemToCheck: any): boolean;
12
12
  export declare function isInputNotNullOrEmpty(itemToCheck: any): boolean;
13
13
  export declare function roundNumber(numberToRound: any, decimalPlaces: number): number;
14
14
  export declare function roundNumberTo4dp(numberToRound: any): number;
15
- export declare function sumNumberArray(numericValues: number[]): number;
16
- export declare function standardDeviationNumberArray(numericValues: number[]): number;
17
- export declare function meanNumberArray(numericValues: number[]): number;
18
- export declare function medianNumberArray(numericValues: number[]): number;
19
- export declare function modeNumberArray(numbers: number[]): number;
20
15
  export declare function clamp(value: any, boundOne: number, boundTwo: number): number;
21
16
  export declare function extractColsFromText(text: string): string[];
22
17
  export declare function replaceAll(text: string, toReplace: string, replaceWith: string): string;
@@ -35,11 +30,6 @@ export declare const Helper: {
35
30
  isInputNotNullOrEmpty: typeof isInputNotNullOrEmpty;
36
31
  roundNumber: typeof roundNumber;
37
32
  roundNumberTo4dp: typeof roundNumberTo4dp;
38
- standardDeviationNumberArray: typeof standardDeviationNumberArray;
39
- sumNumberArray: typeof sumNumberArray;
40
- meanNumberArray: typeof meanNumberArray;
41
- medianNumberArray: typeof medianNumberArray;
42
- modeNumberArray: typeof modeNumberArray;
43
33
  clamp: typeof clamp;
44
34
  extractColsFromText: typeof extractColsFromText;
45
35
  replaceAll: typeof replaceAll;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Helper = exports.extractContextKeysFromText = exports.replaceAll = exports.extractColsFromText = exports.clamp = exports.modeNumberArray = exports.medianNumberArray = exports.meanNumberArray = exports.standardDeviationNumberArray = exports.sumNumberArray = exports.roundNumberTo4dp = exports.roundNumber = exports.isInputNotNullOrEmpty = exports.isInputNullOrEmpty = exports.returnItemCount = exports.copyToClipboard = exports.createDownloadedFile = exports.convertArrayToCsv = exports.arrayToKeyMap = exports.cloneObject = exports.getStringRepresentionFromKey = exports.objectHasKeys = exports.objectNotExists = exports.objectExists = void 0;
3
+ exports.Helper = exports.extractContextKeysFromText = exports.replaceAll = exports.extractColsFromText = exports.clamp = exports.roundNumberTo4dp = exports.roundNumber = exports.isInputNotNullOrEmpty = exports.isInputNullOrEmpty = exports.returnItemCount = exports.copyToClipboard = exports.createDownloadedFile = exports.convertArrayToCsv = exports.arrayToKeyMap = exports.cloneObject = exports.getStringRepresentionFromKey = exports.objectHasKeys = exports.objectNotExists = exports.objectExists = void 0;
4
4
  const StringExtensions_1 = require("../Extensions/StringExtensions");
5
5
  const AdaptableLogger_1 = require("../../agGrid/AdaptableLogger");
6
6
  function objectExists(item) {
@@ -166,76 +166,6 @@ function roundNumberTo4dp(numberToRound) {
166
166
  return roundNumber(numberToRound, 4);
167
167
  }
168
168
  exports.roundNumberTo4dp = roundNumberTo4dp;
169
- function sumNumberArray(numericValues) {
170
- return numericValues.length
171
- ? numericValues.reduce(function (a, b) {
172
- return a + b;
173
- })
174
- : 0;
175
- }
176
- exports.sumNumberArray = sumNumberArray;
177
- function standardDeviationNumberArray(numericValues) {
178
- if (numericValues.length) {
179
- const count = numericValues.length;
180
- const mean = sumNumberArray(numericValues) / count;
181
- return Math.sqrt(sumNumberArray(numericValues.map((val) => {
182
- return Math.pow(val - mean, 2);
183
- })) / count);
184
- }
185
- else {
186
- return 0;
187
- }
188
- }
189
- exports.standardDeviationNumberArray = standardDeviationNumberArray;
190
- function meanNumberArray(numericValues) {
191
- // dividing by 0 will return Infinity
192
- // arr must contain at least 1 element to use reduce
193
- if (numericValues.length) {
194
- let sum = sumNumberArray(numericValues);
195
- return sum / numericValues.length;
196
- }
197
- else {
198
- return 0;
199
- }
200
- }
201
- exports.meanNumberArray = meanNumberArray;
202
- function medianNumberArray(numericValues) {
203
- numericValues.sort(function (a, b) {
204
- return a - b;
205
- });
206
- const middle = Math.floor((numericValues.length - 1) / 2); // NB: operator precedence
207
- if (numericValues.length % 2) {
208
- return numericValues[middle];
209
- }
210
- else {
211
- return (numericValues[middle] + numericValues[middle + 1]) / 2.0;
212
- }
213
- }
214
- exports.medianNumberArray = medianNumberArray;
215
- function modeNumberArray(numbers) {
216
- if (numbers.length === 0) {
217
- return 0;
218
- }
219
- const m = numbers
220
- .reduce((items, current) => {
221
- const item = items.length === 0 ? null : items.find((x) => x.value === current);
222
- item ? item.occurrence++ : items.push({ value: current, occurrence: 1 });
223
- return items;
224
- }, [])
225
- .sort((a, b) => {
226
- if (a.occurrence < b.occurrence) {
227
- return 1;
228
- }
229
- else if (a.occurrence > b.occurrence || a.value < b.value) {
230
- return -1;
231
- }
232
- else {
233
- return a.value === b.value ? 0 : 1;
234
- }
235
- });
236
- return m[0].value;
237
- }
238
- exports.modeNumberArray = modeNumberArray;
239
169
  // putting this here to remove lodash clamp which seems to cause an issue
240
170
  function clamp(value, boundOne, boundTwo) {
241
171
  if (!boundTwo) {
@@ -295,11 +225,6 @@ exports.Helper = {
295
225
  isInputNotNullOrEmpty,
296
226
  roundNumber,
297
227
  roundNumberTo4dp,
298
- standardDeviationNumberArray,
299
- sumNumberArray,
300
- meanNumberArray,
301
- medianNumberArray,
302
- modeNumberArray,
303
228
  clamp,
304
229
  extractColsFromText,
305
230
  replaceAll,
@@ -1,10 +1,10 @@
1
- import { ChartModel } from '@ag-grid-community/core';
1
+ import { AgEventType, ChartModel } from '@ag-grid-community/core';
2
2
  import { AdaptableApi } from '../../types';
3
3
  import { IChartingService } from './Interface/IChartingService';
4
4
  export declare class ChartingService implements IChartingService {
5
5
  private api;
6
6
  constructor(api: AdaptableApi);
7
- onChartModelChange(models: ChartModel[], eventType: string, params: any): void;
7
+ onChartModelChange(models: ChartModel[], eventType: AgEventType, params: any): void;
8
8
  /**
9
9
  * Emit events only for adaptable charting definition changes
10
10
  * - an adaptable chart opens
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChartingService = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const core_1 = require("ag-grid-community");
6
5
  const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
7
6
  const ObjectFactory_1 = tslib_1.__importDefault(require("../ObjectFactory"));
8
7
  class ChartingService {
@@ -14,7 +13,7 @@ class ChartingService {
14
13
  const currentChartModel = models.find((model) => model.chartId === params.chartId);
15
14
  const currentChartDefinition = allChartDefinitions.find((chartDefinition) => chartDefinition.Model.chartId === params.chartId);
16
15
  switch (eventType) {
17
- case core_1.Events.EVENT_CHART_CREATED:
16
+ case 'chartCreated':
18
17
  const createParams = params;
19
18
  if (allChartDefinitions.some((chartDefinition) => chartDefinition.Model.chartId === createParams.chartId)) {
20
19
  // chart already exists
@@ -24,8 +23,8 @@ class ChartingService {
24
23
  this.saveNewChart(chartModel);
25
24
  }
26
25
  break;
27
- case core_1.Events.EVENT_CHART_OPTIONS_CHANGED:
28
- case core_1.Events.EVENT_CHART_RANGE_SELECTION_CHANGED:
26
+ case 'chartOptionsChanged':
27
+ case 'chartRangeSelectionChanged':
29
28
  if (!currentChartDefinition) {
30
29
  // editing a non-saved chart
31
30
  break;
@@ -46,18 +45,13 @@ class ChartingService {
46
45
  */
47
46
  emitAdaptableChartDefinitonChange() {
48
47
  const chartingOpenState = this.api.chartingApi.getChartingOpenState();
49
- const chartChangedInfo = {
50
- chartingOpenState: chartingOpenState,
51
- adaptableApi: this.api,
52
- userName: this.api.optionsApi.getUserName(),
53
- adaptableId: this.api.optionsApi.getAdaptableId(),
54
- };
48
+ const chartChangedInfo = Object.assign({ chartingOpenState: chartingOpenState }, this.api.internalApi.buildBaseContext());
55
49
  this.api.eventApi.emit('ChartChanged', chartChangedInfo);
56
50
  }
57
51
  saveNewChart(chartModel) {
58
52
  var _a, _b;
59
53
  const chartingOptions = (_a = this.api.optionsApi.getChartingOptions()) !== null && _a !== void 0 ? _a : {};
60
- const saveStragegy = (_b = chartingOptions.saveStrategy) !== null && _b !== void 0 ? _b : 'manual';
54
+ const saveStragegy = (_b = chartingOptions.saveChartBehaviour) !== null && _b !== void 0 ? _b : 'manual';
61
55
  if (saveStragegy === 'none') {
62
56
  return;
63
57
  }
@@ -11,25 +11,25 @@ class ModuleService {
11
11
  this.adaptableApi = adaptableApi;
12
12
  }
13
13
  createModuleMenus() {
14
- const settingsPanelMenuItems = [];
15
- const buttonMenuItems = [];
14
+ const settingsPanelItems = [];
15
+ const adaptableMenuItems = [];
16
16
  this.getModuleCollection().forEach((module) => {
17
17
  const settingsPanelMenuItem = module.createModuleMenuItem('ModuleMenu');
18
18
  if (Helper_1.default.objectExists(settingsPanelMenuItem)) {
19
- if (settingsPanelMenuItems.findIndex((m) => m.module == settingsPanelMenuItem.module) == -1) {
20
- settingsPanelMenuItems.push(settingsPanelMenuItem);
19
+ if (settingsPanelItems.findIndex((m) => m.module == settingsPanelMenuItem.module) == -1) {
20
+ settingsPanelItems.push(settingsPanelMenuItem);
21
21
  }
22
22
  }
23
- const buttonMenuItem = module.createModuleMenuItem('ModuleButton');
24
- if (Helper_1.default.objectExists(buttonMenuItem)) {
25
- if (buttonMenuItems.findIndex((m) => m.module == buttonMenuItem.module) == -1) {
26
- buttonMenuItems.push(buttonMenuItem);
23
+ const adaptableMenuItem = module.createModuleMenuItem('ModuleButton');
24
+ if (Helper_1.default.objectExists(adaptableMenuItem)) {
25
+ if (adaptableMenuItems.findIndex((m) => m.module == adaptableMenuItem.module) == -1) {
26
+ adaptableMenuItems.push(adaptableMenuItem);
27
27
  }
28
28
  }
29
29
  });
30
30
  // store the main menu as we will re-use (and it never changes)
31
- this.adaptableApi.internalApi.setSettingPanelModuleMenuItems(settingsPanelMenuItems);
32
- this.adaptableApi.internalApi.setModuleButtonMenuItems(buttonMenuItems);
31
+ this.adaptableApi.internalApi.setSettingsPanelItems(settingsPanelItems);
32
+ this.adaptableApi.internalApi.setMenuModuleItems(adaptableMenuItems);
33
33
  }
34
34
  isModuleAvailable(adaptableModule) {
35
35
  let module = this.getModuleCollection().get(adaptableModule);
@@ -91,52 +91,62 @@ class ModuleService {
91
91
  return learnUrl + 'handbook-calculated-column';
92
92
  case 'CellSummary':
93
93
  return learnUrl + 'handbook-summarising';
94
+ case 'Charting':
95
+ return learnUrl + 'handbook-charts';
96
+ case 'ColumnFilter':
97
+ return learnUrl + 'handbook-column-filter';
98
+ case 'ColumnInfo':
99
+ return learnUrl + 'dev-guide-tutorial-grid-column-info';
100
+ case 'Comment':
101
+ return learnUrl + 'handbook-comments';
94
102
  case 'CustomSort':
95
- return learnUrl + 'handbook-sorting';
103
+ return learnUrl + 'handbook-sorting-custom';
96
104
  case 'Dashboard':
97
105
  return learnUrl + 'ui-dashboard';
98
- case 'DataSet':
99
- return learnUrl + 'handbook-data-sets';
100
- case 'DataImport':
101
- return learnUrl + 'handbook-importing';
102
106
  case 'DataChangeHistory':
103
107
  return learnUrl + 'handbook-monitoring-data-change-history';
108
+ case 'DataImport':
109
+ return learnUrl + 'handbook-importing';
110
+ case 'DataSet':
111
+ return learnUrl + 'handbook-data-sets';
104
112
  case 'Export':
105
113
  return learnUrl + 'handbook-exporting';
106
- case 'ColumnFilter':
107
- return learnUrl + 'handbook-column-filter';
108
- case 'Comment':
109
- return learnUrl + 'handbook-comments';
110
- case 'GridFilter':
111
- return learnUrl + 'handbook-grid-filter';
114
+ case 'Fdc3':
115
+ return learnUrl + 'handbook-fdc3';
112
116
  case 'FlashingCell':
113
117
  return learnUrl + 'handbook-flashing-cell';
114
118
  case 'FormatColumn':
115
119
  return learnUrl + 'handbook-column-formatting';
116
120
  case 'FreeTextColumn':
117
121
  return learnUrl + 'handbook-freetext-column';
122
+ case 'GridFilter':
123
+ return learnUrl + 'handbook-grid-filter';
118
124
  case 'GridInfo':
119
- return learnUrl + 'handbook-monitoring-grid-info';
125
+ return learnUrl + 'dev-guide-tutorial-grid-column-info';
120
126
  case 'Layout':
121
127
  return learnUrl + 'handbook-layouts';
128
+ case 'NamedQuery':
129
+ return learnUrl + 'handbook-named-queries';
122
130
  case 'Note':
123
131
  return learnUrl + 'handbook-notes';
124
132
  case 'PlusMinus':
125
133
  return learnUrl + 'handbook-editing-plus-minus';
126
- case 'NamedQuery':
127
- return learnUrl + 'handbook-named-queries';
128
134
  case 'QuickSearch':
129
135
  return learnUrl + 'handbook-quick-search';
130
136
  case 'Schedule':
131
137
  return learnUrl + 'handbook-scheduling';
138
+ case 'SettingsPanel':
139
+ return learnUrl + 'ui-settings-panel';
132
140
  case 'Shortcut':
133
141
  return learnUrl + 'handbook-editing-shortcut';
134
142
  case 'SmartEdit':
135
143
  return learnUrl + 'handbook-editing-smart-edit';
136
144
  case 'StateManagement':
137
- return learnUrl + 'dev-guide-adaptable-state';
145
+ return learnUrl + 'dev-guide-adaptable-state-management';
138
146
  case 'StatusBar':
139
147
  return learnUrl + 'ui-status-bar';
148
+ case 'StyledColumn':
149
+ return learnUrl + 'handbook-styled-column-overview';
140
150
  case 'SystemStatus':
141
151
  return learnUrl + 'handbook-system-status-message';
142
152
  case 'TeamSharing':
@@ -149,12 +159,6 @@ class ModuleService {
149
159
  return learnUrl + 'integrations-ipushpull';
150
160
  case 'OpenFin':
151
161
  return learnUrl + 'integrations-openfin';
152
- case 'StyledColumn':
153
- return learnUrl + 'handbook-styled-column-overview';
154
- case 'Charting':
155
- return learnUrl + 'handbook-charts';
156
- case 'DataImport':
157
- return learnUrl + 'handbook-data-import';
158
162
  default:
159
163
  return 'good';
160
164
  }
@@ -26,12 +26,7 @@ class RowEditService {
26
26
  const setPrimaryKeyValueFunction = adaptableApi.internalApi.getAdaptableInstance().adaptableOptions.actionRowOptions
27
27
  .setPrimaryKeyValue;
28
28
  const newRowData = typeof setPrimaryKeyValueFunction === 'function'
29
- ? setPrimaryKeyValueFunction({
30
- rowData: formData,
31
- adaptableApi,
32
- userName: this.adaptableApi.optionsApi.getUserName(),
33
- adaptableId: this.adaptableApi.optionsApi.getAdaptableId(),
34
- })
29
+ ? setPrimaryKeyValueFunction(Object.assign({ rowData: formData }, adaptableApi.internalApi.buildBaseContext()))
35
30
  : Object.assign({}, formData);
36
31
  const config = {
37
32
  addIndex: 0,
@@ -100,7 +100,7 @@ class RowSummaryService {
100
100
  const rowSummaries = (_a = this.api.layoutApi.getCurrentLayout().RowSummaries) !== null && _a !== void 0 ? _a : [];
101
101
  const rowSummariesResults = rowSummaries
102
102
  .filter((rowSummary) => !rowSummary.IsSuspended)
103
- .map((rowSummary) => {
103
+ .map((rowSummary, index) => {
104
104
  const { ColumnsMap, Position,
105
105
  // it defaults to true
106
106
  IncludeOnlyFilteredRows = true, } = rowSummary;
@@ -163,7 +163,7 @@ class RowSummaryService {
163
163
  acc = this.api.internalApi.setValueUsingField(acc, fieldName, value);
164
164
  return acc;
165
165
  }, {
166
- [RowSummary_1.ROW_SUMMARY_ROW_ID]: true,
166
+ [RowSummary_1.ROW_SUMMARY_ROW_ID]: `row-summary-${index}`,
167
167
  }),
168
168
  };
169
169
  });
@@ -74,25 +74,11 @@ class ValidationService {
74
74
  IsAlertDefinitionTriggered(alertDefinition, dataChangedEvent) {
75
75
  var _a;
76
76
  const displayValue = this.adaptableApi.gridApi.getDisplayValueFromRowNode(dataChangedEvent.rowNode, dataChangedEvent.column.columnId);
77
- const predicateDefHandlerContext = {
78
- value: dataChangedEvent.newValue,
79
- oldValue: dataChangedEvent.oldValue,
80
- displayValue,
81
- node: dataChangedEvent.rowNode,
82
- column: dataChangedEvent.column,
83
- adaptableApi: this.adaptableApi,
84
- userName: this.adaptableApi.optionsApi.getUserName(),
85
- adaptableId: this.adaptableApi.optionsApi.getAdaptableId(),
86
- };
77
+ const predicateDefHandlerContext = Object.assign({ value: dataChangedEvent.newValue, oldValue: dataChangedEvent.oldValue, displayValue, node: dataChangedEvent.rowNode, column: dataChangedEvent.column }, this.adaptableApi.internalApi.buildBaseContext());
87
78
  return this.adaptableApi.predicateApi.handlePredicates((_a = alertDefinition.Rule) === null || _a === void 0 ? void 0 : _a.Predicates, predicateDefHandlerContext, false);
88
79
  }
89
80
  performServerValidation(cellDataChangedInfo, config) {
90
- const serverValidationContext = {
91
- cellDataChangedInfo: cellDataChangedInfo,
92
- adaptableApi: this.adaptableApi,
93
- userName: this.adaptableApi.optionsApi.getUserName(),
94
- adaptableId: this.adaptableApi.optionsApi.getAdaptableId(),
95
- };
81
+ const serverValidationContext = Object.assign({ cellDataChangedInfo: cellDataChangedInfo }, this.adaptableApi.internalApi.buildBaseContext());
96
82
  return () => {
97
83
  this.adaptableApi.optionsApi
98
84
  .getEditOptions()
@@ -6,8 +6,7 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const AdaptableContext_1 = require("../AdaptableContext");
7
7
  const AlertEmptyView = (props) => {
8
8
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
9
- const accessLevel = adaptable.api.internalApi
10
- .getEntitlementService()
9
+ const accessLevel = adaptable.api.entitlementApi
11
10
  .getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
12
11
  const text = accessLevel == 'ReadOnly'
13
12
  ? 'You have no Alert Definitions.'
@@ -9,8 +9,7 @@ const useChartingElements_1 = require("./useChartingElements");
9
9
  const rebass_1 = require("rebass");
10
10
  const ChartingStatusBarPopover = (props) => {
11
11
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
12
- const accessLevel = adaptable.api.internalApi
13
- .getEntitlementService()
12
+ const accessLevel = adaptable.api.entitlementApi
14
13
  .getEntitlementAccessLevelForModule(ModuleConstants.ChartingModuleId);
15
14
  const { chartSelector, containerSelector, chartButton, deleteButton, editButton } = (0, useChartingElements_1.useChartingElements)({
16
15
  elementType: 'Statusbar',
@@ -28,7 +28,7 @@ const useChartingElements = ({ elementType, accessLevel, size = 'normal', }) =>
28
28
  });
29
29
  const selectedChart = allChartDefinitions.find((chart) => chart.Uuid === selectedChartId);
30
30
  const isAgChart = (0, ChartingState_1.isAgChartDefinition)(selectedChart);
31
- const chartAccessLevel = AdaptableHelper_1.default.getAppropriateAccessLevel(selectedChart, accessLevel);
31
+ const chartAccessLevel = AdaptableHelper_1.default.getAccessLevelForObject(selectedChart, accessLevel);
32
32
  const [selectedContainer, setSelectedContainer] = React.useState(null);
33
33
  // Need to always call as they the rule for hooks
34
34
  const { isOpen: isAgChartOpen, showChart: showAgChart, closeChart: hideAgChart, } = (0, useAgChartState_1.useAgChartState)(isAgChart ? selectedChart : undefined);
@@ -17,9 +17,7 @@ const AdaptableObjectCompactListItem = (props) => {
17
17
  const objectView = props.module.toViewCompact(props.abObject);
18
18
  const viewOptions = (_b = (_a = props.module) === null || _a === void 0 ? void 0 : _a.getViewProperties) === null || _b === void 0 ? void 0 : _b.call(_a);
19
19
  const deleteAction = (_c = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.getCompactDeleteAction) === null || _c === void 0 ? void 0 : _c.call(viewOptions, props.abObject);
20
- const moduleAccessLevel = adaptable.api.internalApi
21
- .getEntitlementService()
22
- .getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
20
+ const moduleAccessLevel = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
23
21
  const suspendAction = (_d = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.getCompactSuspendAction) === null || _d === void 0 ? void 0 : _d.call(viewOptions, props.abObject);
24
22
  const unSuspendAction = (_e = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.getCompactUnSuspendAction) === null || _e === void 0 ? void 0 : _e.call(viewOptions, props.abObject);
25
23
  const isSuspended = props.abObject.IsSuspended;
@@ -65,9 +63,7 @@ const AdaptableObjectCompactList = (props) => {
65
63
  const suspendAllAction = (_d = viewProperties === null || viewProperties === void 0 ? void 0 : viewProperties.getSuspendAllAction) === null || _d === void 0 ? void 0 : _d.call(viewProperties);
66
64
  const unSuspendAllAction = (_e = viewProperties === null || viewProperties === void 0 ? void 0 : viewProperties.getUnSuspendAllAction) === null || _e === void 0 ? void 0 : _e.call(viewProperties);
67
65
  const dispatch = (0, react_redux_1.useDispatch)();
68
- const accessLevel = adaptable.api.internalApi
69
- .getEntitlementService()
70
- .getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
66
+ const accessLevel = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
71
67
  const isAtLeastOneAbObjectActive = props.abObjects.some((abObject) => {
72
68
  return !abObject.IsSuspended;
73
69
  });
@@ -93,10 +93,8 @@ const AdaptableObjectListItem = (props) => {
93
93
  adaptable.api.teamSharingApi.isTeamSharingAvailable() &&
94
94
  adaptable.api.teamSharingApi.hasTeamSharingFullRights();
95
95
  const entityType = props.module.moduleInfo.FriendlyName;
96
- const moduleAccessLevel = adaptable.api.internalApi
97
- .getEntitlementService()
98
- .getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
99
- const accessLevel = AdaptableHelper_1.default.getAppropriateAccessLevel(props.data.abObject, moduleAccessLevel);
96
+ const moduleAccessLevel = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
97
+ const accessLevel = AdaptableHelper_1.default.getAccessLevelForObject(props.data.abObject, moduleAccessLevel);
100
98
  const itemClassName = (0, join_1.default)(props.data.className, ITEM_BASE_CLASS_NAME, props.data.abObject.IsSuspended &&
101
99
  `${ITEM_BASE_CLASS_NAME}--is-suspended`);
102
100
  const handleCloseWizard = React.useCallback(() => {
@@ -61,23 +61,13 @@ class QuickFilterFormComponent extends React.Component {
61
61
  let hideQuickFilterDropdownFunction = this.props.api.optionsApi.getColumnFilterOptions().quickFilterOptions
62
62
  .hideQuickFilterDropdown;
63
63
  if (hideQuickFilterDropdownFunction) {
64
- const columnFilterContext = {
65
- column: this.props.currentColumn,
66
- adaptableApi: this.props.api,
67
- userName: this.props.api.optionsApi.getUserName(),
68
- adaptableId: this.props.api.optionsApi.getAdaptableId(),
69
- };
64
+ const columnFilterContext = Object.assign({ column: this.props.currentColumn }, this.props.api.internalApi.buildBaseContext());
70
65
  showQuickFilterDropdown = !hideQuickFilterDropdownFunction(columnFilterContext);
71
66
  }
72
67
  let showQuickFilterInput = true;
73
68
  let hideQuickFilterInputFunction = this.props.api.optionsApi.getColumnFilterOptions().quickFilterOptions.hideQuickFilterInput;
74
69
  if (hideQuickFilterInputFunction) {
75
- const columnFilterContext = {
76
- column: this.props.currentColumn,
77
- adaptableApi: this.props.api,
78
- userName: this.props.api.optionsApi.getUserName(),
79
- adaptableId: this.props.api.optionsApi.getAdaptableId(),
80
- };
70
+ const columnFilterContext = Object.assign({ column: this.props.currentColumn }, this.props.api.internalApi.buildBaseContext());
81
71
  showQuickFilterInput = !hideQuickFilterInputFunction(columnFilterContext);
82
72
  }
83
73
  return (React.createElement(React.Fragment, null,
@@ -6,7 +6,7 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const ValueSelector_1 = require("../ValueSelector");
7
7
  const AdaptableContext_1 = require("../../AdaptableContext");
8
8
  const react_1 = require("react");
9
- const sortWithOrder_1 = require("../../../Utilities/sortWithOrder");
9
+ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/ArrayExtensions"));
10
10
  const ModuleValueSelector = (props) => {
11
11
  const { options, value, onChange, selectionBoxPosition = 'top' } = props, valueSelectorProps = tslib_1.__rest(props, ["options", "value", "onChange", "selectionBoxPosition"]);
12
12
  const { api } = (0, AdaptableContext_1.useAdaptable)();
@@ -28,7 +28,7 @@ const ModuleValueSelector = (props) => {
28
28
  return labelMap;
29
29
  }, [options]);
30
30
  const sortedOptions = (0, react_1.useMemo)(() => {
31
- return (0, sortWithOrder_1.sortWithOrderArray)(options, value, { sortUnorderedItems: true });
31
+ return ArrayExtensions_1.default.sortArrayWithOrder(options, value, { sortUnorderedItems: true });
32
32
  }, [allowReorder, options, value]);
33
33
  return (React.createElement(ValueSelector_1.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 })));
34
34
  };
@@ -10,7 +10,6 @@ const join_1 = tslib_1.__importDefault(require("../../../../components/utils/joi
10
10
  const Navigation_1 = require("./Navigation");
11
11
  const PopupContext_1 = tslib_1.__importDefault(require("./PopupContext"));
12
12
  const AdaptablePopupBody_1 = require("./AdaptablePopupBody");
13
- const DefaultSettingsPanel_1 = require("../../../../Utilities/Defaults/DefaultSettingsPanel");
14
13
  const AdaptableContext_1 = require("../../../AdaptableContext");
15
14
  const CustomSettingsPanelView_1 = require("./CustomSettingsPanelView");
16
15
  const useMenuItems_1 = require("./useMenuItems");
@@ -54,13 +53,11 @@ const AdaptablePopup = (props) => {
54
53
  else {
55
54
  const module = props.api.internalApi.getModuleService().getModuleById(componentModule);
56
55
  const moduleInfo = module === null || module === void 0 ? void 0 : module.moduleInfo;
57
- accessLevel = props.api.internalApi
58
- .getEntitlementService()
59
- .getEntitlementAccessLevelForModule(componentModule);
56
+ accessLevel = props.api.entitlementApi.getEntitlementAccessLevelForModule(componentModule);
60
57
  friendlyName = moduleInfo.FriendlyName;
61
58
  isStandalone =
62
59
  moduleInfo &&
63
- (DefaultSettingsPanel_1.STANDALONE_MODULE_POPUPS.includes(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.ModuleName) ||
60
+ (GeneralConstants.STANDALONE_MODULE_POPUPS.includes(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.ModuleName) ||
64
61
  (props.componentName && props.componentName !== (moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.Popup)));
65
62
  activeItem = moduleInfo.ModuleName;
66
63
  moduleViewContent = (React.createElement(AdaptablePopupBody_1.AdaptablePopupBody, { api: props.api, module: module, componentName: props.componentName, moduleParams: props.moduleParams, onClearParams: props.onClearParams, onHide: props.onHide }));
@@ -10,9 +10,7 @@ const AdaptablePopupBody = (props) => {
10
10
  var _a;
11
11
  const modalContainer = UIHelper_1.UIHelper.getModalContainer(props.api.optionsApi.getAdaptableOptions(), document);
12
12
  const moduleName = props.module.moduleInfo.ModuleName;
13
- const accessLevel = props.api.internalApi
14
- .getEntitlementService()
15
- .getEntitlementAccessLevelForModule(moduleName);
13
+ const accessLevel = props.api.entitlementApi.getEntitlementAccessLevelForModule(moduleName);
16
14
  const moduleInfo = props.api.internalApi.getModuleService().getModuleInfoByModule(moduleName);
17
15
  const moduleProps = {
18
16
  popupParams: props.moduleParams,
@@ -7,6 +7,7 @@ const react_redux_1 = require("react-redux");
7
7
  const DefaultSettingsPanel_1 = require("../../../../Utilities/Defaults/DefaultSettingsPanel");
8
8
  const AdaptableContext_1 = require("../../../AdaptableContext");
9
9
  const PopupRedux = tslib_1.__importStar(require("../../../../Redux/ActionsReducers/PopupRedux"));
10
+ const GeneralConstants_1 = require("../../../../Utilities/Constants/GeneralConstants");
10
11
  const useMenuItems = () => {
11
12
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
12
13
  const settingsPanelOptions = adaptable.adaptableOptions.settingsPanelOptions;
@@ -23,7 +24,7 @@ const useMenuItems = () => {
23
24
  const visibleItems = allMenuItems.filter((item) => item.module !== 'General' &&
24
25
  item.module !== 'CustomSettingsPanel' &&
25
26
  item.module !== 'Group' &&
26
- !DefaultSettingsPanel_1.STANDALONE_MODULE_POPUPS.includes(item.module) &&
27
+ !GeneralConstants_1.STANDALONE_MODULE_POPUPS.includes(item.module) &&
27
28
  item.isVisible);
28
29
  let navItems = navigationItems
29
30
  .map((moduleName) => {
@@ -28,13 +28,7 @@ const AdaptablePopupAlert = (props) => {
28
28
  }, []);
29
29
  const [formData, setFormData] = (0, react_1.useState)({});
30
30
  const context = React.useMemo(() => {
31
- return {
32
- alert: props.adaptableAlert,
33
- adaptableApi: api,
34
- formData: formData,
35
- userName: api.optionsApi.getUserName(),
36
- adaptableId: api.optionsApi.getAdaptableId(),
37
- };
31
+ return Object.assign(Object.assign({ alert: props.adaptableAlert }, api.internalApi.buildBaseContext()), { formData: formData });
38
32
  }, [JSON.stringify(formData), props.adaptableAlert]);
39
33
  const adaptableForm = React.useMemo(() => {
40
34
  if (api.isDestroyed()) {
@@ -25,27 +25,26 @@ const preventDefault = (e) => e.preventDefault();
25
25
  const AdaptableToolPanelComponent = (props) => {
26
26
  var _a;
27
27
  const toolPanelsGlyph = React.createElement(icons_1.Icon, { name: 'align-justify' });
28
- const entitlementService = props.api.internalApi.getEntitlementService();
29
28
  const moduleService = props.api.internalApi.getModuleService();
30
29
  const adaptableOptions = props.api.optionsApi.getAdaptableOptions();
31
30
  const toolPanelOptions = adaptableOptions.toolPanelOptions;
32
31
  const settingsPanelOptions = adaptableOptions.settingsPanelOptions;
33
- if (entitlementService.isModuleHiddenEntitlement('ToolPanel')) {
32
+ if (props.api.entitlementApi.isModuleHiddenEntitlement('ToolPanel')) {
34
33
  // do NOT show any toolPanel content if the required entitlements are missing
35
34
  return (React.createElement(HelpBlock_1.default, { mt: 2, mb: 2, p: 2, style: { fontSize: 'var(--ab-font-size-3)' } }, "Not enough rights"));
36
35
  }
37
36
  const availableModuleItems = props.MainMenuItems.filter((menuItem) => menuItem.isVisible);
38
37
  const availableModules = availableModuleItems.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 (!props.api.entitlementApi.isModuleHiddenEntitlement('Dashboard')) {
41
40
  availableModules.push('Dashboard');
42
41
  }
43
42
  if (props.api.pluginsApi.getipushpullPluginApi() &&
44
- !entitlementService.isModuleHiddenEntitlement('IPushPull')) {
43
+ !props.api.entitlementApi.isModuleHiddenEntitlement('IPushPull')) {
45
44
  availableModules.push('IPushPull');
46
45
  }
47
46
  if (props.api.pluginsApi.getOpenFinPluginApi() &&
48
- !entitlementService.isModuleHiddenEntitlement('OpenFin')) {
47
+ !props.api.entitlementApi.isModuleHiddenEntitlement('OpenFin')) {
49
48
  availableModules.push('OpenFin');
50
49
  }
51
50
  const availableModuleToolPanels = Types_1.ALL_TOOL_PANELS.filter((moduleToolPanel) => ArrayExtensions_1.default.ContainsItem(availableModules, moduleToolPanel));
@@ -129,7 +128,7 @@ const AdaptableToolPanelComponent = (props) => {
129
128
  const toolPanelButtons = [];
130
129
  let moduleButtons = props.ModuleButtons;
131
130
  const shouldAddSettingsPanel = settingsPanelOptions.alwaysShowInToolPanel &&
132
- !props.api.internalApi.getEntitlementService().isModuleHiddenEntitlement('SettingsPanel');
131
+ !props.api.entitlementApi.isModuleHiddenEntitlement('SettingsPanel');
133
132
  if (shouldAddSettingsPanel && !moduleButtons.includes('SettingsPanel')) {
134
133
  moduleButtons = ['SettingsPanel', ...moduleButtons];
135
134
  }
@@ -147,12 +146,7 @@ const AdaptableToolPanelComponent = (props) => {
147
146
  return props.api.toolPanelApi.getCustomToolPanelButtons().map((button) => {
148
147
  // TODO: variants of this mapping are present in several places (just search for api.internalApi.getStyleForButton() usages)
149
148
  // with the next opportunity we should abstract it
150
- const toolPanelContext = {
151
- adaptableApi: props.api,
152
- userName: props.api.optionsApi.getUserName(),
153
- adaptableId: props.api.optionsApi.getAdaptableId(),
154
- toolPanelState: props.api.toolPanelApi.getToolPanelState(),
155
- };
149
+ const toolPanelContext = Object.assign(Object.assign({}, props.api.internalApi.buildBaseContext()), { toolPanelState: props.api.toolPanelApi.getToolPanelState() });
156
150
  const buttonIcon = props.api.internalApi.getIconForButton(button, toolPanelContext);
157
151
  let buttonStyle = props.api.internalApi.getStyleForButton(button, toolPanelContext);
158
152
  let buttonLabel = props.api.internalApi.getLabelForButton(button, toolPanelContext);