@adaptabletools/adaptable 11.1.2 → 11.1.5
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/bundle.cjs.js +120 -120
- package/package.json +3 -3
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +1 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +49 -49
- package/src/AdaptableOptions/ContainerOptions.d.ts +1 -1
- package/src/AdaptableOptions/DashboardOptions.d.ts +1 -1
- package/src/AdaptableOptions/EditOptions.d.ts +4 -0
- package/src/AdaptableOptions/NotificationsOptions.d.ts +2 -2
- package/src/AdaptableOptions/SmartEdit.d.ts +34 -0
- package/src/AdaptableOptions/SmartEdit.js +2 -0
- package/src/Api/Implementation/ColumnApiImpl.js +1 -1
- package/src/Api/Implementation/FilterApiImpl.js +8 -2
- package/src/Api/Implementation/GridApiImpl.d.ts +3 -3
- package/src/Api/Implementation/GridApiImpl.js +6 -8
- package/src/Api/Implementation/InternalApiImpl.d.ts +4 -0
- package/src/Api/Implementation/InternalApiImpl.js +9 -0
- package/src/Api/Implementation/SmartEditApiImpl.d.ts +3 -2
- package/src/Api/Implementation/ThemeApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ThemeApiImpl.js +3 -0
- package/src/Api/InternalApi.d.ts +4 -0
- package/src/Api/SmartEditApi.d.ts +3 -2
- package/src/Api/ThemeApi.d.ts +4 -0
- package/src/PredefinedConfig/ExportState.d.ts +0 -5
- package/src/PredefinedConfig/PopupState.d.ts +2 -1
- package/src/PredefinedConfig/SystemState.d.ts +2 -5
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +22 -3
- package/src/Redux/ActionsReducers/PopupRedux.js +42 -8
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +5 -23
- package/src/Redux/ActionsReducers/SystemRedux.js +3 -32
- package/src/Strategy/AlertModule.js +29 -9
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/ExportModule.js +14 -4
- package/src/Strategy/SmartEditModule.d.ts +2 -2
- package/src/Strategy/SmartEditModule.js +24 -13
- package/src/Strategy/Utilities/getExportColumnsViewItems.js +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +4 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +0 -3
- package/src/Utilities/Interface/MessagePopups.d.ts +12 -0
- package/src/Utilities/Services/AlertService.d.ts +3 -3
- package/src/Utilities/Services/AlertService.js +6 -6
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +3 -3
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +20 -20
- package/src/Utilities/Services/EntitlementService.d.ts +3 -3
- package/src/Utilities/Services/EntitlementService.js +12 -8
- package/src/Utilities/Services/Interface/IReportService.d.ts +1 -1
- package/src/Utilities/Services/MetamodelService.d.ts +3 -3
- package/src/Utilities/Services/MetamodelService.js +4 -4
- package/src/Utilities/Services/ModuleService.d.ts +3 -3
- package/src/Utilities/Services/ModuleService.js +12 -12
- package/src/Utilities/Services/QueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/QueryLanguageService.js +20 -19
- package/src/Utilities/Services/ReportService.d.ts +4 -4
- package/src/Utilities/Services/ReportService.js +50 -44
- package/src/Utilities/Services/TeamSharingService.d.ts +3 -3
- package/src/Utilities/Services/TeamSharingService.js +19 -16
- package/src/Utilities/Services/ValidationService.d.ts +3 -3
- package/src/Utilities/Services/ValidationService.js +19 -17
- package/src/View/AdaptableView.js +2 -2
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +46 -9
- package/src/View/Alert/Wizard/AlertWizard.js +22 -24
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +5 -5
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +3 -3
- package/src/View/Components/Popups/FormPopups/FormPopups.d.ts +10 -0
- package/src/View/Components/Popups/FormPopups/FormPopups.js +37 -0
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +1 -3
- package/src/View/DataSource/DataSourceViewPanel.d.ts +3 -3
- package/src/View/DataSource/DataSourceViewPanel.js +15 -13
- package/src/View/Export/ExportViewPanel.d.ts +1 -3
- package/src/View/Export/ExportViewPanel.js +1 -17
- package/src/View/GridInfo/AdaptableObjectsSummary.js +1 -1
- package/src/View/GridInfo/GridInfoPopup.js +4 -4
- package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -4
- package/src/View/Layout/Wizard/LayoutEditorWizard.js +6 -1
- package/src/View/SmartEdit/SmartEditPopup.d.ts +3 -3
- package/src/View/SmartEdit/SmartEditPopup.js +15 -3
- package/src/View/SmartEdit/SmartEditViewPanel.d.ts +3 -4
- package/src/View/SmartEdit/SmartEditViewPanel.js +15 -6
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
- package/src/agGrid/Adaptable.d.ts +5 -4
- package/src/agGrid/Adaptable.js +56 -49
- package/src/components/StylePreview.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +5 -0
- package/src/metamodel/adaptable.metamodel.js +16 -5
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/View/Export/ExportCustomDestinationDialog.d.ts +0 -11
- package/src/View/Export/ExportCustomDestinationDialog.js +0 -47
- package/src/View/Export/ExportCustomDestinationFormPopups.d.ts +0 -5
- package/src/View/Export/ExportCustomDestinationFormPopups.js +0 -15
|
@@ -6,11 +6,11 @@ const LoggingHelper_1 = require("../Helpers/LoggingHelper");
|
|
|
6
6
|
const ModuleConstants_1 = require("../Constants/ModuleConstants");
|
|
7
7
|
const scalarAggregationHelper_1 = require("../ExpressionFunctions/scalarAggregationHelper");
|
|
8
8
|
class CalculatedColumnExpressionService {
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(adaptableApi) {
|
|
10
|
+
this.adaptableApi = adaptableApi;
|
|
11
11
|
this.aggregatedScalarCalculatedColumnsMap = new Map();
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
12
|
+
this.adaptableApi = adaptableApi;
|
|
13
|
+
this.adaptableApi.internalApi
|
|
14
14
|
.getDataService()
|
|
15
15
|
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
16
16
|
if (cellDataChangedInfo.trigger === 'aggChange') {
|
|
@@ -27,7 +27,7 @@ class CalculatedColumnExpressionService {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
if (refreshedCalculatedColumns.length) {
|
|
30
|
-
this.
|
|
30
|
+
this.adaptableApi.gridApi.refreshCells(null, refreshedCalculatedColumns);
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -39,8 +39,8 @@ class CalculatedColumnExpressionService {
|
|
|
39
39
|
// we definitely don't want to aggregate everything only to get the data type
|
|
40
40
|
return Enums_1.DataType.Number;
|
|
41
41
|
}
|
|
42
|
-
let firstRowNode = this.
|
|
43
|
-
let firstRowValue = this.
|
|
42
|
+
let firstRowNode = this.adaptableApi.gridApi.getFirstRowNode();
|
|
43
|
+
let firstRowValue = this.adaptableApi.internalApi
|
|
44
44
|
.getQueryLanguageService()
|
|
45
45
|
.evaluateScalarExpression(calculatedColumnQuery.ScalarExpression, ModuleConstants_1.CalculatedColumnModuleId, firstRowNode);
|
|
46
46
|
if (firstRowValue instanceof Date) {
|
|
@@ -57,7 +57,7 @@ class CalculatedColumnExpressionService {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
catch (e) {
|
|
60
|
-
LoggingHelper_1.LogAdaptableWarning(`Invalid CalculatedColumn expression ${this.
|
|
60
|
+
LoggingHelper_1.LogAdaptableWarning(`Invalid CalculatedColumn expression ${this.adaptableApi.queryLanguageApi.getAdaptableQueryExpression(calculatedColumnQuery)} :: ${e}`);
|
|
61
61
|
return Enums_1.DataType.Number;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -65,8 +65,8 @@ class CalculatedColumnExpressionService {
|
|
|
65
65
|
if (calculatedColumnQuery.ScalarExpression) {
|
|
66
66
|
try {
|
|
67
67
|
// TODO AFL add a cached validation for ScalarExpression, just like for all the other types
|
|
68
|
-
let firstRowNode = this.
|
|
69
|
-
this.
|
|
68
|
+
let firstRowNode = this.adaptableApi.gridApi.getFirstRowNode();
|
|
69
|
+
this.adaptableApi.internalApi
|
|
70
70
|
.getQueryLanguageService()
|
|
71
71
|
.evaluateScalarExpression(calculatedColumnQuery.ScalarExpression, ModuleConstants_1.CalculatedColumnModuleId, firstRowNode);
|
|
72
72
|
return true;
|
|
@@ -77,7 +77,7 @@ class CalculatedColumnExpressionService {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
if (calculatedColumnQuery.AggregatedScalarExpression) {
|
|
80
|
-
const validationResult = this.
|
|
80
|
+
const validationResult = this.adaptableApi.internalApi
|
|
81
81
|
.getQueryLanguageService()
|
|
82
82
|
.validateAggregatedScalar(calculatedColumnQuery.AggregatedScalarExpression, ModuleConstants_1.CalculatedColumnModuleId);
|
|
83
83
|
return validationResult.isValid;
|
|
@@ -88,12 +88,12 @@ class CalculatedColumnExpressionService {
|
|
|
88
88
|
evaluateCalculatedColumnQuery(calculatedColumn, node) {
|
|
89
89
|
var _a, _b, _c, _d, _e;
|
|
90
90
|
try {
|
|
91
|
-
if (this.
|
|
91
|
+
if (this.adaptableApi.gridApi.isGroupRowNode(node)) {
|
|
92
92
|
return undefined;
|
|
93
93
|
}
|
|
94
94
|
// no validation here, this function has to be as performant as possible
|
|
95
95
|
if ((_a = calculatedColumn === null || calculatedColumn === void 0 ? void 0 : calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression) {
|
|
96
|
-
return this.
|
|
96
|
+
return this.adaptableApi.internalApi
|
|
97
97
|
.getQueryLanguageService()
|
|
98
98
|
.evaluateScalarExpression(calculatedColumn.Query.ScalarExpression, ModuleConstants_1.CalculatedColumnModuleId, node);
|
|
99
99
|
}
|
|
@@ -112,10 +112,10 @@ class CalculatedColumnExpressionService {
|
|
|
112
112
|
// if there is already an aggregated scalar, delete it (possible when editing)
|
|
113
113
|
this.destroyAggregatedScalarCalculatedColumn(calculatedColumn);
|
|
114
114
|
if ((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.AggregatedScalarExpression) {
|
|
115
|
-
const aggregationConfig = this.
|
|
115
|
+
const aggregationConfig = this.adaptableApi.internalApi
|
|
116
116
|
.getQueryLanguageService()
|
|
117
117
|
.evaluateAggregatedScalarExpression(calculatedColumn.Query.AggregatedScalarExpression, ModuleConstants_1.CalculatedColumnModuleId);
|
|
118
|
-
const aggregatedScalarCalculatedColumn = new AggregatedScalarCalculatedColumn(aggregationConfig.value, calculatedColumn, this.
|
|
118
|
+
const aggregatedScalarCalculatedColumn = new AggregatedScalarCalculatedColumn(aggregationConfig.value, calculatedColumn, this.adaptableApi);
|
|
119
119
|
this.aggregatedScalarCalculatedColumnsMap.set(calculatedColumn.Uuid, aggregatedScalarCalculatedColumn);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
@@ -128,10 +128,10 @@ class CalculatedColumnExpressionService {
|
|
|
128
128
|
}
|
|
129
129
|
exports.CalculatedColumnExpressionService = CalculatedColumnExpressionService;
|
|
130
130
|
class AggregatedScalarCalculatedColumn {
|
|
131
|
-
constructor(expressionEvaluation, calculatedColumn,
|
|
131
|
+
constructor(expressionEvaluation, calculatedColumn, adaptableApi) {
|
|
132
132
|
this.expressionEvaluation = expressionEvaluation;
|
|
133
133
|
this.calculatedColumn = calculatedColumn;
|
|
134
|
-
this.
|
|
134
|
+
this.adaptableApi = adaptableApi;
|
|
135
135
|
this.aggregationResult = this.computeAggregatedValue(expressionEvaluation);
|
|
136
136
|
// currently we support only one reducer
|
|
137
137
|
this.aggregationReducerName = Object.keys(expressionEvaluation.aggregationParams.reducers)[0];
|
|
@@ -153,7 +153,7 @@ class AggregatedScalarCalculatedColumn {
|
|
|
153
153
|
return this.expressionEvaluation.columnDependencies;
|
|
154
154
|
}
|
|
155
155
|
computeAggregatedValue(expressionEvaluation) {
|
|
156
|
-
const gridData = this.
|
|
156
|
+
const gridData = this.adaptableApi.gridApi.getGridData();
|
|
157
157
|
if (!expressionEvaluation.cumulateOver) {
|
|
158
158
|
return scalarAggregationHelper_1.aggregate(expressionEvaluation.aggregationParams, gridData);
|
|
159
159
|
}
|
|
@@ -174,7 +174,7 @@ class AggregatedScalarCalculatedColumn {
|
|
|
174
174
|
if (!expressionEvaluation.aggregationParams.groupBy) {
|
|
175
175
|
expressionEvaluation.aggregationParams.groupBy = [];
|
|
176
176
|
}
|
|
177
|
-
const gridPrimaryKey = this.
|
|
177
|
+
const gridPrimaryKey = this.adaptableApi.internalApi.getAdaptableOptions().primaryKey;
|
|
178
178
|
// !! aggregationParams mutated
|
|
179
179
|
expressionEvaluation.aggregationParams.groupBy.push({ field: gridPrimaryKey });
|
|
180
180
|
// 3. cumulate
|
|
@@ -185,7 +185,7 @@ class AggregatedScalarCalculatedColumn {
|
|
|
185
185
|
var _a, _b;
|
|
186
186
|
if ((_a = this.expressionEvaluation.aggregationParams.groupBy) === null || _a === void 0 ? void 0 : _a.length) {
|
|
187
187
|
const groupColumns = this.expressionEvaluation.aggregationParams.groupBy.map((groupByParam) => groupByParam.field);
|
|
188
|
-
const groupKeys = groupColumns.map((groupColumnName) => this.
|
|
188
|
+
const groupKeys = groupColumns.map((groupColumnName) => this.adaptableApi.gridApi.getRawValueFromRowNode(rowNode, groupColumnName));
|
|
189
189
|
return (_b = this.aggregationResult.deepMap.get(groupKeys)) === null || _b === void 0 ? void 0 : _b.reducerResults[this.aggregationReducerName];
|
|
190
190
|
}
|
|
191
191
|
return this.aggregationResult.reducerResults[this.aggregationReducerName];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
2
1
|
import { IEntitlementService } from './Interface/IEntitlementService';
|
|
3
2
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
4
3
|
import { AccessLevel } from '../../PredefinedConfig/Common/Entitlement';
|
|
4
|
+
import { AdaptableApi } from '../../../types';
|
|
5
5
|
export declare class EntitlementService implements IEntitlementService {
|
|
6
|
-
private
|
|
7
|
-
constructor(
|
|
6
|
+
private adaptableApi;
|
|
7
|
+
constructor(adaptableApi: AdaptableApi);
|
|
8
8
|
setModulesEntitlements(): void;
|
|
9
9
|
isModuleHiddenEntitlement(adaptableModule: AdaptableModule): boolean;
|
|
10
10
|
isModuleFullEntitlement(adaptableModule: AdaptableModule): boolean;
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EntitlementService = void 0;
|
|
4
4
|
class EntitlementService {
|
|
5
|
-
constructor(
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
5
|
+
constructor(adaptableApi) {
|
|
6
|
+
this.adaptableApi = adaptableApi;
|
|
7
|
+
this.adaptableApi = adaptableApi;
|
|
8
8
|
}
|
|
9
9
|
setModulesEntitlements() {
|
|
10
|
-
this.
|
|
10
|
+
this.adaptableApi.internalApi
|
|
11
|
+
.getModuleService()
|
|
12
|
+
.getModuleCollection()
|
|
13
|
+
.forEach((module) => {
|
|
11
14
|
module.setModuleEntitlement();
|
|
12
15
|
});
|
|
13
16
|
}
|
|
@@ -21,15 +24,16 @@ class EntitlementService {
|
|
|
21
24
|
return this.getEntitlementAccessLevelForModule(adaptableModule) == 'ReadOnly';
|
|
22
25
|
}
|
|
23
26
|
getEntitlementAccessLevelForModule(adaptableModule) {
|
|
24
|
-
let
|
|
27
|
+
let adaptableOptions = this.adaptableApi.internalApi.getAdaptableOptions();
|
|
28
|
+
let entitlementOptions = adaptableOptions.entitlementOptions;
|
|
25
29
|
if (entitlementOptions) {
|
|
26
30
|
const defaultAccessLevel = typeof entitlementOptions.defaultAccessLevel === 'function'
|
|
27
|
-
? entitlementOptions.defaultAccessLevel(
|
|
31
|
+
? entitlementOptions.defaultAccessLevel(adaptableOptions.userName, adaptableOptions.adaptableId)
|
|
28
32
|
: entitlementOptions.defaultAccessLevel;
|
|
29
33
|
const moduleEntitlements = entitlementOptions.moduleEntitlements;
|
|
30
34
|
if (moduleEntitlements) {
|
|
31
35
|
if (typeof moduleEntitlements === 'function') {
|
|
32
|
-
const dynamicModuleEntitlement = moduleEntitlements(adaptableModule,
|
|
36
|
+
const dynamicModuleEntitlement = moduleEntitlements(adaptableModule, adaptableOptions.userName, adaptableOptions.adaptableId, defaultAccessLevel);
|
|
33
37
|
return dynamicModuleEntitlement !== null && dynamicModuleEntitlement !== void 0 ? dynamicModuleEntitlement : defaultAccessLevel;
|
|
34
38
|
}
|
|
35
39
|
else {
|
|
@@ -48,7 +52,7 @@ class EntitlementService {
|
|
|
48
52
|
if (this.isModuleHiddenEntitlement('GridInfo')) {
|
|
49
53
|
return false;
|
|
50
54
|
}
|
|
51
|
-
return this.
|
|
55
|
+
return this.adaptableApi.internalApi
|
|
52
56
|
.getAdaptableOptions()
|
|
53
57
|
.userInterfaceOptions.gridInfoSections.includes(section);
|
|
54
58
|
}
|
|
@@ -8,7 +8,7 @@ export interface IReportService extends IAdaptableService {
|
|
|
8
8
|
IsSystemReport(reportName: string): boolean;
|
|
9
9
|
IsSystemReportActive(reportName: SystemReportName): boolean;
|
|
10
10
|
IsSystemExportDestinationActive(exportDestination: SystemExportDestination): boolean;
|
|
11
|
-
GetReportColumnScopeShortDescription(report: Report): string;
|
|
11
|
+
GetReportColumnScopeShortDescription(report: Report): string[];
|
|
12
12
|
GetReportColumnScopeLongDescription(report: Report): string;
|
|
13
13
|
GetReportExpressionDescription(Report: Report, cols: AdaptableColumn[]): string;
|
|
14
14
|
GetReportColumnsForReport(report: Report): AdaptableColumn[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GridInfoOptions, IMetamodelService } from './Interface/IMetamodelService';
|
|
2
|
-
import {
|
|
2
|
+
import { AdaptableApi } from '../../../types';
|
|
3
3
|
export declare class MetamodelService implements IMetamodelService {
|
|
4
|
-
private
|
|
4
|
+
private adaptableApi;
|
|
5
5
|
private gridInfoOptions;
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(adaptableApi: AdaptableApi);
|
|
7
7
|
getGridInfoOptions(): GridInfoOptions;
|
|
8
8
|
private buildGridInfoOptions;
|
|
9
9
|
private mapGridInfoContainerItems;
|
|
@@ -4,10 +4,10 @@ exports.MetamodelService = void 0;
|
|
|
4
4
|
const adaptable_metamodel_1 = require("../../metamodel/adaptable.metamodel");
|
|
5
5
|
const DefaultAdaptableOptions_1 = require("../Defaults/DefaultAdaptableOptions");
|
|
6
6
|
class MetamodelService {
|
|
7
|
-
constructor(
|
|
8
|
-
this.
|
|
7
|
+
constructor(adaptableApi) {
|
|
8
|
+
this.adaptableApi = adaptableApi;
|
|
9
9
|
this.gridInfoOptions = new Map();
|
|
10
|
-
this.
|
|
10
|
+
this.adaptableApi = adaptableApi;
|
|
11
11
|
this.gridInfoOptions = this.buildGridInfoOptions();
|
|
12
12
|
}
|
|
13
13
|
getGridInfoOptions() {
|
|
@@ -17,7 +17,7 @@ class MetamodelService {
|
|
|
17
17
|
const gridInfoOptions = new Map();
|
|
18
18
|
const adaptableMetamodel = adaptable_metamodel_1.ADAPTABLE_METAMODEL;
|
|
19
19
|
const adaptableOptionsMetamodel = adaptableMetamodel['AdaptableOptions'];
|
|
20
|
-
const adaptableOptionsValues = this.
|
|
20
|
+
const adaptableOptionsValues = this.adaptableApi.internalApi.getAdaptableOptions();
|
|
21
21
|
const adaptableOptionsDefaultValues = DefaultAdaptableOptions_1.DefaultAdaptableOptions;
|
|
22
22
|
if (!adaptableOptionsMetamodel) {
|
|
23
23
|
// should never happen
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
2
1
|
import { AdaptableModule } from '../../types';
|
|
3
2
|
import { IModule, ModuleInfo, IModuleCollection } from '../../Strategy/Interface/IModule';
|
|
4
3
|
import { TeamSharingImportInfo } from '../../PredefinedConfig/TeamSharingState';
|
|
5
4
|
import { AdaptableObject } from '../../PredefinedConfig/Common/AdaptableObject';
|
|
6
5
|
import { IModuleService } from './Interface/IModuleService';
|
|
6
|
+
import { AdaptableApi } from '../../../types';
|
|
7
7
|
export declare class ModuleService implements IModuleService {
|
|
8
|
-
private
|
|
9
|
-
constructor(
|
|
8
|
+
private adaptableApi;
|
|
9
|
+
constructor(adaptableApi: AdaptableApi);
|
|
10
10
|
createModuleMenus(): void;
|
|
11
11
|
isModuleAvailable(adaptableModule: AdaptableModule): boolean;
|
|
12
12
|
isModuleEditable(adaptableModule: AdaptableModule): boolean;
|
|
@@ -5,14 +5,14 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const Helper_1 = tslib_1.__importDefault(require("../Helpers/Helper"));
|
|
6
6
|
const DocumentationLinkConstants_1 = require("../Constants/DocumentationLinkConstants");
|
|
7
7
|
class ModuleService {
|
|
8
|
-
constructor(
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
8
|
+
constructor(adaptableApi) {
|
|
9
|
+
this.adaptableApi = adaptableApi;
|
|
10
|
+
this.adaptableApi = adaptableApi;
|
|
11
11
|
}
|
|
12
12
|
createModuleMenus() {
|
|
13
13
|
const dropdownMenuItems = [];
|
|
14
14
|
const buttonMenuItems = [];
|
|
15
|
-
this.
|
|
15
|
+
this.getModuleCollection().forEach((module) => {
|
|
16
16
|
const dropdownMenuItem = module.addModuleMenuItem('ModuleMenu');
|
|
17
17
|
if (Helper_1.default.objectExists(dropdownMenuItem)) {
|
|
18
18
|
if (dropdownMenuItems.findIndex((m) => m.module == dropdownMenuItem.module) == -1) {
|
|
@@ -27,39 +27,39 @@ class ModuleService {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
// store the main menu as we will re-use (and it never changes)
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
30
|
+
this.adaptableApi.internalApi.setModuleDropdownMenuItems(dropdownMenuItems);
|
|
31
|
+
this.adaptableApi.internalApi.setModuleButtonMenuItems(buttonMenuItems);
|
|
32
32
|
}
|
|
33
33
|
isModuleAvailable(adaptableModule) {
|
|
34
|
-
let module = this.
|
|
34
|
+
let module = this.getModuleCollection().get(adaptableModule);
|
|
35
35
|
if (!module) {
|
|
36
36
|
return false;
|
|
37
37
|
}
|
|
38
38
|
return module.isModuleAvailable();
|
|
39
39
|
}
|
|
40
40
|
isModuleEditable(adaptableModule) {
|
|
41
|
-
let module = this.
|
|
41
|
+
let module = this.getModuleCollection().get(adaptableModule);
|
|
42
42
|
if (!module) {
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
45
|
return module.isModuleEditable();
|
|
46
46
|
}
|
|
47
47
|
getTeamSharingAction(adaptableModule) {
|
|
48
|
-
let module = this.
|
|
48
|
+
let module = this.getModuleCollection().get(adaptableModule);
|
|
49
49
|
if (!module) {
|
|
50
50
|
return undefined;
|
|
51
51
|
}
|
|
52
52
|
return module.getTeamSharingAction();
|
|
53
53
|
}
|
|
54
54
|
getModuleById(adaptableModule) {
|
|
55
|
-
return this.
|
|
55
|
+
return this.getModuleCollection().get(adaptableModule);
|
|
56
56
|
}
|
|
57
57
|
getModuleInfoByModule(adaptableModule) {
|
|
58
58
|
const module = this.getModuleById(adaptableModule);
|
|
59
59
|
return module ? module.moduleInfo : undefined;
|
|
60
60
|
}
|
|
61
61
|
getModuleInfoByFriendlyName(friendlyName) {
|
|
62
|
-
for (let module of this.
|
|
62
|
+
for (let module of this.getModuleCollection().values()) {
|
|
63
63
|
let moduleInfo = module.moduleInfo;
|
|
64
64
|
if (moduleInfo && moduleInfo.FriendlyName == friendlyName) {
|
|
65
65
|
return moduleInfo;
|
|
@@ -72,7 +72,7 @@ class ModuleService {
|
|
|
72
72
|
return (_a = this.getModuleById(adaptableModule)) === null || _a === void 0 ? void 0 : _a.getPopupMaxWidth();
|
|
73
73
|
}
|
|
74
74
|
getModuleCollection() {
|
|
75
|
-
return this.
|
|
75
|
+
return this.adaptableApi.internalApi.getModules();
|
|
76
76
|
}
|
|
77
77
|
getModuleDocumentationPageByModule(adaptableModule) {
|
|
78
78
|
let url = `${DocumentationLinkConstants_1.HOST_URL_DOCS}/`;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { IQueryLanguageService } from './Interface/IQueryLanguageService';
|
|
2
|
-
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
3
2
|
import { Observable } from 'rxjs';
|
|
4
3
|
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
5
4
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
6
5
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
7
6
|
import { ModuleExpressionFunctions } from '../../AdaptableOptions/AdaptableQLOptions';
|
|
8
7
|
import { AggregationParameter } from '../ExpressionFunctions/aggregatedScalarExpressionFunctions';
|
|
8
|
+
import { AdaptableApi } from '../../../types';
|
|
9
9
|
export declare class QueryLanguageService implements IQueryLanguageService {
|
|
10
|
-
private
|
|
10
|
+
private adaptableApi;
|
|
11
11
|
private cacheBooleanValidation;
|
|
12
12
|
private cacheObservableValidation;
|
|
13
13
|
private cacheAggregatedBooleanValidation;
|
|
14
14
|
private cacheAggregatedScalarValidation;
|
|
15
15
|
private cacheModuleSpecificExpressionFunctions;
|
|
16
|
-
constructor(
|
|
16
|
+
constructor(adaptableApi: AdaptableApi);
|
|
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;
|
|
@@ -6,8 +6,8 @@ const parser = tslib_1.__importStar(require("../../parser/src"));
|
|
|
6
6
|
const rxjs_1 = require("rxjs");
|
|
7
7
|
const LoggingHelper_1 = require("../Helpers/LoggingHelper");
|
|
8
8
|
class QueryLanguageService {
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
9
|
+
constructor(adaptableApi) {
|
|
10
|
+
this.adaptableApi = adaptableApi;
|
|
11
11
|
this.cacheBooleanValidation = new Map();
|
|
12
12
|
this.cacheObservableValidation = new Map();
|
|
13
13
|
this.cacheAggregatedBooleanValidation = new Map();
|
|
@@ -19,7 +19,7 @@ class QueryLanguageService {
|
|
|
19
19
|
const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
|
|
20
20
|
return parser.evaluate(expression, {
|
|
21
21
|
node: rowNode,
|
|
22
|
-
api: this.
|
|
22
|
+
api: this.adaptableApi,
|
|
23
23
|
functions: booleanAndScalarFunctions,
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -31,7 +31,7 @@ class QueryLanguageService {
|
|
|
31
31
|
const aggregatedScalarFunctions = this.getModuleExpressionFunctions(module).aggregatedScalarFunctions;
|
|
32
32
|
return parser.evaluate(expression, {
|
|
33
33
|
node: null,
|
|
34
|
-
api: this.
|
|
34
|
+
api: this.adaptableApi,
|
|
35
35
|
functions: aggregatedScalarFunctions,
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -40,7 +40,7 @@ class QueryLanguageService {
|
|
|
40
40
|
const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
|
|
41
41
|
const reactiveExpression$ = parser.evaluate(reactiveExpression, {
|
|
42
42
|
node: reactiveExpression,
|
|
43
|
-
api: this.
|
|
43
|
+
api: this.adaptableApi,
|
|
44
44
|
functions: moduleExpressionFunctions.observableFunctions,
|
|
45
45
|
whereClauseFunctions: booleanAndScalarFunctions,
|
|
46
46
|
});
|
|
@@ -51,7 +51,7 @@ class QueryLanguageService {
|
|
|
51
51
|
const booleanAndScalarFunctions = this.getBooleanAndScalarFunctions(moduleExpressionFunctions);
|
|
52
52
|
const aggregationExpression$ = parser.evaluate(aggregationExpression, {
|
|
53
53
|
node: aggregationExpression,
|
|
54
|
-
api: this.
|
|
54
|
+
api: this.adaptableApi,
|
|
55
55
|
functions: moduleExpressionFunctions.aggregatedBooleanFunctions,
|
|
56
56
|
whereClauseFunctions: booleanAndScalarFunctions,
|
|
57
57
|
});
|
|
@@ -75,7 +75,7 @@ class QueryLanguageService {
|
|
|
75
75
|
}
|
|
76
76
|
const force = (_a = config === null || config === void 0 ? void 0 : config.force) !== null && _a !== void 0 ? _a : false;
|
|
77
77
|
// get searchOptions to see if validation should be performed
|
|
78
|
-
if (!this.
|
|
78
|
+
if (!this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
79
79
|
.performExpressionValidation &&
|
|
80
80
|
!force) {
|
|
81
81
|
const result = { isValid: true, errorMessage: '' };
|
|
@@ -103,7 +103,7 @@ class QueryLanguageService {
|
|
|
103
103
|
return result;
|
|
104
104
|
}
|
|
105
105
|
// evaluating the expression is the only way to catch circular named query references
|
|
106
|
-
let firstRowNode = this.
|
|
106
|
+
let firstRowNode = this.adaptableApi.gridApi.getFirstRowNode();
|
|
107
107
|
this.evaluateBooleanExpression(expression, module, firstRowNode);
|
|
108
108
|
const result = {
|
|
109
109
|
isValid: true,
|
|
@@ -243,15 +243,15 @@ class QueryLanguageService {
|
|
|
243
243
|
if (!module) {
|
|
244
244
|
LoggingHelper_1.LogAdaptableInfo(`QueryLanguageService.getModuleExpressionFunctions() was called with an undefined 'module' param, this should never happen`);
|
|
245
245
|
return {
|
|
246
|
-
booleanFunctions: this.
|
|
246
|
+
booleanFunctions: this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
247
247
|
.defaultBooleanFunctions,
|
|
248
|
-
scalarFunctions: this.
|
|
248
|
+
scalarFunctions: this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
249
249
|
.defaultScalarFunctions,
|
|
250
|
-
observableFunctions: this.
|
|
250
|
+
observableFunctions: this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
251
251
|
.defaultObservableFunctions,
|
|
252
|
-
aggregatedBooleanFunctions: this.
|
|
252
|
+
aggregatedBooleanFunctions: this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
253
253
|
.defaultAggregatedBooleanFunctions,
|
|
254
|
-
aggregatedScalarFunctions: this.
|
|
254
|
+
aggregatedScalarFunctions: this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
255
255
|
.defaultAggregatedScalarFunctions,
|
|
256
256
|
};
|
|
257
257
|
}
|
|
@@ -259,17 +259,18 @@ class QueryLanguageService {
|
|
|
259
259
|
if (cachedResult) {
|
|
260
260
|
return cachedResult;
|
|
261
261
|
}
|
|
262
|
-
const moduleSpecificOptions = (_b = (_a = this.
|
|
262
|
+
const moduleSpecificOptions = (_b = (_a = this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
263
263
|
.moduleExpressionFunctions) === null || _a === void 0 ? void 0 : _a[module]) !== null && _b !== void 0 ? _b : {};
|
|
264
264
|
const moduleSpecificFunctions = {
|
|
265
|
-
booleanFunctions: (_c = moduleSpecificOptions.booleanFunctions) !== null && _c !== void 0 ? _c : this.
|
|
265
|
+
booleanFunctions: (_c = moduleSpecificOptions.booleanFunctions) !== null && _c !== void 0 ? _c : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
266
266
|
.defaultBooleanFunctions,
|
|
267
|
-
scalarFunctions: (_d = moduleSpecificOptions.scalarFunctions) !== null && _d !== void 0 ? _d : this.
|
|
268
|
-
|
|
267
|
+
scalarFunctions: (_d = moduleSpecificOptions.scalarFunctions) !== null && _d !== void 0 ? _d : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
268
|
+
.defaultScalarFunctions,
|
|
269
|
+
observableFunctions: (_e = moduleSpecificOptions.observableFunctions) !== null && _e !== void 0 ? _e : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
269
270
|
.defaultObservableFunctions,
|
|
270
|
-
aggregatedBooleanFunctions: (_f = moduleSpecificOptions.aggregatedBooleanFunctions) !== null && _f !== void 0 ? _f : this.
|
|
271
|
+
aggregatedBooleanFunctions: (_f = moduleSpecificOptions.aggregatedBooleanFunctions) !== null && _f !== void 0 ? _f : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
271
272
|
.defaultAggregatedBooleanFunctions,
|
|
272
|
-
aggregatedScalarFunctions: (_g = moduleSpecificOptions.aggregatedScalarFunctions) !== null && _g !== void 0 ? _g : this.
|
|
273
|
+
aggregatedScalarFunctions: (_g = moduleSpecificOptions.aggregatedScalarFunctions) !== null && _g !== void 0 ? _g : this.adaptableApi.internalApi.getAdaptableOptions().adaptableQLOptions.expressionOptions
|
|
273
274
|
.defaultAggregatedScalarFunctions,
|
|
274
275
|
};
|
|
275
276
|
this.cacheModuleSpecificExpressionFunctions.set(module, moduleSpecificFunctions);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
2
1
|
import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
|
|
3
2
|
import { Report, ReportData, SystemReportName } from '../../PredefinedConfig/ExportState';
|
|
4
3
|
import { IReportService } from './Interface/IReportService';
|
|
5
4
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
6
5
|
import { SystemExportDestination } from '../../AdaptableOptions/ExportOptions';
|
|
6
|
+
import { AdaptableApi } from '../../../types';
|
|
7
7
|
export declare class ReportService implements IReportService {
|
|
8
|
-
private
|
|
9
|
-
constructor(
|
|
8
|
+
private adaptableApi;
|
|
9
|
+
constructor(adaptableApi: AdaptableApi);
|
|
10
10
|
CreateSystemReport(systemReportName: SystemReportName): Report;
|
|
11
11
|
IsSystemReport(reportName: string): boolean;
|
|
12
12
|
IsSystemReportActive(reportName: SystemReportName): boolean;
|
|
13
13
|
IsSystemExportDestinationActive(exportDestination: SystemExportDestination): boolean;
|
|
14
|
-
GetReportColumnScopeShortDescription(report: Report): string;
|
|
14
|
+
GetReportColumnScopeShortDescription(report: Report): string[];
|
|
15
15
|
GetReportColumnScopeLongDescription(report: Report): string;
|
|
16
16
|
GetReportExpressionDescription(report: Report, cols: AdaptableColumn[]): string;
|
|
17
17
|
GetReportColumnsForReport(report: Report, includePrimaryKey?: boolean): AdaptableColumn[];
|