@adaptabletools/adaptable-cjs 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 +5 -21
- 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 +2 -6
- 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 +107 -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 +71 -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 +60 -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 +8 -0
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +5 -1
- 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 +10 -8
- 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 +3 -2
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +5 -4
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +0 -3
- package/src/Utilities/Helpers/AdaptableHelper.js +1 -60
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +6 -1
- 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 +4 -1
- 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 +198 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
- package/src/View/Notes/NotesPopup.js +8 -10
- package/src/View/Theme/ThemeSelector.js +2 -2
- package/src/agGrid/ActionColumnRenderer.js +4 -4
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +7 -5291
- package/src/agGrid/AdaptableAgGrid.d.ts +336 -0
- package/src/agGrid/AdaptableAgGrid.js +3785 -0
- package/src/agGrid/AdaptableLogger.js +78 -13
- package/src/agGrid/AgGridAdapter.d.ts +54 -0
- package/src/agGrid/AgGridAdapter.js +554 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
- package/src/agGrid/AgGridColumnAdapter.js +818 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
- package/src/agGrid/AgGridMenuAdapter.js +276 -0
- package/src/agGrid/AgGridOptionsService.d.ts +11 -0
- package/src/agGrid/AgGridOptionsService.js +54 -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} +73 -10
- 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 +6 -4
- 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 +52 -0
- package/src/migration/VersionUpgrade.d.ts +8 -0
- package/src/migration/VersionUpgrade.js +15 -0
- package/src/migration/VersionUpgrade17.d.ts +18 -0
- package/src/migration/VersionUpgrade17.js +347 -0
- package/src/migration/VersionUpgrade18.d.ts +5 -0
- package/src/migration/VersionUpgrade18.js +10 -0
- package/src/types.d.ts +7 -3
- package/tsconfig.cjs.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 -2
- package/src/agGrid/agGridHelper.d.ts +0 -57
- package/src/agGrid/agGridHelper.js +0 -691
- package/src/agGrid/agGridMenuHelper.d.ts +0 -46
- package/src/agGrid/agGridMenuHelper.js +0 -673
- /package/src/AdaptableOptions/{CommentsOptions.js → CommentOptions.js} +0 -0
- /package/src/AdaptableOptions/{NotesOptions.js → NoteOptions.js} +0 -0
|
@@ -16,3 +16,4 @@ export interface WeightedAverageAggregation {
|
|
|
16
16
|
* Defines which Columns in a Layout display Aggregated values when Row-Grouped
|
|
17
17
|
*/
|
|
18
18
|
export type AggregationColumns = Record<string, string | true | WeightedAverageAggregation>;
|
|
19
|
+
export declare const isWeightedAverageAggregation: (aggFunc: AggregationColumns[keyof AggregationColumns]) => aggFunc is WeightedAverageAggregation;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WEIGHTED_AVERAGE_AGG_FN_NAME = void 0;
|
|
3
|
+
exports.isWeightedAverageAggregation = exports.WEIGHTED_AVERAGE_AGG_FN_NAME = void 0;
|
|
4
4
|
exports.WEIGHTED_AVERAGE_AGG_FN_NAME = 'weightedAvg';
|
|
5
|
+
const isWeightedAverageAggregation = (aggFunc) => {
|
|
6
|
+
return (aggFunc === null || aggFunc === void 0 ? void 0 : aggFunc.type) === 'weightedAverage';
|
|
7
|
+
};
|
|
8
|
+
exports.isWeightedAverageAggregation = isWeightedAverageAggregation;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { AdaptableObject } from '../types';
|
|
2
2
|
import { ConfigState } from './ConfigState';
|
|
3
|
+
/**
|
|
4
|
+
* Predefined Configuration for Notes Module
|
|
5
|
+
*/
|
|
6
|
+
export interface NotesState extends ConfigState {
|
|
7
|
+
/**
|
|
8
|
+
* Collection of AdapTable Notes
|
|
9
|
+
*/
|
|
10
|
+
Notes?: AdaptableNotes;
|
|
11
|
+
}
|
|
3
12
|
/**
|
|
4
13
|
* Note that can be applied to a Cell in AdapTable
|
|
5
14
|
*/
|
|
@@ -11,13 +20,7 @@ export interface AdaptableNote extends AdaptableObject {
|
|
|
11
20
|
/**
|
|
12
21
|
* Value of the Note
|
|
13
22
|
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Author of the Note
|
|
17
|
-
*/
|
|
18
|
-
Author: {
|
|
19
|
-
UserName: string;
|
|
20
|
-
};
|
|
23
|
+
Text: string;
|
|
21
24
|
/**
|
|
22
25
|
* Value in Grid's Primary Key Column
|
|
23
26
|
*/
|
|
@@ -26,21 +29,8 @@ export interface AdaptableNote extends AdaptableObject {
|
|
|
26
29
|
* Id of Column containing the Note
|
|
27
30
|
*/
|
|
28
31
|
ColumnId: string;
|
|
29
|
-
/**
|
|
30
|
-
* Id of this AdapTable instance
|
|
31
|
-
*/
|
|
32
|
-
AdaptableId: string;
|
|
33
32
|
}
|
|
34
33
|
/**
|
|
35
34
|
* Collection of Cell Notes
|
|
36
35
|
*/
|
|
37
36
|
export type AdaptableNotes = AdaptableNote[];
|
|
38
|
-
/**
|
|
39
|
-
* Predefined Configuration for Notes Module
|
|
40
|
-
*/
|
|
41
|
-
export interface NotesState extends ConfigState {
|
|
42
|
-
/**
|
|
43
|
-
* Collection of AdapTable Notes
|
|
44
|
-
*/
|
|
45
|
-
Notes?: AdaptableNotes;
|
|
46
|
-
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AdaptableNote, NotesState } from '../../PredefinedConfig/NotesState';
|
|
2
2
|
import * as Redux from 'redux';
|
|
3
|
+
import { CellAddress } from '../../types';
|
|
3
4
|
/**
|
|
4
5
|
* @ReduxAction A Notes has been added
|
|
5
6
|
*/
|
|
@@ -32,8 +33,6 @@ export declare const NotesAdd: (note: AdaptableNote) => AdaptableNotesAddAction;
|
|
|
32
33
|
export declare const NotesEdit: (note: AdaptableNote) => AdaptableNotesEditAction;
|
|
33
34
|
export declare const NotesDelete: (note: AdaptableNote) => AdaptableNotesDeleteAction;
|
|
34
35
|
export declare const NotesReady: (note: NotesState) => NoteReadyAction;
|
|
35
|
-
export declare const
|
|
36
|
-
|
|
37
|
-
ColumnId: string;
|
|
38
|
-
}) => AdaptableNote[];
|
|
36
|
+
export declare const GetAllNotesSelector: (state: NotesState) => AdaptableNote[];
|
|
37
|
+
export declare const GetNotesSelector: (state: NotesState, address: CellAddress) => AdaptableNote[];
|
|
39
38
|
export declare const NotesReducer: Redux.Reducer<NotesState>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotesReducer = exports.GetNotesSelector = exports.NotesReady = exports.NotesDelete = exports.NotesEdit = exports.NotesAdd = exports.NOTES_READY = exports.NOTES_DELETE = exports.NOTES_EDIT = exports.NOTES_ADD = void 0;
|
|
3
|
+
exports.NotesReducer = exports.GetNotesSelector = exports.GetAllNotesSelector = exports.NotesReady = exports.NotesDelete = exports.NotesEdit = exports.NotesAdd = exports.NOTES_READY = exports.NOTES_DELETE = exports.NOTES_EDIT = exports.NOTES_ADD = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
|
|
6
6
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
@@ -40,21 +40,23 @@ const NotesReady = (note) => ({
|
|
|
40
40
|
notesState: note,
|
|
41
41
|
});
|
|
42
42
|
exports.NotesReady = NotesReady;
|
|
43
|
-
const
|
|
43
|
+
const GetAllNotesSelector = (state) => state.Notes;
|
|
44
|
+
exports.GetAllNotesSelector = GetAllNotesSelector;
|
|
45
|
+
const GetNotesSelector = (state, address) => {
|
|
44
46
|
var _a;
|
|
45
|
-
if (!
|
|
47
|
+
if (!address) {
|
|
46
48
|
return [];
|
|
47
49
|
}
|
|
48
50
|
return ((_a = state === null || state === void 0 ? void 0 : state.Notes) !== null && _a !== void 0 ? _a : []).filter((note) => {
|
|
49
|
-
if (note.PrimaryKeyValue ===
|
|
51
|
+
if (note.PrimaryKeyValue === address.PrimaryKeyValue && note.ColumnId === address.ColumnId) {
|
|
50
52
|
// happy check
|
|
51
53
|
return true;
|
|
52
54
|
}
|
|
53
55
|
// Primary keys retreived from the grid dom are always strings, so we must also consider them strings
|
|
54
|
-
if ((typeof
|
|
55
|
-
(typeof
|
|
56
|
-
return (note.PrimaryKeyValue.toString() ===
|
|
57
|
-
note.ColumnId ===
|
|
56
|
+
if ((typeof address.PrimaryKeyValue === 'number' && typeof note.PrimaryKeyValue === 'string') ||
|
|
57
|
+
(typeof address.PrimaryKeyValue === 'string' && typeof note.PrimaryKeyValue === 'number')) {
|
|
58
|
+
return (note.PrimaryKeyValue.toString() === address.PrimaryKeyValue.toString() &&
|
|
59
|
+
note.ColumnId === address.ColumnId);
|
|
58
60
|
}
|
|
59
61
|
return false;
|
|
60
62
|
});
|
|
@@ -2,8 +2,7 @@ import * as Redux from 'redux';
|
|
|
2
2
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
3
3
|
import { AdaptableState } from '../../PredefinedConfig/AdaptableState';
|
|
4
4
|
import { ConfigState } from '../../PredefinedConfig/ConfigState';
|
|
5
|
-
import {
|
|
6
|
-
import { IAdaptableStore } from './Interface/IAdaptableStore';
|
|
5
|
+
import { IAdaptableStore, LoadStoreConfig } from './Interface/IAdaptableStore';
|
|
7
6
|
type EmitterCallback = (data?: any) => any;
|
|
8
7
|
type EmitterAnyCallback = (eventName: string, data?: any) => any;
|
|
9
8
|
export declare const INIT_STATE = "INIT_STATE";
|
|
@@ -22,7 +21,6 @@ export declare const LoadState: (State: {
|
|
|
22
21
|
[s: string]: ConfigState;
|
|
23
22
|
}) => LoadStateAction;
|
|
24
23
|
export declare class AdaptableStore implements IAdaptableStore {
|
|
25
|
-
private isAgGridReady;
|
|
26
24
|
TheStore: Redux.Store<AdaptableState>;
|
|
27
25
|
Load: Promise<any>;
|
|
28
26
|
private emitter;
|
|
@@ -36,12 +34,12 @@ export declare class AdaptableStore implements IAdaptableStore {
|
|
|
36
34
|
/**
|
|
37
35
|
*
|
|
38
36
|
* @param adaptable The Adaptable instance
|
|
39
|
-
* @param
|
|
37
|
+
* @param postLoadHook A function that hydrates the state after it has been loaded from storage
|
|
40
38
|
*/
|
|
41
|
-
constructor(adaptable: IAdaptable
|
|
39
|
+
constructor(adaptable: IAdaptable);
|
|
42
40
|
destroy(): void;
|
|
43
41
|
getCurrentStorageState(): AdaptableState;
|
|
44
42
|
saveStateNow(adaptable: IAdaptable): Promise<any>;
|
|
45
|
-
loadStore: (
|
|
43
|
+
loadStore: (config: LoadStoreConfig) => Promise<any>;
|
|
46
44
|
}
|
|
47
45
|
export {};
|
|
@@ -51,9 +51,9 @@ const TeamSharingState_1 = require("../../PredefinedConfig/TeamSharingState");
|
|
|
51
51
|
exports.INIT_STATE = 'INIT_STATE';
|
|
52
52
|
exports.LOAD_STATE = 'LOAD_STATE';
|
|
53
53
|
const NON_PERSIST_ACTIONS = {
|
|
54
|
-
[exports.LOAD_STATE]: true,
|
|
55
54
|
'@@INIT': true,
|
|
56
55
|
'@@redux/init': true,
|
|
56
|
+
[exports.LOAD_STATE]: true,
|
|
57
57
|
[exports.INIT_STATE]: true,
|
|
58
58
|
// progress indicators should NOT interfere with state management as it may lead to race conditions due to load/persist state being async
|
|
59
59
|
[SystemRedux_1.SYSTEM_PROGRESS_INDICATOR_SHOW]: true,
|
|
@@ -72,13 +72,12 @@ class AdaptableStore {
|
|
|
72
72
|
/**
|
|
73
73
|
*
|
|
74
74
|
* @param adaptable The Adaptable instance
|
|
75
|
-
* @param
|
|
75
|
+
* @param postLoadHook A function that hydrates the state after it has been loaded from storage
|
|
76
76
|
*/
|
|
77
|
-
constructor(adaptable
|
|
77
|
+
constructor(adaptable) {
|
|
78
78
|
/*
|
|
79
79
|
This is the main store for Adaptable State
|
|
80
80
|
*/
|
|
81
|
-
this.isAgGridReady = isAgGridReady;
|
|
82
81
|
this.loadStorageInProgress = false;
|
|
83
82
|
this.loadStateOnStartup = true; // set to false if you want no state
|
|
84
83
|
this.on = (eventName, callback) => {
|
|
@@ -90,7 +89,9 @@ class AdaptableStore {
|
|
|
90
89
|
this.emit = (eventName, data) => {
|
|
91
90
|
return this.emitter.emit(eventName, data);
|
|
92
91
|
};
|
|
93
|
-
this.loadStore = (
|
|
92
|
+
this.loadStore = (config) => {
|
|
93
|
+
const { adaptable, adaptableStateKey, predefinedConfig, postLoadHook } = config;
|
|
94
|
+
const postProcessState = postLoadHook !== null && postLoadHook !== void 0 ? postLoadHook : ((state) => state);
|
|
94
95
|
this.storageEngine.setStateKey(adaptableStateKey);
|
|
95
96
|
// START STATE LOAD
|
|
96
97
|
this.loadStorageInProgress = true;
|
|
@@ -98,17 +99,15 @@ class AdaptableStore {
|
|
|
98
99
|
.load(predefinedConfig)
|
|
99
100
|
.then((storedState) => {
|
|
100
101
|
if (storedState && this.loadStateOnStartup) {
|
|
101
|
-
this.TheStore.dispatch((0, exports.LoadState)(adaptable.adaptableOptions.stateOptions.applyState(storedState)));
|
|
102
|
+
this.TheStore.dispatch((0, exports.LoadState)(postProcessState(adaptable.adaptableOptions.stateOptions.applyState(storedState))));
|
|
102
103
|
}
|
|
103
104
|
})
|
|
104
|
-
// we need AG Grid to be ready because several states(ex. Layout) depend on its API
|
|
105
|
-
.then(() => this.isAgGridReady)
|
|
106
105
|
.then(() => {
|
|
107
106
|
this.TheStore.dispatch((0, exports.InitState)());
|
|
108
107
|
// END STATE LOAD
|
|
109
108
|
this.loadStorageInProgress = false;
|
|
110
109
|
}, (e) => {
|
|
111
|
-
adaptable.logger.
|
|
110
|
+
adaptable.logger.consoleError('Failed to load previous Adaptable State : ', e);
|
|
112
111
|
//for now i'm still initializing Adaptable even if loading state has failed....
|
|
113
112
|
//we may revisit that later
|
|
114
113
|
this.TheStore.dispatch((0, exports.InitState)());
|
|
@@ -166,17 +165,6 @@ class AdaptableStore {
|
|
|
166
165
|
case exports.LOAD_STATE:
|
|
167
166
|
const { State } = action;
|
|
168
167
|
Object.keys(State).forEach((key) => {
|
|
169
|
-
// this check should be removed in version 12 !!!
|
|
170
|
-
if (key === 'Chart') {
|
|
171
|
-
adaptable.logger.consoleWarn(`DEPRECATED: AdapTable Charts Plugin is deprecated! AG Grid built-in charts are fully supported & integrated in AdapTable.
|
|
172
|
-
|
|
173
|
-
Please contact 'support@adaptabletools.com' if you require any charting features that are not currently available.`);
|
|
174
|
-
}
|
|
175
|
-
if (key === 'SparklineColumn') {
|
|
176
|
-
adaptable.logger.consoleWarn(`DEPRECATED: AdapTable SparklineColumn is deprecated! AG Grid built-in Sparklines are fully supported & integrated in AdapTable.
|
|
177
|
-
|
|
178
|
-
Please contact 'support@adaptabletools.com' if you require any sparklines features that are not currently available.`);
|
|
179
|
-
}
|
|
180
168
|
state[key] = State[key];
|
|
181
169
|
});
|
|
182
170
|
break;
|
|
@@ -257,7 +245,6 @@ class AdaptableStore {
|
|
|
257
245
|
...pluginsMiddleware // the plugins middleware
|
|
258
246
|
)));
|
|
259
247
|
this.storageEngine = storageEngine;
|
|
260
|
-
this.loadStore(adaptable, adaptable.adaptableOptions.adaptableStateKey);
|
|
261
248
|
}
|
|
262
249
|
destroy() {
|
|
263
250
|
var _a;
|
|
@@ -345,7 +332,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
345
332
|
}
|
|
346
333
|
case SystemRedux.SYSTEM_FLASHING_CELL_DELETE_ALL: {
|
|
347
334
|
let ret = next(action);
|
|
348
|
-
adaptable.
|
|
335
|
+
adaptable.redrawBody();
|
|
349
336
|
return ret;
|
|
350
337
|
}
|
|
351
338
|
/*******************
|
|
@@ -401,7 +388,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
401
388
|
});
|
|
402
389
|
}
|
|
403
390
|
// called also for rendered column actions, see RENDERED COLUMN ACTIONS block
|
|
404
|
-
adaptable.
|
|
391
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
405
392
|
return returnAction;
|
|
406
393
|
}
|
|
407
394
|
/*******************
|
|
@@ -416,7 +403,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
416
403
|
case FlashingCellRedux.FLASHING_CELL_DEFINITION_SUSPEND_ALL: {
|
|
417
404
|
const returnAction = next(action);
|
|
418
405
|
// called also for rendered column actions, see RENDERED COLUMN ACTIONS block
|
|
419
|
-
adaptable.
|
|
406
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
420
407
|
return returnAction;
|
|
421
408
|
}
|
|
422
409
|
/**
|
|
@@ -581,11 +568,6 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
581
568
|
/*******************
|
|
582
569
|
* SPECIAL COLUMN ACTIONS
|
|
583
570
|
*******************/
|
|
584
|
-
case CalculatedColumnRedux.CALCULATED_COLUMN_READY: {
|
|
585
|
-
// create aggregated scalar columns at grid startup
|
|
586
|
-
adaptable.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
|
|
587
|
-
return;
|
|
588
|
-
}
|
|
589
571
|
/**
|
|
590
572
|
* Use Case: We have added / edited / deleted a Special Column (i.e. one not in initial ColumnDefs)
|
|
591
573
|
* Action: We update the Special ColumnDefs
|
|
@@ -603,7 +585,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
603
585
|
.createAggregatedScalarLiveValue(returnAction.calculatedColumn);
|
|
604
586
|
adaptable.api.calculatedColumnApi.internalApi.fireCalculatedColumnChangedEvent(action.type, actionTyped.calculatedColumn);
|
|
605
587
|
}
|
|
606
|
-
adaptable.
|
|
588
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
607
589
|
return returnAction;
|
|
608
590
|
}
|
|
609
591
|
/**
|
|
@@ -628,7 +610,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
628
610
|
.getCalculatedColumnExpressionService()
|
|
629
611
|
.destroyAggregatedScalarLiveValue(returnAction.calculatedColumn);
|
|
630
612
|
adaptable.api.calculatedColumnApi.internalApi.fireCalculatedColumnChangedEvent(action.type, actionTyped.calculatedColumn);
|
|
631
|
-
adaptable.
|
|
613
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
632
614
|
return returnAction;
|
|
633
615
|
}
|
|
634
616
|
/**
|
|
@@ -649,7 +631,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
649
631
|
return;
|
|
650
632
|
}
|
|
651
633
|
const returnAction = next(action);
|
|
652
|
-
adaptable.
|
|
634
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
653
635
|
return returnAction;
|
|
654
636
|
}
|
|
655
637
|
/*******************
|
|
@@ -686,7 +668,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
686
668
|
case CustomSortRedux.CUSTOM_SORT_UNSUSPEND_ALL: {
|
|
687
669
|
const returnAction = next(action);
|
|
688
670
|
// called also for alert actions, see ALERT ACTIONS block
|
|
689
|
-
adaptable.
|
|
671
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
690
672
|
return returnAction;
|
|
691
673
|
}
|
|
692
674
|
/*******************
|
|
@@ -1663,24 +1645,14 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
1663
1645
|
*******************/
|
|
1664
1646
|
case exports.INIT_STATE: {
|
|
1665
1647
|
let returnAction = next(action);
|
|
1666
|
-
if (adaptable.
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
let currentLayout = (layoutState === null || layoutState === void 0 ? void 0 : layoutState.CurrentLayout) || (defaultLayout === null || defaultLayout === void 0 ? void 0 : defaultLayout.Name);
|
|
1674
|
-
if (!adaptable.api.layoutApi.getLayoutByName(currentLayout)) {
|
|
1675
|
-
currentLayout = defaultLayout ? defaultLayout.Name : layoutState.Layouts[0].Name;
|
|
1648
|
+
if (adaptable.isReady) {
|
|
1649
|
+
// TODO see #create-create-module-menu
|
|
1650
|
+
// create the module menu (for use in the dashboard and the toolpanel)
|
|
1651
|
+
// we need this here for when the state key is changed
|
|
1652
|
+
// since we need the transient state to be restored in the same
|
|
1653
|
+
// way as when Adaptable is initialised.
|
|
1654
|
+
adaptable.ModuleService.createModuleMenus();
|
|
1676
1655
|
}
|
|
1677
|
-
middlewareAPI.dispatch(LayoutRedux.LayoutSelect(currentLayout));
|
|
1678
|
-
// do this now so it sets module entitlements
|
|
1679
|
-
adaptable.EntitlementService.setModulesEntitlements();
|
|
1680
|
-
// create the module menu (for use in the dashboard and the toolpanel)
|
|
1681
|
-
adaptable.ModuleService.createModuleMenus();
|
|
1682
|
-
// update initial mode of DataChangeHistory
|
|
1683
|
-
adaptable.api.internalApi.initializeDataChangeHistory();
|
|
1684
1656
|
return returnAction;
|
|
1685
1657
|
}
|
|
1686
1658
|
default: {
|
|
@@ -2,10 +2,16 @@ import * as Redux from 'redux';
|
|
|
2
2
|
import { AdaptableState } from '../../../PredefinedConfig/AdaptableState';
|
|
3
3
|
import { PredefinedConfig } from '../../../types';
|
|
4
4
|
import { IAdaptable } from '../../../AdaptableInterfaces/IAdaptable';
|
|
5
|
+
export interface LoadStoreConfig {
|
|
6
|
+
adaptable: IAdaptable;
|
|
7
|
+
adaptableStateKey: string;
|
|
8
|
+
predefinedConfig?: PredefinedConfig;
|
|
9
|
+
postLoadHook?: (state: AdaptableState) => AdaptableState;
|
|
10
|
+
}
|
|
5
11
|
export interface IAdaptableStore {
|
|
6
12
|
TheStore: Redux.Store<AdaptableState>;
|
|
7
13
|
Load: PromiseLike<any>;
|
|
8
|
-
loadStore: (
|
|
14
|
+
loadStore: (config: LoadStoreConfig) => PromiseLike<any>;
|
|
9
15
|
getCurrentStorageState: () => AdaptableState | void;
|
|
10
16
|
saveStateNow: (adaptable: IAdaptable) => Promise<any>;
|
|
11
17
|
on: (eventName: string, callback: (data?: any) => any) => () => void;
|
|
@@ -29,13 +29,12 @@ export declare abstract class AdaptableModuleBase implements IModule {
|
|
|
29
29
|
*/
|
|
30
30
|
isModuleObjectsShareable(): boolean;
|
|
31
31
|
isModuleEditable(): boolean;
|
|
32
|
-
updateOldConfig(): void;
|
|
33
32
|
getModuleAdaptableObjects(): AdaptableObject[];
|
|
34
33
|
getExplicitlyReferencedColumnIds(adaptableObject: AdaptableObject): string[];
|
|
35
34
|
getReferencedNamedQueryNames(adaptableObject: AdaptableObject): string[];
|
|
36
35
|
hasNamedQueryReferences(): boolean;
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
onAdaptableReady(): void;
|
|
37
|
+
onAdaptableStateReloaded(adaptableStateReloadedInfo: AdaptableStateReloadedInfo): void;
|
|
39
38
|
setModuleEntitlement(): void;
|
|
40
39
|
addModuleMenuItem(source: 'ModuleMenu' | 'ModuleButton'): AdaptableMenuItem | undefined;
|
|
41
40
|
addModuleButtonMenuItem(): AdaptableMenuItem | undefined;
|
|
@@ -20,11 +20,11 @@ class AdaptableModuleBase {
|
|
|
20
20
|
};
|
|
21
21
|
this.api = api;
|
|
22
22
|
this.api.eventApi.on('AdaptableReady', () => {
|
|
23
|
-
this.
|
|
23
|
+
this.onAdaptableReady();
|
|
24
24
|
this.api.configApi.dispatchStateReadyAction(this.moduleInfo.ModuleName);
|
|
25
25
|
});
|
|
26
26
|
this.api.eventApi.on('AdaptableStateReloaded', (adaptableStateReloadedInfo) => {
|
|
27
|
-
this.
|
|
27
|
+
this.onAdaptableStateReloaded(adaptableStateReloadedInfo);
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
getViewAccessLevel() {
|
|
@@ -47,9 +47,6 @@ class AdaptableModuleBase {
|
|
|
47
47
|
isModuleEditable() {
|
|
48
48
|
return this.hasRequiredAccessLevel(this.getEditAccessLevel());
|
|
49
49
|
}
|
|
50
|
-
updateOldConfig() {
|
|
51
|
-
// override where deprecated configs have to be migrated
|
|
52
|
-
}
|
|
53
50
|
getModuleAdaptableObjects() {
|
|
54
51
|
// override where necessary in base classes
|
|
55
52
|
return [];
|
|
@@ -67,10 +64,10 @@ class AdaptableModuleBase {
|
|
|
67
64
|
// this will skip the unnecessary evaluation of modules which do not have Named Query references
|
|
68
65
|
return true;
|
|
69
66
|
}
|
|
70
|
-
|
|
67
|
+
onAdaptableReady() {
|
|
71
68
|
// override where necessary in base classes
|
|
72
69
|
}
|
|
73
|
-
|
|
70
|
+
onAdaptableStateReloaded(adaptableStateReloadedInfo) {
|
|
74
71
|
// override where necessary in base classes
|
|
75
72
|
}
|
|
76
73
|
setModuleEntitlement() {
|
|
@@ -8,13 +8,12 @@ import { AdaptableModuleView, AdaptableObjectCompactView, AdaptableObjectView, I
|
|
|
8
8
|
import { AdaptableObject } from '../PredefinedConfig/Common/AdaptableObject';
|
|
9
9
|
export declare class AlertModule extends AdaptableModuleBase implements IModule {
|
|
10
10
|
constructor(api: AdaptableApi);
|
|
11
|
+
onAdaptableReady(): void;
|
|
11
12
|
getModuleAdaptableObjects(config?: {
|
|
12
13
|
includeLayoutNotAssociatedObjects?: boolean;
|
|
13
14
|
}): AdaptableObject[];
|
|
14
15
|
getExplicitlyReferencedColumnIds(alertDefinition: AlertDefinition): string[];
|
|
15
16
|
getReferencedNamedQueryNames(alertDefinition: AlertDefinition): string[];
|
|
16
|
-
updateOldConfig(): void;
|
|
17
|
-
private updateAlertSingleToMultiplePredicates;
|
|
18
17
|
addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
19
18
|
private handleCellDataChanged;
|
|
20
19
|
private handleGridDataChanged;
|
|
@@ -17,12 +17,12 @@ const AlertEmptyView_1 = require("../View/Alert/AlertEmptyView");
|
|
|
17
17
|
const AlertStatusSubPanel_1 = require("../View/Alert/AlertStatusSubPanel");
|
|
18
18
|
const ActiveAlertsPanelItemLabel_1 = require("../View/Alert/ActiveAlertsPanelItemLabel");
|
|
19
19
|
const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
|
|
20
|
-
const updateSingleToMultiplePredicates_1 = require("./Utilities/updateSingleToMultiplePredicates");
|
|
21
|
-
const Helper_1 = require("../Utilities/Helpers/Helper");
|
|
22
20
|
const getAlertType_1 = require("../View/Alert/Utilities/getAlertType");
|
|
23
21
|
class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
24
22
|
constructor(api) {
|
|
25
23
|
super(ModuleConstants.AlertModuleId, ModuleConstants.AlertModuleFriendlyName, 'alert', 'AlertPopup', 'Get notified when things happen in Adaptable that you need to know about', api);
|
|
24
|
+
}
|
|
25
|
+
onAdaptableReady() {
|
|
26
26
|
this.api.internalApi
|
|
27
27
|
.getDataService()
|
|
28
28
|
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
@@ -75,59 +75,6 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
75
75
|
}
|
|
76
76
|
return this.api.namedQueryApi.internalApi.getReferencedNamedQueryNames(queryExpression);
|
|
77
77
|
}
|
|
78
|
-
updateOldConfig() {
|
|
79
|
-
var _a;
|
|
80
|
-
this.updateAlertSingleToMultiplePredicates();
|
|
81
|
-
// 1. Make all (new) Flashing Cells have a Predicate if none exists
|
|
82
|
-
const alertState = this.api.alertApi.getAlertState();
|
|
83
|
-
const flashingAlertDefinitions = alertState.FlashingAlertDefinitions;
|
|
84
|
-
const flashingCellDefinitions = this.api.flashingCellApi.getFlashingCellDefinitions();
|
|
85
|
-
if (ArrayExtensions_1.ArrayExtensions.IsEmpty(flashingCellDefinitions) &&
|
|
86
|
-
ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(flashingAlertDefinitions)) {
|
|
87
|
-
this.api.flashingCellApi.setFlashingCellDefinitions(flashingAlertDefinitions);
|
|
88
|
-
// TODO: state does not clear
|
|
89
|
-
this.api.flashingCellApi.internalApi.clearFlashingCellState();
|
|
90
|
-
}
|
|
91
|
-
(_a = alertState.AlertDefinitions) === null || _a === void 0 ? void 0 : _a.forEach((alertDefinition) => {
|
|
92
|
-
// if ShowPopup then change to DisplayNotificate
|
|
93
|
-
if (alertDefinition.AlertProperties &&
|
|
94
|
-
alertDefinition.AlertProperties.ShowPopup &&
|
|
95
|
-
alertDefinition.AlertProperties.ShowPopup == true &&
|
|
96
|
-
!alertDefinition.AlertProperties.DisplayNotification) {
|
|
97
|
-
alertDefinition.AlertProperties.DisplayNotification = true;
|
|
98
|
-
alertDefinition.AlertProperties.ShowPopup = undefined;
|
|
99
|
-
}
|
|
100
|
-
// if no rule but a predicate then use that
|
|
101
|
-
if (!alertDefinition.Rule) {
|
|
102
|
-
if (alertDefinition.Predicate && alertDefinition.Predicate != undefined) {
|
|
103
|
-
const predicate = alertDefinition.Predicate;
|
|
104
|
-
alertDefinition.Rule = {
|
|
105
|
-
Predicate: predicate,
|
|
106
|
-
};
|
|
107
|
-
alertDefinition.Predicate = undefined;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
//migrate alert definitions with `AggregationExpression` (now `AggregatedBooleanExpression`)
|
|
112
|
-
const obsoleteAggregationExpression = alertDefinition.Rule['AggregationExpression'];
|
|
113
|
-
if (obsoleteAggregationExpression) {
|
|
114
|
-
alertDefinition.Rule.AggregatedBooleanExpression = obsoleteAggregationExpression;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
updateAlertSingleToMultiplePredicates() {
|
|
120
|
-
const alertDefinitions = this.api.alertApi.getAlertDefinitions({
|
|
121
|
-
includeLayoutNotAssociatedObjects: true,
|
|
122
|
-
});
|
|
123
|
-
alertDefinitions.forEach((alertDefinition) => {
|
|
124
|
-
if (alertDefinition.Rule && 'Predicate' in alertDefinition.Rule) {
|
|
125
|
-
const preparedAlertDefinition = (0, Helper_1.cloneObject)(alertDefinition);
|
|
126
|
-
(0, updateSingleToMultiplePredicates_1.updateSingleToMultiplePredicates)(preparedAlertDefinition.Rule);
|
|
127
|
-
this.api.alertApi.editAlertDefinition(preparedAlertDefinition);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
78
|
addContextMenuItems(menuContext) {
|
|
132
79
|
const items = [];
|
|
133
80
|
if (!menuContext.isRowGroupColumn && this.isModuleAvailable()) {
|
|
@@ -8,12 +8,11 @@ import { CalculatedColumn } from '../PredefinedConfig/CalculatedColumnState';
|
|
|
8
8
|
import { AdaptableObjectItemView, IModule } from './Interface/IModule';
|
|
9
9
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
10
10
|
import { AdaptableObject } from '../PredefinedConfig/Common/AdaptableObject';
|
|
11
|
-
import { AdaptableStateReloadedInfo } from '../Api/Events/AdaptableStateReloaded';
|
|
12
11
|
export declare class CalculatedColumnModule extends AdaptableModuleBase implements IModule {
|
|
13
12
|
constructor(api: AdaptableApi);
|
|
14
|
-
|
|
13
|
+
onAdaptableReady(): void;
|
|
14
|
+
onAdaptableStateReloaded(): void;
|
|
15
15
|
getModuleAdaptableObjects(): AdaptableObject[];
|
|
16
|
-
updateOldConfig(): void;
|
|
17
16
|
getExplicitlyReferencedColumnIds(calculatedColumn: CalculatedColumn): string[];
|
|
18
17
|
getReferencedNamedQueryNames(calculatedColumn: CalculatedColumn): string[];
|
|
19
18
|
private isCalculatedColumn;
|
|
@@ -15,35 +15,15 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
15
15
|
constructor(api) {
|
|
16
16
|
super(ModuleConstants.CalculatedColumnModuleId, ModuleConstants.CalculatedColumnFriendlyName, 'chart-and-grid', 'CalculatedColumnPopup', 'Create bespoke columns whose cell value is derived dynamically from an Expression', api);
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
onAdaptableReady() {
|
|
19
|
+
this.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
|
|
20
|
+
}
|
|
21
|
+
onAdaptableStateReloaded() {
|
|
22
|
+
this.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
|
|
21
23
|
}
|
|
22
24
|
getModuleAdaptableObjects() {
|
|
23
25
|
return this.api.calculatedColumnApi.getCalculatedColumns();
|
|
24
26
|
}
|
|
25
|
-
updateOldConfig() {
|
|
26
|
-
const calcColumns = this.api.calculatedColumnApi.getCalculatedColumns();
|
|
27
|
-
let oldCalculatedColumns = [];
|
|
28
|
-
calcColumns.forEach((cc) => {
|
|
29
|
-
if (cc.ColumnExpression && !cc.Query) {
|
|
30
|
-
cc.Query = {
|
|
31
|
-
ScalarExpression: cc.ColumnExpression,
|
|
32
|
-
};
|
|
33
|
-
cc.ColumnExpression = undefined;
|
|
34
|
-
oldCalculatedColumns.push(cc);
|
|
35
|
-
this.api.logWarn(`Updating incorrect Predefined Config for Calculated Column: ${cc.ColumnId}`);
|
|
36
|
-
}
|
|
37
|
-
if (!cc.CalculatedColumnSettings) {
|
|
38
|
-
cc.CalculatedColumnSettings = {
|
|
39
|
-
DataType: 'Number',
|
|
40
|
-
};
|
|
41
|
-
oldCalculatedColumns.push(cc);
|
|
42
|
-
this.api.logWarn(`Updating incorrect Predefined Config for Calculated Column: ${cc.ColumnId}`);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
oldCalculatedColumns.forEach((oldCalcCol) => this.api.calculatedColumnApi.editCalculatedColumn(oldCalcCol));
|
|
46
|
-
}
|
|
47
27
|
getExplicitlyReferencedColumnIds(calculatedColumn) {
|
|
48
28
|
var _a;
|
|
49
29
|
return ((_a = this.api.expressionApi.getColumnsFromExpression(this.api.expressionApi.getAdaptableQueryExpression(calculatedColumn.Query))) !== null && _a !== void 0 ? _a : []);
|
|
@@ -5,7 +5,6 @@ import { ChartDefinition } from '../types';
|
|
|
5
5
|
import { ExternalChartDefinition } from '../PredefinedConfig/ChartingState';
|
|
6
6
|
export declare class ChartingModule extends AdaptableModuleBase implements IModule {
|
|
7
7
|
constructor(api: AdaptableApi);
|
|
8
|
-
updateOldConfig(): void;
|
|
9
8
|
isModuleAvailable(): boolean;
|
|
10
9
|
getModuleAdaptableObjects(): (ChartDefinition | ExternalChartDefinition)[];
|
|
11
10
|
toViewAll(): AdaptableObjectView[];
|
|
@@ -10,34 +10,14 @@ const ChartingRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/Cha
|
|
|
10
10
|
const ChartingStatusBarPopover_1 = require("../View/Charting/ChartingStatusBarPopover");
|
|
11
11
|
const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
|
|
12
12
|
const ChartingState_1 = require("../PredefinedConfig/ChartingState");
|
|
13
|
+
const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
|
|
13
14
|
class ChartingModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
14
15
|
constructor(api) {
|
|
15
16
|
super(ModuleConstants.ChartingModuleId, ModuleConstants.ChartingFriendlyName, 'chart', 'ChartPopup', 'Create AG Grid Charts in order to see Adaptable Data visually', api);
|
|
16
17
|
}
|
|
17
|
-
updateOldConfig() {
|
|
18
|
-
const allChartDefinitions = this.api.chartingApi.getChartDefinitions();
|
|
19
|
-
const chartDefinitionsToUpdate = allChartDefinitions
|
|
20
|
-
.filter((chartDefinition) => 'model' in chartDefinition || !('Name' in chartDefinition))
|
|
21
|
-
.map((charDefinition) => {
|
|
22
|
-
const newChartDefinition = Object.assign({}, charDefinition);
|
|
23
|
-
if ('model' in newChartDefinition) {
|
|
24
|
-
newChartDefinition.Model = charDefinition.model;
|
|
25
|
-
delete newChartDefinition.model;
|
|
26
|
-
}
|
|
27
|
-
if (!('Name' in newChartDefinition)) {
|
|
28
|
-
// default to chartId
|
|
29
|
-
// @ts-ignore possible because First iteration had no 'Name' and model was under 'model' key (lowercase)
|
|
30
|
-
newChartDefinition.Name = newChartDefinition.Model.chartId;
|
|
31
|
-
}
|
|
32
|
-
return newChartDefinition;
|
|
33
|
-
});
|
|
34
|
-
if (chartDefinitionsToUpdate.length > 0) {
|
|
35
|
-
chartDefinitionsToUpdate.forEach((chartDefinition) => this.api.chartingApi.editChartDefinition(chartDefinition));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
18
|
isModuleAvailable() {
|
|
39
19
|
const agChartsAvailable = this.api.chartingApi.isChartingEnabled() && super.isModuleAvailable();
|
|
40
|
-
const externalChartsAvailable = this.api.optionsApi.getChartingOptions().externalChartingOptions;
|
|
20
|
+
const externalChartsAvailable = Helper_1.default.objectHasKeys(this.api.optionsApi.getChartingOptions().externalChartingOptions);
|
|
41
21
|
return Boolean(agChartsAvailable || externalChartsAvailable);
|
|
42
22
|
}
|
|
43
23
|
getModuleAdaptableObjects() {
|
|
@@ -12,8 +12,7 @@ export declare class ColumnFilterModule extends AdaptableModuleBase implements I
|
|
|
12
12
|
getModuleAdaptableObjects(): AdaptableObject[];
|
|
13
13
|
getExplicitlyReferencedColumnIds(columnFilter: ColumnFilter): string[];
|
|
14
14
|
hasNamedQueryReferences(): boolean;
|
|
15
|
-
|
|
16
|
-
handleAdaptableReady(): void;
|
|
15
|
+
onAdaptableReady(): void;
|
|
17
16
|
addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
18
17
|
addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
19
18
|
private getExistingColumnFilter;
|