@adaptabletools/adaptable 11.0.0-canary.6 → 11.0.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 +4 -4
- package/agGrid.d.ts +5 -4
- package/agGrid.js +7 -5
- package/base.css +3 -4
- package/bundle.cjs.js +120 -115
- package/index.css +3 -4
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -5
- package/src/AdaptableOptions/{QueryLanguageOptions.d.ts → AdaptableQLOptions.d.ts} +34 -2
- package/src/AdaptableOptions/{QueryLanguageOptions.js → AdaptableQLOptions.js} +0 -0
- package/src/AdaptableOptions/FilterOptions.d.ts +4 -0
- package/src/AdaptableOptions/GeneralOptions.d.ts +0 -7
- package/src/AdaptableOptions/SearchOptions.d.ts +0 -9
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +7 -6
- package/src/AdaptableOptions/StateOptions.d.ts +7 -7
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -2
- package/src/Api/CalculatedColumnApi.d.ts +2 -9
- package/src/Api/GridApi.d.ts +12 -3
- package/src/Api/Implementation/AlertApiImpl.js +1 -2
- 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/ColumnApiImpl.js +1 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +2 -0
- package/src/Api/Implementation/GridApiImpl.js +41 -21
- 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/Implementation/SettingsPanelApiImpl.js +1 -1
- package/src/Api/Implementation/ToolPanelApiImpl.js +1 -1
- 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/AdaptableColumn.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +3 -0
- 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 +6 -1
- package/src/PredefinedConfig/Common/Types.js +1 -0
- package/src/PredefinedConfig/ConditionalStyleState.d.ts +2 -2
- package/src/PredefinedConfig/FormatColumnState.d.ts +15 -0
- package/src/PredefinedConfig/PlusMinusState.d.ts +1 -1
- package/src/PredefinedConfig/Selection/GridCellRange.d.ts +3 -1
- package/src/PredefinedConfig/ToolPanelState.d.ts +3 -0
- package/src/Redux/ActionsReducers/AlertRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/AlertRedux.js +4 -4
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +4 -4
- package/src/Redux/ActionsReducers/CustomSortRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/CustomSortRedux.js +4 -4
- package/src/Redux/ActionsReducers/FlashingCellRedux.d.ts +12 -12
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +33 -29
- package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +4 -4
- package/src/Redux/ActionsReducers/PlusMinusRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/PlusMinusRedux.js +4 -4
- package/src/Redux/ActionsReducers/ScheduleRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/ScheduleRedux.js +16 -16
- package/src/Redux/ActionsReducers/ShortcutRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/ShortcutRedux.js +4 -4
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +1 -1
- package/src/Redux/Store/AdaptableStore.js +47 -22
- package/src/Strategy/AlertModule.js +4 -4
- 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 +4 -4
- 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 +3 -2
- package/src/Utilities/Constants/DocumentationLinkConstants.js +12 -10
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +18 -13
- 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/ModuleService.js +33 -40
- 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/Alert/Wizard/isValidAlertRules.js +3 -3
- 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.d.ts +1 -1
- package/src/View/Components/EntityRulesEditor/index.js +3 -4
- 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/AdaptablePopup/AdaptablePopup.js +4 -8
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +1 -2
- package/src/View/Components/Popups/AdaptablePopupAlert.d.ts +1 -0
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/Dashboard/DashboardPopup.js +1 -1
- package/src/View/FlashingCell/Wizard/isValidFlashingCellRules.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
- package/src/View/License/LicenseWatermark.js +1 -1
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +1 -1
- package/src/View/Query/Wizard/NamedQueryExpressionWizardSection.js +2 -2
- package/src/View/Schedule/Wizard/ScheduleWizard.js +3 -3
- package/src/agGrid/Adaptable.d.ts +4 -1
- package/src/agGrid/Adaptable.js +71 -48
- package/src/agGrid/CheckboxRenderer.d.ts +8 -1
- package/src/agGrid/CheckboxRenderer.js +18 -3
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/agGrid/agGridHelper.js +9 -10
- 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/components/icons/calculated-column.js +2 -1
- package/src/metamodel/adaptable.metamodel.d.ts +235 -41
- package/src/metamodel/adaptable.metamodel.js +435 -149
- 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 = () => {
|
|
@@ -76,75 +76,68 @@ class ModuleService {
|
|
|
76
76
|
}
|
|
77
77
|
getModuleDocumentationPageByModule(adaptableModule) {
|
|
78
78
|
let url = `${DocumentationLinkConstants_1.HOST_URL_DOCS}/`;
|
|
79
|
-
let
|
|
80
|
-
let editingUrl = url + 'editing/';
|
|
81
|
-
let searchingUrl = url + 'searching/';
|
|
82
|
-
let filteringUrl = url + 'filtering/';
|
|
83
|
-
let themingUrl = url + 'theming/';
|
|
84
|
-
let stylingUrl = url + 'styling/';
|
|
85
|
-
let advancedFeaturesUrl = url + 'advanced-features/';
|
|
86
|
-
let gridManagementUrl = url + 'grid-management/';
|
|
87
|
-
let userInterfaceUrl = url + 'user-interface/';
|
|
88
|
-
let pluginUrl = url + 'plugins/';
|
|
79
|
+
let learnUrl = url + 'learn/';
|
|
89
80
|
switch (adaptableModule) {
|
|
90
81
|
case 'Alert':
|
|
91
|
-
return
|
|
82
|
+
return learnUrl + 'handbook-alerting';
|
|
92
83
|
case 'BulkUpdate':
|
|
93
|
-
return
|
|
84
|
+
return url + 'handbook-editing#bulk-update';
|
|
94
85
|
case 'CalculatedColumn':
|
|
95
|
-
return
|
|
86
|
+
return learnUrl + 'handbook-calculated-column';
|
|
96
87
|
case 'CellSummary':
|
|
97
|
-
return
|
|
88
|
+
return learnUrl + 'handbook-summarising#cell-summary-information';
|
|
98
89
|
case 'ConditionalStyle':
|
|
99
|
-
return
|
|
90
|
+
return learnUrl + 'handbook-conditional-styling';
|
|
100
91
|
case 'CustomSort':
|
|
101
|
-
return
|
|
92
|
+
return learnUrl + 'handbook-sorting';
|
|
102
93
|
case 'Dashboard':
|
|
103
|
-
return
|
|
94
|
+
return learnUrl + 'ui-dashboard';
|
|
104
95
|
case 'DataSource':
|
|
105
|
-
return
|
|
96
|
+
return learnUrl + 'handbook-data-sources';
|
|
97
|
+
case 'DataChangeHistory':
|
|
98
|
+
return learnUrl + 'handbook-monitoring#data-change-history';
|
|
106
99
|
case 'Export':
|
|
107
|
-
return
|
|
100
|
+
return learnUrl + 'handbook-exporting';
|
|
108
101
|
case 'Filter':
|
|
109
|
-
return
|
|
102
|
+
return learnUrl + 'handbook-filtering';
|
|
103
|
+
case 'FlashingCell':
|
|
104
|
+
return learnUrl + 'handbook-cell-flashing';
|
|
110
105
|
case 'FormatColumn':
|
|
111
|
-
return
|
|
106
|
+
return learnUrl + 'handbook-column-formatting';
|
|
112
107
|
case 'FreeTextColumn':
|
|
113
|
-
return
|
|
108
|
+
return learnUrl + 'handbook-freetext-column';
|
|
114
109
|
case 'GridInfo':
|
|
115
|
-
return
|
|
110
|
+
return learnUrl + 'handbook-monitoring#grid-info-panel';
|
|
116
111
|
case 'Layout':
|
|
117
|
-
return
|
|
112
|
+
return learnUrl + 'handbook-layouts';
|
|
118
113
|
case 'PlusMinus':
|
|
119
|
-
return
|
|
114
|
+
return learnUrl + 'handbook-editing#plus-minus';
|
|
120
115
|
case 'Query':
|
|
121
|
-
return
|
|
116
|
+
return learnUrl + 'handbook-querying';
|
|
122
117
|
case 'QuickSearch':
|
|
123
|
-
return
|
|
118
|
+
return learnUrl + 'handbook-searching';
|
|
124
119
|
case 'Schedule':
|
|
125
|
-
return
|
|
120
|
+
return learnUrl + 'handbook-scheduling';
|
|
126
121
|
case 'Shortcut':
|
|
127
|
-
return
|
|
122
|
+
return learnUrl + 'handbook-editing#shortcuts';
|
|
128
123
|
case 'SmartEdit':
|
|
129
|
-
return
|
|
124
|
+
return learnUrl + 'handbook-editing#smart-edit';
|
|
130
125
|
case 'StateManagement':
|
|
131
|
-
return
|
|
126
|
+
return learnUrl + 'dev-guide-adaptable-state';
|
|
132
127
|
case 'SystemStatus':
|
|
133
|
-
return
|
|
128
|
+
return learnUrl + 'handbook-notifying';
|
|
134
129
|
case 'TeamSharing':
|
|
135
|
-
return url + '
|
|
130
|
+
return url + 'handbook-collaborating';
|
|
136
131
|
case 'Theme':
|
|
137
|
-
return
|
|
132
|
+
return learnUrl + 'handbook-theming';
|
|
138
133
|
case 'ToolPanel':
|
|
139
|
-
return
|
|
140
|
-
case 'DataChangeHistory':
|
|
141
|
-
return editingUrl + 'change-history-module';
|
|
134
|
+
return learnUrl + 'ui-tool-panel';
|
|
142
135
|
case 'Glue42':
|
|
143
|
-
return
|
|
136
|
+
return learnUrl + 'integrations-glue42';
|
|
144
137
|
case 'IPushPull':
|
|
145
|
-
return
|
|
138
|
+
return learnUrl + 'integrations-ipushpull';
|
|
146
139
|
case 'OpenFin':
|
|
147
|
-
return
|
|
140
|
+
return learnUrl + 'integrations-openfin';
|
|
148
141
|
default:
|
|
149
142
|
return 'good';
|
|
150
143
|
}
|
|
@@ -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" },
|