@adaptabletools/adaptable 22.1.0 → 22.1.1-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/index.css +8 -9
  2. package/package.json +1 -1
  3. package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -2
  4. package/src/AdaptableOptions/AdaptableOptions.d.ts +2 -21
  5. package/src/AdaptableOptions/AlertOptions.d.ts +0 -5
  6. package/src/AdaptableOptions/CellSummaryOptions.d.ts +2 -0
  7. package/src/AdaptableOptions/ChartingOptions.d.ts +2 -0
  8. package/src/AdaptableOptions/ColumnOptions.d.ts +0 -2
  9. package/src/AdaptableOptions/CommentOptions.d.ts +6 -0
  10. package/src/AdaptableOptions/ContainerOptions.d.ts +0 -6
  11. package/src/AdaptableOptions/DashboardOptions.d.ts +0 -2
  12. package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +0 -2
  13. package/src/AdaptableOptions/DataSetOptions.d.ts +2 -0
  14. package/src/AdaptableOptions/DefaultAdaptableOptions.js +35 -3
  15. package/src/AdaptableOptions/EditOptions.d.ts +0 -1
  16. package/src/AdaptableOptions/EntitlementOptions.d.ts +0 -2
  17. package/src/AdaptableOptions/ExportOptions.d.ts +1 -7
  18. package/src/AdaptableOptions/ExpressionOptions.d.ts +0 -18
  19. package/src/AdaptableOptions/Fdc3Options.d.ts +5 -1
  20. package/src/AdaptableOptions/FilterOptions.d.ts +3 -18
  21. package/src/AdaptableOptions/NoteOptions.d.ts +6 -0
  22. package/src/AdaptableOptions/NotificationsOptions.d.ts +0 -10
  23. package/src/AdaptableOptions/PredicateOptions.d.ts +12 -1
  24. package/src/AdaptableOptions/QuickSearchOptions.d.ts +0 -4
  25. package/src/AdaptableOptions/SettingsPanelOptions.d.ts +15 -5
  26. package/src/AdaptableOptions/TeamSharingOptions.d.ts +0 -4
  27. package/src/AdaptableOptions/ToolPanelOptions.d.ts +0 -1
  28. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +6 -7
  29. package/src/AdaptableState/Common/AdaptableFormat.d.ts +9 -0
  30. package/src/AdaptableState/Common/AdaptableFormatPresets.d.ts +31 -0
  31. package/src/AdaptableState/Common/AdaptableFormatPresets.js +181 -0
  32. package/src/AdaptableState/Common/Menu.d.ts +1 -1
  33. package/src/AdaptableState/Common/Menu.js +2 -0
  34. package/src/AdaptableState/FormatColumnState.d.ts +6 -3
  35. package/src/Api/EventApi.d.ts +6 -6
  36. package/src/Api/Implementation/EntitlementApiImpl.js +5 -4
  37. package/src/Api/Implementation/FormatColumnApiImpl.js +8 -3
  38. package/src/Api/Implementation/GridApiImpl.js +1 -12
  39. package/src/Api/Internal/FormatColumnInternalApi.js +4 -2
  40. package/src/Api/Internal/LayoutInternalApi.js +5 -2
  41. package/src/Redux/Store/AdaptableStore.js +4 -4
  42. package/src/Strategy/AdaptableModuleBase.js +8 -7
  43. package/src/Strategy/AlertModule.d.ts +1 -1
  44. package/src/Strategy/BulkUpdateModule.d.ts +1 -1
  45. package/src/Strategy/BulkUpdateModule.js +2 -1
  46. package/src/Strategy/CalculatedColumnModule.d.ts +1 -1
  47. package/src/Strategy/CellSummaryModule.d.ts +1 -1
  48. package/src/Strategy/CellSummaryModule.js +2 -1
  49. package/src/Strategy/ColumnFilterModule.js +2 -1
  50. package/src/Strategy/ColumnInfoModule.d.ts +1 -1
  51. package/src/Strategy/ColumnInfoModule.js +2 -1
  52. package/src/Strategy/CommentModule.d.ts +1 -1
  53. package/src/Strategy/CommentModule.js +12 -2
  54. package/src/Strategy/ExportModule.d.ts +1 -1
  55. package/src/Strategy/Fdc3Module.d.ts +1 -1
  56. package/src/Strategy/FlashingCellModule.d.ts +1 -1
  57. package/src/Strategy/GridFilterModule.js +2 -1
  58. package/src/Strategy/GridInfoModule.d.ts +1 -1
  59. package/src/Strategy/GridInfoModule.js +2 -1
  60. package/src/Strategy/LayoutModule.d.ts +1 -1
  61. package/src/Strategy/NamedQueryModule.js +0 -16
  62. package/src/Strategy/NoteModule.d.ts +1 -1
  63. package/src/Strategy/NoteModule.js +16 -3
  64. package/src/Strategy/PlusMinusModule.js +8 -2
  65. package/src/Strategy/ScheduleModule.js +5 -4
  66. package/src/Strategy/SettingsPanelModule.d.ts +1 -1
  67. package/src/Strategy/ShortcutModule.js +5 -4
  68. package/src/Strategy/SmartEditModule.d.ts +1 -1
  69. package/src/Strategy/SmartEditModule.js +4 -4
  70. package/src/Strategy/SystemStatusModule.d.ts +1 -1
  71. package/src/Utilities/Constants/GeneralConstants.d.ts +4 -0
  72. package/src/Utilities/Constants/GeneralConstants.js +4 -0
  73. package/src/Utilities/Extensions/NumberExtensions.d.ts +2 -0
  74. package/src/Utilities/Extensions/NumberExtensions.js +8 -0
  75. package/src/Utilities/Helpers/AdaptableHelper.js +3 -2
  76. package/src/Utilities/Helpers/FormatHelper.js +26 -15
  77. package/src/Utilities/Services/AnnotationsService.js +10 -1
  78. package/src/Utilities/Services/Interface/IMetamodelService.d.ts +0 -1
  79. package/src/Utilities/Services/MetamodelService.d.ts +0 -2
  80. package/src/Utilities/Services/MetamodelService.js +6 -12
  81. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +7 -6
  82. package/src/View/Alert/AlertEmptyView.js +2 -1
  83. package/src/View/BulkUpdate/BulkUpdateViewPanel.js +1 -1
  84. package/src/View/CellSummary/CellSummaryViewPanel.js +2 -1
  85. package/src/View/Comments/CommentsEditor.js +2 -1
  86. package/src/View/Comments/CommentsPopup.js +3 -1
  87. package/src/View/Components/Buttons/ButtonBase/index.js +3 -2
  88. package/src/View/Components/Buttons/EntityListActionButtons.js +7 -6
  89. package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.js +2 -1
  90. package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +3 -2
  91. package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +3 -1
  92. package/src/View/Components/Panels/PanelDashboard/index.js +2 -1
  93. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +4 -2
  94. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +2 -1
  95. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -2
  96. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +2 -1
  97. package/src/View/Dashboard/CustomDashboardButton.js +3 -2
  98. package/src/View/Dashboard/Dashboard.js +3 -2
  99. package/src/View/Dashboard/DashboardPopup.js +3 -2
  100. package/src/View/Dashboard/PinnedToolbarsSelector.js +2 -1
  101. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +2 -1
  102. package/src/View/Export/ExportViewPanel.js +3 -1
  103. package/src/View/Filter/FilterViewPanel.js +2 -1
  104. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +137 -181
  105. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +20 -8
  106. package/src/View/GridFilter/GridFilterPopupUI/index.d.ts +3 -2
  107. package/src/View/GridFilter/GridFilterPopupUI/index.js +2 -1
  108. package/src/View/GridFilter/GridFilterViewPanel.js +3 -2
  109. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +179 -6
  110. package/src/View/Layout/LayoutCloneButton.js +2 -1
  111. package/src/View/Layout/LayoutViewPanel.js +3 -1
  112. package/src/View/Layout/TransposedPopup.js +2 -1
  113. package/src/View/Note/NotePopup.js +3 -1
  114. package/src/View/SmartEdit/SmartEditViewPanel.js +2 -1
  115. package/src/View/StateManagement/StateManagementViewPanel.js +3 -1
  116. package/src/View/StatusBar/StatusBarPopup.js +2 -1
  117. package/src/View/Theme/ThemeEditor.js +2 -1
  118. package/src/View/Theme/ThemePopup.js +2 -1
  119. package/src/View/Theme/ThemeSelector.js +3 -1
  120. package/src/View/Theme/ThemeViewPanel.js +3 -1
  121. package/src/View/Wizard/OnePageWizards.js +3 -2
  122. package/src/agGrid/AdaptableAgGrid.d.ts +2 -2
  123. package/src/agGrid/AdaptableAgGrid.js +7 -29
  124. package/src/agGrid/AgGridAdapter.js +2 -2
  125. package/src/agGrid/AgGridColumnAdapter.js +11 -4
  126. package/src/agGrid/AgGridExportAdapter.js +4 -2
  127. package/src/agGrid/cellRenderers/ActionColumnRenderer.js +2 -1
  128. package/src/components/Dashboard/Dashboard.js +2 -1
  129. package/src/components/Dashboard/DashboardToolbar.js +2 -1
  130. package/src/components/Datepicker/index.js +2 -1
  131. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +1 -1
  132. package/src/components/Select/Select.js +5 -4
  133. package/src/components/SimpleButton/index.js +3 -2
  134. package/src/env.js +2 -2
  135. package/src/metamodel/adaptable-metamodel-model.d.ts +0 -2
  136. package/src/metamodel/adaptable.metamodel.d.ts +10 -197
  137. package/src/metamodel/adaptable.metamodel.js +1 -1
  138. package/src/types.d.ts +2 -0
  139. package/src/types.js +1 -0
  140. package/themes/dark.css +3 -1
  141. package/tsconfig.esm.tsbuildinfo +1 -1
  142. package/index.css.map +0 -1
