@adaptabletools/adaptable 11.1.1-canary.0 → 11.1.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/README.md +6 -4
- package/agGrid.d.ts +2 -2
- package/base.css +4 -6
- package/bundle.cjs.js +67 -67
- package/index.css +4 -6
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +2 -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/UserInterfaceOptions.d.ts +8 -12
- package/src/Api/AlertApi.d.ts +3 -5
- package/src/Api/DataChangeHistoryApi.d.ts +3 -3
- package/src/Api/Events/CellChanged.d.ts +2 -2
- package/src/Api/ExportApi.d.ts +3 -3
- package/src/Api/FreeTextColumnApi.d.ts +3 -3
- package/src/Api/GridApi.d.ts +4 -4
- package/src/Api/Implementation/AlertApiImpl.d.ts +3 -3
- package/src/Api/Implementation/AlertApiImpl.js +20 -20
- package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +3 -3
- package/src/Api/Implementation/EventApiImpl.js +2 -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 +3 -3
- package/src/Api/Implementation/GridApiImpl.js +5 -5
- package/src/Api/Implementation/InternalApiImpl.d.ts +2 -2
- package/src/Api/Implementation/InternalApiImpl.js +6 -6
- package/src/Api/Implementation/UserInterfaceApiImpl.js +3 -1
- package/src/Api/InternalApi.d.ts +2 -2
- package/src/Api/QueryLanguageApi.d.ts +6 -6
- package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptableFlashingCell.d.ts +2 -2
- package/src/PredefinedConfig/Common/{DataChangedInfo.d.ts → CellDataChangedInfo.d.ts} +1 -5
- package/src/PredefinedConfig/Common/{DataChangedInfo.js → CellDataChangedInfo.js} +0 -0
- package/src/PredefinedConfig/Common/DataChangedScope.d.ts +4 -0
- package/src/PredefinedConfig/Common/DataChangedScope.js +2 -0
- package/src/PredefinedConfig/SystemState.d.ts +2 -2
- package/src/Redux/ActionsReducers/GridRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/SystemRedux.js +5 -5
- package/src/Redux/Store/AdaptableStore.js +15 -15
- package/src/Strategy/AlertModule.js +12 -10
- package/src/Strategy/BulkUpdateModule.js +2 -2
- package/src/Strategy/DataChangeHistoryModule.js +8 -6
- package/src/Strategy/FlashingCellModule.d.ts +2 -2
- package/src/Strategy/FlashingCellModule.js +21 -15
- package/src/Strategy/FormatColumnModule.js +4 -2
- package/src/Utilities/Constants/DocumentationLinkConstants.js +1 -1
- package/src/Utilities/Emitter.d.ts +1 -1
- package/src/Utilities/Emitter.js +3 -6
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +2 -2
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ObjectFactory.d.ts +2 -2
- package/src/Utilities/ObjectFactory.js +2 -2
- 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/QueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/ValidationService.d.ts +4 -4
- package/src/Utilities/Services/ValidationService.js +17 -17
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.d.ts +2 -2
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +2 -2
- package/src/agGrid/ActionColumnRenderer.d.ts +1 -6
- package/src/agGrid/ActionColumnRenderer.js +50 -59
- package/src/agGrid/Adaptable.d.ts +3 -2
- package/src/agGrid/Adaptable.js +97 -59
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -0
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +16 -2
- package/src/metamodel/adaptable.metamodel.d.ts +34 -34
- package/src/metamodel/adaptable.metamodel.js +77 -77
- package/src/types.d.ts +7 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/LICENSE.md +0 -264
|
@@ -32,10 +32,10 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
32
32
|
this.fireGridDataChangedEvent(dataRows, rowNodes, 'Add');
|
|
33
33
|
return rowNodes;
|
|
34
34
|
}
|
|
35
|
-
undoCellEdit(
|
|
35
|
+
undoCellEdit(cellDataChangedInfo) {
|
|
36
36
|
// for the reason of this hacky solution see the comments in DataService
|
|
37
|
-
this.adaptable.api.internalApi.getDataService().logUndoChange(
|
|
38
|
-
this.setCellValue(
|
|
37
|
+
this.adaptable.api.internalApi.getDataService().logUndoChange(cellDataChangedInfo);
|
|
38
|
+
this.setCellValue(cellDataChangedInfo.column.columnId, cellDataChangedInfo.oldValue, cellDataChangedInfo.primaryKeyValue);
|
|
39
39
|
return true;
|
|
40
40
|
}
|
|
41
41
|
async deleteGridData(dataRows, dataUpdateConfig) {
|
|
@@ -276,11 +276,11 @@ class GridApiImpl extends ApiBase_1.ApiBase {
|
|
|
276
276
|
this.adaptable.api.eventApi.emit('SearchChanged', searchChangedInfo);
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
fireCellChangedEvent(
|
|
279
|
+
fireCellChangedEvent(cellDataChangedInfo) {
|
|
280
280
|
if (this.adaptable.isInitialised) {
|
|
281
281
|
const cellChangedInfo = {
|
|
282
282
|
adaptableApi: this.adaptable.api,
|
|
283
|
-
cellChange:
|
|
283
|
+
cellChange: cellDataChangedInfo,
|
|
284
284
|
};
|
|
285
285
|
this.adaptable.api.eventApi.emit('CellChanged', cellChangedInfo);
|
|
286
286
|
}
|
|
@@ -10,7 +10,7 @@ import { SelectedCellInfo } from '../../PredefinedConfig/Selection/SelectedCellI
|
|
|
10
10
|
import { SelectedRowInfo } from '../../PredefinedConfig/Selection/SelectedRowInfo';
|
|
11
11
|
import { AdaptableModule, AdaptableQLModule } from '../../PredefinedConfig/Common/Types';
|
|
12
12
|
import { GridCell } from '../../PredefinedConfig/Selection/GridCell';
|
|
13
|
-
import {
|
|
13
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
14
14
|
import { AdaptableCellChangedAlert, AdaptableOptions, AdaptableRowChangedAlert, AdaptableState, AlertButtonContext, Layout, SystemStatusMessageInfo } from '../../types';
|
|
15
15
|
import { IValidationService } from '../../Utilities/Services/Interface/IValidationService';
|
|
16
16
|
import { IModuleService } from '../../Utilities/Services/Interface/IModuleService';
|
|
@@ -75,7 +75,7 @@ export declare class InternalApiImpl extends ApiBase implements InternalApi {
|
|
|
75
75
|
setGridCells(gridCells: GridCell[]): void;
|
|
76
76
|
setToolbarTitle(): string;
|
|
77
77
|
setGridCell(gridCell: GridCell): void;
|
|
78
|
-
buildDataChangedInfo(config: Pick<
|
|
78
|
+
buildDataChangedInfo(config: Pick<CellDataChangedInfo, 'newValue' | 'oldValue' | 'column' | 'primaryKeyValue' | 'rowNode' | 'trigger'>): CellDataChangedInfo;
|
|
79
79
|
private createDataChangedInfoFromGridCell;
|
|
80
80
|
setLastAppliedShortCut(gridCell: GridCell | undefined): void;
|
|
81
81
|
updateCurrentDraftLayout(layout: Layout): void;
|
|
@@ -75,8 +75,8 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
|
|
|
75
75
|
return this.getAdaptableCellChangedAlerts().find((alert) => {
|
|
76
76
|
var _a, _b, _c, _d;
|
|
77
77
|
return ((_a = alert.alertDefinition.AlertProperties) === null || _a === void 0 ? void 0 : _a.HighlightCell) &&
|
|
78
|
-
((_c = (_b = alert.
|
|
79
|
-
((_d = alert.
|
|
78
|
+
((_c = (_b = alert.cellDataChangedInfo) === null || _b === void 0 ? void 0 : _b.column) === null || _c === void 0 ? void 0 : _c.columnId) === columnId &&
|
|
79
|
+
((_d = alert.cellDataChangedInfo) === null || _d === void 0 ? void 0 : _d.rowNode) === rowNode;
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
getAdaptableAlertWithHighlightRow(rowNode) {
|
|
@@ -197,8 +197,8 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
|
|
|
197
197
|
return toolbarTitle;
|
|
198
198
|
}
|
|
199
199
|
setGridCell(gridCell) {
|
|
200
|
-
const
|
|
201
|
-
this.adaptable.setValue(
|
|
200
|
+
const cellDataChangedInfo = this.createDataChangedInfoFromGridCell(gridCell);
|
|
201
|
+
this.adaptable.setValue(cellDataChangedInfo);
|
|
202
202
|
}
|
|
203
203
|
buildDataChangedInfo(config) {
|
|
204
204
|
var _a;
|
|
@@ -207,14 +207,14 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
|
|
|
207
207
|
createDataChangedInfoFromGridCell(gridCell) {
|
|
208
208
|
let currentValue = this.adaptable.getDisplayValue(gridCell.primaryKeyValue, gridCell.column.columnId);
|
|
209
209
|
const currentRowNode = this.adaptable.getRowNodeForPrimaryKey(gridCell.primaryKeyValue);
|
|
210
|
-
const
|
|
210
|
+
const cellDataChangedInfo = this.buildDataChangedInfo({
|
|
211
211
|
oldValue: currentValue,
|
|
212
212
|
newValue: gridCell.rawValue,
|
|
213
213
|
column: gridCell.column,
|
|
214
214
|
primaryKeyValue: gridCell.primaryKeyValue,
|
|
215
215
|
rowNode: currentRowNode,
|
|
216
216
|
});
|
|
217
|
-
return
|
|
217
|
+
return cellDataChangedInfo;
|
|
218
218
|
}
|
|
219
219
|
setLastAppliedShortCut(gridCell) {
|
|
220
220
|
this.dispatchAction(SystemRedux.SetLastAppliedShortcut(gridCell));
|
|
@@ -8,7 +8,9 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
|
|
|
8
8
|
let colorPalette = this.getUserInterfaceOptions().colorPalette;
|
|
9
9
|
// first do the function then get hardcoded items
|
|
10
10
|
if (colorPalette != null && typeof colorPalette === 'function') {
|
|
11
|
-
|
|
11
|
+
const currentTheme = this.adaptable.api.themeApi.getCurrentTheme();
|
|
12
|
+
const colours = colorPalette(currentTheme);
|
|
13
|
+
return colours;
|
|
12
14
|
}
|
|
13
15
|
else {
|
|
14
16
|
let arr = colorPalette;
|
package/src/Api/InternalApi.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
|
|
|
17
17
|
import { Layout } from '../PredefinedConfig/LayoutState';
|
|
18
18
|
import { AdaptableAlert, AdaptableCellChangedAlert, AdaptableRowChangedAlert } from '../PredefinedConfig/Common/AdaptableAlert';
|
|
19
19
|
import { IDataService } from '../Utilities/Services/Interface/IDataService';
|
|
20
|
-
import { AdaptableMessageType, AlertDefinition,
|
|
20
|
+
import { AdaptableMessageType, AlertDefinition, CellDataChangedInfo, SystemStatusMessageInfo } from '../types';
|
|
21
21
|
import { IEntitlementService } from '../Utilities/Services/Interface/IEntitlementService';
|
|
22
22
|
import { AdaptableFlashingCell } from '../PredefinedConfig/Common/AdaptableFlashingCell';
|
|
23
23
|
import { IQueryLanguageService } from '../Utilities/Services/Interface/IQueryLanguageService';
|
|
@@ -80,7 +80,7 @@ export interface InternalApi {
|
|
|
80
80
|
setGridCell(gridCell: GridCell): void;
|
|
81
81
|
setToolbarTitle(): string;
|
|
82
82
|
getQueryPreviewData(): any;
|
|
83
|
-
buildDataChangedInfo(config: Pick<
|
|
83
|
+
buildDataChangedInfo(config: Pick<CellDataChangedInfo, 'newValue' | 'oldValue' | 'column' | 'primaryKeyValue' | 'rowNode' | 'trigger'>): CellDataChangedInfo;
|
|
84
84
|
setLastAppliedShortCut(gridCell: GridCell | undefined): void;
|
|
85
85
|
updateCurrentDraftLayout(layout: Layout): void;
|
|
86
86
|
getPrimaryKey(): any;
|
|
@@ -2,16 +2,16 @@ import { AdaptableModule } from '../PredefinedConfig/Common/Types';
|
|
|
2
2
|
import { ExpressionFunctionMap } from '../types';
|
|
3
3
|
import { AdaptableQuery } from '../PredefinedConfig/Common/AdaptableQuery';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Functions related to AdapTableQL (the Adaptable Query Language)
|
|
6
6
|
*/
|
|
7
7
|
export interface QueryLanguageApi {
|
|
8
8
|
/**
|
|
9
9
|
* Whether the given BooleanExpression is valid
|
|
10
|
-
* @param
|
|
10
|
+
* @param expression query to Check
|
|
11
11
|
* @param module module specific query
|
|
12
12
|
* @param validationErrorMessage optional validation error message; if provided, the error will be logged
|
|
13
13
|
*/
|
|
14
|
-
isValidBooleanExpression(
|
|
14
|
+
isValidBooleanExpression(expression: string, module: AdaptableModule, validationErrorMessage?: string): boolean;
|
|
15
15
|
/**
|
|
16
16
|
* Whether the given ObservableExpression is valid
|
|
17
17
|
* @param expression - ObservableExpression to check
|
|
@@ -34,7 +34,7 @@ export interface QueryLanguageApi {
|
|
|
34
34
|
*/
|
|
35
35
|
isValidAggregatedScalarExpression(expression: string, module: AdaptableModule, validationErrorMessage?: string): boolean;
|
|
36
36
|
/**
|
|
37
|
-
* Returns all Columns referenced in
|
|
37
|
+
* Returns all Columns referenced in an Expression
|
|
38
38
|
* @param expression - expression to check
|
|
39
39
|
*/
|
|
40
40
|
getColumnsFromExpression(expression: string): string[];
|
|
@@ -47,12 +47,12 @@ export interface QueryLanguageApi {
|
|
|
47
47
|
*/
|
|
48
48
|
getModuleExpressionFunctionMap(): ExpressionFunctionMap;
|
|
49
49
|
/**
|
|
50
|
-
* Runs the AST that AdapTableQL creates for
|
|
50
|
+
* Runs the AST that AdapTableQL creates for an Expression - useful when evaluating remotely
|
|
51
51
|
* @param expression expression to be run
|
|
52
52
|
*/
|
|
53
53
|
getASTForExpression(expression: string): any;
|
|
54
54
|
/**
|
|
55
|
-
* Returns the Expression string of the given AdaptableQuery
|
|
55
|
+
* Returns the Expression string of the given AdaptableQuery: can be Boolean, AggregatedBoolean, Scalar, AggregatedScalar or Observable Expression
|
|
56
56
|
* @param query - the AdaptableQuery
|
|
57
57
|
*/
|
|
58
58
|
getAdaptableQueryExpression(query: Partial<AdaptableQuery>): string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AdaptableObject } from './AdaptableObject';
|
|
2
|
-
import {
|
|
2
|
+
import { CellDataChangedInfo } from './CellDataChangedInfo';
|
|
3
3
|
import { GridDataChangedInfo } from '../../Api/Events/GridDataChanged';
|
|
4
4
|
import { AlertDefinition } from '../AlertState';
|
|
5
5
|
/**
|
|
@@ -16,7 +16,7 @@ export interface AdaptableCellChangedAlert extends AdaptableAlertBase<'cellChang
|
|
|
16
16
|
/**
|
|
17
17
|
* Cell DataChange which triggered Alert
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
cellDataChangedInfo: CellDataChangedInfo;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Defines an Alert fired by AdapTable when a row is changed
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AdaptableObject } from './AdaptableObject';
|
|
2
|
-
import {
|
|
2
|
+
import { CellDataChangedInfo } from '../../types';
|
|
3
3
|
import { FlashingCellDefinition } from '../../../types';
|
|
4
4
|
/**
|
|
5
5
|
* Defines an Alert fired by AdapTable
|
|
@@ -12,7 +12,7 @@ export interface AdaptableFlashingCell extends AdaptableObject {
|
|
|
12
12
|
/**
|
|
13
13
|
* Data change which triggered the FlashingCell
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
cellDataChangedInfo?: CellDataChangedInfo;
|
|
16
16
|
/**
|
|
17
17
|
* Direction of the change: 'up', 'down' or 'neutral'
|
|
18
18
|
*/
|
|
@@ -3,7 +3,7 @@ import { AdaptableColumn } from './AdaptableColumn';
|
|
|
3
3
|
/**
|
|
4
4
|
* Defines a Cell Edit - includes full details of old and new values, the column and the enclosing Row
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface CellDataChangedInfo {
|
|
7
7
|
/**
|
|
8
8
|
* Timestamp of change occurrence (in milliseconds)
|
|
9
9
|
*/
|
|
@@ -37,7 +37,3 @@ export interface DataChangedInfo {
|
|
|
37
37
|
*/
|
|
38
38
|
trigger?: 'edit' | 'tick' | 'undo' | 'aggChange';
|
|
39
39
|
}
|
|
40
|
-
export interface DataChangedScope {
|
|
41
|
-
wholeRow: boolean;
|
|
42
|
-
columnIds: Set<string>;
|
|
43
|
-
}
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PreviewInfo } from '../Utilities/Interface/Preview';
|
|
2
2
|
import { InternalState } from './InternalState';
|
|
3
3
|
import { BulkUpdateValidationResult } from '../Strategy/Interface/IBulkUpdateModule';
|
|
4
|
-
import {
|
|
4
|
+
import { CellDataChangedInfo, GridCell } from '../types';
|
|
5
5
|
import type { IPushPullState, IPushPullReport, IPushPullDomain } from './IPushPullState';
|
|
6
6
|
import { Glue42State, Glue42Report } from './Glue42State';
|
|
7
7
|
import { OpenFinState, OpenFinReport } from './OpenFinState';
|
|
@@ -54,7 +54,7 @@ export interface SystemState extends InternalState, IPushPullState, Glue42State,
|
|
|
54
54
|
disablePersistence: boolean;
|
|
55
55
|
};
|
|
56
56
|
DataChangeHistory: {
|
|
57
|
-
logs: Record<string,
|
|
57
|
+
logs: Record<string, CellDataChangedInfo>;
|
|
58
58
|
currentMode: DataChangeHistoryMode;
|
|
59
59
|
enableTime: Date;
|
|
60
60
|
suspendTime: Date;
|
|
@@ -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;
|
|
@@ -11,7 +11,7 @@ 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
15
|
import { RowsHighlightInfo } from '../../PredefinedConfig/Common/RowsHighlightInfo';
|
|
16
16
|
export declare const FLASHING_CELL_ROW_KEY = "__ROW";
|
|
17
17
|
export declare const SYSTEM_ALERT_ADD = "SYSTEM_ALERT_ADD";
|
|
@@ -191,10 +191,10 @@ export interface SystemLicenseShowWatermarkAction extends Redux.Action {
|
|
|
191
191
|
export interface SystemLicenseDisablePersistenceAction extends Redux.Action {
|
|
192
192
|
}
|
|
193
193
|
export interface SystemDataChangeHistoryAddAction extends Redux.Action {
|
|
194
|
-
changeInfo:
|
|
194
|
+
changeInfo: CellDataChangedInfo;
|
|
195
195
|
}
|
|
196
196
|
export interface SystemDataChangeHistoryUndoAction extends Redux.Action {
|
|
197
|
-
changeInfo:
|
|
197
|
+
changeInfo: CellDataChangedInfo;
|
|
198
198
|
}
|
|
199
199
|
export interface SystemDataChangeHistoryEnableAction extends Redux.Action {
|
|
200
200
|
}
|
|
@@ -249,8 +249,8 @@ export declare const SystemProgressIndicatorShow: (label: string) => SystemProgr
|
|
|
249
249
|
export declare const SystemProgressIndicatorHide: () => SystemProgressIndicatorHideAction;
|
|
250
250
|
export declare const SystemLicenseShowWatermark: (text: string) => SystemLicenseShowWatermarkAction;
|
|
251
251
|
export declare const SystemLicenseDisablePersistence: () => SystemLicenseDisablePersistenceAction;
|
|
252
|
-
export declare const SystemDataChangeHistoryAdd: (changeInfo:
|
|
253
|
-
export declare const SystemDataChangeHistoryUndo: (changeInfo:
|
|
252
|
+
export declare const SystemDataChangeHistoryAdd: (changeInfo: CellDataChangedInfo) => SystemDataChangeHistoryAddAction;
|
|
253
|
+
export declare const SystemDataChangeHistoryUndo: (changeInfo: CellDataChangedInfo) => SystemDataChangeHistoryUndoAction;
|
|
254
254
|
export declare const SystemDataChangeHistoryEnable: () => SystemDataChangeHistoryEnableAction;
|
|
255
255
|
export declare const SystemDataChangeHistoryDisable: () => SystemDataChangeHistoryDisableAction;
|
|
256
256
|
export declare const SystemDataChangeHistorySuspend: () => SystemDataChangeHistorySuspendAction;
|
|
@@ -530,16 +530,16 @@ exports.SystemReducer = (state = initialState, action) => {
|
|
|
530
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) }) });
|
|
531
531
|
case exports.SYSTEM_DATA_CHANGE_HISTORY_ADD: {
|
|
532
532
|
const actionTypedAdd = action;
|
|
533
|
-
const
|
|
534
|
-
const uniqueKey = getDataChangeHistoryKey(
|
|
533
|
+
const cellDataChangedInfo = actionTypedAdd.changeInfo;
|
|
534
|
+
const uniqueKey = getDataChangeHistoryKey(cellDataChangedInfo);
|
|
535
535
|
const updatedDataChangeHistoryLogs = Object.assign({}, state.DataChangeHistory.logs);
|
|
536
|
-
updatedDataChangeHistoryLogs[uniqueKey] =
|
|
536
|
+
updatedDataChangeHistoryLogs[uniqueKey] = cellDataChangedInfo;
|
|
537
537
|
return Object.assign(Object.assign({}, state), { DataChangeHistory: Object.assign(Object.assign({}, state.DataChangeHistory), { logs: updatedDataChangeHistoryLogs }) });
|
|
538
538
|
}
|
|
539
539
|
case exports.SYSTEM_DATA_CHANGE_HISTORY_UNDO: {
|
|
540
540
|
const actionTypedUndo = action;
|
|
541
|
-
const
|
|
542
|
-
const uniqueKey = getDataChangeHistoryKey(
|
|
541
|
+
const cellDataChangedInfo = actionTypedUndo.changeInfo;
|
|
542
|
+
const uniqueKey = getDataChangeHistoryKey(cellDataChangedInfo);
|
|
543
543
|
const updatedDataChangeHistoryLogs = Object.assign({}, state.DataChangeHistory.logs);
|
|
544
544
|
delete updatedDataChangeHistoryLogs[uniqueKey];
|
|
545
545
|
return Object.assign(Object.assign({}, state), { DataChangeHistory: Object.assign(Object.assign({}, state.DataChangeHistory), { logs: updatedDataChangeHistoryLogs }) });
|
|
@@ -324,10 +324,10 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
324
324
|
case SystemRedux.SYSTEM_FLASHING_CELL_ADD:
|
|
325
325
|
case SystemRedux.SYSTEM_FLASHING_CELL_DELETE: {
|
|
326
326
|
const { flashingCell: FlashingCell } = action;
|
|
327
|
-
const {
|
|
327
|
+
const { cellDataChangedInfo: cellDataChangedInfo } = FlashingCell;
|
|
328
328
|
let ret = next(action);
|
|
329
|
-
if (
|
|
330
|
-
adaptable.refreshCells([
|
|
329
|
+
if (cellDataChangedInfo) {
|
|
330
|
+
adaptable.refreshCells([cellDataChangedInfo.rowNode], Object.keys(FlashingCell.flashColumnIds), true);
|
|
331
331
|
}
|
|
332
332
|
return ret;
|
|
333
333
|
}
|
|
@@ -387,9 +387,9 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
387
387
|
const adaptableAlert = actionTyped.alert;
|
|
388
388
|
if (((_c = adaptableAlert.alertDefinition.AlertProperties) === null || _c === void 0 ? void 0 : _c.HighlightCell) &&
|
|
389
389
|
AdaptableAlert_1.isAdaptableCellChangedAlert(adaptableAlert) &&
|
|
390
|
-
adaptableAlert.
|
|
391
|
-
const rowNode = adaptableAlert.
|
|
392
|
-
adaptable.refreshCells([rowNode], [adaptableAlert.
|
|
390
|
+
adaptableAlert.cellDataChangedInfo) {
|
|
391
|
+
const rowNode = adaptableAlert.cellDataChangedInfo.rowNode;
|
|
392
|
+
adaptable.refreshCells([rowNode], [adaptableAlert.cellDataChangedInfo.column.columnId], true);
|
|
393
393
|
}
|
|
394
394
|
if (((_d = adaptableAlert.alertDefinition.AlertProperties) === null || _d === void 0 ? void 0 : _d.HighlightRow) &&
|
|
395
395
|
AdaptableAlert_1.isAdaptableRowChangedAlert(adaptableAlert) &&
|
|
@@ -410,9 +410,9 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
410
410
|
var _a, _b;
|
|
411
411
|
if (((_a = alert.alertDefinition.AlertProperties) === null || _a === void 0 ? void 0 : _a.HighlightCell) &&
|
|
412
412
|
AdaptableAlert_1.isAdaptableCellChangedAlert(alert) &&
|
|
413
|
-
alert.
|
|
414
|
-
let rowNode = alert.
|
|
415
|
-
adaptable.refreshCells([rowNode], [alert.
|
|
413
|
+
alert.cellDataChangedInfo) {
|
|
414
|
+
let rowNode = alert.cellDataChangedInfo.rowNode;
|
|
415
|
+
adaptable.refreshCells([rowNode], [alert.cellDataChangedInfo.column.columnId], true);
|
|
416
416
|
}
|
|
417
417
|
if (((_b = alert.alertDefinition.AlertProperties) === null || _b === void 0 ? void 0 : _b.HighlightRow) &&
|
|
418
418
|
AdaptableAlert_1.isAdaptableRowChangedAlert(alert) &&
|
|
@@ -432,9 +432,9 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
432
432
|
const adaptableAlert = actionTyped.alert;
|
|
433
433
|
if (((_e = adaptableAlert.alertDefinition.AlertProperties) === null || _e === void 0 ? void 0 : _e.HighlightCell) &&
|
|
434
434
|
AdaptableAlert_1.isAdaptableCellChangedAlert(adaptableAlert) &&
|
|
435
|
-
adaptableAlert.
|
|
436
|
-
const rowNode = adaptableAlert.
|
|
437
|
-
adaptable.refreshCells([rowNode], [adaptableAlert.
|
|
435
|
+
adaptableAlert.cellDataChangedInfo) {
|
|
436
|
+
const rowNode = adaptableAlert.cellDataChangedInfo.rowNode;
|
|
437
|
+
adaptable.refreshCells([rowNode], [adaptableAlert.cellDataChangedInfo.column.columnId], true);
|
|
438
438
|
}
|
|
439
439
|
if (((_f = adaptableAlert.alertDefinition.AlertProperties) === null || _f === void 0 ? void 0 : _f.HighlightRow) &&
|
|
440
440
|
AdaptableAlert_1.isAdaptableRowChangedAlert(adaptableAlert) &&
|
|
@@ -645,7 +645,7 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
645
645
|
case QuickSearchRedux.QUICK_SEARCH_RUN: {
|
|
646
646
|
let returnAction = next(action);
|
|
647
647
|
adaptable.redrawBody();
|
|
648
|
-
// if set then
|
|
648
|
+
// if set then return a query on the text
|
|
649
649
|
if (adaptable.adaptableOptions.searchOptions.filterResultsAfterQuickSearch) {
|
|
650
650
|
const actionTyped = action;
|
|
651
651
|
const searchText = actionTyped.quickSearchText;
|
|
@@ -1276,8 +1276,8 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
1276
1276
|
*******************/
|
|
1277
1277
|
case SystemRedux.SYSTEM_DATA_CHANGE_HISTORY_UNDO:
|
|
1278
1278
|
const actionTypedUndo = action;
|
|
1279
|
-
const
|
|
1280
|
-
adaptable.api.gridApi.undoCellEdit(
|
|
1279
|
+
const cellDataChangedInfo = actionTypedUndo.changeInfo;
|
|
1280
|
+
adaptable.api.gridApi.undoCellEdit(cellDataChangedInfo);
|
|
1281
1281
|
return next(action);
|
|
1282
1282
|
/*******************
|
|
1283
1283
|
* SYSTEM (INTERNAL) ACTIONS
|
|
@@ -18,15 +18,17 @@ const AlertEmptyView_1 = require("../View/Alert/AlertEmptyView");
|
|
|
18
18
|
class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
19
19
|
constructor(api) {
|
|
20
20
|
super(ModuleConstants.AlertModuleId, 'Alert', 'alert', 'AlertPopup', 'Get notified when things happen in Adaptable that you need to know about', api);
|
|
21
|
-
this.api.internalApi
|
|
22
|
-
|
|
21
|
+
this.api.internalApi
|
|
22
|
+
.getDataService()
|
|
23
|
+
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
24
|
+
if (cellDataChangedInfo.trigger === 'undo' || cellDataChangedInfo.trigger === 'aggChange') {
|
|
23
25
|
// do NOT handle reverted or aggregated changes
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
28
|
if (this.api.internalApi.getAdaptableOptions().alertOptions.dataChangeDetectionPolicy ===
|
|
27
29
|
'formattedValue') {
|
|
28
|
-
const { oldValue, newValue } =
|
|
29
|
-
const columnId =
|
|
30
|
+
const { oldValue, newValue } = cellDataChangedInfo;
|
|
31
|
+
const columnId = cellDataChangedInfo.column.columnId;
|
|
30
32
|
const oldFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(columnId, oldValue);
|
|
31
33
|
const newFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(columnId, newValue);
|
|
32
34
|
if (oldFormattedValue === newFormattedValue) {
|
|
@@ -34,7 +36,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
34
36
|
return;
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
|
-
this.handleCellDataChanged(
|
|
39
|
+
this.handleCellDataChanged(cellDataChangedInfo);
|
|
38
40
|
});
|
|
39
41
|
this.api.eventApi.on('GridDataChanged', (gridDataChangedInfo) => {
|
|
40
42
|
if (gridDataChangedInfo.rowTrigger === 'Edit') {
|
|
@@ -108,10 +110,10 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
108
110
|
}
|
|
109
111
|
return items;
|
|
110
112
|
}
|
|
111
|
-
handleCellDataChanged(
|
|
112
|
-
const alertDefinitions = this.getAlertDefinitionsForCellDataChange(
|
|
113
|
+
handleCellDataChanged(cellDataChangedInfo) {
|
|
114
|
+
const alertDefinitions = this.getAlertDefinitionsForCellDataChange(cellDataChangedInfo);
|
|
113
115
|
if (alertDefinitions === null || alertDefinitions === void 0 ? void 0 : alertDefinitions.length) {
|
|
114
|
-
this.showAlertForDefinitions(
|
|
116
|
+
this.showAlertForDefinitions(cellDataChangedInfo, alertDefinitions);
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
119
|
handleGridDataChanged(gridDataChangedInfo) {
|
|
@@ -142,9 +144,9 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
142
144
|
]);
|
|
143
145
|
}
|
|
144
146
|
}
|
|
145
|
-
showAlertForDefinitions(
|
|
147
|
+
showAlertForDefinitions(cellDataChangedInfo, alertDefinitions = []) {
|
|
146
148
|
alertDefinitions.forEach((alertDefinition) => {
|
|
147
|
-
const alert = ObjectFactory_1.default.CreateCellChangedAlert(
|
|
149
|
+
const alert = ObjectFactory_1.default.CreateCellChangedAlert(cellDataChangedInfo.column.friendlyName, this.api.alertApi.getAlertDescription(alertDefinition, cellDataChangedInfo), alertDefinition, cellDataChangedInfo);
|
|
148
150
|
this.api.alertApi.displayAlert(alert);
|
|
149
151
|
});
|
|
150
152
|
}
|
|
@@ -121,7 +121,7 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
selectedCellInfo.gridCells.forEach((selectedCell) => {
|
|
124
|
-
const
|
|
124
|
+
const cellDataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
125
125
|
oldValue: selectedCell.rawValue,
|
|
126
126
|
newValue: typedBulkUpdateValue,
|
|
127
127
|
column: selectedCell.column,
|
|
@@ -131,7 +131,7 @@ class BulkUpdateModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
131
131
|
});
|
|
132
132
|
const validationRules = this.api.internalApi
|
|
133
133
|
.getValidationService()
|
|
134
|
-
.getValidationRulesForDataChange(
|
|
134
|
+
.getValidationRulesForDataChange(cellDataChangedInfo);
|
|
135
135
|
const previewResult = {
|
|
136
136
|
id: selectedCell.primaryKeyValue,
|
|
137
137
|
initialValue: selectedCell.rawValue,
|
|
@@ -8,10 +8,12 @@ const SystemRedux_1 = require("../Redux/ActionsReducers/SystemRedux");
|
|
|
8
8
|
class DataChangeHistoryModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
9
9
|
constructor(api) {
|
|
10
10
|
super(ModuleConstants.DataChangeHistoryModuleId, 'Data Changes', 'track-changes', 'DataChangeHistoryPopup', 'Provides an overview of all previous changes, giving the possibility to undo specific changes', api);
|
|
11
|
-
this.api.internalApi
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
this.api.internalApi
|
|
12
|
+
.getDataService()
|
|
13
|
+
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
14
|
+
if (cellDataChangedInfo.trigger !== 'undo' && cellDataChangedInfo.trigger !== 'aggChange') {
|
|
15
|
+
if (this.shouldLogDataChange(cellDataChangedInfo)) {
|
|
16
|
+
this.api.internalApi.dispatchReduxAction(SystemRedux_1.SystemDataChangeHistoryAdd(cellDataChangedInfo));
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
});
|
|
@@ -22,7 +24,7 @@ class DataChangeHistoryModule extends AdaptableModuleBase_1.AdaptableModuleBase
|
|
|
22
24
|
hasNamedQueryReferences() {
|
|
23
25
|
return false;
|
|
24
26
|
}
|
|
25
|
-
shouldLogDataChange(
|
|
27
|
+
shouldLogDataChange(cellDataChangedInfo) {
|
|
26
28
|
// we log changes only if the change tracking is active
|
|
27
29
|
if (this.api.internalApi.getState().System.DataChangeHistory.currentMode !== 'ACTIVE') {
|
|
28
30
|
return false;
|
|
@@ -30,7 +32,7 @@ class DataChangeHistoryModule extends AdaptableModuleBase_1.AdaptableModuleBase
|
|
|
30
32
|
if (this.api.internalApi.getAdaptableOptions().dataChangeHistoryOptions.showDataChange) {
|
|
31
33
|
return this.api.internalApi
|
|
32
34
|
.getAdaptableOptions()
|
|
33
|
-
.dataChangeHistoryOptions.showDataChange(
|
|
35
|
+
.dataChangeHistoryOptions.showDataChange(cellDataChangedInfo);
|
|
34
36
|
}
|
|
35
37
|
return true;
|
|
36
38
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
3
3
|
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
|
|
4
|
-
import {
|
|
4
|
+
import { CellDataChangedInfo } from '../PredefinedConfig/Common/CellDataChangedInfo';
|
|
5
5
|
import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
6
6
|
import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
|
|
7
7
|
import * as FlashingCellRedux from '../Redux/ActionsReducers/FlashingCellRedux';
|
|
@@ -16,7 +16,7 @@ export declare class FlashingCellModule extends AdaptableModuleBase implements I
|
|
|
16
16
|
getReferencedNamedQueryNames(alertDefinition: FlashingCellDefinition): string[];
|
|
17
17
|
addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
18
18
|
addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
19
|
-
protected handleDataSourceChanged(
|
|
19
|
+
protected handleDataSourceChanged(cellDataChangedInfo: CellDataChangedInfo): void;
|
|
20
20
|
private showFlashingCellsForDefinitions;
|
|
21
21
|
private isFlashingTargetOnlyAggChange;
|
|
22
22
|
private getFlashingCellDefinitionsForDataChange;
|