@finos/legend-query-builder 4.1.1 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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 +24 -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 +44 -11
- 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 +20 -32
- package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +2 -2
- 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/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 +3 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +11 -0
- package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
- package/package.json +7 -7
- package/src/components/QueryBuilderPropertyExpressionEditor.tsx +1 -2
- package/src/components/QueryBuilderResultPanel.tsx +146 -30
- 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 +32 -61
- package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +77 -14
- package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +6 -8
- package/src/components/filter/QueryBuilderFilterPanel.tsx +45 -73
- package/src/stores/QueryBuilderResultState.ts +1 -42
- package/src/stores/execution-plan/ExecutionPlanState.ts +142 -4
- package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +16 -0
- package/tsconfig.json +8 -0
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
PanelContent,
|
|
36
36
|
TrashIcon,
|
|
37
37
|
PanelDnDEntry,
|
|
38
|
-
|
|
38
|
+
PanelEntryDragHandle,
|
|
39
39
|
CalendarIcon,
|
|
40
40
|
CalendarClockIcon,
|
|
41
41
|
CustomSelectorInput,
|
|
@@ -325,16 +325,18 @@ const buildCalendarTypeOption = (
|
|
|
325
325
|
|
|
326
326
|
const QueryBuilderProjectionColumnEditor = observer(
|
|
327
327
|
(props: { projectionColumnState: QueryBuilderProjectionColumnState }) => {
|
|
328
|
+
const { projectionColumnState } = props;
|
|
329
|
+
const columnIdx = projectionColumnState.tdsState.tdsColumns.indexOf(
|
|
330
|
+
projectionColumnState,
|
|
331
|
+
);
|
|
328
332
|
const handleRef = useRef<HTMLDivElement>(null);
|
|
329
333
|
const applicationStore = useApplicationStore();
|
|
330
|
-
|
|
331
334
|
const ref = useRef<HTMLDivElement>(null);
|
|
332
335
|
const [isSelectedFromContextMenu, setIsSelectedFromContextMenu] =
|
|
333
336
|
useState(false);
|
|
334
337
|
const onContextMenuOpen = (): void => setIsSelectedFromContextMenu(true);
|
|
335
338
|
const onContextMenuClose = (): void => setIsSelectedFromContextMenu(false);
|
|
336
339
|
|
|
337
|
-
const { projectionColumnState } = props;
|
|
338
340
|
const tdsState = projectionColumnState.tdsState;
|
|
339
341
|
const isCalendarEnabled = tdsState.queryBuilderState.isCalendarEnabled;
|
|
340
342
|
const isRemovalDisabled = tdsState.isColumnInUse(projectionColumnState);
|
|
@@ -478,6 +480,23 @@ const QueryBuilderProjectionColumnEditor = observer(
|
|
|
478
480
|
}
|
|
479
481
|
};
|
|
480
482
|
|
|
483
|
+
const handleDroppingColumn = useCallback(
|
|
484
|
+
(type: string): void => {
|
|
485
|
+
if (
|
|
486
|
+
type === QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE &&
|
|
487
|
+
tdsState.draggedColumnIndex !== undefined &&
|
|
488
|
+
tdsState.hoveredColumnIndex !== undefined
|
|
489
|
+
) {
|
|
490
|
+
tdsState.moveColumn(
|
|
491
|
+
tdsState.draggedColumnIndex,
|
|
492
|
+
tdsState.hoveredColumnIndex,
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
tdsState.setRearrangeColumnsIndex(undefined, undefined);
|
|
496
|
+
},
|
|
497
|
+
[tdsState],
|
|
498
|
+
);
|
|
499
|
+
|
|
481
500
|
// Drag and Drop
|
|
482
501
|
const handleHover = useCallback(
|
|
483
502
|
(
|
|
@@ -490,6 +509,11 @@ const QueryBuilderProjectionColumnEditor = observer(
|
|
|
490
509
|
const hoverIndex = tdsState.projectionColumns.findIndex(
|
|
491
510
|
(e) => e === projectionColumnState,
|
|
492
511
|
);
|
|
512
|
+
|
|
513
|
+
if (dragIndex === hoverIndex) {
|
|
514
|
+
tdsState.setRearrangeColumnsIndex(undefined, hoverIndex);
|
|
515
|
+
}
|
|
516
|
+
|
|
493
517
|
if (dragIndex === -1 || hoverIndex === -1 || dragIndex === hoverIndex) {
|
|
494
518
|
return;
|
|
495
519
|
}
|
|
@@ -507,7 +531,8 @@ const QueryBuilderProjectionColumnEditor = observer(
|
|
|
507
531
|
if (dragIndex > hoverIndex && dragDistance > distanceThreshold) {
|
|
508
532
|
return;
|
|
509
533
|
}
|
|
510
|
-
|
|
534
|
+
|
|
535
|
+
tdsState.setRearrangeColumnsIndex(dragIndex, hoverIndex);
|
|
511
536
|
},
|
|
512
537
|
[projectionColumnState, tdsState],
|
|
513
538
|
);
|
|
@@ -515,9 +540,15 @@ const QueryBuilderProjectionColumnEditor = observer(
|
|
|
515
540
|
() => ({
|
|
516
541
|
accept: [QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE],
|
|
517
542
|
hover: (item, monitor): void => handleHover(item, monitor),
|
|
543
|
+
drop: (item, monitor): void => {
|
|
544
|
+
if (!monitor.didDrop()) {
|
|
545
|
+
handleDroppingColumn(monitor.getItemType() as string);
|
|
546
|
+
}
|
|
547
|
+
},
|
|
518
548
|
}),
|
|
519
|
-
[handleHover],
|
|
549
|
+
[handleHover, handleDroppingColumn],
|
|
520
550
|
);
|
|
551
|
+
|
|
521
552
|
const [
|
|
522
553
|
{ projectionColumnBeingDragged },
|
|
523
554
|
dragConnector,
|
|
@@ -548,8 +579,11 @@ const QueryBuilderProjectionColumnEditor = observer(
|
|
|
548
579
|
}),
|
|
549
580
|
[projectionColumnState],
|
|
550
581
|
);
|
|
582
|
+
|
|
551
583
|
const isBeingDragged =
|
|
552
|
-
|
|
584
|
+
columnIdx === tdsState.hoveredColumnIndex &&
|
|
585
|
+
projectionColumnBeingDragged !== undefined;
|
|
586
|
+
|
|
553
587
|
dragConnector(handleRef);
|
|
554
588
|
dropConnector(ref);
|
|
555
589
|
|
|
@@ -613,6 +647,21 @@ const QueryBuilderProjectionColumnEditor = observer(
|
|
|
613
647
|
return (
|
|
614
648
|
<PanelDnDEntry
|
|
615
649
|
ref={ref}
|
|
650
|
+
// TODO: this is the more appropriate solution than what we did
|
|
651
|
+
// before and in other places for rearrange because it does no
|
|
652
|
+
// rearrange while on hovering, but on drop, there's some work to
|
|
653
|
+
// do about the drop location indicator though
|
|
654
|
+
// See https://github.com/finos/legend-studio/pull/2330
|
|
655
|
+
placeholder={
|
|
656
|
+
<div
|
|
657
|
+
className={
|
|
658
|
+
(tdsState.hoveredColumnIndex ?? 0) >
|
|
659
|
+
(tdsState.draggedColumnIndex ?? 0)
|
|
660
|
+
? 'query-builder__projection__column__placeholder--bottom'
|
|
661
|
+
: 'query-builder__projection__column__placeholder--top'
|
|
662
|
+
}
|
|
663
|
+
/>
|
|
664
|
+
}
|
|
616
665
|
showPlaceholder={isBeingDragged}
|
|
617
666
|
className="query-builder__projection__column"
|
|
618
667
|
>
|
|
@@ -637,9 +686,9 @@ const QueryBuilderProjectionColumnEditor = observer(
|
|
|
637
686
|
onClose={onContextMenuClose}
|
|
638
687
|
>
|
|
639
688
|
<div className="query-builder__projection__column__container">
|
|
640
|
-
<
|
|
641
|
-
|
|
642
|
-
|
|
689
|
+
<PanelEntryDragHandle
|
|
690
|
+
isDragging={isBeingDragged}
|
|
691
|
+
dragSourceConnector={handleRef}
|
|
643
692
|
className="query-builder__projection__column__drag-handle__container"
|
|
644
693
|
/>
|
|
645
694
|
<div className="query-builder__projection__column__name">
|
|
@@ -806,7 +855,7 @@ const QueryBuilderProjectionColumnEditor = observer(
|
|
|
806
855
|
ref={dropTargetConnector}
|
|
807
856
|
>
|
|
808
857
|
<PanelEntryDropZonePlaceholder
|
|
809
|
-
|
|
858
|
+
isDragOver={isDragOver}
|
|
810
859
|
label="Change Date Column"
|
|
811
860
|
className="query-builder__projection__calendar__date__column__dnd__placeholder"
|
|
812
861
|
>
|
|
@@ -937,8 +986,22 @@ export const QueryBuilderTDSPanel = observer(
|
|
|
937
986
|
[handleDrop],
|
|
938
987
|
);
|
|
939
988
|
|
|
940
|
-
const
|
|
941
|
-
|
|
989
|
+
const [, projectionColumnDropConnector] = useDrop<
|
|
990
|
+
QueryBuilderProjectionColumnDragSource,
|
|
991
|
+
void,
|
|
992
|
+
{ isOverProjectionColumns: boolean }
|
|
993
|
+
>(
|
|
994
|
+
() => ({
|
|
995
|
+
accept: [QUERY_BUILDER_PROJECTION_COLUMN_DND_TYPE],
|
|
996
|
+
collect: (monitor) => ({
|
|
997
|
+
isOverProjectionColumns: monitor.isOver({ shallow: false }),
|
|
998
|
+
}),
|
|
999
|
+
}),
|
|
1000
|
+
[],
|
|
1001
|
+
);
|
|
1002
|
+
|
|
1003
|
+
const { isDroppable } = useDragLayer((monitor) => ({
|
|
1004
|
+
isDroppable:
|
|
942
1005
|
monitor.isDragging() &&
|
|
943
1006
|
[
|
|
944
1007
|
QUERY_BUILDER_EXPLORER_TREE_DND_TYPE.ENUM_PROPERTY,
|
|
@@ -989,8 +1052,7 @@ export const QueryBuilderTDSPanel = observer(
|
|
|
989
1052
|
<div className="query-builder__projection__content">
|
|
990
1053
|
<PanelDropZone
|
|
991
1054
|
isDragOver={isDragOver}
|
|
992
|
-
|
|
993
|
-
className="query-builder__panel--droppable"
|
|
1055
|
+
isDroppable={isDroppable}
|
|
994
1056
|
dropTargetConnector={dropTargetConnector}
|
|
995
1057
|
>
|
|
996
1058
|
{!projectionColumns.length && (
|
|
@@ -1003,6 +1065,7 @@ export const QueryBuilderTDSPanel = observer(
|
|
|
1003
1065
|
<div
|
|
1004
1066
|
data-testid={QUERY_BUILDER_TEST_ID.QUERY_BUILDER_TDS}
|
|
1005
1067
|
className="query-builder__projection__columns"
|
|
1068
|
+
ref={projectionColumnDropConnector}
|
|
1006
1069
|
>
|
|
1007
1070
|
<DragPreviewLayer
|
|
1008
1071
|
labelGetter={(
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
ModalFooter,
|
|
43
43
|
PanelFormSection,
|
|
44
44
|
ModalFooterButton,
|
|
45
|
-
|
|
45
|
+
PanelEntryDragHandle,
|
|
46
46
|
PanelDnDEntry,
|
|
47
47
|
PanelHeaderActionItem,
|
|
48
48
|
PanelHeader,
|
|
@@ -611,9 +611,8 @@ const TDSColumnReferenceEditor = observer(
|
|
|
611
611
|
className="query-builder__olap__tds__column-badge"
|
|
612
612
|
>
|
|
613
613
|
<PanelEntryDropZonePlaceholder
|
|
614
|
-
|
|
614
|
+
isDragOver={isDragOver}
|
|
615
615
|
label="Change Column"
|
|
616
|
-
className="query-builder__dnd__placeholder"
|
|
617
616
|
>
|
|
618
617
|
<div className="query-builder__olap__tds__column-badge__content">
|
|
619
618
|
<div
|
|
@@ -875,10 +874,10 @@ const QueryBuilderWindowColumnEditor = observer(
|
|
|
875
874
|
onOpen={onContextMenuOpen}
|
|
876
875
|
onClose={onContextMenuClose}
|
|
877
876
|
>
|
|
878
|
-
<
|
|
879
|
-
|
|
877
|
+
<PanelEntryDragHandle
|
|
878
|
+
isDragging={isBeingDragged}
|
|
880
879
|
className="query-builder__olap__column__drag-handle__container"
|
|
881
|
-
|
|
880
|
+
dragSourceConnector={handleRef}
|
|
882
881
|
/>
|
|
883
882
|
<div className="query-builder__olap__column__operation">
|
|
884
883
|
<div className="query-builder__olap__column__operation__operator">
|
|
@@ -947,9 +946,8 @@ const QueryBuilderWindowColumnEditor = observer(
|
|
|
947
946
|
className="query-builder__olap__column__window__content"
|
|
948
947
|
>
|
|
949
948
|
<PanelEntryDropZonePlaceholder
|
|
950
|
-
|
|
949
|
+
isDragOver={isDragOver}
|
|
951
950
|
label="Add"
|
|
952
|
-
className="query-builder__dnd__placeholder"
|
|
953
951
|
>
|
|
954
952
|
<div
|
|
955
953
|
title={`${windowColumnState.windowColumns.length} columns partitioned`}
|
|
@@ -105,9 +105,9 @@ const QueryBuilderFilterGroupConditionEditor = observer(
|
|
|
105
105
|
(props: {
|
|
106
106
|
node: QueryBuilderFilterTreeGroupNodeData;
|
|
107
107
|
isDragOver: boolean;
|
|
108
|
-
|
|
108
|
+
isDroppable: boolean;
|
|
109
109
|
}) => {
|
|
110
|
-
const { node, isDragOver,
|
|
110
|
+
const { node, isDragOver, isDroppable } = props;
|
|
111
111
|
const switchOperation: React.MouseEventHandler<HTMLDivElement> = (
|
|
112
112
|
event,
|
|
113
113
|
): void => {
|
|
@@ -120,30 +120,29 @@ const QueryBuilderFilterGroupConditionEditor = observer(
|
|
|
120
120
|
};
|
|
121
121
|
return (
|
|
122
122
|
<div className="query-builder-filter-tree__node__label__content dnd__entry__container">
|
|
123
|
-
|
|
123
|
+
<PanelEntryDropZonePlaceholder
|
|
124
|
+
isDragOver={isDragOver}
|
|
125
|
+
isDroppable={isDroppable}
|
|
126
|
+
label="Add to Logical Group"
|
|
127
|
+
>
|
|
124
128
|
<div
|
|
125
|
-
className={clsx('
|
|
126
|
-
'
|
|
129
|
+
className={clsx('query-builder-filter-tree__group-node', {
|
|
130
|
+
'query-builder-filter-tree__group-node--and':
|
|
131
|
+
node.groupOperation === QUERY_BUILDER_GROUP_OPERATION.AND,
|
|
132
|
+
'query-builder-filter-tree__group-node--or':
|
|
133
|
+
node.groupOperation === QUERY_BUILDER_GROUP_OPERATION.OR,
|
|
127
134
|
})}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
title="Switch Operation"
|
|
138
|
-
onClick={switchOperation}
|
|
139
|
-
>
|
|
140
|
-
<div className="query-builder-filter-tree__group-node__label">
|
|
141
|
-
{node.groupOperation}
|
|
135
|
+
title="Switch Operation"
|
|
136
|
+
onClick={switchOperation}
|
|
137
|
+
>
|
|
138
|
+
<div className="query-builder-filter-tree__group-node__label">
|
|
139
|
+
{node.groupOperation}
|
|
140
|
+
</div>
|
|
141
|
+
<button className="query-builder-filter-tree__group-node__action">
|
|
142
|
+
<FilledTriangleIcon />
|
|
143
|
+
</button>
|
|
142
144
|
</div>
|
|
143
|
-
|
|
144
|
-
<FilledTriangleIcon />
|
|
145
|
-
</button>
|
|
146
|
-
</div>
|
|
145
|
+
</PanelEntryDropZonePlaceholder>
|
|
147
146
|
</div>
|
|
148
147
|
);
|
|
149
148
|
},
|
|
@@ -232,32 +231,11 @@ const QueryBuilderFilterConditionEditor = observer(
|
|
|
232
231
|
cleanUpReloadValues,
|
|
233
232
|
};
|
|
234
233
|
|
|
235
|
-
const { showDroppableSuggestion } = useDragLayer((monitor) => ({
|
|
236
|
-
showDroppableSuggestion:
|
|
237
|
-
monitor.isDragging() &&
|
|
238
|
-
(queryBuilderState.TEMPORARY__isDnDFetchStructureToFilterSupported
|
|
239
|
-
? IS_DRAGGABLE_FILTER_DND_TYPES_FETCH_SUPPORTED
|
|
240
|
-
: IS_DRAGGABLE_FILTER_DND_TYPES
|
|
241
|
-
).includes(monitor.getItemType()?.toString() ?? ''),
|
|
242
|
-
}));
|
|
243
|
-
|
|
244
234
|
return (
|
|
245
235
|
<div className="query-builder-filter-tree__node__label__content dnd__entry__container">
|
|
246
|
-
{showDroppableSuggestion && (
|
|
247
|
-
<div
|
|
248
|
-
className={clsx(
|
|
249
|
-
'dnd__entry--droppable__indicator dnd__entry-potential__oiodropzone__indicator--full',
|
|
250
|
-
{
|
|
251
|
-
'dnd__entry--droppable__indicator--dragover': isDragOver,
|
|
252
|
-
},
|
|
253
|
-
)}
|
|
254
|
-
></div>
|
|
255
|
-
)}
|
|
256
|
-
|
|
257
236
|
<PanelEntryDropZonePlaceholder
|
|
258
|
-
|
|
237
|
+
isDragOver={isDragOver}
|
|
259
238
|
label="Add New Logical Group"
|
|
260
|
-
className="query-builder__dnd__placeholder"
|
|
261
239
|
>
|
|
262
240
|
<div className="query-builder-filter-tree__condition-node">
|
|
263
241
|
<div className="query-builder-filter-tree__condition-node__property">
|
|
@@ -301,9 +279,8 @@ const QueryBuilderFilterConditionEditor = observer(
|
|
|
301
279
|
className="query-builder-filter-tree__condition-node__value"
|
|
302
280
|
>
|
|
303
281
|
<PanelEntryDropZonePlaceholder
|
|
304
|
-
|
|
282
|
+
isDragOver={isFilterValueDragOver}
|
|
305
283
|
label="Change Filter Value"
|
|
306
|
-
className="query-builder__dnd__placeholder"
|
|
307
284
|
>
|
|
308
285
|
<BasicValueSpecificationEditor
|
|
309
286
|
valueSpecification={node.condition.value}
|
|
@@ -336,19 +313,16 @@ const QueryBuilderFilterBlankConditionEditor = observer(
|
|
|
336
313
|
(props: {
|
|
337
314
|
node: QueryBuilderFilterTreeBlankConditionNodeData;
|
|
338
315
|
isDragOver: boolean;
|
|
339
|
-
|
|
316
|
+
isDroppable: boolean;
|
|
340
317
|
}) => {
|
|
341
|
-
const { isDragOver,
|
|
318
|
+
const { isDragOver, isDroppable } = props;
|
|
342
319
|
return (
|
|
343
320
|
<div className="query-builder-filter-tree__node__label__content">
|
|
344
321
|
<PanelEntryDropZonePlaceholder
|
|
345
|
-
|
|
322
|
+
isDragOver={isDragOver}
|
|
323
|
+
isDroppable={isDroppable}
|
|
346
324
|
label="Create Condition"
|
|
347
|
-
className="query-builder__dnd__placeholder"
|
|
348
325
|
>
|
|
349
|
-
{showDroppableSuggestion && (
|
|
350
|
-
<div className="query-builder-filter-tree__blank-node--droppable"></div>
|
|
351
|
-
)}
|
|
352
326
|
<div className="query-builder-filter-tree__blank-node">blank</div>
|
|
353
327
|
</PanelEntryDropZonePlaceholder>
|
|
354
328
|
</div>
|
|
@@ -560,8 +534,8 @@ const QueryBuilderFilterTreeNodeContainer = observer(
|
|
|
560
534
|
dragConnector(dropConnector(ref));
|
|
561
535
|
useDragPreviewLayer(dragPreviewConnector);
|
|
562
536
|
|
|
563
|
-
const {
|
|
564
|
-
|
|
537
|
+
const { isDroppable } = useDragLayer((monitor) => ({
|
|
538
|
+
isDroppable:
|
|
565
539
|
monitor.isDragging() &&
|
|
566
540
|
(queryBuilderState.TEMPORARY__isDnDFetchStructureToFilterSupported
|
|
567
541
|
? IS_DRAGGABLE_FILTER_DND_TYPES_FETCH_SUPPORTED
|
|
@@ -627,7 +601,7 @@ const QueryBuilderFilterTreeNodeContainer = observer(
|
|
|
627
601
|
{node instanceof QueryBuilderFilterTreeGroupNodeData && (
|
|
628
602
|
<QueryBuilderFilterGroupConditionEditor
|
|
629
603
|
node={node}
|
|
630
|
-
|
|
604
|
+
isDroppable={isDroppable}
|
|
631
605
|
isDragOver={isDragOver}
|
|
632
606
|
/>
|
|
633
607
|
)}
|
|
@@ -641,7 +615,7 @@ const QueryBuilderFilterTreeNodeContainer = observer(
|
|
|
641
615
|
<QueryBuilderFilterBlankConditionEditor
|
|
642
616
|
node={node}
|
|
643
617
|
isDragOver={isDragOver}
|
|
644
|
-
|
|
618
|
+
isDroppable={isDroppable}
|
|
645
619
|
/>
|
|
646
620
|
)}
|
|
647
621
|
</div>
|
|
@@ -811,8 +785,8 @@ export const QueryBuilderFilterPanel = observer(
|
|
|
811
785
|
}
|
|
812
786
|
};
|
|
813
787
|
|
|
814
|
-
const {
|
|
815
|
-
|
|
788
|
+
const { isDroppable } = useDragLayer((monitor) => ({
|
|
789
|
+
isDroppable:
|
|
816
790
|
monitor.isDragging() &&
|
|
817
791
|
(queryBuilderState.TEMPORARY__isDnDFetchStructureToFilterSupported
|
|
818
792
|
? IS_DRAGGABLE_FILTER_DND_TYPES_FETCH_SUPPORTED
|
|
@@ -991,10 +965,7 @@ export const QueryBuilderFilterPanel = observer(
|
|
|
991
965
|
<PanelContent>
|
|
992
966
|
<PanelDropZone
|
|
993
967
|
isDragOver={isDragOver && filterState.isEmpty}
|
|
994
|
-
|
|
995
|
-
showDroppableSuggestion && filterState.isEmpty
|
|
996
|
-
}
|
|
997
|
-
className="query-builder__panel--droppable"
|
|
968
|
+
isDroppable={isDroppable && filterState.isEmpty}
|
|
998
969
|
dropTargetConnector={dropTargetConnector}
|
|
999
970
|
>
|
|
1000
971
|
{filterState.isEmpty && (
|
|
@@ -1014,18 +985,19 @@ export const QueryBuilderFilterPanel = observer(
|
|
|
1014
985
|
<QueryBuilderFilterTree queryBuilderState={queryBuilderState} />
|
|
1015
986
|
</>
|
|
1016
987
|
)}
|
|
1017
|
-
|
|
1018
|
-
{showDroppableSuggestion && !filterState.isEmpty && (
|
|
988
|
+
{isDroppable && !filterState.isEmpty && (
|
|
1019
989
|
<div
|
|
1020
990
|
ref={addFilterRef}
|
|
1021
|
-
className=
|
|
1022
|
-
'query-builder-post-filter-tree__blank-node--droppable--tall',
|
|
1023
|
-
{
|
|
1024
|
-
'dnd__entry--droppable__indicator--dragover': isDragOver,
|
|
1025
|
-
},
|
|
1026
|
-
)}
|
|
991
|
+
className="query-builder-filter-tree__free-drop-zone__container"
|
|
1027
992
|
>
|
|
1028
|
-
|
|
993
|
+
<PanelEntryDropZonePlaceholder
|
|
994
|
+
isDragOver={isDragOver}
|
|
995
|
+
isDroppable={isDroppable}
|
|
996
|
+
className="query-builder-filter-tree__free-drop-zone"
|
|
997
|
+
label="Add filter to main group"
|
|
998
|
+
>
|
|
999
|
+
<></>
|
|
1000
|
+
</PanelEntryDropZonePlaceholder>
|
|
1029
1001
|
</div>
|
|
1030
1002
|
)}
|
|
1031
1003
|
</PanelDropZone>
|
|
@@ -37,7 +37,6 @@ import {
|
|
|
37
37
|
buildRawLambdaFromLambdaFunction,
|
|
38
38
|
reportGraphAnalytics,
|
|
39
39
|
extractExecutionResultValues,
|
|
40
|
-
TDSExecutionResult,
|
|
41
40
|
} from '@finos/legend-graph';
|
|
42
41
|
import { buildLambdaFunction } from './QueryBuilderValueSpecificationBuilder.js';
|
|
43
42
|
import { DEFAULT_TAB_SIZE } from '@finos/legend-application';
|
|
@@ -163,46 +162,6 @@ export class QueryBuilderResultState {
|
|
|
163
162
|
this.queryRunPromise = promise;
|
|
164
163
|
};
|
|
165
164
|
|
|
166
|
-
findColumnFromCoordinates = (
|
|
167
|
-
colIndex: number,
|
|
168
|
-
): string | number | boolean | null | undefined => {
|
|
169
|
-
if (
|
|
170
|
-
!this.executionResult ||
|
|
171
|
-
!(this.executionResult instanceof TDSExecutionResult)
|
|
172
|
-
) {
|
|
173
|
-
return undefined;
|
|
174
|
-
}
|
|
175
|
-
return this.executionResult.result.columns[colIndex];
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
findRowFromRowIndex = (
|
|
179
|
-
rowIndex: number,
|
|
180
|
-
): (string | number | boolean | null)[] => {
|
|
181
|
-
if (
|
|
182
|
-
!this.executionResult ||
|
|
183
|
-
!(this.executionResult instanceof TDSExecutionResult)
|
|
184
|
-
) {
|
|
185
|
-
return [''];
|
|
186
|
-
}
|
|
187
|
-
return this.executionResult.result.rows[rowIndex]?.values ?? [''];
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
findResultValueFromCoordinates = (
|
|
191
|
-
resultCoordinate: [number, number],
|
|
192
|
-
): string | number | boolean | null | undefined => {
|
|
193
|
-
const rowIndex = resultCoordinate[0];
|
|
194
|
-
const colIndex = resultCoordinate[1];
|
|
195
|
-
|
|
196
|
-
if (
|
|
197
|
-
!this.executionResult ||
|
|
198
|
-
!(this.executionResult instanceof TDSExecutionResult)
|
|
199
|
-
) {
|
|
200
|
-
return undefined;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return this.executionResult.result.rows[rowIndex]?.values[colIndex];
|
|
204
|
-
};
|
|
205
|
-
|
|
206
165
|
setIsQueryUsageViewerOpened(val: boolean): void {
|
|
207
166
|
this.isQueryUsageViewerOpened = val;
|
|
208
167
|
}
|
|
@@ -442,7 +401,7 @@ export class QueryBuilderResultState {
|
|
|
442
401
|
rawPlan,
|
|
443
402
|
this.queryBuilderState.graphManagerState.graph,
|
|
444
403
|
);
|
|
445
|
-
this.executionPlanState.
|
|
404
|
+
this.executionPlanState.initialize(plan);
|
|
446
405
|
} catch {
|
|
447
406
|
// do nothing
|
|
448
407
|
}
|