@adaptabletools/adaptable 11.0.9 → 11.1.1-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +19 -11
- package/bundle.cjs.js +125 -125
- package/index.css +23 -11
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +4 -2
- package/src/AdaptableOptions/AlertOptions.d.ts +2 -2
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +2 -2
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
- package/src/Api/AlertApi.d.ts +5 -6
- package/src/Api/BulkUpdateApi.d.ts +5 -0
- package/src/Api/ConfigApi.d.ts +1 -1
- package/src/Api/DataChangeHistoryApi.d.ts +3 -3
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/CellChanged.d.ts +2 -2
- package/src/Api/Events/GridDataChanged.d.ts +5 -1
- package/src/Api/ExportApi.d.ts +3 -3
- package/src/Api/FreeTextColumnApi.d.ts +3 -3
- package/src/Api/GridApi.d.ts +27 -6
- package/src/Api/Implementation/AlertApiImpl.d.ts +7 -4
- package/src/Api/Implementation/AlertApiImpl.js +86 -59
- package/src/Api/Implementation/BulkUpdateApiImpl.d.ts +1 -0
- package/src/Api/Implementation/BulkUpdateApiImpl.js +4 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +7 -2
- package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +3 -3
- package/src/Api/Implementation/EventApiImpl.js +1 -1
- package/src/Api/Implementation/ExportApiImpl.d.ts +2 -2
- package/src/Api/Implementation/ExportApiImpl.js +7 -8
- package/src/Api/Implementation/FreeTextColumnApiImpl.d.ts +2 -2
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +7 -7
- package/src/Api/Implementation/GridApiImpl.d.ts +11 -3
- package/src/Api/Implementation/GridApiImpl.js +29 -8
- package/src/Api/Implementation/InternalApiImpl.d.ts +11 -4
- package/src/Api/Implementation/InternalApiImpl.js +41 -5
- package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -1
- package/src/Api/Implementation/LayoutApiImpl.js +19 -4
- package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
- package/src/Api/Implementation/SettingsPanelApiImpl.js +7 -1
- package/src/Api/InternalApi.d.ts +10 -3
- package/src/Api/LayoutApi.d.ts +14 -3
- package/src/PredefinedConfig/AlertState.d.ts +7 -3
- package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +35 -6
- package/src/PredefinedConfig/Common/AdaptableAlert.js +7 -0
- package/src/PredefinedConfig/Common/AdaptableFlashingCell.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +20 -0
- package/src/PredefinedConfig/Common/{DataChangedInfo.d.ts → CellDataChangedInfo.d.ts} +2 -6
- package/src/PredefinedConfig/Common/{DataChangedInfo.js → CellDataChangedInfo.js} +0 -0
- package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -1
- package/src/PredefinedConfig/Common/DataChangedScope.d.ts +4 -0
- package/src/PredefinedConfig/Common/DataChangedScope.js +2 -0
- package/src/PredefinedConfig/Common/Entitlement.d.ts +2 -2
- package/src/PredefinedConfig/Common/Menu.d.ts +3 -0
- package/src/PredefinedConfig/Common/RowsHighlightInfo.d.ts +15 -0
- package/src/PredefinedConfig/Common/RowsHighlightInfo.js +2 -0
- package/src/PredefinedConfig/ConfigState.d.ts +4 -1
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/PredefinedConfig/PopupState.d.ts +2 -1
- package/src/PredefinedConfig/SystemState.d.ts +2 -2
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +4 -8
- package/src/Redux/ActionsReducers/GridRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +18 -0
- package/src/Redux/ActionsReducers/PopupRedux.js +36 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +16 -5
- package/src/Redux/ActionsReducers/SystemRedux.js +37 -6
- package/src/Redux/Store/AdaptableReduxMerger.d.ts +1 -0
- package/src/Redux/Store/AdaptableReduxMerger.js +40 -4
- package/src/Redux/Store/AdaptableStore.js +76 -34
- package/src/Strategy/AlertModule.d.ts +5 -3
- package/src/Strategy/AlertModule.js +68 -22
- package/src/Strategy/BulkUpdateModule.js +7 -2
- package/src/Strategy/DataChangeHistoryModule.js +8 -6
- package/src/Strategy/ExportModule.js +1 -0
- package/src/Strategy/FlashingCellModule.d.ts +2 -2
- package/src/Strategy/FlashingCellModule.js +21 -15
- package/src/Strategy/FormatColumnModule.js +4 -2
- package/src/Strategy/SmartEditModule.js +6 -0
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +1 -1
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +6 -2
- package/src/Utilities/Emitter.d.ts +1 -1
- package/src/Utilities/Emitter.js +6 -3
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +2 -2
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/Interface/MessagePopups.d.ts +13 -0
- package/src/Utilities/ObjectFactory.d.ts +9 -7
- package/src/Utilities/ObjectFactory.js +26 -12
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +3 -3
- package/src/Utilities/Services/DataService.d.ts +5 -5
- package/src/Utilities/Services/DataService.js +12 -10
- package/src/Utilities/Services/Interface/IAlertService.d.ts +2 -2
- package/src/Utilities/Services/Interface/IDataService.d.ts +6 -6
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/Interface/IValidationService.d.ts +4 -4
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/ModuleService.js +1 -1
- package/src/Utilities/Services/QueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/ValidationService.d.ts +4 -4
- package/src/Utilities/Services/ValidationService.js +18 -17
- package/src/View/AdaptableView.js +2 -0
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +16 -9
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +13 -3
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -0
- package/src/View/Alert/Wizard/AlertWizard.js +83 -1
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -2
- package/src/View/Components/FilterForm/FilterForm.js +2 -2
- package/src/View/Components/Panels/PanelFooter.d.ts +10 -0
- package/src/View/Components/Panels/PanelFooter.js +14 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +12 -7
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +3 -1
- package/src/View/Components/Popups/{AdaptablePopup/Utilities.d.ts → Utilities.d.ts} +4 -0
- package/src/View/Components/Popups/{AdaptablePopup/Utilities.js → Utilities.js} +5 -2
- package/src/View/Components/Popups/WindowPopups/WindowPopups.d.ts +6 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +32 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +4 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +8 -0
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +2 -2
- package/src/View/Layout/LayoutEditorStandalonePopup.d.ts +3 -0
- package/src/View/Layout/LayoutEditorStandalonePopup.js +76 -0
- package/src/View/Layout/LayoutPopup.js +3 -24
- package/src/View/Layout/LayoutViewPanel.d.ts +1 -4
- package/src/View/Layout/LayoutViewPanel.js +5 -18
- package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.d.ts +9 -0
- package/src/View/Layout/Wizard/LayoutEditor/ColumnLabels.js +55 -0
- package/src/View/Layout/Wizard/LayoutEditor/index.js +3 -68
- package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -0
- package/src/View/Layout/Wizard/LayoutEditorWizard.js +35 -7
- package/src/View/SystemStatus/SystemStatusEntityRow.js +1 -2
- package/src/agGrid/Adaptable.d.ts +6 -4
- package/src/agGrid/Adaptable.js +115 -117
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/agGrid/agGridHelper.js +23 -8
- package/src/agGrid/editors/AdaptableDateEditor/index.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +1 -1
- package/src/components/Dialog/index.js +1 -1
- package/src/components/Modal/index.js +1 -1
- package/src/components/WindowModal/WindowModal.d.ts +10 -8
- package/src/components/WindowModal/WindowModal.js +4 -2
- package/src/components/WindowModal/useStacking.d.ts +9 -0
- package/src/components/WindowModal/useStacking.js +45 -0
- package/src/env.js +3 -3
- package/src/metamodel/adaptable.metamodel.d.ts +85 -45
- package/src/metamodel/adaptable.metamodel.js +185 -84
- package/src/types.d.ts +5 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -4,7 +4,7 @@ import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
|
4
4
|
import { SelectedCellInfo } from '../../PredefinedConfig/Selection/SelectedCellInfo';
|
|
5
5
|
import { SelectedRowInfo } from '../../PredefinedConfig/Selection/SelectedRowInfo';
|
|
6
6
|
import { AdaptableMenuItem } from '../../PredefinedConfig/Common/Menu';
|
|
7
|
-
import {
|
|
7
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
8
8
|
import { ColumnSort } from '../../PredefinedConfig/Common/ColumnSort';
|
|
9
9
|
import { CellSummmary } from '../../types';
|
|
10
10
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
@@ -81,10 +81,10 @@ export declare const GRID_SET_TREE_MODE_ON = "GRID_SET_TREE_MODE_ON";
|
|
|
81
81
|
*/
|
|
82
82
|
export declare const GRID_SET_TREE_MODE_OFF = "GRID_SET_TREE_MODE_OFF";
|
|
83
83
|
export interface GridDataChangedAction extends Redux.Action {
|
|
84
|
-
|
|
84
|
+
cellDataChangedInfo: CellDataChangedInfo;
|
|
85
85
|
}
|
|
86
86
|
export interface GridDataEditedAction extends Redux.Action {
|
|
87
|
-
|
|
87
|
+
cellDataChangedInfo: CellDataChangedInfo;
|
|
88
88
|
}
|
|
89
89
|
export interface GridSetColumnsAction extends Redux.Action {
|
|
90
90
|
columns: AdaptableColumn[];
|
|
@@ -102,10 +102,10 @@ export interface GridEditColumnAction extends Redux.Action {
|
|
|
102
102
|
column: AdaptableColumn;
|
|
103
103
|
}
|
|
104
104
|
export interface GridSetValueLikeEditAction extends Redux.Action {
|
|
105
|
-
|
|
105
|
+
cellDataChangedInfo: CellDataChangedInfo;
|
|
106
106
|
}
|
|
107
107
|
export interface GridSetValueLikeEditBatchAction extends Redux.Action {
|
|
108
|
-
|
|
108
|
+
cellDataChangedInfoBatch: CellDataChangedInfo[];
|
|
109
109
|
}
|
|
110
110
|
export interface GridSelectColumnAction extends Redux.Action {
|
|
111
111
|
columnId: string;
|
|
@@ -17,6 +17,8 @@ export declare const POPUP_SHOW_CONFIRMATION = "POPUP_SHOW_CONFIRMATION";
|
|
|
17
17
|
export declare const POPUP_CONFIRM_CONFIRMATION = "POPUP_CONFIRM_CONFIRMATION";
|
|
18
18
|
export declare const POPUP_CANCEL_CONFIRMATION = "POPUP_CANCEL_CONFIRMATION";
|
|
19
19
|
export declare const POPUP_CLEAR_PARAM = "POPUP_CLEAR_PARAM";
|
|
20
|
+
export declare const POPUP_WINDOW_SHOW_SCREEN = "POPUP_WINDOW_SHOW_SCREEN";
|
|
21
|
+
export declare const POPUP_WINDOW_HIDE_SCREEN = "POPUP_WINDOW_HIDE_SCREEN";
|
|
20
22
|
export interface PopupShowScreenAction extends Redux.Action {
|
|
21
23
|
ComponentModule: AdaptableModule;
|
|
22
24
|
ComponentName: string;
|
|
@@ -27,6 +29,15 @@ export interface PopupShowScreenAction extends Redux.Action {
|
|
|
27
29
|
}
|
|
28
30
|
export interface PopupHideScreenAction extends Redux.Action {
|
|
29
31
|
}
|
|
32
|
+
export interface PopupShowWindowAction extends Redux.Action {
|
|
33
|
+
Id: string;
|
|
34
|
+
Title: string;
|
|
35
|
+
PopupProps: any;
|
|
36
|
+
Icon?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface PopupHideWindowAction extends Redux.Action {
|
|
39
|
+
Id: string;
|
|
40
|
+
}
|
|
30
41
|
export interface PopupShowLoadingAction extends Redux.Action {
|
|
31
42
|
}
|
|
32
43
|
export interface PopupHideLoadingAction extends Redux.Action {
|
|
@@ -57,6 +68,13 @@ export declare const PopupShowScreen: (componentModule?: AdaptableModule, compon
|
|
|
57
68
|
[key: string]: any;
|
|
58
69
|
}) => PopupShowScreenAction;
|
|
59
70
|
export declare const PopupHideScreen: () => PopupHideScreenAction;
|
|
71
|
+
export declare const PopupShowWindow: (config: {
|
|
72
|
+
Id: string;
|
|
73
|
+
Title: string;
|
|
74
|
+
PopupProps?: any;
|
|
75
|
+
Icon?: string;
|
|
76
|
+
}) => PopupShowWindowAction;
|
|
77
|
+
export declare const PopupWindowHide: (id: string) => PopupHideWindowAction;
|
|
60
78
|
export declare const PopupShowAlert: (alert: AdaptableAlert) => PopupShowAlertAction;
|
|
61
79
|
export declare const PopupHideAlert: () => PopupHideAlertAction;
|
|
62
80
|
export declare const PopupShowLoading: () => PopupShowLoadingAction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PopupReducer = exports.PopupClearParam = exports.PopupCancelConfirmation = exports.PopupConfirmConfirmation = exports.PopupShowConfirmation = exports.PopupConfirmPrompt = exports.PopupHidePrompt = exports.PopupShowPrompt = exports.PopupHideLoading = exports.PopupShowLoading = exports.PopupHideAlert = exports.PopupShowAlert = exports.PopupHideScreen = exports.PopupShowScreen = exports.POPUP_CLEAR_PARAM = exports.POPUP_CANCEL_CONFIRMATION = exports.POPUP_CONFIRM_CONFIRMATION = exports.POPUP_SHOW_CONFIRMATION = exports.POPUP_CONFIRM_PROMPT = exports.POPUP_HIDE_PROMPT = exports.POPUP_SHOW_PROMPT = exports.POPUP_HIDE_ALERT = exports.POPUP_SHOW_ALERT = exports.POPUP_HIDE_LOADING = exports.POPUP_SHOW_LOADING = exports.POPUP_HIDE_SCREEN = exports.POPUP_SHOW_SCREEN = void 0;
|
|
3
|
+
exports.PopupReducer = exports.PopupClearParam = exports.PopupCancelConfirmation = exports.PopupConfirmConfirmation = exports.PopupShowConfirmation = exports.PopupConfirmPrompt = exports.PopupHidePrompt = exports.PopupShowPrompt = exports.PopupHideLoading = exports.PopupShowLoading = exports.PopupHideAlert = exports.PopupShowAlert = exports.PopupWindowHide = exports.PopupShowWindow = exports.PopupHideScreen = exports.PopupShowScreen = exports.POPUP_WINDOW_HIDE_SCREEN = exports.POPUP_WINDOW_SHOW_SCREEN = exports.POPUP_CLEAR_PARAM = exports.POPUP_CANCEL_CONFIRMATION = exports.POPUP_CONFIRM_CONFIRMATION = exports.POPUP_SHOW_CONFIRMATION = exports.POPUP_CONFIRM_PROMPT = exports.POPUP_HIDE_PROMPT = exports.POPUP_SHOW_PROMPT = exports.POPUP_HIDE_ALERT = exports.POPUP_SHOW_ALERT = exports.POPUP_HIDE_LOADING = exports.POPUP_SHOW_LOADING = exports.POPUP_HIDE_SCREEN = exports.POPUP_SHOW_SCREEN = void 0;
|
|
4
4
|
exports.POPUP_SHOW_SCREEN = 'POPUP_SHOW_SCREEN';
|
|
5
5
|
exports.POPUP_HIDE_SCREEN = 'POPUP_HIDE_SCREEN';
|
|
6
6
|
exports.POPUP_SHOW_LOADING = 'POPUP_SHOW_LOADING';
|
|
@@ -14,6 +14,8 @@ exports.POPUP_SHOW_CONFIRMATION = 'POPUP_SHOW_CONFIRMATION';
|
|
|
14
14
|
exports.POPUP_CONFIRM_CONFIRMATION = 'POPUP_CONFIRM_CONFIRMATION';
|
|
15
15
|
exports.POPUP_CANCEL_CONFIRMATION = 'POPUP_CANCEL_CONFIRMATION';
|
|
16
16
|
exports.POPUP_CLEAR_PARAM = 'POPUP_CLEAR_PARAM';
|
|
17
|
+
exports.POPUP_WINDOW_SHOW_SCREEN = 'POPUP_WINDOW_SHOW_SCREEN';
|
|
18
|
+
exports.POPUP_WINDOW_HIDE_SCREEN = 'POPUP_WINDOW_HIDE_SCREEN';
|
|
17
19
|
exports.PopupShowScreen = (componentModule, componentName, params, popupProps) => ({
|
|
18
20
|
type: exports.POPUP_SHOW_SCREEN,
|
|
19
21
|
ComponentModule: componentModule,
|
|
@@ -24,6 +26,17 @@ exports.PopupShowScreen = (componentModule, componentName, params, popupProps) =
|
|
|
24
26
|
exports.PopupHideScreen = () => ({
|
|
25
27
|
type: exports.POPUP_HIDE_SCREEN,
|
|
26
28
|
});
|
|
29
|
+
exports.PopupShowWindow = (config) => ({
|
|
30
|
+
type: exports.POPUP_WINDOW_SHOW_SCREEN,
|
|
31
|
+
Id: config.Id,
|
|
32
|
+
Title: config.Title,
|
|
33
|
+
PopupProps: config.PopupProps,
|
|
34
|
+
Icon: config.Icon,
|
|
35
|
+
});
|
|
36
|
+
exports.PopupWindowHide = (id) => ({
|
|
37
|
+
type: exports.POPUP_WINDOW_HIDE_SCREEN,
|
|
38
|
+
Id: id,
|
|
39
|
+
});
|
|
27
40
|
exports.PopupShowAlert = (alert) => {
|
|
28
41
|
return {
|
|
29
42
|
type: exports.POPUP_SHOW_ALERT,
|
|
@@ -101,6 +114,9 @@ const initialState = {
|
|
|
101
114
|
Message: '',
|
|
102
115
|
ConfirmAction: null,
|
|
103
116
|
},
|
|
117
|
+
WindowPopup: {
|
|
118
|
+
PopupList: [],
|
|
119
|
+
},
|
|
104
120
|
};
|
|
105
121
|
exports.PopupReducer = (state = initialState, action) => {
|
|
106
122
|
switch (action.type) {
|
|
@@ -242,6 +258,25 @@ exports.PopupReducer = (state = initialState, action) => {
|
|
|
242
258
|
};
|
|
243
259
|
return Object.assign({}, state, { ScreenPopup: newScreenPopup });
|
|
244
260
|
}
|
|
261
|
+
case exports.POPUP_WINDOW_SHOW_SCREEN: {
|
|
262
|
+
const showWindowAction = action;
|
|
263
|
+
const windowSettings = {
|
|
264
|
+
Id: showWindowAction.Id,
|
|
265
|
+
Icon: showWindowAction.Icon,
|
|
266
|
+
Title: showWindowAction.Title,
|
|
267
|
+
PopupProps: showWindowAction.PopupProps,
|
|
268
|
+
};
|
|
269
|
+
// Prevent opening the same popup twice
|
|
270
|
+
if (state.WindowPopup.PopupList.some((windowPopup) => windowPopup.Id === windowSettings.Id)) {
|
|
271
|
+
return state;
|
|
272
|
+
}
|
|
273
|
+
const PopupList = [...state.WindowPopup.PopupList, windowSettings];
|
|
274
|
+
return Object.assign(Object.assign({}, state), { WindowPopup: Object.assign(Object.assign({}, state.WindowPopup), { PopupList }) });
|
|
275
|
+
}
|
|
276
|
+
case exports.POPUP_WINDOW_HIDE_SCREEN: {
|
|
277
|
+
const PopupList = state.WindowPopup.PopupList.filter((windowPopup) => windowPopup.Id !== action.Id);
|
|
278
|
+
return Object.assign(Object.assign({}, state), { WindowPopup: Object.assign(Object.assign({}, state.WindowPopup), { PopupList }) });
|
|
279
|
+
}
|
|
245
280
|
default:
|
|
246
281
|
return state;
|
|
247
282
|
}
|
|
@@ -11,7 +11,8 @@ import { SystemStatusMessageInfo } from '../../PredefinedConfig/Common/SystemSta
|
|
|
11
11
|
import { CachedQuery } from '../../PredefinedConfig/QueryState';
|
|
12
12
|
import { AdaptableFlashingCell } from '../../PredefinedConfig/Common/AdaptableFlashingCell';
|
|
13
13
|
import { MathOperation, SummaryOperation } from '../../PredefinedConfig/Common/Enums';
|
|
14
|
-
import {
|
|
14
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
15
|
+
import { RowsHighlightInfo } from '../../PredefinedConfig/Common/RowsHighlightInfo';
|
|
15
16
|
export declare const FLASHING_CELL_ROW_KEY = "__ROW";
|
|
16
17
|
export declare const SYSTEM_ALERT_ADD = "SYSTEM_ALERT_ADD";
|
|
17
18
|
export declare const SYSTEM_ALERT_DELETE = "SYSTEM_ALERT_DELETE";
|
|
@@ -37,7 +38,9 @@ export declare const SYSTEM_HIGHLIGHT_CELL_ADD = "SYSTEM_HIGHLIGHT_CELL_ADD";
|
|
|
37
38
|
export declare const SYSTEM_HIGHLIGHT_CELL_DELETE = "SYSTEM_HIGHLIGHT_CELL_DELETE";
|
|
38
39
|
export declare const SYSTEM_HIGHLIGHT_CELL_DELETE_ALL = "SYSTEM_HIGHLIGHT_CELL_DELETE_ALL";
|
|
39
40
|
export declare const SYSTEM_HIGHLIGHT_ROW_ADD = "SYSTEM_HIGHLIGHT_ROW_ADD";
|
|
41
|
+
export declare const SYSTEM_HIGHLIGHT_ROWS_ADD = "SYSTEM_HIGHLIGHT_ROWS_ADD";
|
|
40
42
|
export declare const SYSTEM_HIGHLIGHT_ROW_DELETE = "SYSTEM_HIGHLIGHT_ROW_DELETE";
|
|
43
|
+
export declare const SYSTEM_HIGHLIGHT_ROWS_DELETE = "SYSTEM_HIGHLIGHT_ROWS_DELETE";
|
|
41
44
|
export declare const SYSTEM_HIGHLIGHT_ROW_DELETE_ALL = "SYSTEM_HIGHLIGHT_ROW_DELETE_ALL";
|
|
42
45
|
export declare const SYSTEM_SET_NEW_COLUMN_LIST_ORDER = "SYSTEM_SET_NEW_COLUMN_LIST_ORDER";
|
|
43
46
|
export declare const SYSTEM_SET_LAST_APPLIED_SHORTCUT = "SYSTEM_SET_LAST_APPLIED_SHORTCUT";
|
|
@@ -77,6 +80,12 @@ export interface SystemHighlightRowAddAction extends Redux.Action {
|
|
|
77
80
|
export interface SystemHighlightRowDeleteAction extends Redux.Action {
|
|
78
81
|
primaryKeyValue: RowHighlightInfo['primaryKeyValue'];
|
|
79
82
|
}
|
|
83
|
+
export interface SystemHighlightRowsAddAction extends Redux.Action {
|
|
84
|
+
rowsHighlightInfo: RowsHighlightInfo;
|
|
85
|
+
}
|
|
86
|
+
export interface SystemHighlightRowsDeleteAction extends Redux.Action {
|
|
87
|
+
primaryKeyValues: RowsHighlightInfo['primaryKeyValues'];
|
|
88
|
+
}
|
|
80
89
|
export interface SystemHighlightRowDeleteAllAction extends Redux.Action {
|
|
81
90
|
}
|
|
82
91
|
export interface SystemAlertAddAction extends Redux.Action {
|
|
@@ -182,10 +191,10 @@ export interface SystemLicenseShowWatermarkAction extends Redux.Action {
|
|
|
182
191
|
export interface SystemLicenseDisablePersistenceAction extends Redux.Action {
|
|
183
192
|
}
|
|
184
193
|
export interface SystemDataChangeHistoryAddAction extends Redux.Action {
|
|
185
|
-
changeInfo:
|
|
194
|
+
changeInfo: CellDataChangedInfo;
|
|
186
195
|
}
|
|
187
196
|
export interface SystemDataChangeHistoryUndoAction extends Redux.Action {
|
|
188
|
-
changeInfo:
|
|
197
|
+
changeInfo: CellDataChangedInfo;
|
|
189
198
|
}
|
|
190
199
|
export interface SystemDataChangeHistoryEnableAction extends Redux.Action {
|
|
191
200
|
}
|
|
@@ -209,7 +218,9 @@ export declare const SystemHighlightCellAdd: (cellHighlightInfo: CellHighlightIn
|
|
|
209
218
|
export declare const SystemHighlightCellDelete: (primaryKeyValue: CellHighlightInfo['primaryKeyValue'], columnId: CellHighlightInfo['columnId']) => SystemHighlightCellDeleteAction;
|
|
210
219
|
export declare const SystemHighlightCellDeleteAll: () => SystemHighlightCellDeleteAllAction;
|
|
211
220
|
export declare const SystemHighlightRowAdd: (rowHighlightInfo: RowHighlightInfo) => SystemHighlightRowAddAction;
|
|
221
|
+
export declare const SystemHighlightRowsAdd: (rowsHighlightInfo: RowsHighlightInfo) => SystemHighlightRowsAddAction;
|
|
212
222
|
export declare const SystemHighlightRowDelete: (primaryKeyValue: RowHighlightInfo['primaryKeyValue']) => SystemHighlightRowDeleteAction;
|
|
223
|
+
export declare const SystemHighlightRowsDelete: (primaryKeyValues: RowsHighlightInfo['primaryKeyValues']) => SystemHighlightRowsDeleteAction;
|
|
213
224
|
export declare const SystemHighlightRowDeleteAll: () => SystemHighlightRowDeleteAllAction;
|
|
214
225
|
export declare const SystemAlertAdd: (alert: AdaptableAlert, maxAlerts: number) => SystemAlertAddAction;
|
|
215
226
|
export declare const SystemAlertDelete: (alert: AdaptableAlert) => SystemAlertDeleteAction;
|
|
@@ -238,8 +249,8 @@ export declare const SystemProgressIndicatorShow: (label: string) => SystemProgr
|
|
|
238
249
|
export declare const SystemProgressIndicatorHide: () => SystemProgressIndicatorHideAction;
|
|
239
250
|
export declare const SystemLicenseShowWatermark: (text: string) => SystemLicenseShowWatermarkAction;
|
|
240
251
|
export declare const SystemLicenseDisablePersistence: () => SystemLicenseDisablePersistenceAction;
|
|
241
|
-
export declare const SystemDataChangeHistoryAdd: (changeInfo:
|
|
242
|
-
export declare const SystemDataChangeHistoryUndo: (changeInfo:
|
|
252
|
+
export declare const SystemDataChangeHistoryAdd: (changeInfo: CellDataChangedInfo) => SystemDataChangeHistoryAddAction;
|
|
253
|
+
export declare const SystemDataChangeHistoryUndo: (changeInfo: CellDataChangedInfo) => SystemDataChangeHistoryUndoAction;
|
|
243
254
|
export declare const SystemDataChangeHistoryEnable: () => SystemDataChangeHistoryEnableAction;
|
|
244
255
|
export declare const SystemDataChangeHistoryDisable: () => SystemDataChangeHistoryDisableAction;
|
|
245
256
|
export declare const SystemDataChangeHistorySuspend: () => SystemDataChangeHistorySuspendAction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SystemReducer = exports.getSystemExportCustomDestinationPopups = exports.SystemSettingsPanelSet = exports.SystemExportCustomDestinationPopupHide = exports.SystemExportCustomDestinationPopupShow = exports.SystemDataChangeHistoryResume = exports.SystemDataChangeHistorySuspend = exports.SystemDataChangeHistoryDisable = exports.SystemDataChangeHistoryEnable = exports.SystemDataChangeHistoryUndo = exports.SystemDataChangeHistoryAdd = exports.SystemLicenseDisablePersistence = exports.SystemLicenseShowWatermark = exports.SystemProgressIndicatorHide = exports.SystemProgressIndicatorShow = exports.SystemCellSummaryChangeOperation = exports.SystemCachedQueryAdd = exports.SetLastAppliedShortcut = exports.SetNewColumnListOrder = exports.BulkUpdateChangeValue = exports.BulkUpdateSetPreview = exports.BulkUpdateSetValidSelection = exports.BulkUpdateCheckCellSelection = exports.SmartEditSetPreview = exports.SmartEditSetValidSelection = exports.SmartEditCheckCellSelection = exports.SmartEditChangeOperation = exports.SmartEditChangeValue = exports.SystemStatusMessageInfoDeleteAll = exports.SystemStatusMessageInfoDelete = exports.SystemStatusMessageInfoAdd = exports.SystemFlashingCellDeleteAll = exports.SystemFlashingCellDelete = exports.SystemFlashingCellAdd = exports.SystemAlertRemoveHighlight = exports.SystemAlertDeleteAll = exports.SystemAlertDelete = exports.SystemAlertAdd = exports.SystemHighlightRowDeleteAll = exports.SystemHighlightRowDelete = exports.SystemHighlightRowAdd = exports.SystemHighlightCellDeleteAll = exports.SystemHighlightCellDelete = exports.SystemHighlightCellAdd = exports.SYSTEM_SETTINGS_PANEL_SET = exports.SYSTEM_DATA_CHANGE_HISTORY_RESUME = exports.SYSTEM_DATA_CHANGE_HISTORY_SUSPEND = exports.SYSTEM_DATA_CHANGE_HISTORY_DISABLE = exports.SYSTEM_DATA_CHANGE_HISTORY_ENABLE = exports.SYSTEM_DATA_CHANGE_HISTORY_UNDO = exports.SYSTEM_DATA_CHANGE_HISTORY_ADD = exports.SYSTEM_LICENSE_DISABLE_PERSISTENCE = exports.SYSTEM_LICENSE_SHOW_WATERMARK = exports.SYSTEM_PROGRESS_INDICATOR_HIDE = exports.SYSTEM_PROGRESS_INDICATOR_SHOW = exports.SYSTEM_EXPORT_CUSTOM_DESTINATION_POPUP_HIDE = exports.SYSTEM_EXPORT_CUSTOM_DESTINATION_POPUP_SHOW = exports.SYSTEM_CELL_SUMMARY_CHANGE_OPERATION = exports.SYSTEM_CACHED_QUERY_ADD = exports.SYSTEM_SET_LAST_APPLIED_SHORTCUT = exports.SYSTEM_SET_NEW_COLUMN_LIST_ORDER = exports.SYSTEM_HIGHLIGHT_ROW_DELETE_ALL = exports.SYSTEM_HIGHLIGHT_ROW_DELETE = exports.SYSTEM_HIGHLIGHT_ROW_ADD = exports.SYSTEM_HIGHLIGHT_CELL_DELETE_ALL = exports.SYSTEM_HIGHLIGHT_CELL_DELETE = exports.SYSTEM_HIGHLIGHT_CELL_ADD = exports.SYSTEM_BULK_UPDATE_CHANGE_VALUE = exports.SYSTEM_BULK_UPDATE_SET_PREVIEW = exports.SYSTEM_BULK_UPDATE_SET_VALID_SELECTION = exports.SYSTEM_BULK_UPDATE_CHECK_CELL_SELECTION = exports.SYSTEM_SMART_EDIT_CHANGE_OPERATION = exports.SYSTEM_SMART_EDIT_CHANGE_VALUE = exports.SYSTEM_SMARTEDIT_SET_PREVIEW = exports.SYSTEM_SMARTEDIT_SET_VALID_SELECTION = exports.SYSTEM_SMARTEDIT_FETCH_PREVIEW = exports.SYSTEM_SMARTEDIT_CHECK_CELL_SELECTION = exports.SYSTEM_STATUS_MESSAGE_INFO_DELETE_ALL = exports.SYSTEM_STATUS_MESSAGE_INFO_DELETE = exports.SYSTEM_STATUS_MESSAGE_INFO_ADD = exports.SYSTEM_FLASHING_CELL_DELETE_ALL = exports.SYSTEM_FLASHING_CELL_DELETE = exports.SYSTEM_FLASHING_CELL_ADD = exports.SYSTEM_ALERT_REMOVE_HIGHLIGHT = exports.SYSTEM_ALERT_DELETE_ALL = exports.SYSTEM_ALERT_DELETE = exports.SYSTEM_ALERT_ADD = exports.FLASHING_CELL_ROW_KEY = void 0;
|
|
3
|
+
exports.SystemReducer = exports.getSystemExportCustomDestinationPopups = exports.SystemSettingsPanelSet = exports.SystemExportCustomDestinationPopupHide = exports.SystemExportCustomDestinationPopupShow = exports.SystemDataChangeHistoryResume = exports.SystemDataChangeHistorySuspend = exports.SystemDataChangeHistoryDisable = exports.SystemDataChangeHistoryEnable = exports.SystemDataChangeHistoryUndo = exports.SystemDataChangeHistoryAdd = exports.SystemLicenseDisablePersistence = exports.SystemLicenseShowWatermark = exports.SystemProgressIndicatorHide = exports.SystemProgressIndicatorShow = exports.SystemCellSummaryChangeOperation = exports.SystemCachedQueryAdd = exports.SetLastAppliedShortcut = exports.SetNewColumnListOrder = exports.BulkUpdateChangeValue = exports.BulkUpdateSetPreview = exports.BulkUpdateSetValidSelection = exports.BulkUpdateCheckCellSelection = exports.SmartEditSetPreview = exports.SmartEditSetValidSelection = exports.SmartEditCheckCellSelection = exports.SmartEditChangeOperation = exports.SmartEditChangeValue = exports.SystemStatusMessageInfoDeleteAll = exports.SystemStatusMessageInfoDelete = exports.SystemStatusMessageInfoAdd = exports.SystemFlashingCellDeleteAll = exports.SystemFlashingCellDelete = exports.SystemFlashingCellAdd = exports.SystemAlertRemoveHighlight = exports.SystemAlertDeleteAll = exports.SystemAlertDelete = exports.SystemAlertAdd = exports.SystemHighlightRowDeleteAll = exports.SystemHighlightRowsDelete = exports.SystemHighlightRowDelete = exports.SystemHighlightRowsAdd = exports.SystemHighlightRowAdd = exports.SystemHighlightCellDeleteAll = exports.SystemHighlightCellDelete = exports.SystemHighlightCellAdd = exports.SYSTEM_SETTINGS_PANEL_SET = exports.SYSTEM_DATA_CHANGE_HISTORY_RESUME = exports.SYSTEM_DATA_CHANGE_HISTORY_SUSPEND = exports.SYSTEM_DATA_CHANGE_HISTORY_DISABLE = exports.SYSTEM_DATA_CHANGE_HISTORY_ENABLE = exports.SYSTEM_DATA_CHANGE_HISTORY_UNDO = exports.SYSTEM_DATA_CHANGE_HISTORY_ADD = exports.SYSTEM_LICENSE_DISABLE_PERSISTENCE = exports.SYSTEM_LICENSE_SHOW_WATERMARK = exports.SYSTEM_PROGRESS_INDICATOR_HIDE = exports.SYSTEM_PROGRESS_INDICATOR_SHOW = exports.SYSTEM_EXPORT_CUSTOM_DESTINATION_POPUP_HIDE = exports.SYSTEM_EXPORT_CUSTOM_DESTINATION_POPUP_SHOW = exports.SYSTEM_CELL_SUMMARY_CHANGE_OPERATION = exports.SYSTEM_CACHED_QUERY_ADD = exports.SYSTEM_SET_LAST_APPLIED_SHORTCUT = exports.SYSTEM_SET_NEW_COLUMN_LIST_ORDER = exports.SYSTEM_HIGHLIGHT_ROW_DELETE_ALL = exports.SYSTEM_HIGHLIGHT_ROWS_DELETE = exports.SYSTEM_HIGHLIGHT_ROW_DELETE = exports.SYSTEM_HIGHLIGHT_ROWS_ADD = exports.SYSTEM_HIGHLIGHT_ROW_ADD = exports.SYSTEM_HIGHLIGHT_CELL_DELETE_ALL = exports.SYSTEM_HIGHLIGHT_CELL_DELETE = exports.SYSTEM_HIGHLIGHT_CELL_ADD = exports.SYSTEM_BULK_UPDATE_CHANGE_VALUE = exports.SYSTEM_BULK_UPDATE_SET_PREVIEW = exports.SYSTEM_BULK_UPDATE_SET_VALID_SELECTION = exports.SYSTEM_BULK_UPDATE_CHECK_CELL_SELECTION = exports.SYSTEM_SMART_EDIT_CHANGE_OPERATION = exports.SYSTEM_SMART_EDIT_CHANGE_VALUE = exports.SYSTEM_SMARTEDIT_SET_PREVIEW = exports.SYSTEM_SMARTEDIT_SET_VALID_SELECTION = exports.SYSTEM_SMARTEDIT_FETCH_PREVIEW = exports.SYSTEM_SMARTEDIT_CHECK_CELL_SELECTION = exports.SYSTEM_STATUS_MESSAGE_INFO_DELETE_ALL = exports.SYSTEM_STATUS_MESSAGE_INFO_DELETE = exports.SYSTEM_STATUS_MESSAGE_INFO_ADD = exports.SYSTEM_FLASHING_CELL_DELETE_ALL = exports.SYSTEM_FLASHING_CELL_DELETE = exports.SYSTEM_FLASHING_CELL_ADD = exports.SYSTEM_ALERT_REMOVE_HIGHLIGHT = exports.SYSTEM_ALERT_DELETE_ALL = exports.SYSTEM_ALERT_DELETE = exports.SYSTEM_ALERT_ADD = exports.FLASHING_CELL_ROW_KEY = void 0;
|
|
4
4
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
5
5
|
const Helper_1 = require("../../Utilities/Helpers/Helper");
|
|
6
6
|
/*
|
|
@@ -40,7 +40,9 @@ exports.SYSTEM_HIGHLIGHT_CELL_DELETE = 'SYSTEM_HIGHLIGHT_CELL_DELETE';
|
|
|
40
40
|
exports.SYSTEM_HIGHLIGHT_CELL_DELETE_ALL = 'SYSTEM_HIGHLIGHT_CELL_DELETE_ALL';
|
|
41
41
|
// Rows Highlight
|
|
42
42
|
exports.SYSTEM_HIGHLIGHT_ROW_ADD = 'SYSTEM_HIGHLIGHT_ROW_ADD';
|
|
43
|
+
exports.SYSTEM_HIGHLIGHT_ROWS_ADD = 'SYSTEM_HIGHLIGHT_ROWS_ADD';
|
|
43
44
|
exports.SYSTEM_HIGHLIGHT_ROW_DELETE = 'SYSTEM_HIGHLIGHT_ROW_DELETE';
|
|
45
|
+
exports.SYSTEM_HIGHLIGHT_ROWS_DELETE = 'SYSTEM_HIGHLIGHT_ROWS_DELETE';
|
|
44
46
|
exports.SYSTEM_HIGHLIGHT_ROW_DELETE_ALL = 'SYSTEM_HIGHLIGHT_ROW_DELETE_ALL';
|
|
45
47
|
// Columns
|
|
46
48
|
exports.SYSTEM_SET_NEW_COLUMN_LIST_ORDER = 'SYSTEM_SET_NEW_COLUMN_LIST_ORDER';
|
|
@@ -88,10 +90,18 @@ exports.SystemHighlightRowAdd = (rowHighlightInfo) => ({
|
|
|
88
90
|
type: exports.SYSTEM_HIGHLIGHT_ROW_ADD,
|
|
89
91
|
rowHighlightInfo: rowHighlightInfo,
|
|
90
92
|
});
|
|
93
|
+
exports.SystemHighlightRowsAdd = (rowsHighlightInfo) => ({
|
|
94
|
+
type: exports.SYSTEM_HIGHLIGHT_ROWS_ADD,
|
|
95
|
+
rowsHighlightInfo: rowsHighlightInfo,
|
|
96
|
+
});
|
|
91
97
|
exports.SystemHighlightRowDelete = (primaryKeyValue) => ({
|
|
92
98
|
type: exports.SYSTEM_HIGHLIGHT_ROW_DELETE,
|
|
93
99
|
primaryKeyValue: primaryKeyValue,
|
|
94
100
|
});
|
|
101
|
+
exports.SystemHighlightRowsDelete = (primaryKeyValues) => ({
|
|
102
|
+
type: exports.SYSTEM_HIGHLIGHT_ROWS_DELETE,
|
|
103
|
+
primaryKeyValues: primaryKeyValues,
|
|
104
|
+
});
|
|
95
105
|
exports.SystemHighlightRowDeleteAll = () => ({
|
|
96
106
|
type: exports.SYSTEM_HIGHLIGHT_ROW_DELETE_ALL,
|
|
97
107
|
});
|
|
@@ -378,6 +388,19 @@ exports.SystemReducer = (state = initialState, action) => {
|
|
|
378
388
|
HighlightedRows: [...state.HighlightedRows, actionTypedAdd.rowHighlightInfo],
|
|
379
389
|
});
|
|
380
390
|
}
|
|
391
|
+
case exports.SYSTEM_HIGHLIGHT_ROWS_ADD: {
|
|
392
|
+
const actionTypedAdd = action;
|
|
393
|
+
const rowHighlightInfos = actionTypedAdd.rowsHighlightInfo.primaryKeyValues.map((primaryKeyValue) => {
|
|
394
|
+
return {
|
|
395
|
+
primaryKeyValue,
|
|
396
|
+
highlightStyle: actionTypedAdd.rowsHighlightInfo.highlightStyle,
|
|
397
|
+
timeout: actionTypedAdd.rowsHighlightInfo.timeout,
|
|
398
|
+
};
|
|
399
|
+
});
|
|
400
|
+
return Object.assign({}, state, {
|
|
401
|
+
HighlightedRows: [...state.HighlightedRows, ...rowHighlightInfos],
|
|
402
|
+
});
|
|
403
|
+
}
|
|
381
404
|
case exports.SYSTEM_HIGHLIGHT_ROW_DELETE: {
|
|
382
405
|
const actionTypedDelete = action;
|
|
383
406
|
const actionId = actionTypedDelete.primaryKeyValue;
|
|
@@ -387,6 +410,14 @@ exports.SystemReducer = (state = initialState, action) => {
|
|
|
387
410
|
}),
|
|
388
411
|
});
|
|
389
412
|
}
|
|
413
|
+
case exports.SYSTEM_HIGHLIGHT_ROWS_DELETE: {
|
|
414
|
+
const actionTypedDelete = action;
|
|
415
|
+
return Object.assign({}, state, {
|
|
416
|
+
HighlightedRows: state.HighlightedRows.filter((rowHighlightInfo) => {
|
|
417
|
+
return !actionTypedDelete.primaryKeyValues.includes(rowHighlightInfo.primaryKeyValue);
|
|
418
|
+
}),
|
|
419
|
+
});
|
|
420
|
+
}
|
|
390
421
|
case exports.SYSTEM_HIGHLIGHT_ROW_DELETE_ALL: {
|
|
391
422
|
return Object.assign({}, state, {
|
|
392
423
|
HighlightedRows: [],
|
|
@@ -499,16 +530,16 @@ exports.SystemReducer = (state = initialState, action) => {
|
|
|
499
530
|
return Object.assign(Object.assign({}, state), { Export: Object.assign(Object.assign({}, state.Export), { CustomDestinationPopups: (_a = state.Export.CustomDestinationPopups) === null || _a === void 0 ? void 0 : _a.filter((data) => data !== action.data) }) });
|
|
500
531
|
case exports.SYSTEM_DATA_CHANGE_HISTORY_ADD: {
|
|
501
532
|
const actionTypedAdd = action;
|
|
502
|
-
const
|
|
503
|
-
const uniqueKey = getDataChangeHistoryKey(
|
|
533
|
+
const cellDataChangedInfo = actionTypedAdd.changeInfo;
|
|
534
|
+
const uniqueKey = getDataChangeHistoryKey(cellDataChangedInfo);
|
|
504
535
|
const updatedDataChangeHistoryLogs = Object.assign({}, state.DataChangeHistory.logs);
|
|
505
|
-
updatedDataChangeHistoryLogs[uniqueKey] =
|
|
536
|
+
updatedDataChangeHistoryLogs[uniqueKey] = cellDataChangedInfo;
|
|
506
537
|
return Object.assign(Object.assign({}, state), { DataChangeHistory: Object.assign(Object.assign({}, state.DataChangeHistory), { logs: updatedDataChangeHistoryLogs }) });
|
|
507
538
|
}
|
|
508
539
|
case exports.SYSTEM_DATA_CHANGE_HISTORY_UNDO: {
|
|
509
540
|
const actionTypedUndo = action;
|
|
510
|
-
const
|
|
511
|
-
const uniqueKey = getDataChangeHistoryKey(
|
|
541
|
+
const cellDataChangedInfo = actionTypedUndo.changeInfo;
|
|
542
|
+
const uniqueKey = getDataChangeHistoryKey(cellDataChangedInfo);
|
|
512
543
|
const updatedDataChangeHistoryLogs = Object.assign({}, state.DataChangeHistory.logs);
|
|
513
544
|
delete updatedDataChangeHistoryLogs[uniqueKey];
|
|
514
545
|
return Object.assign(Object.assign({}, state), { DataChangeHistory: Object.assign(Object.assign({}, state.DataChangeHistory), { logs: updatedDataChangeHistoryLogs }) });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConfigState } from '../../PredefinedConfig/ConfigState';
|
|
2
2
|
import { AdaptableState } from '../../PredefinedConfig/AdaptableState';
|
|
3
3
|
export declare function AddStateSource(stateObject: any, source: 'Config' | 'User'): any;
|
|
4
|
+
export declare function ProcessKeepUserDefinedRevision(configState: any, currentUserState: any): any;
|
|
4
5
|
export declare function MergeStateFunction(oldState: any, newState: any): any;
|
|
5
6
|
export declare function MergeState(oldState: any, newState: any): any;
|
|
6
7
|
declare type TypeReducer = (state: AdaptableState, action: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mergeReducer = exports.MergeState = exports.MergeStateFunction = exports.AddStateSource = void 0;
|
|
3
|
+
exports.mergeReducer = exports.MergeState = exports.MergeStateFunction = exports.ProcessKeepUserDefinedRevision = exports.AddStateSource = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const mergeWith_1 = tslib_1.__importDefault(require("lodash/mergeWith"));
|
|
6
6
|
const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
|
|
@@ -47,6 +47,34 @@ function AddStateSource(stateObject = {}, source) {
|
|
|
47
47
|
return stateObject;
|
|
48
48
|
}
|
|
49
49
|
exports.AddStateSource = AddStateSource;
|
|
50
|
+
function ProcessKeepUserDefinedRevision(configState, currentUserState) {
|
|
51
|
+
const traverseStateObject = (configObject, stateObject) => {
|
|
52
|
+
Object.entries(configObject).forEach(([key, configValue]) => {
|
|
53
|
+
const stateValue = stateObject[key];
|
|
54
|
+
if (Array.isArray(configValue) && Array.isArray(stateValue)) {
|
|
55
|
+
const userDefinedItems = stateValue.filter((item) => {
|
|
56
|
+
return isAdaptableObject_1.isAdaptableObject(item) && item.Source !== 'Config';
|
|
57
|
+
});
|
|
58
|
+
configObject[key] = configValue.concat(userDefinedItems);
|
|
59
|
+
// we probably don't need to call traverseStateObject on the array as well,
|
|
60
|
+
// so we do the traversing on the else branch only
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
if (configValue !== null &&
|
|
64
|
+
typeof configValue === 'object' &&
|
|
65
|
+
typeof stateValue === 'object') {
|
|
66
|
+
traverseStateObject(configValue, stateValue);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
traverseStateObject(configState, currentUserState);
|
|
72
|
+
return configState;
|
|
73
|
+
}
|
|
74
|
+
exports.ProcessKeepUserDefinedRevision = ProcessKeepUserDefinedRevision;
|
|
75
|
+
function deepClone(obj) {
|
|
76
|
+
return JSON.parse(JSON.stringify(obj));
|
|
77
|
+
}
|
|
50
78
|
function MergeStateFunction(oldState, newState) {
|
|
51
79
|
// return MergeState(oldState, newState);
|
|
52
80
|
var _a, _b, _c;
|
|
@@ -66,14 +94,22 @@ function MergeStateFunction(oldState, newState) {
|
|
|
66
94
|
for (const configModuleName in config) {
|
|
67
95
|
state[configModuleName] = (_a = state[configModuleName]) !== null && _a !== void 0 ? _a : config[configModuleName];
|
|
68
96
|
}
|
|
69
|
-
// any Module in state that has an older revision
|
|
97
|
+
// any Module in state that has an older revision than the config will be replaced
|
|
70
98
|
for (const stateModuleName in state) {
|
|
71
99
|
if (config[stateModuleName] != undefined) {
|
|
72
100
|
// explicitly use double equals, as we want to avoid null as well
|
|
73
101
|
const stateRevision = (_b = state[stateModuleName].Revision) !== null && _b !== void 0 ? _b : 0;
|
|
74
102
|
const configRevision = (_c = config[stateModuleName].Revision) !== null && _c !== void 0 ? _c : 0;
|
|
75
|
-
|
|
76
|
-
|
|
103
|
+
const stateRevisionKey = typeof stateRevision === 'object' ? stateRevision.Key : stateRevision;
|
|
104
|
+
const configRevisionBehavior = typeof configRevision === 'object' ? configRevision.Behavior : 'Override';
|
|
105
|
+
const configRevisionKey = typeof configRevision === 'object' ? configRevision.Key : configRevision;
|
|
106
|
+
if (configRevisionKey > stateRevisionKey) {
|
|
107
|
+
if (configRevisionBehavior === 'Override') {
|
|
108
|
+
state[stateModuleName] = config[stateModuleName];
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
state[stateModuleName] = ProcessKeepUserDefinedRevision(deepClone(config[stateModuleName]), state[stateModuleName]);
|
|
112
|
+
}
|
|
77
113
|
}
|
|
78
114
|
}
|
|
79
115
|
}
|