@adaptabletools/adaptable 11.0.7 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +19 -11
- package/bundle.cjs.js +100 -100
- 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 +2 -0
- package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
- package/src/Api/AlertApi.d.ts +3 -2
- package/src/Api/BulkUpdateApi.d.ts +6 -1
- package/src/Api/CalculatedColumnApi.d.ts +1 -1
- package/src/Api/CellSummaryApi.d.ts +1 -1
- package/src/Api/ConditionalStyleApi.d.ts +1 -1
- package/src/Api/ConfigApi.d.ts +1 -1
- package/src/Api/CustomSortApi.d.ts +1 -1
- package/src/Api/DashboardApi.d.ts +1 -1
- package/src/Api/DataSourceApi.d.ts +1 -1
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/GridDataChanged.d.ts +5 -1
- package/src/Api/ExportApi.d.ts +7 -2
- package/src/Api/FormatColumnApi.d.ts +1 -1
- package/src/Api/FreeTextColumnApi.d.ts +1 -1
- package/src/Api/GridApi.d.ts +24 -3
- package/src/Api/Implementation/AlertApiImpl.d.ts +4 -1
- package/src/Api/Implementation/AlertApiImpl.js +79 -52
- 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/ExportApiImpl.d.ts +2 -1
- package/src/Api/Implementation/ExportApiImpl.js +14 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -1
- package/src/Api/Implementation/GridApiImpl.js +24 -3
- package/src/Api/Implementation/InternalApiImpl.d.ts +9 -2
- package/src/Api/Implementation/InternalApiImpl.js +37 -1
- package/src/Api/Implementation/LayoutApiImpl.d.ts +6 -0
- package/src/Api/Implementation/LayoutApiImpl.js +48 -0
- package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
- package/src/Api/Implementation/SettingsPanelApiImpl.js +7 -1
- package/src/Api/InternalApi.d.ts +9 -2
- package/src/Api/LayoutApi.d.ts +38 -1
- package/src/Api/PlusMinusApi.d.ts +1 -1
- package/src/Api/QueryApi.d.ts +1 -1
- package/src/Api/QuickSearchApi.d.ts +1 -1
- package/src/Api/ScheduleApi.d.ts +1 -1
- package/src/Api/ShortcutApi.d.ts +1 -1
- package/src/Api/SmartEditApi.d.ts +1 -1
- package/src/Api/TeamSharingApi.d.ts +1 -1
- package/src/Api/ThemeApi.d.ts +1 -1
- 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/AdaptablePredicate.js +20 -0
- package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -1
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
- 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/Redux/ActionsReducers/FlashingCellRedux.js +4 -8
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +18 -0
- package/src/Redux/ActionsReducers/PopupRedux.js +36 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +11 -0
- package/src/Redux/ActionsReducers/SystemRedux.js +32 -1
- package/src/Redux/Store/AdaptableReduxMerger.d.ts +1 -0
- package/src/Redux/Store/AdaptableReduxMerger.js +40 -4
- package/src/Redux/Store/AdaptableStore.js +69 -27
- package/src/Strategy/AlertModule.d.ts +5 -3
- package/src/Strategy/AlertModule.js +60 -16
- package/src/Strategy/BulkUpdateModule.js +5 -0
- package/src/Strategy/ExportModule.js +1 -0
- 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/Interface/MessagePopups.d.ts +13 -0
- package/src/Utilities/ObjectFactory.d.ts +8 -6
- package/src/Utilities/ObjectFactory.js +26 -12
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/ModuleService.js +1 -1
- package/src/Utilities/Services/ValidationService.js +1 -0
- 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 -1
- 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/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 +4 -2
- package/src/agGrid/Adaptable.js +65 -69
- package/src/agGrid/PercentBarRenderer.js +2 -1
- 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 +51 -11
- package/src/metamodel/adaptable.metamodel.js +183 -40
- package/src/types.d.ts +3 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAdaptableRowChangedAlert = exports.isAdaptableCellChangedAlert = void 0;
|
|
4
|
+
exports.isAdaptableCellChangedAlert = (alert) => {
|
|
5
|
+
return alert.alertType === 'cellChanged';
|
|
6
|
+
};
|
|
7
|
+
exports.isAdaptableRowChangedAlert = (alert) => {
|
|
8
|
+
return alert.alertType === 'rowChanged';
|
|
9
|
+
};
|
|
@@ -495,5 +495,25 @@ exports.SystemPredicateDefs = [
|
|
|
495
495
|
return distinctValues.includes(value);
|
|
496
496
|
},
|
|
497
497
|
},
|
|
498
|
+
{
|
|
499
|
+
id: 'AddedRow',
|
|
500
|
+
label: 'Added Row(s)',
|
|
501
|
+
columnScope: { All: true },
|
|
502
|
+
moduleScope: ['alert'],
|
|
503
|
+
handler: () => {
|
|
504
|
+
// handled in AlertModule as an eventHandler
|
|
505
|
+
return false;
|
|
506
|
+
},
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
id: 'RemovedRow',
|
|
510
|
+
label: 'Removed Row(s)',
|
|
511
|
+
columnScope: { All: true },
|
|
512
|
+
moduleScope: ['alert'],
|
|
513
|
+
handler: () => {
|
|
514
|
+
// handled in AlertModule as an eventHandler
|
|
515
|
+
return false;
|
|
516
|
+
},
|
|
517
|
+
},
|
|
498
518
|
];
|
|
499
519
|
exports.SystemFilterPredicateIds = exports.SystemPredicateDefs.filter((p) => p.moduleScope.includes('filter')).map((p) => p.id);
|
|
@@ -5,11 +5,11 @@ export interface Entitlement {
|
|
|
5
5
|
*/
|
|
6
6
|
adaptableModule: AdaptableModule;
|
|
7
7
|
/**
|
|
8
|
-
* Access Level for an Entitlement; options are:
|
|
8
|
+
* Access Level for an Entitlement; options are: `Full` `ReadOnly` `Hidden`
|
|
9
9
|
*/
|
|
10
10
|
accessLevel: AccessLevel;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Defines Access Level for an Entitlement - can be
|
|
13
|
+
* Defines Access Level for an Entitlement - can be `ReadOnly`, `Hidden` or `Full`
|
|
14
14
|
*/
|
|
15
15
|
export declare type AccessLevel = 'ReadOnly' | 'Hidden' | 'Full';
|
|
@@ -68,6 +68,9 @@ export interface UserMenuItem<CONTEXT_TYPE extends BaseMenuContext> {
|
|
|
68
68
|
*/
|
|
69
69
|
subMenuItems?: UserMenuItem<CONTEXT_TYPE>[];
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Base Context object used for both Column and Context Menu Context
|
|
73
|
+
*/
|
|
71
74
|
export interface BaseMenuContext {
|
|
72
75
|
/**
|
|
73
76
|
* The Adaptable Api - included as a convenience
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AdaptableStyle } from '../../../types';
|
|
2
|
+
export interface RowsHighlightInfo {
|
|
3
|
+
/**
|
|
4
|
+
* Primary key valuse for the rows to be highlighted
|
|
5
|
+
*/
|
|
6
|
+
primaryKeyValues: any[];
|
|
7
|
+
/**
|
|
8
|
+
* Timeout after which the highlight is removed
|
|
9
|
+
*/
|
|
10
|
+
timeout?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Highlight style
|
|
13
|
+
*/
|
|
14
|
+
highlightStyle: AdaptableStyle;
|
|
15
|
+
}
|
|
@@ -5,5 +5,8 @@ export interface ConfigState {
|
|
|
5
5
|
/**
|
|
6
6
|
* Version number of the Item - allows developers to update one section in Predefined Config while keeping others unchanged
|
|
7
7
|
*/
|
|
8
|
-
Revision?: number
|
|
8
|
+
Revision?: number | {
|
|
9
|
+
Key: number;
|
|
10
|
+
UpdateStrategy: 'Override' | 'KeepUserDefined';
|
|
11
|
+
};
|
|
9
12
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ScreenPopup, AlertPopup, ConfirmationPopup, PromptPopup, LoadingPopup } from '../Utilities/Interface/MessagePopups';
|
|
1
|
+
import { ScreenPopup, AlertPopup, ConfirmationPopup, PromptPopup, LoadingPopup, WindowPopup } from '../Utilities/Interface/MessagePopups';
|
|
2
2
|
import { InternalState } from './InternalState';
|
|
3
3
|
/**
|
|
4
4
|
* Internal state to manage open popups - NOT persisted by Redux
|
|
5
5
|
*/
|
|
6
6
|
export interface PopupState extends InternalState {
|
|
7
7
|
ScreenPopup: ScreenPopup;
|
|
8
|
+
WindowPopup: WindowPopup;
|
|
8
9
|
AlertPopup: AlertPopup;
|
|
9
10
|
ConfirmationPopup: ConfirmationPopup;
|
|
10
11
|
PromptPopup: PromptPopup;
|
|
@@ -64,28 +64,24 @@ exports.FlashingCellReducer = (state = initialState, action) => {
|
|
|
64
64
|
let flashingCellDefinitions;
|
|
65
65
|
switch (action.type) {
|
|
66
66
|
case exports.FLASHING_CELL_DEFINITION_SET: {
|
|
67
|
-
const actionFlashingCellDefinition = action
|
|
68
|
-
.flashingCellDefinitions;
|
|
67
|
+
const actionFlashingCellDefinition = action.flashingCellDefinitions;
|
|
69
68
|
return Object.assign(Object.assign({}, state), { FlashingCellDefinitions: actionFlashingCellDefinition });
|
|
70
69
|
}
|
|
71
70
|
case exports.FLASHING_CELL_DEFINITION_ADD: {
|
|
72
|
-
const actionFlashingCellDefinition = action
|
|
73
|
-
.flashingCellDefinition;
|
|
71
|
+
const actionFlashingCellDefinition = action.flashingCellDefinition;
|
|
74
72
|
AdaptableHelper_1.default.addUuidAndSource(actionFlashingCellDefinition);
|
|
75
73
|
flashingCellDefinitions = [].concat(state.FlashingCellDefinitions);
|
|
76
74
|
flashingCellDefinitions.push(actionFlashingCellDefinition);
|
|
77
75
|
return Object.assign(Object.assign({}, state), { FlashingCellDefinitions: flashingCellDefinitions });
|
|
78
76
|
}
|
|
79
77
|
case exports.FLASHING_CELL_DEFINITION_EDIT: {
|
|
80
|
-
const actionFlashingCellDefinition = action
|
|
81
|
-
.flashingCellDefinition;
|
|
78
|
+
const actionFlashingCellDefinition = action.flashingCellDefinition;
|
|
82
79
|
return Object.assign(Object.assign({}, state), { FlashingCellDefinitions: state.FlashingCellDefinitions.map((abObject) => abObject.Uuid === actionFlashingCellDefinition.Uuid
|
|
83
80
|
? actionFlashingCellDefinition
|
|
84
81
|
: abObject) });
|
|
85
82
|
}
|
|
86
83
|
case exports.FLASHING_CELL_DEFINITION_DELETE: {
|
|
87
|
-
const actionFlashingCellDefinition = action
|
|
88
|
-
.flashingCellDefinition;
|
|
84
|
+
const actionFlashingCellDefinition = action.flashingCellDefinition;
|
|
89
85
|
return Object.assign(Object.assign({}, state), { FlashingCellDefinitions: state.FlashingCellDefinitions.filter((abObject) => abObject.Uuid !== actionFlashingCellDefinition.Uuid) });
|
|
90
86
|
}
|
|
91
87
|
case exports.FLASHING_CELL_DEFINITION_SUSPEND: {
|
|
@@ -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
|
}
|
|
@@ -12,6 +12,7 @@ import { CachedQuery } from '../../PredefinedConfig/QueryState';
|
|
|
12
12
|
import { AdaptableFlashingCell } from '../../PredefinedConfig/Common/AdaptableFlashingCell';
|
|
13
13
|
import { MathOperation, SummaryOperation } from '../../PredefinedConfig/Common/Enums';
|
|
14
14
|
import { DataChangedInfo } from '../../PredefinedConfig/Common/DataChangedInfo';
|
|
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 {
|
|
@@ -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;
|
|
@@ -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: [],
|
|
@@ -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
|
}
|