@adaptabletools/adaptable 10.0.4-canary.1 → 10.0.4-canary.2

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 (179) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +1 -1
  3. package/base.css +16 -6
  4. package/bundle.cjs.js +350 -0
  5. package/index.css +20 -6
  6. package/package.json +1 -5
  7. package/publishTimestamp.d.ts +1 -1
  8. package/publishTimestamp.js +1 -1
  9. package/src/AdaptableInterfaces/AdaptableNoCodeWizard.d.ts +1 -1
  10. package/src/AdaptableInterfaces/IAdaptable.d.ts +14 -12
  11. package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -3
  12. package/src/AdaptableOptions/ContainerOptions.d.ts +4 -5
  13. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +1 -1
  14. package/src/AdaptableOptions/DateInputOptions.d.ts +5 -1
  15. package/src/AdaptableOptions/EditOptions.d.ts +2 -3
  16. package/src/AdaptableOptions/FilterOptions.d.ts +8 -8
  17. package/src/AdaptableOptions/GeneralOptions.d.ts +3 -2
  18. package/src/AdaptableOptions/MenuOptions.d.ts +11 -11
  19. package/src/AdaptableOptions/NotificationsOptions.d.ts +8 -0
  20. package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -2
  21. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +3 -3
  22. package/src/Api/AdaptableApi.d.ts +12 -12
  23. package/src/Api/ColumnApi.d.ts +10 -5
  24. package/src/Api/EventApi.d.ts +1 -1
  25. package/src/Api/Events/AdaptableReady.d.ts +3 -2
  26. package/src/Api/GridApi.d.ts +10 -10
  27. package/src/Api/Implementation/ColumnApiImpl.d.ts +4 -3
  28. package/src/Api/Implementation/ColumnApiImpl.js +11 -9
  29. package/src/Api/Implementation/ConfigApiImpl.js +0 -24
  30. package/src/Api/Implementation/GridApiImpl.d.ts +2 -2
  31. package/src/Api/Implementation/GridApiImpl.js +3 -4
  32. package/src/Api/Implementation/InternalApiImpl.d.ts +1 -1
  33. package/src/Api/Implementation/InternalApiImpl.js +2 -2
  34. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
  35. package/src/Api/Implementation/LayoutApiImpl.js +15 -0
  36. package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -2
  37. package/src/Api/Implementation/PluginsApiImpl.js +1 -1
  38. package/src/Api/Implementation/ScheduleApiImpl.js +6 -6
  39. package/src/Api/Implementation/ToolPanelApiImpl.js +1 -1
  40. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +3 -3
  41. package/src/Api/Implementation/UserInterfaceApiImpl.js +4 -4
  42. package/src/Api/InternalApi.d.ts +1 -1
  43. package/src/Api/LayoutApi.d.ts +7 -0
  44. package/src/Api/PluginsApi.d.ts +1 -7
  45. package/src/Api/TeamSharingApi.d.ts +1 -1
  46. package/src/Api/ThemeApi.d.ts +2 -2
  47. package/src/Api/UserInterfaceApi.d.ts +3 -3
  48. package/src/PredefinedConfig/AdaptableState.d.ts +2 -10
  49. package/src/PredefinedConfig/AlertState.d.ts +1 -1
  50. package/src/PredefinedConfig/ApplicationState.d.ts +1 -1
  51. package/src/PredefinedConfig/CalculatedColumnState.d.ts +1 -1
  52. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +3 -3
  53. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +4 -4
  54. package/src/PredefinedConfig/Common/AdaptableStyle.d.ts +7 -7
  55. package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
  56. package/src/PredefinedConfig/Common/Menu.d.ts +40 -17
  57. package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +1 -1
  58. package/src/PredefinedConfig/Common/Types.d.ts +5 -5
  59. package/src/PredefinedConfig/Common/Types.js +9 -7
  60. package/src/PredefinedConfig/ConditionalStyleState.d.ts +1 -1
  61. package/src/PredefinedConfig/CustomSortState.d.ts +1 -1
  62. package/src/PredefinedConfig/DataSourceState.d.ts +1 -1
  63. package/src/PredefinedConfig/ExportState.d.ts +3 -3
  64. package/src/PredefinedConfig/FilterState.d.ts +2 -2
  65. package/src/PredefinedConfig/FormatColumnState.d.ts +1 -1
  66. package/src/PredefinedConfig/FreeTextColumnState.d.ts +1 -1
  67. package/src/PredefinedConfig/LayoutState.d.ts +1 -1
  68. package/src/PredefinedConfig/PredefinedConfig.d.ts +0 -40
  69. package/src/PredefinedConfig/QuickSearchState.d.ts +3 -3
  70. package/src/PredefinedConfig/ScheduleState.d.ts +1 -1
  71. package/src/PredefinedConfig/ThemeState.d.ts +5 -1
  72. package/src/Redux/ActionsReducers/DashboardRedux.js +2 -1
  73. package/src/Redux/ActionsReducers/GridRedux.d.ts +3 -2
  74. package/src/Redux/ActionsReducers/GridRedux.js +2 -2
  75. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +12 -2
  76. package/src/Redux/ActionsReducers/LayoutRedux.js +24 -1
  77. package/src/Redux/DeadRedux.d.ts +4 -8
  78. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +6 -1
  79. package/src/Redux/Store/AdaptableStore.d.ts +3 -3
  80. package/src/Redux/Store/AdaptableStore.js +18 -13
  81. package/src/Strategy/AdaptableModuleBase.d.ts +2 -2
  82. package/src/Strategy/AlertModule.d.ts +2 -2
  83. package/src/Strategy/AlertModule.js +1 -94
  84. package/src/Strategy/BulkUpdateModule.d.ts +2 -2
  85. package/src/Strategy/BulkUpdateModule.js +4 -4
  86. package/src/Strategy/CellSummaryModule.d.ts +2 -2
  87. package/src/Strategy/DashboardModule.d.ts +2 -2
  88. package/src/Strategy/DataChangeHistoryModule.js +2 -2
  89. package/src/Strategy/ExportModule.d.ts +2 -2
  90. package/src/Strategy/FilterModule.d.ts +2 -2
  91. package/src/Strategy/FormatColumnModule.js +1 -1
  92. package/src/Strategy/GridInfoModule.d.ts +2 -2
  93. package/src/Strategy/Interface/IModule.d.ts +2 -2
  94. package/src/Strategy/LayoutModule.d.ts +2 -2
  95. package/src/Strategy/LayoutModule.js +21 -8
  96. package/src/Strategy/SmartEditModule.d.ts +2 -2
  97. package/src/Strategy/SmartEditModule.js +3 -4
  98. package/src/Strategy/SystemStatusModule.d.ts +2 -2
  99. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  100. package/src/Utilities/Constants/GeneralConstants.js +2 -1
  101. package/src/Utilities/Constants/ModuleConstants.d.ts +6 -6
  102. package/src/Utilities/Constants/ModuleConstants.js +7 -7
  103. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +8 -7
  104. package/src/Utilities/Helpers/PreviewHelper.js +2 -2
  105. package/src/Utilities/Interface/Preview.d.ts +2 -1
  106. package/src/Utilities/Services/LicenseService.js +16 -2
  107. package/src/Utilities/Services/ValidationService.js +1 -1
  108. package/src/View/AdaptableViewFactory.d.ts +2 -1
  109. package/src/View/AdaptableViewFactory.js +2 -0
  110. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +7 -7
  111. package/src/View/CellSummary/CellSummaryViewPanel.js +2 -2
  112. package/src/View/Components/FilterForm/FilterForm.js +5 -7
  113. package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +1 -1
  114. package/src/View/Components/FilterForm/ListBoxFilterForm.js +7 -7
  115. package/src/View/Components/FilterForm/QuickFilterForm.js +3 -5
  116. package/src/View/Components/Panels/FilterFormPanel.d.ts +1 -1
  117. package/src/View/Components/Panels/PanelWithImage.d.ts +423 -1
  118. package/src/View/Components/Popups/AdaptablePopupAlert.js +22 -9
  119. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -4
  120. package/src/View/Components/ToolPanel/ToolPanelPopup.js +2 -3
  121. package/src/View/CustomSort/CustomSortEntityRow.d.ts +3 -1
  122. package/src/View/CustomSort/CustomSortEntityRow.js +3 -3
  123. package/src/View/CustomSort/CustomSortPopup.js +1 -1
  124. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +1 -1
  125. package/src/View/Dashboard/Dashboard.js +3 -3
  126. package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +1 -1
  127. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +6 -5
  128. package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +6 -6
  129. package/src/View/Export/ExportViewPanel.js +6 -6
  130. package/src/View/GridInfo/GridOptionsComponent.js +1 -1
  131. package/src/View/Layout/LayoutViewPanel.js +2 -2
  132. package/src/View/Query/QueryViewPanel.js +1 -1
  133. package/src/View/QuickSearch/useQuickSearchDebounced.js +2 -3
  134. package/src/View/Schedule/SchedulePopup.js +3 -3
  135. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +1 -1
  136. package/src/View/SmartEdit/SmartEditPopup.js +1 -1
  137. package/src/View/StateManagement/StateManagementPopup.d.ts +2 -12
  138. package/src/View/StateManagement/StateManagementPopup.js +21 -114
  139. package/src/View/StateManagement/StateManagementViewPanel.d.ts +5 -0
  140. package/src/View/StateManagement/StateManagementViewPanel.js +22 -0
  141. package/src/View/StateManagement/components/ClearButton.d.ts +6 -0
  142. package/src/View/StateManagement/components/ClearButton.js +9 -0
  143. package/src/View/StateManagement/components/ExportDropdown.d.ts +8 -0
  144. package/src/View/StateManagement/components/ExportDropdown.js +43 -0
  145. package/src/View/StateManagement/components/LoadButton.d.ts +7 -0
  146. package/src/View/StateManagement/components/LoadButton.js +38 -0
  147. package/src/View/StateManagement/handleExportState.d.ts +1 -0
  148. package/src/View/StateManagement/handleExportState.js +22 -0
  149. package/src/View/Theme/ThemeViewPanel.js +1 -1
  150. package/src/agGrid/Adaptable.d.ts +9 -8
  151. package/src/agGrid/Adaptable.js +99 -78
  152. package/src/agGrid/agGridHelper.d.ts +4 -4
  153. package/src/agGrid/agGridHelper.js +15 -16
  154. package/src/agGrid/agGridMenuHelper.d.ts +15 -13
  155. package/src/agGrid/agGridMenuHelper.js +53 -45
  156. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.d.ts +1 -1
  157. package/src/agGrid/editors/AdaptableDateEditor/InternalAdaptableDateEditor.js +11 -6
  158. package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +3 -2
  159. package/src/agGrid/editors/AdaptableDateEditor/index.js +16 -6
  160. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +1 -0
  161. package/src/agGrid/editors/AdaptableNumberEditor/index.js +7 -2
  162. package/src/components/Datepicker/DatepickerContext.d.ts +2 -2
  163. package/src/components/Datepicker/index.js +9 -5
  164. package/src/components/Modal/index.d.ts +1 -1
  165. package/src/components/OverlayTrigger/index.js +3 -3
  166. package/src/components/OverlayTrigger/useAgGridClassName.d.ts +2 -0
  167. package/src/components/OverlayTrigger/{useVendorClassName.js → useAgGridClassName.js} +3 -3
  168. package/src/components/ProgressIndicator/ProgressIndicator.js +1 -1
  169. package/src/components/icons/index.js +2 -0
  170. package/src/components/icons/upload.d.ts +3 -0
  171. package/src/components/icons/upload.js +8 -0
  172. package/src/metamodel/adaptable.metamodel.d.ts +52 -37
  173. package/src/metamodel/adaptable.metamodel.js +261 -265
  174. package/src/types.d.ts +1 -1
  175. package/version.d.ts +1 -1
  176. package/version.js +1 -1
  177. package/src/PredefinedConfig/DeprecatedState.d.ts +0 -82
  178. package/src/PredefinedConfig/DeprecatedState.js +0 -5
  179. package/src/components/OverlayTrigger/useVendorClassName.d.ts +0 -2
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LayoutReducer = exports.LayoutReady = exports.LayoutUpdateCurrentDraft = exports.LayoutSelect = exports.LayoutSave = exports.LayoutDelete = exports.LayoutAdd = exports.LAYOUT_READY = exports.LAYOUT_UPDATE_CURRENT_DRAFT = exports.LAYOUT_SAVE = exports.LAYOUT_SELECT = exports.LAYOUT_DELETE = exports.LAYOUT_EDIT = exports.LAYOUT_ADD = void 0;
3
+ exports.LayoutReducer = exports.LayoutReady = exports.LayoutUpdateCurrentDraft = exports.LayoutSelect = exports.LayoutSetColumnCaption = exports.LayoutSave = exports.LayoutDelete = exports.LayoutAdd = exports.LAYOUT_READY = exports.LAYOUT_UPDATE_CURRENT_DRAFT = exports.LAYOUT_SET_COLUMN_CAPTION = exports.LAYOUT_SAVE = exports.LAYOUT_SELECT = exports.LAYOUT_DELETE = exports.LAYOUT_EDIT = exports.LAYOUT_ADD = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
6
6
  const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
