@finos/legend-query-builder 4.11.4 → 4.11.6
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilder.js +1 -1
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/execution-plan/SQLExecutionNodeViewer.js +1 -1
- package/lib/components/execution-plan/SQLExecutionNodeViewer.js.map +1 -1
- package/lib/components/{QueryBuilderResultPanel.d.ts → result/QueryBuilderResultPanel.d.ts} +1 -2
- package/lib/components/result/QueryBuilderResultPanel.d.ts.map +1 -0
- package/lib/components/result/QueryBuilderResultPanel.js +185 -0
- package/lib/components/result/QueryBuilderResultPanel.js.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts +24 -0
- package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSGridResult.js +204 -0
- package/lib/components/result/tds/QueryBuilderTDSGridResult.js.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSResultShared.d.ts +37 -0
- package/lib/components/result/tds/QueryBuilderTDSResultShared.d.ts.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSResultShared.js +251 -0
- package/lib/components/result/tds/QueryBuilderTDSResultShared.js.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.d.ts +24 -0
- package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.d.ts.map +1 -0
- package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js +224 -0
- package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js.map +1 -0
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderResultState.d.ts +5 -1
- package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderResultState.js.map +1 -1
- package/package.json +3 -3
- package/src/components/QueryBuilder.tsx +1 -1
- package/src/components/execution-plan/SQLExecutionNodeViewer.tsx +1 -1
- package/src/components/result/QueryBuilderResultPanel.tsx +569 -0
- package/src/components/result/tds/QueryBuilderTDSGridResult.tsx +346 -0
- package/src/components/result/tds/QueryBuilderTDSResultShared.tsx +502 -0
- package/src/components/result/tds/QueryBuilderTDSSimpleGridResult.tsx +387 -0
- package/src/stores/QueryBuilderResultState.ts +12 -1
- package/tsconfig.json +4 -1
- package/lib/components/QueryBuilderResultPanel.d.ts.map +0 -1
- package/lib/components/QueryBuilderResultPanel.js +0 -633
- package/lib/components/QueryBuilderResultPanel.js.map +0 -1
- package/src/components/QueryBuilderResultPanel.tsx +0 -1412
@@ -0,0 +1,37 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
/// <reference types="react" resolution-mode="require"/>
|
17
|
+
import { type TDSExecutionResult, type ExecutionResult } from '@finos/legend-graph';
|
18
|
+
import { type ApplicationStore, type LegendApplicationConfig, type LegendApplicationPlugin, type LegendApplicationPluginManager } from '@finos/legend-application';
|
19
|
+
import type { QueryBuilderTDSState } from '../../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
|
20
|
+
import { type DataGridCellRendererParams } from '@finos/legend-lego/data-grid';
|
21
|
+
import type { QueryBuilderResultState, QueryBuilderTDSResultCellData, QueryBuilderTDSRowDataType } from '../../../stores/QueryBuilderResultState.js';
|
22
|
+
export declare const tryToFormatSql: (sql: string) => string;
|
23
|
+
export declare const getExecutedSqlFromExecutionResult: (execResult: ExecutionResult) => string | undefined;
|
24
|
+
export declare const getAggregationTDSColumnCustomizations: (result: TDSExecutionResult, columnName: string) => object | undefined;
|
25
|
+
export declare const getRowDataFromExecutionResult: (executionResult: TDSExecutionResult) => QueryBuilderTDSRowDataType[];
|
26
|
+
export type IQueryRendererParamsWithGridType = DataGridCellRendererParams & {
|
27
|
+
resultState: QueryBuilderResultState;
|
28
|
+
tdsExecutionResult: TDSExecutionResult;
|
29
|
+
};
|
30
|
+
export declare const filterByOrOutValues: (applicationStore: ApplicationStore<LegendApplicationConfig, LegendApplicationPluginManager<LegendApplicationPlugin>>, data: QueryBuilderTDSResultCellData | null, isFilterBy: boolean, tdsState: QueryBuilderTDSState) => void;
|
31
|
+
export declare const QueryBuilderGridResultContextMenu: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<{
|
32
|
+
data: QueryBuilderTDSResultCellData | null;
|
33
|
+
tdsState: QueryBuilderTDSState;
|
34
|
+
copyCellValueFunc: () => void;
|
35
|
+
copyCellRowValueFunc: () => void;
|
36
|
+
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>>;
|
37
|
+
//# sourceMappingURL=QueryBuilderTDSResultShared.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderTDSResultShared.d.ts","sourceRoot":"","sources":["../../../../src/components/result/tds/QueryBuilderTDSResultShared.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AASH,OAAO,EACL,KAAK,kBAAkB,EAMvB,KAAK,eAAe,EAErB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EAEpC,MAAM,2BAA2B,CAAC;AA4BnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AAKxG,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,KAAK,EACV,uBAAuB,EACvB,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,4CAA4C,CAAC;AAQpD,eAAO,MAAM,cAAc,QAAS,MAAM,KAAG,MAY5C,CAAC;AAEF,eAAO,MAAM,iCAAiC,eAChC,eAAe,KAC1B,MAAM,GAAG,SAiBX,CAAC;AAEF,eAAO,MAAM,qCAAqC,WACxC,kBAAkB,cACd,MAAM,KACjB,MAAM,GAAG,SA6BX,CAAC;AAEF,eAAO,MAAM,6BAA6B,oBACvB,kBAAkB,KAClC,0BAA0B,EAe5B,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,0BAA0B,GAAG;IAC1E,WAAW,EAAE,uBAAuB,CAAC;IACrC,kBAAkB,EAAE,kBAAkB,CAAC;CACxC,CAAC;AAyQF,eAAO,MAAM,mBAAmB,qBACZ,iBAChB,uBAAuB,EACvB,+BAA+B,uBAAuB,CAAC,CACxD,QACK,6BAA6B,GAAG,IAAI,cAC9B,OAAO,YACT,oBAAoB,KAC7B,IAIF,CAAC;AAEF,eAAO,MAAM,iCAAiC;UAIlC,6BAA6B,GAAG,IAAI;cAChC,oBAAoB;uBACX,MAAM,IAAI;0BACP,MAAM,IAAI;2GAsCrC,CAAC"}
|
@@ -0,0 +1,251 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
/**
|
3
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
import { MenuContent, MenuContentItem, MenuContentDivider, } from '@finos/legend-art';
|
18
|
+
import { observer } from 'mobx-react-lite';
|
19
|
+
import { flowResult } from 'mobx';
|
20
|
+
import { InstanceValue, EnumValueInstanceValue, EnumValueExplicitReference, PRIMITIVE_TYPE, RelationalExecutionActivities, } from '@finos/legend-graph';
|
21
|
+
import { format as formatSQL } from 'sql-formatter';
|
22
|
+
import { useApplicationStore, } from '@finos/legend-application';
|
23
|
+
import { assertErrorThrown, guaranteeNonNullable, filterByType, isBoolean, } from '@finos/legend-shared';
|
24
|
+
import { forwardRef } from 'react';
|
25
|
+
import { QueryBuilderDerivationProjectionColumnState, QueryBuilderProjectionColumnState, } from '../../../stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js';
|
26
|
+
import { PostFilterConditionState, QueryBuilderPostFilterTreeConditionNodeData, PostFilterValueSpecConditionValueState, } from '../../../stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js';
|
27
|
+
import { QueryBuilderPostFilterOperator_Equal, QueryBuilderPostFilterOperator_NotEqual, } from '../../../stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js';
|
28
|
+
import { QueryBuilderPostFilterOperator_In, QueryBuilderPostFilterOperator_NotIn, } from '../../../stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js';
|
29
|
+
import { instanceValue_setValue, instanceValue_setValues, } from '../../../stores/shared/ValueSpecificationModifierHelper.js';
|
30
|
+
import {} from '@finos/legend-lego/data-grid';
|
31
|
+
import { QueryBuilderPostFilterOperator_IsEmpty, QueryBuilderPostFilterOperator_IsNotEmpty, } from '../../../stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js';
|
32
|
+
import { getTDSColumnState } from '../../../stores/fetch-structure/tds/QueryBuilderTDSHelper.js';
|
33
|
+
export const tryToFormatSql = (sql) => {
|
34
|
+
try {
|
35
|
+
const formattedSql = formatSQL(sql, { language: 'mysql' });
|
36
|
+
return formattedSql;
|
37
|
+
}
|
38
|
+
catch {
|
39
|
+
try {
|
40
|
+
const formattedSql = formatSQL(sql);
|
41
|
+
return formattedSql;
|
42
|
+
}
|
43
|
+
catch {
|
44
|
+
return sql;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
};
|
48
|
+
export const getExecutedSqlFromExecutionResult = (execResult) => {
|
49
|
+
const executedSqls = execResult.activities
|
50
|
+
?.filter(filterByType(RelationalExecutionActivities))
|
51
|
+
.map((relationalActivity) => relationalActivity.sql);
|
52
|
+
if (executedSqls?.length) {
|
53
|
+
let executedSql = '';
|
54
|
+
if (executedSqls.length > 1) {
|
55
|
+
for (let i = 0; i < executedSqls.length; i++) {
|
56
|
+
executedSql += `\n--QUERY #${i + 1}\n`;
|
57
|
+
executedSql += `${executedSqls[i]}\n`;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
else {
|
61
|
+
executedSql += executedSqls[0];
|
62
|
+
}
|
63
|
+
return executedSql;
|
64
|
+
}
|
65
|
+
return undefined;
|
66
|
+
};
|
67
|
+
export const getAggregationTDSColumnCustomizations = (result, columnName) => {
|
68
|
+
const columnType = result.builder.columns.find((col) => col.name === columnName)?.type;
|
69
|
+
switch (columnType) {
|
70
|
+
case PRIMITIVE_TYPE.STRING:
|
71
|
+
return {
|
72
|
+
filter: 'agTextColumnFilter',
|
73
|
+
allowedAggFuncs: ['count'],
|
74
|
+
};
|
75
|
+
case PRIMITIVE_TYPE.DATE:
|
76
|
+
case PRIMITIVE_TYPE.DATETIME:
|
77
|
+
case PRIMITIVE_TYPE.STRICTDATE:
|
78
|
+
return {
|
79
|
+
filter: 'agDateColumnFilter',
|
80
|
+
allowedAggFuncs: ['count'],
|
81
|
+
};
|
82
|
+
case PRIMITIVE_TYPE.DECIMAL:
|
83
|
+
case PRIMITIVE_TYPE.INTEGER:
|
84
|
+
case PRIMITIVE_TYPE.FLOAT:
|
85
|
+
return {
|
86
|
+
filter: 'agNumberColumnFilter',
|
87
|
+
allowedAggFuncs: ['count', 'sum', 'max', 'min', 'avg'],
|
88
|
+
};
|
89
|
+
default:
|
90
|
+
return {
|
91
|
+
allowedAggFuncs: ['count'],
|
92
|
+
};
|
93
|
+
}
|
94
|
+
};
|
95
|
+
export const getRowDataFromExecutionResult = (executionResult) => {
|
96
|
+
const rowData = executionResult.result.rows.map((_row, rowIdx) => {
|
97
|
+
const row = {};
|
98
|
+
const cols = executionResult.result.columns;
|
99
|
+
_row.values.forEach((value, colIdx) => {
|
100
|
+
// `ag-grid` shows `false` value as empty string so we have
|
101
|
+
// call `.toString()` to avoid this behavior.
|
102
|
+
// See https://github.com/finos/legend-studio/issues/1008
|
103
|
+
row[cols[colIdx]] = isBoolean(value) ? String(value) : value;
|
104
|
+
});
|
105
|
+
row.rowNumber = rowIdx;
|
106
|
+
return row;
|
107
|
+
});
|
108
|
+
return rowData;
|
109
|
+
};
|
110
|
+
const postFilterEqualOperator = new QueryBuilderPostFilterOperator_Equal();
|
111
|
+
const postFilterInOperator = new QueryBuilderPostFilterOperator_In();
|
112
|
+
const postFilterEmptyOperator = new QueryBuilderPostFilterOperator_IsEmpty();
|
113
|
+
const postFilterNotEmptyOperator = new QueryBuilderPostFilterOperator_IsNotEmpty();
|
114
|
+
const postFilterNotEqualOperator = new QueryBuilderPostFilterOperator_NotEqual();
|
115
|
+
const postFilterNotInOperator = new QueryBuilderPostFilterOperator_NotIn();
|
116
|
+
const getExistingPostFilterNode = (operators, projectionColumnName, postFilterState, tdsColState) => Array.from(postFilterState.nodes.values())
|
117
|
+
.filter(filterByType(QueryBuilderPostFilterTreeConditionNodeData))
|
118
|
+
.filter((node) => node.condition.leftConditionValue instanceof
|
119
|
+
QueryBuilderProjectionColumnState)
|
120
|
+
.filter((node) => node.condition.leftConditionValue.columnName ===
|
121
|
+
(projectionColumnName ?? tdsColState?.columnName) &&
|
122
|
+
operators
|
123
|
+
.map((op) => op.getLabel())
|
124
|
+
.includes(node.condition.operator.getLabel()))[0];
|
125
|
+
const updateFilterConditionValue = (conditionValue, _cellData, tdsState) => {
|
126
|
+
if (_cellData.value) {
|
127
|
+
instanceValue_setValue(conditionValue, conditionValue instanceof EnumValueInstanceValue
|
128
|
+
? EnumValueExplicitReference.create(guaranteeNonNullable((conditionValue.genericType?.ownerReference.value).values.filter((v) => v.name === _cellData.value)[0]))
|
129
|
+
: _cellData.value, 0, tdsState.queryBuilderState.observerContext);
|
130
|
+
}
|
131
|
+
};
|
132
|
+
const generateNewPostFilterConditionNodeData = async (applicationStore, operator, _cellData, tdsState, tdsColState) => {
|
133
|
+
let postFilterConditionState;
|
134
|
+
try {
|
135
|
+
const possibleProjectionColumnState = _cellData.columnName
|
136
|
+
? tdsState.projectionColumns
|
137
|
+
.filter((c) => c.columnName === _cellData.columnName)
|
138
|
+
.concat(tdsState.aggregationState.columns
|
139
|
+
.filter((c) => c.columnName === _cellData.columnName)
|
140
|
+
.map((ag) => ag.projectionColumnState))[0]
|
141
|
+
: tdsColState;
|
142
|
+
if (possibleProjectionColumnState) {
|
143
|
+
postFilterConditionState = new PostFilterConditionState(tdsState.postFilterState, possibleProjectionColumnState, operator);
|
144
|
+
if (tdsColState instanceof QueryBuilderDerivationProjectionColumnState) {
|
145
|
+
await flowResult(tdsColState.fetchDerivationLambdaReturnType());
|
146
|
+
}
|
147
|
+
const defaultFilterConditionValue = postFilterConditionState.operator.getDefaultFilterConditionValue(postFilterConditionState);
|
148
|
+
postFilterConditionState.buildFromValueSpec(defaultFilterConditionValue);
|
149
|
+
updateFilterConditionValue(defaultFilterConditionValue, _cellData, tdsState);
|
150
|
+
tdsState.postFilterState.addNodeFromNode(new QueryBuilderPostFilterTreeConditionNodeData(undefined, postFilterConditionState), undefined);
|
151
|
+
}
|
152
|
+
}
|
153
|
+
catch (error) {
|
154
|
+
assertErrorThrown(error);
|
155
|
+
applicationStore.notificationService.notifyWarning(error.message);
|
156
|
+
return;
|
157
|
+
}
|
158
|
+
};
|
159
|
+
const updateExistingPostFilterConditionNodeData = (existingPostFilterNode, isFilterBy, _cellData, operator, data, tdsState) => {
|
160
|
+
if (operator === postFilterEmptyOperator ||
|
161
|
+
operator === postFilterNotEmptyOperator) {
|
162
|
+
const conditionState = existingPostFilterNode.condition;
|
163
|
+
if (conditionState.operator.getLabel() !== operator.getLabel()) {
|
164
|
+
conditionState.changeOperator(isFilterBy ? postFilterEmptyOperator : postFilterNotEmptyOperator);
|
165
|
+
}
|
166
|
+
return;
|
167
|
+
}
|
168
|
+
const conditionState = existingPostFilterNode.condition;
|
169
|
+
const rightSide = conditionState.rightConditionValue;
|
170
|
+
if (rightSide instanceof PostFilterValueSpecConditionValueState) {
|
171
|
+
if (conditionState.operator.getLabel() === operator.getLabel()) {
|
172
|
+
const doesValueAlreadyExist = rightSide.value instanceof InstanceValue &&
|
173
|
+
(rightSide.value instanceof EnumValueInstanceValue
|
174
|
+
? rightSide.value.values.map((ef) => ef.value.name)
|
175
|
+
: rightSide.value.values).includes(_cellData.value);
|
176
|
+
if (!doesValueAlreadyExist) {
|
177
|
+
const currentValueSpecificaton = rightSide.value;
|
178
|
+
const newValueSpecification = conditionState.operator.getDefaultFilterConditionValue(conditionState);
|
179
|
+
updateFilterConditionValue(newValueSpecification, _cellData, tdsState);
|
180
|
+
conditionState.changeOperator(isFilterBy ? postFilterInOperator : postFilterNotInOperator);
|
181
|
+
instanceValue_setValues(rightSide.value, [currentValueSpecificaton, newValueSpecification], tdsState.queryBuilderState.observerContext);
|
182
|
+
}
|
183
|
+
}
|
184
|
+
else {
|
185
|
+
const doesValueAlreadyExist = rightSide.value instanceof InstanceValue &&
|
186
|
+
rightSide.value.values
|
187
|
+
.filter((v) => v instanceof InstanceValue)
|
188
|
+
.map((v) => v instanceof EnumValueInstanceValue
|
189
|
+
? v.values.map((ef) => ef.value.name)
|
190
|
+
: v.values)
|
191
|
+
.flat()
|
192
|
+
.includes(_cellData.value ?? data?.value);
|
193
|
+
if (!doesValueAlreadyExist) {
|
194
|
+
const newValueSpecification = (isFilterBy ? postFilterEqualOperator : postFilterNotEqualOperator).getDefaultFilterConditionValue(conditionState);
|
195
|
+
updateFilterConditionValue(newValueSpecification, _cellData, tdsState);
|
196
|
+
instanceValue_setValues(rightSide.value, [...rightSide.value.values, newValueSpecification], tdsState.queryBuilderState.observerContext);
|
197
|
+
}
|
198
|
+
}
|
199
|
+
}
|
200
|
+
};
|
201
|
+
const getFilterOperator = (isFilterBy, _cellData) => {
|
202
|
+
if (isFilterBy) {
|
203
|
+
if (_cellData.value === null) {
|
204
|
+
return postFilterEmptyOperator;
|
205
|
+
}
|
206
|
+
else {
|
207
|
+
return postFilterEqualOperator;
|
208
|
+
}
|
209
|
+
}
|
210
|
+
else {
|
211
|
+
if (_cellData.value === null) {
|
212
|
+
return postFilterNotEmptyOperator;
|
213
|
+
}
|
214
|
+
else {
|
215
|
+
return postFilterNotEqualOperator;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
};
|
219
|
+
const filterByOrOutValue = (applicationStore, isFilterBy, _cellData, data, tdsState) => {
|
220
|
+
tdsState.setShowPostFilterPanel(true);
|
221
|
+
const operator = getFilterOperator(isFilterBy, _cellData);
|
222
|
+
const tdsColState = data?.columnName
|
223
|
+
? getTDSColumnState(tdsState, data.columnName)
|
224
|
+
: undefined;
|
225
|
+
const existingPostFilterNode = getExistingPostFilterNode(_cellData.value === null
|
226
|
+
? [postFilterEmptyOperator, postFilterNotEmptyOperator]
|
227
|
+
: isFilterBy
|
228
|
+
? [postFilterEqualOperator, postFilterInOperator]
|
229
|
+
: [postFilterNotEqualOperator, postFilterNotInOperator], _cellData.columnName, tdsState.postFilterState, tdsColState);
|
230
|
+
existingPostFilterNode === undefined
|
231
|
+
? generateNewPostFilterConditionNodeData(applicationStore, operator, _cellData, tdsState, tdsColState).catch(applicationStore.alertUnhandledError)
|
232
|
+
: updateExistingPostFilterConditionNodeData(existingPostFilterNode, isFilterBy, _cellData, operator, data, tdsState);
|
233
|
+
};
|
234
|
+
export const filterByOrOutValues = (applicationStore, data, isFilterBy, tdsState) => {
|
235
|
+
tdsState.queryBuilderState.resultState.selectedCells.forEach((_cellData) => {
|
236
|
+
filterByOrOutValue(applicationStore, isFilterBy, _cellData, data, tdsState);
|
237
|
+
});
|
238
|
+
};
|
239
|
+
export const QueryBuilderGridResultContextMenu = observer(forwardRef(function QueryBuilderResultContextMenu(props, ref) {
|
240
|
+
const { data, tdsState, copyCellValueFunc, copyCellRowValueFunc } = props;
|
241
|
+
const applicationStore = useApplicationStore();
|
242
|
+
const tdsColState = data?.columnName
|
243
|
+
? getTDSColumnState(tdsState, data.columnName)
|
244
|
+
: undefined;
|
245
|
+
return (_jsxs(MenuContent, { ref: ref, children: [_jsx(MenuContentItem, { disabled: !tdsColState, onClick: () => {
|
246
|
+
filterByOrOutValues(applicationStore, data, true, tdsState);
|
247
|
+
}, children: "Filter By" }), _jsx(MenuContentItem, { disabled: !tdsColState, onClick: () => {
|
248
|
+
filterByOrOutValues(applicationStore, data, false, tdsState);
|
249
|
+
}, children: "Filter Out" }), _jsx(MenuContentDivider, {}), _jsx(MenuContentItem, { onClick: copyCellValueFunc, children: "Copy Cell Value" }), _jsx(MenuContentItem, { onClick: copyCellRowValueFunc, children: "Copy Row Value" })] }));
|
250
|
+
}));
|
251
|
+
//# sourceMappingURL=QueryBuilderTDSResultShared.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderTDSResultShared.js","sourceRoot":"","sources":["../../../../src/components/result/tds/QueryBuilderTDSResultShared.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAGL,aAAa,EACb,sBAAsB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C;gBAC9D,CAAC,0BAGe,EAClB,KAAC,eAAe,IACd,QAAQ,EAAE,CAAC,WAAW,EACtB,OAAO,EAAE,GAAS,EAAE;oBAClB,mBAAmB,CAAC,gBAAgB,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;gBAC/D,CAAC,2BAGe,EAClB,KAAC,kBAAkB,KAAG,EACtB,KAAC,eAAe,IAAC,OAAO,EAAE,iBAAiB,gCAEzB,EAClB,KAAC,eAAe,IAAC,OAAO,EAAE,oBAAoB,+BAE5B,IACN,CACf,CAAC;AACJ,CAAC,CAAC,CACH,CAAC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import type { QueryBuilderState } from '../../../stores/QueryBuilderState.js';
|
17
|
+
import { TDSExecutionResult } from '@finos/legend-graph';
|
18
|
+
export declare const QueryBuilderTDSSimpleGridResult: ((props: {
|
19
|
+
executionResult: TDSExecutionResult;
|
20
|
+
queryBuilderState: QueryBuilderState;
|
21
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
22
|
+
displayName: string;
|
23
|
+
};
|
24
|
+
//# sourceMappingURL=QueryBuilderTDSSimpleGridResult.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderTDSSimpleGridResult.d.ts","sourceRoot":"","sources":["../../../../src/components/result/tds/QueryBuilderTDSSimpleGridResult.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAEL,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AA0T7B,eAAO,MAAM,+BAA+B,WAClC;IACN,eAAe,EAAE,kBAAkB,CAAC;IACpC,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;;CA8CF,CAAC"}
|
@@ -0,0 +1,224 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
/**
|
3
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
import { ContextMenu, clsx } from '@finos/legend-art';
|
18
|
+
import { observer } from 'mobx-react-lite';
|
19
|
+
import { getTDSRowRankByColumnInAsc, TDSExecutionResult, } from '@finos/legend-graph';
|
20
|
+
import { DataGrid, } from '@finos/legend-lego/data-grid';
|
21
|
+
import { getRowDataFromExecutionResult, QueryBuilderGridResultContextMenu, } from './QueryBuilderTDSResultShared.js';
|
22
|
+
import { QueryBuilderTDSState } from '../../../stores/fetch-structure/tds/QueryBuilderTDSState.js';
|
23
|
+
import { DEFAULT_LOCALE } from '../../../graph-manager/QueryBuilderConst.js';
|
24
|
+
import { isNumber, isString, isValidURL } from '@finos/legend-shared';
|
25
|
+
const QueryResultCellRenderer = observer((params) => {
|
26
|
+
const resultState = params.resultState;
|
27
|
+
const tdsExecutionResult = params.tdsExecutionResult;
|
28
|
+
const fetchStructureImplementation = resultState.queryBuilderState.fetchStructureState.implementation;
|
29
|
+
const applicationStore = resultState.queryBuilderState.applicationStore;
|
30
|
+
const cellValue = params.value;
|
31
|
+
const formattedCellValue = () => {
|
32
|
+
if (isNumber(cellValue)) {
|
33
|
+
return Intl.NumberFormat(DEFAULT_LOCALE, {
|
34
|
+
maximumFractionDigits: 4,
|
35
|
+
}).format(Number(cellValue));
|
36
|
+
}
|
37
|
+
return cellValue;
|
38
|
+
};
|
39
|
+
const cellValueUrlLink = isString(cellValue) && isValidURL(cellValue) ? cellValue : undefined;
|
40
|
+
const columnName = params.column?.getColId() ?? '';
|
41
|
+
const findCoordinatesFromResultValue = (colId, rowNumber) => {
|
42
|
+
const colIndex = tdsExecutionResult.result.columns.findIndex((col) => col === colId);
|
43
|
+
return { rowIndex: rowNumber, colIndex: colIndex };
|
44
|
+
};
|
45
|
+
const currentCellCoordinates = findCoordinatesFromResultValue(columnName, params.rowIndex);
|
46
|
+
const cellInFilteredResults = resultState.selectedCells.some((result) => result.coordinates.colIndex === currentCellCoordinates.colIndex &&
|
47
|
+
result.coordinates.rowIndex === currentCellCoordinates.rowIndex);
|
48
|
+
const findColumnFromCoordinates = (colIndex) => {
|
49
|
+
if (!resultState.executionResult ||
|
50
|
+
!(resultState.executionResult instanceof TDSExecutionResult)) {
|
51
|
+
return undefined;
|
52
|
+
}
|
53
|
+
return resultState.executionResult.result.columns[colIndex];
|
54
|
+
};
|
55
|
+
const findResultValueFromCoordinates = (resultCoordinate) => {
|
56
|
+
const rowIndex = resultCoordinate[0];
|
57
|
+
const colIndex = resultCoordinate[1];
|
58
|
+
if (!resultState.executionResult ||
|
59
|
+
!(resultState.executionResult instanceof TDSExecutionResult)) {
|
60
|
+
return undefined;
|
61
|
+
}
|
62
|
+
if (params.columnApi.getColumnState()[colIndex]?.sort === 'asc') {
|
63
|
+
resultState.executionResult.result.rows.sort((a, b) => getTDSRowRankByColumnInAsc(a, b, colIndex));
|
64
|
+
}
|
65
|
+
else if (params.columnApi.getColumnState()[colIndex]?.sort === 'desc') {
|
66
|
+
resultState.executionResult.result.rows.sort((a, b) => getTDSRowRankByColumnInAsc(b, a, colIndex));
|
67
|
+
}
|
68
|
+
return resultState.executionResult.result.rows[rowIndex]?.values[colIndex];
|
69
|
+
};
|
70
|
+
const isCoordinatesSelected = (resultCoordinate) => resultState.selectedCells.some((cell) => cell.coordinates.rowIndex === resultCoordinate.rowIndex &&
|
71
|
+
cell.coordinates.colIndex === resultCoordinate.colIndex);
|
72
|
+
const mouseDown = (event) => {
|
73
|
+
event.preventDefault();
|
74
|
+
if (event.shiftKey) {
|
75
|
+
const coordinates = findCoordinatesFromResultValue(columnName, params.rowIndex);
|
76
|
+
const actualValue = findResultValueFromCoordinates([
|
77
|
+
coordinates.rowIndex,
|
78
|
+
coordinates.colIndex,
|
79
|
+
]);
|
80
|
+
resultState.addSelectedCell({
|
81
|
+
value: actualValue,
|
82
|
+
columnName: columnName,
|
83
|
+
coordinates: coordinates,
|
84
|
+
});
|
85
|
+
return;
|
86
|
+
}
|
87
|
+
if (event.button === 0) {
|
88
|
+
resultState.setIsSelectingCells(true);
|
89
|
+
resultState.setSelectedCells([]);
|
90
|
+
const coordinates = findCoordinatesFromResultValue(columnName, params.rowIndex);
|
91
|
+
const actualValue = findResultValueFromCoordinates([
|
92
|
+
coordinates.rowIndex,
|
93
|
+
coordinates.colIndex,
|
94
|
+
]);
|
95
|
+
resultState.setSelectedCells([
|
96
|
+
{
|
97
|
+
value: actualValue,
|
98
|
+
columnName: columnName,
|
99
|
+
coordinates: coordinates,
|
100
|
+
},
|
101
|
+
]);
|
102
|
+
resultState.setMouseOverCell(resultState.selectedCells[0] ?? null);
|
103
|
+
}
|
104
|
+
if (event.button === 2) {
|
105
|
+
const coordinates = findCoordinatesFromResultValue(columnName, params.rowIndex);
|
106
|
+
const isInSelected = isCoordinatesSelected(coordinates);
|
107
|
+
if (!isInSelected) {
|
108
|
+
const actualValue = findResultValueFromCoordinates([
|
109
|
+
coordinates.rowIndex,
|
110
|
+
coordinates.colIndex,
|
111
|
+
]);
|
112
|
+
resultState.setSelectedCells([
|
113
|
+
{
|
114
|
+
value: actualValue,
|
115
|
+
columnName: columnName,
|
116
|
+
coordinates: coordinates,
|
117
|
+
},
|
118
|
+
]);
|
119
|
+
resultState.setMouseOverCell(resultState.selectedCells[0] ?? null);
|
120
|
+
}
|
121
|
+
}
|
122
|
+
};
|
123
|
+
const mouseUp = (event) => {
|
124
|
+
resultState.setIsSelectingCells(false);
|
125
|
+
};
|
126
|
+
const mouseOver = (event) => {
|
127
|
+
if (resultState.isSelectingCells) {
|
128
|
+
if (resultState.selectedCells.length < 1) {
|
129
|
+
return;
|
130
|
+
}
|
131
|
+
const results = resultState.selectedCells[0];
|
132
|
+
if (!results) {
|
133
|
+
return;
|
134
|
+
}
|
135
|
+
const firstCorner = results.coordinates;
|
136
|
+
const secondCorner = findCoordinatesFromResultValue(columnName, params.rowIndex);
|
137
|
+
resultState.setSelectedCells([results]);
|
138
|
+
const minRow = Math.min(firstCorner.rowIndex, secondCorner.rowIndex);
|
139
|
+
const minCol = Math.min(firstCorner.colIndex, secondCorner.colIndex);
|
140
|
+
const maxRow = Math.max(firstCorner.rowIndex, secondCorner.rowIndex);
|
141
|
+
const maxCol = Math.max(firstCorner.colIndex, secondCorner.colIndex);
|
142
|
+
for (let x = minRow; x <= maxRow; x++) {
|
143
|
+
for (let y = minCol; y <= maxCol; y++) {
|
144
|
+
const actualValue = findResultValueFromCoordinates([x, y]);
|
145
|
+
const valueAndColumnId = {
|
146
|
+
value: actualValue,
|
147
|
+
columnName: findColumnFromCoordinates(y),
|
148
|
+
coordinates: {
|
149
|
+
rowIndex: x,
|
150
|
+
colIndex: y,
|
151
|
+
},
|
152
|
+
};
|
153
|
+
if (!resultState.selectedCells.find((result) => result.coordinates.colIndex === y &&
|
154
|
+
result.coordinates.rowIndex === x)) {
|
155
|
+
resultState.addSelectedCell(valueAndColumnId);
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
}
|
160
|
+
resultState.setMouseOverCell(resultState.selectedCells[0] ?? null);
|
161
|
+
};
|
162
|
+
const getContextMenuRenderer = () => {
|
163
|
+
if (fetchStructureImplementation instanceof QueryBuilderTDSState) {
|
164
|
+
const copyCellValue = applicationStore.guardUnhandledError(() => applicationStore.clipboardService.copyTextToClipboard(fetchStructureImplementation.queryBuilderState.resultState.selectedCells
|
165
|
+
.map((cellData) => cellData.value)
|
166
|
+
.join(',')));
|
167
|
+
const findRowFromRowIndex = (rowIndex) => {
|
168
|
+
if (!fetchStructureImplementation.queryBuilderState.resultState
|
169
|
+
.executionResult ||
|
170
|
+
!(fetchStructureImplementation.queryBuilderState.resultState
|
171
|
+
.executionResult instanceof TDSExecutionResult)) {
|
172
|
+
return '';
|
173
|
+
}
|
174
|
+
// try to get the entire row value separated by comma
|
175
|
+
// rowData is in format of {columnName: value, columnName1: value, ...., rowNumber:value}
|
176
|
+
const valueArr = [];
|
177
|
+
Object.entries(params.api.getRenderedNodes().find((n) => n.rowIndex === rowIndex)
|
178
|
+
?.data).forEach((entry) => {
|
179
|
+
if (entry[0] !== 'rowNumber') {
|
180
|
+
valueArr.push(entry[1]);
|
181
|
+
}
|
182
|
+
});
|
183
|
+
return valueArr.join(',');
|
184
|
+
};
|
185
|
+
const copyRowValue = applicationStore.guardUnhandledError(() => applicationStore.clipboardService.copyTextToClipboard(findRowFromRowIndex(fetchStructureImplementation.queryBuilderState.resultState
|
186
|
+
.selectedCells[0]?.coordinates.rowIndex ?? 0)));
|
187
|
+
return (_jsx(QueryBuilderGridResultContextMenu, { data: resultState.mousedOverCell, tdsState: fetchStructureImplementation, copyCellValueFunc: copyCellValue, copyCellRowValueFunc: copyRowValue }));
|
188
|
+
}
|
189
|
+
return null;
|
190
|
+
};
|
191
|
+
return (_jsx(ContextMenu, { content: getContextMenuRenderer(), disabled: !(resultState.queryBuilderState.fetchStructureState
|
192
|
+
.implementation instanceof QueryBuilderTDSState) ||
|
193
|
+
!resultState.queryBuilderState.isQuerySupported ||
|
194
|
+
!resultState.mousedOverCell, menuProps: { elevation: 7 }, className: clsx('ag-theme-balham-dark query-builder__result__tds-grid'), children: _jsx("div", { className: clsx('query-builder__result__values__table__cell', {
|
195
|
+
'query-builder__result__values__table__cell--active': cellInFilteredResults,
|
196
|
+
}), onMouseDown: (event) => mouseDown(event), onMouseUp: (event) => mouseUp(event), onMouseOver: (event) => mouseOver(event), children: cellValueUrlLink ? (_jsx("a", { href: cellValueUrlLink, target: "_blank", rel: "noreferrer", children: cellValueUrlLink })) : (_jsx("span", { children: formattedCellValue() })) }) }));
|
197
|
+
});
|
198
|
+
export const QueryBuilderTDSSimpleGridResult = observer((props) => {
|
199
|
+
const { executionResult, queryBuilderState } = props;
|
200
|
+
const resultState = queryBuilderState.resultState;
|
201
|
+
const colDefs = executionResult.result.columns.map((colName) => ({
|
202
|
+
minWidth: 50,
|
203
|
+
sortable: true,
|
204
|
+
resizable: true,
|
205
|
+
field: colName,
|
206
|
+
flex: 1,
|
207
|
+
cellRenderer: QueryResultCellRenderer,
|
208
|
+
cellRendererParams: {
|
209
|
+
resultState: resultState,
|
210
|
+
tdsExecutionResult: executionResult,
|
211
|
+
},
|
212
|
+
}));
|
213
|
+
return (_jsx("div", { className: "query-builder__result__values__table", children: _jsx("div", { className: clsx('ag-theme-balham-dark query-builder__result__tds-grid'), children: _jsx(DataGrid, { rowData: getRowDataFromExecutionResult(executionResult), gridOptions: {
|
214
|
+
suppressScrollOnNewData: true,
|
215
|
+
getRowId: (data) => data.data.rowNumber,
|
216
|
+
rowSelection: 'multiple',
|
217
|
+
},
|
218
|
+
// NOTE: when column definition changed, we need to force refresh the cell to make sure the cell renderer is updated
|
219
|
+
// See https://stackoverflow.com/questions/56341073/how-to-refresh-an-ag-grid-when-a-change-occurs-inside-a-custom-cell-renderer-com
|
220
|
+
onRowDataUpdated: (params) => {
|
221
|
+
params.api.refreshCells({ force: true });
|
222
|
+
}, suppressFieldDotNotation: true, suppressContextMenu: false, columnDefs: colDefs }) }) }));
|
223
|
+
});
|
224
|
+
//# sourceMappingURL=QueryBuilderTDSSimpleGridResult.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QueryBuilderTDSSimpleGridResult.js","sourceRoot":"","sources":["../../../../src/components/result/tds/QueryBuilderTDSSimpleGridResult.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,QAAQ,GAET,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,GAElC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAQtE,MAAM,uBAAuB,GAAG,QAAQ,CACtC,CAAC,MAAwC,EAAE,EAAE;IAC3C,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IACvC,MAAM,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;IACrD,MAAM,4BAA4B,GAChC,WAAW,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,cAAc,CAAC;IACnE,MAAM,gBAAgB,GAAG,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;IACxE,MAAM,SAAS,GAAG,MAAM,CAAC,KAA0C,CAAC;IACpE,MAAM,kBAAkB,G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