@adaptabletools/adaptable 11.0.0-canary.6 → 11.0.0-canary.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agGrid.d.ts +5 -4
- package/agGrid.js +7 -5
- package/base.css +2 -2
- package/bundle.cjs.js +120 -115
- package/index.css +2 -2
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -0
- package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -5
- package/src/AdaptableOptions/{QueryLanguageOptions.d.ts → AdaptableQLOptions.d.ts} +31 -2
- package/src/AdaptableOptions/{QueryLanguageOptions.js → AdaptableQLOptions.js} +0 -0
- package/src/AdaptableOptions/GeneralOptions.d.ts +0 -7
- package/src/AdaptableOptions/SearchOptions.d.ts +0 -9
- package/src/AdaptableOptions/StateOptions.d.ts +7 -7
- package/src/Api/CalculatedColumnApi.d.ts +2 -9
- package/src/Api/GridApi.d.ts +11 -1
- package/src/Api/Implementation/ApiBase.d.ts +3 -2
- package/src/Api/Implementation/ApiBase.js +5 -2
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +3 -4
- package/src/Api/Implementation/GridApiImpl.d.ts +2 -0
- package/src/Api/Implementation/GridApiImpl.js +27 -4
- package/src/Api/Implementation/InternalApiImpl.d.ts +2 -3
- package/src/Api/Implementation/InternalApiImpl.js +5 -4
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +3 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.js +15 -2
- package/src/Api/InternalApi.d.ts +2 -3
- package/src/Api/QueryApi.d.ts +2 -2
- package/src/Api/QueryLanguageApi.d.ts +13 -0
- package/src/Api/SettingsPanelApi.d.ts +4 -5
- package/src/PredefinedConfig/AlertState.d.ts +5 -1
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +8 -3
- package/src/PredefinedConfig/Common/AdaptableQuery.d.ts +0 -1
- package/src/PredefinedConfig/Common/AdaptableQuery.js +1 -5
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +1 -1
- package/src/PredefinedConfig/Common/Types.d.ts +2 -0
- package/src/PredefinedConfig/Common/Types.js +1 -0
- package/src/PredefinedConfig/Selection/GridCellRange.d.ts +3 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +1 -1
- package/src/Redux/Store/AdaptableStore.js +27 -2
- package/src/Strategy/AlertModule.js +3 -3
- package/src/Strategy/CalculatedColumnModule.js +4 -4
- package/src/Strategy/ChartingModule.d.ts +3 -3
- package/src/Strategy/ChartingModule.js +2 -2
- package/src/Strategy/FlashingCellModule.js +2 -2
- package/src/Strategy/FreeTextColumnModule.js +1 -0
- package/src/Strategy/{SetingsPanelModule.d.ts → SettingsPanelModule.d.ts} +0 -0
- package/src/Strategy/{SetingsPanelModule.js → SettingsPanelModule.js} +0 -0
- package/src/Strategy/Utilities/getAlertPreviewViewItems.js +1 -1
- package/src/Strategy/Utilities/getExpressionViewItems.d.ts +2 -2
- package/src/Strategy/Utilities/getExpressionViewItems.js +2 -1
- package/src/Strategy/Utilities/getRuleViewItems.js +1 -2
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +2 -1
- package/src/Utilities/Constants/DocumentationLinkConstants.js +3 -2
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +16 -12
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +18 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +311 -14
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +2 -2
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +8 -8
- package/src/Utilities/ExpressionFunctions/groupingMap.d.ts +2 -3
- package/src/Utilities/ExpressionFunctions/groupingMap.js +3 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +33 -0
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +154 -0
- package/src/Utilities/Helpers/AdaptableHelper.js +2 -1
- package/src/Utilities/Services/AlertService.js +5 -1
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +7 -3
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +143 -18
- package/src/Utilities/Services/Interface/IAdaptableService.d.ts +1 -1
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +6 -3
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +7 -1
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/QueryLanguageService.d.ts +9 -2
- package/src/Utilities/Services/QueryLanguageService.js +81 -22
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +5 -3
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.d.ts +1 -0
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -2
- package/src/View/CalculatedColumn/CalculatedColumnSharedEntity.js +3 -3
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +2 -4
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +43 -12
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -2
- package/src/View/ColorPicker.d.ts +1 -1
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/AdaptableInput/index.d.ts +1 -1
- package/src/View/Components/Buttons/ButtonDelete.d.ts +1 -1
- package/src/View/Components/EntityRulesEditor/index.js +2 -3
- package/src/View/Components/Forms/AdaptableFormControlTextClear.d.ts +1 -1
- package/src/View/Components/Panels/PanelWithImage.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.d.ts +1 -0
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
- package/src/View/License/LicenseWatermark.js +1 -1
- package/src/agGrid/Adaptable.d.ts +1 -0
- package/src/agGrid/Adaptable.js +16 -14
- package/src/agGrid/agGridHelper.js +2 -2
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.d.ts +4 -2
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +4 -4
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.js +5 -2
- package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.d.ts +2 -0
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +45 -0
- package/src/components/ExpressionEditor/editorButtonsReactive.js +8 -13
- package/src/components/ExpressionEditor/index.d.ts +2 -1
- package/src/components/ExpressionEditor/index.js +9 -2
- package/src/components/Input/index.d.ts +1 -1
- package/src/components/List/ListGroupItem/index.d.ts +1 -1
- package/src/components/Logo/index.js +8 -7
- package/src/components/PopupWithFooter.d.ts +1 -1
- package/src/components/Textarea/index.d.ts +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +41 -37
- package/src/metamodel/adaptable.metamodel.js +156 -133
- package/src/types.d.ts +5 -5
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -16,8 +16,12 @@ class AlertService {
|
|
|
16
16
|
this.emitter = new Emitter_1.default();
|
|
17
17
|
}
|
|
18
18
|
createReactiveAlert(alertDefinition) {
|
|
19
|
-
// if there is already
|
|
19
|
+
// if there is already a reactive alert for this definition, delete it (possible in case of editing definitions),
|
|
20
20
|
this.deleteReactiveAlert(alertDefinition);
|
|
21
|
+
if (!alertDefinition.Rule.ObservableExpression &&
|
|
22
|
+
!alertDefinition.Rule.AggregatedBooleanExpression) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
21
25
|
const isValidExpression = this.isValidExpression(alertDefinition.Rule);
|
|
22
26
|
if (!isValidExpression) {
|
|
23
27
|
LoggingHelper_1.LogAdaptableWarning(`Could NOT create reactive alert due to invalid Rule definition!`, alertDefinition.Rule);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
2
2
|
import { ICalculatedColumnExpressionService } from './Interface/ICalculatedColumnExpressionService';
|
|
3
3
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
4
|
+
import { AdaptableCalculatedColumnQuery, CalculatedColumn } from '../../PredefinedConfig/CalculatedColumnState';
|
|
4
5
|
export declare class CalculatedColumnExpressionService implements ICalculatedColumnExpressionService {
|
|
5
6
|
private adaptable;
|
|
7
|
+
private aggregatedScalarCalculatedColumnsMap;
|
|
6
8
|
constructor(adaptable: IAdaptable);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
getCalculatedColumnDataType(calculatedColumnQuery: AdaptableCalculatedColumnQuery): 'String' | 'Number' | 'Boolean' | 'Date';
|
|
10
|
+
isCalculatedColumnQueryValid(calculatedColumnQuery: AdaptableCalculatedColumnQuery): boolean;
|
|
11
|
+
evaluateCalculatedColumnQuery(calculatedColumn: CalculatedColumn, node: RowNode): any;
|
|
12
|
+
createAggregatedScalarCalculatedColumn(calculatedColumn: CalculatedColumn): void;
|
|
13
|
+
destroyAggregatedScalarCalculatedColumn(calculatedColumn: CalculatedColumn): void;
|
|
10
14
|
destroy(): void;
|
|
11
15
|
}
|
|
@@ -4,17 +4,45 @@ exports.CalculatedColumnExpressionService = void 0;
|
|
|
4
4
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
5
5
|
const LoggingHelper_1 = require("../Helpers/LoggingHelper");
|
|
6
6
|
const ModuleConstants_1 = require("../Constants/ModuleConstants");
|
|
7
|
+
const scalarAggregationHelper_1 = require("../ExpressionFunctions/scalarAggregationHelper");
|
|
7
8
|
class CalculatedColumnExpressionService {
|
|
8
9
|
constructor(adaptable) {
|
|
9
10
|
this.adaptable = adaptable;
|
|
11
|
+
this.aggregatedScalarCalculatedColumnsMap = new Map();
|
|
10
12
|
this.adaptable = adaptable;
|
|
13
|
+
this.adaptable.api.internalApi
|
|
14
|
+
.getDataService()
|
|
15
|
+
.on('DataChanged', (dataChangedInfo) => {
|
|
16
|
+
if (dataChangedInfo.trigger === 'aggChange') {
|
|
17
|
+
// do NOT handle changes on group rows
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const refreshedCalculatedColumns = [];
|
|
21
|
+
this.aggregatedScalarCalculatedColumnsMap.forEach((aggregatedScalarCalculatedColumn) => {
|
|
22
|
+
if (aggregatedScalarCalculatedColumn
|
|
23
|
+
.getColumnDependencies()
|
|
24
|
+
.includes(dataChangedInfo.column.columnId)) {
|
|
25
|
+
aggregatedScalarCalculatedColumn.refreshAggregatedColumnValue();
|
|
26
|
+
refreshedCalculatedColumns.push(aggregatedScalarCalculatedColumn.getCalculatedColumnId());
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
if (refreshedCalculatedColumns.length) {
|
|
30
|
+
this.adaptable.api.gridApi.refreshCells(null, refreshedCalculatedColumns);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
11
33
|
}
|
|
12
|
-
|
|
34
|
+
getCalculatedColumnDataType(calculatedColumnQuery) {
|
|
13
35
|
try {
|
|
36
|
+
if (calculatedColumnQuery.AggregatedScalarExpression) {
|
|
37
|
+
// currently AggregatedScalarExpression support only numerical values
|
|
38
|
+
// TODO AFL try to derive the type from the aggregatedColumn?
|
|
39
|
+
// we definitely don't want to aggregate everything only to get the data type
|
|
40
|
+
return Enums_1.DataType.Number;
|
|
41
|
+
}
|
|
14
42
|
let firstRowNode = this.adaptable.api.gridApi.getFirstRowNode();
|
|
15
43
|
let firstRowValue = this.adaptable.api.internalApi
|
|
16
44
|
.getQueryLanguageService()
|
|
17
|
-
.evaluateScalarExpression(
|
|
45
|
+
.evaluateScalarExpression(calculatedColumnQuery.ScalarExpression, ModuleConstants_1.CalculatedColumnModuleId, firstRowNode);
|
|
18
46
|
if (firstRowValue instanceof Date) {
|
|
19
47
|
return Enums_1.DataType.Date;
|
|
20
48
|
}
|
|
@@ -29,40 +57,137 @@ class CalculatedColumnExpressionService {
|
|
|
29
57
|
}
|
|
30
58
|
}
|
|
31
59
|
catch (e) {
|
|
32
|
-
LoggingHelper_1.LogAdaptableWarning(`Invalid CalculatedColumn expression ${
|
|
60
|
+
LoggingHelper_1.LogAdaptableWarning(`Invalid CalculatedColumn expression ${this.adaptable.api.queryLanguageApi.getAdaptableQueryExpression(calculatedColumnQuery)} :: ${e}`);
|
|
33
61
|
return Enums_1.DataType.Number;
|
|
34
62
|
}
|
|
35
63
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
.
|
|
41
|
-
.
|
|
42
|
-
|
|
64
|
+
isCalculatedColumnQueryValid(calculatedColumnQuery) {
|
|
65
|
+
if (calculatedColumnQuery.ScalarExpression) {
|
|
66
|
+
try {
|
|
67
|
+
// TODO AFL add a cached validation for ScalarExpression, just like for all the other types
|
|
68
|
+
let firstRowNode = this.adaptable.getFirstRowNode();
|
|
69
|
+
this.adaptable.api.internalApi
|
|
70
|
+
.getQueryLanguageService()
|
|
71
|
+
.evaluateScalarExpression(calculatedColumnQuery.ScalarExpression, ModuleConstants_1.CalculatedColumnModuleId, firstRowNode);
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
// no logging as this method is used only in the UI
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
43
78
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
79
|
+
if (calculatedColumnQuery.AggregatedScalarExpression) {
|
|
80
|
+
const validationResult = this.adaptable.api.internalApi
|
|
81
|
+
.getQueryLanguageService()
|
|
82
|
+
.validateAggregatedScalar(calculatedColumnQuery.AggregatedScalarExpression, ModuleConstants_1.CalculatedColumnModuleId);
|
|
83
|
+
return validationResult.isValid;
|
|
47
84
|
}
|
|
85
|
+
// if query has neither a ScalarExpression nor an AggregatedScalarExpression => it can only be false
|
|
86
|
+
return false;
|
|
48
87
|
}
|
|
49
|
-
|
|
88
|
+
evaluateCalculatedColumnQuery(calculatedColumn, node) {
|
|
89
|
+
var _a, _b, _c, _d, _e;
|
|
50
90
|
try {
|
|
51
91
|
if (this.adaptable.api.gridApi.isGroupRowNode(node)) {
|
|
52
92
|
return undefined;
|
|
53
93
|
}
|
|
54
94
|
// no validation here, this function has to be as performant as possible
|
|
55
|
-
|
|
56
|
-
.
|
|
57
|
-
|
|
95
|
+
if ((_a = calculatedColumn === null || calculatedColumn === void 0 ? void 0 : calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression) {
|
|
96
|
+
return this.adaptable.api.internalApi
|
|
97
|
+
.getQueryLanguageService()
|
|
98
|
+
.evaluateScalarExpression(calculatedColumn.Query.ScalarExpression, ModuleConstants_1.CalculatedColumnModuleId, node);
|
|
99
|
+
}
|
|
100
|
+
if ((_b = calculatedColumn === null || calculatedColumn === void 0 ? void 0 : calculatedColumn.Query) === null || _b === void 0 ? void 0 : _b.AggregatedScalarExpression) {
|
|
101
|
+
const aggregatedScalarCalculatedColumn = this.aggregatedScalarCalculatedColumnsMap.get(calculatedColumn.Uuid);
|
|
102
|
+
return aggregatedScalarCalculatedColumn === null || aggregatedScalarCalculatedColumn === void 0 ? void 0 : aggregatedScalarCalculatedColumn.getAggregatedColumnValue(node);
|
|
103
|
+
}
|
|
58
104
|
}
|
|
59
105
|
catch (error) {
|
|
60
|
-
LoggingHelper_1.LogAdaptableError(`Invalid CalculatedColumn
|
|
106
|
+
LoggingHelper_1.LogAdaptableError(`Invalid CalculatedColumn expression ${(_d = (_c = calculatedColumn === null || calculatedColumn === void 0 ? void 0 : calculatedColumn.Query) === null || _c === void 0 ? void 0 : _c.ScalarExpression) !== null && _d !== void 0 ? _d : (_e = calculatedColumn === null || calculatedColumn === void 0 ? void 0 : calculatedColumn.Query) === null || _e === void 0 ? void 0 : _e.AggregatedScalarExpression} :: ${error}`);
|
|
61
107
|
return null;
|
|
62
108
|
}
|
|
63
109
|
}
|
|
110
|
+
createAggregatedScalarCalculatedColumn(calculatedColumn) {
|
|
111
|
+
var _a;
|
|
112
|
+
// if there is already an aggregated scalar, delete it (possible when editing)
|
|
113
|
+
this.destroyAggregatedScalarCalculatedColumn(calculatedColumn);
|
|
114
|
+
if ((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.AggregatedScalarExpression) {
|
|
115
|
+
const aggregationConfig = this.adaptable.api.internalApi
|
|
116
|
+
.getQueryLanguageService()
|
|
117
|
+
.evaluateAggregatedScalarExpression(calculatedColumn.Query.AggregatedScalarExpression, ModuleConstants_1.CalculatedColumnModuleId);
|
|
118
|
+
const aggregatedScalarCalculatedColumn = new AggregatedScalarCalculatedColumn(aggregationConfig.value, calculatedColumn, this.adaptable);
|
|
119
|
+
this.aggregatedScalarCalculatedColumnsMap.set(calculatedColumn.Uuid, aggregatedScalarCalculatedColumn);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
destroyAggregatedScalarCalculatedColumn(calculatedColumn) {
|
|
123
|
+
this.aggregatedScalarCalculatedColumnsMap.delete(calculatedColumn.Uuid);
|
|
124
|
+
}
|
|
64
125
|
destroy() {
|
|
65
126
|
// TO DO
|
|
66
127
|
}
|
|
67
128
|
}
|
|
68
129
|
exports.CalculatedColumnExpressionService = CalculatedColumnExpressionService;
|
|
130
|
+
class AggregatedScalarCalculatedColumn {
|
|
131
|
+
constructor(expressionEvaluation, calculatedColumn, adaptable) {
|
|
132
|
+
this.expressionEvaluation = expressionEvaluation;
|
|
133
|
+
this.calculatedColumn = calculatedColumn;
|
|
134
|
+
this.adaptable = adaptable;
|
|
135
|
+
this.aggregationResult = this.computeAggregatedValue(expressionEvaluation);
|
|
136
|
+
// currently we support only one reducer
|
|
137
|
+
this.aggregationReducerName = Object.keys(expressionEvaluation.aggregationParams.reducers)[0];
|
|
138
|
+
}
|
|
139
|
+
getAggregatedColumnValue(rowNode) {
|
|
140
|
+
const aggregationValue = this.getAggregationValue(rowNode);
|
|
141
|
+
if (this.expressionEvaluation.rowValueGetter) {
|
|
142
|
+
return this.expressionEvaluation.rowValueGetter(rowNode, aggregationValue);
|
|
143
|
+
}
|
|
144
|
+
return aggregationValue;
|
|
145
|
+
}
|
|
146
|
+
refreshAggregatedColumnValue() {
|
|
147
|
+
this.aggregationResult = this.computeAggregatedValue(this.expressionEvaluation);
|
|
148
|
+
}
|
|
149
|
+
getCalculatedColumnId() {
|
|
150
|
+
return this.calculatedColumn.ColumnId;
|
|
151
|
+
}
|
|
152
|
+
getColumnDependencies() {
|
|
153
|
+
return this.expressionEvaluation.columnDependencies;
|
|
154
|
+
}
|
|
155
|
+
computeAggregatedValue(expressionEvaluation) {
|
|
156
|
+
const gridData = this.adaptable.api.gridApi.getGridData();
|
|
157
|
+
if (!expressionEvaluation.cumulateOver) {
|
|
158
|
+
return scalarAggregationHelper_1.aggregate(expressionEvaluation.aggregationParams, gridData);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
// 1. sort grid data by given OVER column
|
|
162
|
+
const sortByColumn = expressionEvaluation.cumulateOver;
|
|
163
|
+
// currently we support only ascending sorting
|
|
164
|
+
gridData.sort((first, second) => {
|
|
165
|
+
if (first[sortByColumn] < second[sortByColumn]) {
|
|
166
|
+
return -1;
|
|
167
|
+
}
|
|
168
|
+
if (first[sortByColumn] > second[sortByColumn]) {
|
|
169
|
+
return 1;
|
|
170
|
+
}
|
|
171
|
+
return 0;
|
|
172
|
+
});
|
|
173
|
+
// 2. add primary key column as the most specific groupBy
|
|
174
|
+
if (!expressionEvaluation.aggregationParams.groupBy) {
|
|
175
|
+
expressionEvaluation.aggregationParams.groupBy = [];
|
|
176
|
+
}
|
|
177
|
+
const gridPrimaryKey = this.adaptable.adaptableOptions.primaryKey;
|
|
178
|
+
// !! aggregationParams mutated
|
|
179
|
+
expressionEvaluation.aggregationParams.groupBy.push({ field: gridPrimaryKey });
|
|
180
|
+
// 3. cumulate
|
|
181
|
+
return scalarAggregationHelper_1.cumulate(expressionEvaluation.aggregationParams, gridData);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
getAggregationValue(rowNode) {
|
|
185
|
+
var _a, _b;
|
|
186
|
+
if ((_a = this.expressionEvaluation.aggregationParams.groupBy) === null || _a === void 0 ? void 0 : _a.length) {
|
|
187
|
+
const groupColumns = this.expressionEvaluation.aggregationParams.groupBy.map((groupByParam) => groupByParam.field);
|
|
188
|
+
const groupKeys = groupColumns.map((groupColumnName) => this.adaptable.api.gridApi.getRawValueFromRowNode(rowNode, groupColumnName));
|
|
189
|
+
return (_b = this.aggregationResult.deepMap.get(groupKeys)) === null || _b === void 0 ? void 0 : _b.reducerResults[this.aggregationReducerName];
|
|
190
|
+
}
|
|
191
|
+
return this.aggregationResult.reducerResults[this.aggregationReducerName];
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { IAdaptableService } from './IAdaptableService';
|
|
2
2
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
3
|
+
import { AdaptableCalculatedColumnQuery, CalculatedColumn } from '../../../PredefinedConfig/CalculatedColumnState';
|
|
3
4
|
export interface ICalculatedColumnExpressionService extends IAdaptableService {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
isCalculatedColumnQueryValid(calculatedColumnQuery: AdaptableCalculatedColumnQuery): boolean;
|
|
6
|
+
evaluateCalculatedColumnQuery(calculatedColumn: CalculatedColumn, rowNode: RowNode): any;
|
|
7
|
+
getCalculatedColumnDataType(calculatedColumnQuery: AdaptableCalculatedColumnQuery): 'String' | 'Number' | 'Boolean' | 'Date';
|
|
8
|
+
createAggregatedScalarCalculatedColumn(calculatedColumn: CalculatedColumn): void;
|
|
9
|
+
destroyAggregatedScalarCalculatedColumn(calculatedColumn: CalculatedColumn): void;
|
|
7
10
|
}
|
|
@@ -3,12 +3,14 @@ import { IAdaptableService } from './IAdaptableService';
|
|
|
3
3
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
4
4
|
import { DataChangedInfo } from '../../../PredefinedConfig/Common/DataChangedInfo';
|
|
5
5
|
import { AdaptableModule } from '../../../PredefinedConfig/Common/Types';
|
|
6
|
-
import {
|
|
6
|
+
import { AggregationParameter } from '../../ExpressionFunctions/aggregatedScalarExpressionFunctions';
|
|
7
|
+
import { ModuleExpressionFunctions } from '../../../AdaptableOptions/AdaptableQLOptions';
|
|
7
8
|
export interface IQueryLanguageService extends IAdaptableService {
|
|
8
9
|
evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: RowNode): boolean;
|
|
9
10
|
evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: RowNode): any;
|
|
10
11
|
evaluateObservableExpression(expression: string, module: AdaptableModule): Observable<DataChangedInfo>;
|
|
11
12
|
evaluateAggregatedBooleanExpression(expression: string, module: AdaptableModule): Observable<DataChangedInfo>;
|
|
13
|
+
evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): AggregationParameter;
|
|
12
14
|
validateBoolean(expression: string, module: AdaptableModule, config?: {
|
|
13
15
|
force?: boolean;
|
|
14
16
|
}): {
|
|
@@ -23,6 +25,10 @@ export interface IQueryLanguageService extends IAdaptableService {
|
|
|
23
25
|
isValid: boolean;
|
|
24
26
|
errorMessage: string;
|
|
25
27
|
};
|
|
28
|
+
validateAggregatedScalar(expression: string, module: AdaptableModule): {
|
|
29
|
+
isValid: boolean;
|
|
30
|
+
errorMessage: string;
|
|
31
|
+
};
|
|
26
32
|
getModuleExpressionFunctions(module: AdaptableModule): ModuleExpressionFunctions;
|
|
27
33
|
getColumnsFromExpression(input: string): string[];
|
|
28
34
|
getNamedQueryNamesFromExpression(input: string): string[];
|
|
@@ -23,7 +23,7 @@ var LicenseValidityType;
|
|
|
23
23
|
LicenseValidityType["COMMERCIAL_EXPIRED_IN_SCOPE"] = "COMMERCIAL_EXPIRED_IN_SCOPE";
|
|
24
24
|
LicenseValidityType["COMMERCIAL_EXPIRED_OUT_OF_SCOPE"] = "COMMERCIAL_EXPIRED_OUT_OF_SCOPE";
|
|
25
25
|
})(LicenseValidityType = exports.LicenseValidityType || (exports.LicenseValidityType = {}));
|
|
26
|
-
const SANDPACK_REGEX = /(https):\/\/\d+\-\d+\-\d
|
|
26
|
+
const SANDPACK_REGEX = /(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g;
|
|
27
27
|
const SANDBOX_REGEX = /(https):\/\/\S+(\.csb\.app)/g;
|
|
28
28
|
const origin = typeof window !== 'undefined' ? window.location.origin : '';
|
|
29
29
|
const isInsideSandpack = () => {
|
|
@@ -4,16 +4,19 @@ import { Observable } from 'rxjs';
|
|
|
4
4
|
import { DataChangedInfo } from '../../PredefinedConfig/Common/DataChangedInfo';
|
|
5
5
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
6
6
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
7
|
-
import { ModuleExpressionFunctions } from '../../AdaptableOptions/
|
|
7
|
+
import { ModuleExpressionFunctions } from '../../AdaptableOptions/AdaptableQLOptions';
|
|
8
|
+
import { AggregationParameter } from '../ExpressionFunctions/aggregatedScalarExpressionFunctions';
|
|
8
9
|
export declare class QueryLanguageService implements IQueryLanguageService {
|
|
9
10
|
private adaptable;
|
|
10
11
|
private cacheBooleanValidation;
|
|
11
12
|
private cacheObservableValidation;
|
|
12
|
-
private
|
|
13
|
+
private cacheAggregatedBooleanValidation;
|
|
14
|
+
private cacheAggregatedScalarValidation;
|
|
13
15
|
private cacheModuleSpecificExpressionFunctions;
|
|
14
16
|
constructor(adaptable: IAdaptable);
|
|
15
17
|
evaluateBooleanExpression(expression: string, module: AdaptableModule, rowNode: any): any;
|
|
16
18
|
evaluateScalarExpression(expression: string, module: AdaptableModule, rowNode: RowNode): any;
|
|
19
|
+
evaluateAggregatedScalarExpression(expression: string, module: AdaptableModule): AggregationParameter;
|
|
17
20
|
evaluateObservableExpression(reactiveExpression: string, module: AdaptableModule): Observable<DataChangedInfo>;
|
|
18
21
|
evaluateAggregatedBooleanExpression(aggregationExpression: string, module: AdaptableModule): Observable<DataChangedInfo>;
|
|
19
22
|
validateBoolean(expressionInput: string, module: AdaptableModule, config?: {
|
|
@@ -30,6 +33,10 @@ export declare class QueryLanguageService implements IQueryLanguageService {
|
|
|
30
33
|
isValid: boolean;
|
|
31
34
|
errorMessage: string;
|
|
32
35
|
};
|
|
36
|
+
validateAggregatedScalar(expressionInput: string, module: AdaptableModule): {
|
|
37
|
+
isValid: boolean;
|
|
38
|
+
errorMessage: string;
|
|
39
|
+
};
|
|
33
40
|
getColumnsFromExpression(input?: string): string[];
|
|
34
41
|
getNamedQueryNamesFromExpression(input?: string): string[];
|
|
35
42
|
getModuleExpressionFunctions(module: AdaptableModule): ModuleExpressionFunctions;
|
|
@@ -10,7 +10,8 @@ class QueryLanguageService {
|
|
|
10
10
|
this.adaptable = adaptable;
|
|
11
11
|
this.cacheBooleanValidation = new Map();
|
|
12
12
|
this.cacheObservableValidation = new Map();
|
|
13
|
-
this.
|
|
13
|
+
this.cacheAggregatedBooleanValidation = new Map();
|
|
14
|
+
this.cacheAggregatedScalarValidation = new Map();
|
|
14
15
|
this.cacheModuleSpecificExpressionFunctions = new Map();
|
|
15
16
|
}
|
|
16
17
|
evaluateBooleanExpression(expression, module, rowNode) {
|
|
@@ -26,6 +27,14 @@ class QueryLanguageService {
|
|
|
26
27
|
// currently scalar and boolean expressions are evaluated the same
|
|
27
28
|
return this.evaluateBooleanExpression(expression, module, rowNode);
|
|
28
29
|
}
|
|
30
|
+
evaluateAggregatedScalarExpression(expression, module) {
|
|
31
|
+
const aggregatedScalarFunctions = this.getModuleExpressionFunctions(module).aggregatedScalarFunctions;
|
|
32
|
+
return parser.evaluate(expression, {
|
|
33
|
+
node: null,
|
|
34
|
+
api: this.adaptable.api,
|
|
35
|
+
functions: aggregatedScalarFunctions,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
29
38
|
evaluateObservableExpression(reactiveExpression, module) {
|
|
30
39
|
const moduleExpressionFunctions = this.getModuleExpressionFunctions(module);
|
|
31
40
|
const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
|
|
@@ -66,7 +75,7 @@ class QueryLanguageService {
|
|
|
66
75
|
}
|
|
67
76
|
const force = (_a = config === null || config === void 0 ? void 0 : config.force) !== null && _a !== void 0 ? _a : false;
|
|
68
77
|
// get searchOptions to see if validation should be performed
|
|
69
|
-
if (!this.adaptable.api.internalApi.getAdaptableOptions().
|
|
78
|
+
if (!this.adaptable.api.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
70
79
|
.performExpressionValidation &&
|
|
71
80
|
!force) {
|
|
72
81
|
const result = { isValid: true, errorMessage: '' };
|
|
@@ -148,30 +157,68 @@ class QueryLanguageService {
|
|
|
148
157
|
}
|
|
149
158
|
validateAggregatedBoolean(expressionInput = '', module) {
|
|
150
159
|
const cacheKey = this.getExpressionCacheKey(expressionInput, module);
|
|
151
|
-
if (this.
|
|
152
|
-
return this.
|
|
160
|
+
if (this.cacheAggregatedBooleanValidation.has(cacheKey)) {
|
|
161
|
+
return this.cacheAggregatedBooleanValidation.get(cacheKey);
|
|
162
|
+
}
|
|
163
|
+
const expression = expressionInput.trim();
|
|
164
|
+
if (expression === '') {
|
|
165
|
+
const result = {
|
|
166
|
+
isValid: false,
|
|
167
|
+
errorMessage: 'empty AggregatedBoolean expression',
|
|
168
|
+
};
|
|
169
|
+
this.cacheAggregatedBooleanValidation.set(cacheKey, result);
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
const aggregatedBooleanExpressionEvaluation = this.evaluateAggregatedBooleanExpression(expression, module);
|
|
174
|
+
if (!rxjs_1.isObservable(aggregatedBooleanExpressionEvaluation)) {
|
|
175
|
+
const result = {
|
|
176
|
+
isValid: false,
|
|
177
|
+
errorMessage: `provided AggregatedBoolean expression does not evaluate to an Observable`,
|
|
178
|
+
};
|
|
179
|
+
this.cacheAggregatedBooleanValidation.set(cacheKey, result);
|
|
180
|
+
return result;
|
|
181
|
+
}
|
|
182
|
+
const result = { isValid: true, errorMessage: '' };
|
|
183
|
+
this.cacheAggregatedBooleanValidation.set(cacheKey, result);
|
|
184
|
+
return result;
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
const result = {
|
|
188
|
+
isValid: false,
|
|
189
|
+
errorMessage: error,
|
|
190
|
+
};
|
|
191
|
+
this.cacheAggregatedBooleanValidation.set(cacheKey, result);
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
validateAggregatedScalar(expressionInput = '', module) {
|
|
196
|
+
const cacheKey = this.getExpressionCacheKey(expressionInput, module);
|
|
197
|
+
if (this.cacheAggregatedScalarValidation.has(cacheKey)) {
|
|
198
|
+
return this.cacheAggregatedScalarValidation.get(cacheKey);
|
|
153
199
|
}
|
|
154
200
|
const expression = expressionInput.trim();
|
|
155
201
|
if (expression === '') {
|
|
156
202
|
const result = {
|
|
157
203
|
isValid: false,
|
|
158
|
-
errorMessage: 'empty
|
|
204
|
+
errorMessage: 'empty AggregatedScalar expression',
|
|
159
205
|
};
|
|
160
|
-
this.
|
|
206
|
+
this.cacheAggregatedScalarValidation.set(cacheKey, result);
|
|
161
207
|
return result;
|
|
162
208
|
}
|
|
163
209
|
try {
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
210
|
+
const evaluationResult = this.evaluateAggregatedScalarExpression(expression, module);
|
|
211
|
+
if (evaluationResult.type !== 'aggregation') {
|
|
166
212
|
const result = {
|
|
167
213
|
isValid: false,
|
|
168
|
-
errorMessage:
|
|
214
|
+
errorMessage: 'provided AggregatedScalar expression does not evaluate to a supported aggregation',
|
|
169
215
|
};
|
|
170
|
-
this.
|
|
216
|
+
this.cacheAggregatedScalarValidation.set(cacheKey, result);
|
|
171
217
|
return result;
|
|
172
218
|
}
|
|
219
|
+
// no exception,so everything seems to be fine
|
|
173
220
|
const result = { isValid: true, errorMessage: '' };
|
|
174
|
-
this.
|
|
221
|
+
this.cacheAggregatedScalarValidation.set(cacheKey, result);
|
|
175
222
|
return result;
|
|
176
223
|
}
|
|
177
224
|
catch (error) {
|
|
@@ -179,7 +226,7 @@ class QueryLanguageService {
|
|
|
179
226
|
isValid: false,
|
|
180
227
|
errorMessage: error,
|
|
181
228
|
};
|
|
182
|
-
this.
|
|
229
|
+
this.cacheAggregatedScalarValidation.set(cacheKey, result);
|
|
183
230
|
return result;
|
|
184
231
|
}
|
|
185
232
|
}
|
|
@@ -192,26 +239,38 @@ class QueryLanguageService {
|
|
|
192
239
|
// Returns the ExpressionFunctions available for the given Module as specified in the `QueryLanguageOptions.moduleExpressionFunctions`
|
|
193
240
|
// if there are no specific functions defined, it falls back to the default values
|
|
194
241
|
getModuleExpressionFunctions(module) {
|
|
195
|
-
var _a, _b, _c, _d, _e, _f;
|
|
242
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
196
243
|
if (!module) {
|
|
197
244
|
LoggingHelper_1.LogAdaptableInfo(`QueryLanguageService.getModuleExpressionFunctions() was called with an undefined 'module' param, this should never happen`);
|
|
198
245
|
return {
|
|
199
|
-
booleanFunctions: this.adaptable.adaptableOptions.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
246
|
+
booleanFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
|
|
247
|
+
.defaultBooleanFunctions,
|
|
248
|
+
scalarFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
|
|
249
|
+
.defaultScalarFunctions,
|
|
250
|
+
observableFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
|
|
251
|
+
.defaultObservableFunctions,
|
|
252
|
+
aggregatedBooleanFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
|
|
253
|
+
.defaultAggregatedBooleanFunctions,
|
|
254
|
+
aggregatedScalarFunctions: this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
|
|
255
|
+
.defaultAggregatedScalarFunctions,
|
|
203
256
|
};
|
|
204
257
|
}
|
|
205
258
|
let cachedResult = this.cacheModuleSpecificExpressionFunctions.get(module);
|
|
206
259
|
if (cachedResult) {
|
|
207
260
|
return cachedResult;
|
|
208
261
|
}
|
|
209
|
-
const moduleSpecificOptions = (_b = (_a = this.adaptable.adaptableOptions.
|
|
262
|
+
const moduleSpecificOptions = (_b = (_a = this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
|
|
263
|
+
.moduleExpressionFunctions) === null || _a === void 0 ? void 0 : _a[module]) !== null && _b !== void 0 ? _b : {};
|
|
210
264
|
const moduleSpecificFunctions = {
|
|
211
|
-
booleanFunctions: (_c = moduleSpecificOptions.booleanFunctions) !== null && _c !== void 0 ? _c : this.adaptable.adaptableOptions.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
265
|
+
booleanFunctions: (_c = moduleSpecificOptions.booleanFunctions) !== null && _c !== void 0 ? _c : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
|
|
266
|
+
.defaultBooleanFunctions,
|
|
267
|
+
scalarFunctions: (_d = moduleSpecificOptions.scalarFunctions) !== null && _d !== void 0 ? _d : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions.defaultScalarFunctions,
|
|
268
|
+
observableFunctions: (_e = moduleSpecificOptions.observableFunctions) !== null && _e !== void 0 ? _e : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
|
|
269
|
+
.defaultObservableFunctions,
|
|
270
|
+
aggregatedBooleanFunctions: (_f = moduleSpecificOptions.aggregatedBooleanFunctions) !== null && _f !== void 0 ? _f : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
|
|
271
|
+
.defaultAggregatedBooleanFunctions,
|
|
272
|
+
aggregatedScalarFunctions: (_g = moduleSpecificOptions.aggregatedScalarFunctions) !== null && _g !== void 0 ? _g : this.adaptable.adaptableOptions.adaptableQLOptions.expressionOptions
|
|
273
|
+
.defaultAggregatedScalarFunctions,
|
|
215
274
|
};
|
|
216
275
|
this.cacheModuleSpecificExpressionFunctions.set(module, moduleSpecificFunctions);
|
|
217
276
|
return moduleSpecificFunctions;
|
|
@@ -13,6 +13,7 @@ const ConfigurationForm = (props) => {
|
|
|
13
13
|
let abOptions = props.adaptableOptions;
|
|
14
14
|
const layoutOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.layoutOptions), abOptions.layoutOptions);
|
|
15
15
|
const generalOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.generalOptions), abOptions.generalOptions);
|
|
16
|
+
const adaptableQLOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.adaptableQLOptions), abOptions.adaptableQLOptions);
|
|
16
17
|
const userInterfaceOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.userInterfaceOptions), abOptions.userInterfaceOptions);
|
|
17
18
|
const searchOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.searchOptions), abOptions.searchOptions);
|
|
18
19
|
const filterOptions = Object.assign(Object.assign({}, DefaultAdaptableOptions_1.DefaultAdaptableOptions.filterOptions), abOptions.filterOptions);
|
|
@@ -72,10 +73,11 @@ const ConfigurationForm = (props) => {
|
|
|
72
73
|
React.createElement(HelpBlock_1.default, null, "Search Options"),
|
|
73
74
|
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
74
75
|
React.createElement(FormLayout_1.FormRow, { label: "Case Sensitive Text Comparison" },
|
|
75
|
-
React.createElement(CheckBox_1.CheckBox, { checked:
|
|
76
|
+
React.createElement(CheckBox_1.CheckBox, { checked: adaptableQLOptions.caseSensitiveTextComparisons, onChange: (caseSensitiveTextComparisons) => {
|
|
76
77
|
abOptions = Object.assign({}, abOptions);
|
|
77
|
-
abOptions.
|
|
78
|
-
abOptions.
|
|
78
|
+
abOptions.adaptableQLOptions = Object.assign({}, abOptions.adaptableQLOptions);
|
|
79
|
+
abOptions.adaptableQLOptions.caseSensitiveTextComparisons =
|
|
80
|
+
caseSensitiveTextComparisons;
|
|
79
81
|
props.onChangeadaptableOptions(abOptions);
|
|
80
82
|
} })),
|
|
81
83
|
React.createElement(FormLayout_1.FormRow, { label: "Use AG Grid Filter Form Style" },
|
|
@@ -9,6 +9,7 @@ export declare const renderAlertDisplaySummary: () => JSX.Element;
|
|
|
9
9
|
interface AlertPreviewProps extends BoxProps {
|
|
10
10
|
api: AdaptableApi;
|
|
11
11
|
alertDefinition: AlertDefinition;
|
|
12
|
+
focusFirstButton?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare const AlertPreview: React.FunctionComponent<AlertPreviewProps>;
|
|
14
15
|
export declare const AlertDisplayWizardSection: (props: AlertDisplayWizardSectionProps) => JSX.Element;
|
|
@@ -32,7 +32,7 @@ exports.renderAlertDisplaySummary = () => {
|
|
|
32
32
|
return React.createElement(exports.AlertPreview, { api: api, alertDefinition: data });
|
|
33
33
|
};
|
|
34
34
|
exports.AlertPreview = (_a) => {
|
|
35
|
-
var { alertDefinition, api } = _a, boxProps = tslib_1.__rest(_a, ["alertDefinition", "api"]);
|
|
35
|
+
var { alertDefinition, api, focusFirstButton } = _a, boxProps = tslib_1.__rest(_a, ["alertDefinition", "api", "focusFirstButton"]);
|
|
36
36
|
const mapButtons = React.useCallback((button) => {
|
|
37
37
|
let buttonStyle = button.ButtonStyle;
|
|
38
38
|
if (buttonStyle && buttonStyle.tone == null && (alertDefinition === null || alertDefinition === void 0 ? void 0 : alertDefinition.MessageType)) {
|
|
@@ -52,7 +52,7 @@ exports.AlertPreview = (_a) => {
|
|
|
52
52
|
return result;
|
|
53
53
|
}, [alertDefinition]);
|
|
54
54
|
return (React.createElement(rebass_1.Box, Object.assign({}, boxProps, { style: Object.assign({ border: '1px solid var(--ab-color-inputborder)' }, boxProps.style) }),
|
|
55
|
-
React.createElement(AdaptablePopupAlert_1.AdaptablePopupAlert, { headless: true, adaptableAlert: alertToPreview, api: api, onClose: () => { } })));
|
|
55
|
+
React.createElement(AdaptablePopupAlert_1.AdaptablePopupAlert, { headless: true, focusFirstButton: focusFirstButton, adaptableAlert: alertToPreview, api: api, onClose: () => { } })));
|
|
56
56
|
};
|
|
57
57
|
exports.AlertDisplayWizardSection = (props) => {
|
|
58
58
|
var _a, _b, _c, _d;
|
|
@@ -7,14 +7,14 @@ const rebass_1 = require("rebass");
|
|
|
7
7
|
const CodeBlock_1 = require("../../components/CodeBlock");
|
|
8
8
|
class CalculatedColumnSharedEntity extends React.Component {
|
|
9
9
|
render() {
|
|
10
|
-
|
|
10
|
+
// TODO AFL TTT
|
|
11
11
|
let calcCol = this.props.entity;
|
|
12
12
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center" },
|
|
13
13
|
React.createElement(rebass_1.Flex, { flex: 4 }, calcCol.ColumnId),
|
|
14
14
|
React.createElement(rebass_1.Flex, { flex: 8 },
|
|
15
15
|
React.createElement(CodeBlock_1.CodeBlock, null,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
' ',
|
|
17
|
+
this.props.api.queryLanguageApi.getAdaptableQueryExpression(calcCol.Query)))));
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
exports.CalculatedColumnSharedEntity = CalculatedColumnSharedEntity;
|
|
@@ -28,9 +28,8 @@ class CalculatedColumnSummaryComponent extends React.Component {
|
|
|
28
28
|
let detailRow;
|
|
29
29
|
let sharing = this.props.teamSharingActivated;
|
|
30
30
|
this.props.CalculatedColumns.map((item, index) => {
|
|
31
|
-
var _a;
|
|
32
31
|
if (item.ColumnId == this.props.summarisedColumn.columnId) {
|
|
33
|
-
detailRow = (React.createElement(ModuleDetail_1.ModuleDetail, { key: 'UF' + index, item1: this.props.moduleInfo.FriendlyName, item2: (
|
|
32
|
+
detailRow = (React.createElement(ModuleDetail_1.ModuleDetail, { key: 'UF' + index, item1: this.props.moduleInfo.FriendlyName, item2: this.props.api.queryLanguageApi.getAdaptableQueryExpression(item.Query), configEnity: item, showShare: this.props.teamSharingActivated, moduleInfo: this.props.moduleInfo, onEdit: () => this.onEdit(item), onShare: (config) => this.props.onShare(item, config), onDelete: CalculatedColumnRedux.CalculatedColumnDelete(item), showBold: true, accessLevel: this.props.accessLevel }));
|
|
34
33
|
}
|
|
35
34
|
});
|
|
36
35
|
return (React.createElement("div", null,
|
|
@@ -52,10 +51,9 @@ class CalculatedColumnSummaryComponent extends React.Component {
|
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
53
|
canFinishWizard() {
|
|
55
|
-
var _a;
|
|
56
54
|
let calculatedColumn = this.state.editedAdaptableObject;
|
|
57
55
|
return (StringExtensions_1.StringExtensions.IsNotNullOrEmpty(calculatedColumn.ColumnId) &&
|
|
58
|
-
StringExtensions_1.StringExtensions.IsNotNullOrEmpty((
|
|
56
|
+
StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.api.queryLanguageApi.getAdaptableQueryExpression(calculatedColumn.Query)));
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
59
|
exports.CalculatedColumnSummaryComponent = CalculatedColumnSummaryComponent;
|