@@ -24,6 +24,10 @@ exports.LAYOUT_SELECT = 'LAYOUT_SELECT';
24
24
  * @ReduxAction A Layout has been (auto)saved
25
25
  */
26
26
  exports.LAYOUT_SAVE = 'LAYOUT_SAVE';
27
+ /**
28
+ * @ReduxAction A new caption / header has been set for a Column in the Layout
29
+ */
30
+ exports.LAYOUT_SET_COLUMN_CAPTION = 'LAYOUT_SET_COLUMN_CAPTION';
27
31
  exports.LAYOUT_UPDATE_CURRENT_DRAFT = 'LAYOUT_UPDATE_CURRENT_DRAFT';
28
32
  /**
29
33
  * @ReduxAction Layout Module is ready
@@ -41,6 +45,12 @@ exports.LayoutSave = (layout) => ({
41
45
  type: exports.LAYOUT_SAVE,
42
46
  layout,
43
47
  });
48
+ exports.LayoutSetColumnCaption = (layoutName, columnId, caption) => ({
49
+ type: exports.LAYOUT_SET_COLUMN_CAPTION,
50
+ layoutName,
51
+ columnId,
52
+ caption,
53
+ });
44
54
  exports.LayoutSelect = (layoutName) => ({
45
55
  type: exports.LAYOUT_SELECT,
46
56
  layoutName,
@@ -83,6 +93,19 @@ exports.LayoutReducer = (state = initialState, action) => {
83
93
  const newLayouts = state.Layouts.filter((abObject) => abObject.Uuid !== actionLayout.Uuid);
84
94
  return Object.assign(Object.assign({}, state), { CurrentLayout: state.CurrentLayout === actionLayout.Name ? newLayouts[0].Name : state.CurrentLayout, Layouts: newLayouts });
85
95
  }
96
+ case exports.LAYOUT_SET_COLUMN_CAPTION: {
97
+ const setColumnCaptionAction = action;
98
+ const currentLayoutName = setColumnCaptionAction.layoutName;
99
+ let currentLayout = state.Layouts.find((l) => l.Name === currentLayoutName);
100
+ if (currentLayout) {
101
+ currentLayout.ColumnHeadersMap[setColumnCaptionAction.columnId] =
102
+ setColumnCaptionAction.caption;
103
+ return Object.assign({}, state, {
104
+ Layouts: state.Layouts.map((abObject) => abObject.Uuid === currentLayout.Uuid ? currentLayout : abObject),
105
+ });
106
+ }
107
+ return state;
108
+ }
86
109
  default:
87
110
  return state;
88
111
  }
@@ -1,25 +1,21 @@
1
1
  import * as Redux from 'redux';
2
- import { FlashingCellState } from '../PredefinedConfig/DeprecatedState';
3
- import { UpdatedRowState } from '../PredefinedConfig/DeprecatedState';
4
- import { PercentBarState } from '../PredefinedConfig/DeprecatedState';
5
- import { GradientColumnState } from '../PredefinedConfig/DeprecatedState';
6
2
  export declare const GRADIENT_COLUMN_CLEAR = "GRADIENT_COLUMN_CLEAR";
7
3
  export interface GradientColumnClearAction extends Redux.Action {
8
4
  }
9
5
  export declare const GradientColumnClear: () => GradientColumnClearAction;
10
- export declare const GradientColumnReducer: Redux.Reducer<GradientColumnState>;
6
+ export declare const GradientColumnReducer: Redux.Reducer<any>;
11
7
  export declare const PERCENT_BAR_CLEAR = "PERCENT_BAR_CLEAR";
12
8
  export interface PercentBarClearAction extends Redux.Action {
13
9
  }
14
10
  export declare const PercentBarClear: () => PercentBarClearAction;
15
- export declare const PercentBarReducer: Redux.Reducer<PercentBarState>;
11
+ export declare const PercentBarReducer: Redux.Reducer<any>;
16
12
  export declare const FLASHING_CELL_CLEAR = "FLASHING_CELL_CLEAR";
17
13
  export interface FlashingCellClearAction extends Redux.Action {
18
14
  }
19
15
  export declare const FlashingCellClear: () => FlashingCellClearAction;
20
- export declare const FlashingCellReducer: Redux.Reducer<FlashingCellState>;
16
+ export declare const FlashingCellReducer: Redux.Reducer<any>;
21
17
  export declare const UPDATED_ROW_CLEAR = "UPDATED_ROW_CLEAR";
22
18
  export interface UpdatedRowClearAction extends Redux.Action {
23
19
  }
24
20
  export declare const UpdatedRowClear: () => UpdatedRowClearAction;
25
- export declare const UpdatedRowReducer: Redux.Reducer<UpdatedRowState>;
21
+ export declare const UpdatedRowReducer: Redux.Reducer<any>;
@@ -83,6 +83,7 @@ class AdaptableReduxLocalStorageEngine {
83
83
  return this.saveNow(state, getState);
84
84
  }
85
85
  saveNow(state, getState) {
86
+ var _a;
86
87
  const config = {
87
88
  adaptableId: this.adaptableId,
88
89
  adaptableStateKey: this.adaptableStateKey,
@@ -92,7 +93,11 @@ class AdaptableReduxLocalStorageEngine {
92
93
  if (getState) {
93
94
  result = getState(state, config);
94
95
  }
95
- return (this.persistState || persistState)(result, config).catch(rejectWithMessage);
96
+ const promise = (_a = (this.persistState || persistState)(result, config)) === null || _a === void 0 ? void 0 : _a.catch(rejectWithMessage);
97
+ if (!(promise instanceof Promise)) {
98
+ LoggingHelper_1.ConsoleLogByMessageType('stateOptions.persistState should return a promise, it returned', 'Error', promise);
99
+ }
100
+ return promise;
96
101
  }
97
102
  }
98
103
  function rejectWithMessage(error) {
@@ -22,7 +22,7 @@ export declare const LoadState: (State: {
22
22
  [s: string]: ConfigState;
23
23
  }) => LoadStateAction;
24
24
  export declare class AdaptableStore implements IAdaptableStore {
25
- private isVendorReady;
25
+ private isAgGridReady;
26
26
  TheStore: Redux.Store<AdaptableState>;
27
27
  Load: Promise<any>;
28
28
  private emitter;
@@ -36,9 +36,9 @@ export declare class AdaptableStore implements IAdaptableStore {
36
36
  /**
37
37
  *
38
38
  * @param adaptable The Adaptable instance
39
- * @param isVendorReady A promise which is resolved when the underlying grid is ready for binding
39
+ * @param isAgGridReady A promise which is resolved when AG Grid is ready for binding
40
40
  */
