@adaptabletools/adaptable 11.1.4 → 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 +83 -83
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/Api/Implementation/InternalApiImpl.d.ts +4 -0
- package/src/Api/Implementation/InternalApiImpl.js +9 -0
- 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/ThemeApi.d.ts +4 -0
- package/src/Strategy/AlertModule.js +1 -3
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/Utilities/getExportColumnsViewItems.js +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
- 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/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/DataChangeHistory/DataChangeHistoryPopup.js +1 -3
- package/src/View/GridInfo/AdaptableObjectsSummary.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
- package/src/agGrid/Adaptable.js +9 -9
- package/src/components/StylePreview.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +6 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.5",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
package/publishTimestamp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: 1649336531486;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
|
@@ -33,6 +33,7 @@ import { AlertButtonForm, AlertDefinition } from '../../PredefinedConfig/AlertSt
|
|
|
33
33
|
import { AdaptableMessageType } from '../../PredefinedConfig/Common/AdaptableMessageType';
|
|
34
34
|
import { AdaptableFrameworkComponent } from '../../AdaptableOptions/AdaptableFrameworkComponent';
|
|
35
35
|
import { IMetamodelService } from '../../Utilities/Services/Interface/IMetamodelService';
|
|
36
|
+
import { IModuleCollection } from '../../Strategy/Interface/IModule';
|
|
36
37
|
export declare class InternalApiImpl extends ApiBase implements InternalApi {
|
|
37
38
|
getSystemState(): SystemState;
|
|
38
39
|
getAdaptableFormFromAlertForm(alertForm: string | AlertButtonForm, context: any, defaultMessageType?: AdaptableMessageType): (Omit<AdaptableForm<AlertButtonContext>, 'buttons'> & {
|
|
@@ -95,8 +96,11 @@ export declare class InternalApiImpl extends ApiBase implements InternalApi {
|
|
|
95
96
|
getAlertService(): IAlertService;
|
|
96
97
|
getTeamSharingService(): ITeamSharingService;
|
|
97
98
|
getMetamodelService(): IMetamodelService;
|
|
99
|
+
getModules(): IModuleCollection;
|
|
98
100
|
getModuleFriendlyName(adaptableModule: AdaptableModule): string;
|
|
99
101
|
runModuleInAdaptableQL(adaptableQLModule: AdaptableQLModule): boolean;
|
|
102
|
+
forAllRowNodesDo(func: (rowNode: RowNode) => void): void;
|
|
103
|
+
forAllVisibleRowNodesDo(func: (rowNode: RowNode) => void): void;
|
|
100
104
|
buildStandaloneColumnHeader(column: AdaptableColumn): AdaptableMenuItem[];
|
|
101
105
|
clearFlashingCellState(): void;
|
|
102
106
|
clearUpdatedRowState(): void;
|
|
@@ -270,6 +270,9 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
|
|
|
270
270
|
getMetamodelService() {
|
|
271
271
|
return this.adaptable.MetamodelService;
|
|
272
272
|
}
|
|
273
|
+
getModules() {
|
|
274
|
+
return this.adaptable.adaptableModules;
|
|
275
|
+
}
|
|
273
276
|
getModuleFriendlyName(adaptableModule) {
|
|
274
277
|
var _a, _b;
|
|
275
278
|
return ((_b = (_a = this.adaptable.ModuleService.getModuleInfoByModule(adaptableModule)) === null || _a === void 0 ? void 0 : _a.FriendlyName) !== null && _b !== void 0 ? _b : adaptableModule);
|
|
@@ -278,6 +281,12 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
|
|
|
278
281
|
const adaptableQLModules = this.getAdaptableQLOptions().externallyEvaluatedModules;
|
|
279
282
|
return !adaptableQLModules.includes(adaptableQLModule);
|
|
280
283
|
}
|
|
284
|
+
forAllRowNodesDo(func) {
|
|
285
|
+
this.adaptable.forAllRowNodesDo(func);
|
|
286
|
+
}
|
|
287
|
+
forAllVisibleRowNodesDo(func) {
|
|
288
|
+
this.adaptable.forAllVisibleRowNodesDo(func);
|
|
289
|
+
}
|
|
281
290
|
buildStandaloneColumnHeader(column) {
|
|
282
291
|
return this.adaptable.buildStandaloneColumnHeader(column);
|
|
283
292
|
}
|
|
@@ -62,5 +62,8 @@ class ThemeApiImpl extends ApiBase_1.ApiBase {
|
|
|
62
62
|
showThemePopup() {
|
|
63
63
|
this.showModulePopup(ModuleConstants.ThemeModuleId);
|
|
64
64
|
}
|
|
65
|
+
getAgGridCurrentThemeName() {
|
|
66
|
+
return this.adaptable.getAgGridCurrentThemeName();
|
|
67
|
+
}
|
|
65
68
|
}
|
|
66
69
|
exports.ThemeApiImpl = ThemeApiImpl;
|
package/src/Api/InternalApi.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ import { AlertButtonForm } from '../PredefinedConfig/AlertState';
|
|
|
32
32
|
import { AdaptableFrameworkComponent } from '../AdaptableOptions/AdaptableFrameworkComponent';
|
|
33
33
|
import { IMetamodelService } from '../Utilities/Services/Interface/IMetamodelService';
|
|
34
34
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
35
|
+
import { IModuleCollection } from '../Strategy/Interface/IModule';
|
|
35
36
|
/**
|
|
36
37
|
* This set of api methods is designed for **internal use of Adaptable** only.
|
|
37
38
|
*
|
|
@@ -99,8 +100,11 @@ export interface InternalApi {
|
|
|
99
100
|
getAlertService(): IAlertService;
|
|
100
101
|
getTeamSharingService(): ITeamSharingService;
|
|
101
102
|
getMetamodelService(): IMetamodelService;
|
|
103
|
+
getModules(): IModuleCollection;
|
|
102
104
|
getModuleFriendlyName(adaptableModule: AdaptableModule): string;
|
|
103
105
|
runModuleInAdaptableQL(adaptableQLModule: AdaptableQLModule): boolean;
|
|
106
|
+
forAllRowNodesDo(func: (rowNode: RowNode) => void): void;
|
|
107
|
+
forAllVisibleRowNodesDo(func: (rowNode: RowNode) => void): void;
|
|
104
108
|
buildStandaloneColumnHeader(column: AdaptableColumn): AdaptableMenuItem[];
|
|
105
109
|
getCustomSortComparer(column: AdaptableColumn): ColumnValuesComparer | undefined;
|
|
106
110
|
clearFlashingCellState(): void;
|
package/src/Api/ThemeApi.d.ts
CHANGED
|
@@ -156,9 +156,7 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
156
156
|
var _a;
|
|
157
157
|
// the row node data is most probably stale because the reactive queries buffer the changed data
|
|
158
158
|
// so we have to refresh it
|
|
159
|
-
reactiveAlertInfo.dataChangeLogEntry.rowNode = this.api.
|
|
160
|
-
.getAdaptableInstance()
|
|
161
|
-
.getRowNodeForPrimaryKey(reactiveAlertInfo.dataChangeLogEntry.primaryKeyValue);
|
|
159
|
+
reactiveAlertInfo.dataChangeLogEntry.rowNode = this.api.gridApi.getRowNodeForPrimaryKey(reactiveAlertInfo.dataChangeLogEntry.primaryKeyValue);
|
|
162
160
|
reactiveAlertInfo.dataChangeLogEntry.rowData = (_a = reactiveAlertInfo.dataChangeLogEntry.rowNode) === null || _a === void 0 ? void 0 : _a.data;
|
|
163
161
|
if (reactiveAlertInfo.type === 'alert') {
|
|
164
162
|
this.showAlertForDefinitions(reactiveAlertInfo.dataChangeLogEntry, [
|
|
@@ -77,7 +77,7 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
77
77
|
values: [calculateColumn.FriendlyName],
|
|
78
78
|
},
|
|
79
79
|
getExpressionViewItems_1.getExpressionViewItems(calculateColumn.Query),
|
|
80
|
-
];
|
|
80
|
+
].filter(Boolean);
|
|
81
81
|
if (ArrayExtensions_1.default.IsNotNullOrEmpty(settingsTags)) {
|
|
82
82
|
items.push({
|
|
83
83
|
name: 'Settings',
|
|
@@ -4,6 +4,6 @@ exports.getExportColumnsViewItems = void 0;
|
|
|
4
4
|
exports.getExportColumnsViewItems = (report, api) => {
|
|
5
5
|
return {
|
|
6
6
|
name: 'Columns',
|
|
7
|
-
values: [api.internalApi.getReportService().GetReportColumnScopeShortDescription(report)],
|
|
7
|
+
values: [...api.internalApi.getReportService().GetReportColumnScopeShortDescription(report)],
|
|
8
8
|
};
|
|
9
9
|
};
|
|
@@ -195,7 +195,7 @@ const getSumAggregation$ = (source$, initialSum) => {
|
|
|
195
195
|
};
|
|
196
196
|
const getColumnValueSum = (column, context) => {
|
|
197
197
|
let sum = 0;
|
|
198
|
-
context.api.internalApi.
|
|
198
|
+
context.api.internalApi.forAllRowNodesDo((rowNode) => {
|
|
199
199
|
var _a;
|
|
200
200
|
// if there is a WHERE clause defined, check if the current rowNode satisfies the condition
|
|
201
201
|
if (context.filterFn && !context.filterFn(rowNode)) {
|
|
@@ -233,7 +233,7 @@ const getDataChangedInfoStub = (context) => {
|
|
|
233
233
|
}
|
|
234
234
|
else {
|
|
235
235
|
// if there is a WHERE clause defined, find the first rowNode which satisfies the condition
|
|
236
|
-
context.api.internalApi.
|
|
236
|
+
context.api.internalApi.forAllRowNodesDo((rowNode) => {
|
|
237
237
|
if (!rowNodeStub) {
|
|
238
238
|
if (context.filterFn(rowNode)) {
|
|
239
239
|
rowNodeStub = rowNode;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { IAlertService } from './Interface/IAlertService';
|
|
2
2
|
import { AlertDefinition } from '../../PredefinedConfig/AlertState';
|
|
3
3
|
import { EmitterCallback } from '../Emitter';
|
|
4
|
-
import {
|
|
4
|
+
import { AdaptableApi } from '../../types';
|
|
5
5
|
export declare class AlertService implements IAlertService {
|
|
6
|
-
private
|
|
6
|
+
private adaptableApi;
|
|
7
7
|
private emitter;
|
|
8
8
|
private reactiveAlertsMap;
|
|
9
|
-
constructor(
|
|
9
|
+
constructor(adaptableApi: AdaptableApi);
|
|
10
10
|
onReactiveAlertTriggered: (callback: EmitterCallback) => (() => void);
|
|
11
11
|
createReactiveAlert(alertDefinition: AlertDefinition): void;
|
|
12
12
|
deleteReactiveAlert(alertDefinition: AlertDefinition): void;
|
|
@@ -7,8 +7,8 @@ const rxjs_1 = require("rxjs");
|
|
|
7
7
|
const LoggingHelper_1 = require("../Helpers/LoggingHelper");
|
|
8
8
|
const ModuleConstants_1 = require("../Constants/ModuleConstants");
|
|
9
9
|
class AlertService {
|
|
10
|
-
constructor(
|
|
11
|
-
this.
|
|
10
|
+
constructor(adaptableApi) {
|
|
11
|
+
this.adaptableApi = adaptableApi;
|
|
12
12
|
this.reactiveAlertsMap = new Map();
|
|
13
13
|
this.onReactiveAlertTriggered = (callback) => {
|
|
14
14
|
return this.emitter.on('ReactiveAlertTriggered', callback);
|
|
@@ -58,17 +58,17 @@ class AlertService {
|
|
|
58
58
|
}
|
|
59
59
|
isValidExpression(rule) {
|
|
60
60
|
return rule.ObservableExpression
|
|
61
|
-
? this.
|
|
61
|
+
? this.adaptableApi.queryLanguageApi.isValidObservableExpression(rule.ObservableExpression, ModuleConstants_1.AlertModuleId, `Invalid Alert rule with observable expression `)
|
|
62
62
|
: rule.AggregatedBooleanExpression
|
|
63
|
-
? this.
|
|
63
|
+
? this.adaptableApi.queryLanguageApi.isValidAggregatedBooleanExpression(rule.AggregatedBooleanExpression, ModuleConstants_1.AlertModuleId, `Invalid Alert rule with aggregation expression `)
|
|
64
64
|
: false;
|
|
65
65
|
}
|
|
66
66
|
evaluateReactiveExpression(rule) {
|
|
67
67
|
return rule.ObservableExpression
|
|
68
|
-
? this.
|
|
68
|
+
? this.adaptableApi.internalApi
|
|
69
69
|
.getQueryLanguageService()
|
|
70
70
|
.evaluateObservableExpression(rule.ObservableExpression, ModuleConstants_1.AlertModuleId)
|
|
71
|
-
: this.
|
|
71
|
+
: this.adaptableApi.internalApi
|
|
72
72
|
.getQueryLanguageService()
|
|
73
73
|
.evaluateAggregatedBooleanExpression(rule.AggregatedBooleanExpression, ModuleConstants_1.AlertModuleId);
|
|
74
74
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
2
1
|
import { ICalculatedColumnExpressionService } from './Interface/ICalculatedColumnExpressionService';
|
|
3
2
|
import { RowNode } from '@ag-grid-community/all-modules';
|
|
4
3
|
import { AdaptableCalculatedColumnQuery, CalculatedColumn } from '../../PredefinedConfig/CalculatedColumnState';
|
|
4
|
+
import { AdaptableApi } from '../../../types';
|
|
5
5
|
export declare class CalculatedColumnExpressionService implements ICalculatedColumnExpressionService {
|
|
6
|
-
private
|
|
6
|
+
private adaptableApi;
|
|
7
7
|
private aggregatedScalarCalculatedColumnsMap;
|
|
8
|
-
constructor(
|
|
8
|
+
constructor(adaptableApi: AdaptableApi);
|
|
9
9
|
getCalculatedColumnDataType(calculatedColumnQuery: AdaptableCalculatedColumnQuery): 'String' | 'Number' | 'Boolean' | 'Date';
|
|
10
10
|
isCalculatedColumnQueryValid(calculatedColumnQuery: AdaptableCalculatedColumnQuery): boolean;
|
|
11
11
|
evaluateCalculatedColumnQuery(calculatedColumn: CalculatedColumn, node: RowNode): any;
|
|
@@ -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;
|