@finos/legend-query-builder 2.1.2 → 2.1.3
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/{src/stores/QueryBuilderBootstraper.ts → lib/application/QueryBuilderDocumentation.d.ts} +6 -8
- package/lib/application/QueryBuilderDocumentation.d.ts.map +1 -0
- package/lib/application/QueryBuilderDocumentation.js +23 -0
- package/lib/application/QueryBuilderDocumentation.js.map +1 -0
- package/lib/components/QueryBuilder.js +3 -2
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.js +3 -2
- package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
- package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderDiffPanel.js +9 -8
- package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +3 -2
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderResultPanel.js +8 -7
- package/lib/components/QueryBuilderResultPanel.js.map +1 -1
- package/lib/components/QueryBuilderTextEditor.js +3 -2
- package/lib/components/QueryBuilderTextEditor.js.map +1 -1
- package/lib/components/QueryBuilder_LegendApplicationPlugin.d.ts +2 -1
- package/lib/components/QueryBuilder_LegendApplicationPlugin.d.ts.map +1 -1
- package/lib/components/QueryBuilder_LegendApplicationPlugin.js +8 -0
- package/lib/components/QueryBuilder_LegendApplicationPlugin.js.map +1 -1
- package/lib/{stores/QueryBuilderBootstraper.js → components/execution-plan/ExecutionPlanViewer.d.ts} +12 -6
- package/lib/components/execution-plan/ExecutionPlanViewer.d.ts.map +1 -0
- package/lib/components/execution-plan/ExecutionPlanViewer.js +182 -0
- package/lib/components/execution-plan/ExecutionPlanViewer.js.map +1 -0
- package/lib/components/execution-plan/SQLExecutionNodeViewer.d.ts +31 -0
- package/lib/components/execution-plan/SQLExecutionNodeViewer.d.ts.map +1 -0
- package/lib/components/execution-plan/SQLExecutionNodeViewer.js +32 -0
- package/lib/components/execution-plan/SQLExecutionNodeViewer.js.map +1 -0
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.js +2 -2
- package/lib/components/explorer/QueryBuilderPropertySearchPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +4 -4
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.js +2 -3
- package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
- package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaEditor.js +20 -19
- package/lib/components/shared/LambdaEditor.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/package.json +9 -17
- package/lib/stores/QueryBuilderResultState.d.ts +1 -1
- package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderResultState.js +2 -1
- package/lib/stores/QueryBuilderResultState.js.map +1 -1
- package/lib/stores/execution-plan/ExecutionPlanState.d.ts +61 -0
- package/lib/stores/execution-plan/ExecutionPlanState.d.ts.map +1 -0
- package/lib/stores/execution-plan/ExecutionPlanState.js +118 -0
- package/lib/stores/execution-plan/ExecutionPlanState.js.map +1 -0
- package/lib/stores/explorer/QueryBuilderPropertySearchState.d.ts +3 -4
- package/lib/stores/explorer/QueryBuilderPropertySearchState.d.ts.map +1 -1
- package/lib/stores/explorer/QueryBuilderPropertySearchState.js +3 -4
- package/lib/stores/explorer/QueryBuilderPropertySearchState.js.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
- package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
- package/package.json +16 -24
- package/{lib/stores/QueryBuilderBootstraper.d.ts → src/application/QueryBuilderDocumentation.ts} +8 -2
- package/src/components/QueryBuilder.tsx +2 -2
- package/src/components/QueryBuilderConstantExpressionPanel.tsx +2 -2
- package/src/components/QueryBuilderDiffPanel.tsx +16 -19
- package/src/components/QueryBuilderParametersPanel.tsx +2 -2
- package/src/components/QueryBuilderResultPanel.tsx +14 -14
- package/src/components/QueryBuilderTextEditor.tsx +4 -4
- package/src/components/QueryBuilder_LegendApplicationPlugin.ts +10 -0
- package/src/components/execution-plan/ExecutionPlanViewer.tsx +543 -0
- package/src/components/execution-plan/SQLExecutionNodeViewer.tsx +46 -0
- package/src/components/explorer/QueryBuilderPropertySearchPanel.tsx +2 -2
- package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +12 -18
- package/src/components/shared/BasicValueSpecificationEditor.tsx +2 -2
- package/src/components/shared/LambdaEditor.tsx +27 -25
- package/src/index.ts +3 -2
- package/src/stores/QueryBuilderResultState.ts +2 -1
- package/src/stores/execution-plan/ExecutionPlanState.ts +153 -0
- package/src/stores/explorer/QueryBuilderPropertySearchState.ts +4 -4
- package/src/stores/filter/QueryBuilderFilterState.ts +2 -0
- package/tsconfig.json +4 -1
- package/lib/stores/QueryBuilderBootstraper.d.ts.map +0 -1
- package/lib/stores/QueryBuilderBootstraper.js.map +0 -1
|
@@ -66,10 +66,10 @@ import {
|
|
|
66
66
|
uniq,
|
|
67
67
|
parseCSVString,
|
|
68
68
|
guaranteeIsNumber,
|
|
69
|
+
csvStringify,
|
|
69
70
|
} from '@finos/legend-shared';
|
|
70
71
|
import { flowResult } from 'mobx';
|
|
71
72
|
import { observer } from 'mobx-react-lite';
|
|
72
|
-
import CSVParser from 'papaparse';
|
|
73
73
|
import { useEffect, useRef, useState } from 'react';
|
|
74
74
|
import {
|
|
75
75
|
instanceValue_setValue,
|
|
@@ -534,7 +534,7 @@ const stringifyValue = (values: ValueSpecification[]): string => {
|
|
|
534
534
|
if (values.length === 0) {
|
|
535
535
|
return '';
|
|
536
536
|
}
|
|
537
|
-
return
|
|
537
|
+
return csvStringify([
|
|
538
538
|
values
|
|
539
539
|
.map((val) => {
|
|
540
540
|
if (val instanceof PrimitiveInstanceValue) {
|
|
@@ -19,23 +19,25 @@ import { editor as monacoEditorAPI, type IDisposable } from 'monaco-editor';
|
|
|
19
19
|
import { observer } from 'mobx-react-lite';
|
|
20
20
|
import {
|
|
21
21
|
clsx,
|
|
22
|
-
disposeEditor,
|
|
23
|
-
getBaseTextEditorOptions,
|
|
24
|
-
getEditorValue,
|
|
25
|
-
normalizeLineEnding,
|
|
26
22
|
FilledWindowMaximizeIcon,
|
|
27
23
|
LongArrowAltDownIcon,
|
|
28
24
|
LongArrowAltUpIcon,
|
|
29
25
|
Dialog,
|
|
30
26
|
useResizeDetector,
|
|
31
|
-
clearMarkers,
|
|
32
|
-
setErrorMarkers,
|
|
33
27
|
Modal,
|
|
34
28
|
ModalBody,
|
|
35
29
|
ModalFooter,
|
|
36
30
|
ModalHeader,
|
|
37
31
|
ModalTitle,
|
|
38
32
|
} from '@finos/legend-art';
|
|
33
|
+
import {
|
|
34
|
+
disposeCodeEditor,
|
|
35
|
+
getBaseCodeEditorOptions,
|
|
36
|
+
getCodeEditorValue,
|
|
37
|
+
normalizeLineEnding,
|
|
38
|
+
clearMarkers,
|
|
39
|
+
setErrorMarkers,
|
|
40
|
+
} from '@finos/legend-lego/code-editor';
|
|
39
41
|
import type { LambdaEditorState } from '../../stores/shared/LambdaEditorState.js';
|
|
40
42
|
import {
|
|
41
43
|
debounce,
|
|
@@ -46,8 +48,8 @@ import {
|
|
|
46
48
|
import { flowResult } from 'mobx';
|
|
47
49
|
import { ParserError, type EngineError, type Type } from '@finos/legend-graph';
|
|
48
50
|
import {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
CODE_EDITOR_LANGUAGE,
|
|
52
|
+
CODE_EDITOR_THEME,
|
|
51
53
|
TAB_SIZE,
|
|
52
54
|
useApplicationStore,
|
|
53
55
|
} from '@finos/legend-application';
|
|
@@ -181,12 +183,12 @@ const LambdaEditorInline = observer(
|
|
|
181
183
|
scrollbar: { vertical: 'hidden' },
|
|
182
184
|
};
|
|
183
185
|
const _editor = monacoEditorAPI.create(element, {
|
|
184
|
-
...
|
|
185
|
-
language:
|
|
186
|
+
...getBaseCodeEditorOptions(),
|
|
187
|
+
language: CODE_EDITOR_LANGUAGE.PURE,
|
|
186
188
|
theme: applicationStore.layoutService
|
|
187
189
|
.TEMPORARY__isLightColorThemeEnabled
|
|
188
|
-
?
|
|
189
|
-
:
|
|
190
|
+
? CODE_EDITOR_THEME.TEMPORARY__VSCODE_LIGHT
|
|
191
|
+
: CODE_EDITOR_THEME.LEGEND,
|
|
190
192
|
...lambdaEditorOptions,
|
|
191
193
|
});
|
|
192
194
|
setEditor(_editor);
|
|
@@ -211,7 +213,7 @@ const LambdaEditorInline = observer(
|
|
|
211
213
|
},
|
|
212
214
|
);
|
|
213
215
|
// set the value here so we don't lose the error when toggling between expand/collape modes
|
|
214
|
-
const currentValue =
|
|
216
|
+
const currentValue = getCodeEditorValue(editor);
|
|
215
217
|
editor.setValue(currentValue);
|
|
216
218
|
}
|
|
217
219
|
}
|
|
@@ -244,7 +246,7 @@ const LambdaEditorInline = observer(
|
|
|
244
246
|
onDidChangeModelContentEventDisposer.current?.dispose();
|
|
245
247
|
onDidChangeModelContentEventDisposer.current =
|
|
246
248
|
editor.onDidChangeModelContent(() => {
|
|
247
|
-
const currentVal =
|
|
249
|
+
const currentVal = getCodeEditorValue(editor);
|
|
248
250
|
/**
|
|
249
251
|
* Avoid unecessary setting of lambda string. Also, this prevents clearing the non-parser error on first render.
|
|
250
252
|
* Since this method is guaranteed to be called one time during the first rendering when we first set the
|
|
@@ -287,7 +289,7 @@ const LambdaEditorInline = observer(
|
|
|
287
289
|
);
|
|
288
290
|
|
|
289
291
|
// Set the text value
|
|
290
|
-
const currentValue =
|
|
292
|
+
const currentValue = getCodeEditorValue(editor);
|
|
291
293
|
const editorModel = editor.getModel();
|
|
292
294
|
const currentConfig = editor.getRawOptions();
|
|
293
295
|
if (currentValue !== value) {
|
|
@@ -322,7 +324,7 @@ const LambdaEditorInline = observer(
|
|
|
322
324
|
useEffect(
|
|
323
325
|
() => (): void => {
|
|
324
326
|
if (editor) {
|
|
325
|
-
|
|
327
|
+
disposeCodeEditor(editor);
|
|
326
328
|
}
|
|
327
329
|
onDidChangeModelContentEventDisposer.current?.dispose();
|
|
328
330
|
onDidFocusEditorWidgetDisposer.current?.dispose();
|
|
@@ -342,7 +344,7 @@ const LambdaEditorInline = observer(
|
|
|
342
344
|
data-testid={QUERY_BUILDER_TEST_ID.LAMBDA_EDITOR__EDITOR_INPUT}
|
|
343
345
|
className="lambda-editor__editor__input"
|
|
344
346
|
>
|
|
345
|
-
<div className="
|
|
347
|
+
<div className="code-editor__body" ref={textInputRef} />
|
|
346
348
|
</div>
|
|
347
349
|
{Boolean(expectedType) && (
|
|
348
350
|
<div className="lambda-editor__editor__info">
|
|
@@ -459,12 +461,12 @@ const LambdaEditorPopUp = observer(
|
|
|
459
461
|
if (!editor && textInputRef.current) {
|
|
460
462
|
const element = textInputRef.current;
|
|
461
463
|
const _editor = monacoEditorAPI.create(element, {
|
|
462
|
-
...
|
|
463
|
-
language:
|
|
464
|
+
...getBaseCodeEditorOptions(),
|
|
465
|
+
language: CODE_EDITOR_LANGUAGE.PURE,
|
|
464
466
|
theme: applicationStore.layoutService
|
|
465
467
|
.TEMPORARY__isLightColorThemeEnabled
|
|
466
|
-
?
|
|
467
|
-
:
|
|
468
|
+
? CODE_EDITOR_THEME.TEMPORARY__VSCODE_LIGHT
|
|
469
|
+
: CODE_EDITOR_THEME.LEGEND,
|
|
468
470
|
});
|
|
469
471
|
setEditor(_editor);
|
|
470
472
|
}
|
|
@@ -485,7 +487,7 @@ const LambdaEditorPopUp = observer(
|
|
|
485
487
|
onDidChangeModelContentEventDisposer.current?.dispose();
|
|
486
488
|
onDidChangeModelContentEventDisposer.current =
|
|
487
489
|
editor.onDidChangeModelContent(() => {
|
|
488
|
-
const currentVal =
|
|
490
|
+
const currentVal = getCodeEditorValue(editor);
|
|
489
491
|
/**
|
|
490
492
|
* Avoid unecessary setting of lambda string. Also, this prevents clearing the non-parser error on first render.
|
|
491
493
|
* Since this method is guaranteed to be called one time during the first rendering when we first set the
|
|
@@ -521,7 +523,7 @@ const LambdaEditorPopUp = observer(
|
|
|
521
523
|
});
|
|
522
524
|
|
|
523
525
|
// Set the text value
|
|
524
|
-
const currentValue =
|
|
526
|
+
const currentValue = getCodeEditorValue(editor);
|
|
525
527
|
const editorModel = editor.getModel();
|
|
526
528
|
const currentConfig = editor.getRawOptions();
|
|
527
529
|
if (currentValue !== value) {
|
|
@@ -562,7 +564,7 @@ const LambdaEditorPopUp = observer(
|
|
|
562
564
|
useEffect(
|
|
563
565
|
() => (): void => {
|
|
564
566
|
if (editor) {
|
|
565
|
-
|
|
567
|
+
disposeCodeEditor(editor);
|
|
566
568
|
}
|
|
567
569
|
onDidChangeModelContentEventDisposer.current?.dispose();
|
|
568
570
|
},
|
|
@@ -613,7 +615,7 @@ const LambdaEditorPopUp = observer(
|
|
|
613
615
|
data-testid={QUERY_BUILDER_TEST_ID.LAMBDA_EDITOR__EDITOR_INPUT}
|
|
614
616
|
className="lambda-editor__editor__input"
|
|
615
617
|
>
|
|
616
|
-
<div className="
|
|
618
|
+
<div className="code-editor__body" ref={textInputRef} />
|
|
617
619
|
</div>
|
|
618
620
|
</div>
|
|
619
621
|
</ModalBody>
|
package/src/index.ts
CHANGED
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
export * from './application/QueryBuilderTelemetryHelper.js';
|
|
19
19
|
export * from './application/QueryBuilderEvent.js';
|
|
20
20
|
|
|
21
|
-
export * from './stores/QueryBuilderBootstraper.js';
|
|
22
21
|
export { QueryBuilder_GraphManagerPreset } from './graphManager/QueryBuilder_GraphManagerPreset.js';
|
|
23
22
|
|
|
24
23
|
export { QUERY_BUILDER_TEST_ID } from './application/QueryBuilderTesting.js';
|
|
@@ -53,15 +52,17 @@ export * from './components/QuerySetupUtils.js';
|
|
|
53
52
|
export * from './components/QueryBuilderTextEditor.js';
|
|
54
53
|
|
|
55
54
|
export { TEST__setUpQueryBuilder } from './components/QueryBuilderComponentTestUtils.js';
|
|
55
|
+
export { QueryBuilderTextEditorMode } from './stores/QueryBuilderTextEditorState.js';
|
|
56
56
|
|
|
57
57
|
// ------------------------------------------- Shared components -------------------------------------------
|
|
58
58
|
|
|
59
59
|
export * from './components/shared/LambdaEditor.js';
|
|
60
60
|
export * from './components/shared/BasicValueSpecificationEditor.js';
|
|
61
61
|
export * from './components/shared/LambdaParameterValuesEditor.js';
|
|
62
|
+
export * from './components/execution-plan/ExecutionPlanViewer.js';
|
|
62
63
|
|
|
63
64
|
export { LambdaEditorState } from './stores/shared/LambdaEditorState.js';
|
|
64
65
|
export * from './stores/shared/LambdaParameterState.js';
|
|
65
66
|
export * from './stores/shared/ValueSpecificationModifierHelper.js';
|
|
66
67
|
export * from './stores/shared/ValueSpecificationEditorHelper.js';
|
|
67
|
-
export
|
|
68
|
+
export * from './stores/execution-plan/ExecutionPlanState.js';
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
extractExecutionResultValues,
|
|
40
40
|
} from '@finos/legend-graph';
|
|
41
41
|
import { buildLambdaFunction } from './QueryBuilderValueSpecificationBuilder.js';
|
|
42
|
-
import {
|
|
42
|
+
import { TAB_SIZE } from '@finos/legend-application';
|
|
43
43
|
import {
|
|
44
44
|
buildExecutionParameterValues,
|
|
45
45
|
getExecutionQueryFromRawLambda,
|
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
import type { LambdaFunctionBuilderOption } from './QueryBuilderValueSpecificationBuilderHelper.js';
|
|
48
48
|
import { QueryBuilderTelemetryHelper } from '../application/QueryBuilderTelemetryHelper.js';
|
|
49
49
|
import { QUERY_BUILDER_EVENT } from '../application/QueryBuilderEvent.js';
|
|
50
|
+
import { ExecutionPlanState } from './execution-plan/ExecutionPlanState.js';
|
|
50
51
|
|
|
51
52
|
const DEFAULT_LIMIT = 1000;
|
|
52
53
|
|
|
@@ -0,0 +1,153 @@
|
|
|
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
|
+
|
|
17
|
+
import { observable, action, makeObservable } from 'mobx';
|
|
18
|
+
import {
|
|
19
|
+
type RawExecutionPlan,
|
|
20
|
+
type GraphManagerState,
|
|
21
|
+
ExecutionPlan,
|
|
22
|
+
ExecutionNode,
|
|
23
|
+
} from '@finos/legend-graph';
|
|
24
|
+
import type { TreeNodeData } from '@finos/legend-art';
|
|
25
|
+
import type { GenericLegendApplicationStore } from '@finos/legend-application';
|
|
26
|
+
|
|
27
|
+
export class ExecutionPlanViewTreeNodeData implements TreeNodeData {
|
|
28
|
+
id: string;
|
|
29
|
+
label: string;
|
|
30
|
+
isSelected?: boolean;
|
|
31
|
+
isOpen?: boolean;
|
|
32
|
+
childrenIds?: string[];
|
|
33
|
+
executionPlan!: ExecutionPlan;
|
|
34
|
+
|
|
35
|
+
constructor(id: string, label: string, executionPlan: ExecutionPlan) {
|
|
36
|
+
this.id = id;
|
|
37
|
+
this.label = label;
|
|
38
|
+
this.executionPlan = executionPlan;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export class ExecutionNodeTreeNodeData implements TreeNodeData {
|
|
43
|
+
id: string;
|
|
44
|
+
label: string;
|
|
45
|
+
isSelected?: boolean;
|
|
46
|
+
isOpen?: boolean;
|
|
47
|
+
childrenIds?: string[];
|
|
48
|
+
executionNode: ExecutionNode;
|
|
49
|
+
|
|
50
|
+
constructor(id: string, label: string, executionNode: ExecutionNode) {
|
|
51
|
+
this.id = id;
|
|
52
|
+
this.label = label;
|
|
53
|
+
this.executionNode = executionNode;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export enum EXECUTION_PLAN_VIEW_MODE {
|
|
58
|
+
FORM = 'Form',
|
|
59
|
+
JSON = 'JSON',
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export class ExecutionPlanState {
|
|
63
|
+
applicationStore: GenericLegendApplicationStore;
|
|
64
|
+
graphManagerState: GraphManagerState;
|
|
65
|
+
displayDataJson: object = {};
|
|
66
|
+
displayData = '';
|
|
67
|
+
selectedNode:
|
|
68
|
+
| ExecutionNodeTreeNodeData
|
|
69
|
+
| ExecutionPlanViewTreeNodeData
|
|
70
|
+
| undefined = undefined;
|
|
71
|
+
viewMode: EXECUTION_PLAN_VIEW_MODE = EXECUTION_PLAN_VIEW_MODE.FORM;
|
|
72
|
+
rawPlan?: RawExecutionPlan | undefined;
|
|
73
|
+
plan?: ExecutionPlan | undefined;
|
|
74
|
+
debugText?: string | undefined;
|
|
75
|
+
|
|
76
|
+
constructor(
|
|
77
|
+
applicationStore: GenericLegendApplicationStore,
|
|
78
|
+
graphManagerState: GraphManagerState,
|
|
79
|
+
) {
|
|
80
|
+
makeObservable(this, {
|
|
81
|
+
displayData: observable,
|
|
82
|
+
displayDataJson: observable,
|
|
83
|
+
viewMode: observable,
|
|
84
|
+
rawPlan: observable,
|
|
85
|
+
plan: observable,
|
|
86
|
+
debugText: observable,
|
|
87
|
+
setExecutionPlanDisplayData: action,
|
|
88
|
+
setExecutionPlanDisplayDataJson: action,
|
|
89
|
+
transformMetadataToProtocolJson: action,
|
|
90
|
+
setSelectedNode: action,
|
|
91
|
+
setRawPlan: action,
|
|
92
|
+
setPlan: action,
|
|
93
|
+
setViewMode: action,
|
|
94
|
+
setDebugText: action,
|
|
95
|
+
});
|
|
96
|
+
this.applicationStore = applicationStore;
|
|
97
|
+
this.graphManagerState = graphManagerState;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
setViewMode(val: EXECUTION_PLAN_VIEW_MODE): void {
|
|
101
|
+
this.viewMode = val;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
setRawPlan = (val: RawExecutionPlan | undefined): void => {
|
|
105
|
+
this.rawPlan = val;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
setPlan = (val: ExecutionPlan | undefined): void => {
|
|
109
|
+
this.plan = val;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
setDebugText(val: string | undefined): void {
|
|
113
|
+
this.debugText = val;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
setSelectedNode(
|
|
117
|
+
node: ExecutionNodeTreeNodeData | ExecutionPlanViewTreeNodeData | undefined,
|
|
118
|
+
): void {
|
|
119
|
+
if (this.selectedNode) {
|
|
120
|
+
this.selectedNode.isSelected = false;
|
|
121
|
+
}
|
|
122
|
+
if (node) {
|
|
123
|
+
node.isSelected = true;
|
|
124
|
+
}
|
|
125
|
+
this.selectedNode = node;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
setExecutionPlanDisplayData(val: string): void {
|
|
129
|
+
this.displayData = val;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
setExecutionPlanDisplayDataJson(val: object): void {
|
|
133
|
+
this.displayDataJson = val;
|
|
134
|
+
|
|
135
|
+
this.setExecutionPlanDisplayData(
|
|
136
|
+
JSON.stringify(this.displayDataJson, undefined, 2),
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
transformMetadataToProtocolJson(
|
|
141
|
+
metaModel: ExecutionPlan | ExecutionNode,
|
|
142
|
+
): void {
|
|
143
|
+
if (metaModel instanceof ExecutionPlan) {
|
|
144
|
+
const protocolJson =
|
|
145
|
+
this.graphManagerState.graphManager.serializeExecutionPlan(metaModel);
|
|
146
|
+
this.setExecutionPlanDisplayDataJson(protocolJson);
|
|
147
|
+
} else if (metaModel instanceof ExecutionNode) {
|
|
148
|
+
const protocolJson =
|
|
149
|
+
this.graphManagerState.graphManager.serializeExecutionNode(metaModel);
|
|
150
|
+
this.setExecutionPlanDisplayDataJson(protocolJson);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
} from '@finos/legend-graph';
|
|
27
27
|
import {
|
|
28
28
|
ActionState,
|
|
29
|
+
FuzzySearchEngine,
|
|
29
30
|
addUniqueEntry,
|
|
30
31
|
deleteEntry,
|
|
31
32
|
guaranteeNonNullable,
|
|
@@ -51,8 +52,7 @@ import {
|
|
|
51
52
|
QueryBuilderExplorerTreeSubTypeNodeData,
|
|
52
53
|
} from './QueryBuilderExplorerState.js';
|
|
53
54
|
import type { QueryBuilderState } from '../QueryBuilderState.js';
|
|
54
|
-
import {
|
|
55
|
-
import { TextSearchAdvancedConfigState } from '@finos/legend-application';
|
|
55
|
+
import { FuzzySearchAdvancedConfigState } from '@finos/legend-application/components';
|
|
56
56
|
|
|
57
57
|
export class QueryBuilderPropertySearchState {
|
|
58
58
|
queryBuilderState: QueryBuilderState;
|
|
@@ -72,7 +72,7 @@ export class QueryBuilderPropertySearchState {
|
|
|
72
72
|
|
|
73
73
|
// search
|
|
74
74
|
searchEngine: FuzzySearchEngine<QueryBuilderExplorerTreeNodeData>;
|
|
75
|
-
searchConfigurationState:
|
|
75
|
+
searchConfigurationState: FuzzySearchAdvancedConfigState;
|
|
76
76
|
searchState = ActionState.create();
|
|
77
77
|
searchText = '';
|
|
78
78
|
searchResults: QueryBuilderExplorerTreeNodeData[] = [];
|
|
@@ -112,7 +112,7 @@ export class QueryBuilderPropertySearchState {
|
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
this.queryBuilderState = queryBuilderState;
|
|
115
|
-
this.searchConfigurationState = new
|
|
115
|
+
this.searchConfigurationState = new FuzzySearchAdvancedConfigState(
|
|
116
116
|
(): void => this.search(),
|
|
117
117
|
);
|
|
118
118
|
this.searchEngine = new FuzzySearchEngine(this.indexedExplorerTreeNodes);
|
|
@@ -245,9 +245,11 @@ export abstract class QueryBuilderFilterTreeNodeData
|
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
abstract get dragPreviewLabel(): string;
|
|
248
|
+
|
|
248
249
|
setIsOpen(val: boolean): void {
|
|
249
250
|
this.isOpen = val;
|
|
250
251
|
}
|
|
252
|
+
|
|
251
253
|
setParentId(val: string | undefined): void {
|
|
252
254
|
this.parentId = val;
|
|
253
255
|
}
|
package/tsconfig.json
CHANGED
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
],
|
|
34
34
|
"files": [
|
|
35
35
|
"./src/index.ts",
|
|
36
|
+
"./src/application/QueryBuilderDocumentation.ts",
|
|
36
37
|
"./src/application/QueryBuilderEvent.ts",
|
|
37
38
|
"./src/application/QueryBuilderSetting.ts",
|
|
38
39
|
"./src/application/QueryBuilderTelemetryHelper.ts",
|
|
@@ -51,7 +52,6 @@
|
|
|
51
52
|
"./src/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts",
|
|
52
53
|
"./src/graphManager/protocol/pure/v1/V1_QueryBuilder_PureGraphManagerExtension.ts",
|
|
53
54
|
"./src/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts",
|
|
54
|
-
"./src/stores/QueryBuilderBootstraper.ts",
|
|
55
55
|
"./src/stores/QueryBuilderChangeDetectionState.ts",
|
|
56
56
|
"./src/stores/QueryBuilderCommand.ts",
|
|
57
57
|
"./src/stores/QueryBuilderConfig.ts",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"./src/stores/QueryBuilderValueSpecificationHelper.ts",
|
|
73
73
|
"./src/stores/ServiceInfo.ts",
|
|
74
74
|
"./src/stores/entitlements/QueryBuilderCheckEntitlementsState.ts",
|
|
75
|
+
"./src/stores/execution-plan/ExecutionPlanState.ts",
|
|
75
76
|
"./src/stores/explorer/QueryBuilderExplorerState.ts",
|
|
76
77
|
"./src/stores/explorer/QueryBuilderPropertySearchState.ts",
|
|
77
78
|
"./src/stores/explorer/QueryFunctionsExplorerState.ts",
|
|
@@ -178,6 +179,8 @@
|
|
|
178
179
|
"./src/components/QueryBuilderTextEditor.tsx",
|
|
179
180
|
"./src/components/QueryBuilderUnsupportedQueryEditor.tsx",
|
|
180
181
|
"./src/components/ServiceQuerySetupUtils.tsx",
|
|
182
|
+
"./src/components/execution-plan/ExecutionPlanViewer.tsx",
|
|
183
|
+
"./src/components/execution-plan/SQLExecutionNodeViewer.tsx",
|
|
181
184
|
"./src/components/explorer/QueryBuilderExplorerPanel.tsx",
|
|
182
185
|
"./src/components/explorer/QueryBuilderFunctionsExplorerPanel.tsx",
|
|
183
186
|
"./src/components/explorer/QueryBuilderMilestoningEditor.tsx",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBuilderBootstraper.d.ts","sourceRoot":"","sources":["../../src/stores/QueryBuilderBootstraper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,eAAO,MAAM,0BAA0B,QAAa,QAAQ,IAAI,CAG/D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBuilderBootstraper.js","sourceRoot":"","sources":["../../src/stores/QueryBuilderBootstraper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,IAAmB,EAAE;IAClE,2CAA2C;IAC3C,qBAAqB,CAAC,eAAe,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC;AACpE,CAAC,CAAC"}
|