@finos/legend-query-builder 4.4.0 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  2. package/lib/components/QueryBuilderResultPanel.js +8 -2
  3. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  4. package/lib/components/execution-plan/AllocationExecutionNodeViewer.js +1 -1
  5. package/lib/components/execution-plan/AllocationExecutionNodeViewer.js.map +1 -1
  6. package/lib/components/execution-plan/ExecutionPlanViewer.d.ts +7 -0
  7. package/lib/components/execution-plan/ExecutionPlanViewer.d.ts.map +1 -1
  8. package/lib/components/execution-plan/ExecutionPlanViewer.js +109 -27
  9. package/lib/components/execution-plan/ExecutionPlanViewer.js.map +1 -1
  10. package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.d.ts.map +1 -1
  11. package/lib/components/execution-plan/FunctionParametersValidationNodeViewer.js.map +1 -1
  12. package/lib/components/execution-plan/ImplementationViewer.d.ts +23 -0
  13. package/lib/components/execution-plan/ImplementationViewer.d.ts.map +1 -0
  14. package/lib/components/execution-plan/ImplementationViewer.js +35 -0
  15. package/lib/components/execution-plan/ImplementationViewer.js.map +1 -0
  16. package/lib/components/execution-plan/PartialClassResultViewer.d.ts +21 -0
  17. package/lib/components/execution-plan/PartialClassResultViewer.d.ts.map +1 -0
  18. package/lib/components/execution-plan/PartialClassResultViewer.js +24 -0
  19. package/lib/components/execution-plan/PartialClassResultViewer.js.map +1 -0
  20. package/lib/components/execution-plan/RelationalClassQueryTempTableGraphFetchExecutionNodeViewer.d.ts +23 -0
  21. package/lib/components/execution-plan/RelationalClassQueryTempTableGraphFetchExecutionNodeViewer.d.ts.map +1 -0
  22. package/lib/components/execution-plan/RelationalClassQueryTempTableGraphFetchExecutionNodeViewer.js +43 -0
  23. package/lib/components/execution-plan/RelationalClassQueryTempTableGraphFetchExecutionNodeViewer.js.map +1 -0
  24. package/lib/components/execution-plan/RelationalCrossRootQueryTempTableGraphFetchExecutionNodeViewer.d.ts +23 -0
  25. package/lib/components/execution-plan/RelationalCrossRootQueryTempTableGraphFetchExecutionNodeViewer.d.ts.map +1 -0
  26. package/lib/components/execution-plan/RelationalCrossRootQueryTempTableGraphFetchExecutionNodeViewer.js +47 -0
  27. package/lib/components/execution-plan/RelationalCrossRootQueryTempTableGraphFetchExecutionNodeViewer.js.map +1 -0
  28. package/lib/components/execution-plan/RelationalRootQueryTempTableGraphFetchExecutionNodeViewer.d.ts +23 -0
  29. package/lib/components/execution-plan/RelationalRootQueryTempTableGraphFetchExecutionNodeViewer.d.ts.map +1 -0
  30. package/lib/components/execution-plan/RelationalRootQueryTempTableGraphFetchExecutionNodeViewer.js +43 -0
  31. package/lib/components/execution-plan/RelationalRootQueryTempTableGraphFetchExecutionNodeViewer.js.map +1 -0
  32. package/lib/components/execution-plan/ResultTypeViewer.d.ts.map +1 -1
  33. package/lib/components/execution-plan/ResultTypeViewer.js +5 -1
  34. package/lib/components/execution-plan/ResultTypeViewer.js.map +1 -1
  35. package/lib/components/execution-plan/SQLExecutionNodeViewer.d.ts +1 -1
  36. package/lib/components/execution-plan/SQLExecutionNodeViewer.d.ts.map +1 -1
  37. package/lib/components/execution-plan/SQLExecutionNodeViewer.js +16 -3
  38. package/lib/components/execution-plan/SQLExecutionNodeViewer.js.map +1 -1
  39. package/lib/components/execution-plan/SequenceExecutionNodeViewer.d.ts +6 -0
  40. package/lib/components/execution-plan/SequenceExecutionNodeViewer.d.ts.map +1 -1
  41. package/lib/components/execution-plan/SequenceExecutionNodeViewer.js +34 -12
  42. package/lib/components/execution-plan/SequenceExecutionNodeViewer.js.map +1 -1
  43. package/lib/components/execution-plan/StoreMappingGlobalGraphFetchExecutionNodeViewer.d.ts +23 -0
  44. package/lib/components/execution-plan/StoreMappingGlobalGraphFetchExecutionNodeViewer.d.ts.map +1 -0
  45. package/lib/components/execution-plan/StoreMappingGlobalGraphFetchExecutionNodeViewer.js +57 -0
  46. package/lib/components/execution-plan/StoreMappingGlobalGraphFetchExecutionNodeViewer.js.map +1 -0
  47. package/lib/components/execution-plan/TempTableStrategyViewer.d.ts +28 -0
  48. package/lib/components/execution-plan/TempTableStrategyViewer.d.ts.map +1 -0
  49. package/lib/components/execution-plan/TempTableStrategyViewer.js +42 -0
  50. package/lib/components/execution-plan/TempTableStrategyViewer.js.map +1 -0
  51. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +7 -1
  52. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  53. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js +16 -10
  54. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js.map +1 -1
  55. package/lib/components/shared/CustomDatePicker.d.ts +2 -1
  56. package/lib/components/shared/CustomDatePicker.d.ts.map +1 -1
  57. package/lib/components/shared/CustomDatePicker.js +31 -19
  58. package/lib/components/shared/CustomDatePicker.js.map +1 -1
  59. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
  60. package/lib/components/shared/QueryBuilderVariableSelector.js +1 -1
  61. package/lib/components/shared/QueryBuilderVariableSelector.js.map +1 -1
  62. package/lib/index.css +2 -2
  63. package/lib/index.css.map +1 -1
  64. package/lib/package.json +1 -1
  65. package/lib/stores/execution-plan/ExecutionPlanState.d.ts +15 -1
  66. package/lib/stores/execution-plan/ExecutionPlanState.d.ts.map +1 -1
  67. package/lib/stores/execution-plan/ExecutionPlanState.js +50 -3
  68. package/lib/stores/execution-plan/ExecutionPlanState.js.map +1 -1
  69. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.d.ts.map +1 -1
  70. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +16 -4
  71. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  72. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.d.ts +6 -4
  73. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.d.ts.map +1 -1
  74. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js +43 -9
  75. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js.map +1 -1
  76. package/package.json +5 -5
  77. package/src/components/QueryBuilderResultPanel.tsx +7 -2
  78. package/src/components/execution-plan/AllocationExecutionNodeViewer.tsx +1 -1
  79. package/src/components/execution-plan/ExecutionPlanViewer.tsx +233 -57
  80. package/src/components/execution-plan/FunctionParametersValidationNodeViewer.tsx +1 -0
  81. package/src/components/execution-plan/ImplementationViewer.tsx +76 -0
  82. package/src/components/execution-plan/PartialClassResultViewer.tsx +55 -0
  83. package/src/components/execution-plan/RelationalClassQueryTempTableGraphFetchExecutionNodeViewer.tsx +190 -0
  84. package/src/components/execution-plan/RelationalCrossRootQueryTempTableGraphFetchExecutionNodeViewer.tsx +219 -0
  85. package/src/components/execution-plan/RelationalRootQueryTempTableGraphFetchExecutionNodeViewer.tsx +204 -0
  86. package/src/components/execution-plan/ResultTypeViewer.tsx +4 -0
  87. package/src/components/execution-plan/SQLExecutionNodeViewer.tsx +66 -44
  88. package/src/components/execution-plan/SequenceExecutionNodeViewer.tsx +79 -15
  89. package/src/components/execution-plan/StoreMappingGlobalGraphFetchExecutionNodeViewer.tsx +264 -0
  90. package/src/components/execution-plan/TempTableStrategyViewer.tsx +97 -0
  91. package/src/components/fetch-structure/QueryBuilderGraphFetchTreePanel.tsx +23 -9
  92. package/src/components/shared/CustomDatePicker.tsx +65 -27
  93. package/src/components/shared/QueryBuilderVariableSelector.tsx +4 -1
  94. package/src/stores/execution-plan/ExecutionPlanState.ts +64 -1
  95. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +17 -7
  96. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.ts +73 -9
  97. package/tsconfig.json +7 -0
