@adaptabletools/adaptable-cjs 22.1.0 → 22.1.1-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +8 -9
- package/package.json +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -2
- package/src/AdaptableOptions/AdaptableOptions.d.ts +2 -21
- package/src/AdaptableOptions/AlertOptions.d.ts +0 -5
- package/src/AdaptableOptions/CellSummaryOptions.d.ts +2 -0
- package/src/AdaptableOptions/ChartingOptions.d.ts +2 -0
- package/src/AdaptableOptions/ColumnOptions.d.ts +0 -2
- package/src/AdaptableOptions/CommentOptions.d.ts +6 -0
- package/src/AdaptableOptions/ContainerOptions.d.ts +0 -6
- package/src/AdaptableOptions/DashboardOptions.d.ts +0 -2
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +0 -2
- package/src/AdaptableOptions/DataSetOptions.d.ts +2 -0
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +34 -2
- package/src/AdaptableOptions/EditOptions.d.ts +0 -1
- package/src/AdaptableOptions/EntitlementOptions.d.ts +0 -2
- package/src/AdaptableOptions/ExportOptions.d.ts +1 -7
- package/src/AdaptableOptions/ExpressionOptions.d.ts +0 -18
- package/src/AdaptableOptions/Fdc3Options.d.ts +5 -1
- package/src/AdaptableOptions/FilterOptions.d.ts +3 -18
- package/src/AdaptableOptions/NoteOptions.d.ts +6 -0
- package/src/AdaptableOptions/NotificationsOptions.d.ts +0 -10
- package/src/AdaptableOptions/PredicateOptions.d.ts +12 -1
- package/src/AdaptableOptions/QuickSearchOptions.d.ts +0 -4
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +15 -5
- package/src/AdaptableOptions/TeamSharingOptions.d.ts +0 -4
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +0 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +6 -7
- package/src/AdaptableState/Common/AdaptableFormat.d.ts +9 -0
- package/src/AdaptableState/Common/AdaptableFormatPresets.d.ts +31 -0
- package/src/AdaptableState/Common/AdaptableFormatPresets.js +186 -0
- package/src/AdaptableState/Common/Menu.d.ts +1 -1
- package/src/AdaptableState/Common/Menu.js +2 -0
- package/src/AdaptableState/FormatColumnState.d.ts +6 -3
- package/src/Api/EventApi.d.ts +6 -6
- package/src/Api/Implementation/EntitlementApiImpl.js +5 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +8 -3
- package/src/Api/Implementation/GridApiImpl.js +1 -12
- package/src/Api/Internal/FormatColumnInternalApi.js +4 -2
- package/src/Api/Internal/LayoutInternalApi.js +5 -2
- package/src/Redux/Store/AdaptableStore.js +4 -4
- package/src/Strategy/AdaptableModuleBase.js +8 -7
- package/src/Strategy/AlertModule.d.ts +1 -1
- package/src/Strategy/BulkUpdateModule.d.ts +1 -1
- package/src/Strategy/BulkUpdateModule.js +2 -1
- package/src/Strategy/CalculatedColumnModule.d.ts +1 -1
- package/src/Strategy/CellSummaryModule.d.ts +1 -1
- package/src/Strategy/CellSummaryModule.js +2 -1
- package/src/Strategy/ColumnFilterModule.js +2 -1
- package/src/Strategy/ColumnInfoModule.d.ts +1 -1
- package/src/Strategy/ColumnInfoModule.js +2 -1
- package/src/Strategy/CommentModule.d.ts +1 -1
- package/src/Strategy/CommentModule.js +12 -2
- package/src/Strategy/ExportModule.d.ts +1 -1
- package/src/Strategy/Fdc3Module.d.ts +1 -1
- package/src/Strategy/FlashingCellModule.d.ts +1 -1
- package/src/Strategy/GridFilterModule.js +2 -1
- package/src/Strategy/GridInfoModule.d.ts +1 -1
- package/src/Strategy/GridInfoModule.js +2 -1
- package/src/Strategy/LayoutModule.d.ts +1 -1
- package/src/Strategy/NamedQueryModule.js +0 -16
- package/src/Strategy/NoteModule.d.ts +1 -1
- package/src/Strategy/NoteModule.js +16 -3
- package/src/Strategy/PlusMinusModule.js +8 -2
- package/src/Strategy/ScheduleModule.js +5 -4
- package/src/Strategy/SettingsPanelModule.d.ts +1 -1
- package/src/Strategy/ShortcutModule.js +5 -4
- package/src/Strategy/SmartEditModule.d.ts +1 -1
- package/src/Strategy/SmartEditModule.js +4 -4
- package/src/Strategy/SystemStatusModule.d.ts +1 -1
- package/src/Utilities/Constants/GeneralConstants.d.ts +4 -0
- package/src/Utilities/Constants/GeneralConstants.js +5 -1
- package/src/Utilities/Extensions/NumberExtensions.d.ts +2 -0
- package/src/Utilities/Extensions/NumberExtensions.js +9 -0
- package/src/Utilities/Helpers/AdaptableHelper.js +3 -2
- package/src/Utilities/Helpers/FormatHelper.js +26 -15
- package/src/Utilities/Services/AnnotationsService.js +10 -1
- package/src/Utilities/Services/Interface/IMetamodelService.d.ts +0 -1
- package/src/Utilities/Services/MetamodelService.d.ts +0 -2
- package/src/Utilities/Services/MetamodelService.js +6 -12
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +7 -6
- package/src/View/Alert/AlertEmptyView.js +2 -1
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +1 -1
- package/src/View/CellSummary/CellSummaryViewPanel.js +2 -1
- package/src/View/Comments/CommentsEditor.js +2 -1
- package/src/View/Comments/CommentsPopup.js +3 -1
- package/src/View/Components/Buttons/ButtonBase/index.js +3 -2
- package/src/View/Components/Buttons/EntityListActionButtons.js +7 -6
- package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.js +2 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +3 -2
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +4 -1
- package/src/View/Components/Panels/PanelDashboard/index.js +2 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +4 -2
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +2 -1
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +3 -2
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +2 -1
- package/src/View/Dashboard/CustomDashboardButton.js +3 -2
- package/src/View/Dashboard/Dashboard.js +3 -2
- package/src/View/Dashboard/DashboardPopup.js +3 -2
- package/src/View/Dashboard/PinnedToolbarsSelector.js +2 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +2 -1
- package/src/View/Export/ExportViewPanel.js +3 -1
- package/src/View/Filter/FilterViewPanel.js +2 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +137 -181
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +20 -8
- package/src/View/GridFilter/GridFilterPopupUI/index.d.ts +3 -2
- package/src/View/GridFilter/GridFilterPopupUI/index.js +2 -1
- package/src/View/GridFilter/GridFilterViewPanel.js +3 -2
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +179 -6
- package/src/View/Layout/LayoutCloneButton.js +2 -1
- package/src/View/Layout/LayoutViewPanel.js +3 -1
- package/src/View/Layout/TransposedPopup.js +2 -1
- package/src/View/Note/NotePopup.js +3 -1
- package/src/View/SmartEdit/SmartEditViewPanel.js +2 -1
- package/src/View/StateManagement/StateManagementViewPanel.js +3 -1
- package/src/View/StatusBar/StatusBarPopup.js +2 -1
- package/src/View/Theme/ThemeEditor.js +2 -1
- package/src/View/Theme/ThemePopup.js +2 -1
- package/src/View/Theme/ThemeSelector.js +3 -1
- package/src/View/Theme/ThemeViewPanel.js +3 -1
- package/src/View/Wizard/OnePageWizards.js +3 -2
- package/src/agGrid/AdaptableAgGrid.d.ts +2 -2
- package/src/agGrid/AdaptableAgGrid.js +7 -29
- package/src/agGrid/AgGridAdapter.js +1 -1
- package/src/agGrid/AgGridColumnAdapter.js +11 -4
- package/src/agGrid/AgGridExportAdapter.js +4 -2
- package/src/agGrid/cellRenderers/ActionColumnRenderer.js +2 -1
- package/src/components/Dashboard/Dashboard.js +2 -1
- package/src/components/Dashboard/DashboardToolbar.js +2 -1
- package/src/components/Datepicker/index.js +2 -1
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +1 -1
- package/src/components/Select/Select.js +4 -3
- package/src/components/SimpleButton/index.js +3 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable-metamodel-model.d.ts +0 -2
- package/src/metamodel/adaptable.metamodel.d.ts +10 -197
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +2 -0
- package/src/types.js +5 -1
- package/themes/dark.css +3 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/index.css.map +0 -1
|
@@ -81,22 +81,33 @@ function NumberFormatter(input, options = {}, rowNode, column, api) {
|
|
|
81
81
|
let decimalCount = Math.floor(n) === n ? 0 : n.toString().split(fractionsSepatator)[1]?.length || 0;
|
|
82
82
|
digitsToUse = decimalCount;
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
if (options.IntegerSeparator !== undefined) {
|
|
93
|
-
// if fraction separator is not a comma then simply replace all instances
|
|
94
|
-
if (options.FractionSeparator !== ',') {
|
|
95
|
-
s = s.replace(/\,/g, options.IntegerSeparator);
|
|
84
|
+
if (options.Notation === 'scientific') {
|
|
85
|
+
// Scientific notation: bypass locale grouping. Use toExponential
|
|
86
|
+
// for predictable mantissa-digit control and apply only the
|
|
87
|
+
// FractionSeparator post-hoc.
|
|
88
|
+
s = n.toExponential(options.FractionDigits != null ? digitsToUse : undefined);
|
|
89
|
+
if (options.FractionSeparator !== undefined && options.FractionSeparator !== '.') {
|
|
90
|
+
s = s.replace('.', options.FractionSeparator);
|
|
96
91
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
s = n.toLocaleString('en-US', {
|
|
95
|
+
minimumIntegerDigits: options.IntegerDigits || undefined,
|
|
96
|
+
minimumFractionDigits: digitsToUse,
|
|
97
|
+
maximumFractionDigits: digitsToUse,
|
|
98
|
+
});
|
|
99
|
+
if (options.FractionSeparator !== undefined) {
|
|
100
|
+
s = s.replace(/\./g, options.FractionSeparator);
|
|
101
|
+
}
|
|
102
|
+
if (options.IntegerSeparator !== undefined) {
|
|
103
|
+
// if fraction separator is not a comma then simply replace all instances
|
|
104
|
+
if (options.FractionSeparator !== ',') {
|
|
105
|
+
s = s.replace(/\,/g, options.IntegerSeparator);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
// otherwise don't replace the last instance
|
|
109
|
+
s = StringExtensions_1.default.ReplaceAllOccurencesExceptLastOne(s, ',', options.IntegerSeparator);
|
|
110
|
+
}
|
|
100
111
|
}
|
|
101
112
|
}
|
|
102
113
|
s = (options.Prefix || '') + s + (options.Suffix || '');
|
|
@@ -102,7 +102,16 @@ class AnnotationsService {
|
|
|
102
102
|
}
|
|
103
103
|
const cellNote = this.api.noteApi.getNoteForCell(cellPosition);
|
|
104
104
|
const cellComments = this.api.commentApi.getCommentThreadForCell(cellPosition);
|
|
105
|
-
|
|
105
|
+
// Notes / Comments only open on hover when explicitly opted in via
|
|
106
|
+
// `noteOptions.openNote = 'hover'` / `commentOptions.showComment =
|
|
107
|
+
// 'hover'` (the defaults). When either is set to 'menu' the popup is
|
|
108
|
+
// only opened via the Cell Menu, so we ignore that side of the
|
|
109
|
+
// annotation when deciding whether to show the popup here.
|
|
110
|
+
const openNoteMode = this.api.optionsApi.getNoteOptions()?.showNoteAction ?? 'hover';
|
|
111
|
+
const showCommentMode = this.api.optionsApi.getCommentOptions()?.showCommentAction ?? 'hover';
|
|
112
|
+
const shouldOpenForNote = !!cellNote && openNoteMode === 'hover';
|
|
113
|
+
const shouldOpenForComment = !!cellComments && showCommentMode === 'hover';
|
|
114
|
+
if (!shouldOpenForNote && !shouldOpenForComment) {
|
|
106
115
|
return;
|
|
107
116
|
}
|
|
108
117
|
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;
|
|
@@ -9,23 +9,16 @@ const AdaptableLogger_1 = require("../../agGrid/AdaptableLogger");
|
|
|
9
9
|
const DefaultAdaptableOptions_1 = require("../../AdaptableOptions/DefaultAdaptableOptions");
|
|
10
10
|
const supportedMetamodelTypes = ['s', 'n', 'b', 'a', 'f', 'R'];
|
|
11
11
|
class MetamodelService {
|
|
12
|
-
gridInfoOptions = new Map();
|
|
13
12
|
getAdaptableOptions = () => null;
|
|
14
13
|
constructor(getAdaptableOptions, validateOptions) {
|
|
15
14
|
this.getAdaptableOptions = getAdaptableOptions;
|
|
16
|
-
this.gridInfoOptions = this.buildGridInfoOptions();
|
|
17
15
|
if (validateOptions) {
|
|
18
16
|
this.validateAdaptableOptionsValues();
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
|
-
getGridInfoOptions() {
|
|
22
|
-
return this.gridInfoOptions;
|
|
23
|
-
}
|
|
24
19
|
getGridInfoNoCodeOptions() {
|
|
25
20
|
return this.buildGridInfoOptions({
|
|
26
|
-
filterItemProperty: (itemProperty) =>
|
|
27
|
-
return itemProperty.nC === 'item';
|
|
28
|
-
},
|
|
21
|
+
filterItemProperty: (itemProperty) => itemProperty.nC === 'item',
|
|
29
22
|
filterEmptyAdaptableOptions: false,
|
|
30
23
|
});
|
|
31
24
|
}
|
|
@@ -93,7 +86,7 @@ class MetamodelService {
|
|
|
93
86
|
}
|
|
94
87
|
}
|
|
95
88
|
buildGridInfoOptions(options) {
|
|
96
|
-
const { filterItemProperty, filterEmptyAdaptableOptions = true } = options
|
|
89
|
+
const { filterItemProperty, filterEmptyAdaptableOptions = true } = options;
|
|
97
90
|
const gridInfoOptions = new Map();
|
|
98
91
|
const adaptableMetamodel = this.getAdaptableMetamodel();
|
|
99
92
|
const adaptableOptionsMetamodel = this.getAdaptableOptionsMetamodel();
|
|
@@ -109,9 +102,10 @@ class MetamodelService {
|
|
|
109
102
|
containerLabel: 'Base Options',
|
|
110
103
|
items: baseOptionsItems,
|
|
111
104
|
});
|
|
112
|
-
// map containers
|
|
105
|
+
// map containers — any top-level property that points to another
|
|
106
|
+
// metamodel item (k === 'R') is a nested *Options object
|
|
113
107
|
adaptableOptionsMetamodel.p
|
|
114
|
-
.filter((optionItem) => optionItem.
|
|
108
|
+
.filter((optionItem) => optionItem.k === 'R')
|
|
115
109
|
.forEach((containerOptionItem) => {
|
|
116
110
|
const containerMetamodelName = containerOptionItem.r;
|
|
117
111
|
const adaptableOptionsName = containerOptionItem.n;
|
|
@@ -134,7 +128,7 @@ class MetamodelService {
|
|
|
134
128
|
});
|
|
135
129
|
return gridInfoOptions;
|
|
136
130
|
}
|
|
137
|
-
mapGridInfoContainerItems(optionItemContainer, adaptableOptionsValues, defaultAdaptableOptionsValues, filter
|
|
131
|
+
mapGridInfoContainerItems(optionItemContainer, adaptableOptionsValues, defaultAdaptableOptionsValues, filter) {
|
|
138
132
|
return optionItemContainer.p.filter(filter).map((itemProperty) => {
|
|
139
133
|
return {
|
|
140
134
|
name: itemProperty.n,
|
|
@@ -6,6 +6,7 @@ const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlo
|
|
|
6
6
|
const Types_1 = require("../../../AdaptableState/Common/Types");
|
|
7
7
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
8
8
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
9
|
+
const GeneralConstants_1 = require("../../../Utilities/Constants/GeneralConstants");
|
|
9
10
|
const ModuleConstants_1 = require("../../../Utilities/Constants/ModuleConstants");
|
|
10
11
|
const InfiniteTable_1 = require("../../../components/InfiniteTable");
|
|
11
12
|
const Flex_1 = require("../../../components/Flex");
|
|
@@ -81,7 +82,7 @@ const EntitlementsListForm = (props) => {
|
|
|
81
82
|
render: (params) => {
|
|
82
83
|
const module = params.data.name;
|
|
83
84
|
const accessLevel = entitlementsMap[module];
|
|
84
|
-
return (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module,
|
|
85
|
+
return (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, GeneralConstants_1.ACCESS_LEVEL_FULL), checked: accessLevel === GeneralConstants_1.ACCESS_LEVEL_FULL }));
|
|
85
86
|
},
|
|
86
87
|
},
|
|
87
88
|
readonly: {
|
|
@@ -89,7 +90,7 @@ const EntitlementsListForm = (props) => {
|
|
|
89
90
|
render: (params) => {
|
|
90
91
|
const module = params.data.name;
|
|
91
92
|
const accessLevel = entitlementsMap[module];
|
|
92
|
-
return (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module,
|
|
93
|
+
return (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, GeneralConstants_1.ACCESS_LEVEL_READ_ONLY), checked: accessLevel === GeneralConstants_1.ACCESS_LEVEL_READ_ONLY }));
|
|
93
94
|
},
|
|
94
95
|
},
|
|
95
96
|
hidden: {
|
|
@@ -97,7 +98,7 @@ const EntitlementsListForm = (props) => {
|
|
|
97
98
|
render: (params) => {
|
|
98
99
|
const module = params.data.name;
|
|
99
100
|
const accessLevel = entitlementsMap[module];
|
|
100
|
-
return (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module,
|
|
101
|
+
return (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, GeneralConstants_1.ACCESS_LEVEL_HIDDEN), checked: accessLevel === GeneralConstants_1.ACCESS_LEVEL_HIDDEN }));
|
|
101
102
|
},
|
|
102
103
|
},
|
|
103
104
|
};
|
|
@@ -129,9 +130,9 @@ const DefaultEntitlementForm = (props) => {
|
|
|
129
130
|
}, [abOptions?.entitlementOptions?.defaultAccessLevel]);
|
|
130
131
|
return (React.createElement(FormLayout_1.default, { className: "twa:mb-2" },
|
|
131
132
|
React.createElement(FormLayout_1.FormRow, { label: "Default Entitlement:" },
|
|
132
|
-
React.createElement(Radio_1.default, { onClick: () => handleDefaultEntitlementChange(
|
|
133
|
-
React.createElement(Radio_1.default, { onClick: () => handleDefaultEntitlementChange(
|
|
134
|
-
React.createElement(Radio_1.default, { onClick: () => handleDefaultEntitlementChange(
|
|
133
|
+
React.createElement(Radio_1.default, { onClick: () => handleDefaultEntitlementChange(GeneralConstants_1.ACCESS_LEVEL_FULL), checked: defaultEntitlement === GeneralConstants_1.ACCESS_LEVEL_FULL, className: "twa:mr-3" }, "Visible"),
|
|
134
|
+
React.createElement(Radio_1.default, { onClick: () => handleDefaultEntitlementChange(GeneralConstants_1.ACCESS_LEVEL_READ_ONLY), checked: defaultEntitlement === GeneralConstants_1.ACCESS_LEVEL_READ_ONLY, className: "twa:mr-3" }, "Read Only"),
|
|
135
|
+
React.createElement(Radio_1.default, { onClick: () => handleDefaultEntitlementChange(GeneralConstants_1.ACCESS_LEVEL_HIDDEN), checked: defaultEntitlement === GeneralConstants_1.ACCESS_LEVEL_HIDDEN }, "Hidden"))));
|
|
135
136
|
};
|
|
136
137
|
const EntitlementsForm = (props) => {
|
|
137
138
|
let abOptions = props.adaptableOptions;
|
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AlertEmptyView = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
6
7
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
7
8
|
const AlertEmptyView = (props) => {
|
|
8
9
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
9
10
|
const accessLevel = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(props.module.moduleInfo.ModuleName);
|
|
10
|
-
const text = accessLevel ==
|
|
11
|
+
const text = accessLevel == GeneralConstants_1.ACCESS_LEVEL_READ_ONLY
|
|
11
12
|
? 'You have no Alert Definitions.'
|
|
12
13
|
: "Click 'New' to create a new Alert Definition - this will include the Rule which triggers the Alert, and the behaviour of the Alert.";
|
|
13
14
|
return React.createElement(React.Fragment, null, text);
|
|
@@ -42,7 +42,7 @@ class BulkUpdateViewPanelComponent extends React.Component {
|
|
|
42
42
|
let statusColour = this.getStatusColour();
|
|
43
43
|
let selectedColumn = this.props.BulkUpdateValidationResult.Column;
|
|
44
44
|
let previewPanel = (React.createElement(PreviewResultsPanel_1.PreviewResultsPanel, { previewInfo: this.props.PreviewInfo, api: this.props.api, selectedColumn: selectedColumn, showPanel: true, showHeader: false }));
|
|
45
|
-
const valueSelectorDisabled = this.props.accessLevel ==
|
|
45
|
+
const valueSelectorDisabled = this.props.accessLevel == GeneralConstants.ACCESS_LEVEL_READ_ONLY ||
|
|
46
46
|
!this.props.BulkUpdateValidationResult.IsValid ||
|
|
47
47
|
this.props.api.layoutApi.isCurrentLayoutPivot();
|
|
48
48
|
const valueOperationDisabled = valueSelectorDisabled ||
|
|
@@ -48,7 +48,8 @@ class CellSummaryViewPanelComponent extends React.Component {
|
|
|
48
48
|
};
|
|
49
49
|
});
|
|
50
50
|
let cellSummaryPopover = React.createElement(CellSummaryPopover_1.CellSummaryPopover, { CellSummary: this.props.CellSummary });
|
|
51
|
-
let shouldDisable = this.props.accessLevel ==
|
|
51
|
+
let shouldDisable = this.props.accessLevel == GeneralConstants.ACCESS_LEVEL_READ_ONLY ||
|
|
52
|
+
this.props.CellSummary == null;
|
|
52
53
|
const isToolbar = this.props.viewType === 'Toolbar';
|
|
53
54
|
const elementType = isToolbar ? 'DashboardToolbar' : 'ToolPanel';
|
|
54
55
|
const operationValue = this.getOperationValue() ?? 'N/A';
|
|
@@ -13,6 +13,7 @@ const AdaptableContext_1 = require("../AdaptableContext");
|
|
|
13
13
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../Components/AdaptableInput"));
|
|
14
14
|
const FormatHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/FormatHelper"));
|
|
15
15
|
const Flex_1 = require("../../components/Flex");
|
|
16
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
16
17
|
// Edit Mode
|
|
17
18
|
// [author] [edit, delete]
|
|
18
19
|
// [text-editor] * this is different
|
|
@@ -29,7 +30,7 @@ const CommentsEditor = (props) => {
|
|
|
29
30
|
return api.optionsApi.getUserName();
|
|
30
31
|
}, []);
|
|
31
32
|
const commentThread = (0, react_redux_1.useSelector)((state) => CommentsRedux.GetCellCommentSelector(state.Comment, cellAddress));
|
|
32
|
-
const isReadOnlyModule = api.entitlementApi.getEntitlementAccessLevelForModule('Comment') ===
|
|
33
|
+
const isReadOnlyModule = api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === GeneralConstants_1.ACCESS_LEVEL_READ_ONLY;
|
|
33
34
|
const [activeEditingComment, setActiveEditingComment] = React.useState(() => {
|
|
34
35
|
/**
|
|
35
36
|
* When opening the popup and there is only one comment, we want to open it in edit mode.
|
|
@@ -10,6 +10,7 @@ const AdaptableContext_1 = require("../AdaptableContext");
|
|
|
10
10
|
const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
|
|
11
11
|
const AdaptableButton_1 = require("../Components/AdaptableButton");
|
|
12
12
|
const FormatHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/FormatHelper"));
|
|
13
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
13
14
|
const Flex_1 = require("../../components/Flex");
|
|
14
15
|
const tableDOMProps = {
|
|
15
16
|
style: {
|
|
@@ -29,7 +30,8 @@ const headerOptions = {
|
|
|
29
30
|
};
|
|
30
31
|
const CellComments = (props) => {
|
|
31
32
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
32
|
-
const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') ===
|
|
33
|
+
const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') ===
|
|
34
|
+
GeneralConstants_1.ACCESS_LEVEL_READ_ONLY;
|
|
33
35
|
const formatDate = (date, format) => {
|
|
34
36
|
return FormatHelper_1.default.DateFormatter(date, { Pattern: format });
|
|
35
37
|
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ButtonBase = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const GeneralConstants_1 = require("../../../../Utilities/Constants/GeneralConstants");
|
|
6
7
|
const Flex_1 = require("../../../../components/Flex");
|
|
7
8
|
const clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
8
9
|
const twMerge_1 = require("../../../../twMerge");
|
|
@@ -17,12 +18,12 @@ class ButtonBase extends React.Component {
|
|
|
17
18
|
glyph: '',
|
|
18
19
|
displayMode: 'Glyph+Text',
|
|
19
20
|
transformGlyph: false,
|
|
20
|
-
accessLevel:
|
|
21
|
+
accessLevel: GeneralConstants_1.ACCESS_LEVEL_FULL,
|
|
21
22
|
showDefaultStyle: false,
|
|
22
23
|
};
|
|
23
24
|
render() {
|
|
24
25
|
let isDisabled;
|
|
25
|
-
isDisabled = this.props.accessLevel ==
|
|
26
|
+
isDisabled = this.props.accessLevel == GeneralConstants_1.ACCESS_LEVEL_HIDDEN;
|
|
26
27
|
if (this.props.overrideDisableButton || this.props.disabled) {
|
|
27
28
|
isDisabled = true;
|
|
28
29
|
}
|
|
@@ -8,6 +8,7 @@ const ButtonClone_1 = require("./ButtonClone");
|
|
|
8
8
|
const ButtonDelete_1 = require("./ButtonDelete");
|
|
9
9
|
const ButtonShare_1 = require("./ButtonShare");
|
|
10
10
|
const SuspendToggleButton_1 = require("./SuspendToggleButton/SuspendToggleButton");
|
|
11
|
+
const GeneralConstants_1 = require("../../../Utilities/Constants/GeneralConstants");
|
|
11
12
|
const Flex_1 = require("../../../components/Flex");
|
|
12
13
|
const clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
13
14
|
const stopPropagation = (e) => {
|
|
@@ -27,7 +28,7 @@ class EntityListActionButtons extends React.Component {
|
|
|
27
28
|
overrideDisableShare: false,
|
|
28
29
|
confirmDeleteAction: null,
|
|
29
30
|
entityType: '',
|
|
30
|
-
accessLevel:
|
|
31
|
+
accessLevel: GeneralConstants_1.ACCESS_LEVEL_FULL,
|
|
31
32
|
editSize: 'xsmall',
|
|
32
33
|
deleteSize: 'xsmall',
|
|
33
34
|
shareSize: 'xsmall',
|
|
@@ -40,11 +41,11 @@ class EntityListActionButtons extends React.Component {
|
|
|
40
41
|
'twa:justify-end': justifyContent === 'end',
|
|
41
42
|
}) || 'twa:justify-center';
|
|
42
43
|
return (React.createElement(Flex_1.Flex, { className: `${justifyContentClassName} twa:m-0 twa:p-0`, onClick: stopPropagation },
|
|
43
|
-
this.props.showEdit && (React.createElement(ButtonEdit_1.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 ==
|
|
44
|
-
this.props.showClone && (React.createElement(ButtonClone_1.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 ==
|
|
45
|
-
this.props.showDelete && (React.createElement(ButtonDelete_1.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 ==
|
|
46
|
-
this.props.showShare && (React.createElement(ButtonShare_1.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 ==
|
|
47
|
-
this.props.showSuspend && this.props.suspendableObject && (React.createElement(SuspendToggleButton_1.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 ==
|
|
44
|
+
this.props.showEdit && (React.createElement(ButtonEdit_1.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 == GeneralConstants_1.ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipEdit, accessLevel: this.props.accessLevel })),
|
|
45
|
+
this.props.showClone && (React.createElement(ButtonClone_1.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 == GeneralConstants_1.ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipClone, accessLevel: this.props.cloneAccessLevel })),
|
|
46
|
+
this.props.showDelete && (React.createElement(ButtonDelete_1.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 == GeneralConstants_1.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 })),
|
|
47
|
+
this.props.showShare && (React.createElement(ButtonShare_1.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 == GeneralConstants_1.ACCESS_LEVEL_READ_ONLY, tooltip: this.props.overrideTooltipShare, accessLevel: this.props.accessLevel })),
|
|
48
|
+
this.props.showSuspend && this.props.suspendableObject && (React.createElement(SuspendToggleButton_1.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 == GeneralConstants_1.ACCESS_LEVEL_READ_ONLY }))));
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
exports.EntityListActionButtons = EntityListActionButtons;
|
|
@@ -4,6 +4,7 @@ exports.SuspendToggleButton = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const ToggleButton_1 = require("../../../../components/ToggleButton");
|
|
7
|
+
const GeneralConstants_1 = require("../../../../Utilities/Constants/GeneralConstants");
|
|
7
8
|
const clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
8
9
|
exports.SuspendToggleButton = React.memo(({ suspendableObject, onUnSuspend, onSuspend, style, disabled, accessLevel, className }) => {
|
|
9
10
|
const handleOnChange = React.useCallback((checked) => {
|
|
@@ -14,7 +15,7 @@ exports.SuspendToggleButton = React.memo(({ suspendableObject, onUnSuspend, onSu
|
|
|
14
15
|
onSuspend(suspendableObject);
|
|
15
16
|
}
|
|
16
17
|
}, [onUnSuspend, onSuspend]);
|
|
17
|
-
const preparedDisabled = (accessLevel && accessLevel ===
|
|
18
|
+
const preparedDisabled = (accessLevel && accessLevel === GeneralConstants_1.ACCESS_LEVEL_READ_ONLY) || disabled;
|
|
18
19
|
const isSuspended = suspendableObject.IsSuspended;
|
|
19
20
|
return (React.createElement(ToggleButton_1.ToggleButton, { className: (0, clsx_1.default)(`ab-SuspendButton`, className), "data-name": suspendableObject.IsSuspended ? 'un-suspend' : 'suspend', disabled: preparedDisabled, style: style, onChange: handleOnChange, checked: !isSuspended }, isSuspended ? 'inactive' : 'active'));
|
|
20
21
|
});
|
|
@@ -81,7 +81,6 @@ const ColumnFilterInput = (props) => {
|
|
|
81
81
|
} }));
|
|
82
82
|
}
|
|
83
83
|
if (usePrimitiveInputs === false && (type === 'number' || type === 'text')) {
|
|
84
|
-
// we use the permitted values selector
|
|
85
84
|
return (React.createElement(PermittedValuesSelector_1.PermittedValuesSelector, { allowNewValues: true, searchable: 'inline', value: liveValue, columnId: columnId, onFocus: onFocus, onBlur: onBlur, onChange: (value) => {
|
|
86
85
|
if (value == undefined) {
|
|
87
86
|
onClear();
|
|
@@ -101,7 +100,9 @@ const ColumnFilterInput = (props) => {
|
|
|
101
100
|
borderRadius: 0,
|
|
102
101
|
border: 'none',
|
|
103
102
|
}
|
|
104
|
-
: {
|
|
103
|
+
: {
|
|
104
|
+
width: '100%',
|
|
105
|
+
}, "data-name": "floating-filter-input", onFocus: onFocus, onBlur: onBlur, disabled: disabled, type: type === 'number' ? 'text' : type,
|
|
105
106
|
// autoFocus has to be FALSE because if the input receives focus in the init phase,
|
|
106
107
|
// it may scroll the AG Grid header viewport into view and de-synchronize it (relative to the content viewport)
|
|
107
108
|
autoFocus: false, value: liveValue ?? '', onKeyDown: onKeyDown, showClearButton: false, className: "twa:flex-1", onChange: (e) => {
|
|
@@ -40,7 +40,10 @@ const ColumnFilterInputList = (props) => {
|
|
|
40
40
|
}
|
|
41
41
|
return (React.createElement(React.Fragment, null, (matchingInputs ?? []).map((input, index) => {
|
|
42
42
|
const value = props?.predicate?.args?.[index];
|
|
43
|
-
|
|
43
|
+
const operator = props.predicate?.operator;
|
|
44
|
+
const usePermittedValuesSelector = input === 'number' ||
|
|
45
|
+
(input === 'text' && (operator === 'Equals' || operator === 'NotEquals'));
|
|
46
|
+
return (React.createElement(ColumnFilterInput_1.ColumnFilterInput, { columnId: props.columnId, usePrimitiveInputs: !usePermittedValuesSelector, key: index, disabled: props.disabled, type: input, value: value, onKeyDown: props.onKeyDown, onClear: () => {
|
|
44
47
|
const args = [...props.predicate.args];
|
|
45
48
|
args.splice(index, 1);
|
|
46
49
|
const newPredicate = {
|
|
@@ -4,6 +4,7 @@ exports.PanelDashboard = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const Dashboard_1 = require("../../../../components/Dashboard");
|
|
7
|
+
const GeneralConstants_1 = require("../../../../Utilities/Constants/GeneralConstants");
|
|
7
8
|
class PanelDashboard extends React.Component {
|
|
8
9
|
static defaultProps = {
|
|
9
10
|
showConfigureActionButton: true,
|
|
@@ -11,7 +12,7 @@ class PanelDashboard extends React.Component {
|
|
|
11
12
|
headerText: 'Module',
|
|
12
13
|
onClose: null,
|
|
13
14
|
onConfigure: null,
|
|
14
|
-
accessLevel:
|
|
15
|
+
accessLevel: GeneralConstants_1.ACCESS_LEVEL_FULL,
|
|
15
16
|
};
|
|
16
17
|
render() {
|
|
17
18
|
const { headerText, showConfigureActionButton, showCloseActionButton, onConfigure, onClose, accessLevel, children, } = this.props;
|
|
@@ -32,7 +32,7 @@ const AdaptablePopup = (props) => {
|
|
|
32
32
|
let isStandalone = false;
|
|
33
33
|
let moduleViewContent = null;
|
|
34
34
|
let activeItem = null;
|
|
35
|
-
let accessLevel =
|
|
35
|
+
let accessLevel = GeneralConstants.ACCESS_LEVEL_FULL;
|
|
36
36
|
const firstMenuItem = menuItems.find((menuItem) => menuItem !== '-');
|
|
37
37
|
const firstMenuModule = firstMenuItem?.category;
|
|
38
38
|
let componentModule = props.componentModule;
|
|
@@ -74,7 +74,9 @@ const AdaptablePopup = (props) => {
|
|
|
74
74
|
} },
|
|
75
75
|
React.createElement(AdaptablePopupDialog_1.AdaptablePopupDialog, { dataName: componentModule, baseClassName: baseClassName, className: className, friendlyName: friendlyName, isActionModule: isStandalone, isWindowModal: isWindowModal, onHide: props.onHide, modalContainer: modalContainer },
|
|
76
76
|
!isStandalone && React.createElement(TopBar_1.default, { icon: settingsPanelOptions.icon }, settingsPanelTitle),
|
|
77
|
-
React.createElement(Flex_1.Box, { className: (0, clsx_1.default)('twa:flex twa:flex-row twa:flex-1 twa:min-h-0', 'twa:bg-defaultbackground twa:text-text-on-defaultbackground', accessLevel ==
|
|
77
|
+
React.createElement(Flex_1.Box, { className: (0, clsx_1.default)('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
|
|
78
|
+
? GeneralConstants.READ_ONLY_STYLE
|
|
79
|
+
: '') },
|
|
78
80
|
!isStandalone && (React.createElement(Navigation_1.Navigation, { menuItems: menuItems, api: props.api, activeItem: activeItem, customSettingsPanels: settingsPanelOptions.customSettingsPanels })),
|
|
79
81
|
React.createElement(Flex_1.Box, { className: (0, clsx_1.default)('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)))));
|
|
80
82
|
};
|
|
@@ -4,6 +4,7 @@ exports.AdaptablePopupModuleView = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
7
|
+
const GeneralConstants_1 = require("../../../../Utilities/Constants/GeneralConstants");
|
|
7
8
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
|
|
8
9
|
const EmptyContent_1 = tslib_1.__importDefault(require("../../../../components/EmptyContent"));
|
|
9
10
|
const icons_1 = require("../../../../components/icons");
|
|
@@ -70,7 +71,7 @@ const AdaptablePopupModuleView = (props) => {
|
|
|
70
71
|
if (moduleViewProperties?.abObjectTypes?.length) {
|
|
71
72
|
const items = moduleViewProperties?.abObjectTypes.map((abObjectType) => {
|
|
72
73
|
return {
|
|
73
|
-
disabled: abObjectType?.accessLevel ===
|
|
74
|
+
disabled: abObjectType?.accessLevel === GeneralConstants_1.ACCESS_LEVEL_READ_ONLY,
|
|
74
75
|
onClick: () => {
|
|
75
76
|
setAbObjectType(abObjectType);
|
|
76
77
|
handleOpenEditPopup();
|
|
@@ -4,6 +4,7 @@ exports.getAdaptableToolPanelAgGridComponent = exports.ConnectedAdaptableToolPan
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const kebabCase_1 = tslib_1.__importDefault(require("../../../Utilities/utils/kebabCase"));
|
|
7
|
+
const GeneralConstants_1 = require("../../../Utilities/Constants/GeneralConstants");
|
|
7
8
|
const ToolPanelRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/ToolPanelRedux"));
|
|
8
9
|
const react_redux_1 = require("react-redux");
|
|
9
10
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/ArrayExtensions"));
|
|
@@ -133,7 +134,7 @@ const AdaptableToolPanelComponent = (props) => {
|
|
|
133
134
|
toolPanelButtons.push(moduleButtons.map((x) => {
|
|
134
135
|
let menuItem = props.MainMenuItems.find((y) => y.isVisible && y.category == x);
|
|
135
136
|
if (menuItem) {
|
|
136
|
-
return (React.createElement(SimpleButton_1.default, { "data-name": menuItem.category, key: menuItem.label, icon: menuItem.icon, tone: "none", variant: "text", className: `ab-ToolPanel__Home__${(0, kebabCase_1.default)(menuItem.label)}`, tooltip: menuItem.label, onClick: () => props.onClick(menuItem.reduxAction), accessLevel:
|
|
137
|
+
return (React.createElement(SimpleButton_1.default, { "data-name": menuItem.category, key: menuItem.label, icon: menuItem.icon, tone: "none", variant: "text", className: `ab-ToolPanel__Home__${(0, kebabCase_1.default)(menuItem.label)}`, tooltip: menuItem.label, onClick: () => props.onClick(menuItem.reduxAction), accessLevel: GeneralConstants_1.ACCESS_LEVEL_FULL }));
|
|
137
138
|
}
|
|
138
139
|
}));
|
|
139
140
|
}
|
|
@@ -158,7 +159,7 @@ const AdaptableToolPanelComponent = (props) => {
|
|
|
158
159
|
const buttonVariant = buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'text';
|
|
159
160
|
const buttonTone = buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none';
|
|
160
161
|
const uniqueKey = buttonLabel ?? (0, uuid_1.createUuid)();
|
|
161
|
-
return (React.createElement(SimpleButton_1.default, { key: uniqueKey, variant: buttonVariant, tone: buttonTone, className: `ab-ToolPanel__Home__${(0, kebabCase_1.default)(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled, onClick: () => button.onClick(button, toolPanelContext), accessLevel:
|
|
162
|
+
return (React.createElement(SimpleButton_1.default, { key: uniqueKey, variant: buttonVariant, tone: buttonTone, className: `ab-ToolPanel__Home__${(0, kebabCase_1.default)(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled, onClick: () => button.onClick(button, toolPanelContext), accessLevel: GeneralConstants_1.ACCESS_LEVEL_FULL }, buttonLabel));
|
|
162
163
|
});
|
|
163
164
|
};
|
|
164
165
|
const onSetToolPanelVisibility = (name, checked) => {
|
|
@@ -8,6 +8,7 @@ const AdaptableContext_1 = require("../../AdaptableContext");
|
|
|
8
8
|
const uuid_1 = require("../../../components/utils/uuid");
|
|
9
9
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
|
|
10
10
|
const kebabCase_1 = tslib_1.__importDefault(require("../../../Utilities/utils/kebabCase"));
|
|
11
|
+
const GeneralConstants_1 = require("../../../Utilities/Constants/GeneralConstants");
|
|
11
12
|
const CustomToolPanelContent = (props) => {
|
|
12
13
|
const { customToolPanel } = props;
|
|
13
14
|
const { api } = (0, AdaptableContext_1.useAdaptable)();
|
|
@@ -63,7 +64,7 @@ const CustomToolPanelContent = (props) => {
|
|
|
63
64
|
const buttonVariant = buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'text';
|
|
64
65
|
const buttonTone = buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none';
|
|
65
66
|
const uniqueKey = buttonLabel ?? (0, uuid_1.createUuid)();
|
|
66
|
-
return (React.createElement(SimpleButton_1.default, { key: uniqueKey, variant: buttonVariant, tone: buttonTone, className: `ab-ToolPanel__Home__${(0, kebabCase_1.default)(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled, onClick: () => button.onClick(button, toolPanelContext), accessLevel:
|
|
67
|
+
return (React.createElement(SimpleButton_1.default, { key: uniqueKey, variant: buttonVariant, tone: buttonTone, className: `ab-ToolPanel__Home__${(0, kebabCase_1.default)(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled, onClick: () => button.onClick(button, toolPanelContext), accessLevel: GeneralConstants_1.ACCESS_LEVEL_FULL }, buttonLabel));
|
|
67
68
|
})))));
|
|
68
69
|
};
|
|
69
70
|
exports.CustomToolPanelContent = CustomToolPanelContent;
|
|
@@ -6,6 +6,7 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
8
8
|
const kebabCase_1 = tslib_1.__importDefault(require("../../Utilities/utils/kebabCase"));
|
|
9
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
9
10
|
const CustomDashboardButton = (props) => {
|
|
10
11
|
const { button } = props;
|
|
11
12
|
const [componentRevision, setComponentRevision] = (0, react_1.useState)(1);
|
|
@@ -23,12 +24,12 @@ const CustomDashboardButton = (props) => {
|
|
|
23
24
|
return null;
|
|
24
25
|
}
|
|
25
26
|
const disabled = button.disabled && button.disabled(button, dashboardContext);
|
|
26
|
-
return (React.createElement(SimpleButton_1.default, { key: buttonLabel, "aria-label": buttonLabel, variant: buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'text', tone: buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none', className: `ab-DashboardToolbar__Home__${(0, kebabCase_1.default)(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled || props.accessLevel ==
|
|
27
|
+
return (React.createElement(SimpleButton_1.default, { key: buttonLabel, "aria-label": buttonLabel, variant: buttonStyle && buttonStyle.variant ? buttonStyle.variant : 'text', tone: buttonStyle && buttonStyle.tone ? buttonStyle.tone : 'none', className: `ab-DashboardToolbar__Home__${(0, kebabCase_1.default)(buttonLabel)} ${buttonStyle?.className || ''}`, tooltip: buttonTooltip, icon: buttonIcon, disabled: disabled || props.accessLevel == GeneralConstants_1.ACCESS_LEVEL_READ_ONLY, onClick: () => {
|
|
27
28
|
button.onClick?.(button, dashboardContext);
|
|
28
29
|
setTimeout(() => {
|
|
29
30
|
// mutate state to force a re-rendering
|
|
30
31
|
setComponentRevision(componentRevision + 1);
|
|
31
32
|
}, 16);
|
|
32
|
-
}, accessLevel:
|
|
33
|
+
}, accessLevel: GeneralConstants_1.ACCESS_LEVEL_FULL }, buttonLabel));
|
|
33
34
|
};
|
|
34
35
|
exports.CustomDashboardButton = CustomDashboardButton;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Dashboard = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const kebabCase_1 = tslib_1.__importDefault(require("../../Utilities/utils/kebabCase"));
|
|
6
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
6
7
|
const React = tslib_1.__importStar(require("react"));
|
|
7
8
|
const react_redux_1 = require("react-redux");
|
|
8
9
|
const Dashboard_1 = require("../../components/Dashboard");
|
|
@@ -30,7 +31,7 @@ const DashboardComponent = (props) => {
|
|
|
30
31
|
let visibleDashboardElements = visibleToolbarNames.map((visibleToolbarName) => {
|
|
31
32
|
let customToolbar = customToolbars && customToolbars.find((ct) => ct.name == visibleToolbarName);
|
|
32
33
|
if (customToolbar) {
|
|
33
|
-
if (dashboardAccessLevel !=
|
|
34
|
+
if (dashboardAccessLevel != GeneralConstants_1.ACCESS_LEVEL_HIDDEN) {
|
|
34
35
|
return (React.createElement(Flex_1.Box, { key: customToolbar.name, className: `ab-Dashboard__container ab-Dashboard__container--customToolbar` },
|
|
35
36
|
React.createElement(CustomToolbar_1.CustomToolbarWrapper, { customToolbar: customToolbar, dashboardRevision: props.DashboardRevision })));
|
|
36
37
|
}
|
|
@@ -67,7 +68,7 @@ const DashboardComponent = (props) => {
|
|
|
67
68
|
shortcuts = shortcutsArray.map((x, index) => {
|
|
68
69
|
let menuItem = props.InternalState.Dashboard.DashboardModuleButtons.find((y) => y.isVisible && y.category == x);
|
|
69
70
|
if (menuItem) {
|
|
70
|
-
return (React.createElement(AdaptableButton_1.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__${(0, kebabCase_1.default)(menuItem.label)}`, icon: menuItem.icon, tooltip: menuItem.label, disabled: props.accessLevel ==
|
|
71
|
+
return (React.createElement(AdaptableButton_1.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__${(0, kebabCase_1.default)(menuItem.label)}`, icon: menuItem.icon, tooltip: menuItem.label, disabled: props.accessLevel == GeneralConstants_1.ACCESS_LEVEL_READ_ONLY, onClick: () => props.dispatch(menuItem.reduxAction), accessLevel: GeneralConstants_1.ACCESS_LEVEL_FULL, style: menuItem.category === 'SystemStatus'
|
|
71
72
|
? {
|
|
72
73
|
...UIHelper_1.default.getStyleForMessageType(props.api.systemStatusApi.getCurrentSystemStatusMessageInfo()?.statusType ??
|
|
73
74
|
'Success'),
|
|
@@ -7,6 +7,7 @@ const react_redux_1 = require("react-redux");
|
|
|
7
7
|
const DashboardRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/DashboardRedux"));
|
|
8
8
|
const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
|
|
9
9
|
const DashboardManager_1 = tslib_1.__importDefault(require("../../components/Dashboard/DashboardManager"));
|
|
10
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
10
11
|
const ModuleValueSelector_1 = require("../Components/ModuleValueSelector");
|
|
11
12
|
const PinnedToolbarsSelector_1 = require("./PinnedToolbarsSelector");
|
|
12
13
|
const Flex_1 = require("../../components/Flex");
|
|
@@ -60,8 +61,8 @@ class DashboardPopupComponent extends React.Component {
|
|
|
60
61
|
const allModuleButtons = this.props.InternalState.SettingsPanelModuleEntries.map((x) => x.category);
|
|
61
62
|
const baseClassName = 'ab-Dashboard-Popup';
|
|
62
63
|
const dashboardAccessLevel = this.props.api.entitlementApi.getEntitlementAccessLevelForModule('Dashboard');
|
|
63
|
-
const areDashboardSettingsVisible = dashboardAccessLevel ==
|
|
64
|
-
const isDashboardDisabled = dashboardAccessLevel ===
|
|
64
|
+
const areDashboardSettingsVisible = dashboardAccessLevel == GeneralConstants_1.ACCESS_LEVEL_FULL || dashboardAccessLevel == GeneralConstants_1.ACCESS_LEVEL_READ_ONLY;
|
|
65
|
+
const isDashboardDisabled = dashboardAccessLevel === GeneralConstants_1.ACCESS_LEVEL_READ_ONLY;
|
|
65
66
|
const isModuleCheckboxDisabled = (module) => {
|
|
66
67
|
if (module === 'SettingsPanel') {
|
|
67
68
|
return this.props.api.optionsApi.getSettingsPanelOptions().alwaysShowInDashboard;
|
|
@@ -6,11 +6,12 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
7
7
|
const ModuleManager_1 = require("../../components/DragAndDropContext/ModuleManager");
|
|
8
8
|
const DashboardRedux_1 = require("../../Redux/ActionsReducers/DashboardRedux");
|
|
9
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
9
10
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
10
11
|
const PinnedToolbarsSelector = (props) => {
|
|
11
12
|
const { api } = (0, AdaptableContext_1.useAdaptable)();
|
|
12
13
|
const dashboardAccessLevel = api.entitlementApi.getEntitlementAccessLevelForModule('Dashboard');
|
|
13
|
-
const isDashboardDisabled = dashboardAccessLevel ===
|
|
14
|
+
const isDashboardDisabled = dashboardAccessLevel === GeneralConstants_1.ACCESS_LEVEL_READ_ONLY;
|
|
14
15
|
const dashboardState = (0, react_redux_1.useSelector)((state) => state.Dashboard);
|
|
15
16
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
16
17
|
const pinnedToolbars = dashboardState.PinnedToolbars;
|
|
@@ -6,6 +6,7 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
8
8
|
const usePrevious_1 = tslib_1.__importDefault(require("../../components/utils/usePrevious"));
|
|
9
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
9
10
|
const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
|
|
10
11
|
const buildActionColumnButton_1 = require("./buildActionColumnButton");
|
|
11
12
|
const AdaptableAgGrid_1 = require("../../agGrid/AdaptableAgGrid");
|
|
@@ -120,7 +121,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, adaptableContainerId, agGr
|
|
|
120
121
|
agGridContainer: agGridContainerId,
|
|
121
122
|
},
|
|
122
123
|
entitlementOptions: {
|
|
123
|
-
defaultAccessLevel:
|
|
124
|
+
defaultAccessLevel: GeneralConstants_1.ACCESS_LEVEL_HIDDEN,
|
|
124
125
|
},
|
|
125
126
|
actionColumnOptions: actionColumnOptions,
|
|
126
127
|
initialState: {
|
|
@@ -39,7 +39,9 @@ const ExportViewPanel = (props) => {
|
|
|
39
39
|
}) },
|
|
40
40
|
React.createElement(ReportNameSelector_1.ReportNameSelector, { viewType: props.viewType, reportName: currentReportName, userReports: userReports, onReportNameSelected: (reportName) => exportApi.selectReport(reportName) }),
|
|
41
41
|
React.createElement(ReportFormatSelector_1.ReportFormatSelector, { viewType: props.viewType, reportName: currentReportName, reportFormat: currentFormat, onReportFormatSelected: (reportFormat) => exportApi.selectFormat(reportFormat) }),
|
|
42
|
-
React.createElement(Flex_1.Flex, { className: (0, join_1.default)(accessLevel ==
|
|
42
|
+
React.createElement(Flex_1.Flex, { className: (0, join_1.default)(accessLevel == GeneralConstants.ACCESS_LEVEL_READ_ONLY
|
|
43
|
+
? GeneralConstants.READ_ONLY_STYLE
|
|
44
|
+
: '', `ab-${elementType}__Export__controls twa:w-full`) },
|
|
43
45
|
React.createElement(Flex_1.Flex, { className: "twa:min-w-[44px]" },
|
|
44
46
|
React.createElement(ExportDestinationPicker_1.ExportDestinationPicker, { viewType: props.viewType, reportName: currentReportName, reportFormat: currentFormat })),
|
|
45
47
|
React.createElement(Flex_1.Flex, null,
|