@finos/legend-query-builder 3.2.7 → 3.2.8
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderResultPanel.js +28 -6
- package/lib/components/QueryBuilderResultPanel.js.map +1 -1
- package/lib/components/execution-plan/ExecutionPlanViewer.d.ts.map +1 -1
- package/lib/components/execution-plan/ExecutionPlanViewer.js +11 -3
- package/lib/components/execution-plan/ExecutionPlanViewer.js.map +1 -1
- package/lib/components/execution-plan/SQLExecutionNodeViewer.d.ts +2 -2
- package/lib/components/execution-plan/SQLExecutionNodeViewer.d.ts.map +1 -1
- package/lib/components/execution-plan/SQLExecutionNodeViewer.js +15 -4
- package/lib/components/execution-plan/SQLExecutionNodeViewer.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryLoaderState.d.ts.map +1 -1
- package/lib/stores/QueryLoaderState.js +2 -1
- package/lib/stores/QueryLoaderState.js.map +1 -1
- package/package.json +5 -5
- package/src/components/QueryBuilderResultPanel.tsx +88 -2
- package/src/components/execution-plan/ExecutionPlanViewer.tsx +29 -11
- package/src/components/execution-plan/SQLExecutionNodeViewer.tsx +99 -12
- package/src/stores/QueryLoaderState.ts +2 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryLoaderState.d.ts","sourceRoot":"","sources":["../../src/stores/QueryLoaderState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,UAAU,EACf,wBAAwB,EACxB,KAAK,SAAS,EACd,KAAK,sBAAsB,EAE5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,KAAK,WAAW,EAGjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,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5C,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,IAAI;IAInC,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAIxC,6BAA6B,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAIjD,KAAK,IAAI,IAAI;IAIZ,UAAU,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC;IAkBnE,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC;IAqEpD,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC;IAoB7D,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC;IAmB/C,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC;CAkB5D"}
|
@@ -131,6 +131,7 @@ export class QueryLoaderState {
|
|
131
131
|
let searchSpecification = new QuerySearchSpecification();
|
132
132
|
searchSpecification.searchTerm = searchText;
|
133
133
|
searchSpecification.limit = QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT + 1;
|
134
|
+
searchSpecification.exactMatchName = true;
|
134
135
|
searchSpecification.showCurrentUserQueriesOnly =
|
135
136
|
this.showCurrentUserQueriesOnly;
|
136
137
|
if (this.queryBuilderState) {
|
@@ -161,7 +162,7 @@ export class QueryLoaderState {
|
|
161
162
|
try {
|
162
163
|
const query = (yield this.graphManagerState.graphManager.renameQuery(queryId, name));
|
163
164
|
this.onQueryRenamed?.(query);
|
164
|
-
this.applicationStore.notificationService.
|
165
|
+
this.applicationStore.notificationService.notifySuccess('Renamed query successfully');
|
165
166
|
this.renameQueryState.pass();
|
166
167
|
this.searchQueries(this.searchText); // trigger a search to refresh the query list
|
167
168
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"QueryLoaderState.js","sourceRoot":"","sources":["../../src/stores/QueryLoaderState.ts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-1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-query-builder",
|
3
|
-
"version": "3.2.
|
3
|
+
"version": "3.2.8",
|
4
4
|
"description": "Legend query builder core",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -42,10 +42,10 @@
|
|
42
42
|
"test:watch": "jest --watch"
|
43
43
|
},
|
44
44
|
"dependencies": {
|
45
|
-
"@finos/legend-application": "15.0.
|
46
|
-
"@finos/legend-art": "7.0.
|
47
|
-
"@finos/legend-graph": "28.1.
|
48
|
-
"@finos/legend-lego": "1.0.
|
45
|
+
"@finos/legend-application": "15.0.13",
|
46
|
+
"@finos/legend-art": "7.0.14",
|
47
|
+
"@finos/legend-graph": "28.1.8",
|
48
|
+
"@finos/legend-lego": "1.0.6",
|
49
49
|
"@finos/legend-server-depot": "6.0.6",
|
50
50
|
"@finos/legend-shared": "10.0.5",
|
51
51
|
"@finos/legend-storage": "3.0.55",
|
@@ -28,7 +28,18 @@ import {
|
|
28
28
|
ExclamationTriangleIcon,
|
29
29
|
PanelContent,
|
30
30
|
MenuContentDivider,
|
31
|
+
Button,
|
32
|
+
SQLIcon,
|
33
|
+
Dialog,
|
34
|
+
Modal,
|
35
|
+
ModalBody,
|
36
|
+
ModalFooter,
|
37
|
+
ModalFooterButton,
|
38
|
+
ModalHeader,
|
39
|
+
PanelDivider,
|
31
40
|
} from '@finos/legend-art';
|
41
|
+
import { format as formatSQL } from 'sql-formatter';
|
42
|
+
|
32
43
|
import { observer } from 'mobx-react-lite';
|
33
44
|
import { flowResult } from 'mobx';
|
34
45
|
import type { QueryBuilderState } from '../stores/QueryBuilderState.js';
|
@@ -41,6 +52,7 @@ import {
|
|
41
52
|
RawExecutionResult,
|
42
53
|
EnumValueInstanceValue,
|
43
54
|
EnumValueExplicitReference,
|
55
|
+
RelationalExecutionActivities,
|
44
56
|
} from '@finos/legend-graph';
|
45
57
|
import {
|
46
58
|
ActionAlertActionType,
|
@@ -55,8 +67,9 @@ import {
|
|
55
67
|
type PlainObject,
|
56
68
|
prettyDuration,
|
57
69
|
prettyCONSTName,
|
70
|
+
filterByType,
|
58
71
|
} from '@finos/legend-shared';
|
59
|
-
import { type MutableRefObject, forwardRef, useRef } from 'react';
|
72
|
+
import { type MutableRefObject, forwardRef, useRef, useState } from 'react';
|
60
73
|
import {
|
61
74
|
QueryBuilderDerivationProjectionColumnState,
|
62
75
|
QueryBuilderProjectionColumnState,
|
@@ -445,6 +458,22 @@ export const QueryBuilderResultPanel = observer(
|
|
445
458
|
const resultState = queryBuilderState.resultState;
|
446
459
|
const queryParametersState = queryBuilderState.parametersState;
|
447
460
|
const executionResult = resultState.executionResult;
|
461
|
+
const [showSqlModal, setShowSqlModal] = useState(false);
|
462
|
+
const relationalActivities = executionResult?.activities;
|
463
|
+
const executedSqls = relationalActivities
|
464
|
+
?.filter(filterByType(RelationalExecutionActivities))
|
465
|
+
.map((relationalActivity) => relationalActivity.sql);
|
466
|
+
|
467
|
+
let executedSql = '';
|
468
|
+
if (executedSqls?.length && executedSqls.length > 1) {
|
469
|
+
for (let i = 0; i < executedSqls.length; i++) {
|
470
|
+
executedSql += `\n--QUERY #${i + 1}\n`;
|
471
|
+
executedSql += `${executedSqls[i]}\n`;
|
472
|
+
}
|
473
|
+
} else {
|
474
|
+
executedSql += executedSqls?.[0];
|
475
|
+
}
|
476
|
+
|
448
477
|
const fetchStructureImplementation =
|
449
478
|
queryBuilderState.fetchStructureState.implementation;
|
450
479
|
const USER_ATTESTATION_MESSAGE =
|
@@ -464,7 +493,6 @@ export const QueryBuilderResultPanel = observer(
|
|
464
493
|
);
|
465
494
|
}
|
466
495
|
};
|
467
|
-
|
468
496
|
const confirmExport = (format: string): void => {
|
469
497
|
applicationStore.alertService.setActionAlertInfo({
|
470
498
|
message: USER_ATTESTATION_MESSAGE,
|
@@ -529,6 +557,19 @@ export const QueryBuilderResultPanel = observer(
|
|
529
557
|
};
|
530
558
|
const allowSettingPreviewLimit = queryBuilderState.isQuerySupported;
|
531
559
|
|
560
|
+
const copyExpression = (value: string): void => {
|
561
|
+
applicationStore.clipboardService
|
562
|
+
.copyTextToClipboard(value)
|
563
|
+
.then(() =>
|
564
|
+
applicationStore.notificationService.notifySuccess(
|
565
|
+
'SQL Query copied',
|
566
|
+
undefined,
|
567
|
+
2500,
|
568
|
+
),
|
569
|
+
)
|
570
|
+
.catch(applicationStore.alertUnhandledError);
|
571
|
+
};
|
572
|
+
|
532
573
|
const isRunQueryDisabled =
|
533
574
|
!isQueryValid ||
|
534
575
|
resultState.isGeneratingPlan ||
|
@@ -561,14 +602,59 @@ export const QueryBuilderResultPanel = observer(
|
|
561
602
|
data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_RESULT_PANEL}
|
562
603
|
className="panel query-builder__result"
|
563
604
|
>
|
605
|
+
{showSqlModal && executedSqls && (
|
606
|
+
<Dialog
|
607
|
+
open={Boolean(showSqlModal)}
|
608
|
+
onClose={() => setShowSqlModal(false)}
|
609
|
+
>
|
610
|
+
<Modal className="editor-modal" darkMode={true}>
|
611
|
+
<ModalHeader title="Executed SQL Query" />
|
612
|
+
<ModalBody className="query-builder__sql__modal">
|
613
|
+
<>
|
614
|
+
<CodeEditor
|
615
|
+
inputValue={formatSQL(executedSql)}
|
616
|
+
isReadOnly={true}
|
617
|
+
language={CODE_EDITOR_LANGUAGE.SQL}
|
618
|
+
hideMinimap={true}
|
619
|
+
/>
|
620
|
+
|
621
|
+
<PanelDivider />
|
622
|
+
</>
|
623
|
+
</ModalBody>
|
624
|
+
<ModalFooter>
|
625
|
+
<ModalFooterButton
|
626
|
+
formatText={false}
|
627
|
+
onClick={() => copyExpression(executedSql)}
|
628
|
+
text="Copy SQL to Clipboard"
|
629
|
+
/>
|
630
|
+
|
631
|
+
<ModalFooterButton
|
632
|
+
onClick={() => setShowSqlModal(false)}
|
633
|
+
text="Close"
|
634
|
+
/>
|
635
|
+
</ModalFooter>
|
636
|
+
</Modal>
|
637
|
+
</Dialog>
|
638
|
+
)}
|
639
|
+
|
564
640
|
<div className="panel__header">
|
565
641
|
<div className="panel__header__title">
|
566
642
|
<div className="panel__header__title__label">result</div>
|
643
|
+
{executedSqls && (
|
644
|
+
<Button
|
645
|
+
onClick={() => setShowSqlModal(true)}
|
646
|
+
title="Executed SQL"
|
647
|
+
className="query-builder__result__sql__actions"
|
648
|
+
>
|
649
|
+
<SQLIcon />
|
650
|
+
</Button>
|
651
|
+
)}
|
567
652
|
{resultState.pressedRunQuery.isInProgress && (
|
568
653
|
<div className="panel__header__title__label__status">
|
569
654
|
Running Query...
|
570
655
|
</div>
|
571
656
|
)}
|
657
|
+
|
572
658
|
<div className="query-builder__result__analytics">
|
573
659
|
{resultDescription ?? ''}
|
574
660
|
</div>
|
@@ -38,6 +38,8 @@ import {
|
|
38
38
|
ModalFooter,
|
39
39
|
PanelSideBarHeader,
|
40
40
|
ModalFooterButton,
|
41
|
+
PanelHeader,
|
42
|
+
Panel,
|
41
43
|
} from '@finos/legend-art';
|
42
44
|
import {
|
43
45
|
addUniqueEntry,
|
@@ -428,6 +430,9 @@ const ExecutionPlanViewerContent = observer(
|
|
428
430
|
}) => {
|
429
431
|
const { executionPlanState, rawPlan } = props;
|
430
432
|
const plan = executionPlanState.plan;
|
433
|
+
const isDarkMode =
|
434
|
+
!executionPlanState.applicationStore.layoutService
|
435
|
+
.TEMPORARY__isLightColorThemeEnabled;
|
431
436
|
|
432
437
|
return (
|
433
438
|
<div className="execution-plan-viewer__content">
|
@@ -448,7 +453,13 @@ const ExecutionPlanViewerContent = observer(
|
|
448
453
|
</div>
|
449
454
|
</ResizablePanel>
|
450
455
|
<ResizablePanelSplitter>
|
451
|
-
<ResizablePanelSplitterLine
|
456
|
+
<ResizablePanelSplitterLine
|
457
|
+
color={
|
458
|
+
isDarkMode
|
459
|
+
? 'var(--color-dark-grey-200)'
|
460
|
+
: 'var(--color-legacylight-light-grey-300)'
|
461
|
+
}
|
462
|
+
/>
|
452
463
|
</ResizablePanelSplitter>
|
453
464
|
<ResizablePanel>
|
454
465
|
<ExecutionPlanViewPanel
|
@@ -480,6 +491,9 @@ export const ExecutionPlanViewer = observer(
|
|
480
491
|
executionPlanState.setDebugText(undefined);
|
481
492
|
};
|
482
493
|
const rawPlan = executionPlanState.rawPlan;
|
494
|
+
const isDarkMode =
|
495
|
+
!executionPlanState.applicationStore.layoutService
|
496
|
+
.TEMPORARY__isLightColorThemeEnabled;
|
483
497
|
|
484
498
|
if (!rawPlan) {
|
485
499
|
return null;
|
@@ -506,17 +520,21 @@ export const ExecutionPlanViewer = observer(
|
|
506
520
|
/>
|
507
521
|
</ResizablePanel>
|
508
522
|
<ResizablePanelSplitter>
|
509
|
-
<ResizablePanelSplitterLine
|
523
|
+
<ResizablePanelSplitterLine
|
524
|
+
color={
|
525
|
+
isDarkMode
|
526
|
+
? 'var(--color-dark-grey-200)'
|
527
|
+
: 'var(--color-legacylight-light-grey-300)'
|
528
|
+
}
|
529
|
+
/>
|
510
530
|
</ResizablePanelSplitter>
|
511
531
|
<ResizablePanel size={200} minSize={28}>
|
512
|
-
<
|
513
|
-
<
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
</div>
|
519
|
-
</div>
|
532
|
+
<Panel className="panel execution-plan-viewer__debug-panel">
|
533
|
+
<PanelHeader
|
534
|
+
title="DEBUG LOG"
|
535
|
+
keepTitleFormat={true}
|
536
|
+
darkMode={isDarkMode}
|
537
|
+
/>
|
520
538
|
<PanelContent>
|
521
539
|
<CodeEditor
|
522
540
|
inputValue={executionPlanState.debugText}
|
@@ -524,7 +542,7 @@ export const ExecutionPlanViewer = observer(
|
|
524
542
|
language={CODE_EDITOR_LANGUAGE.TEXT}
|
525
543
|
/>
|
526
544
|
</PanelContent>
|
527
|
-
</
|
545
|
+
</Panel>
|
528
546
|
</ResizablePanel>
|
529
547
|
</ResizablePanelGroup>
|
530
548
|
) : (
|
@@ -15,13 +15,19 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
18
|
-
import
|
18
|
+
import {
|
19
|
+
type ExecutionPlanState,
|
20
|
+
EXECUTION_PLAN_VIEW_MODE,
|
21
|
+
} from '../../stores/execution-plan/ExecutionPlanState.js';
|
19
22
|
import { format as formatSQL } from 'sql-formatter';
|
20
|
-
import type
|
23
|
+
import { type SQLResultColumn, stringifyDataType } from '@finos/legend-graph';
|
21
24
|
import {
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
+
PanelListItem,
|
26
|
+
CopyIcon,
|
27
|
+
PanelDivider,
|
28
|
+
Button,
|
29
|
+
PanelContent,
|
30
|
+
} from '@finos/legend-art';
|
25
31
|
|
26
32
|
/**
|
27
33
|
* TODO: Create a new `AbstractPlugin` for this, called `ExecutionPlanViewerPlugin`
|
@@ -35,14 +41,95 @@ export const SQLExecutionNodeViewer: React.FC<{
|
|
35
41
|
resultColumns: SQLResultColumn[];
|
36
42
|
executionPlanState: ExecutionPlanState;
|
37
43
|
}> = observer((props) => {
|
38
|
-
const { query } = props;
|
44
|
+
const { query, resultColumns, executionPlanState } = props;
|
39
45
|
|
46
|
+
const applicationStore = executionPlanState.applicationStore;
|
47
|
+
const copyExpression = (value: string): void => {
|
48
|
+
applicationStore.clipboardService
|
49
|
+
.copyTextToClipboard(value)
|
50
|
+
.then(() =>
|
51
|
+
applicationStore.notificationService.notifySuccess(
|
52
|
+
'SQL Query copied',
|
53
|
+
undefined,
|
54
|
+
2500,
|
55
|
+
),
|
56
|
+
)
|
57
|
+
.catch(applicationStore.alertUnhandledError);
|
58
|
+
};
|
40
59
|
return (
|
41
|
-
<
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
60
|
+
<PanelContent
|
61
|
+
darkMode={
|
62
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
63
|
+
}
|
64
|
+
>
|
65
|
+
<div className="query-builder__sql__container">
|
66
|
+
<PanelDivider />
|
67
|
+
<div key={query}>
|
68
|
+
<div className="query-builder__sql__container__item__label">
|
69
|
+
<PanelListItem>
|
70
|
+
SQL
|
71
|
+
<div>
|
72
|
+
<button
|
73
|
+
onClick={() => {
|
74
|
+
copyExpression(query);
|
75
|
+
}}
|
76
|
+
title="Copy SQL Expression"
|
77
|
+
className="query-builder__sql__container__icon"
|
78
|
+
>
|
79
|
+
<CopyIcon />
|
80
|
+
</button>
|
81
|
+
</div>
|
82
|
+
</PanelListItem>
|
83
|
+
</div>
|
84
|
+
<PanelListItem className="query-builder__sql__container__item">
|
85
|
+
<pre>{formatSQL(query)} </pre>
|
86
|
+
</PanelListItem>
|
87
|
+
<PanelDivider />
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
<div className="query-builder__sql__container">
|
91
|
+
<div>
|
92
|
+
<PanelListItem className="query-builder__sql__container__item__label">
|
93
|
+
Result Columns
|
94
|
+
</PanelListItem>
|
95
|
+
<PanelDivider />
|
96
|
+
<table className="table query-builder__sql__container__table">
|
97
|
+
<thead>
|
98
|
+
<tr>
|
99
|
+
<th className="table__cell--left">Label</th>
|
100
|
+
<th className="table__cell--left">Data Type</th>
|
101
|
+
</tr>
|
102
|
+
</thead>
|
103
|
+
<tbody>
|
104
|
+
{resultColumns.map((column) => (
|
105
|
+
<tr key={column.label}>
|
106
|
+
<td className="table__cell--left">
|
107
|
+
{column.label.replaceAll(`"`, '')}
|
108
|
+
</td>
|
109
|
+
|
110
|
+
{column.dataType && (
|
111
|
+
<td className="table__cell--left">
|
112
|
+
{stringifyDataType(column.dataType)}
|
113
|
+
</td>
|
114
|
+
)}
|
115
|
+
</tr>
|
116
|
+
))}
|
117
|
+
</tbody>
|
118
|
+
</table>
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
<PanelDivider />
|
122
|
+
|
123
|
+
<div className="query-builder__sql__container">
|
124
|
+
<Button
|
125
|
+
className="btn--dark execution-node-viewer__unsupported-view__to-text-mode__btn"
|
126
|
+
onClick={(): void =>
|
127
|
+
executionPlanState.setViewMode(EXECUTION_PLAN_VIEW_MODE.JSON)
|
128
|
+
}
|
129
|
+
text="View JSON"
|
130
|
+
/>
|
131
|
+
</div>
|
132
|
+
<PanelDivider />
|
133
|
+
</PanelContent>
|
47
134
|
);
|
48
135
|
});
|
@@ -205,6 +205,7 @@ export class QueryLoaderState {
|
|
205
205
|
let searchSpecification = new QuerySearchSpecification();
|
206
206
|
searchSpecification.searchTerm = searchText;
|
207
207
|
searchSpecification.limit = QUERY_LOADER_TYPEAHEAD_SEARCH_LIMIT + 1;
|
208
|
+
searchSpecification.exactMatchName = true;
|
208
209
|
searchSpecification.showCurrentUserQueriesOnly =
|
209
210
|
this.showCurrentUserQueriesOnly;
|
210
211
|
if (this.queryBuilderState) {
|
@@ -246,7 +247,7 @@ export class QueryLoaderState {
|
|
246
247
|
name,
|
247
248
|
)) as Query;
|
248
249
|
this.onQueryRenamed?.(query);
|
249
|
-
this.applicationStore.notificationService.
|
250
|
+
this.applicationStore.notificationService.notifySuccess(
|
250
251
|
'Renamed query successfully',
|
251
252
|
);
|
252
253
|
this.renameQueryState.pass();
|