@@ -98,7 +98,16 @@ export class AnnotationsService {
98
98
  }
99
99
  const cellNote = this.api.noteApi.getNoteForCell(cellPosition);
100
100
  const cellComments = this.api.commentApi.getCommentThreadForCell(cellPosition);
101
- if (!cellNote && !cellComments) {
101
+ // Notes / Comments only open on hover when explicitly opted in via
102
+ // `noteOptions.openNote = 'hover'` / `commentOptions.showComment =
103
+ // 'hover'` (the defaults). When either is set to 'menu' the popup is
104
+ // only opened via the Cell Menu, so we ignore that side of the
105
+ // annotation when deciding whether to show the popup here.
106
+ const openNoteMode = this.api.optionsApi.getNoteOptions()?.showNoteAction ?? 'hover';
107
+ const showCommentMode = this.api.optionsApi.getCommentOptions()?.showCommentAction ?? 'hover';
108
+ const shouldOpenForNote = !!cellNote && openNoteMode === 'hover';
109
+ const shouldOpenForComment = !!cellComments && showCommentMode === 'hover';
110
+ if (!shouldOpenForNote && !shouldOpenForComment) {
102
111
  return;
103
112
  }
104
113
  this.showPopup(cellPosition, false);
@@ -15,7 +15,6 @@ export interface GridInfoOption {
15
15
  }
16
16
  export interface IMetamodelService extends IAdaptableService {
17
17
  getAdaptableOptions: () => AdaptableOptions;
18
- getGridInfoOptions(): GridInfoOptions;
19
18
  getGridInfoNoCodeOptions(): GridInfoOptions;
20
19
  validateAdaptableOptionsValues(): void;
21
20
  }
@@ -1,10 +1,8 @@
1
1
  import { GridInfoOptions, IMetamodelService } from './Interface/IMetamodelService';
2
2
  import { AdaptableOptions } from '../../../types';
3
3
  export declare class MetamodelService implements IMetamodelService {
4
- private gridInfoOptions;
5
4
  getAdaptableOptions: () => AdaptableOptions;
6
5
  constructor(getAdaptableOptions: () => AdaptableOptions, validateOptions?: boolean);
7
- getGridInfoOptions(): GridInfoOptions;
8
6
  getGridInfoNoCodeOptions(): GridInfoOptions;
9
7
  validateAdaptableOptionsValues(): void;
10
8
  private validateOptionsObject;
@@ -5,23 +5,16 @@ import { AdaptableLogger } from '../../agGrid/AdaptableLogger';
5
5
  import { getDefaultAdaptableOptions } from '../../AdaptableOptions/DefaultAdaptableOptions';
6
6
  const supportedMetamodelTypes = ['s', 'n', 'b', 'a', 'f', 'R'];
7
7
  export class MetamodelService {
8
- gridInfoOptions = new Map();
9
8
  getAdaptableOptions = () => null;
10
9
  constructor(getAdaptableOptions, validateOptions) {
11
10
  this.getAdaptableOptions = getAdaptableOptions;
12
- this.gridInfoOptions = this.buildGridInfoOptions();
13
11
  if (validateOptions) {
14
12
  this.validateAdaptableOptionsValues();
15
13
  }
16
14
  }
17
- getGridInfoOptions() {
18
- return this.gridInfoOptions;
19
- }
20
15
  getGridInfoNoCodeOptions() {
21
16
  return this.buildGridInfoOptions({
22
- filterItemProperty: (itemProperty) => {
23
- return itemProperty.nC === 'item';
24
- },
17
+ filterItemProperty: (itemProperty) => itemProperty.nC === 'item',
25
18
  filterEmptyAdaptableOptions: false,
26
19
  });
27
20
  }
@@ -89,7 +82,7 @@ export class MetamodelService {
89
82
  }
90
83
  }
91
84
  buildGridInfoOptions(options) {
92
- const { filterItemProperty, filterEmptyAdaptableOptions = true } = options || {};
85
+ const { filterItemProperty, filterEmptyAdaptableOptions = true } = options;
93
86
  const gridInfoOptions = new Map();
94
87
  const adaptableMetamodel = this.getAdaptableMetamodel();
95
88
  const adaptableOptionsMetamodel = this.getAdaptableOptionsMetamodel();
@@ -105,9 +98,10 @@ export class MetamodelService {
105
98
  containerLabel: 'Base Options',
106
99
  items: baseOptionsItems,
107
100
  });
108
- // map containers
101
+ // map containers — any top-level property that points to another
102
+ // metamodel item (k === 'R') is a nested *Options object
109
103
  adaptableOptionsMetamodel.p
110
- .filter((optionItem) => optionItem.g === 'container')
104
+ .filter((optionItem) => optionItem.k === 'R')
111
105
  .forEach((containerOptionItem) => {
112
106
  const containerMetamodelName = containerOptionItem.r;
113
107
  const adaptableOptionsName = containerOptionItem.n;
@@ -130,7 +124,7 @@ export class MetamodelService {
130
124
  });
131
125
  return gridInfoOptions;
132
126
  }
133
- mapGridInfoContainerItems(optionItemContainer, adaptableOptionsValues, defaultAdaptableOptionsValues, filter = (itemProperty) => itemProperty.g === 'item') {
127
+ mapGridInfoContainerItems(optionItemContainer, adaptableOptionsValues, defaultAdaptableOptionsValues, filter) {
134
128
  return optionItemContainer.p.filter(filter).map((itemProperty) => {
135
129
  return {
136
130
  name: itemProperty.n,
@@ -3,6 +3,7 @@ import HelpBlock from '../../../components/HelpBlock';
3
3
  import { ALL_MODULES } from '../../../AdaptableState/Common/Types';
4
4
  import Radio from '../../../components/Radio';
5
5
  import FormLayout, { FormRow } from '../../../components/FormLayout';
6
+ import { ACCESS_LEVEL_FULL, ACCESS_LEVEL_HIDDEN, ACCESS_LEVEL_READ_ONLY, } from '../../../Utilities/Constants/GeneralConstants';
6
7
  import { ADAPTABLE_MODULE_MAP } from '../../../Utilities/Constants/ModuleConstants';
7
8
  import { DataSource, InfiniteTableGrid, } from '../../../components/InfiniteTable';
8
9
  import { Box, Flex } from '../../../components/Flex';
@@ -78,7 +79,7 @@ const EntitlementsListForm = (props) => {
78
79
  render: (params) => {
79
80
  const module = params.data.name;
80
81
  const accessLevel = entitlementsMap[module];
81
- return (React.createElement(Radio, { onClick: () => handleOnChange(module, 'Full'), checked: accessLevel === 'Full' }));
82
+ return (React.createElement(Radio, { onClick: () => handleOnChange(module, ACCESS_LEVEL_FULL), checked: accessLevel === ACCESS_LEVEL_FULL }));
82
83
  },
83
84
  },
84
85
  readonly: {
@@ -86,7 +87,7 @@ const EntitlementsListForm = (props) => {
86
87
  render: (params) => {
87
88
  const module = params.data.name;
88
89
  const accessLevel = entitlementsMap[module];
89
- return (React.createElement(Radio, { onClick: () => handleOnChange(module, 'ReadOnly'), checked: accessLevel === 'ReadOnly' }));
90
+ return (React.createElement(Radio, { onClick: () => handleOnChange(module, ACCESS_LEVEL_READ_ONLY), checked: accessLevel === ACCESS_LEVEL_READ_ONLY }));
90
91
  },
91
92
  },
92
93
  hidden: {
@@ -94,7 +95,7 @@ const EntitlementsListForm = (props) => {
94
95
  render: (params) => {
95
96
  const module = params.data.name;
96
97
  const accessLevel = entitlementsMap[module];
97
- return (React.createElement(Radio, { onClick: () => handleOnChange(module, 'Hidden'), checked: accessLevel === 'Hidden' }));
98
+ return (React.createElement(Radio, { onClick: () => handleOnChange(module, ACCESS_LEVEL_HIDDEN), checked: accessLevel === ACCESS_LEVEL_HIDDEN }));
98
99
  },
99
100
  },
100
101
  };
@@ -126,9 +127,9 @@ const DefaultEntitlementForm = (props) => {
126
127
  }, [abOptions?.entitlementOptions?.defaultAccessLevel]);
127
128
  return (React.createElement(FormLayout, { className: "twa:mb-2" },
128
129
  React.createElement(FormRow, { label: "Default Entitlement:" },
129
- React.createElement(Radio, { onClick: () => handleDefaultEntitlementChange('Full'), checked: defaultEntitlement === 'Full', className: "twa:mr-3" }, "Visible"),
130
- React.createElement(Radio, { onClick: () => handleDefaultEntitlementChange('ReadOnly'), checked: defaultEntitlement === 'ReadOnly', className: "twa:mr-3" }, "Read Only"),
131
- React.createElement(Radio, { onClick: () => handleDefaultEntitlementChange('Hidden'), checked: defaultEntitlement === 'Hidden' }, "Hidden"))));
130
+ React.createElement(Radio, { onClick: () => handleDefaultEntitlementChange(ACCESS_LEVEL_FULL), checked: defaultEntitlement === ACCESS_LEVEL_FULL, className: "twa:mr-3" }, "Visible"),
131
+ React.createElement(Radio, { onClick: () => handleDefaultEntitlementChange(ACCESS_LEVEL_READ_ONLY), checked: defaultEntitlement === ACCESS_LEVEL_READ_ONLY, className: "twa:mr-3" }, "Read Only"),
132
+ React.createElement(Radio, { onClick: () => handleDefaultEntitlementChange(ACCESS_LEVEL_HIDDEN), checked: defaultEntitlement === ACCESS_LEVEL_HIDDEN }, "Hidden"))));
132
133
  };
133
134
  const EntitlementsForm = (props) => {
134
135
  let abOptions = props.adaptableOptions;
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
+ import { ACCESS_LEVEL_READ_ONLY } from '../../Utilities/Constants/GeneralConstants';
2
3
  import { useAdaptable } from '../AdaptableContext';
3
4
  export const AlertEmptyView = (props) => {
4
5
  const adaptable = useAdaptable();
5
6
  const accessLevel = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
6
- const text = accessLevel == 'ReadOnly'
7
+ const text = accessLevel == ACCESS_LEVEL_READ_ONLY
7
8
  ? 'You have no Alert Definitions.'
8
9
  : "Click 'New' to create a new Alert Definition - this will include the Rule which triggers the Alert, and the behaviour of the Alert.";
9
10
  return React.createElement(React.Fragment, null, text);
@@ -38,7 +38,7 @@ class BulkUpdateViewPanelComponent extends React.Component {
38
38
  let statusColour = this.getStatusColour();
39
39
  let selectedColumn = this.props.BulkUpdateValidationResult.Column;
40
40
  let previewPanel = (React.createElement(PreviewResultsPanel, { previewInfo: this.props.PreviewInfo, api: this.props.api, selectedColumn: selectedColumn, showPanel: true, showHeader: false }));
41
- const valueSelectorDisabled = this.props.accessLevel == 'ReadOnly' ||
41
+ const valueSelectorDisabled = this.props.accessLevel == GeneralConstants.ACCESS_LEVEL_READ_ONLY ||
42
42
  !this.props.BulkUpdateValidationResult.IsValid ||
43
43
  this.props.api.layoutApi.isCurrentLayoutPivot();
44
44
  const valueOperationDisabled = valueSelectorDisabled ||
@@ -44,7 +44,8 @@ class CellSummaryViewPanelComponent extends React.Component {
44
44
  };
45
45
  });
46
46
  let cellSummaryPopover = React.createElement(CellSummaryPopover, { CellSummary: this.props.CellSummary });
47
- let shouldDisable = this.props.accessLevel == 'ReadOnly' || this.props.CellSummary == null;
47
+ let shouldDisable = this.props.accessLevel == GeneralConstants.ACCESS_LEVEL_READ_ONLY ||
48
+ this.props.CellSummary == null;
48
49
  const isToolbar = this.props.viewType === 'Toolbar';
49
50
  const elementType = isToolbar ? 'DashboardToolbar' : 'ToolPanel';
50
51
  const operationValue = this.getOperationValue() ?? 'N/A';
@@ -9,6 +9,7 @@ import { useAdaptable } from '../AdaptableContext';
9
9
  import AdaptableInput from '../Components/AdaptableInput';
10
10
  import FormatHelper from '../../Utilities/Helpers/FormatHelper';
11
11
  import { Box, Flex } from '../../components/Flex';
12
+ import { ACCESS_LEVEL_READ_ONLY } from '../../Utilities/Constants/GeneralConstants';
12
13
  // Edit Mode
13
14
  // [author] [edit, delete]
14
15
  // [text-editor] * this is different
@@ -25,7 +26,7 @@ export const CommentsEditor = (props) => {
25
26
  return api.optionsApi.getUserName();
26
27
  }, []);
27
28
  const commentThread = useSelector((state) => CommentsRedux.GetCellCommentSelector(state.Comment, cellAddress));
28
- const isReadOnlyModule = api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
29
+ const isReadOnlyModule = api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === ACCESS_LEVEL_READ_ONLY;
29
30
  const [activeEditingComment, setActiveEditingComment] = React.useState(() => {
30
31
  /**
31
32
  * When opening the popup and there is only one comment, we want to open it in edit mode.
@@ -6,6 +6,7 @@ import { useAdaptable } from '../AdaptableContext';
6
6
  import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
7
7
  import { AdaptableButtonComponent } from '../Components/AdaptableButton';
8
8
  import FormatHelper from '../../Utilities/Helpers/FormatHelper';
9
+ import { ACCESS_LEVEL_READ_ONLY } from '../../Utilities/Constants/GeneralConstants';
9
10
  import { Box, Flex } from '../../components/Flex';
10
11
  const tableDOMProps = {
11
12
  style: {
@@ -25,7 +26,8 @@ const headerOptions = {
25
26
  };
26
27
  const CellComments = (props) => {
27
28
  const adaptable = useAdaptable();
28
- const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
29
+ const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') ===
30
+ ACCESS_LEVEL_READ_ONLY;
29
31
  const formatDate = (date, format) => {
30
32
  return FormatHelper.DateFormatter(date, { Pattern: format });
31
33
  };
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { ACCESS_LEVEL_FULL, ACCESS_LEVEL_HIDDEN, } from '../../../../Utilities/Constants/GeneralConstants';
2
3
  import { Box } from '../../../../components/Flex';
3
4
  import clsx from 'clsx';
4
5
  import { twMerge } from '../../../../twMerge';
@@ -13,12 +14,12 @@ export class ButtonBase extends React.Component {
13
14
  glyph: '',
14
15
  displayMode: 'Glyph+Text',
15
16
  transformGlyph: false,
16
- accessLevel: 'Full',
17
+ accessLevel: ACCESS_LEVEL_FULL,
17
18
  showDefaultStyle: false,
18
19
  };
19
20
  render() {
20
21
  let isDisabled;
21
- isDisabled = this.props.accessLevel == 'Hidden';
22
+ isDisabled = this.props.accessLevel == ACCESS_LEVEL_HIDDEN;
22
23
  if (this.props.overrideDisableButton || this.props.disabled) {
23
24
  isDisabled = true;
24
25
  }
@@ -4,6 +4,7 @@ import { ButtonClone } from './ButtonClone';
4
4
  import { ButtonDelete } from './ButtonDelete';
5
5
  import { ButtonShare } from './ButtonShare';
6
6
  import { SuspendToggleButton } from './SuspendToggleButton/SuspendToggleButton';
7
+ import { ACCESS_LEVEL_FULL, ACCESS_LEVEL_READ_ONLY, } from '../../../Utilities/Constants/GeneralConstants';
7
8
  import { Flex } from '../../../components/Flex';
8
9
  import clsx from 'clsx';
9
10
  const stopPropagation = (e) => {
@@ -23,7 +24,7 @@ export class EntityListActionButtons extends React.Component {
23
24
  overrideDisableShare: false,
24
25
  confirmDeleteAction: null,
25
26
  entityType: '',
26
- accessLevel: 'Full',
27
+ accessLevel: ACCESS_LEVEL_FULL,
27
28
  editSize: 'xsmall',
28
29
  deleteSize: 'xsmall',
29
30
  shareSize: 'xsmall',
@@ -36,10 +37,10 @@ export class EntityListActionButtons extends React.Component {
36
37
  'twa:justify-end': justifyContent === 'end',
37
38
  }) || 'twa:justify-center';
38
39
  return (React.createElement(Flex, { className: `${justifyContentClassName} twa:m-0 twa:p-0`, onClick: stopPropagation },
39
- this.props.showEdit && (React.createElement(ButtonEdit, { onClick: () => (this.props.editClick ? this.props.editClick() : null), className: `twa:ml-0 twa:mr-[2px] twa:my-[2px] twa:text-text-on-edit twa:bg-action-edit twa:fill-text-on-edit`, disabled: this.props.overrideDisableEdit || this.props.accessLevel == 'ReadOnly', tooltip: this.props.overrideTooltipEdit, accessLevel: this.props.accessLevel })),
40
- this.props.showClone && (React.createElement(ButtonClone, { onClick: () => (this.props.cloneClick ? this.props.cloneClick() : null), className: `twa:ml-0 twa:mr-[2px] twa:my-[2px] twa:text-text-on-clone twa:bg-action-clone twa:fill-text-on-clone`, children: null, disabled: this.props.overrideDisableClone || this.props.cloneAccessLevel == 'ReadOnly', tooltip: this.props.overrideTooltipClone, accessLevel: this.props.cloneAccessLevel })),
41
- this.props.showDelete && (React.createElement(ButtonDelete, { "data-name": "delete", className: `twa:mx-[px] twa:my-[2px] twa:text-text-on-delete twa:bg-action-delete twa:fill-text-on-delete`, disabled: this.props.overrideDisableDelete || this.props.accessLevel == 'ReadOnly', tooltip: this.props.overrideTooltipDelete, ConfirmAction: this.props.confirmDeleteAction, ConfirmationMsg: 'Are you sure you want to delete this ' + this.props.entityType + '?', ConfirmationTitle: 'Delete ' + this.props.entityType, accessLevel: this.props.accessLevel })),
42
- this.props.showShare && (React.createElement(ButtonShare, { className: `twa:mx-[1px] twa:my-[2px] twa:text-text-on-share twa:bg-action-share twa:fill-text-on-share`, onShare: (config) => this.props.shareClick ? this.props.shareClick(config) : null, Header: `TeamSharing ${this.props.entityType}`, disabled: this.props.overrideDisableShare || this.props.accessLevel == 'ReadOnly', tooltip: this.props.overrideTooltipShare, accessLevel: this.props.accessLevel })),
43
- this.props.showSuspend && this.props.suspendableObject && (React.createElement(SuspendToggleButton, { className: `twa:ml-[2px] twa:align-self-center`, onSuspend: this.props.onSuspend, onUnSuspend: this.props.onUnSuspend, suspendableObject: this.props.suspendableObject, disabled: this.props.accessLevel == 'ReadOnly' }))));
40
+ this.props.showEdit && (React.createElement(ButtonEdit, { onClick: () => (this.props.editClick ? this.props.editClick() : null), className: `twa:ml-0 twa:mr-[2px] twa:my-[2px] twa:text-text-on-edit twa:bg-action-edit twa:fill-text-on-edit`, disabled: this.props.overrideDisableEdit || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipEdit, accessLevel: this.props.accessLevel })),
41
+ this.props.showClone && (React.createElement(ButtonClone, { onClick: () => (this.props.cloneClick ? this.props.cloneClick() : null), className: `twa:ml-0 twa:mr-[2px] twa:my-[2px] twa:text-text-on-clone twa:bg-action-clone twa:fill-text-on-clone`, children: null, disabled: this.props.overrideDisableClone || this.props.cloneAccessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipClone, accessLevel: this.props.cloneAccessLevel })),
42
+ this.props.showDelete && (React.createElement(ButtonDelete, { "data-name": "delete", className: `twa:mx-[px] twa:my-[2px] twa:text-text-on-delete twa:bg-action-delete twa:fill-text-on-delete`, disabled: this.props.overrideDisableDelete || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipDelete, ConfirmAction: this.props.confirmDeleteAction, ConfirmationMsg: 'Are you sure you want to delete this ' + this.props.entityType + '?', ConfirmationTitle: 'Delete ' + this.props.entityType, accessLevel: this.props.accessLevel })),
43
+ this.props.showShare && (React.createElement(ButtonShare, { className: `twa:mx-[1px] twa:my-[2px] twa:text-text-on-share twa:bg-action-share twa:fill-text-on-share`, onShare: (config) => this.props.shareClick ? this.props.shareClick(config) : null, Header: `TeamSharing ${this.props.entityType}`, disabled: this.props.overrideDisableShare || this.props.accessLevel == ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipShare, accessLevel: this.props.accessLevel })),
44
+ this.props.showSuspend && this.props.suspendableObject && (React.createElement(SuspendToggleButton, { className: `twa:ml-[2px] twa:align-self-center`, onSuspend: this.props.onSuspend, onUnSuspend: this.props.onUnSuspend, suspendableObject: this.props.suspendableObject, disabled: this.props.accessLevel == ACCESS_LEVEL_READ_ONLY }))));
44
45
  }
45
46
  }
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ToggleButton } from '../../../../components/ToggleButton';
3
+ import { ACCESS_LEVEL_READ_ONLY } from '../../../../Utilities/Constants/GeneralConstants';
3
4
  import clsx from 'clsx';
4
5
  export const SuspendToggleButton = React.memo(({ suspendableObject, onUnSuspend, onSuspend, style, disabled, accessLevel, className }) => {
5
6
  const handleOnChange = React.useCallback((checked) => {
@@ -10,7 +11,7 @@ export const SuspendToggleButton = React.memo(({ suspendableObject, onUnSuspend,
10
11
  onSuspend(suspendableObject);
11
12
  }
12
13
  }, [onUnSuspend, onSuspend]);
13
- const preparedDisabled = (accessLevel && accessLevel === 'ReadOnly') || disabled;
14
+ const preparedDisabled = (accessLevel && accessLevel === ACCESS_LEVEL_READ_ONLY) || disabled;
14
15
  const isSuspended = suspendableObject.IsSuspended;
15
16
  return (React.createElement(ToggleButton, { className: clsx(`ab-SuspendButton`, className), "data-name": suspendableObject.IsSuspended ? 'un-suspend' : 'suspend', disabled: preparedDisabled, style: style, onChange: handleOnChange, checked: !isSuspended }, isSuspended ? 'inactive' : 'active'));
16
17
  });
@@ -77,7 +77,6 @@ export const ColumnFilterInput = (props) => {
77
77
  } }));
78
78
  }
79
79
  if (usePrimitiveInputs === false && (type === 'number' || type === 'text')) {
80
- // we use the permitted values selector
81
80
  return (React.createElement(PermittedValuesSelector, { allowNewValues: true, searchable: 'inline', value: liveValue, columnId: columnId, onFocus: onFocus, onBlur: onBlur, onChange: (value) => {
82
81
  if (value == undefined) {
83
82
  onClear();
@@ -97,7 +96,9 @@ export const ColumnFilterInput = (props) => {
97
96
  borderRadius: 0,
98
97
  border: 'none',
99
98
  }
100
- : {}, "data-name": "floating-filter-input", onFocus: onFocus, onBlur: onBlur, disabled: disabled, type: type === 'number' ? 'text' : type,
99
+ : {
100
+ width: '100%',
101
+ }, "data-name": "floating-filter-input", onFocus: onFocus, onBlur: onBlur, disabled: disabled, type: type === 'number' ? 'text' : type,
101
102
  // autoFocus has to be FALSE because if the input receives focus in the init phase,
102
103
  // it may scroll the AG Grid header viewport into view and de-synchronize it (relative to the content viewport)
103
104
  autoFocus: false, value: liveValue ?? '', onKeyDown: onKeyDown, showClearButton: false, className: "twa:flex-1", onChange: (e) => {
@@ -36,7 +36,9 @@ export const ColumnFilterInputList = (props) => {
36
36
  }
37
37
  return (React.createElement(React.Fragment, null, (matchingInputs ?? []).map((input, index) => {
38
38
  const value = props?.predicate?.args?.[index];
39
- return (React.createElement(ColumnFilterInput, { columnId: props.columnId, usePrimitiveInputs: false, key: index, disabled: props.disabled, type: input, value: value, onKeyDown: props.onKeyDown, onClear: () => {
39
+ const operator = props.predicate?.operator;
40
+ const usePermittedValuesSelector = input === 'number' || operator === 'Is' || operator === 'IsNot';
41
+ return (React.createElement(ColumnFilterInput, { columnId: props.columnId, usePrimitiveInputs: !usePermittedValuesSelector, key: index, disabled: props.disabled, type: input, value: value, onKeyDown: props.onKeyDown, onClear: () => {
40
42
  const args = [...props.predicate.args];
41
43
  args.splice(index, 1);
42
44
  const newPredicate = {
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { DashboardToolbar as DashboardToolbarUI } from '../../../../components/Dashboard';
3
+ import { ACCESS_LEVEL_FULL } from '../../../../Utilities/Constants/GeneralConstants';
3
4
  export class PanelDashboard extends React.Component {
4
5
  static defaultProps = {
5
6
  showConfigureActionButton: true,
@@ -7,7 +8,7 @@ export class PanelDashboard extends React.Component {
7
8
  headerText: 'Module',
8
9
  onClose: null,
9
10
  onConfigure: null,
10
- accessLevel: 'Full',
11
+ accessLevel: ACCESS_LEVEL_FULL,
11
12
  };
12
13
  render() {
13
14
  const { headerText, showConfigureActionButton, showCloseActionButton, onConfigure, onClose, accessLevel, children, } = this.props;
@@ -28,7 +28,7 @@ export const AdaptablePopup = (props) => {
28
28
  let isStandalone = false;
29
29
  let moduleViewContent = null;
30
30
  let activeItem = null;
31
- let accessLevel = 'Full';
31
+ let accessLevel = GeneralConstants.ACCESS_LEVEL_FULL;
32
32
  const firstMenuItem = menuItems.find((menuItem) => menuItem !== '-');
33
33
  const firstMenuModule = firstMenuItem?.category;
34
34
  let componentModule = props.componentModule;
@@ -70,7 +70,9 @@ export const AdaptablePopup = (props) => {
70
70
  } },
71
71
  React.createElement(AdaptablePopupDialog, { dataName: componentModule, baseClassName: baseClassName, className: className, friendlyName: friendlyName, isActionModule: isStandalone, isWindowModal: isWindowModal, onHide: props.onHide, modalContainer: modalContainer },
72
72
  !isStandalone && React.createElement(TopBar, { icon: settingsPanelOptions.icon }, settingsPanelTitle),
73
- React.createElement(Box, { className: clsx('twa:flex twa:flex-row twa:flex-1 twa:min-h-0', 'twa:bg-defaultbackground twa:text-text-on-defaultbackground', accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '') },
73
+ React.createElement(Box, { className: clsx('twa:flex twa:flex-row twa:flex-1 twa:min-h-0', 'twa:bg-defaultbackground twa:text-text-on-defaultbackground', accessLevel == GeneralConstants.ACCESS_LEVEL_READ_ONLY
74
+ ? GeneralConstants.READ_ONLY_STYLE
75
+ : '') },
74
76
  !isStandalone && (React.createElement(Navigation, { menuItems: menuItems, api: props.api, activeItem: activeItem, customSettingsPanels: settingsPanelOptions.customSettingsPanels })),
75
77
  React.createElement(Box, { className: clsx('ab-Adaptable-Popup__Body', 'twa:bg-primarylight twa:text-primarylight-foreground', 'twa:flex twa:flex-1 twa:min-w-0 twa:overflow-auto', !isStandalone && 'twa:*:p-3') }, moduleViewContent)))));
76
78
  };
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useDispatch, useSelector } from 'react-redux';
3
+ import { ACCESS_LEVEL_READ_ONLY } from '../../../../Utilities/Constants/GeneralConstants';
3
4
  import DropdownButton from '../../../../components/DropdownButton';
4
5
  import EmptyContent from '../../../../components/EmptyContent';
5
6
  import { Icon } from '../../../../components/icons';
@@ -66,7 +67,7 @@ export const AdaptablePopupModuleView = (props) => {
66
67
  if (moduleViewProperties?.abObjectTypes?.length) {
67
68
  const items = moduleViewProperties?.abObjectTypes.map((abObjectType) => {
68
69
  return {
69
- disabled: abObjectType?.accessLevel === 'ReadOnly',
70
+ disabled: abObjectType?.accessLevel === ACCESS_LEVEL_READ_ONLY,
70
71
  onClick: () => {
71
72
  setAbObjectType(abObjectType);
72
73
  handleOpenEditPopup();
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import kebabCase from '../../../Utilities/utils/kebabCase';
3
+ import { ACCESS_LEVEL_FULL } from '../../../Utilities/Constants/GeneralConstants';
3
4
  import * as ToolPanelRedux from '../../../Redux/ActionsReducers/ToolPanelRedux';
4
5
  import { connect } from 'react-redux';
5
6
  import ArrayExtensions from '../../../Utilities/Extensions/ArrayExtensions';
@@ -129,7 +130,7 @@ const AdaptableToolPanelComponent = (props) => {
129
130
  toolPanelButtons.push(moduleButtons.map((x) => {
130
131
  let menuItem = props.MainMenuItems.find((y) => y.isVisible && y.category == x);
131
132
  if (menuItem) {
132
- return (React.createElement(SimpleButton, { "data-name": menuItem.category, key: menuItem.label, icon: menuItem.icon, tone: "none", variant: "text", className: `ab-ToolPanel__Home__${kebabCase(menuItem.label)}`, tooltip: menuItem.label, onClick: () => props.onClick(menuItem.reduxAction), accessLevel: 'Full' }));
133
+ return (React.createElement(SimpleButton, { "data-name": menuItem.category, key: menuItem.label, icon: menuItem.icon, tone: "none", variant: "text", className: `ab-ToolPanel__Home__${kebabCase(menuItem.label)}`, tooltip: menuItem.label, onClick: () => props.onClick(menuItem.reduxAction), accessLevel: ACCESS_LEVEL_FULL }));
133
134
  }
134
135
  }));
135
136
  }
@@ -154,7 +155,7 @@ const AdaptableToolPanelComponent = (props) => {
154
155
  const buttonVariant = buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'text';
155
156
  const buttonTone = buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none';
156
157
  const uniqueKey = buttonLabel ?? createUuid();
157
- return (React.createElement(SimpleButton, { key: uniqueKey, variant: buttonVariant, tone: buttonTone, className: `ab-ToolPanel__Home__${kebabCase(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled, onClick: () => button.onClick(button, toolPanelContext), accessLevel: 'Full' }, buttonLabel));
158
+ return (React.createElement(SimpleButton, { key: uniqueKey, variant: buttonVariant, tone: buttonTone, className: `ab-ToolPanel__Home__${kebabCase(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled, onClick: () => button.onClick(button, toolPanelContext), accessLevel: ACCESS_LEVEL_FULL }, buttonLabel));
158
159
  });
159
160
  };
160
161
  const onSetToolPanelVisibility = (name, checked) => {
@@ -4,6 +4,7 @@ import { useAdaptable } from '../../AdaptableContext';
4
4
  import { createUuid } from '../../../components/utils/uuid';
5
5
  import SimpleButton from '../../../components/SimpleButton';
6
6
  import kebabCase from '../../../Utilities/utils/kebabCase';
7
+ import { ACCESS_LEVEL_FULL } from '../../../Utilities/Constants/GeneralConstants';
7
8
  export const CustomToolPanelContent = (props) => {
8
9
  const { customToolPanel } = props;
9
10
  const { api } = useAdaptable();
@@ -59,7 +60,7 @@ export const CustomToolPanelContent = (props) => {
59
60
  const buttonVariant = buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'text';
60
61
  const buttonTone = buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none';
61
62
  const uniqueKey = buttonLabel ?? createUuid();
62
- return (React.createElement(SimpleButton, { key: uniqueKey, variant: buttonVariant, tone: buttonTone, className: `ab-ToolPanel__Home__${kebabCase(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled, onClick: () => button.onClick(button, toolPanelContext), accessLevel: 'Full' }, buttonLabel));
63
+ return (React.createElement(SimpleButton, { key: uniqueKey, variant: buttonVariant, tone: buttonTone, className: `ab-ToolPanel__Home__${kebabCase(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled, onClick: () => button.onClick(button, toolPanelContext), accessLevel: ACCESS_LEVEL_FULL }, buttonLabel));
63
64
  })))));
64
65
  };
65
66
  const hasCustomRenderFn = (customToolPanel) => customToolPanel.render;
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { useState } from 'react';
3
3
  import SimpleButton from '../../components/SimpleButton';
4
4
  import kebabCase from '../../Utilities/utils/kebabCase';
5
+ import { ACCESS_LEVEL_FULL, ACCESS_LEVEL_READ_ONLY, } from '../../Utilities/Constants/GeneralConstants';
5
6
  export const CustomDashboardButton = (props) => {
6
7
  const { button } = props;
7
8
  const [componentRevision, setComponentRevision] = useState(1);
@@ -19,11 +20,11 @@ export const CustomDashboardButton = (props) => {
19
20
  return null;
20
21
  }
21
22
  const disabled = button.disabled && button.disabled(button, dashboardContext);
22
- return (React.createElement(SimpleButton, { key: buttonLabel, "aria-label": buttonLabel, variant: buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'text', tone: buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none', className: `ab-DashboardToolbar__Home__${kebabCase(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled || props.accessLevel == 'ReadOnly', onClick: () => {
23
+ return (React.createElement(SimpleButton, { key: buttonLabel, "aria-label": buttonLabel, variant: buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'text', tone: buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none', className: `ab-DashboardToolbar__Home__${kebabCase(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled || props.accessLevel == ACCESS_LEVEL_READ_ONLY, onClick: () => {
23
24
  button.onClick?.(button, dashboardContext);
24
25
  setTimeout(() => {
25
26
  // mutate state to force a re-rendering
26
27
  setComponentRevision(componentRevision + 1);
27
28
  }, 16);
28
- }, accessLevel: 'Full' }, buttonLabel));
29
+ }, accessLevel: ACCESS_LEVEL_FULL }, buttonLabel));
29
30
  };
@@ -1,4 +1,5 @@
1
1
  import kebabCase from '../../Utilities/utils/kebabCase';
2
+ import { ACCESS_LEVEL_FULL, ACCESS_LEVEL_HIDDEN, ACCESS_LEVEL_READ_ONLY, } from '../../Utilities/Constants/GeneralConstants';
2
3
  import * as React from 'react';
3
4
  import { connect } from 'react-redux';
4
5
  import { Dashboard as DashboardUI, DashboardTab as DashboardTabUI, } from '../../components/Dashboard';
@@ -26,7 +27,7 @@ const DashboardComponent = (props) => {
26
27
  let visibleDashboardElements = visibleToolbarNames.map((visibleToolbarName) => {
27
28
  let customToolbar = customToolbars && customToolbars.find((ct) => ct.name == visibleToolbarName);
28
29
  if (customToolbar) {
29
- if (dashboardAccessLevel != 'Hidden') {
30
+ if (dashboardAccessLevel != ACCESS_LEVEL_HIDDEN) {
30
31
  return (React.createElement(Box, { key: customToolbar.name, className: `ab-Dashboard__container ab-Dashboard__container--customToolbar` },
31
32
  React.createElement(CustomToolbarWrapper, { customToolbar: customToolbar, dashboardRevision: props.DashboardRevision })));
32
33
  }
@@ -63,7 +64,7 @@ const DashboardComponent = (props) => {
63
64
  shortcuts = shortcutsArray.map((x, index) => {
64
65
  let menuItem = props.InternalState.Dashboard.DashboardModuleButtons.find((y) => y.isVisible && y.category == x);
65
66
  if (menuItem) {
66
- return (React.createElement(AdaptableButtonComponent, { "data-name": `dashboard-module-button-${menuItem.category ?? 'custom-' + index}`, "aria-label": menuItem.label, key: menuItem.label, variant: menuItem.category === 'SystemStatus' ? 'outlined' : 'text', tone: menuItem.category === 'SystemStatus' ? 'neutral' : 'none', className: `ab-DashboardToolbar__Home__${kebabCase(menuItem.label)}`, icon: menuItem.icon, tooltip: menuItem.label, disabled: props.accessLevel == 'ReadOnly', onClick: () => props.dispatch(menuItem.reduxAction), accessLevel: 'Full', style: menuItem.category === 'SystemStatus'
67
+ return (React.createElement(AdaptableButtonComponent, { "data-name": `dashboard-module-button-${menuItem.category ?? 'custom-' + index}`, "aria-label": menuItem.label, key: menuItem.label, variant: menuItem.category === 'SystemStatus' ? 'outlined' : 'text', tone: menuItem.category === 'SystemStatus' ? 'neutral' : 'none', className: `ab-DashboardToolbar__Home__${kebabCase(menuItem.label)}`, icon: menuItem.icon, tooltip: menuItem.label, disabled: props.accessLevel == ACCESS_LEVEL_READ_ONLY, onClick: () => props.dispatch(menuItem.reduxAction), accessLevel: ACCESS_LEVEL_FULL, style: menuItem.category === 'SystemStatus'
67
68
  ? {
68
69
  ...UIHelper.getStyleForMessageType(props.api.systemStatusApi.getCurrentSystemStatusMessageInfo()?.statusType ??
69
70
  'Success'),
@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
3
3
  import * as DashboardRedux from '../../Redux/ActionsReducers/DashboardRedux';
4
4
  import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
5
5
  import DashboardManagerUI from '../../components/Dashboard/DashboardManager';
6
+ import { ACCESS_LEVEL_FULL, ACCESS_LEVEL_READ_ONLY, } from '../../Utilities/Constants/GeneralConstants';
6
7
  import { ModuleValueSelector } from '../Components/ModuleValueSelector';
7
8
  import { PinnedToolbarsSelector } from './PinnedToolbarsSelector';
8
9
  import { Flex } from '../../components/Flex';
@@ -56,8 +57,8 @@ class DashboardPopupComponent extends React.Component {
56
57
  const allModuleButtons = this.props.InternalState.SettingsPanelModuleEntries.map((x) => x.category);
57
58
  const baseClassName = 'ab-Dashboard-Popup';
58
59
  const dashboardAccessLevel = this.props.api.entitlementApi.getEntitlementAccessLevelForModule('Dashboard');
59
- const areDashboardSettingsVisible = dashboardAccessLevel == 'Full' || dashboardAccessLevel == 'ReadOnly';
60
- const isDashboardDisabled = dashboardAccessLevel === 'ReadOnly';
60
+ const areDashboardSettingsVisible = dashboardAccessLevel == ACCESS_LEVEL_FULL || dashboardAccessLevel == ACCESS_LEVEL_READ_ONLY;
61
+ const isDashboardDisabled = dashboardAccessLevel === ACCESS_LEVEL_READ_ONLY;
61
62
  const isModuleCheckboxDisabled = (module) => {
62
63
  if (module === 'SettingsPanel') {
63
64
  return this.props.api.optionsApi.getSettingsPanelOptions().alwaysShowInDashboard;
@@ -2,11 +2,12 @@ import * as React from 'react';
2
2
  import { useDispatch, useSelector } from 'react-redux';
3
3
  import { ModuleManager } from '../../components/DragAndDropContext/ModuleManager';
4
4
  import { DashboardSetPinnedToolbars } from '../../Redux/ActionsReducers/DashboardRedux';
5
+ import { ACCESS_LEVEL_READ_ONLY } from '../../Utilities/Constants/GeneralConstants';
5
6
  import { useAdaptable } from '../AdaptableContext';
6
7
  export const PinnedToolbarsSelector = (props) => {
7
8
  const { api } = useAdaptable();
8
9
  const dashboardAccessLevel = api.entitlementApi.getEntitlementAccessLevelForModule('Dashboard');
9
- const isDashboardDisabled = dashboardAccessLevel === 'ReadOnly';
10
+ const isDashboardDisabled = dashboardAccessLevel === ACCESS_LEVEL_READ_ONLY;
10
11
  const dashboardState = useSelector((state) => state.Dashboard);
11
12
  const dispatch = useDispatch();
12
13
  const pinnedToolbars = dashboardState.PinnedToolbars;
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { useEffect, useRef, useState } from 'react';
3
3
  import { useAdaptable } from '../AdaptableContext';
4
4
  import usePrevious from '../../components/utils/usePrevious';
5
+ import { ACCESS_LEVEL_HIDDEN } from '../../Utilities/Constants/GeneralConstants';
5
6
  import { DataChangeHistoryModuleId } from '../../Utilities/Constants/ModuleConstants';
6
7
  import { buildActionColumnButton } from './buildActionColumnButton';
7
8
  import { AdaptableAgGrid } from '../../agGrid/AdaptableAgGrid';
@@ -115,7 +116,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, adaptableContainerId, agGr
115
116
  agGridContainer: agGridContainerId,
116
117
  },
117
118
  entitlementOptions: {
118
- defaultAccessLevel: 'Hidden',
119
+ defaultAccessLevel: ACCESS_LEVEL_HIDDEN,
119
120
  },
120
121
  actionColumnOptions: actionColumnOptions,
121
122
  initialState: {
@@ -35,7 +35,9 @@ export const ExportViewPanel = (props) => {
35
35
  }) },
36
36
  React.createElement(ReportNameSelector, { viewType: props.viewType, reportName: currentReportName, userReports: userReports, onReportNameSelected: (reportName) => exportApi.selectReport(reportName) }),
37
37
  React.createElement(ReportFormatSelector, { viewType: props.viewType, reportName: currentReportName, reportFormat: currentFormat, onReportFormatSelected: (reportFormat) => exportApi.selectFormat(reportFormat) }),
38
- React.createElement(Flex, { className: join(accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__Export__controls twa:w-full`) },
38
+ React.createElement(Flex, { className: join(accessLevel == GeneralConstants.ACCESS_LEVEL_READ_ONLY
39
+ ? GeneralConstants.READ_ONLY_STYLE
40
+ : '', `ab-${elementType}__Export__controls twa:w-full`) },
39
41
  React.createElement(Flex, { className: "twa:min-w-[44px]" },
40
42
  React.createElement(ExportDestinationPicker, { viewType: props.viewType, reportName: currentReportName, reportFormat: currentFormat })),
41
43
  React.createElement(Flex, null,
@@ -7,6 +7,7 @@ import { ButtonClear } from '../Components/Buttons/ButtonClear';
7
7
  import { CheckBox } from '../../components/CheckBox';
8
8
  import { connect } from 'react-redux';
9
9
  import { getColumnFiltersSelector } from '../../Redux/ActionsReducers/LayoutRedux';
10
+ import { ACCESS_LEVEL_READ_ONLY } from '../../Utilities/Constants/GeneralConstants';
10
11
  import SimpleButton from '../../components/SimpleButton';
11
12
  import join from '../../components/utils/join';
12
13
  import { Flex } from '../../components/Flex';
@@ -31,7 +32,7 @@ class FilterViewPanelComponent extends React.Component {
31
32
  ArrayExtensions.IsNotNullOrEmpty(this.props.ColumnFilters) && (React.createElement(AdaptablePopover, { popupPadding: 0, className: `ab-${elementType}__Filter__info`, headerText: "", bodyText: [React.createElement(ActiveFiltersPanel, null)], useButton: true, showEvent: 'focus', hideEvent: "blur", popoverMinWidth: 400 })),
32
33
  React.createElement(ButtonClear, { "aria-label": 'Clear Filters', className: `ab-${elementType}__Filter__clear twa:mx-1 twa:mb-0`, onClick: () => this.onClearFilters(), tooltip: "Clear Filters", disabled: this.props.ColumnFilters.length == 0, showText: this.props.viewType === 'ToolPanel' }, this.props.viewType === 'ToolPanel' && 'Clear'),
33
34
  React.createElement(SimpleButton, { "aria-label": isAtLeastOneFilterActive ? 'Suspend All Filters' : 'Resume All Filters', className: join(`ab-${elementType}__Filter__suspend-button`, isAtLeastOneFilterActive && `ab-${elementType}__Filter__suspend-all`, !isAtLeastOneFilterActive && `ab-${elementType}__Filter__un-suspend-all`), disabled: !isAtLeastOneFilter, onClick: handleSuspendUnsuspendAll, tone: isAtLeastOneFilterActive ? 'neutral' : 'success', variant: "text", icon: isAtLeastOneFilterActive ? 'pause' : 'play', accessLevel: this.props.accessLevel })),
34
- React.createElement(Flex, { alignItems: "center" }, this.props.api.filterApi.columnFilterApi.isQuickFilterAvailable() && (React.createElement(CheckBox, { "data-name": "quick-filter-toggle", className: `ab-${elementType}__Filter__active-check twa:my-0 twa:text-2 twa:p-1`, disabled: this.props.accessLevel === 'ReadOnly' ||
35
+ React.createElement(Flex, { alignItems: "center" }, this.props.api.filterApi.columnFilterApi.isQuickFilterAvailable() && (React.createElement(CheckBox, { "data-name": "quick-filter-toggle", className: `ab-${elementType}__Filter__active-check twa:my-0 twa:text-2 twa:p-1`, disabled: this.props.accessLevel === ACCESS_LEVEL_READ_ONLY ||
35
36
  this.props.api.layoutApi.isCurrentLayoutPivot(), checked: this.props.IsQuickFilterVisible, onChange: (checked) => {
36
37
  checked ? this.props.onShowQuickFilterBar() : this.props.onHideQuickFilterBar();
37
38
  } }, "Filter Bar")))));