@adaptabletools/adaptable 18.0.0-canary.1 → 18.0.0-canary.11
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 +11 -3
- package/base.css.map +1 -1
- package/index.css +88 -70
- package/index.css.map +1 -1
- package/package.json +4 -5
- package/src/AdaptableInterfaces/IAdaptable.d.ts +61 -108
- package/src/AdaptableOptions/AdaptableOptions.d.ts +12 -6
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -4
- package/src/AdaptableOptions/ColumnOptions.d.ts +4 -2
- 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/ConfigApi.d.ts +1 -1
- package/src/Api/Events/AdaptableReady.d.ts +3 -3
- package/src/Api/Events/GridDataChanged.d.ts +4 -4
- package/src/Api/GridApi.d.ts +18 -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.d.ts +4 -0
- package/src/Api/Implementation/CommentsApiImpl.js +7 -1
- package/src/Api/Implementation/ConfigApiImpl.js +13 -5
- package/src/Api/Implementation/GridApiImpl.d.ts +4 -3
- package/src/Api/Implementation/GridApiImpl.js +33 -14
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
- package/src/Api/Implementation/LayoutApiImpl.js +15 -0
- package/src/Api/Implementation/NotesApiImpl.d.ts +6 -4
- package/src/Api/Implementation/NotesApiImpl.js +9 -8
- package/src/Api/Implementation/OptionsApiImpl.d.ts +2 -1
- package/src/Api/Implementation/OptionsApiImpl.js +12 -2
- package/src/Api/Implementation/ScopeApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ScopeApiImpl.js +20 -7
- 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/CommentsInternalApi.d.ts +4 -0
- package/src/Api/Internal/CommentsInternalApi.js +14 -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/FormatColumnInternalApi.js +3 -2
- 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/NotesInternalApi.d.ts +4 -0
- package/src/Api/Internal/NotesInternalApi.js +14 -0
- package/src/Api/Internal/TeamSharingInternalApi.js +1 -1
- package/src/Api/InteropioPluginApi.d.ts +2 -2
- package/src/Api/LayoutApi.d.ts +11 -0
- package/src/Api/OptionsApi.d.ts +5 -1
- package/src/Api/ScopeApi.d.ts +10 -0
- package/src/EnvVars.d.ts +3 -0
- package/src/EnvVars.js +4 -0
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableScope.d.ts +4 -1
- package/src/PredefinedConfig/Common/AggregationColumns.d.ts +1 -0
- package/src/PredefinedConfig/Common/AggregationColumns.js +3 -0
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +8 -0
- package/src/PredefinedConfig/Common/RowSummary.d.ts +7 -0
- package/src/PredefinedConfig/Common/RowSummary.js +1 -0
- package/src/PredefinedConfig/LayoutState.d.ts +5 -0
- package/src/PredefinedConfig/NotesState.d.ts +10 -20
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -1
- package/src/PredefinedConfig/SystemState.d.ts +7 -0
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +9 -0
- package/src/Redux/ActionsReducers/LayoutRedux.js +20 -0
- package/src/Redux/ActionsReducers/NotesRedux.d.ts +3 -4
- package/src/Redux/ActionsReducers/NotesRedux.js +8 -7
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +13 -1
- package/src/Redux/Store/AdaptableStore.d.ts +4 -6
- package/src/Redux/Store/AdaptableStore.js +33 -50
- package/src/Redux/Store/Interface/IAdaptableStore.d.ts +8 -2
- 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/CellSummaryModule.d.ts +1 -0
- package/src/Strategy/CellSummaryModule.js +50 -21
- 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 +5 -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 +8 -3
- package/src/Strategy/LayoutModule.js +108 -53
- package/src/Strategy/NamedQueryModule.d.ts +0 -1
- package/src/Strategy/NamedQueryModule.js +0 -19
- package/src/Strategy/NotesModule.js +3 -4
- 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/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +2 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +294 -0
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +1 -1
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +4 -0
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +3 -4
- package/src/Utilities/Helpers/AdaptableHelper.js +18 -58
- package/src/Utilities/Helpers/Helper.d.ts +2 -0
- package/src/Utilities/Helpers/Helper.js +4 -0
- package/src/Utilities/ObjectFactory.js +6 -6
- package/src/Utilities/Services/AggregatedScalarLiveValue.d.ts +3 -2
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +14 -9
- package/src/Utilities/Services/CellPopupService.js +0 -1
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/LicenseService/index.d.ts +3 -0
- package/src/Utilities/Services/LicenseService/index.js +1 -181
- package/src/Utilities/Services/MetamodelService.d.ts +1 -1
- package/src/Utilities/Services/MetamodelService.js +6 -3
- package/src/Utilities/Services/QueryLanguageService.d.ts +1 -1
- package/src/Utilities/Services/QueryLanguageService.js +2 -1
- package/src/Utilities/Services/RowEditService.d.ts +3 -2
- package/src/Utilities/Services/RowEditService.js +3 -1
- package/src/Utilities/Services/SummaryService.d.ts +19 -0
- package/src/Utilities/Services/SummaryService.js +29 -0
- package/src/Utilities/license/decode.js +1 -65
- package/src/Utilities/license/hashing.js +1 -43
- package/src/View/AdaptableView.js +1 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +2 -2
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.d.ts +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +2 -2
- 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/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/NewScopeComponent.js +34 -1
- package/src/View/Components/Popups/AdaptableLoadingScreen.d.ts +6 -5
- package/src/View/Components/Popups/AdaptableLoadingScreen.js +19 -9
- package/src/View/Components/Popups/AdaptableToaster.js +1 -1
- 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 +8 -8
- package/src/View/GridFilter/GridFilterViewPanel.js +7 -3
- package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +2 -3
- package/src/View/Layout/TransposedPopup.d.ts +3 -0
- package/src/View/Layout/TransposedPopup.js +194 -0
- package/src/View/Layout/Wizard/LayoutWizard.js +1 -1
- package/src/View/License/LicenseWatermark.js +1 -61
- package/src/View/Notes/NotesPopup.js +9 -11
- package/src/View/SpecialColumnSettingsWizardStep.js +4 -4
- package/src/View/Theme/ThemeSelector.js +3 -3
- package/src/agGrid/ActionColumnRenderer.js +7 -6
- package/src/agGrid/Adaptable.d.ts +3 -455
- package/src/agGrid/Adaptable.js +8 -5292
- package/src/agGrid/AdaptableAgGrid.d.ts +351 -0
- package/src/agGrid/AdaptableAgGrid.js +3936 -0
- package/src/agGrid/AdaptableLogger.js +77 -11
- package/src/agGrid/AgGridAdapter.d.ts +62 -0
- package/src/agGrid/AgGridAdapter.js +577 -0
- package/src/agGrid/AgGridColumnAdapter.d.ts +56 -0
- package/src/agGrid/AgGridColumnAdapter.js +824 -0
- package/src/agGrid/AgGridMenuAdapter.d.ts +28 -0
- package/src/agGrid/AgGridMenuAdapter.js +271 -0
- package/src/agGrid/AgGridOptionsService.d.ts +12 -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} +70 -9
- package/src/agGrid/editors/AdaptableDateEditor/index.js +2 -2
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +2 -2
- package/src/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/InfiniteTable/index.js +2 -2
- package/src/components/Input/index.d.ts +1 -1
- package/src/components/List/ListGroupItem/index.d.ts +1 -1
- 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/components/icons/index.js +2 -0
- package/src/components/icons/rows.d.ts +3 -0
- package/src/components/icons/rows.js +4 -0
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +74 -11
- package/src/metamodel/adaptable.metamodel.js +1 -9313
- 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/parser/src/types.d.ts +5 -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/View/Components/ScopeComponent.d.ts +0 -24
- package/src/View/Components/ScopeComponent.js +0 -133
- package/src/View/Export/Wizard/ReportScopeWizard.d.ts +0 -17
- package/src/View/Export/Wizard/ReportScopeWizard.js +0 -47
- 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
|
@@ -77,6 +77,7 @@ export declare const SYSTEM_VISUAL_EXPORT_END = "SYSTEM_VISUAL_EXPORT_END";
|
|
|
77
77
|
export declare const SYSTEM_CELL_POPUP_SHOW = "SYSTEM_CELL_POPUP_SHOW";
|
|
78
78
|
export declare const SYSTEM_CELL_POPUP_HIDE = "SYSTEM_CELL_POPUP_HIDE";
|
|
79
79
|
export declare const SYSTEM_CELL_POPUP_EDIT_FOCUSED_ENTITY = "SYSTEM_CELL_POPUP_EDIT_FOCUSED_ENTITY";
|
|
80
|
+
export declare const SYSTEM_SUMMARY_ROW_SET = "SYSTEM_SUMMARY_ROW_SET";
|
|
80
81
|
export declare const DATA_IMPORT_COMPLETED = "DATA_IMPORT_COMPLETED";
|
|
81
82
|
export interface DataImportCompletedAction extends Redux.Action {
|
|
82
83
|
dataImportedInfo: DataImportedInfo;
|
|
@@ -328,6 +329,10 @@ export declare const SystemVisualExportEnd: () => SystemVisualExportEndAction;
|
|
|
328
329
|
export declare const SystemQuickSearchFloatingVisibility: (visible: boolean) => SystemQuickSearchFloatingVisibilityAction;
|
|
329
330
|
export declare const SystemCellPopupShow: (cellPosition: CellAddress, editMode?: boolean) => SystemCellPopupShowAction;
|
|
330
331
|
export declare const SystemCellPopupEditFocusedEntity: (focusedEntity: 'Note' | 'Comment') => SystemCellPopupEditFocusedEntityAction;
|
|
332
|
+
export declare const SystemRowSummartSet: (systemRowSummaries: SystemState['RowSummary']['rowSummaries']) => {
|
|
333
|
+
readonly type: "SYSTEM_SUMMARY_ROW_SET";
|
|
334
|
+
readonly rowSummaries: import("../../PredefinedConfig/SystemState").SystemRowSummary[];
|
|
335
|
+
};
|
|
331
336
|
export declare const SystemCellPopupHide: () => SystemCellPopupHideAction;
|
|
332
337
|
export declare const SystemDisableDeleteConfirmationSelector: (state: SystemState) => boolean;
|
|
333
338
|
export declare const SystemPreviousGroupedColumnsSelector: (state: SystemState) => Record<string, Record<string, number>>;
|
|
@@ -87,10 +87,12 @@ export const SYSTEM_SET_QUICK_SEARCH_FLOATING_VISIBILITY = 'SYSTEM_SET_QUICK_SEA
|
|
|
87
87
|
// Data Export (Report)
|
|
88
88
|
export const SYSTEM_VISUAL_EXPORT_BEGIN = 'SYSTEM_VISUAL_EXPORT_BEGIN';
|
|
89
89
|
export const SYSTEM_VISUAL_EXPORT_END = 'SYSTEM_VISUAL_EXPORT_END';
|
|
90
|
-
// Notes
|
|
90
|
+
// Notes and Comments
|
|
91
91
|
export const SYSTEM_CELL_POPUP_SHOW = 'SYSTEM_CELL_POPUP_SHOW';
|
|
92
92
|
export const SYSTEM_CELL_POPUP_HIDE = 'SYSTEM_CELL_POPUP_HIDE';
|
|
93
93
|
export const SYSTEM_CELL_POPUP_EDIT_FOCUSED_ENTITY = 'SYSTEM_CELL_POPUP_EDIT_FOCUSED_ENTITY';
|
|
94
|
+
// Row Summaries
|
|
95
|
+
export const SYSTEM_SUMMARY_ROW_SET = 'SYSTEM_SUMMARY_ROW_SET';
|
|
94
96
|
// Data Import
|
|
95
97
|
export const DATA_IMPORT_COMPLETED = 'DATA_IMPORT_COMPLETED';
|
|
96
98
|
export const SystemHighlightCellAdd = (cellHighlightInfo) => ({
|
|
@@ -316,6 +318,10 @@ export const SystemCellPopupEditFocusedEntity = (focusedEntity) => ({
|
|
|
316
318
|
type: SYSTEM_CELL_POPUP_EDIT_FOCUSED_ENTITY,
|
|
317
319
|
focusedEntity,
|
|
318
320
|
});
|
|
321
|
+
export const SystemRowSummartSet = (systemRowSummaries) => ({
|
|
322
|
+
type: SYSTEM_SUMMARY_ROW_SET,
|
|
323
|
+
rowSummaries: systemRowSummaries,
|
|
324
|
+
});
|
|
319
325
|
export const SystemCellPopupHide = () => ({
|
|
320
326
|
type: SYSTEM_CELL_POPUP_HIDE,
|
|
321
327
|
});
|
|
@@ -758,6 +764,12 @@ export const SystemReducer = (state = initialState, action) => {
|
|
|
758
764
|
popupPosition: null,
|
|
759
765
|
} });
|
|
760
766
|
}
|
|
767
|
+
case SYSTEM_SUMMARY_ROW_SET: {
|
|
768
|
+
const typedAction = action;
|
|
769
|
+
return Object.assign(Object.assign({}, state), { RowSummary: {
|
|
770
|
+
rowSummaries: typedAction.rowSummaries,
|
|
771
|
+
} });
|
|
772
|
+
}
|
|
761
773
|
default:
|
|
762
774
|
return state;
|
|
763
775
|
}
|
|
@@ -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 {};
|
|
@@ -47,9 +47,9 @@ import { isAdaptableSharedEntity, isCustomSharedEntity, } from '../../Predefined
|
|
|
47
47
|
export const INIT_STATE = 'INIT_STATE';
|
|
48
48
|
export const LOAD_STATE = 'LOAD_STATE';
|
|
49
49
|
const NON_PERSIST_ACTIONS = {
|
|
50
|
-
[LOAD_STATE]: true,
|
|
51
50
|
'@@INIT': true,
|
|
52
51
|
'@@redux/init': true,
|
|
52
|
+
[LOAD_STATE]: true,
|
|
53
53
|
[INIT_STATE]: true,
|
|
54
54
|
// progress indicators should NOT interfere with state management as it may lead to race conditions due to load/persist state being async
|
|
55
55
|
[SYSTEM_PROGRESS_INDICATOR_SHOW]: true,
|
|
@@ -66,13 +66,12 @@ export class AdaptableStore {
|
|
|
66
66
|
/**
|
|
67
67
|
*
|
|
68
68
|
* @param adaptable The Adaptable instance
|
|
69
|
-
* @param
|
|
69
|
+
* @param postLoadHook A function that hydrates the state after it has been loaded from storage
|
|
70
70
|
*/
|
|
71
|
-
constructor(adaptable
|
|
71
|
+
constructor(adaptable) {
|
|
72
72
|
/*
|
|
73
73
|
This is the main store for Adaptable State
|
|
74
74
|
*/
|
|
75
|
-
this.isAgGridReady = isAgGridReady;
|
|
76
75
|
this.loadStorageInProgress = false;
|
|
77
76
|
this.loadStateOnStartup = true; // set to false if you want no state
|
|
78
77
|
this.on = (eventName, callback) => {
|
|
@@ -84,7 +83,9 @@ export class AdaptableStore {
|
|
|
84
83
|
this.emit = (eventName, data) => {
|
|
85
84
|
return this.emitter.emit(eventName, data);
|
|
86
85
|
};
|
|
87
|
-
this.loadStore = (
|
|
86
|
+
this.loadStore = (config) => {
|
|
87
|
+
const { adaptable, adaptableStateKey, predefinedConfig, postLoadHook } = config;
|
|
88
|
+
const postProcessState = postLoadHook !== null && postLoadHook !== void 0 ? postLoadHook : ((state) => state);
|
|
88
89
|
this.storageEngine.setStateKey(adaptableStateKey);
|
|
89
90
|
// START STATE LOAD
|
|
90
91
|
this.loadStorageInProgress = true;
|
|
@@ -92,17 +93,15 @@ export class AdaptableStore {
|
|
|
92
93
|
.load(predefinedConfig)
|
|
93
94
|
.then((storedState) => {
|
|
94
95
|
if (storedState && this.loadStateOnStartup) {
|
|
95
|
-
this.TheStore.dispatch(LoadState(adaptable.adaptableOptions.stateOptions.applyState(storedState)));
|
|
96
|
+
this.TheStore.dispatch(LoadState(postProcessState(adaptable.adaptableOptions.stateOptions.applyState(storedState))));
|
|
96
97
|
}
|
|
97
98
|
})
|
|
98
|
-
// we need AG Grid to be ready because several states(ex. Layout) depend on its API
|
|
99
|
-
.then(() => this.isAgGridReady)
|
|
100
99
|
.then(() => {
|
|
101
100
|
this.TheStore.dispatch(InitState());
|
|
102
101
|
// END STATE LOAD
|
|
103
102
|
this.loadStorageInProgress = false;
|
|
104
103
|
}, (e) => {
|
|
105
|
-
adaptable.logger.
|
|
104
|
+
adaptable.logger.consoleError('Failed to load previous Adaptable State : ', e);
|
|
106
105
|
//for now i'm still initializing Adaptable even if loading state has failed....
|
|
107
106
|
//we may revisit that later
|
|
108
107
|
this.TheStore.dispatch(InitState());
|
|
@@ -160,17 +159,6 @@ export class AdaptableStore {
|
|
|
160
159
|
case LOAD_STATE:
|
|
161
160
|
const { State } = action;
|
|
162
161
|
Object.keys(State).forEach((key) => {
|
|
163
|
-
// this check should be removed in version 12 !!!
|
|
164
|
-
if (key === 'Chart') {
|
|
165
|
-
adaptable.logger.consoleWarn(`DEPRECATED: AdapTable Charts Plugin is deprecated! AG Grid built-in charts are fully supported & integrated in AdapTable.
|
|
166
|
-
|
|
167
|
-
Please contact 'support@adaptabletools.com' if you require any charting features that are not currently available.`);
|
|
168
|
-
}
|
|
169
|
-
if (key === 'SparklineColumn') {
|
|
170
|
-
adaptable.logger.consoleWarn(`DEPRECATED: AdapTable SparklineColumn is deprecated! AG Grid built-in Sparklines are fully supported & integrated in AdapTable.
|
|
171
|
-
|
|
172
|
-
Please contact 'support@adaptabletools.com' if you require any sparklines features that are not currently available.`);
|
|
173
|
-
}
|
|
174
162
|
state[key] = State[key];
|
|
175
163
|
});
|
|
176
164
|
break;
|
|
@@ -251,7 +239,6 @@ export class AdaptableStore {
|
|
|
251
239
|
...pluginsMiddleware // the plugins middleware
|
|
252
240
|
)));
|
|
253
241
|
this.storageEngine = storageEngine;
|
|
254
|
-
this.loadStore(adaptable, adaptable.adaptableOptions.adaptableStateKey);
|
|
255
242
|
}
|
|
256
243
|
destroy() {
|
|
257
244
|
var _a;
|
|
@@ -323,6 +310,16 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
323
310
|
const ret = next(action);
|
|
324
311
|
return ret;
|
|
325
312
|
}
|
|
313
|
+
/*******************
|
|
314
|
+
* System Row Summary ACTIONS
|
|
315
|
+
*******************/
|
|
316
|
+
case SystemRedux.SYSTEM_SUMMARY_ROW_SET: {
|
|
317
|
+
let nextAction = next(action);
|
|
318
|
+
setTimeout(() => {
|
|
319
|
+
adaptable.setupRowSummaries();
|
|
320
|
+
}, 0);
|
|
321
|
+
return nextAction;
|
|
322
|
+
}
|
|
326
323
|
/*******************
|
|
327
324
|
* FLASHING CELL ACTIONS
|
|
328
325
|
*******************/
|
|
@@ -338,7 +335,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
338
335
|
}
|
|
339
336
|
case SystemRedux.SYSTEM_FLASHING_CELL_DELETE_ALL: {
|
|
340
337
|
let ret = next(action);
|
|
341
|
-
adaptable.
|
|
338
|
+
adaptable.redrawBody();
|
|
342
339
|
return ret;
|
|
343
340
|
}
|
|
344
341
|
/*******************
|
|
@@ -394,7 +391,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
394
391
|
});
|
|
395
392
|
}
|
|
396
393
|
// called also for rendered column actions, see RENDERED COLUMN ACTIONS block
|
|
397
|
-
adaptable.
|
|
394
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
398
395
|
return returnAction;
|
|
399
396
|
}
|
|
400
397
|
/*******************
|
|
@@ -409,7 +406,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
409
406
|
case FlashingCellRedux.FLASHING_CELL_DEFINITION_SUSPEND_ALL: {
|
|
410
407
|
const returnAction = next(action);
|
|
411
408
|
// called also for rendered column actions, see RENDERED COLUMN ACTIONS block
|
|
412
|
-
adaptable.
|
|
409
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
413
410
|
return returnAction;
|
|
414
411
|
}
|
|
415
412
|
/**
|
|
@@ -574,11 +571,6 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
574
571
|
/*******************
|
|
575
572
|
* SPECIAL COLUMN ACTIONS
|
|
576
573
|
*******************/
|
|
577
|
-
case CalculatedColumnRedux.CALCULATED_COLUMN_READY: {
|
|
578
|
-
// create aggregated scalar columns at grid startup
|
|
579
|
-
adaptable.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
|
|
580
|
-
return;
|
|
581
|
-
}
|
|
582
574
|
/**
|
|
583
575
|
* Use Case: We have added / edited / deleted a Special Column (i.e. one not in initial ColumnDefs)
|
|
584
576
|
* Action: We update the Special ColumnDefs
|
|
@@ -596,7 +588,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
596
588
|
.createAggregatedScalarLiveValue(returnAction.calculatedColumn);
|
|
597
589
|
adaptable.api.calculatedColumnApi.internalApi.fireCalculatedColumnChangedEvent(action.type, actionTyped.calculatedColumn);
|
|
598
590
|
}
|
|
599
|
-
adaptable.
|
|
591
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
600
592
|
return returnAction;
|
|
601
593
|
}
|
|
602
594
|
/**
|
|
@@ -621,7 +613,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
621
613
|
.getCalculatedColumnExpressionService()
|
|
622
614
|
.destroyAggregatedScalarLiveValue(returnAction.calculatedColumn);
|
|
623
615
|
adaptable.api.calculatedColumnApi.internalApi.fireCalculatedColumnChangedEvent(action.type, actionTyped.calculatedColumn);
|
|
624
|
-
adaptable.
|
|
616
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
625
617
|
return returnAction;
|
|
626
618
|
}
|
|
627
619
|
/**
|
|
@@ -642,7 +634,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
642
634
|
return;
|
|
643
635
|
}
|
|
644
636
|
const returnAction = next(action);
|
|
645
|
-
adaptable.
|
|
637
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
646
638
|
return returnAction;
|
|
647
639
|
}
|
|
648
640
|
/*******************
|
|
@@ -679,7 +671,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
679
671
|
case CustomSortRedux.CUSTOM_SORT_UNSUSPEND_ALL: {
|
|
680
672
|
const returnAction = next(action);
|
|
681
673
|
// called also for alert actions, see ALERT ACTIONS block
|
|
682
|
-
adaptable.
|
|
674
|
+
adaptable.updateColumnModelAndRefreshGrid();
|
|
683
675
|
return returnAction;
|
|
684
676
|
}
|
|
685
677
|
/*******************
|
|
@@ -1063,6 +1055,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
1063
1055
|
adaptable.setLayout(savingLayout);
|
|
1064
1056
|
}
|
|
1065
1057
|
}
|
|
1058
|
+
adaptable.refreshQuickFilter();
|
|
1066
1059
|
return returnAction;
|
|
1067
1060
|
}
|
|
1068
1061
|
/*******************
|
|
@@ -1656,24 +1649,14 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
1656
1649
|
*******************/
|
|
1657
1650
|
case INIT_STATE: {
|
|
1658
1651
|
let returnAction = next(action);
|
|
1659
|
-
if (adaptable.
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
let currentLayout = (layoutState === null || layoutState === void 0 ? void 0 : layoutState.CurrentLayout) || (defaultLayout === null || defaultLayout === void 0 ? void 0 : defaultLayout.Name);
|
|
1667
|
-
if (!adaptable.api.layoutApi.getLayoutByName(currentLayout)) {
|
|
1668
|
-
currentLayout = defaultLayout ? defaultLayout.Name : layoutState.Layouts[0].Name;
|
|
1652
|
+
if (adaptable.isReady) {
|
|
1653
|
+
// TODO see #create-create-module-menu
|
|
1654
|
+
// create the module menu (for use in the dashboard and the toolpanel)
|
|
1655
|
+
// we need this here for when the state key is changed
|
|
1656
|
+
// since we need the transient state to be restored in the same
|
|
1657
|
+
// way as when Adaptable is initialised.
|
|
1658
|
+
adaptable.ModuleService.createModuleMenus();
|
|
1669
1659
|
}
|
|
1670
|
-
middlewareAPI.dispatch(LayoutRedux.LayoutSelect(currentLayout));
|
|
1671
|
-
// do this now so it sets module entitlements
|
|
1672
|
-
adaptable.EntitlementService.setModulesEntitlements();
|
|
1673
|
-
// create the module menu (for use in the dashboard and the toolpanel)
|
|
1674
|
-
adaptable.ModuleService.createModuleMenus();
|
|
1675
|
-
// update initial mode of DataChangeHistory
|
|
1676
|
-
adaptable.api.internalApi.initializeDataChangeHistory();
|
|
1677
1660
|
return returnAction;
|
|
1678
1661
|
}
|
|
1679
1662
|
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
|
-
Load:
|
|
8
|
-
loadStore: (
|
|
13
|
+
Load: Promise<any>;
|
|
14
|
+
loadStore: (config: LoadStoreConfig) => Promise<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;
|
|
@@ -16,11 +16,11 @@ export class AdaptableModuleBase {
|
|
|
16
16
|
};
|
|
17
17
|
this.api = api;
|
|
18
18
|
this.api.eventApi.on('AdaptableReady', () => {
|
|
19
|
-
this.
|
|
19
|
+
this.onAdaptableReady();
|
|
20
20
|
this.api.configApi.dispatchStateReadyAction(this.moduleInfo.ModuleName);
|
|
21
21
|
});
|
|
22
22
|
this.api.eventApi.on('AdaptableStateReloaded', (adaptableStateReloadedInfo) => {
|
|
23
|
-
this.
|
|
23
|
+
this.onAdaptableStateReloaded(adaptableStateReloadedInfo);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
getViewAccessLevel() {
|
|
@@ -43,9 +43,6 @@ export class AdaptableModuleBase {
|
|
|
43
43
|
isModuleEditable() {
|
|
44
44
|
return this.hasRequiredAccessLevel(this.getEditAccessLevel());
|
|
45
45
|
}
|
|
46
|
-
updateOldConfig() {
|
|
47
|
-
// override where deprecated configs have to be migrated
|
|
48
|
-
}
|
|
49
46
|
getModuleAdaptableObjects() {
|
|
50
47
|
// override where necessary in base classes
|
|
51
48
|
return [];
|
|
@@ -63,10 +60,10 @@ export class AdaptableModuleBase {
|
|
|
63
60
|
// this will skip the unnecessary evaluation of modules which do not have Named Query references
|
|
64
61
|
return true;
|
|
65
62
|
}
|
|
66
|
-
|
|
63
|
+
onAdaptableReady() {
|
|
67
64
|
// override where necessary in base classes
|
|
68
65
|
}
|
|
69
|
-
|
|
66
|
+
onAdaptableStateReloaded(adaptableStateReloadedInfo) {
|
|
70
67
|
// override where necessary in base classes
|
|
71
68
|
}
|
|
72
69
|
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;
|
|
@@ -13,12 +13,12 @@ import { AlertEmptyView } from '../View/Alert/AlertEmptyView';
|
|
|
13
13
|
import { AlertStatusPanel } from '../View/Alert/AlertStatusSubPanel';
|
|
14
14
|
import { ActiveAlertsPanelItemLabel } from '../View/Alert/ActiveAlertsPanelItemLabel';
|
|
15
15
|
import { getObjectTagsViewItems } from './Utilities/getObjectTagsViewItems';
|
|
16
|
-
import { updateSingleToMultiplePredicates } from './Utilities/updateSingleToMultiplePredicates';
|
|
17
|
-
import { cloneObject } from '../Utilities/Helpers/Helper';
|
|
18
16
|
import { getAlertType } from '../View/Alert/Utilities/getAlertType';
|
|
19
17
|
export class AlertModule extends AdaptableModuleBase {
|
|
20
18
|
constructor(api) {
|
|
21
19
|
super(ModuleConstants.AlertModuleId, ModuleConstants.AlertModuleFriendlyName, 'alert', 'AlertPopup', 'Get notified when things happen in Adaptable that you need to know about', api);
|
|
20
|
+
}
|
|
21
|
+
onAdaptableReady() {
|
|
22
22
|
this.api.internalApi
|
|
23
23
|
.getDataService()
|
|
24
24
|
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
@@ -71,59 +71,6 @@ export class AlertModule extends AdaptableModuleBase {
|
|
|
71
71
|
}
|
|
72
72
|
return this.api.namedQueryApi.internalApi.getReferencedNamedQueryNames(queryExpression);
|
|
73
73
|
}
|
|
74
|
-
updateOldConfig() {
|
|
75
|
-
var _a;
|
|
76
|
-
this.updateAlertSingleToMultiplePredicates();
|
|
77
|
-
// 1. Make all (new) Flashing Cells have a Predicate if none exists
|
|
78
|
-
const alertState = this.api.alertApi.getAlertState();
|
|
79
|
-
const flashingAlertDefinitions = alertState.FlashingAlertDefinitions;
|
|
80
|
-
const flashingCellDefinitions = this.api.flashingCellApi.getFlashingCellDefinitions();
|
|
81
|
-
if (ArrayExtensions.IsEmpty(flashingCellDefinitions) &&
|
|
82
|
-
ArrayExtensions.IsNotNullOrEmpty(flashingAlertDefinitions)) {
|
|
83
|
-
this.api.flashingCellApi.setFlashingCellDefinitions(flashingAlertDefinitions);
|
|
84
|
-
// TODO: state does not clear
|
|
85
|
-
this.api.flashingCellApi.internalApi.clearFlashingCellState();
|
|
86
|
-
}
|
|
87
|
-
(_a = alertState.AlertDefinitions) === null || _a === void 0 ? void 0 : _a.forEach((alertDefinition) => {
|
|
88
|
-
// if ShowPopup then change to DisplayNotificate
|
|
89
|
-
if (alertDefinition.AlertProperties &&
|
|
90
|
-
alertDefinition.AlertProperties.ShowPopup &&
|
|
91
|
-
alertDefinition.AlertProperties.ShowPopup == true &&
|
|
92
|
-
!alertDefinition.AlertProperties.DisplayNotification) {
|
|
93
|
-
alertDefinition.AlertProperties.DisplayNotification = true;
|
|
94
|
-
alertDefinition.AlertProperties.ShowPopup = undefined;
|
|
95
|
-
}
|
|
96
|
-
// if no rule but a predicate then use that
|
|
97
|
-
if (!alertDefinition.Rule) {
|
|
98
|
-
if (alertDefinition.Predicate && alertDefinition.Predicate != undefined) {
|
|
99
|
-
const predicate = alertDefinition.Predicate;
|
|
100
|
-
alertDefinition.Rule = {
|
|
101
|
-
Predicate: predicate,
|
|
102
|
-
};
|
|
103
|
-
alertDefinition.Predicate = undefined;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
//migrate alert definitions with `AggregationExpression` (now `AggregatedBooleanExpression`)
|
|
108
|
-
const obsoleteAggregationExpression = alertDefinition.Rule['AggregationExpression'];
|
|
109
|
-
if (obsoleteAggregationExpression) {
|
|
110
|
-
alertDefinition.Rule.AggregatedBooleanExpression = obsoleteAggregationExpression;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
updateAlertSingleToMultiplePredicates() {
|
|
116
|
-
const alertDefinitions = this.api.alertApi.getAlertDefinitions({
|
|
117
|
-
includeLayoutNotAssociatedObjects: true,
|
|
118
|
-
});
|
|
119
|
-
alertDefinitions.forEach((alertDefinition) => {
|
|
120
|
-
if (alertDefinition.Rule && 'Predicate' in alertDefinition.Rule) {
|
|
121
|
-
const preparedAlertDefinition = cloneObject(alertDefinition);
|
|
122
|
-
updateSingleToMultiplePredicates(preparedAlertDefinition.Rule);
|
|
123
|
-
this.api.alertApi.editAlertDefinition(preparedAlertDefinition);
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
74
|
addContextMenuItems(menuContext) {
|
|
128
75
|
const items = [];
|
|
129
76
|
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;
|
|
@@ -11,35 +11,15 @@ export class CalculatedColumnModule extends AdaptableModuleBase {
|
|
|
11
11
|
constructor(api) {
|
|
12
12
|
super(ModuleConstants.CalculatedColumnModuleId, ModuleConstants.CalculatedColumnFriendlyName, 'chart-and-grid', 'CalculatedColumnPopup', 'Create bespoke columns whose cell value is derived dynamically from an Expression', api);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
onAdaptableReady() {
|
|
15
|
+
this.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
|
|
16
|
+
}
|
|
17
|
+
onAdaptableStateReloaded() {
|
|
18
|
+
this.api.calculatedColumnApi.refreshAggregatedCalculatedColumns();
|
|
17
19
|
}
|
|
18
20
|
getModuleAdaptableObjects() {
|
|
19
21
|
return this.api.calculatedColumnApi.getCalculatedColumns();
|
|
20
22
|
}
|
|
21
|
-
updateOldConfig() {
|
|
22
|
-
const calcColumns = this.api.calculatedColumnApi.getCalculatedColumns();
|
|
23
|
-
let oldCalculatedColumns = [];
|
|
24
|
-
calcColumns.forEach((cc) => {
|
|
25
|
-
if (cc.ColumnExpression && !cc.Query) {
|
|
26
|
-
cc.Query = {
|
|
27
|
-
ScalarExpression: cc.ColumnExpression,
|
|
28
|
-
};
|
|
29
|
-
cc.ColumnExpression = undefined;
|
|
30
|
-
oldCalculatedColumns.push(cc);
|
|
31
|
-
this.api.logWarn(`Updating incorrect Predefined Config for Calculated Column: ${cc.ColumnId}`);
|
|
32
|
-
}
|
|
33
|
-
if (!cc.CalculatedColumnSettings) {
|
|
34
|
-
cc.CalculatedColumnSettings = {
|
|
35
|
-
DataType: 'Number',
|
|
36
|
-
};
|
|
37
|
-
oldCalculatedColumns.push(cc);
|
|
38
|
-
this.api.logWarn(`Updating incorrect Predefined Config for Calculated Column: ${cc.ColumnId}`);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
oldCalculatedColumns.forEach((oldCalcCol) => this.api.calculatedColumnApi.editCalculatedColumn(oldCalcCol));
|
|
42
|
-
}
|
|
43
23
|
getExplicitlyReferencedColumnIds(calculatedColumn) {
|
|
44
24
|
var _a;
|
|
45
25
|
return ((_a = this.api.expressionApi.getColumnsFromExpression(this.api.expressionApi.getAdaptableQueryExpression(calculatedColumn.Query))) !== null && _a !== void 0 ? _a : []);
|
|
@@ -8,6 +8,7 @@ import { AccessLevel } from '../PredefinedConfig/Common/Entitlement';
|
|
|
8
8
|
import { CellSummmary } from '../PredefinedConfig/Common/CellSummary';
|
|
9
9
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
10
10
|
export declare class CellSummaryModule extends AdaptableModuleBase implements ICellSummaryModule {
|
|
11
|
+
cachedCellSummary: WeakMap<SelectedCellInfo<any>, CellSummmary>;
|
|
11
12
|
constructor(api: AdaptableApi);
|
|
12
13
|
getViewAccessLevel(): AccessLevel;
|
|
13
14
|
addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
@@ -6,6 +6,7 @@ import { CellSummaryStatusPanel } from '../View/CellSummary/CellSummaryStatusPan
|
|
|
6
6
|
export class CellSummaryModule extends AdaptableModuleBase {
|
|
7
7
|
constructor(api) {
|
|
8
8
|
super(ModuleConstants.CellSummaryModuleId, ModuleConstants.CellSummaryFriendlyName, 'cells', 'CellSummaryPopup', 'See summary information on a group of cells using multiple summary operations', api);
|
|
9
|
+
this.cachedCellSummary = new WeakMap();
|
|
9
10
|
}
|
|
10
11
|
getViewAccessLevel() {
|
|
11
12
|
return 'Full';
|
|
@@ -42,6 +43,9 @@ export class CellSummaryModule extends AdaptableModuleBase {
|
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
createCellSummary(selectedCellInfo) {
|
|
46
|
+
if (this.cachedCellSummary.has(selectedCellInfo)) {
|
|
47
|
+
return this.cachedCellSummary.get(selectedCellInfo);
|
|
48
|
+
}
|
|
45
49
|
let selectedCellSummary;
|
|
46
50
|
if (selectedCellInfo && ArrayExtensions.IsNotNullOrEmpty(selectedCellInfo.columns)) {
|
|
47
51
|
let numericValues = [];
|
|
@@ -70,28 +74,52 @@ export class CellSummaryModule extends AdaptableModuleBase {
|
|
|
70
74
|
// copying so that we keep the order - needed for others
|
|
71
75
|
const newNumericValues = [...numericValues];
|
|
72
76
|
let hasNumericColumns = numericValues.length > 0;
|
|
73
|
-
|
|
77
|
+
if (selectedCellInfo.columns.length > 1) {
|
|
78
|
+
return {
|
|
79
|
+
Sum: null,
|
|
80
|
+
Average: null,
|
|
81
|
+
Median: null,
|
|
82
|
+
Mode: null,
|
|
83
|
+
Distinct: null,
|
|
84
|
+
Max: null,
|
|
85
|
+
Min: null,
|
|
86
|
+
Count: null,
|
|
87
|
+
Std_Deviation: null,
|
|
88
|
+
Only: '',
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const handleExpression = (functionName) => {
|
|
92
|
+
const columnId = selectedCellInfo.columns[0].columnId;
|
|
93
|
+
const rowNodes = selectedCellInfo.gridCells.map((gc) => gc.rowNode);
|
|
94
|
+
return this.api.internalApi.getAdaptableInstance().SummaryService.evaluateExpressionValue({
|
|
95
|
+
expression: {
|
|
96
|
+
function: functionName,
|
|
97
|
+
},
|
|
98
|
+
columnId: columnId,
|
|
99
|
+
getRowNodes: () => rowNodes,
|
|
100
|
+
}, ModuleConstants.CellSummaryModuleId);
|
|
101
|
+
};
|
|
102
|
+
const sumValue = hasNumericColumns ? handleExpression('SUM') : null;
|
|
103
|
+
const avgValue = hasNumericColumns ? Helper.roundNumber(handleExpression('AVG'), 2) : null;
|
|
104
|
+
const modeValue = hasNumericColumns ? handleExpression('MODE') : null;
|
|
105
|
+
const medianValue = hasNumericColumns ? handleExpression('MEDIAN') : null;
|
|
106
|
+
const distinctValue = handleExpression('DISTINCT');
|
|
107
|
+
const maxValue = hasNumericColumns ? handleExpression('MAX') : null;
|
|
108
|
+
const minValue = hasNumericColumns ? handleExpression('MIN') : null;
|
|
109
|
+
const stdDeviation = hasNumericColumns
|
|
110
|
+
? Helper.roundNumberTo4dp(handleExpression('STD_DEVIATION'))
|
|
111
|
+
: null;
|
|
74
112
|
selectedCellSummary = {
|
|
75
|
-
Sum:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
? Helper.roundNumberTo4dp(Helper.medianNumberArray(numericValues))
|
|
83
|
-
: undefined,
|
|
84
|
-
Mode: hasNumericColumns
|
|
85
|
-
? Helper.roundNumberTo4dp(Helper.modeNumberArray(numericValues))
|
|
86
|
-
: undefined,
|
|
87
|
-
Distinct: distinctCount,
|
|
88
|
-
Max: hasNumericColumns ? Helper.roundNumberTo4dp(Math.max(...numericValues)) : undefined,
|
|
89
|
-
Min: hasNumericColumns ? Helper.roundNumberTo4dp(Math.min(...numericValues)) : undefined,
|
|
113
|
+
Sum: sumValue,
|
|
114
|
+
Average: avgValue,
|
|
115
|
+
Median: medianValue,
|
|
116
|
+
Mode: modeValue,
|
|
117
|
+
Distinct: distinctValue,
|
|
118
|
+
Max: maxValue,
|
|
119
|
+
Min: minValue,
|
|
90
120
|
Count: allValues.length,
|
|
91
|
-
Std_Deviation:
|
|
92
|
-
|
|
93
|
-
: undefined,
|
|
94
|
-
Only: distinctCount == 1 ? JSON.stringify(allValues[0]) : '',
|
|
121
|
+
Std_Deviation: stdDeviation,
|
|
122
|
+
Only: distinctValue == 1 ? JSON.stringify(allValues[0]) : '',
|
|
95
123
|
};
|
|
96
124
|
numericValues = [...newNumericValues];
|
|
97
125
|
const operationDefinitions = this.api.cellSummaryApi.getCellSummaryOperationDefinitions();
|
|
@@ -100,7 +128,7 @@ export class CellSummaryModule extends AdaptableModuleBase {
|
|
|
100
128
|
if (operation.operationFunction) {
|
|
101
129
|
const cellSummaryOperationContext = {
|
|
102
130
|
selectedCellInfo,
|
|
103
|
-
distinctCount,
|
|
131
|
+
distinctCount: distinctValue,
|
|
104
132
|
allValues,
|
|
105
133
|
numericValues,
|
|
106
134
|
numericColumns,
|
|
@@ -112,6 +140,7 @@ export class CellSummaryModule extends AdaptableModuleBase {
|
|
|
112
140
|
}
|
|
113
141
|
});
|
|
114
142
|
}
|
|
143
|
+
this.cachedCellSummary.set(selectedCellInfo, selectedCellSummary);
|
|
115
144
|
return selectedCellSummary;
|
|
116
145
|
}
|
|
117
146
|
getViewProperties() {
|