41
- constructor(adaptable: IAdaptable, isVendorReady: Promise<any>);
41
+ constructor(adaptable: IAdaptable, isAgGridReady: Promise<any>);
42
42
  getCurrentStorageState(): AdaptableState;
43
43
  saveStateNow(adaptable: IAdaptable): Promise<any>;
44
44
  loadStore: (adaptable: IAdaptable, adaptableStateKey: string, predefinedConfig?: PredefinedConfig) => Promise<any>;
@@ -66,13 +66,13 @@ class AdaptableStore {
66
66
  /**
67
67
  *
68
68
  * @param adaptable The Adaptable instance
69
- * @param isVendorReady A promise which is resolved when the underlying grid is ready for binding
69
+ * @param isAgGridReady A promise which is resolved when AG Grid is ready for binding
70
70
  */
71
- constructor(adaptable, isVendorReady) {
71
+ constructor(adaptable, isAgGridReady) {
72
72
  /*
73
- This is the main store for Adaptable State
74
- */
75
- this.isVendorReady = isVendorReady;
73
+ This is the main store for Adaptable State
74
+ */
75
+ this.isAgGridReady = isAgGridReady;
76
76
  this.loadStorageInProgress = false;
77
77
  this.loadStateOnStartup = true; // set to false if you want no state
78
78
  this.on = (eventName, callback) => {
@@ -95,8 +95,8 @@ class AdaptableStore {
95
95
  this.TheStore.dispatch(exports.LoadState(adaptable.adaptableOptions.stateOptions.applyState(storedState)));
96
96
  }
97
97
  })
98
- // we need the vendor grid to be ready because several states(ex. Layout) depend on its API
99
- .then(() => this.isVendorReady)
98
+ // we need AG Grid to be ready because several states(ex. Layout) depend on its API
99
+ .then(() => this.isAgGridReady)
100
100
  .then(() => {
101
101
  this.TheStore.dispatch(exports.InitState());
102
102
  // END STATE LOAD
@@ -313,7 +313,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
313
313
  *******************/
314
314
  case SystemRedux.SYSTEM_FLASHING_ALERT_ADD:
315
315
  case SystemRedux.SYSTEM_FLASHING_ALERT_DELETE: {
316
- const { flashingAlert: FlashingAlert, } = action;
316
+ const { flashingAlert: FlashingAlert } = action;
317
317
  const { dataChangedInfo } = FlashingAlert;
318
318
  let ret = next(action);
319
319
  if (dataChangedInfo) {
@@ -682,13 +682,15 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
682
682
  case LayoutRedux.LAYOUT_EDIT:
683
683
  case LayoutRedux.LAYOUT_SAVE:
684
684
  case LayoutRedux.LAYOUT_DELETE:
685
+ case LayoutRedux.LAYOUT_SET_COLUMN_CAPTION:
685
686
  case LayoutRedux.LAYOUT_SELECT: {
686
687
  const oldLayoutState = middlewareAPI.getState().Layout;
687
688
  let returnAction = next(action);
688
689
  const newLayoutState = middlewareAPI.getState().Layout;
689
690
  adaptable.api.layoutApi.fireLayoutChangedEvent(action.type, oldLayoutState, newLayoutState);
690
691
  if (returnAction.type == LayoutRedux.LAYOUT_SELECT ||
691
- returnAction.type == LayoutRedux.LAYOUT_DELETE) {
692
+ returnAction.type == LayoutRedux.LAYOUT_DELETE ||
693
+ returnAction.type == LayoutRedux.LAYOUT_SET_COLUMN_CAPTION) {
692
694
  let gridState = middlewareAPI.getState().Grid;
693
695
  let currentLayout = newLayoutState.Layouts.find((l) => l.Name == newLayoutState.CurrentLayout);
694
696
  if (gridState.CurrentLayout) {
@@ -1049,7 +1051,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
1049
1051
  case TeamSharingRedux.TEAMSHARING_IMPORT_ITEM: {
1050
1052
  let returnAction = next(action);
1051
1053
  const actionTyped = action;
1052
- const [importStepActions, needsOverwriteConfirmation,] = adaptable.api.internalApi
1054
+ const [importStepActions, needsOverwriteConfirmation] = adaptable.api.internalApi
1053
1055
  .getTeamSharingService()
1054
1056
  .buildSharedEntityImportActions(actionTyped.SharedEntity);
1055
1057
  const processImportAction = TeamSharingRedux.TeamSharingProcessImport(importStepActions);
@@ -1122,14 +1124,14 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
1122
1124
  .getSharedEntities(adaptableId)
1123
1125
  .then((sharedEntities) => {
1124
1126
  // check if remote server has a newer revision
1125
- const [localRevision, remoteRevision,] = adaptable.api.internalApi
1127
+ const [localRevision, remoteRevision] = adaptable.api.internalApi
1126
1128
  .getTeamSharingService()
1127
1129
  .getSharedEntityLocalAndRemoteRevisions(ChangedAdaptableObject.Uuid, sharedEntities);
1128
1130
  if (remoteRevision > localRevision) {
1129
1131
  // if remote has a newer version, we will NOT overwrite it
1130
1132
  return;
1131
1133
  }
1132
- const [updatedSharedEntities, newActiveEntities,] = adaptable.api.internalApi
1134
+ const [updatedSharedEntities, newActiveEntities] = adaptable.api.internalApi
1133
1135
  .getTeamSharingService()
1134
1136
  .updateActiveSharedEntity(ChangedAdaptableObject, UserName, sharedEntities);
1135
1137
  middlewareAPI.dispatch(TeamSharingRedux.TeamSharingLinkItem(...newActiveEntities));
@@ -1195,7 +1197,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
1195
1197
  case GridRedux.GRID_REFRESH_CELLS: {
1196
1198
  const actionTyped = action;
1197
1199
  let ret = next(action);
1198
- adaptable.refreshCells(actionTyped.rows, actionTyped.columnIds, true);
1200
+ adaptable.refreshCells(actionTyped.rowNodes, actionTyped.columnIds, true);
1199
1201
  return ret;
1200
1202
  }
1201
1203
  case GridRedux.GRID_SET_SORT: {
@@ -1246,6 +1248,9 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
1246
1248
  *******************/
1247
1249
  case exports.INIT_STATE: {
1248
1250
  let returnAction = next(action);
1251
+ if (adaptable.isDestroyed) {
1252
+ return returnAction;
1253
+ }
1249
1254
  // make sure we have the grid columns in state, before we do any layout work
1250
1255
  adaptable.updateColumnsIntoStore();
1251
1256
  const layoutState = middlewareAPI.getState().Layout;
@@ -3,7 +3,7 @@ import { Action } from 'redux';
3
3
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
4
4
  import { ModuleParams } from '../View/Components/SharedProps/ModuleViewPopupProps';
5
5
  import { MenuItemShowPopup, MenuItemDoReduxAction, MenuItemDoClickFunction } from '../Utilities/MenuItem';
6
- import { AdaptableMenuItem, MenuContext } from '../PredefinedConfig/Common/Menu';
6
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
7
7
  import { AdaptableModule } from '../PredefinedConfig/Common/Types';
8
8
  import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
9
9
  import { AdaptableObject } from '../PredefinedConfig/Common/AdaptableObject';
@@ -33,7 +33,7 @@ export declare abstract class AdaptableModuleBase implements IModule {
33
33
  addModuleMenuItem(source: 'ModuleMenu' | 'ModuleButton'): AdaptableMenuItem | undefined;
34
34
  addModuleButtonMenuItem(): AdaptableMenuItem | undefined;
35
35
  addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
36
- addContextMenuItems(menuContext: MenuContext): AdaptableMenuItem[] | undefined;
36
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
37
37
  createMainMenuItemShowPopup({ Label, ComponentName, Icon, PopupParams, }: {
38
38
  Label: string;
39
39
  ComponentName: string;
@@ -2,7 +2,7 @@ import { AdaptableApi } from '../Api/AdaptableApi';
2
2
  import { AlertDefinition } from '../PredefinedConfig/AlertState';
3
3
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
4
4
  import { DataChangedInfo } from '../PredefinedConfig/Common/DataChangedInfo';
5
- import { AdaptableMenuItem, MenuContext } from '../PredefinedConfig/Common/Menu';
5
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
6
6
  import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
7
7
  import { AdaptableModuleBase } from './AdaptableModuleBase';
8
8
  import { IModule } from './Interface/IModule';
@@ -14,7 +14,7 @@ export declare class AlertModule extends AdaptableModuleBase implements IModule
14
14
  getReferencedNamedQueryNames(alertDefinition: AlertDefinition): string[];
15
15
  updateOldConfig(): void;
16
16
  addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
17
- addContextMenuItems(menuContext: MenuContext): AdaptableMenuItem[] | undefined;
17
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
18
18
  protected handleDataSourceChanged(dataChangedInfo: DataChangedInfo): void;
19
19
  private handleReactiveAlertTriggered;
20
20
  private showAlertForDefinitions;
@@ -63,7 +63,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
63
63
  return this.api.queryApi.getReferencedNamedQueryNames(queryExpression);
64
64
  }
65
65
  updateOldConfig() {
66
- var _a, _b, _c;
66
+ var _a, _b;
67
67
  /*
68
68
  Need to do 4 things here:
69
69
  1. Make all (new) Flashing Alerts have a Predicate if none exists
@@ -72,7 +72,6 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
72
72
  4. Convert old Updated Rows into Flashing Alerts
73
73
  */
74
74
  let oldAlertDefinitions = [];
75
- let newAlertDefinitions = [];
76
75
  // 1. Make all (new) Flashing Alerts have a Predicate if none exists
77
76
  (_a = this.api.alertApi
78
77
  .getAlertState()
@@ -98,98 +97,6 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
98
97
  oldAlertDefinitions.push(alertDefinition);
99
98
  }
100
99
  });
101
- // 3. Convert old Flashing Cells into Flashing Alerts
102
- let flashingCellState = this.api.internalApi.getState().FlashingCell;
103
- (_c = flashingCellState === null || flashingCellState === void 0 ? void 0 : flashingCellState.FlashingCells) === null || _c === void 0 ? void 0 : _c.forEach((flashingCell) => {
104
- if (flashingCell.IsLive) {
105
- let upColor = flashingCell.UpColor
106
- ? flashingCell.UpColor
107
- : flashingCellState.DefaultUpColor
108
- ? flashingCellState.DefaultUpColor
109
- : this.api.internalApi.getAdaptableOptions().notificationsOptions
110
- .flashingAlertDefaultProperties.UpChangeStyle.BackColor;
111
- let downColor = flashingCell.UpColor
112
- ? flashingCell.DownColor
113
- : flashingCellState.DefautDownColor
114
- ? flashingCellState.DefautDownColor
115
- : this.api.internalApi.getAdaptableOptions().notificationsOptions
116
- .flashingAlertDefaultProperties.DownChangeStyle.BackColor;
117
- let duration = flashingCell.FlashingCellDuration
118
- ? flashingCell.FlashingCellDuration
119
- : flashingCellState.DefaultDuration
120
- ? flashingCellState.DefaultDuration
121
- : this.api.internalApi.getAdaptableOptions().notificationsOptions
122
- .flashingAlertDefaultProperties.FlashDuration;
123
- let flashingAlertDefinition = {
124
- Rule: {
125
- Predicate: ANY_PREDICATE,
126
- },
127
- FlashTarget: 'cell',
128
- FlashDuration: duration,
129
- Scope: {
130
- ColumnIds: [flashingCell.ColumnId],
131
- },
132
- UpChangeStyle: {
133
- BackColor: upColor,
134
- },
135
- DownChangeStyle: {
136
- BackColor: downColor,
137
- },
138
- };
139
- // this.api.alertApi.addFlashingAlertDefinition(flashingAlertDefinition);
140
- newAlertDefinitions.push(flashingAlertDefinition);
141
- LoggingHelper_1.LogAdaptableWarning(`Updating incorrect Predefined Config for Flashing Alert: ${flashingCell.ColumnId}`);
142
- }
143
- });
144
- // 4. Convert old Updated Rows into Flashing Alerts
145
- let updatedRowState = this.api.internalApi.getState().UpdatedRow;
146
- if (updatedRowState === null || updatedRowState === void 0 ? void 0 : updatedRowState.EnableUpdatedRow) {
147
- let flashingAlertDefinition = {
148
- Rule: {
149
- Predicate: ANY_PREDICATE,
150
- },
151
- FlashTarget: 'row',
152
- Scope: {
153
- All: true,
154
- },
155
- };
156
- if (updatedRowState.Duration) {
157
- flashingAlertDefinition.FlashDuration =
158
- updatedRowState.Duration == 'Always' ? 'always' : updatedRowState.Duration;
159
- }
160
- else {
161
- flashingAlertDefinition.FlashDuration = 'always';
162
- }
163
- if (updatedRowState.UpColor) {
164
- flashingAlertDefinition.UpChangeStyle = {
165
- BackColor: updatedRowState.UpColor,
166
- };
167
- }
168
- else {
169
- flashingAlertDefinition.UpChangeStyle = undefined;
170
- }
171
- if (updatedRowState.DownColor) {
172
- flashingAlertDefinition.DownChangeStyle = {
173
- BackColor: updatedRowState.DownColor,
174
- };
175
- }
176
- else {
177
- flashingAlertDefinition.DownChangeStyle = undefined;
178
- }
179
- if (updatedRowState.NeutralColor) {
180
- flashingAlertDefinition.NeutralChangeStyle = {
181
- BackColor: updatedRowState.NeutralColor,
182
- };
183
- }
184
- else {
185
- flashingAlertDefinition.NeutralChangeStyle = undefined;
186
- }
187
- newAlertDefinitions.push(flashingAlertDefinition);
188
- }
189
- this.api.alertApi.addFlashingAlertDefinitions(newAlertDefinitions);
190
- this.api.alertApi.editFlashingAlertDefinitions(oldAlertDefinitions);
191
- this.api.internalApi.clearUpdatedRowState();
192
- this.api.internalApi.clearFlashingCellState();
193
100
  }
194
101
  addColumnMenuItems(column) {
195
102
  if (column && this.isModuleEditable()) {
@@ -1,12 +1,12 @@
1
1
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
2
  import { IBulkUpdateModule, BulkUpdateValidationResult } from './Interface/IBulkUpdateModule';
3
3
  import { PreviewInfo } from '../Utilities/Interface/Preview';
4
- import { AdaptableMenuItem, MenuContext } from '../PredefinedConfig/Common/Menu';
4
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
5
5
  import { AccessLevel, AdaptableApi } from '../types';
6
6
  export declare class BulkUpdateModule extends AdaptableModuleBase implements IBulkUpdateModule {
7
7
  constructor(api: AdaptableApi);
8
8
  getViewAccessLevel(): AccessLevel;
9
- addContextMenuItems(menuContext: MenuContext): AdaptableMenuItem[] | undefined;
9
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
10
10
  checkCorrectCellSelection(): BulkUpdateValidationResult;
11
11
  buildPreviewValues(bulkUpdateValue: any): PreviewInfo;
12
12
  }
@@ -99,12 +99,12 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
99
99
  return null;
100
100
  }
101
101
  let selectedCellInfo = this.api.gridApi.getSelectedCellInfo();
102
- let columnId = '';
102
+ let column;
103
103
  if (!this.api.internalApi.isGridInPivotMode()) {
104
104
  if (selectedCellInfo != null && selectedCellInfo.columns.length > 0) {
105
- columnId = selectedCellInfo.columns[0].columnId;
105
+ column = this.api.columnApi.getColumnFromId(selectedCellInfo.columns[0].columnId);
106
106
  let typedBulkUpdateValue;
107
- switch (selectedCellInfo.columns[0].dataType) {
107
+ switch (column.dataType) {
108
108
  case Enums_1.DataType.Number:
109
109
  typedBulkUpdateValue = Number(bulkUpdateValue);
110
110
  break;
@@ -139,7 +139,7 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
139
139
  }
140
140
  }
141
141
  return {
142
- columnId: columnId,
142
+ column: column,
143
143
  previewResults: previewResults,
144
144
  previewValidationSummary: PreviewHelper_1.PreviewHelper.GetPreviewValidationSummary(previewResults),
145
145
  };
@@ -1,13 +1,13 @@
1
1
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
2
  import { ICellSummaryModule } from './Interface/ICellSummaryModule';
3
3
  import { SelectedCellInfo } from '../PredefinedConfig/Selection/SelectedCellInfo';
4
- import { AdaptableMenuItem, MenuContext } from '../PredefinedConfig/Common/Menu';
4
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
5
5
  import { AdaptableApi } from '../Api/AdaptableApi';
6
6
  import { AccessLevel } from '../PredefinedConfig/Common/Entitlement';
7
7
  import { CellSummmary } from '../PredefinedConfig/Common/CellSummary';
8
8
  export declare class CellSummaryModule extends AdaptableModuleBase implements ICellSummaryModule {
9
9
  constructor(api: AdaptableApi);
10
10
  getViewAccessLevel(): AccessLevel;
11
- addContextMenuItems(menuContext: MenuContext): AdaptableMenuItem[] | undefined;
11
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
12
12
  createCellSummary(selectedCellInfo: SelectedCellInfo): CellSummmary;
13
13
  }
@@ -1,5 +1,5 @@
1
1
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
- import { AdaptableMenuItem, MenuContext } from '../PredefinedConfig/Common/Menu';
2
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
3
3
  import { IModule } from './Interface/IModule';
4
4
  import { AdaptableApi } from '../Api/AdaptableApi';
5
5
  export declare class DashboardModule extends AdaptableModuleBase implements IModule {
@@ -8,6 +8,6 @@ export declare class DashboardModule extends AdaptableModuleBase implements IMod
8
8
  updateOldConfig(): void;
9
9
  handleAdaptableReady(): void;
10
10
  addColumnMenuItems(): AdaptableMenuItem[] | undefined;
11
- addContextMenuItems(menuContext: MenuContext): AdaptableMenuItem[] | undefined;
11
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
12
12
  private buildMenuItems;
13
13
  }
@@ -27,10 +27,10 @@ class DataChangeHistoryModule extends AdaptableModuleBase_1.AdaptableModuleBase
27
27
  if (this.api.internalApi.getState().System.DataChangeHistory.currentMode !== 'ACTIVE') {
28
28
  return false;
29
29
  }
30
- if (this.api.internalApi.getAdaptableOptions().dataChangeHistoryOptions.filterDataChange) {
30
+ if (this.api.internalApi.getAdaptableOptions().dataChangeHistoryOptions.showDataChange) {
31
31
  return this.api.internalApi
32
32
  .getAdaptableOptions()
33
- .dataChangeHistoryOptions.filterDataChange(dataChangedInfo);
33
+ .dataChangeHistoryOptions.showDataChange(dataChangedInfo);
34
34
  }
35
35
  return true;
36
36
  }
@@ -3,7 +3,7 @@ import { IExportModule } from './Interface/IExportModule';
3
3
  import { ExportDestination } from '../PredefinedConfig/Common/Enums';
4
4
  import { Report } from '../PredefinedConfig/ExportState';
5
5
  import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
6
- import { AdaptableMenuItem, MenuContext } from '../PredefinedConfig/Common/Menu';
6
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
7
7
  import { AdaptableApi } from '../Api/AdaptableApi';
8
8
  import { AdaptableObject } from '../PredefinedConfig/Common/AdaptableObject';
9
9
  export declare class ExportModule extends AdaptableModuleBase implements IExportModule {
@@ -12,7 +12,7 @@ export declare class ExportModule extends AdaptableModuleBase implements IExport
12
12
  getExplicitlyReferencedColumnIds(report: Report): string[];
13
13
  getReferencedNamedQueryNames(report: Report): string[];
14
14
  updateOldConfig(): void;
15
- addContextMenuItems(menuContext: MenuContext): AdaptableMenuItem[] | undefined;
15
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
16
16
  export(report: Report, exportDestination: ExportDestination | string): void;
17
17
  private isCustomDestination;
18
18
  private convertReportToJSON;
@@ -1,6 +1,6 @@
1
1
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
2
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
3
- import { AdaptableMenuItem, MenuContext } from '../PredefinedConfig/Common/Menu';
3
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
4
4
  import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
5
5
  import { ColumnFilter } from '../PredefinedConfig/FilterState';
6
6
  import { IModule } from './Interface/IModule';
@@ -12,7 +12,7 @@ export declare class FilterModule extends AdaptableModuleBase implements IModule
12
12
  getExplicitlyReferencedColumnIds(columnFilter: ColumnFilter): string[];
13
13
  hasNamedQueryReferences(): boolean;
14
14
  handleAdaptableReady(): void;
15
- addContextMenuItems(menuContext: MenuContext): AdaptableMenuItem[] | undefined;
15
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
16
16
  addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
17
17
  getTeamSharingAction(): TeamSharingImportInfo<ColumnFilter>;
18
18
  }
@@ -133,7 +133,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
133
133
  if (formatColumn) {
134
134
  return formatColumn;
135
135
  }
136
- // special columns (CalculatedColumn & FreeTextColumns) are not yet part of the underlying AG-Grid colDefs
136
+ // special columns (Calculated, FreeText, Action) are not yet part of AG-GridS colDefs
137
137
  // so we have to check if the given columnId is a special column
138
138
  const isSpecialColumn = !!this.api.calculatedColumnApi.getCalculatedColumnForColumnId(columnId) ||
139
139
  !!this.api.freeTextColumnApi.getFreeTextColumnById(columnId);
@@ -1,5 +1,5 @@
1
1
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
- import { AdaptableMenuItem, MenuContext } from '../PredefinedConfig/Common/Menu';
2
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
3
3
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
4
4
  import { IModule } from './Interface/IModule';
5
5
  import { AdaptableApi } from '../Api/AdaptableApi';
@@ -8,5 +8,5 @@ export declare class GridInfoModule extends AdaptableModuleBase implements IModu
8
8
  constructor(api: AdaptableApi);
9
9
  getViewAccessLevel(): AccessLevel;
10
10
  addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
11
- addContextMenuItems(menuContext: MenuContext): AdaptableMenuItem[] | undefined;
11
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
12
12
  }
@@ -1,5 +1,5 @@
1
1
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
2
- import { AdaptableMenuItem, MenuContext } from '../../PredefinedConfig/Common/Menu';
2
+ import { AdaptableMenuItem, ContextMenuContext } from '../../PredefinedConfig/Common/Menu';
3
3
  import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
4
4
  import { TeamSharingImportInfo } from '../../PredefinedConfig/TeamSharingState';
5
5
  import { AdaptableObject } from '../../PredefinedConfig/Common/AdaptableObject';
@@ -35,7 +35,7 @@ export interface IModule {
35
35
  AccessLevel: AccessLevel;
36
36
  addModuleMenuItem(source: 'ModuleMenu' | 'ModuleButton'): AdaptableMenuItem | undefined;
37
37
  addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
38
- addContextMenuItems(menuContext: MenuContext): AdaptableMenuItem[] | undefined;
38
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
39
39
  setModuleEntitlement(): void;
40
40
  isModuleAvailable(): boolean;
41
41
  isModuleEditable(): boolean;
@@ -1,6 +1,6 @@
1
1
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
2
  import { LayoutState, Layout } from '../PredefinedConfig/LayoutState';
3
- import { AdaptableMenuItem, MenuContext } from '../PredefinedConfig/Common/Menu';
3
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
4
4
  import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
5
5
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
6
6
  import { AdaptableApi } from '../Api/AdaptableApi';
@@ -14,6 +14,6 @@ export declare class LayoutModule extends AdaptableModuleBase implements IModule
14
14
  hasNamedQueryReferences(): boolean;
15
15
  handleAdaptableReady(): void;
16
16
  addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
17
- addContextMenuItems(menuContext: MenuContext): AdaptableMenuItem[] | undefined;
17
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
18
18
  getTeamSharingAction(): TeamSharingImportInfo<Layout>;
19
19
  }
@@ -38,15 +38,28 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
38
38
  addColumnMenuItems(column) {
39
39
  let returnColumnMenuItems = [];
40
40
  if (this.isModuleEditable()) {
41
- returnColumnMenuItems.push(this.createColumnMenuItemShowPopup('Edit Layout', this.moduleInfo.Popup, this.moduleInfo.Glyph, {
42
- action: 'Edit',
43
- source: 'ColumnMenu',
44
- }));
45
- if (column && column.hideable) {
46
- returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Hide Column', 'hide-column', () => {
47
- this.api.columnApi.hideColumn(column.columnId);
41
+ const isReadOnlyLayout = this.api.layoutApi.isCurrentLayoutReadOnly();
42
+ if (!isReadOnlyLayout) {
43
+ returnColumnMenuItems.push(this.createColumnMenuItemShowPopup('Edit Layout', this.moduleInfo.Popup, this.moduleInfo.Glyph, {
44
+ action: 'Edit',
45
+ source: 'ColumnMenu',
48
46
  }));
49
47
  }
48
+ if (column) {
49
+ if (!isReadOnlyLayout) {
50
+ returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Change Caption', 'edit', () => {
51
+ let newname = prompt('Enter a new Caption for the Column');
52
+ if (newname) {
53
+ this.api.layoutApi.setColumnCaption(column.columnId, newname);
54
+ }
55
+ }));
56
+ }
57
+ if (column.hideable) {
58
+ returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Hide Column', 'hide-column', () => {
59
+ this.api.columnApi.hideColumn(column.columnId);
60
+ }));
61
+ }
62
+ }
50
63
  let selectMenuItems = [];
51
64
  if (column) {
52
65
  selectMenuItems.push(this.createColumnMenuItemClickFunction('Column', 'column-chooser', () => {
@@ -67,7 +80,7 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
67
80
  }
68
81
  addContextMenuItems(menuContext) {
69
82
  let returnColumnMenuItems = [];
70
- if (this.isModuleEditable()) {
83
+ if (this.isModuleEditable() && !this.api.layoutApi.isCurrentLayoutReadOnly()) {
71
84
  returnColumnMenuItems.push(this.createColumnMenuItemShowPopup('Edit Layout', this.moduleInfo.Popup, this.moduleInfo.Glyph, {
72
85
  action: 'Edit',
73
86
  source: 'ColumnMenu',
@@ -4,13 +4,13 @@ import { IModuleActionReturn } from './Interface/IModuleActionReturn';
4
4
  import { ISmartEditModule } from './Interface/ISmartEditModule';
5
5
  import { PreviewInfo } from '../Utilities/Interface/Preview';
6
6
  import { GridCell } from '../PredefinedConfig/Selection/GridCell';
7
- import { AdaptableMenuItem, MenuContext } from '../PredefinedConfig/Common/Menu';
7
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
8
8
  import { AdaptableApi } from '../Api/AdaptableApi';
9
9
  import { AccessLevel } from '../PredefinedConfig/Common/Entitlement';
10
10
  export declare class SmartEditModule extends AdaptableModuleBase implements ISmartEditModule {
11
11
  constructor(api: AdaptableApi);
12
12
  getViewAccessLevel(): AccessLevel;
13
- addContextMenuItems(menuContext: MenuContext): AdaptableMenuItem[] | undefined;
13
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
14
14
  ApplySmartEdit(newValues: GridCell[]): void;
15
15
  CheckCorrectCellSelection(): IModuleActionReturn<boolean>;
16
16
  BuildPreviewValues(smartEditValue: number, smartEditOperation: MathOperation): PreviewInfo;