@adaptabletools/adaptable 18.0.0-canary.3 → 18.0.0-canary.5
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/agGrid.d.ts +4 -21
- package/agGrid.js +9 -26
- package/base.css +4 -1
- package/base.css.map +1 -1
- package/index.css +79 -68
- package/index.css.map +1 -1
- package/package.json +3 -4
- package/src/AdaptableInterfaces/IAdaptable.d.ts +55 -109
- package/src/AdaptableOptions/AdaptableOptions.d.ts +11 -5
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -4
- package/src/AdaptableOptions/{CommentsOptions.d.ts → CommentOptions.d.ts} +5 -5
- package/src/AdaptableOptions/MenuOptions.d.ts +1 -1
- package/src/AdaptableOptions/MenuOptions.js +1 -5
- package/src/AdaptableOptions/{NotesOptions.d.ts → NoteOptions.d.ts} +1 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -0
- package/src/Api/AdaptableApi.d.ts +5 -0
- package/src/Api/BulkUpdateApi.d.ts +0 -5
- package/src/Api/Events/AdaptableReady.d.ts +3 -3
- package/src/Api/Events/GridDataChanged.d.ts +4 -4
- package/src/Api/GridApi.d.ts +14 -13
- package/src/Api/Implementation/ActionColumnApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ActionColumnApiImpl.js +33 -0
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +3 -0
- package/src/Api/Implementation/ApiBase.d.ts +2 -1
- package/src/Api/Implementation/ApiBase.js +4 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +0 -1
- package/src/Api/Implementation/BulkUpdateApiImpl.js +0 -4
- package/src/Api/Implementation/CommentsApiImpl.js +2 -1
- package/src/Api/Implementation/ConfigApiImpl.js +8 -3
- package/src/Api/Implementation/GridApiImpl.d.ts +3 -3
- package/src/Api/Implementation/GridApiImpl.js +20 -14
- package/src/Api/Implementation/LayoutApiImpl.d.ts +4 -0
- package/src/Api/Implementation/LayoutApiImpl.js +14 -0
- package/src/Api/Implementation/NotesApiImpl.d.ts +2 -4
- package/src/Api/Implementation/NotesApiImpl.js +4 -8
- package/src/Api/Implementation/OptionsApiImpl.d.ts +1 -1
- package/src/Api/Implementation/OptionsApiImpl.js +2 -2
- package/src/Api/Implementation/StatusBarApiImpl.d.ts +0 -1
- package/src/Api/Implementation/StatusBarApiImpl.js +0 -3
- package/src/Api/Implementation/ToolPanelApiImpl.js +6 -6
- package/src/Api/Internal/ActionRowInternalApi.d.ts +5 -1
- package/src/Api/Internal/ActionRowInternalApi.js +106 -0
- package/src/Api/Internal/AdaptableInternalApi.d.ts +3 -4
- package/src/Api/Internal/AdaptableInternalApi.js +10 -8
- package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.js +70 -0
- package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
- package/src/Api/Internal/ColumnFilterInternalApi.js +11 -1
- package/src/Api/Internal/ColumnInternalApi.d.ts +4 -1
- package/src/Api/Internal/ColumnInternalApi.js +12 -0
- package/src/Api/Internal/CustomSortInternalApi.d.ts +3 -2
- package/src/Api/Internal/CustomSortInternalApi.js +32 -1
- package/src/Api/Internal/DataSetInternalApi.js +1 -1
- package/src/Api/Internal/FreeTextColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/FreeTextColumnInternalApi.js +59 -0
- package/src/Api/Internal/GridFilterInternalApi.js +1 -1
- package/src/Api/Internal/GridInternalApi.d.ts +21 -3
- package/src/Api/Internal/GridInternalApi.js +126 -7
- package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
- package/src/Api/InteropioPluginApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +8 -0
- package/src/Api/OptionsApi.d.ts +1 -1
- package/src/EnvVars.d.ts +3 -0
- package/src/EnvVars.js +4 -0
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +3 -0
- package/src/PredefinedConfig/NotesState.d.ts +10 -20
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +3 -4
- package/src/Redux/ActionsReducers/NotesRedux.js +8 -7
- package/src/Redux/Store/AdaptableStore.d.ts +4 -6
- package/src/Redux/Store/AdaptableStore.js +22 -50
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +7 -1
- package/src/Strategy/AdaptableModuleBase.d.ts +2 -3
- package/src/Strategy/AdaptableModuleBase.js +4 -7
- package/src/Strategy/AlertModule.d.ts +1 -2
- package/src/Strategy/AlertModule.js +2 -55
- package/src/Strategy/CalculatedColumnModule.d.ts +2 -3
- package/src/Strategy/CalculatedColumnModule.js +5 -25
- package/src/Strategy/ChartingModule.d.ts +0 -1
- package/src/Strategy/ChartingModule.js +2 -22
- package/src/Strategy/ColumnFilterModule.d.ts +1 -2
- package/src/Strategy/ColumnFilterModule.js +1 -64
- package/src/Strategy/CommentsModule.d.ts +1 -0
- package/src/Strategy/CommentsModule.js +2 -1
- package/src/Strategy/CustomSortModule.js +1 -1
- package/src/Strategy/DashboardModule.d.ts +1 -2
- package/src/Strategy/DashboardModule.js +1 -8
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +3 -1
- package/src/Strategy/DataSetModule.d.ts +1 -1
- package/src/Strategy/DataSetModule.js +1 -1
- package/src/Strategy/FlashingCellModule.d.ts +1 -2
- package/src/Strategy/FlashingCellModule.js +2 -15
- package/src/Strategy/FormatColumnModule.d.ts +0 -2
- package/src/Strategy/FormatColumnModule.js +0 -47
- package/src/Strategy/FreeTextColumnModule.d.ts +0 -1
- package/src/Strategy/FreeTextColumnModule.js +0 -30
- package/src/Strategy/GridFilterModule.d.ts +0 -1
- package/src/Strategy/GridFilterModule.js +0 -37
- package/src/Strategy/Interface/IModule.d.ts +0 -1
- package/src/Strategy/LayoutModule.d.ts +1 -3
- package/src/Strategy/LayoutModule.js +6 -50
- package/src/Strategy/NamedQueryModule.d.ts +0 -1
- package/src/Strategy/NamedQueryModule.js +0 -19
- package/src/Strategy/PlusMinusModule.d.ts +1 -1
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/ScheduleModule.d.ts +1 -1
- package/src/Strategy/ScheduleModule.js +1 -1
- package/src/Strategy/ShortcutModule.d.ts +1 -1
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/StyledColumnModule.d.ts +0 -1
- package/src/Strategy/StyledColumnModule.js +0 -21
- package/src/Strategy/TeamSharingModule.d.ts +1 -0
- package/src/Strategy/TeamSharingModule.js +5 -5
- package/src/Strategy/ToolPanelModule.d.ts +0 -1
- package/src/Strategy/ToolPanelModule.js +0 -23
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
- package/src/Utilities/Constants/GeneralConstants.js +1 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +5 -4
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +0 -3
- package/src/Utilities/Helpers/AdaptableHelper.js +0 -58
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +4 -0
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +3 -1
- package/src/Utilities/Services/CellPopupService.js +0 -1
- package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
- package/src/Utilities/Services/LicenseService/index.js +10 -3
- package/src/Utilities/Services/MetamodelService.d.ts +1 -1
- package/src/Utilities/Services/MetamodelService.js +6 -3
- package/src/Utilities/Services/RowEditService.d.ts +3 -2
- package/src/Utilities/Services/RowEditService.js +3 -1
- package/src/View/AdaptableView.js +0 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/utils.d.ts +1 -1
- package/src/View/CellSummary/CellSummaryPopup.js +1 -1
- package/src/View/Comments/CommentsPopup.js +12 -8
- package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
- package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
- package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +3 -0
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
- package/src/View/GridFilter/GridFilterViewPanel.js +6 -2
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
- package/src/View/Layout/TransposedPopup.d.ts +3 -0
- package/src/View/Layout/TransposedPopup.js +193 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
- package/src/View/Notes/NotesPopup.js +9 -11
- package/src/View/Theme/ThemeSelector.js +3 -3
- package/src/agGrid/ActionColumnRenderer.js +4 -4
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +8 -5292
- package/src/agGrid/AdaptableAgGrid.d.ts +336 -0
- package/src/agGrid/AdaptableAgGrid.js +3780 -0
- package/src/agGrid/AdaptableLogger.js +77 -11
- package/src/agGrid/AgGridAdapter.d.ts +54 -0
- package/src/agGrid/AgGridAdapter.js +549 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
- package/src/agGrid/AgGridColumnAdapter.js +813 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
- package/src/agGrid/AgGridMenuAdapter.js +271 -0
- package/src/agGrid/AgGridOptionsService.d.ts +11 -0
- package/src/agGrid/AgGridOptionsService.js +50 -0
- package/src/agGrid/BadgeRenderer.js +1 -1
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/FilterWrapper.d.ts +2 -2
- package/src/agGrid/FilterWrapper.js +1 -1
- package/src/agGrid/attachAddaptableColumnTypes.d.ts +12 -12
- package/src/agGrid/defaultAdaptableOptions.d.ts +3 -0
- package/src/{Utilities/Defaults/DefaultAdaptableOptions.js → agGrid/defaultAdaptableOptions.js} +70 -9
- package/src/agGrid/editors/AdaptableDateEditor/index.js +2 -2
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/InfiniteTable/index.js +2 -2
- package/src/components/Modal/index.d.ts +1 -0
- package/src/components/Modal/index.js +4 -3
- package/src/components/Select/Select.d.ts +2 -0
- package/src/components/Select/Select.js +2 -2
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +39 -11
- package/src/metamodel/adaptable.metamodel.js +73 -32
- package/src/migration/AdaptableUpgradeHelper.d.ts +38 -0
- package/src/migration/AdaptableUpgradeHelper.js +48 -0
- package/src/migration/VersionUpgrade.d.ts +8 -0
- package/src/migration/VersionUpgrade.js +11 -0
- package/src/migration/VersionUpgrade17.d.ts +18 -0
- package/src/migration/VersionUpgrade17.js +342 -0
- package/src/migration/VersionUpgrade18.d.ts +5 -0
- package/src/migration/VersionUpgrade18.js +6 -0
- package/src/types.d.ts +7 -3
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.d.ts +0 -2
- package/src/Utilities/Services/Interface/IRowEditService.d.ts +0 -3
- package/src/Utilities/Services/Interface/IRowEditService.js +0 -1
- package/src/agGrid/agGridHelper.d.ts +0 -57
- package/src/agGrid/agGridHelper.js +0 -686
- package/src/agGrid/agGridMenuHelper.d.ts +0 -46
- package/src/agGrid/agGridMenuHelper.js +0 -668
- /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
- /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { VersionUpgrade } from './VersionUpgrade';
|
|
2
|
+
import { updateSingleToMultiplePredicates } from '../Strategy/Utilities/updateSingleToMultiplePredicates';
|
|
3
|
+
import ArrayExtensions from '../Utilities/Extensions/ArrayExtensions';
|
|
4
|
+
import ObjectFactory from '../Utilities/ObjectFactory';
|
|
5
|
+
import StringExtensions from '../Utilities/Extensions/StringExtensions';
|
|
6
|
+
export class VersionUpgrade17 extends VersionUpgrade {
|
|
7
|
+
migrateState(state) {
|
|
8
|
+
return this.migrateStateWithMethods(state, [
|
|
9
|
+
this.migrateCalculatedColumnState,
|
|
10
|
+
this.migrateAlertState,
|
|
11
|
+
this.migrateToolPanelState,
|
|
12
|
+
this.migrateStyledColumnState,
|
|
13
|
+
this.migrateNamedQueryState,
|
|
14
|
+
this.migrateGridFilterState,
|
|
15
|
+
this.migrateFreeTextColumnState,
|
|
16
|
+
this.migrateFormatColumnState,
|
|
17
|
+
this.migrateFlashinCellState,
|
|
18
|
+
this.migrateDashboardState,
|
|
19
|
+
this.migrateColumnFilterState,
|
|
20
|
+
this.migrateChartingState,
|
|
21
|
+
]);
|
|
22
|
+
}
|
|
23
|
+
migrateChartingState(state) {
|
|
24
|
+
var _a;
|
|
25
|
+
// const allChartDefinitions = this.api.chartingApi.getChartDefinitions();
|
|
26
|
+
const allChartDefinitions = (_a = state.Charting) === null || _a === void 0 ? void 0 : _a.ChartDefinitions;
|
|
27
|
+
if (Array.isArray(allChartDefinitions)) {
|
|
28
|
+
allChartDefinitions
|
|
29
|
+
.filter((chartDefinition) => 'model' in chartDefinition || !('Name' in chartDefinition))
|
|
30
|
+
.forEach((charDefinition) => {
|
|
31
|
+
if ('model' in charDefinition) {
|
|
32
|
+
charDefinition.Model = charDefinition.model;
|
|
33
|
+
delete charDefinition.model;
|
|
34
|
+
}
|
|
35
|
+
if (!('Name' in charDefinition)) {
|
|
36
|
+
// default to chartId
|
|
37
|
+
// @ts-ignore possible because First iteration had no 'Name' and model was under 'model' key (lowercase)
|
|
38
|
+
charDefinition.Name = charDefinition.Model.chartId;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return state;
|
|
43
|
+
}
|
|
44
|
+
migrateColumnFilterState(state) {
|
|
45
|
+
var _a, _b, _c, _d, _e;
|
|
46
|
+
// Update Module Buttons
|
|
47
|
+
const moduleButtons = (_a = state.Dashboard) === null || _a === void 0 ? void 0 : _a.ModuleButtons;
|
|
48
|
+
if ((moduleButtons === null || moduleButtons === void 0 ? void 0 : moduleButtons.length) && !moduleButtons.includes('ColumnFilter')) {
|
|
49
|
+
const dashboardState = (_b = state.Dashboard) !== null && _b !== void 0 ? _b : {};
|
|
50
|
+
dashboardState.ModuleButtons = moduleButtons.map((moduleButton) => {
|
|
51
|
+
if (moduleButton == 'Filter') {
|
|
52
|
+
return 'ColumnFilter';
|
|
53
|
+
}
|
|
54
|
+
return moduleButton;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
// Update Toolbars
|
|
58
|
+
const tabs = (_c = state.Dashboard) === null || _c === void 0 ? void 0 : _c.Tabs;
|
|
59
|
+
if (Array.isArray(tabs)) {
|
|
60
|
+
state.Dashboard.Tabs = tabs.map((tab) => {
|
|
61
|
+
if (tab.Toolbars.includes('Filter') &&
|
|
62
|
+
!tab.Toolbars.includes('ColumnFilter')) {
|
|
63
|
+
return Object.assign(Object.assign({}, tab), {
|
|
64
|
+
// replace with 'GridFilter'
|
|
65
|
+
Toolbars: tab.Toolbars.map((t) => (t == 'Filter' ? 'ColumnFilter' : t)) });
|
|
66
|
+
}
|
|
67
|
+
return tab;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// - move pinned toolbars
|
|
71
|
+
const pinnedToolbars = (_d = state.Dashboard) === null || _d === void 0 ? void 0 : _d.PinnedToolbars;
|
|
72
|
+
if (pinnedToolbars && !(pinnedToolbars === null || pinnedToolbars === void 0 ? void 0 : pinnedToolbars.includes('ColumnFilter'))) {
|
|
73
|
+
state.Dashboard.PinnedToolbars = pinnedToolbars.map((pinnedToolbar) => {
|
|
74
|
+
if (pinnedToolbar == 'Filter') {
|
|
75
|
+
return 'ColumnFilter';
|
|
76
|
+
}
|
|
77
|
+
return pinnedToolbar;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
// Update Status Bar
|
|
81
|
+
const statusBars = (_e = state.StatusBar) === null || _e === void 0 ? void 0 : _e.StatusBars;
|
|
82
|
+
if (statusBars) {
|
|
83
|
+
state.StatusBar.StatusBars = statusBars.map((panel) => {
|
|
84
|
+
return Object.assign(Object.assign({}, panel), { StatusBarPanels: panel.StatusBarPanels.map((panel) => {
|
|
85
|
+
if (panel === 'Filter') {
|
|
86
|
+
return 'ColumnFilter';
|
|
87
|
+
}
|
|
88
|
+
return panel;
|
|
89
|
+
}) });
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return state;
|
|
93
|
+
}
|
|
94
|
+
migrateDashboardState(state) {
|
|
95
|
+
// let dashboardState: any = this.api.dashboardApi.getDashboardState();
|
|
96
|
+
let dashboardState = state.Dashboard;
|
|
97
|
+
if (dashboardState === null || dashboardState === void 0 ? void 0 : dashboardState.VisibleButtons) {
|
|
98
|
+
this.logger.warn(`Updating Obsolete VisibleButtons Config for DashboardState: [${dashboardState.VisibleButtons}]`);
|
|
99
|
+
state.Dashboard.ModuleButtons = [
|
|
100
|
+
...state.Dashboard.ModuleButtons,
|
|
101
|
+
...dashboardState.VisibleButtons,
|
|
102
|
+
];
|
|
103
|
+
//@ts-ignore delete as no longer needed
|
|
104
|
+
delete state.Dashboard.VisibleButtons;
|
|
105
|
+
}
|
|
106
|
+
return state;
|
|
107
|
+
}
|
|
108
|
+
migrateFlashinCellState(state) {
|
|
109
|
+
const flashingCellState = state.FlashingCell;
|
|
110
|
+
if (Array.isArray(flashingCellState === null || flashingCellState === void 0 ? void 0 : flashingCellState.FlashingCellDefinitions)) {
|
|
111
|
+
flashingCellState.FlashingCellDefinitions.forEach((flashingCellDefinition) => {
|
|
112
|
+
if (flashingCellDefinition.Rule && 'Predicate' in flashingCellDefinition.Rule) {
|
|
113
|
+
updateSingleToMultiplePredicates(flashingCellDefinition.Rule);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return state;
|
|
118
|
+
}
|
|
119
|
+
migrateFormatColumnState(state) {
|
|
120
|
+
var _a, _b, _c, _d;
|
|
121
|
+
// const formatColumns = this.api.formatColumnApi.getFormatColumns();
|
|
122
|
+
const formatColumns = ((_a = state.FormatColumn) === null || _a === void 0 ? void 0 : _a.FormatColumns) || [];
|
|
123
|
+
formatColumns.forEach((formatColumn) => {
|
|
124
|
+
if (formatColumn.Rule && 'Predicate' in formatColumn.Rule) {
|
|
125
|
+
//@ts-ignore ignore
|
|
126
|
+
updateSingleToMultiplePredicates(formatColumn.Rule);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
// update ConditionalStyle StatusBarPanel
|
|
130
|
+
// const oldStatusBars = this.api.internalApi.getState().StatusBar.StatusBars;
|
|
131
|
+
const statusBars = ((_b = state.StatusBar) === null || _b === void 0 ? void 0 : _b.StatusBars) || [];
|
|
132
|
+
let replaceConditionalStyleStatusBar = false;
|
|
133
|
+
statusBars.forEach((statusBar) => (Object.assign(Object.assign({}, statusBar), { StatusBarPanels: [
|
|
134
|
+
...new Set(statusBar.StatusBarPanels.map((statusBarPanel) => {
|
|
135
|
+
if (statusBarPanel === 'ConditionalStyle') {
|
|
136
|
+
replaceConditionalStyleStatusBar = true;
|
|
137
|
+
return 'FormatColumn';
|
|
138
|
+
}
|
|
139
|
+
return statusBarPanel;
|
|
140
|
+
})),
|
|
141
|
+
] })));
|
|
142
|
+
// update ConditionalStyle dashboard buttons
|
|
143
|
+
// const dashboardModuleButtons = this.api.internalApi.getState().Dashboard.ModuleButtons as any;
|
|
144
|
+
const dashboardModuleButtons = (_c = state.Dashboard) === null || _c === void 0 ? void 0 : _c.ModuleButtons;
|
|
145
|
+
if (dashboardModuleButtons && dashboardModuleButtons.includes('ConditionalStyle')) {
|
|
146
|
+
dashboardModuleButtons[dashboardModuleButtons.indexOf('ConditionalStyle')] = 'FormatColumn';
|
|
147
|
+
}
|
|
148
|
+
// update ConditionalStyle toolPanel buttons
|
|
149
|
+
// const toolPanelModuleButtons = this.api.internalApi.getState().ToolPanel.ModuleButtons as any;
|
|
150
|
+
const toolPanelModuleButtons = (_d = state.ToolPanel) === null || _d === void 0 ? void 0 : _d.ModuleButtons;
|
|
151
|
+
if (toolPanelModuleButtons && toolPanelModuleButtons.includes('ConditionalStyle')) {
|
|
152
|
+
toolPanelModuleButtons[toolPanelModuleButtons.indexOf('ConditionalStyle')] = 'FormatColumn';
|
|
153
|
+
}
|
|
154
|
+
return state;
|
|
155
|
+
}
|
|
156
|
+
migrateFreeTextColumnState(state) {
|
|
157
|
+
var _a;
|
|
158
|
+
// make sure all default to type string
|
|
159
|
+
const allFreeTextColumns = ((_a = state.FreeTextColumn) === null || _a === void 0 ? void 0 : _a.FreeTextColumns) || [];
|
|
160
|
+
for (const freeTextColumn of allFreeTextColumns) {
|
|
161
|
+
const unTypedCol = freeTextColumn;
|
|
162
|
+
if (unTypedCol.DataType) {
|
|
163
|
+
const dataType = unTypedCol.DataType;
|
|
164
|
+
delete unTypedCol['DataType'];
|
|
165
|
+
if (!freeTextColumn.FreeTextColumnSettings) {
|
|
166
|
+
freeTextColumn.FreeTextColumnSettings = {
|
|
167
|
+
DataType: dataType,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
freeTextColumn.FreeTextColumnSettings.DataType = dataType;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (!freeTextColumn.FreeTextColumnSettings) {
|
|
175
|
+
freeTextColumn.FreeTextColumnSettings = {
|
|
176
|
+
DataType: 'String',
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
if (!freeTextColumn.FreeTextColumnSettings.DataType) {
|
|
180
|
+
freeTextColumn.FreeTextColumnSettings.DataType = 'String';
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return state;
|
|
184
|
+
}
|
|
185
|
+
migrateGridFilterState(state) {
|
|
186
|
+
var _a, _b;
|
|
187
|
+
const oldQueryState = state.Query;
|
|
188
|
+
if (!oldQueryState) {
|
|
189
|
+
return state;
|
|
190
|
+
}
|
|
191
|
+
// - move query to current layout
|
|
192
|
+
const expression = oldQueryState.CurrentQuery;
|
|
193
|
+
const currentLayout = (_a = state.Layout.Layouts) === null || _a === void 0 ? void 0 : _a.find((l) => l.Name === state.Layout.CurrentLayout);
|
|
194
|
+
const currentGridFilter = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.GridFilter;
|
|
195
|
+
const currentGridFilterExpression = currentGridFilter && !currentGridFilter.IsSuspended ? currentGridFilter.Expression || '' : '';
|
|
196
|
+
if (expression && StringExtensions.IsNullOrEmpty(currentGridFilterExpression)) {
|
|
197
|
+
currentLayout.GridFilter = Object.assign(Object.assign({}, currentGridFilter), { Expression: expression });
|
|
198
|
+
}
|
|
199
|
+
// - move dashboard/toolbar
|
|
200
|
+
(_b = state.Dashboard.Tabs) === null || _b === void 0 ? void 0 : _b.forEach((tab) => {
|
|
201
|
+
if (tab.Toolbars.includes('Query')) {
|
|
202
|
+
tab.Toolbars = tab.Toolbars.map((t) => (t == 'Query' ? 'GridFilter' : t));
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
// - move pinned toolbars
|
|
206
|
+
let updatePinnedToolbars = false;
|
|
207
|
+
if (state.Dashboard.PinnedToolbars) {
|
|
208
|
+
state.Dashboard.PinnedToolbars = state.Dashboard.PinnedToolbars.map((pinnedToolbar) => {
|
|
209
|
+
if (pinnedToolbar == 'Query') {
|
|
210
|
+
return 'GridFilter';
|
|
211
|
+
}
|
|
212
|
+
return pinnedToolbar;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
return state;
|
|
216
|
+
}
|
|
217
|
+
migrateNamedQueryState(state) {
|
|
218
|
+
// - move named queries from old Query State to this Module
|
|
219
|
+
// Note: GridFilter Module moves the "old" CurrentQuery into Layout
|
|
220
|
+
// const oldQueryState: QueryState = this.api.internalApi.getAdaptableState().Query;
|
|
221
|
+
const oldQueryState = state.Query;
|
|
222
|
+
const oldNamedQueries = oldQueryState === null || oldQueryState === void 0 ? void 0 : oldQueryState.NamedQueries;
|
|
223
|
+
if (ArrayExtensions.IsNotNullOrEmpty(oldNamedQueries)) {
|
|
224
|
+
const currentNamedQueries = state.NamedQuery.NamedQueries;
|
|
225
|
+
oldNamedQueries.forEach((oldNamedQuery) => {
|
|
226
|
+
var _a, _b;
|
|
227
|
+
const currentQuery = currentNamedQueries.find((q) => q.Name === oldNamedQuery.Name);
|
|
228
|
+
if (!currentQuery) {
|
|
229
|
+
(_b = (_a = state.NamedQuery) === null || _a === void 0 ? void 0 : _a.NamedQueries) === null || _b === void 0 ? void 0 : _b.push(oldNamedQuery);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
if (oldQueryState) {
|
|
234
|
+
delete state.Query;
|
|
235
|
+
}
|
|
236
|
+
return state;
|
|
237
|
+
}
|
|
238
|
+
migrateStyledColumnState(state) {
|
|
239
|
+
var _a, _b, _c, _d;
|
|
240
|
+
var _e;
|
|
241
|
+
const formatColumnsWithColumnStyles = ((_b = (_a = state.FormatColumn) === null || _a === void 0 ? void 0 : _a.FormatColumns) === null || _b === void 0 ? void 0 : _b.filter((fc) => fc.ColumnStyle)) || [];
|
|
242
|
+
if (!formatColumnsWithColumnStyles.length) {
|
|
243
|
+
return state;
|
|
244
|
+
}
|
|
245
|
+
this.logger.info(`Converting ${formatColumnsWithColumnStyles.length} FormatColumns Styles to Styled Columns`, formatColumnsWithColumnStyles);
|
|
246
|
+
// delete the format columns with column styles
|
|
247
|
+
state.FormatColumn.FormatColumns = (_c = state.FormatColumn.FormatColumns) === null || _c === void 0 ? void 0 : _c.filter((fc) => !fc.ColumnStyle);
|
|
248
|
+
const styledColumns = formatColumnsWithColumnStyles
|
|
249
|
+
.map((formatColumn) => {
|
|
250
|
+
if (!('ColumnIds' in formatColumn.Scope)) {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
return Object.assign(Object.assign(Object.assign({}, ObjectFactory.CreateEmptyStyledColumn()), { ColumnId: formatColumn.Scope.ColumnIds[0] }), formatColumn.ColumnStyle);
|
|
254
|
+
})
|
|
255
|
+
.filter(Boolean);
|
|
256
|
+
(_d = (_e = state.StyledColumn).StyledColumns) !== null && _d !== void 0 ? _d : (_e.StyledColumns = []);
|
|
257
|
+
styledColumns.forEach((styledColumn) => {
|
|
258
|
+
state.StyledColumn.StyledColumns.push(styledColumn);
|
|
259
|
+
});
|
|
260
|
+
return state;
|
|
261
|
+
}
|
|
262
|
+
migrateToolPanelState(state) {
|
|
263
|
+
var _a;
|
|
264
|
+
// const deprecatedToolPanelConfigs: AdaptableToolPanels | undefined = (
|
|
265
|
+
// this.api.toolPanelApi.getToolPanelState() as any
|
|
266
|
+
// ).VisibleToolPanels;
|
|
267
|
+
const deprecatedToolPanelConfigs = (_a = state.ToolPanel) === null || _a === void 0 ? void 0 : _a.VisibleToolPanels;
|
|
268
|
+
if (deprecatedToolPanelConfigs === null || deprecatedToolPanelConfigs === void 0 ? void 0 : deprecatedToolPanelConfigs.length) {
|
|
269
|
+
this.logger.warn(`Updating Obsolete VisibleToolPanels Config for ToolPanelState: [${deprecatedToolPanelConfigs}]`);
|
|
270
|
+
const migratedToolPanelConfigs = deprecatedToolPanelConfigs.map((toolPanel) => ({
|
|
271
|
+
Name: toolPanel,
|
|
272
|
+
State: 'collapsed',
|
|
273
|
+
}));
|
|
274
|
+
state.ToolPanel.ToolPanels = migratedToolPanelConfigs;
|
|
275
|
+
}
|
|
276
|
+
return state;
|
|
277
|
+
}
|
|
278
|
+
migrateAlertState(state) {
|
|
279
|
+
var _a, _b, _c, _d, _e;
|
|
280
|
+
(_b = (_a = state.Alert) === null || _a === void 0 ? void 0 : _a.AlertDefinitions) === null || _b === void 0 ? void 0 : _b.forEach((alertDefinition) => {
|
|
281
|
+
if (alertDefinition.Rule && 'Predicate' in alertDefinition.Rule) {
|
|
282
|
+
updateSingleToMultiplePredicates(alertDefinition.Rule);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
const alertState = state.Alert;
|
|
286
|
+
if (ArrayExtensions.IsEmpty((_c = state.FlashingCell) === null || _c === void 0 ? void 0 : _c.FlashingCellDefinitions) &&
|
|
287
|
+
ArrayExtensions.IsNotNullOrEmpty(alertState === null || alertState === void 0 ? void 0 : alertState.FlashingAlertDefinitions)) {
|
|
288
|
+
state.FlashingCell.FlashingCellDefinitions = alertState.FlashingAlertDefinitions;
|
|
289
|
+
//@ts-ignore delete as no longer needed
|
|
290
|
+
delete state.Alert.FlashingAlertDefinitions;
|
|
291
|
+
}
|
|
292
|
+
(_e = (_d = state.Alert) === null || _d === void 0 ? void 0 : _d.AlertDefinitions) === null || _e === void 0 ? void 0 : _e.forEach((alertDefinition) => {
|
|
293
|
+
// if ShowPopup then change to DisplayNotificate
|
|
294
|
+
if (alertDefinition.AlertProperties &&
|
|
295
|
+
alertDefinition.AlertProperties.ShowPopup &&
|
|
296
|
+
alertDefinition.AlertProperties.ShowPopup == true &&
|
|
297
|
+
!alertDefinition.AlertProperties.DisplayNotification) {
|
|
298
|
+
alertDefinition.AlertProperties.DisplayNotification = true;
|
|
299
|
+
alertDefinition.AlertProperties.ShowPopup = undefined;
|
|
300
|
+
}
|
|
301
|
+
// if no rule but a predicate then use that
|
|
302
|
+
if (!alertDefinition.Rule) {
|
|
303
|
+
if (alertDefinition.Predicate && alertDefinition.Predicate != undefined) {
|
|
304
|
+
const predicate = alertDefinition.Predicate;
|
|
305
|
+
alertDefinition.Rule = {
|
|
306
|
+
Predicate: predicate,
|
|
307
|
+
};
|
|
308
|
+
alertDefinition.Predicate = undefined;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
//migrate alert definitions with `AggregationExpression` (now `AggregatedBooleanExpression`)
|
|
313
|
+
const obsoleteAggregationExpression = alertDefinition.Rule['AggregationExpression'];
|
|
314
|
+
if (obsoleteAggregationExpression) {
|
|
315
|
+
alertDefinition.Rule.AggregatedBooleanExpression = obsoleteAggregationExpression;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
return state;
|
|
320
|
+
}
|
|
321
|
+
migrateCalculatedColumnState(state) {
|
|
322
|
+
var _a, _b;
|
|
323
|
+
(_b = (_a = state.CalculatedColumn) === null || _a === void 0 ? void 0 : _a.CalculatedColumns) === null || _b === void 0 ? void 0 : _b.forEach((cc) => {
|
|
324
|
+
if (cc.ColumnExpression && !cc.Query) {
|
|
325
|
+
cc.Query = {
|
|
326
|
+
ScalarExpression: cc.ColumnExpression,
|
|
327
|
+
};
|
|
328
|
+
cc.ColumnExpression = undefined;
|
|
329
|
+
}
|
|
330
|
+
if (!cc.CalculatedColumnSettings) {
|
|
331
|
+
cc.CalculatedColumnSettings = {
|
|
332
|
+
DataType: 'Number',
|
|
333
|
+
};
|
|
334
|
+
this.logger.warn(`Updating incorrect Predefined Config for Calculated Column: ${cc.ColumnId}`);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
return state;
|
|
338
|
+
}
|
|
339
|
+
migrateUserState(state) {
|
|
340
|
+
return state;
|
|
341
|
+
}
|
|
342
|
+
}
|
package/src/types.d.ts
CHANGED
|
@@ -22,12 +22,14 @@ export type { DataImportValidationError, DataImportOptions, DataImportFileHandle
|
|
|
22
22
|
export type { DataSetOptions, DataSet, DataSetFormContext, } from './AdaptableOptions/DataSetOptions';
|
|
23
23
|
export type { CellSummaryOptions } from './AdaptableOptions/CellSummaryOptions';
|
|
24
24
|
export type { CustomSortOptions, ColumnValuesComparer } from './AdaptableOptions/CustomSortOptions';
|
|
25
|
-
export type { NotesOptions, NotableCellContext } from './AdaptableOptions/
|
|
26
|
-
export type {
|
|
25
|
+
export type { NoteOptions as NotesOptions, NotableCellContext, } from './AdaptableOptions/NoteOptions';
|
|
26
|
+
export type { CommentsOptions, CommentableCellContext, CommentLoadContext as CommentsLoadContext, } from './AdaptableOptions/CommentOptions';
|
|
27
|
+
export type { GroupingOptions, BalancedGroupsKeyContext } from './AdaptableOptions/GroupingOptions';
|
|
27
28
|
export type { IPushPullPluginOptions } from './AdaptableOptions/IPushPullPluginOptions';
|
|
28
29
|
export type { LayoutOptions, LayoutViewOptions, LayoutTagOptions, LayoutAvailableContext, AutoGenerateTagsForLayoutsContext, LayoutAssociatedObject, PivotPreviewColumnsContext, } from './AdaptableOptions/LayoutOptions';
|
|
29
30
|
export type { ChartingOptions, ChartContainer, ExternalChartingContext, ExternalChartingOptions, } from './AdaptableOptions/ChartingOptions';
|
|
30
31
|
export type { OpenFinPluginOptions } from './AdaptableOptions/OpenFinPluginOptions';
|
|
32
|
+
export type { InteropioPluginOptions } from './AdaptableOptions/InteropioPluginOptions';
|
|
31
33
|
export type { MasterDetailPluginOptions, DetailInitContext, } from './AdaptableOptions/MasterDetailPluginOptions';
|
|
32
34
|
export type { DateInputOptions } from './AdaptableOptions/DateInputOptions';
|
|
33
35
|
export type { ColumnFilterOptions, QuickFilterOptions, FilterFormOptions, ValuesFilterOptions, ColumnFilterContext, } from './AdaptableOptions/ColumnFilterOptions';
|
|
@@ -40,7 +42,7 @@ export type { AggregationColumns, WeightedAverageAggregation, } from './Predefin
|
|
|
40
42
|
export type { AccessLevel, Entitlement } from './PredefinedConfig/Common/Entitlement';
|
|
41
43
|
export type { FilterActionOnDataChange } from './PredefinedConfig/Common/FilterActionOnDataChange';
|
|
42
44
|
export type { ConfigState } from './PredefinedConfig/ConfigState';
|
|
43
|
-
export type { AdaptableNote, NotesState
|
|
45
|
+
export type { AdaptableNote, NotesState, AdaptableNotes } from './PredefinedConfig/NotesState';
|
|
44
46
|
export type { TeamSharingOptions, SharedEntitiesContext, } from './AdaptableOptions/TeamSharingOptions';
|
|
45
47
|
export type { ToolPanelOptions, CustomToolPanel, ToolPanelButtonContext, CustomToolPanelButtonContext, } from './AdaptableOptions/ToolPanelOptions';
|
|
46
48
|
export type { UserInterfaceOptions, BasePermittedValues, PermittedValues, EditLookUpPermittedValues, FilterPermittedValues, CustomSortPermittedValues, BulkUpdatePermittedValues, EditLookUpContext, PermittedValuesContext, FilterPermittedValuesContext, BulkUpdatePermittedValuesContext, ObjectTagsContext, CustomIcon, } from './AdaptableOptions/UserInterfaceOptions';
|
|
@@ -81,6 +83,7 @@ export type { FreeTextColumnApi } from './Api/FreeTextColumnApi';
|
|
|
81
83
|
export type { GridApi } from './Api/GridApi';
|
|
82
84
|
export type { IPushPullApi } from './Api/IPushPullApi';
|
|
83
85
|
export type { LayoutApi } from './Api/LayoutApi';
|
|
86
|
+
export type { InteropioPluginApi } from './Api/InteropioPluginApi';
|
|
84
87
|
export type { OpenFinApi } from './Api/OpenFinApi';
|
|
85
88
|
export type { OptionsApi } from './Api/OptionsApi';
|
|
86
89
|
export type { PluginsApi } from './Api/PluginsApi';
|
|
@@ -201,3 +204,4 @@ export type { Fdc3IntentType, Fdc3StandardIntentType, Fdc3CustomIntentType, Comp
|
|
|
201
204
|
export type { Fdc3Options, GridDataContextMapping, ActionColumnDefaultConfiguration, ResolveContextDataContext, RaiseIntentConfig, BroadcastConfig, HandleFdc3IntentContext, HandleFdc3Context, Fdc3ButtonContext, Fdc3AdaptableButton, HandleFdc3IntentResolutionContext, UIControlConfig, Fdc3IntentOptions, Fdc3ContextOptions, RaiseIntentConfiguration, BroadcastConfiguration, FDC3ActionColumn, } from './AdaptableOptions/Fdc3Options';
|
|
202
205
|
export type { CellAddress } from './PredefinedConfig/CellAddress';
|
|
203
206
|
export type { CommentThread, AdaptableComment } from './PredefinedConfig/CommentState';
|
|
207
|
+
export type { UpgradeConfig } from '../agGrid';
|