@finos/legend-query-builder 4.1.2 → 4.1.4
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/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
- package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderResultPanel.js +91 -24
- package/lib/components/QueryBuilderResultPanel.js.map +1 -1
- package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderTextEditor.js +3 -1
- package/lib/components/QueryBuilderTextEditor.js.map +1 -1
- package/lib/components/execution-plan/AllocationExecutionNodeViewer.d.ts +23 -0
- package/lib/components/execution-plan/AllocationExecutionNodeViewer.d.ts.map +1 -0
- package/lib/components/execution-plan/AllocationExecutionNodeViewer.js +32 -0
- package/lib/components/execution-plan/AllocationExecutionNodeViewer.js.map +1 -0
- package/lib/components/execution-plan/ConstantExecutionNodeViewer.d.ts +23 -0
- package/lib/components/execution-plan/ConstantExecutionNodeViewer.d.ts.map +1 -0
- package/lib/components/execution-plan/ConstantExecutionNodeViewer.js +35 -0
- package/lib/components/execution-plan/ConstantExecutionNodeViewer.js.map +1 -0
- package/lib/components/execution-plan/DataTypeResultTypeViewer.d.ts +21 -0
- package/lib/components/execution-plan/DataTypeResultTypeViewer.d.ts.map +1 -0
- package/lib/components/execution-plan/DataTypeResultTypeViewer.js +31 -0
- package/lib/components/execution-plan/DataTypeResultTypeViewer.js.map +1 -0
- package/lib/components/execution-plan/ExecutionPlanViewer.d.ts +10 -4
- package/lib/components/execution-plan/ExecutionPlanViewer.d.ts.map +1 -1
- package/lib/components/execution-plan/ExecutionPlanViewer.js +74 -62
- package/lib/components/execution-plan/ExecutionPlanViewer.js.map +1 -1
- package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.d.ts +25 -0
- package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.d.ts.map +1 -0
- package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.js +47 -0
- package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.js.map +1 -0
- package/lib/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.d.ts +23 -0
- package/lib/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.d.ts.map +1 -0
- package/lib/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.js +31 -0
- package/lib/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.js.map +1 -0
- package/lib/components/execution-plan/ResultTypeViewer.d.ts +21 -0
- package/lib/components/execution-plan/ResultTypeViewer.d.ts.map +1 -0
- package/lib/components/execution-plan/ResultTypeViewer.js +33 -0
- package/lib/components/execution-plan/ResultTypeViewer.js.map +1 -0
- package/lib/components/execution-plan/SQLExecutionNodeViewer.d.ts +9 -1
- package/lib/components/execution-plan/SQLExecutionNodeViewer.d.ts.map +1 -1
- package/lib/components/execution-plan/SQLExecutionNodeViewer.js +12 -6
- package/lib/components/execution-plan/SQLExecutionNodeViewer.js.map +1 -1
- package/lib/components/execution-plan/SequenceExecutionNodeViewer.d.ts +23 -0
- package/lib/components/execution-plan/SequenceExecutionNodeViewer.d.ts.map +1 -0
- package/lib/components/execution-plan/SequenceExecutionNodeViewer.js +38 -0
- package/lib/components/execution-plan/SequenceExecutionNodeViewer.js.map +1 -0
- package/lib/components/execution-plan/TDSResultTypeViewer.d.ts +21 -0
- package/lib/components/execution-plan/TDSResultTypeViewer.d.ts.map +1 -0
- package/lib/components/execution-plan/TDSResultTypeViewer.js +25 -0
- package/lib/components/execution-plan/TDSResultTypeViewer.js.map +1 -0
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js +3 -3
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +25 -34
- package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +68 -22
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.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/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
- package/lib/components/filter/QueryBuilderFilterPanel.js +21 -32
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaEditor.js +10 -3
- package/lib/components/shared/LambdaEditor.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +4 -4
- package/lib/stores/QueryBuilderResultState.d.ts +0 -3
- package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderResultState.js +2 -25
- package/lib/stores/QueryBuilderResultState.js.map +1 -1
- package/lib/stores/QueryBuilderTextEditorState.d.ts +3 -1
- package/lib/stores/QueryBuilderTextEditorState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderTextEditorState.js +2 -2
- package/lib/stores/QueryBuilderTextEditorState.js.map +1 -1
- package/lib/stores/QueryLoaderState.d.ts +2 -0
- package/lib/stores/QueryLoaderState.d.ts.map +1 -1
- package/lib/stores/QueryLoaderState.js +7 -3
- package/lib/stores/QueryLoaderState.js.map +1 -1
- package/lib/stores/execution-plan/ExecutionPlanState.d.ts +14 -1
- package/lib/stores/execution-plan/ExecutionPlanState.d.ts.map +1 -1
- package/lib/stores/execution-plan/ExecutionPlanState.js +86 -3
- package/lib/stores/execution-plan/ExecutionPlanState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +3 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts +4 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js +5 -3
- package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js.map +1 -1
- package/lib/stores/shared/LambdaEditorState.d.ts +7 -2
- package/lib/stores/shared/LambdaEditorState.d.ts.map +1 -1
- package/lib/stores/shared/LambdaEditorState.js +7 -2
- package/lib/stores/shared/LambdaEditorState.js.map +1 -1
- package/package.json +12 -12
- package/src/components/QueryBuilderPropertyExpressionEditor.tsx +1 -2
- package/src/components/QueryBuilderResultPanel.tsx +146 -30
- package/src/components/QueryBuilderTextEditor.tsx +3 -1
- package/src/components/execution-plan/AllocationExecutionNodeViewer.tsx +77 -0
- package/src/components/execution-plan/ConstantExecutionNodeViewer.tsx +82 -0
- package/src/components/execution-plan/DataTypeResultTypeViewer.tsx +52 -0
- package/src/components/execution-plan/ExecutionPlanViewer.tsx +205 -195
- package/src/components/execution-plan/FunctionParametersValidationNodeViewer.tsx +118 -0
- package/src/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.tsx +68 -0
- package/src/components/execution-plan/ResultTypeViewer.tsx +37 -0
- package/src/components/execution-plan/SQLExecutionNodeViewer.tsx +50 -19
- package/src/components/execution-plan/SequenceExecutionNodeViewer.tsx +95 -0
- package/src/components/execution-plan/TDSResultTypeViewer.tsx +59 -0
- package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +5 -8
- package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +37 -62
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +161 -45
- package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +6 -8
- package/src/components/filter/QueryBuilderFilterPanel.tsx +49 -73
- package/src/components/shared/LambdaEditor.tsx +10 -3
- package/src/stores/QueryBuilderResultState.ts +1 -42
- package/src/stores/QueryBuilderTextEditorState.ts +4 -2
- package/src/stores/QueryLoaderState.ts +11 -1
- package/src/stores/execution-plan/ExecutionPlanState.ts +142 -4
- package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +3 -1
- package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.ts +8 -3
- package/src/stores/shared/LambdaEditorState.ts +12 -5
- package/tsconfig.json +8 -0
|
@@ -129,7 +129,9 @@ export class QueryBuilderTextEditorState extends LambdaEditorState {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
*convertLambdaObjectToGrammarString(
|
|
132
|
+
*convertLambdaObjectToGrammarString(options: {
|
|
133
|
+
pretty?: boolean | undefined;
|
|
134
|
+
}): GeneratorFn<void> {
|
|
133
135
|
if (this.rawLambdaState.lambda.body) {
|
|
134
136
|
this.isConvertingLambdaToString = true;
|
|
135
137
|
try {
|
|
@@ -144,7 +146,7 @@ export class QueryBuilderTextEditorState extends LambdaEditorState {
|
|
|
144
146
|
const isolatedLambdas =
|
|
145
147
|
(yield this.queryBuilderState.graphManagerState.graphManager.lambdasToPureCode(
|
|
146
148
|
lambdas,
|
|
147
|
-
pretty,
|
|
149
|
+
options.pretty,
|
|
148
150
|
)) as Map<string, string>;
|
|
149
151
|
const grammarText = isolatedLambdas.get(this.lambdaId);
|
|
150
152
|
this.setLambdaString(
|
|
@@ -24,12 +24,14 @@ import {
|
|
|
24
24
|
type QueryInfo,
|
|
25
25
|
type BasicGraphManagerState,
|
|
26
26
|
type Query,
|
|
27
|
+
GRAPH_MANAGER_EVENT,
|
|
27
28
|
} from '@finos/legend-graph';
|
|
28
29
|
import {
|
|
29
30
|
ActionState,
|
|
30
31
|
type GeneratorFn,
|
|
31
32
|
assertErrorThrown,
|
|
32
33
|
guaranteeNonNullable,
|
|
34
|
+
LogEvent,
|
|
33
35
|
} from '@finos/legend-shared';
|
|
34
36
|
import { makeObservable, observable, action, flow } from 'mobx';
|
|
35
37
|
import type { QueryBuilderState } from './QueryBuilderState.js';
|
|
@@ -62,6 +64,7 @@ export class QueryLoaderState {
|
|
|
62
64
|
readonly isReadOnly?: boolean | undefined;
|
|
63
65
|
readonly onQueryRenamed?: ((query: LightQuery) => void) | undefined;
|
|
64
66
|
readonly onQueryDeleted?: ((query: LightQuery) => void) | undefined;
|
|
67
|
+
readonly handleFetchDefaultQueriesFailure?: (() => void) | undefined;
|
|
65
68
|
|
|
66
69
|
queryBuilderState?: QueryBuilderState | undefined;
|
|
67
70
|
|
|
@@ -93,6 +96,7 @@ export class QueryLoaderState {
|
|
|
93
96
|
isReadOnly?: boolean | undefined;
|
|
94
97
|
onQueryRenamed?: ((query: LightQuery) => void) | undefined;
|
|
95
98
|
onQueryDeleted?: ((query: LightQuery) => void) | undefined;
|
|
99
|
+
handleFetchDefaultQueriesFailure?: (() => void) | undefined;
|
|
96
100
|
},
|
|
97
101
|
) {
|
|
98
102
|
makeObservable(this, {
|
|
@@ -126,6 +130,8 @@ export class QueryLoaderState {
|
|
|
126
130
|
this.isReadOnly = options.isReadOnly;
|
|
127
131
|
this.onQueryRenamed = options.onQueryRenamed;
|
|
128
132
|
this.onQueryDeleted = options.onQueryDeleted;
|
|
133
|
+
this.handleFetchDefaultQueriesFailure =
|
|
134
|
+
options.handleFetchDefaultQueriesFailure;
|
|
129
135
|
}
|
|
130
136
|
|
|
131
137
|
setSearchText(val: string): void {
|
|
@@ -190,7 +196,11 @@ export class QueryLoaderState {
|
|
|
190
196
|
} catch (error) {
|
|
191
197
|
this.searchQueriesState.fail();
|
|
192
198
|
assertErrorThrown(error);
|
|
193
|
-
this.applicationStore.
|
|
199
|
+
this.applicationStore.logService.error(
|
|
200
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.GET_QUERY_FAILURE),
|
|
201
|
+
error,
|
|
202
|
+
);
|
|
203
|
+
this.handleFetchDefaultQueriesFailure?.();
|
|
194
204
|
}
|
|
195
205
|
}
|
|
196
206
|
|
|
@@ -14,15 +14,20 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { observable, action, makeObservable } from 'mobx';
|
|
17
|
+
import { observable, action, makeObservable, computed } from 'mobx';
|
|
18
18
|
import {
|
|
19
19
|
type RawExecutionPlan,
|
|
20
20
|
type GraphManagerState,
|
|
21
21
|
ExecutionPlan,
|
|
22
22
|
ExecutionNode,
|
|
23
23
|
} from '@finos/legend-graph';
|
|
24
|
-
import type { TreeNodeData } from '@finos/legend-art';
|
|
24
|
+
import type { TreeNodeData, TreeData } from '@finos/legend-art';
|
|
25
25
|
import type { GenericLegendApplicationStore } from '@finos/legend-application';
|
|
26
|
+
import {
|
|
27
|
+
addUniqueEntry,
|
|
28
|
+
filterByType,
|
|
29
|
+
guaranteeNonNullable,
|
|
30
|
+
} from '@finos/legend-shared';
|
|
26
31
|
|
|
27
32
|
export class ExecutionPlanViewTreeNodeData implements TreeNodeData {
|
|
28
33
|
id: string;
|
|
@@ -33,10 +38,22 @@ export class ExecutionPlanViewTreeNodeData implements TreeNodeData {
|
|
|
33
38
|
executionPlan!: ExecutionPlan;
|
|
34
39
|
|
|
35
40
|
constructor(id: string, label: string, executionPlan: ExecutionPlan) {
|
|
41
|
+
makeObservable(this, {
|
|
42
|
+
isSelected: observable,
|
|
43
|
+
isOpen: observable,
|
|
44
|
+
setIsSelected: action,
|
|
45
|
+
setIsOpen: action,
|
|
46
|
+
});
|
|
36
47
|
this.id = id;
|
|
37
48
|
this.label = label;
|
|
38
49
|
this.executionPlan = executionPlan;
|
|
39
50
|
}
|
|
51
|
+
setIsSelected(val: boolean): void {
|
|
52
|
+
this.isSelected = val;
|
|
53
|
+
}
|
|
54
|
+
setIsOpen(val: boolean): void {
|
|
55
|
+
this.isOpen = val;
|
|
56
|
+
}
|
|
40
57
|
}
|
|
41
58
|
|
|
42
59
|
export class ExecutionNodeTreeNodeData implements TreeNodeData {
|
|
@@ -48,12 +65,85 @@ export class ExecutionNodeTreeNodeData implements TreeNodeData {
|
|
|
48
65
|
executionNode: ExecutionNode;
|
|
49
66
|
|
|
50
67
|
constructor(id: string, label: string, executionNode: ExecutionNode) {
|
|
68
|
+
makeObservable(this, {
|
|
69
|
+
isSelected: observable,
|
|
70
|
+
isOpen: observable,
|
|
71
|
+
setIsSelected: action,
|
|
72
|
+
setIsOpen: action,
|
|
73
|
+
});
|
|
51
74
|
this.id = id;
|
|
52
75
|
this.label = label;
|
|
53
76
|
this.executionNode = executionNode;
|
|
54
77
|
}
|
|
78
|
+
|
|
79
|
+
setIsSelected(val: boolean): void {
|
|
80
|
+
this.isSelected = val;
|
|
81
|
+
}
|
|
82
|
+
setIsOpen(val: boolean): void {
|
|
83
|
+
this.isOpen = val;
|
|
84
|
+
}
|
|
55
85
|
}
|
|
56
86
|
|
|
87
|
+
export const generateExecutionNodeTreeNodeData = (
|
|
88
|
+
executionNode: ExecutionNode,
|
|
89
|
+
label: string,
|
|
90
|
+
parentNode:
|
|
91
|
+
| ExecutionNodeTreeNodeData
|
|
92
|
+
| ExecutionPlanViewTreeNodeData
|
|
93
|
+
| undefined,
|
|
94
|
+
): ExecutionNodeTreeNodeData => {
|
|
95
|
+
const executionNodeTreeNode = new ExecutionNodeTreeNodeData(
|
|
96
|
+
executionNode._UUID,
|
|
97
|
+
label,
|
|
98
|
+
executionNode,
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
const childrenIds: string[] = [];
|
|
102
|
+
|
|
103
|
+
executionNode.executionNodes
|
|
104
|
+
.slice()
|
|
105
|
+
.filter(filterByType(ExecutionNode))
|
|
106
|
+
.forEach((childExecutionNode) => {
|
|
107
|
+
addUniqueEntry(childrenIds, childExecutionNode._UUID);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
executionNodeTreeNode.childrenIds = childrenIds;
|
|
111
|
+
|
|
112
|
+
return executionNodeTreeNode;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const generateExecutionPlanTreeNodeData = (
|
|
116
|
+
executionPlan: ExecutionPlan,
|
|
117
|
+
): ExecutionPlanViewTreeNodeData => {
|
|
118
|
+
const executionPlanNode = new ExecutionPlanViewTreeNodeData(
|
|
119
|
+
`Execution Plan`,
|
|
120
|
+
`Execution Plan`,
|
|
121
|
+
executionPlan,
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const childrenIds: string[] = [];
|
|
125
|
+
|
|
126
|
+
const rootNodeId = executionPlan.rootExecutionNode._UUID;
|
|
127
|
+
addUniqueEntry(childrenIds, rootNodeId);
|
|
128
|
+
executionPlanNode.childrenIds = childrenIds;
|
|
129
|
+
return executionPlanNode;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const getExecutionPlanTreeData = (
|
|
133
|
+
executionPlan: ExecutionPlan,
|
|
134
|
+
): TreeData<ExecutionPlanViewTreeNodeData | ExecutionNodeTreeNodeData> => {
|
|
135
|
+
const rootIds: string[] = [];
|
|
136
|
+
const nodes = new Map<
|
|
137
|
+
string,
|
|
138
|
+
ExecutionPlanViewTreeNodeData | ExecutionNodeTreeNodeData
|
|
139
|
+
>();
|
|
140
|
+
const executionPlanTreeNode =
|
|
141
|
+
generateExecutionPlanTreeNodeData(executionPlan);
|
|
142
|
+
addUniqueEntry(rootIds, executionPlanTreeNode.id);
|
|
143
|
+
nodes.set(executionPlanTreeNode.id, executionPlanTreeNode);
|
|
144
|
+
return { rootIds, nodes };
|
|
145
|
+
};
|
|
146
|
+
|
|
57
147
|
export enum EXECUTION_PLAN_VIEW_MODE {
|
|
58
148
|
FORM = 'Form',
|
|
59
149
|
JSON = 'JSON',
|
|
@@ -69,6 +159,9 @@ export class ExecutionPlanState {
|
|
|
69
159
|
| ExecutionPlanViewTreeNodeData
|
|
70
160
|
| undefined = undefined;
|
|
71
161
|
viewMode: EXECUTION_PLAN_VIEW_MODE = EXECUTION_PLAN_VIEW_MODE.FORM;
|
|
162
|
+
treeData?:
|
|
163
|
+
| TreeData<ExecutionPlanViewTreeNodeData | ExecutionNodeTreeNodeData>
|
|
164
|
+
| undefined;
|
|
72
165
|
rawPlan?: RawExecutionPlan | undefined;
|
|
73
166
|
plan?: ExecutionPlan | undefined;
|
|
74
167
|
debugText?: string | undefined;
|
|
@@ -84,6 +177,7 @@ export class ExecutionPlanState {
|
|
|
84
177
|
rawPlan: observable,
|
|
85
178
|
plan: observable,
|
|
86
179
|
debugText: observable,
|
|
180
|
+
treeData: observable,
|
|
87
181
|
setExecutionPlanDisplayData: action,
|
|
88
182
|
setExecutionPlanDisplayDataJson: action,
|
|
89
183
|
transformMetadataToProtocolJson: action,
|
|
@@ -92,6 +186,11 @@ export class ExecutionPlanState {
|
|
|
92
186
|
setPlan: action,
|
|
93
187
|
setViewMode: action,
|
|
94
188
|
setDebugText: action,
|
|
189
|
+
setTreeNode: action,
|
|
190
|
+
setTreeData: action,
|
|
191
|
+
refreshTreeData: action,
|
|
192
|
+
nonNullableTreeData: computed,
|
|
193
|
+
initialize: action,
|
|
95
194
|
});
|
|
96
195
|
this.applicationStore = applicationStore;
|
|
97
196
|
this.graphManagerState = graphManagerState;
|
|
@@ -101,6 +200,36 @@ export class ExecutionPlanState {
|
|
|
101
200
|
this.viewMode = val;
|
|
102
201
|
}
|
|
103
202
|
|
|
203
|
+
setTreeNode(
|
|
204
|
+
id: string,
|
|
205
|
+
node: ExecutionPlanViewTreeNodeData | ExecutionNodeTreeNodeData,
|
|
206
|
+
): void {
|
|
207
|
+
this.treeData?.nodes.set(id, node);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
setTreeData(
|
|
211
|
+
val:
|
|
212
|
+
| TreeData<ExecutionPlanViewTreeNodeData | ExecutionNodeTreeNodeData>
|
|
213
|
+
| undefined,
|
|
214
|
+
): void {
|
|
215
|
+
this.treeData = val;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
refreshTreeData(): void {
|
|
219
|
+
if (this.treeData) {
|
|
220
|
+
this.setTreeData({ ...this.treeData });
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
get nonNullableTreeData(): TreeData<
|
|
225
|
+
ExecutionPlanViewTreeNodeData | ExecutionNodeTreeNodeData
|
|
226
|
+
> {
|
|
227
|
+
return guaranteeNonNullable(
|
|
228
|
+
this.treeData,
|
|
229
|
+
'Execution plan viewer tree data has not been initialized',
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
104
233
|
setRawPlan = (val: RawExecutionPlan | undefined): void => {
|
|
105
234
|
this.rawPlan = val;
|
|
106
235
|
};
|
|
@@ -109,6 +238,15 @@ export class ExecutionPlanState {
|
|
|
109
238
|
this.plan = val;
|
|
110
239
|
};
|
|
111
240
|
|
|
241
|
+
initialize = (val: ExecutionPlan | undefined): void => {
|
|
242
|
+
this.setPlan(val);
|
|
243
|
+
if (val !== undefined) {
|
|
244
|
+
this.setTreeData(getExecutionPlanTreeData(val));
|
|
245
|
+
} else {
|
|
246
|
+
this.setTreeData(undefined);
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
|
|
112
250
|
setDebugText(val: string | undefined): void {
|
|
113
251
|
this.debugText = val;
|
|
114
252
|
}
|
|
@@ -117,10 +255,10 @@ export class ExecutionPlanState {
|
|
|
117
255
|
node: ExecutionNodeTreeNodeData | ExecutionPlanViewTreeNodeData | undefined,
|
|
118
256
|
): void {
|
|
119
257
|
if (this.selectedNode) {
|
|
120
|
-
this.selectedNode.
|
|
258
|
+
this.selectedNode.setIsSelected(false);
|
|
121
259
|
}
|
|
122
260
|
if (node) {
|
|
123
|
-
node.
|
|
261
|
+
node.setIsSelected(true);
|
|
124
262
|
}
|
|
125
263
|
this.selectedNode = node;
|
|
126
264
|
}
|
|
@@ -465,7 +465,9 @@ export class QueryBuilderTDSState
|
|
|
465
465
|
// convert to grammar for display
|
|
466
466
|
flowResult(
|
|
467
467
|
derivationColumnState.derivationLambdaEditorState.convertLambdaObjectToGrammarString(
|
|
468
|
-
|
|
468
|
+
{
|
|
469
|
+
pretty: false,
|
|
470
|
+
},
|
|
469
471
|
),
|
|
470
472
|
).catch(this.queryBuilderState.applicationStore.alertUnhandledError);
|
|
471
473
|
}
|
|
@@ -226,7 +226,10 @@ class QueryBuilderDerivationProjectionLambdaState extends LambdaEditorState {
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
*convertLambdaObjectToGrammarString(
|
|
229
|
+
*convertLambdaObjectToGrammarString(options?: {
|
|
230
|
+
pretty?: boolean | undefined;
|
|
231
|
+
preserveCompilationError?: boolean | undefined;
|
|
232
|
+
}): GeneratorFn<void> {
|
|
230
233
|
if (this.derivationProjectionColumnState.lambda.body) {
|
|
231
234
|
try {
|
|
232
235
|
const lambdas = new Map<string, RawLambda>();
|
|
@@ -240,7 +243,7 @@ class QueryBuilderDerivationProjectionLambdaState extends LambdaEditorState {
|
|
|
240
243
|
const isolatedLambdas =
|
|
241
244
|
(yield this.queryBuilderState.graphManagerState.graphManager.lambdasToPureCode(
|
|
242
245
|
lambdas,
|
|
243
|
-
pretty,
|
|
246
|
+
options?.pretty,
|
|
244
247
|
)) as Map<string, string>;
|
|
245
248
|
const grammarText = isolatedLambdas.get(this.lambdaId);
|
|
246
249
|
this.setLambdaString(
|
|
@@ -248,7 +251,9 @@ class QueryBuilderDerivationProjectionLambdaState extends LambdaEditorState {
|
|
|
248
251
|
? this.extractLambdaString(grammarText)
|
|
249
252
|
: '',
|
|
250
253
|
);
|
|
251
|
-
this.clearErrors(
|
|
254
|
+
this.clearErrors({
|
|
255
|
+
preserveCompilationError: options?.preserveCompilationError,
|
|
256
|
+
});
|
|
252
257
|
} catch (error) {
|
|
253
258
|
assertErrorThrown(error);
|
|
254
259
|
this.queryBuilderState.applicationStore.logService.error(
|
|
@@ -64,9 +64,15 @@ export abstract class LambdaEditorState {
|
|
|
64
64
|
this.lambdaString = val;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
clearErrors(
|
|
68
|
-
|
|
67
|
+
clearErrors(options?: {
|
|
68
|
+
preserveCompilationError?: boolean | undefined;
|
|
69
|
+
}): void {
|
|
69
70
|
this.setParserError(undefined);
|
|
71
|
+
if (options?.preserveCompilationError && this.compilationError) {
|
|
72
|
+
this.compilationError.sourceInformation = undefined;
|
|
73
|
+
} else {
|
|
74
|
+
this.setCompilationError(undefined);
|
|
75
|
+
}
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
setCompilationError(compilationError: CompilationError | undefined): void {
|
|
@@ -113,7 +119,8 @@ export abstract class LambdaEditorState {
|
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
abstract convertLambdaGrammarStringToObject(): GeneratorFn<void>;
|
|
116
|
-
abstract convertLambdaObjectToGrammarString(
|
|
117
|
-
pretty
|
|
118
|
-
|
|
122
|
+
abstract convertLambdaObjectToGrammarString(options?: {
|
|
123
|
+
pretty?: boolean | undefined;
|
|
124
|
+
preserveCompilationError?: boolean | undefined;
|
|
125
|
+
}): GeneratorFn<void>;
|
|
119
126
|
}
|
package/tsconfig.json
CHANGED
|
@@ -222,8 +222,16 @@
|
|
|
222
222
|
"./src/components/ServiceQuerySetupUtils.tsx",
|
|
223
223
|
"./src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx",
|
|
224
224
|
"./src/components/data-access/DataAccessOverview.tsx",
|
|
225
|
+
"./src/components/execution-plan/AllocationExecutionNodeViewer.tsx",
|
|
226
|
+
"./src/components/execution-plan/ConstantExecutionNodeViewer.tsx",
|
|
227
|
+
"./src/components/execution-plan/DataTypeResultTypeViewer.tsx",
|
|
225
228
|
"./src/components/execution-plan/ExecutionPlanViewer.tsx",
|
|
229
|
+
"./src/components/execution-plan/FunctionParametersValidationNodeViewer.tsx",
|
|
230
|
+
"./src/components/execution-plan/RelationalTDSInstantiationExecutionNodeViewer.tsx",
|
|
231
|
+
"./src/components/execution-plan/ResultTypeViewer.tsx",
|
|
226
232
|
"./src/components/execution-plan/SQLExecutionNodeViewer.tsx",
|
|
233
|
+
"./src/components/execution-plan/SequenceExecutionNodeViewer.tsx",
|
|
234
|
+
"./src/components/execution-plan/TDSResultTypeViewer.tsx",
|
|
227
235
|
"./src/components/explorer/QueryBuilderExplorerPanel.tsx",
|
|
228
236
|
"./src/components/explorer/QueryBuilderFunctionsExplorerPanel.tsx",
|
|
229
237
|
"./src/components/explorer/QueryBuilderMilestoningEditor.tsx",
|