@finos/legend-query-builder 4.14.18 → 4.14.19
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilder.d.ts.map +1 -1
- package/lib/components/QueryBuilder.js +5 -3
- package/lib/components/QueryBuilder.js.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.js +71 -45
- package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
- package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderDiffPanel.js +2 -1
- package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +25 -26
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +11 -2
- package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderPropertyExpressionEditor.js +35 -10
- package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
- package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
- package/lib/components/QueryBuilderSideBar.js +6 -1
- package/lib/components/QueryBuilderSideBar.js.map +1 -1
- package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
- package/lib/components/QueryBuilderTextEditor.js +3 -3
- package/lib/components/QueryBuilderTextEditor.js.map +1 -1
- package/lib/components/QueryLoader.d.ts.map +1 -1
- package/lib/components/QueryLoader.js +5 -3
- package/lib/components/QueryLoader.js.map +1 -1
- package/lib/components/QueryUsageViewer.d.ts.map +1 -1
- package/lib/components/QueryUsageViewer.js +2 -2
- package/lib/components/QueryUsageViewer.js.map +1 -1
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts +2 -0
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts.map +1 -1
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +19 -2
- package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
- package/lib/components/data-access/DataAccessOverview.d.ts.map +1 -1
- package/lib/components/data-access/DataAccessOverview.js +6 -1
- package/lib/components/data-access/DataAccessOverview.js.map +1 -1
- package/lib/components/execution-plan/ExecutionPlanViewer.d.ts.map +1 -1
- package/lib/components/execution-plan/ExecutionPlanViewer.js +6 -6
- package/lib/components/execution-plan/ExecutionPlanViewer.js.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderExplorerPanel.js +3 -2
- package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js +3 -2
- package/lib/components/explorer/QueryBuilderMilestoningEditor.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js +6 -3
- package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +4 -3
- package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
- package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +11 -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 +2 -2
- package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
- package/lib/components/result/QueryBuilderResultPanel.d.ts.map +1 -1
- package/lib/components/result/QueryBuilderResultPanel.js +2 -1
- package/lib/components/result/QueryBuilderResultPanel.js.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSGridResult.d.ts.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSGridResult.js +5 -1
- package/lib/components/result/tds/QueryBuilderTDSGridResult.js.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.d.ts.map +1 -1
- package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js +11 -2
- package/lib/components/result/tds/QueryBuilderTDSSimpleGridResult.js.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.js +25 -22
- package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
- package/lib/components/shared/CustomDatePicker.d.ts.map +1 -1
- package/lib/components/shared/CustomDatePicker.js +8 -5
- package/lib/components/shared/CustomDatePicker.js.map +1 -1
- package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaEditor.js +17 -3
- package/lib/components/shared/LambdaEditor.js.map +1 -1
- package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
- package/lib/components/shared/LambdaParameterValuesEditor.js +2 -2
- package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -1
- package/lib/components/shared/QueryBuilderPropertyInfoTooltip.d.ts +6 -0
- package/lib/components/shared/QueryBuilderPropertyInfoTooltip.d.ts.map +1 -1
- package/lib/components/shared/QueryBuilderPropertyInfoTooltip.js +40 -3
- package/lib/components/shared/QueryBuilderPropertyInfoTooltip.js.map +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
- package/lib/components/watermark/QueryBuilderWatermark.js +28 -12
- package/lib/components/watermark/QueryBuilderWatermark.js.map +1 -1
- package/lib/index.css +17 -1
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/QueryBuilderConstantsState.d.ts +1 -0
- package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -1
- package/lib/stores/QueryBuilderConstantsState.js +7 -1
- package/lib/stores/QueryBuilderConstantsState.js.map +1 -1
- package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts +5 -0
- package/lib/stores/QueryBuilder_LegendApplicationPlugin_Extension.d.ts.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts +1 -2
- package/lib/stores/watermark/QueryBuilderWatermarkState.d.ts.map +1 -1
- package/lib/stores/watermark/QueryBuilderWatermarkState.js +2 -12
- package/lib/stores/watermark/QueryBuilderWatermarkState.js.map +1 -1
- package/package.json +8 -8
- package/src/components/QueryBuilder.tsx +14 -2
- package/src/components/QueryBuilderConstantExpressionPanel.tsx +145 -69
- package/src/components/QueryBuilderDiffPanel.tsx +10 -2
- package/src/components/QueryBuilderParametersPanel.tsx +42 -37
- package/src/components/QueryBuilderPropertyExpressionEditor.tsx +87 -24
- package/src/components/QueryBuilderSideBar.tsx +20 -0
- package/src/components/QueryBuilderTextEditor.tsx +6 -4
- package/src/components/QueryLoader.tsx +12 -3
- package/src/components/QueryUsageViewer.tsx +7 -1
- package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +40 -4
- package/src/components/data-access/DataAccessOverview.tsx +9 -1
- package/src/components/execution-plan/ExecutionPlanViewer.tsx +11 -8
- package/src/components/explorer/QueryBuilderExplorerPanel.tsx +5 -2
- package/src/components/explorer/QueryBuilderMilestoningEditor.tsx +5 -2
- package/src/components/fetch-structure/QueryBuilderGraphFetchTreePanel.tsx +12 -5
- package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +8 -4
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +56 -72
- package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +8 -2
- package/src/components/result/QueryBuilderResultPanel.tsx +8 -1
- package/src/components/result/tds/QueryBuilderTDSGridResult.tsx +6 -3
- package/src/components/result/tds/QueryBuilderTDSSimpleGridResult.tsx +14 -4
- package/src/components/shared/BasicValueSpecificationEditor.tsx +39 -25
- package/src/components/shared/CustomDatePicker.tsx +18 -5
- package/src/components/shared/LambdaEditor.tsx +27 -11
- package/src/components/shared/LambdaParameterValuesEditor.tsx +4 -1
- package/src/components/shared/QueryBuilderPropertyInfoTooltip.tsx +115 -64
- package/src/components/watermark/QueryBuilderWatermark.tsx +60 -19
- package/src/stores/QueryBuilderConstantsState.ts +12 -0
- package/src/stores/QueryBuilder_LegendApplicationPlugin_Extension.ts +9 -0
- package/src/stores/watermark/QueryBuilderWatermarkState.ts +2 -12
@@ -14,7 +14,13 @@
|
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
16
|
|
17
|
-
import {
|
17
|
+
import {
|
18
|
+
useCallback,
|
19
|
+
useEffect,
|
20
|
+
useRef,
|
21
|
+
useState,
|
22
|
+
type ChangeEvent,
|
23
|
+
} from 'react';
|
18
24
|
import {
|
19
25
|
clsx,
|
20
26
|
Dialog,
|
@@ -26,6 +32,7 @@ import {
|
|
26
32
|
ModalBody,
|
27
33
|
ModalFooter,
|
28
34
|
ModalFooterButton,
|
35
|
+
InputWithInlineValidation,
|
29
36
|
} from '@finos/legend-art';
|
30
37
|
import { observer } from 'mobx-react-lite';
|
31
38
|
import {
|
@@ -301,6 +308,8 @@ const DerivedPropertyExpressionEditor = observer(
|
|
301
308
|
export const QueryBuilderPropertyExpressionEditor = observer(
|
302
309
|
(props: { propertyExpressionState: QueryBuilderPropertyExpressionState }) => {
|
303
310
|
const { propertyExpressionState } = props;
|
311
|
+
const applicationStore =
|
312
|
+
propertyExpressionState.queryBuilderState.applicationStore;
|
304
313
|
const handleClose = (): void =>
|
305
314
|
propertyExpressionState.setIsEditingDerivedProperty(false);
|
306
315
|
const isParameterCompatibleWithDerivedProperty = (
|
@@ -334,7 +343,9 @@ export const QueryBuilderPropertyExpressionEditor = observer(
|
|
334
343
|
}}
|
335
344
|
>
|
336
345
|
<Modal
|
337
|
-
darkMode={
|
346
|
+
darkMode={
|
347
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
348
|
+
}
|
338
349
|
className="editor-modal query-builder-property-editor"
|
339
350
|
>
|
340
351
|
<ModalHeader title="Derived Property" />
|
@@ -368,6 +379,72 @@ export const QueryBuilderPropertyExpressionEditor = observer(
|
|
368
379
|
},
|
369
380
|
);
|
370
381
|
|
382
|
+
export const QueryBuilderEditablePropertyName = observer(
|
383
|
+
(props: {
|
384
|
+
columnName: string;
|
385
|
+
changeColumnName?:
|
386
|
+
| ((event: ChangeEvent<HTMLInputElement>) => void)
|
387
|
+
| undefined;
|
388
|
+
error: string | undefined;
|
389
|
+
title: string;
|
390
|
+
}) => {
|
391
|
+
const { columnName, changeColumnName, error, title } = props;
|
392
|
+
|
393
|
+
const [isEditingColumnName, setIsEditingColumnName] = useState(false);
|
394
|
+
const columnNameInputRef = useRef<HTMLInputElement>(null);
|
395
|
+
|
396
|
+
useEffect(() => {
|
397
|
+
if (isEditingColumnName) {
|
398
|
+
columnNameInputRef.current?.focus();
|
399
|
+
}
|
400
|
+
}, [isEditingColumnName, columnNameInputRef]);
|
401
|
+
|
402
|
+
return isEditingColumnName ? (
|
403
|
+
<div className="query-builder__property__name__editor">
|
404
|
+
<InputWithInlineValidation
|
405
|
+
className="query-builder__property__name__editor__input input-group__input"
|
406
|
+
spellCheck={false}
|
407
|
+
value={columnName}
|
408
|
+
onChange={changeColumnName}
|
409
|
+
onKeyDown={(event: React.KeyboardEvent<HTMLInputElement>) => {
|
410
|
+
if (event.key === 'Enter') {
|
411
|
+
setIsEditingColumnName(false);
|
412
|
+
}
|
413
|
+
}}
|
414
|
+
onBlur={() => {
|
415
|
+
setIsEditingColumnName(false);
|
416
|
+
}}
|
417
|
+
error={error}
|
418
|
+
ref={columnNameInputRef}
|
419
|
+
draggable={true}
|
420
|
+
onDragStart={(e: React.DragEvent<HTMLInputElement>) => {
|
421
|
+
// The below 2 lines are to allow dragging to select text in the input instead of
|
422
|
+
// dragging the draggable element containing the input.
|
423
|
+
e.preventDefault();
|
424
|
+
e.stopPropagation();
|
425
|
+
}}
|
426
|
+
/>
|
427
|
+
</div>
|
428
|
+
) : (
|
429
|
+
<div className="query-builder__property__name__display" title={title}>
|
430
|
+
<span
|
431
|
+
className={clsx('query-builder__property__name__display__content', {
|
432
|
+
'query-builder__property__name__display__content--error': error,
|
433
|
+
'editable-value': changeColumnName,
|
434
|
+
})}
|
435
|
+
onClick={() => {
|
436
|
+
if (changeColumnName) {
|
437
|
+
setIsEditingColumnName(true);
|
438
|
+
}
|
439
|
+
}}
|
440
|
+
>
|
441
|
+
{columnName}
|
442
|
+
</span>
|
443
|
+
</div>
|
444
|
+
);
|
445
|
+
},
|
446
|
+
);
|
447
|
+
|
371
448
|
export const QueryBuilderPropertyExpressionBadge = observer(
|
372
449
|
(props: {
|
373
450
|
columnName?: string;
|
@@ -375,14 +452,14 @@ export const QueryBuilderPropertyExpressionBadge = observer(
|
|
375
452
|
onPropertyExpressionChange: (
|
376
453
|
node: QueryBuilderExplorerTreePropertyNodeData,
|
377
454
|
) => void;
|
378
|
-
|
379
|
-
error?:
|
455
|
+
changeColumnName?: (event: ChangeEvent<HTMLInputElement>) => void;
|
456
|
+
error?: string | undefined;
|
380
457
|
}) => {
|
381
458
|
const {
|
382
459
|
columnName,
|
383
460
|
propertyExpressionState,
|
384
461
|
onPropertyExpressionChange,
|
385
|
-
|
462
|
+
changeColumnName,
|
386
463
|
error,
|
387
464
|
} = props;
|
388
465
|
const type =
|
@@ -446,26 +523,12 @@ export const QueryBuilderPropertyExpressionBadge = observer(
|
|
446
523
|
},
|
447
524
|
)}
|
448
525
|
>
|
449
|
-
<
|
450
|
-
|
526
|
+
<QueryBuilderEditablePropertyName
|
527
|
+
columnName={columnName ?? propertyExpressionState.title}
|
528
|
+
changeColumnName={changeColumnName}
|
529
|
+
error={error}
|
451
530
|
title={`${propertyExpressionState.title} - ${propertyExpressionState.path}`}
|
452
|
-
|
453
|
-
<span
|
454
|
-
className={clsx(
|
455
|
-
'query-builder-property-expression-badge__property__content',
|
456
|
-
{
|
457
|
-
'query-builder-property-expression-badge__property__content--error':
|
458
|
-
error,
|
459
|
-
'editable-value': !!setIsEditingColumnName,
|
460
|
-
},
|
461
|
-
)}
|
462
|
-
onClick={() => {
|
463
|
-
setIsEditingColumnName?.(true);
|
464
|
-
}}
|
465
|
-
>
|
466
|
-
{columnName ?? propertyExpressionState.title}
|
467
|
-
</span>
|
468
|
-
</div>
|
531
|
+
/>
|
469
532
|
{hasDerivedPropertyInExpression && (
|
470
533
|
<button
|
471
534
|
className={clsx(
|
@@ -49,6 +49,7 @@ import {
|
|
49
49
|
type PackageableElementOption,
|
50
50
|
} from '@finos/legend-lego/graph-editor';
|
51
51
|
import { MilestoningParametersEditor } from './explorer/QueryBuilderMilestoningEditor.js';
|
52
|
+
import type { QueryBuilder_LegendApplicationPlugin_Extension } from '../stores/QueryBuilder_LegendApplicationPlugin_Extension.js';
|
52
53
|
|
53
54
|
export const getParameterValue = (
|
54
55
|
parameter: ValueSpecification | undefined,
|
@@ -602,6 +603,22 @@ export const QueryBuilderSidebar = observer(
|
|
602
603
|
children: React.ReactNode;
|
603
604
|
}) => {
|
604
605
|
const { queryBuilderState, children } = props;
|
606
|
+
const applicationStore = useApplicationStore();
|
607
|
+
const extraTemplateQueryPanelContentRenderer =
|
608
|
+
applicationStore.pluginManager
|
609
|
+
.getApplicationPlugins()
|
610
|
+
.flatMap(
|
611
|
+
(plugin) =>
|
612
|
+
(
|
613
|
+
plugin as QueryBuilder_LegendApplicationPlugin_Extension
|
614
|
+
).getExtraTemplateQueryPanelContentRenderer?.() ?? [],
|
615
|
+
);
|
616
|
+
const templateQueryPanelContentTab =
|
617
|
+
extraTemplateQueryPanelContentRenderer[0] ? (
|
618
|
+
extraTemplateQueryPanelContentRenderer[0](queryBuilderState)
|
619
|
+
) : (
|
620
|
+
<></>
|
621
|
+
);
|
605
622
|
|
606
623
|
return (
|
607
624
|
<div
|
@@ -620,6 +637,9 @@ export const QueryBuilderSidebar = observer(
|
|
620
637
|
)}
|
621
638
|
</div>
|
622
639
|
</div>
|
640
|
+
<div className="query-builder__template-query">
|
641
|
+
{templateQueryPanelContentTab}
|
642
|
+
</div>
|
623
643
|
<div className="query-builder__side-bar__content">{children}</div>
|
624
644
|
</div>
|
625
645
|
);
|
@@ -71,7 +71,9 @@ export const QueryBuilderTextEditor = observer(
|
|
71
71
|
}}
|
72
72
|
>
|
73
73
|
<Modal
|
74
|
-
darkMode={
|
74
|
+
darkMode={
|
75
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
76
|
+
}
|
75
77
|
className={clsx('editor-modal query-builder-text-mode__modal', {
|
76
78
|
'query-builder-text-mode__modal--has-error': Boolean(
|
77
79
|
queryTextEditorState.parserError,
|
@@ -135,13 +137,13 @@ export const QueryBuilderTextEditor = observer(
|
|
135
137
|
text="Discard Changes"
|
136
138
|
/>
|
137
139
|
)}
|
138
|
-
<
|
139
|
-
className="btn btn--dark"
|
140
|
+
<ModalFooterButton
|
140
141
|
onClick={close}
|
141
142
|
disabled={
|
142
143
|
Boolean(queryTextEditorState.parserError) ||
|
143
144
|
queryBuilderState.textEditorState.closingQueryState.isInProgress
|
144
145
|
}
|
146
|
+
type="secondary"
|
145
147
|
>
|
146
148
|
{queryBuilderState.textEditorState.closingQueryState
|
147
149
|
.isInProgress ? (
|
@@ -154,7 +156,7 @@ export const QueryBuilderTextEditor = observer(
|
|
154
156
|
) : (
|
155
157
|
<> Close </>
|
156
158
|
)}
|
157
|
-
</
|
159
|
+
</ModalFooterButton>
|
158
160
|
</ModalFooter>
|
159
161
|
</Modal>
|
160
162
|
</Dialog>
|
@@ -59,6 +59,7 @@ import {
|
|
59
59
|
const QueryPreviewViewer = observer(
|
60
60
|
(props: { queryLoaderState: QueryLoaderState }) => {
|
61
61
|
const { queryLoaderState } = props;
|
62
|
+
const applicationStore = queryLoaderState.applicationStore;
|
62
63
|
const close = (): void => {
|
63
64
|
queryLoaderState.setShowPreviewViewer(false);
|
64
65
|
};
|
@@ -72,7 +73,12 @@ const QueryPreviewViewer = observer(
|
|
72
73
|
paper: 'editor-modal__content',
|
73
74
|
}}
|
74
75
|
>
|
75
|
-
<Modal
|
76
|
+
<Modal
|
77
|
+
className="editor-modal"
|
78
|
+
darkMode={
|
79
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
80
|
+
}
|
81
|
+
>
|
76
82
|
<ModalHeader
|
77
83
|
title={
|
78
84
|
guaranteeNonNullable(queryLoaderState.queryPreviewContent).name
|
@@ -89,7 +95,7 @@ const QueryPreviewViewer = observer(
|
|
89
95
|
/>
|
90
96
|
</ModalBody>
|
91
97
|
<ModalFooter>
|
92
|
-
<ModalFooterButton onClick={close} text="Close" />
|
98
|
+
<ModalFooterButton onClick={close} text="Close" type="secondary" />
|
93
99
|
</ModalFooter>
|
94
100
|
</Modal>
|
95
101
|
</Dialog>
|
@@ -456,6 +462,7 @@ export const QueryLoaderDialog = observer(
|
|
456
462
|
loadActionLabel?: string | undefined;
|
457
463
|
}) => {
|
458
464
|
const { queryLoaderState, title, loadActionLabel } = props;
|
465
|
+
const applicationStore = queryLoaderState.applicationStore;
|
459
466
|
|
460
467
|
const close = (): void => {
|
461
468
|
queryLoaderState.setQueryLoaderDialogOpen(false);
|
@@ -475,7 +482,9 @@ export const QueryLoaderDialog = observer(
|
|
475
482
|
}}
|
476
483
|
>
|
477
484
|
<Modal
|
478
|
-
darkMode={
|
485
|
+
darkMode={
|
486
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
487
|
+
}
|
479
488
|
className="modal query-loader__dialog__body__content"
|
480
489
|
>
|
481
490
|
<div className="modal query-loader__dialog__header">
|
@@ -56,7 +56,12 @@ export const QueryUsageViewer = observer(
|
|
56
56
|
open={resultState.isQueryUsageViewerOpened}
|
57
57
|
onClose={() => resultState.setIsQueryUsageViewerOpened(false)}
|
58
58
|
>
|
59
|
-
<Modal
|
59
|
+
<Modal
|
60
|
+
className="query-builder__usage-viewer__modal"
|
61
|
+
darkMode={
|
62
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
63
|
+
}
|
64
|
+
>
|
60
65
|
<ModalHeader title="Query Usage" />
|
61
66
|
<ModalBody className="query-builder__usage-viewer__body">
|
62
67
|
<>
|
@@ -102,6 +107,7 @@ export const QueryUsageViewer = observer(
|
|
102
107
|
<ModalFooterButton
|
103
108
|
onClick={() => resultState.setIsQueryUsageViewerOpened(false)}
|
104
109
|
text="Close"
|
110
|
+
type="secondary"
|
105
111
|
/>
|
106
112
|
</ModalFooter>
|
107
113
|
</Modal>
|
@@ -52,15 +52,19 @@ import {
|
|
52
52
|
import { STYLE_PREFIX, STYLE_PREFIX__DARK } from '@finos/legend-art';
|
53
53
|
import { expect } from '@jest/globals';
|
54
54
|
|
55
|
+
const getSelectorContainerClassName = (lightMode?: boolean): string =>
|
56
|
+
'.' + `${lightMode ? STYLE_PREFIX : STYLE_PREFIX__DARK}__value-container`;
|
57
|
+
|
58
|
+
const getSelectorInputClassName = (lightMode?: boolean): string =>
|
59
|
+
'.' + `${lightMode ? STYLE_PREFIX : STYLE_PREFIX__DARK}__single-value`;
|
60
|
+
|
55
61
|
export const selectFromCustomSelectorInput = (
|
56
62
|
selectorContainer: HTMLElement,
|
57
63
|
optionText: string,
|
58
64
|
lightMode?: boolean,
|
59
65
|
): void => {
|
60
|
-
const selectorContainerClassName =
|
61
|
-
|
62
|
-
const selectorInputValue =
|
63
|
-
'.' + `${lightMode ? STYLE_PREFIX : STYLE_PREFIX__DARK}__single-value`;
|
66
|
+
const selectorContainerClassName = getSelectorContainerClassName(lightMode);
|
67
|
+
const selectorInputValue = getSelectorInputClassName(lightMode);
|
64
68
|
|
65
69
|
let foundOptionText = false;
|
66
70
|
const selector = selectorContainer.querySelector(
|
@@ -106,6 +110,38 @@ export const selectFromCustomSelectorInput = (
|
|
106
110
|
}
|
107
111
|
};
|
108
112
|
|
113
|
+
export const selectFirstOptionFromCustomSelectorInput = (
|
114
|
+
selectorContainer: HTMLElement,
|
115
|
+
lightMode?: boolean,
|
116
|
+
): void => {
|
117
|
+
const selectorContainerClassName = getSelectorContainerClassName(lightMode);
|
118
|
+
const selectorInputValue = getSelectorInputClassName(lightMode);
|
119
|
+
|
120
|
+
const selector = selectorContainer.querySelector(
|
121
|
+
selectorContainerClassName,
|
122
|
+
) as HTMLSelectElement;
|
123
|
+
|
124
|
+
fireEvent.keyDown(selector, { key: 'ArrowDown' });
|
125
|
+
fireEvent.keyDown(selector, { key: 'Enter' });
|
126
|
+
expect(selector.querySelector(selectorInputValue)).not.toBeNull();
|
127
|
+
};
|
128
|
+
|
129
|
+
export const getCustomSelectorInputValue = (
|
130
|
+
selectorContainer: HTMLElement,
|
131
|
+
lightMode?: boolean,
|
132
|
+
): string | null => {
|
133
|
+
const selectorContainerClassName = getSelectorContainerClassName(lightMode);
|
134
|
+
const selectorInputValue = getSelectorInputClassName(lightMode);
|
135
|
+
|
136
|
+
const selector = guaranteeNonNullable(
|
137
|
+
selectorContainer.querySelector(selectorContainerClassName),
|
138
|
+
) as HTMLSelectElement;
|
139
|
+
const selectorInput = guaranteeNonNullable(
|
140
|
+
selector.querySelector(selectorInputValue),
|
141
|
+
);
|
142
|
+
return selectorInput.textContent;
|
143
|
+
};
|
144
|
+
|
109
145
|
export const dragAndDrop = async (
|
110
146
|
source: HTMLElement,
|
111
147
|
drop: HTMLElement,
|
@@ -217,9 +217,17 @@ const AccessStatusCellRenderer = observer(
|
|
217
217
|
const DataAccessOverviewGrid = observer(
|
218
218
|
(props: { dataAccessState: DataAccessState }) => {
|
219
219
|
const { dataAccessState } = props;
|
220
|
+
const darkMode =
|
221
|
+
!dataAccessState.applicationStore.layoutService
|
222
|
+
.TEMPORARY__isLightColorThemeEnabled;
|
220
223
|
|
221
224
|
return (
|
222
|
-
<div
|
225
|
+
<div
|
226
|
+
className={clsx('data-access-overview__grid', {
|
227
|
+
'ag-theme-balham': !darkMode,
|
228
|
+
'ag-theme-balham-dark': darkMode,
|
229
|
+
})}
|
230
|
+
>
|
223
231
|
<DataGrid
|
224
232
|
rowData={dataAccessState.datasets}
|
225
233
|
gridOptions={{
|
@@ -148,11 +148,13 @@ export const ExecutionPlanViewerPanelContent: React.FC<{
|
|
148
148
|
executionPlanState: ExecutionPlanState;
|
149
149
|
}> = observer((props) => {
|
150
150
|
const { executionPlanState } = props;
|
151
|
-
const applicationStore = executionPlanState.applicationStore;
|
152
151
|
const globalImplementationSupport =
|
153
152
|
executionPlanState.plan?.globalImplementationSupport;
|
154
153
|
const templateFunctions =
|
155
154
|
executionPlanState.plan?.processingTemplateFunctions ?? [];
|
155
|
+
const isDarkMode =
|
156
|
+
!executionPlanState.applicationStore.layoutService
|
157
|
+
.TEMPORARY__isLightColorThemeEnabled;
|
156
158
|
|
157
159
|
if (
|
158
160
|
globalImplementationSupport &&
|
@@ -210,10 +212,7 @@ export const ExecutionPlanViewerPanelContent: React.FC<{
|
|
210
212
|
<ResizablePanelGroup orientation="vertical">
|
211
213
|
<ResizablePanel minSize={30} size={400}>
|
212
214
|
<PanelContent
|
213
|
-
darkMode={
|
214
|
-
!applicationStore.layoutService
|
215
|
-
.TEMPORARY__isLightColorThemeEnabled
|
216
|
-
}
|
215
|
+
darkMode={isDarkMode}
|
217
216
|
className="query-builder__java__container__panel"
|
218
217
|
>
|
219
218
|
<div className="query-builder__java__container">
|
@@ -773,7 +772,7 @@ const ExecutionPlanViewerContent = observer(
|
|
773
772
|
<ResizablePanel size={300} minSize={300}>
|
774
773
|
<div className="panel execution-plan-viewer__explorer">
|
775
774
|
<PanelSideBarHeader
|
776
|
-
darkMode={
|
775
|
+
darkMode={isDarkMode}
|
777
776
|
title="execution plan explorer"
|
778
777
|
/>
|
779
778
|
<div className="panel__content execution-plan-viewer__explorer__content__container">
|
@@ -846,7 +845,7 @@ export const ExecutionPlanViewer = observer(
|
|
846
845
|
paper: 'editor-modal__content',
|
847
846
|
}}
|
848
847
|
>
|
849
|
-
<Modal className="editor-modal" darkMode={
|
848
|
+
<Modal className="editor-modal" darkMode={isDarkMode}>
|
850
849
|
<ModalHeader title="Execution Plan" />
|
851
850
|
<ModalBody>
|
852
851
|
{executionPlanState.debugText ? (
|
@@ -891,7 +890,11 @@ export const ExecutionPlanViewer = observer(
|
|
891
890
|
)}
|
892
891
|
</ModalBody>
|
893
892
|
<ModalFooter>
|
894
|
-
<ModalFooterButton
|
893
|
+
<ModalFooterButton
|
894
|
+
onClick={closePlanViewer}
|
895
|
+
text="Close"
|
896
|
+
type="secondary"
|
897
|
+
/>
|
895
898
|
</ModalFooter>
|
896
899
|
</Modal>
|
897
900
|
</Dialog>
|
@@ -217,6 +217,7 @@ export const QueryBuilderSubclassInfoTooltip: React.FC<{
|
|
217
217
|
const QueryBuilderExplorerPreviewDataModal = observer(
|
218
218
|
(props: { queryBuilderState: QueryBuilderState }) => {
|
219
219
|
const { queryBuilderState } = props;
|
220
|
+
const applicationStore = queryBuilderState.applicationStore;
|
220
221
|
const previewDataState = queryBuilderState.explorerState.previewDataState;
|
221
222
|
const close = (): void => previewDataState.setPreviewData(undefined);
|
222
223
|
|
@@ -234,7 +235,9 @@ const QueryBuilderExplorerPreviewDataModal = observer(
|
|
234
235
|
}}
|
235
236
|
>
|
236
237
|
<Modal
|
237
|
-
darkMode={
|
238
|
+
darkMode={
|
239
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
240
|
+
}
|
238
241
|
className="editor-modal query-builder__explorer__preview-data-modal"
|
239
242
|
>
|
240
243
|
<ModalHeader title={prettyCONSTName(previewDataState.propertyName)} />
|
@@ -276,7 +279,7 @@ const QueryBuilderExplorerPreviewDataModal = observer(
|
|
276
279
|
)}
|
277
280
|
</ModalBody>
|
278
281
|
<ModalFooter>
|
279
|
-
<ModalFooterButton text="Close" onClick={close} />
|
282
|
+
<ModalFooterButton text="Close" onClick={close} type="secondary" />
|
280
283
|
</ModalFooter>
|
281
284
|
</Modal>
|
282
285
|
</Dialog>
|
@@ -281,6 +281,7 @@ const AllVersionsInRangelMilestoningParametersEditor = observer(
|
|
281
281
|
export const MilestoningParametersEditor = observer(
|
282
282
|
(props: { queryBuilderState: QueryBuilderState }) => {
|
283
283
|
const { queryBuilderState } = props;
|
284
|
+
const applicationStore = queryBuilderState.applicationStore;
|
284
285
|
const milestoningState = queryBuilderState.milestoningState;
|
285
286
|
const close = (): void => milestoningState.setShowMilestoningEditor(false);
|
286
287
|
const isCompatibleMilestoningParameter = (
|
@@ -302,7 +303,9 @@ export const MilestoningParametersEditor = observer(
|
|
302
303
|
}}
|
303
304
|
>
|
304
305
|
<Modal
|
305
|
-
darkMode={
|
306
|
+
darkMode={
|
307
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
308
|
+
}
|
306
309
|
className="editor-modal query-builder__variables__modal"
|
307
310
|
>
|
308
311
|
<ModalHeader title="Milestoning Parameters" />
|
@@ -352,7 +355,7 @@ export const MilestoningParametersEditor = observer(
|
|
352
355
|
</div>
|
353
356
|
</ModalBody>
|
354
357
|
<ModalFooter>
|
355
|
-
<ModalFooterButton text="Close" onClick={close} />
|
358
|
+
<ModalFooterButton text="Close" onClick={close} type="secondary" />
|
356
359
|
</ModalFooter>
|
357
360
|
</Modal>
|
358
361
|
</Dialog>
|
@@ -346,12 +346,13 @@ const PureSerializationConfigModal = observer(
|
|
346
346
|
onClick={removeConfig}
|
347
347
|
/>
|
348
348
|
)}
|
349
|
-
<
|
350
|
-
className="
|
349
|
+
<ModalFooterButton
|
350
|
+
className="modal__footer__close-btn"
|
351
351
|
onClick={handleAction}
|
352
|
+
type={toAdd ? 'primary' : 'secondary'}
|
352
353
|
>
|
353
354
|
{toAdd ? 'Add Config' : 'Close'}
|
354
|
-
</
|
355
|
+
</ModalFooterButton>
|
355
356
|
</ModalFooter>
|
356
357
|
</Modal>
|
357
358
|
</Dialog>
|
@@ -379,6 +380,7 @@ export const QueryBuilderGraphFetchExternalConfig = observer(
|
|
379
380
|
value: serializationState.targetBinding,
|
380
381
|
label: serializationState.targetBinding.name,
|
381
382
|
};
|
383
|
+
const applicationStore = graphFetchState.queryBuilderState.applicationStore;
|
382
384
|
const onBindingChange = (
|
383
385
|
val: PackageableElementOption<Binding> | null,
|
384
386
|
): void => {
|
@@ -423,9 +425,14 @@ export const QueryBuilderGraphFetchExternalConfig = observer(
|
|
423
425
|
onChange={onBindingChange}
|
424
426
|
value={selectedBinding}
|
425
427
|
formatOptionLabel={getBindingFormatter({
|
426
|
-
darkMode:
|
428
|
+
darkMode:
|
429
|
+
!applicationStore.layoutService
|
430
|
+
.TEMPORARY__isLightColorThemeEnabled,
|
427
431
|
})}
|
428
|
-
darkMode={
|
432
|
+
darkMode={
|
433
|
+
!applicationStore.layoutService
|
434
|
+
.TEMPORARY__isLightColorThemeEnabled
|
435
|
+
}
|
429
436
|
/>
|
430
437
|
</div>
|
431
438
|
<div className="service-execution-editor__configuration__item">
|
@@ -227,8 +227,10 @@ const cloneSortColumnStateArray = (
|
|
227
227
|
|
228
228
|
export const QueryResultModifierModal = observer(
|
229
229
|
(props: { tdsState: QueryBuilderTDSState }) => {
|
230
|
-
// Read current state
|
231
230
|
const { tdsState } = props;
|
231
|
+
const applicationStore = tdsState.queryBuilderState.applicationStore;
|
232
|
+
|
233
|
+
// Read current state
|
232
234
|
const resultSetModifierState = tdsState.resultSetModifierState;
|
233
235
|
const stateSortColumns = resultSetModifierState.sortColumns;
|
234
236
|
const stateDistinct = resultSetModifierState.distinct;
|
@@ -331,7 +333,9 @@ export const QueryResultModifierModal = observer(
|
|
331
333
|
data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_RESULT_MODIFIER_PANEL}
|
332
334
|
>
|
333
335
|
<Modal
|
334
|
-
darkMode={
|
336
|
+
darkMode={
|
337
|
+
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
338
|
+
}
|
335
339
|
className="editor-modal query-builder__projection__modal"
|
336
340
|
>
|
337
341
|
<ModalHeader title="Result Set Modifier" />
|
@@ -403,7 +407,7 @@ export const QueryResultModifierModal = observer(
|
|
403
407
|
<div className="query-builder__result__slice__input__wrapper">
|
404
408
|
<InputWithInlineValidation
|
405
409
|
id="query-builder__projection__modal__slice-start-input"
|
406
|
-
className="input--dark query-builder__result__slice__input"
|
410
|
+
className="input--dark query-builder__result__slice__input panel__content__form__section__input"
|
407
411
|
spellCheck={false}
|
408
412
|
value={slice[0] ?? ''}
|
409
413
|
onChange={changeSliceStart}
|
@@ -414,7 +418,7 @@ export const QueryResultModifierModal = observer(
|
|
414
418
|
<div className="query-builder__result__slice__range">..</div>
|
415
419
|
<div className="query-builder__result__slice__input__wrapper">
|
416
420
|
<InputWithInlineValidation
|
417
|
-
className="input--dark query-builder__result__slice__input"
|
421
|
+
className="input--dark query-builder__result__slice__input panel__content__form__section__input"
|
418
422
|
spellCheck={false}
|
419
423
|
value={slice[1] ?? ''}
|
420
424
|
onChange={changeSliceEnd}
|