@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
|
@@ -17,8 +17,10 @@ const getFlashingTargetViewItems_1 = require("./Utilities/getFlashingTargetViewI
|
|
|
17
17
|
class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
18
18
|
constructor(api) {
|
|
19
19
|
super(ModuleConstants.FlashingCellModuleId, 'Flashing Cell', 'flashing-cell', 'FlashingAlert', 'Flash cells when they change', api);
|
|
20
|
-
this.api.internalApi
|
|
21
|
-
|
|
20
|
+
this.api.internalApi
|
|
21
|
+
.getDataService()
|
|
22
|
+
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
23
|
+
if (cellDataChangedInfo.trigger === 'undo') {
|
|
22
24
|
// do NOT handle reverted changes
|
|
23
25
|
return;
|
|
24
26
|
}
|
|
@@ -26,8 +28,8 @@ class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
26
28
|
// - flash for the underlying small data changes, but the visual does not
|
|
27
29
|
if (this.api.internalApi.getAdaptableOptions().alertOptions.dataChangeDetectionPolicy ===
|
|
28
30
|
'formattedValue') {
|
|
29
|
-
const { oldValue, newValue } =
|
|
30
|
-
const columnId =
|
|
31
|
+
const { oldValue, newValue } = cellDataChangedInfo;
|
|
32
|
+
const columnId = cellDataChangedInfo.column.columnId;
|
|
31
33
|
const oldFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(columnId, oldValue);
|
|
32
34
|
const newFormattedValue = this.api.gridApi.getFormattedValueFromRawValue(columnId, newValue);
|
|
33
35
|
if (oldFormattedValue === newFormattedValue) {
|
|
@@ -35,7 +37,7 @@ class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
|
-
this.handleDataSourceChanged(
|
|
40
|
+
this.handleDataSourceChanged(cellDataChangedInfo);
|
|
39
41
|
});
|
|
40
42
|
}
|
|
41
43
|
getModuleAdaptableObjects() {
|
|
@@ -101,23 +103,27 @@ class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
101
103
|
}
|
|
102
104
|
return items;
|
|
103
105
|
}
|
|
104
|
-
handleDataSourceChanged(
|
|
105
|
-
const flashingCellDefinitions = this.getFlashingCellDefinitionsForDataChange(
|
|
106
|
+
handleDataSourceChanged(cellDataChangedInfo) {
|
|
107
|
+
const flashingCellDefinitions = this.getFlashingCellDefinitionsForDataChange(cellDataChangedInfo);
|
|
106
108
|
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(flashingCellDefinitions)) {
|
|
107
|
-
this.showFlashingCellsForDefinitions(
|
|
109
|
+
this.showFlashingCellsForDefinitions(cellDataChangedInfo, flashingCellDefinitions);
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
|
-
showFlashingCellsForDefinitions(
|
|
112
|
+
showFlashingCellsForDefinitions(cellDataChangedInfo, flashingCellDefinitions = []) {
|
|
111
113
|
const allColumnIds = this.api.columnApi.getColumns().map((c) => c.columnId);
|
|
112
|
-
const columnDataType =
|
|
114
|
+
const columnDataType = cellDataChangedInfo.column.dataType;
|
|
113
115
|
const numeric = columnDataType === 'Number';
|
|
114
116
|
const isComparableType = numeric || columnDataType === 'Date';
|
|
115
117
|
let up = false;
|
|
116
118
|
let down = false;
|
|
117
119
|
let direction = 'neutral';
|
|
118
120
|
if (isComparableType) {
|
|
119
|
-
const newValue = numeric
|
|
120
|
-
|
|
121
|
+
const newValue = numeric
|
|
122
|
+
? Number(cellDataChangedInfo.newValue)
|
|
123
|
+
: cellDataChangedInfo.newValue;
|
|
124
|
+
const oldValue = numeric
|
|
125
|
+
? Number(cellDataChangedInfo.oldValue)
|
|
126
|
+
: cellDataChangedInfo.oldValue;
|
|
121
127
|
up = newValue > oldValue;
|
|
122
128
|
down = newValue < oldValue;
|
|
123
129
|
direction = up ? 'up' : down ? 'down' : 'neutral';
|
|
@@ -125,7 +131,7 @@ class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
125
131
|
flashingCellDefinitions.forEach((flashingCellDefinition) => {
|
|
126
132
|
var _a;
|
|
127
133
|
let flashTarget = this.api.flashingCellApi.getFlashingCellFlashTarget(flashingCellDefinition);
|
|
128
|
-
const flashColumnIds = { [
|
|
134
|
+
const flashColumnIds = { [cellDataChangedInfo.column.columnId]: true };
|
|
129
135
|
/**
|
|
130
136
|
* When flashing a row, all columns in that row are marked to flash.
|
|
131
137
|
*/
|
|
@@ -134,11 +140,11 @@ class FlashingCellModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
134
140
|
flashColumnIds[colId] = true;
|
|
135
141
|
});
|
|
136
142
|
}
|
|
137
|
-
const rowPrimaryKey =
|
|
143
|
+
const rowPrimaryKey = cellDataChangedInfo.primaryKeyValue;
|
|
138
144
|
this.api.flashingCellApi.showFlashingCell({
|
|
139
145
|
rowPrimaryKey,
|
|
140
146
|
flashingCellDefinition: flashingCellDefinition,
|
|
141
|
-
|
|
147
|
+
cellDataChangedInfo: cellDataChangedInfo,
|
|
142
148
|
direction,
|
|
143
149
|
flashTarget,
|
|
144
150
|
flashColumnIds,
|
|
@@ -19,7 +19,9 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
19
19
|
* Use Case: Data (cell/row) has changed
|
|
20
20
|
* Action: Any CheckboxFormatColumns need to be updated, as their disabled state may have changed
|
|
21
21
|
*/
|
|
22
|
-
this.api.internalApi
|
|
22
|
+
this.api.internalApi
|
|
23
|
+
.getDataService()
|
|
24
|
+
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
23
25
|
const activeCheckboxColumnIds = this.api.columnApi
|
|
24
26
|
.getColumns()
|
|
25
27
|
.filter((aColumn) => {
|
|
@@ -28,7 +30,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
28
30
|
})
|
|
29
31
|
.map((aColumn) => aColumn.columnId);
|
|
30
32
|
// no need to refresh the CheckboxColumns if the change was triggered by one of them
|
|
31
|
-
if (!activeCheckboxColumnIds.includes(
|
|
33
|
+
if (!activeCheckboxColumnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
32
34
|
this.api.internalApi
|
|
33
35
|
.getAdaptableInstance()
|
|
34
36
|
.refreshCells(null, activeCheckboxColumnIds, true, true);
|
|
@@ -11,4 +11,4 @@ exports.AggregatedBooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptab
|
|
|
11
11
|
exports.AggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-aggregation#aggregated-scalar-expressions`;
|
|
12
12
|
exports.PredicateDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-predicate`;
|
|
13
13
|
exports.PrimaryKeyDocsLink = `${exports.HOST_URL_DOCS}/guide/dev-guide-tutorial-primary-key`;
|
|
14
|
-
exports.LicenseDocsLink = `${exports.HOST_URL_DOCS}/licensing`;
|
|
14
|
+
exports.LicenseDocsLink = `${exports.HOST_URL_DOCS}/guide/licensing`;
|
|
@@ -7,7 +7,7 @@ declare class Emittery {
|
|
|
7
7
|
on(eventName: string, listener: EmitterCallback): any;
|
|
8
8
|
off(eventName: string, listener: EmitterCallback): void;
|
|
9
9
|
once(eventName: string): Promise<unknown>;
|
|
10
|
-
onIncludeFiredOnce(eventName: string
|
|
10
|
+
onIncludeFiredOnce(eventName: string): Promise<any>;
|
|
11
11
|
onIncludeFired(eventName: string, listener: EmitterCallback): any;
|
|
12
12
|
emit(eventName: string, eventData?: any): Promise<any[]>;
|
|
13
13
|
emitSync(eventName: string, eventData?: any): any[];
|
package/src/Utilities/Emitter.js
CHANGED
|
@@ -100,16 +100,13 @@ class Emittery {
|
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
onIncludeFiredOnce(eventName
|
|
103
|
+
onIncludeFiredOnce(eventName) {
|
|
104
104
|
const triggeredEventsMap = triggeredMap.get(this);
|
|
105
105
|
const eventInfo = triggeredEventsMap.get(eventName);
|
|
106
106
|
if (eventInfo) {
|
|
107
|
-
|
|
108
|
-
return () => { };
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
return this.on(eventName, listener);
|
|
107
|
+
return Promise.resolve(eventInfo.data);
|
|
112
108
|
}
|
|
109
|
+
return this.once(eventName);
|
|
113
110
|
}
|
|
114
111
|
onIncludeFired(eventName, listener) {
|
|
115
112
|
const triggeredEventsMap = triggeredMap.get(this);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpressionFunction } from '../../parser/src/types';
|
|
2
|
-
declare type AggregationFunctionName = 'WHERE' | 'COL' | AggregationFunction | ComparisonFunction;
|
|
2
|
+
export declare type AggregationFunctionName = 'WHERE' | 'COL' | AggregationFunction | ComparisonFunction;
|
|
3
3
|
declare type AggregationFunction = 'SUM';
|
|
4
4
|
declare type ComparisonFunction = 'EQ' | 'NEQ' | 'LT' | 'GT' | 'LTE' | 'GTE';
|
|
5
5
|
export declare const aggregatedBooleanExpressionFunctions: Record<AggregationFunctionName, ExpressionFunction>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExpressionContext } from '../../parser/src/types';
|
|
2
2
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
import {
|
|
4
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
5
5
|
export interface BaseParameter<T = string, N = string> {
|
|
6
6
|
type: T;
|
|
7
7
|
name: N;
|
|
@@ -12,7 +12,7 @@ export interface ColumnParameter extends BaseParameter<'config', 'COL'> {
|
|
|
12
12
|
export declare const getStringValues: (context: ExpressionContext, ...stringArguments: string[]) => string[];
|
|
13
13
|
export declare const getStringValue: (context: ExpressionContext, stringArgument: string) => string;
|
|
14
14
|
export declare const isTextSearchCaseInsensitive: (context: ExpressionContext) => boolean;
|
|
15
|
-
export declare const getDataChangeLog$: (context: ExpressionContext, columnNameFilter: string) => Observable<
|
|
15
|
+
export declare const getDataChangeLog$: (context: ExpressionContext, columnNameFilter: string) => Observable<CellDataChangedInfo>;
|
|
16
16
|
export declare const handleWhereFunction: (args: any[], context: ExpressionContext) => any;
|
|
17
17
|
export declare const extractColumnParameter: (consumingFunctionName: string, args: BaseParameter[]) => ColumnParameter;
|
|
18
18
|
export declare const extractParameter: <T extends BaseParameter<string, string>>(consumingFunctionName: string, allowedType: T["type"], allowedOperands: T["name"][], args: BaseParameter[], isOptional?: boolean) => T;
|
|
@@ -18,7 +18,7 @@ exports.getStringValue = (context, stringArgument) => {
|
|
|
18
18
|
return exports.isTextSearchCaseInsensitive(context) ? stringArgument.toLowerCase() : stringArgument;
|
|
19
19
|
};
|
|
20
20
|
exports.isTextSearchCaseInsensitive = (context) => !context.api.internalApi.isTextComparisonCaseSensitive();
|
|
21
|
-
// returns an observable which filters the source$ emissions and emits only if the
|
|
21
|
+
// returns an observable which filters the source$ emissions and emits only if the CellDataChangedInfo relates to the given column
|
|
22
22
|
// optionally, if a filter function (where clause) is provided, it is also evaluated
|
|
23
23
|
exports.getDataChangeLog$ = (context, columnNameFilter) => {
|
|
24
24
|
let dataChangeLog$ = context.api.internalApi.getDataService().dataChangeLog$;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpressionFunction } from '../../parser/src/types';
|
|
2
|
-
declare type ObservableFunctionName = 'WHERE' | 'COL' | 'TIMEFRAME' | ObservableFunction | ChangeFunction;
|
|
2
|
+
export declare type ObservableFunctionName = 'WHERE' | 'COL' | 'TIMEFRAME' | ObservableFunction | ChangeFunction;
|
|
3
3
|
declare type ObservableFunction = 'ROW_CHANGE' | 'GRID_CHANGE';
|
|
4
4
|
declare type ChangeFunction = 'MAX' | 'MIN' | 'NONE' | 'COUNT';
|
|
5
5
|
export declare const observableExpressionFunctions: Record<ObservableFunctionName, ExpressionFunction>;
|
|
@@ -13,7 +13,7 @@ import { ConditionalStyle } from '../PredefinedConfig/ConditionalStyleState';
|
|
|
13
13
|
import { FormatColumn } from '../PredefinedConfig/FormatColumnState';
|
|
14
14
|
import { FreeTextColumn } from '../PredefinedConfig/FreeTextColumnState';
|
|
15
15
|
import { AdaptableStyle } from '../PredefinedConfig/Common/AdaptableStyle';
|
|
16
|
-
import {
|
|
16
|
+
import { CellDataChangedInfo } from '../PredefinedConfig/Common/CellDataChangedInfo';
|
|
17
17
|
import { Glue42Report, Glue42Schedule } from '../PredefinedConfig/Glue42State';
|
|
18
18
|
import { IPushPullReport } from '../PredefinedConfig/SystemState';
|
|
19
19
|
import { IPushPullSchedule } from '../PredefinedConfig/IPushPullState';
|
|
@@ -34,7 +34,7 @@ export declare function CreateEmptyCalculatedColumn(isFilterable: boolean): Calc
|
|
|
34
34
|
export declare function CreateEmptyNamedQuery(expression?: string): NamedQuery;
|
|
35
35
|
export declare function CreateEmptyPlusMinusNudge(): PlusMinusNudge;
|
|
36
36
|
export declare function CreateGenericAlert(alertHeader: string, alertMessage: string, alertDefinition: AlertDefinition): AdaptableGenericAlert;
|
|
37
|
-
export declare function CreateCellChangedAlert(alertHeader: string, alertMessage: string, alertDefinition: AlertDefinition,
|
|
37
|
+
export declare function CreateCellChangedAlert(alertHeader: string, alertMessage: string, alertDefinition: AlertDefinition, cellDataChangedInfo: CellDataChangedInfo): AdaptableCellChangedAlert;
|
|
38
38
|
export declare function CreateRowChangedAlert(alertHeader: string, alertMessage: string, alertDefinition: AlertDefinition, gridDataChange: GridDataChangedInfo): AdaptableRowChangedAlert;
|
|
39
39
|
export declare function CreateEmptyAlertDefinition(): AlertDefinition;
|
|
40
40
|
export declare function CreateEmptyFlashingCellDefinition(): FlashingCellDefinition;
|
|
@@ -61,14 +61,14 @@ function CreateGenericAlert(alertHeader, alertMessage, alertDefinition) {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
exports.CreateGenericAlert = CreateGenericAlert;
|
|
64
|
-
function CreateCellChangedAlert(alertHeader, alertMessage, alertDefinition,
|
|
64
|
+
function CreateCellChangedAlert(alertHeader, alertMessage, alertDefinition, cellDataChangedInfo) {
|
|
65
65
|
return {
|
|
66
66
|
alertType: 'cellChanged',
|
|
67
67
|
Uuid: Uuid_1.createUuid(),
|
|
68
68
|
header: alertHeader,
|
|
69
69
|
message: alertMessage,
|
|
70
70
|
alertDefinition,
|
|
71
|
-
|
|
71
|
+
cellDataChangedInfo: cellDataChangedInfo,
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
exports.CreateCellChangedAlert = CreateCellChangedAlert;
|
|
@@ -12,8 +12,8 @@ class CalculatedColumnExpressionService {
|
|
|
12
12
|
this.adaptable = adaptable;
|
|
13
13
|
this.adaptable.api.internalApi
|
|
14
14
|
.getDataService()
|
|
15
|
-
.on('
|
|
16
|
-
if (
|
|
15
|
+
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
16
|
+
if (cellDataChangedInfo.trigger === 'aggChange') {
|
|
17
17
|
// do NOT handle changes on group rows
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
@@ -21,7 +21,7 @@ class CalculatedColumnExpressionService {
|
|
|
21
21
|
this.aggregatedScalarCalculatedColumnsMap.forEach((aggregatedScalarCalculatedColumn) => {
|
|
22
22
|
if (aggregatedScalarCalculatedColumn
|
|
23
23
|
.getColumnDependencies()
|
|
24
|
-
.includes(
|
|
24
|
+
.includes(cellDataChangedInfo.column.columnId)) {
|
|
25
25
|
aggregatedScalarCalculatedColumn.refreshAggregatedColumnValue();
|
|
26
26
|
refreshedCalculatedColumns.push(aggregatedScalarCalculatedColumn.getCalculatedColumnId());
|
|
27
27
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { IDataService } from './Interface/IDataService';
|
|
2
2
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
3
|
-
import {
|
|
3
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
4
4
|
import { EmitterCallback } from '../../Utilities/Emitter';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
6
|
export declare class DataService implements IDataService {
|
|
7
7
|
private adaptable;
|
|
8
8
|
private emitter;
|
|
9
9
|
private readonly dataChangeLogSubject$;
|
|
10
|
-
dataChangeLog$: Observable<
|
|
10
|
+
dataChangeLog$: Observable<CellDataChangedInfo>;
|
|
11
11
|
private undoChangeLog;
|
|
12
12
|
private undoChangeTimers;
|
|
13
13
|
constructor(adaptable: IAdaptable);
|
|
14
14
|
on: (eventName: string, callback: EmitterCallback) => (() => void);
|
|
15
15
|
emit: (eventName: string, data?: any) => Promise<any>;
|
|
16
|
-
CreateDataChangedEvent(
|
|
17
|
-
logUndoChange(change:
|
|
18
|
-
extractUndoChange(change:
|
|
16
|
+
CreateDataChangedEvent(cellDataChangedInfo: CellDataChangedInfo): void;
|
|
17
|
+
logUndoChange(change: CellDataChangedInfo): void;
|
|
18
|
+
extractUndoChange(change: CellDataChangedInfo): CellDataChangedInfo | undefined;
|
|
19
19
|
destroy(): void;
|
|
20
20
|
private getUndoChangeKey;
|
|
21
21
|
private logDataChange;
|
|
@@ -20,11 +20,11 @@ class DataService {
|
|
|
20
20
|
this.undoChangeLog = new Map();
|
|
21
21
|
this.undoChangeTimers = new Map();
|
|
22
22
|
}
|
|
23
|
-
CreateDataChangedEvent(
|
|
24
|
-
if (
|
|
25
|
-
this.emitter.emitSync('
|
|
26
|
-
this.adaptable.api.gridApi.fireCellChangedEvent(
|
|
27
|
-
this.logDataChange(
|
|
23
|
+
CreateDataChangedEvent(cellDataChangedInfo) {
|
|
24
|
+
if (cellDataChangedInfo.newValue != cellDataChangedInfo.oldValue) {
|
|
25
|
+
this.emitter.emitSync('CellDataChanged', cellDataChangedInfo);
|
|
26
|
+
this.adaptable.api.gridApi.fireCellChangedEvent(cellDataChangedInfo);
|
|
27
|
+
this.logDataChange(cellDataChangedInfo);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
// we need this temporary "shared memory" because the value change and the AG Grid cellChanged event are asynchronous
|
|
@@ -69,16 +69,18 @@ class DataService {
|
|
|
69
69
|
newValue,
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
logDataChange(
|
|
73
|
-
const dataChangeLogEntry = this.extractDataChangeLogEntry(
|
|
72
|
+
logDataChange(cellDataChangedInfo) {
|
|
73
|
+
const dataChangeLogEntry = this.extractDataChangeLogEntry(cellDataChangedInfo);
|
|
74
74
|
this.dataChangeLogSubject$.next(dataChangeLogEntry);
|
|
75
75
|
}
|
|
76
|
-
extractDataChangeLogEntry(
|
|
76
|
+
extractDataChangeLogEntry(cellDataChangedInfo) {
|
|
77
77
|
// create rowData snapshot
|
|
78
|
-
const rowData =
|
|
78
|
+
const rowData = cellDataChangedInfo.rowData
|
|
79
|
+
? Helper_1.default.cloneObject(cellDataChangedInfo.rowData)
|
|
80
|
+
: null;
|
|
79
81
|
// strip down rowNode properties as it is pretty "heavy" on the memory
|
|
80
82
|
const rowNode = rowData ? { data: rowData } : null;
|
|
81
|
-
return Object.assign(Object.assign({},
|
|
83
|
+
return Object.assign(Object.assign({}, cellDataChangedInfo), { rowNode,
|
|
82
84
|
rowData });
|
|
83
85
|
}
|
|
84
86
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AlertDefinition } from '../../../PredefinedConfig/AlertState';
|
|
2
|
-
import {
|
|
2
|
+
import { CellDataChangedInfo } from '../../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
3
3
|
import { IAdaptableService } from './IAdaptableService';
|
|
4
4
|
export declare type ReactiveAlertInfo = {
|
|
5
5
|
alertDefinition: AlertDefinition;
|
|
6
6
|
type: 'alert';
|
|
7
|
-
dataChangeLogEntry:
|
|
7
|
+
dataChangeLogEntry: CellDataChangedInfo;
|
|
8
8
|
};
|
|
9
9
|
export interface IAlertService extends IAdaptableService {
|
|
10
10
|
createReactiveAlert(alertDefinition: AlertDefinition): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CellDataChangedInfo } from '../../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { IAdaptableService } from './IAdaptableService';
|
|
4
4
|
export interface IDataService extends IAdaptableService {
|
|
5
|
-
CreateDataChangedEvent(
|
|
6
|
-
on(eventName: '
|
|
7
|
-
readonly dataChangeLog$: Observable<
|
|
8
|
-
logUndoChange(undoChange:
|
|
9
|
-
extractUndoChange(undoChange:
|
|
5
|
+
CreateDataChangedEvent(cellDataChangedInfo: CellDataChangedInfo): void;
|
|
6
|
+
on(eventName: 'CellDataChanged', callback: (cellDataChangedInfo: CellDataChangedInfo) => void): () => void;
|
|
7
|
+
readonly dataChangeLog$: Observable<CellDataChangedInfo>;
|
|
8
|
+
logUndoChange(undoChange: CellDataChangedInfo): void;
|
|
9
|
+
extractUndoChange(undoChange: CellDataChangedInfo): CellDataChangedInfo | undefined;
|
|
10
10
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { IAdaptableService } from './IAdaptableService';
|
|
3
3
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
4
|
-
import {
|
|
4
|
+
import { CellDataChangedInfo } from '../../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
5
5
|
import { AdaptableModule } from '../../../PredefinedConfig/Common/Types';
|
|
6
6
|
import { AggregationParameter } from '../../ExpressionFunctions/aggregatedScalarExpressionFunctions';
|
|
7
7
|
import { ModuleExpressionFunctions } from '../../../AdaptableOptions/AdaptableQLOptions';
|
|
8
8
|
export interface IQueryLanguageService extends IAdaptableService {
|
|
9
9
|
evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: RowNode): boolean;
|
|
10
10
|
evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: RowNode): any;
|
|
11
|
-
evaluateObservableExpression(expression: string, module: AdaptableModule): Observable<
|
|
12
|
-
evaluateAggregatedBooleanExpression(expression: string, module: AdaptableModule): Observable<
|
|
11
|
+
evaluateObservableExpression(expression: string, module: AdaptableModule): Observable<CellDataChangedInfo>;
|
|
12
|
+
evaluateAggregatedBooleanExpression(expression: string, module: AdaptableModule): Observable<CellDataChangedInfo>;
|
|
13
13
|
evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): AggregationParameter;
|
|
14
14
|
validateBoolean(expression: string, module: AdaptableModule, config?: {
|
|
15
15
|
force?: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CellDataChangedInfo } from '../../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
2
2
|
import { AlertDefinition } from '../../../PredefinedConfig/AlertState';
|
|
3
3
|
import { IAdaptableService } from './IAdaptableService';
|
|
4
4
|
export interface IValidationService extends IAdaptableService {
|
|
5
|
-
getValidationRulesForDataChange(
|
|
6
|
-
performValidation(
|
|
7
|
-
performServerValidation(
|
|
5
|
+
getValidationRulesForDataChange(cellDataChangedInfo: CellDataChangedInfo): AlertDefinition[];
|
|
6
|
+
performValidation(cellDataChangedInfo: CellDataChangedInfo): boolean;
|
|
7
|
+
performServerValidation(cellDataChangedInfo: CellDataChangedInfo, config: {
|
|
8
8
|
onServerValidationCompleted: () => void;
|
|
9
9
|
}): () => boolean;
|
|
10
10
|
createValidationDescription(alertDefinition: AlertDefinition): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IQueryLanguageService } from './Interface/IQueryLanguageService';
|
|
2
2
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
import {
|
|
4
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
5
5
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
6
6
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
7
7
|
import { ModuleExpressionFunctions } from '../../AdaptableOptions/AdaptableQLOptions';
|
|
@@ -17,8 +17,8 @@ export declare class QueryLanguageService implements IQueryLanguageService {
|
|
|
17
17
|
evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: any): any;
|
|
18
18
|
evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: RowNode): any;
|
|
19
19
|
evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): AggregationParameter;
|
|
20
|
-
evaluateObservableExpression(reactiveExpression: string, module: AdaptableModule): Observable<
|
|
21
|
-
evaluateAggregatedBooleanExpression(aggregationExpression: string, module: AdaptableModule): Observable<
|
|
20
|
+
evaluateObservableExpression(reactiveExpression: string, module: AdaptableModule): Observable<CellDataChangedInfo>;
|
|
21
|
+
evaluateAggregatedBooleanExpression(aggregationExpression: string, module: AdaptableModule): Observable<CellDataChangedInfo>;
|
|
22
22
|
validateBoolean(expressionInput: string, module: AdaptableModule, config?: {
|
|
23
23
|
force?: boolean;
|
|
24
24
|
}): {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
2
|
-
import {
|
|
2
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
3
3
|
import { IValidationService } from './Interface/IValidationService';
|
|
4
4
|
import { AlertDefinition } from '../../PredefinedConfig/AlertState';
|
|
5
5
|
export declare class ValidationService implements IValidationService {
|
|
6
6
|
private adaptable;
|
|
7
7
|
constructor(adaptable: IAdaptable);
|
|
8
|
-
getValidationRulesForDataChange(
|
|
9
|
-
performValidation(
|
|
8
|
+
getValidationRulesForDataChange(cellDataChangedInfo: CellDataChangedInfo): AlertDefinition[];
|
|
9
|
+
performValidation(cellDataChangedInfo: CellDataChangedInfo): boolean;
|
|
10
10
|
private IsAlertDefinitionTriggered;
|
|
11
|
-
performServerValidation(
|
|
11
|
+
performServerValidation(cellDataChangedInfo: CellDataChangedInfo, config: {
|
|
12
12
|
onServerValidationCompleted: () => void;
|
|
13
13
|
}): () => boolean;
|
|
14
14
|
createValidationDescription(alertDefinition: AlertDefinition): string;
|
|
@@ -11,28 +11,28 @@ class ValidationService {
|
|
|
11
11
|
this.adaptable = adaptable;
|
|
12
12
|
}
|
|
13
13
|
// Not sure where to put this: was in the Module but might be better here until I can work out a way of having an event with a callback...
|
|
14
|
-
getValidationRulesForDataChange(
|
|
14
|
+
getValidationRulesForDataChange(cellDataChangedInfo) {
|
|
15
15
|
// if the new value is the same as the old value then we can get out as we dont see it as an edit?
|
|
16
|
-
if (
|
|
16
|
+
if (cellDataChangedInfo.oldValue == cellDataChangedInfo.newValue) {
|
|
17
17
|
return [];
|
|
18
18
|
}
|
|
19
19
|
let editingRules = this.adaptable.api.alertApi
|
|
20
20
|
.getAlertDefinitionsWithPreventEdit()
|
|
21
|
-
.filter((v) => this.adaptable.api.scopeApi.isColumnInScope(
|
|
21
|
+
.filter((v) => this.adaptable.api.scopeApi.isColumnInScope(cellDataChangedInfo.column, v.Scope));
|
|
22
22
|
let failedValidations = [];
|
|
23
23
|
if (ArrayExtensions_1.ArrayExtensions.IsNotEmpty(editingRules)) {
|
|
24
24
|
editingRules.forEach((alertDefinition) => {
|
|
25
25
|
if (alertDefinition.Rule.BooleanExpression) {
|
|
26
|
-
let isSatisfiedExpression =
|
|
26
|
+
let isSatisfiedExpression = cellDataChangedInfo.rowNode != null &&
|
|
27
27
|
this.adaptable.api.internalApi
|
|
28
28
|
.getQueryLanguageService()
|
|
29
|
-
.evaluateBooleanExpression(alertDefinition.Rule.BooleanExpression, ModuleConstants_1.AlertModuleId,
|
|
29
|
+
.evaluateBooleanExpression(alertDefinition.Rule.BooleanExpression, ModuleConstants_1.AlertModuleId, cellDataChangedInfo.rowNode);
|
|
30
30
|
if (isSatisfiedExpression) {
|
|
31
31
|
failedValidations.push(alertDefinition);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
if (this.IsAlertDefinitionTriggered(alertDefinition,
|
|
35
|
+
if (this.IsAlertDefinitionTriggered(alertDefinition, cellDataChangedInfo)) {
|
|
36
36
|
failedValidations.push(alertDefinition);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -40,15 +40,15 @@ class ValidationService {
|
|
|
40
40
|
}
|
|
41
41
|
return failedValidations;
|
|
42
42
|
}
|
|
43
|
-
performValidation(
|
|
44
|
-
const failedRules = this.getValidationRulesForDataChange(
|
|
43
|
+
performValidation(cellDataChangedInfo) {
|
|
44
|
+
const failedRules = this.getValidationRulesForDataChange(cellDataChangedInfo);
|
|
45
45
|
if (failedRules.length > 0) {
|
|
46
46
|
let alert = {
|
|
47
47
|
alertType: 'cellChanged',
|
|
48
48
|
header: 'Alert',
|
|
49
49
|
message: 'Perform Edit Alert Fired',
|
|
50
50
|
alertDefinition: failedRules[0],
|
|
51
|
-
|
|
51
|
+
cellDataChangedInfo: cellDataChangedInfo,
|
|
52
52
|
};
|
|
53
53
|
this.adaptable.api.alertApi.publishAlertFiredEvent(alert);
|
|
54
54
|
return false;
|
|
@@ -64,25 +64,25 @@ class ValidationService {
|
|
|
64
64
|
column: dataChangedEvent.column,
|
|
65
65
|
}, false);
|
|
66
66
|
}
|
|
67
|
-
performServerValidation(
|
|
67
|
+
performServerValidation(cellDataChangedInfo, config) {
|
|
68
68
|
return () => {
|
|
69
69
|
this.adaptable.adaptableOptions.editOptions
|
|
70
|
-
.validateOnServer(
|
|
70
|
+
.validateOnServer(cellDataChangedInfo)
|
|
71
71
|
.then((validationResult) => {
|
|
72
72
|
var _a, _b;
|
|
73
73
|
if (validationResult.NewValue === undefined) {
|
|
74
|
-
validationResult.NewValue =
|
|
74
|
+
validationResult.NewValue = cellDataChangedInfo.newValue;
|
|
75
75
|
}
|
|
76
76
|
// If they have changed the return value then we should update the grid, log the function change
|
|
77
77
|
// otherwise the value will persist
|
|
78
|
-
if (validationResult.NewValue !==
|
|
79
|
-
|
|
80
|
-
// this.adaptable.setValue(
|
|
81
|
-
const row = (_a =
|
|
78
|
+
if (validationResult.NewValue !== cellDataChangedInfo.newValue) {
|
|
79
|
+
cellDataChangedInfo.newValue = validationResult.NewValue;
|
|
80
|
+
// this.adaptable.setValue(cellDataChangedInfo, false);
|
|
81
|
+
const row = (_a = cellDataChangedInfo.rowNode) === null || _a === void 0 ? void 0 : _a.data;
|
|
82
82
|
if (!row) {
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
row[(_b = this.adaptable.api.columnApi.getAgGridColumnFieldForAdaptableColumn(
|
|
85
|
+
row[(_b = this.adaptable.api.columnApi.getAgGridColumnFieldForAdaptableColumn(cellDataChangedInfo.column.columnId)) !== null && _b !== void 0 ? _b : cellDataChangedInfo.column.columnId] = validationResult.NewValue;
|
|
86
86
|
this.adaptable.api.gridApi.updateGridData([row]);
|
|
87
87
|
if (StringExtensions_1.default.IsNotNullOrEmpty(validationResult.ValidationMessage) &&
|
|
88
88
|
this.adaptable.adaptableOptions.editOptions.displayServerValidationMessages) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
3
3
|
export interface DataChangeHistoryGridProps {
|
|
4
4
|
adaptableContainerId: string;
|
|
5
5
|
agGridContainerId: string;
|
|
6
|
-
changeHistoryLog: Record<string,
|
|
6
|
+
changeHistoryLog: Record<string, CellDataChangedInfo>;
|
|
7
7
|
onUndoChange: (changeKey: string) => void;
|
|
8
8
|
}
|
|
9
9
|
export declare const DataChangeHistoryGrid: (props: DataChangeHistoryGridProps) => JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
4
4
|
import { SystemDataChangeHistoryDisableAction, SystemDataChangeHistoryEnableAction, SystemDataChangeHistoryResumeAction, SystemDataChangeHistorySuspendAction } from '../../Redux/ActionsReducers/SystemRedux';
|
|
5
5
|
import { DataChangeHistoryMode } from '../../PredefinedConfig/SystemState';
|
|
6
6
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
7
7
|
interface DataChangeHistoryPopupProps extends ModuleViewPopupProps<DataChangeHistoryPopupComponent> {
|
|
8
|
-
changeHistoryLog: Record<string,
|
|
8
|
+
changeHistoryLog: Record<string, CellDataChangedInfo>;
|
|
9
9
|
changeHistoryMode: DataChangeHistoryMode;
|
|
10
10
|
activationTime: Date;
|
|
11
11
|
suspensionTime: Date;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { ICellRendererComp, ICellRendererParams
|
|
2
|
-
export declare class CustomTooltip implements ITooltipComp {
|
|
3
|
-
private eGui;
|
|
4
|
-
init(params: ITooltipParams): void;
|
|
5
|
-
getGui(): any;
|
|
6
|
-
}
|
|
1
|
+
import { ICellRendererComp, ICellRendererParams } from '@ag-grid-community/all-modules';
|
|
7
2
|
export declare class ActionColumnRenderer implements ICellRendererComp {
|
|
8
3
|
private eGui;
|
|
9
4
|
private eventListener;
|