@@ -0,0 +1,190 @@
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 { observer } from 'mobx-react-lite';
18
+ import {
19
+ type ExecutionPlanState,
20
+ EXECUTION_PLAN_VIEW_MODE,
21
+ } from '../../stores/execution-plan/ExecutionPlanState.js';
22
+
23
+ import {
24
+ PanelListItem,
25
+ PanelDivider,
26
+ Button,
27
+ PanelContent,
28
+ clsx,
29
+ } from '@finos/legend-art';
30
+ import {
31
+ type RelationalClassQueryTempTableGraphFetchExecutionNode,
32
+ SQLExecutionNode,
33
+ } from '@finos/legend-graph';
34
+ import { ResultTypeViewer } from './ResultTypeViewer.js';
35
+ import { SQLExecutionNodeViewerHelper } from './SQLExecutionNodeViewer.js';
36
+ import { useState } from 'react';
37
+ import { prettyCONSTName } from '@finos/legend-shared';
38
+ import { ImplementationViewer } from './ImplementationViewer.js';
39
+ import { TempTableStrategyViewer } from './TempTableStrategyViewer.js';
40
+
41
+ enum RELATIONAL_CLASS_QUERY_TABS {
42
+ GENERAL = 'GENERAL',
43
+ TEMP_TABLE = 'TEMP_TABLE_STRATEGY',
44
+ }
45
+
46
+ export const RelationalClassQueryTempTableGraphFetchExecutionNodeViewer: React.FC<{
47
+ node: RelationalClassQueryTempTableGraphFetchExecutionNode;
48
+ executionPlanState: ExecutionPlanState;
49
+ }> = observer((props) => {
50
+ const { node, executionPlanState } = props;
51
+ const applicationStore = executionPlanState.applicationStore;
52
+
53
+ const [selectedTab, setSelectedTab] = useState<RELATIONAL_CLASS_QUERY_TABS>(
54
+ RELATIONAL_CLASS_QUERY_TABS.GENERAL,
55
+ );
56
+
57
+ return (
58
+ <PanelContent
59
+ darkMode={
60
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
61
+ }
62
+ >
63
+ <div className="query-builder__execution-plan-form--editor">
64
+ <div className="panel">
65
+ <div className="panel__header query-builder__execution-plan-form--editor__header--with-tabs">
66
+ <div className="uml-element-editor__tabs">
67
+ {Object.values(RELATIONAL_CLASS_QUERY_TABS).map((tab) => (
68
+ <div
69
+ key={tab}
70
+ onClick={() => setSelectedTab(tab)}
71
+ className={clsx(
72
+ 'query-builder__execution-plan-form--editor__tab',
73
+ {
74
+ 'query-builder__execution-plan-form--editor__tab--active':
75
+ tab === selectedTab,
76
+ },
77
+ )}
78
+ >
79
+ {prettyCONSTName(tab)}
80
+ </div>
81
+ ))}
82
+ </div>
83
+ </div>
84
+ {selectedTab === RELATIONAL_CLASS_QUERY_TABS.GENERAL && (
85
+ <div className="query-builder__store-mapping-global-graph-fetch__container">
86
+ <PanelListItem className="query-builder__store-mapping-global-graph-fetch__container__label">
87
+ Relational Class Query Temp Table Graph Fetch Execution Node
88
+ Details
89
+ </PanelListItem>
90
+ <PanelDivider />
91
+ <table className="table query-builder__store-mapping-global-graph-fetch__container__table">
92
+ <thead>
93
+ <tr>
94
+ <th className="table__cell--left">Property</th>
95
+ <th className="table__cell--left">Details</th>
96
+ </tr>
97
+ </thead>
98
+ <tbody>
99
+ <tr>
100
+ <td className="table__cell--left"> NodeIndex</td>
101
+ <td className="table__cell--left">{node.nodeIndex}</td>
102
+ </tr>
103
+ {node.parentIndex && (
104
+ <tr>
105
+ <td className="table__cell--left">ParentIndex</td>
106
+ <td className="table__cell--left">{node.parentIndex}</td>
107
+ </tr>
108
+ )}
109
+ {node.authDependent && (
110
+ <tr>
111
+ <td className="table__cell--left">AuthDependent</td>
112
+ <td className="table__cell--left">
113
+ {node.authDependent.toString()}
114
+ </td>
115
+ </tr>
116
+ )}
117
+ {node.processedTempTableName && (
118
+ <tr>
119
+ <td className="table__cell--left">
120
+ processedTempTableName
121
+ </td>
122
+ <td className="table__cell--left">
123
+ {node.processedTempTableName}
124
+ </td>
125
+ </tr>
126
+ )}
127
+ {node.tempTableName && (
128
+ <tr>
129
+ <td className="table__cell--left">tempTableName</td>
130
+ <td className="table__cell--left">
131
+ {node.tempTableName}
132
+ </td>
133
+ </tr>
134
+ )}
135
+ </tbody>
136
+ </table>
137
+ <PanelDivider />
138
+ <div className="query-builder__store-mapping-global-graph-fetch__container__implementation">
139
+ <ImplementationViewer
140
+ node={node}
141
+ executionPlanState={executionPlanState}
142
+ />
143
+ </div>
144
+ <PanelDivider />
145
+ {node.executionNodes.length > 0 &&
146
+ node.executionNodes[0] &&
147
+ node.executionNodes[0] instanceof SQLExecutionNode && (
148
+ <>
149
+ <PanelListItem className="query-builder__store-mapping-global-graph-fetch__container__label2">
150
+ Execution Node Details
151
+ </PanelListItem>
152
+ <PanelDivider />
153
+ <SQLExecutionNodeViewerHelper
154
+ query={node.executionNodes[0].sqlQuery}
155
+ resultColumns={node.executionNodes[0].resultColumns}
156
+ resultType={node.executionNodes[0].resultType}
157
+ executionPlanState={executionPlanState}
158
+ />
159
+ </>
160
+ )}
161
+ <PanelDivider />
162
+ <div className="query-builder__store-mapping-global-graph-fetch__container__result">
163
+ <ResultTypeViewer resultType={node.resultType} />
164
+ </div>
165
+ <PanelDivider />
166
+ <div className="query-builder__store-mapping-global-graph-fetch__container__result">
167
+ <Button
168
+ className="btn--dark execution-node-viewer__unsupported-view__to-text-mode__btn"
169
+ onClick={(): void =>
170
+ executionPlanState.setViewMode(
171
+ EXECUTION_PLAN_VIEW_MODE.JSON,
172
+ )
173
+ }
174
+ text="View JSON"
175
+ />
176
+ </div>
177
+ </div>
178
+ )}
179
+ {selectedTab === RELATIONAL_CLASS_QUERY_TABS.TEMP_TABLE &&
180
+ node.tempTableStrategy && (
181
+ <TempTableStrategyViewer
182
+ tempTableStrategy={node.tempTableStrategy}
183
+ executionPlanState={executionPlanState}
184
+ />
185
+ )}
186
+ </div>
187
+ </div>
188
+ </PanelContent>
189
+ );
190
+ });
@@ -0,0 +1,219 @@
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 { observer } from 'mobx-react-lite';
18
+ import {
19
+ type ExecutionPlanState,
20
+ EXECUTION_PLAN_VIEW_MODE,
21
+ } from '../../stores/execution-plan/ExecutionPlanState.js';
22
+
23
+ import {
24
+ PanelListItem,
25
+ PanelDivider,
26
+ Button,
27
+ PanelContent,
28
+ clsx,
29
+ } from '@finos/legend-art';
30
+ import {
31
+ type RelationalCrossRootQueryTempTableGraphFetchExecutionNode,
32
+ SQLExecutionNode,
33
+ } from '@finos/legend-graph';
34
+ import { ResultTypeViewer } from './ResultTypeViewer.js';
35
+ import { SQLExecutionNodeViewerHelper } from './SQLExecutionNodeViewer.js';
36
+ import { useState } from 'react';
37
+ import { prettyCONSTName } from '@finos/legend-shared';
38
+ import { ImplementationViewer } from './ImplementationViewer.js';
39
+ import { TempTableStrategyViewer } from './TempTableStrategyViewer.js';
40
+
41
+ enum RELATIONAL_CROSS_ROOT_QUERY_TABS {
42
+ GENERAL = 'GENERAL',
43
+ TEMP_TABLE_STRATEGY = 'TEMP_TABLE_STRATEGY',
44
+ PARENT_TEMP_TABLE_STRATEGY = 'PARENT_TEMP_TABLE_STRATEGY',
45
+ }
46
+
47
+ export const RelationalCrossRootQueryTempTableGraphFetchExecutionNodeViewer: React.FC<{
48
+ node: RelationalCrossRootQueryTempTableGraphFetchExecutionNode;
49
+ executionPlanState: ExecutionPlanState;
50
+ }> = observer((props) => {
51
+ const { node, executionPlanState } = props;
52
+ const applicationStore = executionPlanState.applicationStore;
53
+
54
+ const [selectedTab, setSelectedTab] =
55
+ useState<RELATIONAL_CROSS_ROOT_QUERY_TABS>(
56
+ RELATIONAL_CROSS_ROOT_QUERY_TABS.GENERAL,
57
+ );
58
+
59
+ return (
60
+ <PanelContent
61
+ darkMode={
62
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
63
+ }
64
+ >
65
+ <div className="query-builder__execution-plan-form--editor">
66
+ <div className="panel">
67
+ <div className="panel__header query-builder__execution-plan-form--editor__header--with-tabs">
68
+ <div className="uml-element-editor__tabs">
69
+ {Object.values(RELATIONAL_CROSS_ROOT_QUERY_TABS).map((tab) => (
70
+ <div
71
+ key={tab}
72
+ onClick={() => setSelectedTab(tab)}
73
+ className={clsx(
74
+ 'query-builder__execution-plan-form--editor__tab',
75
+ {
76
+ 'query-builder__execution-plan-form--editor__tab--active':
77
+ tab === selectedTab,
78
+ },
79
+ )}
80
+ >
81
+ {prettyCONSTName(tab)}
82
+ </div>
83
+ ))}
84
+ </div>
85
+ </div>
86
+ {selectedTab === RELATIONAL_CROSS_ROOT_QUERY_TABS.GENERAL && (
87
+ <div className="query-builder__store-mapping-global-graph-fetch__container">
88
+ <PanelListItem className="query-builder__store-mapping-global-graph-fetch__container__label">
89
+ Relational Cross Root Query Temp Table Graph Fetch Execution
90
+ Node Details
91
+ </PanelListItem>
92
+ <PanelDivider />
93
+ <table className="table query-builder__store-mapping-global-graph-fetch__container__table">
94
+ <thead>
95
+ <tr>
96
+ <th className="table__cell--left">Property</th>
97
+ <th className="table__cell--left">Details</th>
98
+ </tr>
99
+ </thead>
100
+ <tbody>
101
+ <tr>
102
+ <td className="table__cell--left"> NodeIndex</td>
103
+ <td className="table__cell--left">{node.nodeIndex}</td>
104
+ </tr>
105
+ {node.parentIndex !== undefined && (
106
+ <tr>
107
+ <td className="table__cell--left">ParentIndex</td>
108
+ <td className="table__cell--left">{node.parentIndex}</td>
109
+ </tr>
110
+ )}
111
+ {node.authDependent !== undefined && (
112
+ <tr>
113
+ <td className="table__cell--left">AuthDependent</td>
114
+ <td className="table__cell--left">
115
+ {node.authDependent.toString()}
116
+ </td>
117
+ </tr>
118
+ )}
119
+ {node.processedTempTableName !== undefined && (
120
+ <tr>
121
+ <td className="table__cell--left">
122
+ processedTempTableName
123
+ </td>
124
+ <td className="table__cell--left">
125
+ {node.processedTempTableName}
126
+ </td>
127
+ </tr>
128
+ )}
129
+ {node.tempTableName && (
130
+ <tr>
131
+ <td className="table__cell--left">tempTableName</td>
132
+ <td className="table__cell--left">
133
+ {node.tempTableName}
134
+ </td>
135
+ </tr>
136
+ )}
137
+ {node.processedParentTempTableName !== undefined && (
138
+ <tr>
139
+ <td className="table__cell--left">
140
+ processedParentTempTableName
141
+ </td>
142
+ <td className="table__cell--left">
143
+ {node.processedParentTempTableName}
144
+ </td>
145
+ </tr>
146
+ )}
147
+ {node.parentTempTableName && (
148
+ <tr>
149
+ <td className="table__cell--left">parentTempTableName</td>
150
+ <td className="table__cell--left">
151
+ {node.parentTempTableName}
152
+ </td>
153
+ </tr>
154
+ )}
155
+ </tbody>
156
+ </table>
157
+ <PanelDivider />
158
+ <div className="query-builder__store-mapping-global-graph-fetch__container__implementation">
159
+ <ImplementationViewer
160
+ node={node}
161
+ executionPlanState={executionPlanState}
162
+ />
163
+ </div>
164
+ <PanelDivider />
165
+ {node.executionNodes.length > 0 &&
166
+ node.executionNodes[0] &&
167
+ node.executionNodes[0] instanceof SQLExecutionNode && (
168
+ <>
169
+ <PanelListItem className="query-builder__store-mapping-global-graph-fetch__container__label2">
170
+ Execution Node Details
171
+ </PanelListItem>
172
+ <PanelDivider />
173
+ <SQLExecutionNodeViewerHelper
174
+ query={node.executionNodes[0].sqlQuery}
175
+ resultColumns={node.executionNodes[0].resultColumns}
176
+ resultType={node.executionNodes[0].resultType}
177
+ executionPlanState={executionPlanState}
178
+ />
179
+ </>
180
+ )}
181
+ <PanelDivider />
182
+ <div className="query-builder__store-mapping-global-graph-fetch__container__result">
183
+ <ResultTypeViewer resultType={node.resultType} />
184
+ </div>
185
+ <PanelDivider />
186
+ <div className="query-builder__store-mapping-global-graph-fetch__container__result">
187
+ <Button
188
+ className="btn--dark execution-node-viewer__unsupported-view__to-text-mode__btn"
189
+ onClick={(): void =>
190
+ executionPlanState.setViewMode(
191
+ EXECUTION_PLAN_VIEW_MODE.JSON,
192
+ )
193
+ }
194
+ text="View JSON"
195
+ />
196
+ </div>
197
+ </div>
198
+ )}
199
+ {selectedTab ===
200
+ RELATIONAL_CROSS_ROOT_QUERY_TABS.TEMP_TABLE_STRATEGY &&
201
+ node.tempTableStrategy && (
202
+ <TempTableStrategyViewer
203
+ tempTableStrategy={node.tempTableStrategy}
204
+ executionPlanState={executionPlanState}
205
+ />
206
+ )}
207
+ {selectedTab ===
208
+ RELATIONAL_CROSS_ROOT_QUERY_TABS.PARENT_TEMP_TABLE_STRATEGY &&
209
+ node.parentTempTableStrategy && (
210
+ <TempTableStrategyViewer
211
+ tempTableStrategy={node.parentTempTableStrategy}
212
+ executionPlanState={executionPlanState}
213
+ />
214
+ )}
215
+ </div>
216
+ </div>
217
+ </PanelContent>
218
+ );
219
+ });
@@ -0,0 +1,204 @@
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 { observer } from 'mobx-react-lite';
18
+ import {
19
+ type ExecutionPlanState,
20
+ EXECUTION_PLAN_VIEW_MODE,
21
+ } from '../../stores/execution-plan/ExecutionPlanState.js';
22
+
23
+ import {
24
+ PanelListItem,
25
+ PanelDivider,
26
+ Button,
27
+ PanelContent,
28
+ clsx,
29
+ } from '@finos/legend-art';
30
+ import {
31
+ type RelationalRootQueryTempTableGraphFetchExecutionNode,
32
+ SQLExecutionNode,
33
+ } from '@finos/legend-graph';
34
+ import { ResultTypeViewer } from './ResultTypeViewer.js';
35
+ import { SQLExecutionNodeViewerHelper } from './SQLExecutionNodeViewer.js';
36
+ import { useState } from 'react';
37
+ import { prettyCONSTName } from '@finos/legend-shared';
38
+ import { ImplementationViewer } from './ImplementationViewer.js';
39
+ import { TempTableStrategyViewer } from './TempTableStrategyViewer.js';
40
+
41
+ enum RELATIONAL_ROOT_QUERY_TABS {
42
+ GENERAL = 'GENERAL',
43
+ TEMP_TABLE = 'TEMP_TABLE_STRATEGY',
44
+ }
45
+
46
+ export const RelationalRootQueryTempTableGraphFetchExecutionNodeViewer: React.FC<{
47
+ node: RelationalRootQueryTempTableGraphFetchExecutionNode;
48
+ executionPlanState: ExecutionPlanState;
49
+ }> = observer((props) => {
50
+ const { node, executionPlanState } = props;
51
+ const applicationStore = executionPlanState.applicationStore;
52
+
53
+ const [selectedTab, setSelectedTab] = useState<RELATIONAL_ROOT_QUERY_TABS>(
54
+ RELATIONAL_ROOT_QUERY_TABS.GENERAL,
55
+ );
56
+
57
+ return (
58
+ <PanelContent
59
+ darkMode={
60
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
61
+ }
62
+ >
63
+ <div className="query-builder__execution-plan-form--editor">
64
+ <div className="panel">
65
+ <div className="panel__header query-builder__execution-plan-form--editor__header--with-tabs">
66
+ <div className="uml-element-editor__tabs">
67
+ {Object.values(RELATIONAL_ROOT_QUERY_TABS).map((tab) => (
68
+ <div
69
+ key={tab}
70
+ onClick={() => setSelectedTab(tab)}
71
+ className={clsx(
72
+ 'query-builder__execution-plan-form--editor__tab',
73
+ {
74
+ 'query-builder__execution-plan-form--editor__tab--active':
75
+ tab === selectedTab,
76
+ },
77
+ )}
78
+ >
79
+ {prettyCONSTName(tab)}
80
+ </div>
81
+ ))}
82
+ </div>
83
+ </div>
84
+ {selectedTab === RELATIONAL_ROOT_QUERY_TABS.GENERAL && (
85
+ <div className="query-builder__store-mapping-global-graph-fetch__container">
86
+ <PanelListItem className="query-builder__store-mapping-global-graph-fetch__container__label">
87
+ Relational Root Query Temp Table Graph Fetch Execution Node
88
+ Details
89
+ </PanelListItem>
90
+ <PanelDivider />
91
+ <table className="table query-builder__store-mapping-global-graph-fetch__container__table">
92
+ <thead>
93
+ <tr>
94
+ <th className="table__cell--left">Property</th>
95
+ <th className="table__cell--left">Details</th>
96
+ </tr>
97
+ </thead>
98
+ <tbody>
99
+ <tr>
100
+ <td className="table__cell--left"> NodeIndex</td>
101
+ <td className="table__cell--left">{node.nodeIndex}</td>
102
+ </tr>
103
+ {node.parentIndex !== undefined && (
104
+ <tr>
105
+ <td className="table__cell--left">ParentIndex</td>
106
+ <td className="table__cell--left">{node.parentIndex}</td>
107
+ </tr>
108
+ )}
109
+ {node.batchSize !== undefined && (
110
+ <tr>
111
+ <td className="table__cell--left">Batch Size</td>
112
+ <td className="table__cell--left">{node.batchSize}</td>
113
+ </tr>
114
+ )}
115
+ {node.checked && (
116
+ <tr>
117
+ <td className="table__cell--left">Checked</td>
118
+ <td className="table__cell--left">
119
+ {node.checked.toString()}
120
+ </td>
121
+ </tr>
122
+ )}
123
+ {node.authDependent !== undefined && (
124
+ <tr>
125
+ <td className="table__cell--left">AuthDependent</td>
126
+ <td className="table__cell--left">
127
+ {node.authDependent.toString()}
128
+ </td>
129
+ </tr>
130
+ )}
131
+ {node.processedTempTableName !== undefined && (
132
+ <tr>
133
+ <td className="table__cell--left">
134
+ processedTempTableName
135
+ </td>
136
+ <td className="table__cell--left">
137
+ {node.processedTempTableName}
138
+ </td>
139
+ </tr>
140
+ )}
141
+ {node.tempTableName && (
142
+ <tr>
143
+ <td className="table__cell--left">tempTableName</td>
144
+ <td className="table__cell--left">
145
+ {node.tempTableName}
146
+ </td>
147
+ </tr>
148
+ )}
149
+ </tbody>
150
+ </table>
151
+ <PanelDivider />
152
+ <div className="query-builder__store-mapping-global-graph-fetch__container__implementation">
153
+ <ImplementationViewer
154
+ node={node}
155
+ executionPlanState={executionPlanState}
156
+ />
157
+ </div>
158
+ <PanelDivider />
159
+ {node.executionNodes.length > 0 &&
160
+ node.executionNodes[0] &&
161
+ node.executionNodes[0] instanceof SQLExecutionNode && (
162
+ <>
163
+ <PanelListItem className="query-builder__store-mapping-global-graph-fetch__container__label2">
164
+ Execution Node Details
165
+ </PanelListItem>
166
+ <PanelDivider />
167
+ <SQLExecutionNodeViewerHelper
168
+ query={node.executionNodes[0].sqlQuery}
169
+ resultColumns={node.executionNodes[0].resultColumns}
170
+ resultType={node.executionNodes[0].resultType}
171
+ executionPlanState={executionPlanState}
172
+ />
173
+ </>
174
+ )}
175
+ <PanelDivider />
176
+ <div className="query-builder__store-mapping-global-graph-fetch__container__result">
177
+ <ResultTypeViewer resultType={node.resultType} />
178
+ </div>
179
+ <PanelDivider />
180
+ <div className="query-builder__store-mapping-global-graph-fetch__container__result">
181
+ <Button
182
+ className="btn--dark execution-node-viewer__unsupported-view__to-text-mode__btn"
183
+ onClick={(): void =>
184
+ executionPlanState.setViewMode(
185
+ EXECUTION_PLAN_VIEW_MODE.JSON,
186
+ )
187
+ }
188
+ text="View JSON"
189
+ />
190
+ </div>
191
+ </div>
192
+ )}
193
+ {selectedTab === RELATIONAL_ROOT_QUERY_TABS.TEMP_TABLE &&
194
+ node.tempTableStrategy && (
195
+ <TempTableStrategyViewer
196
+ tempTableStrategy={node.tempTableStrategy}
197
+ executionPlanState={executionPlanState}
198
+ />
199
+ )}
200
+ </div>
201
+ </div>
202
+ </PanelContent>
203
+ );
204
+ });
@@ -19,9 +19,11 @@ import {
19
19
  type ResultType,
20
20
  TDSResultType,
21
21
  DataTypeResultType,
22
+ PartialClassResultType,
22
23
  } from '@finos/legend-graph';
23
24
  import { DataTypeResultTypeViewer } from './DataTypeResultTypeViewer.js';
24
25
  import { TDSResultTypeViewer } from './TDSResultTypeViewer.js';
26
+ import { PartialClassResultTypeViewer } from './PartialClassResultViewer.js';
25
27
 
26
28
  export const ResultTypeViewer: React.FC<{
27
29
  resultType: ResultType;
@@ -31,6 +33,8 @@ export const ResultTypeViewer: React.FC<{
31
33
  return <DataTypeResultTypeViewer resultType={resultType} />;
32
34
  } else if (resultType instanceof TDSResultType) {
33
35
  return <TDSResultTypeViewer resultType={resultType} />;
36
+ } else if (resultType instanceof PartialClassResultType) {
37
+ return <PartialClassResultTypeViewer resultType={resultType} />;
34
38
  } else {
35
39
  return null;
36
40
  }