@finos/legend-application-repl 0.0.50 → 0.0.52
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/dataCube/DataCube.d.ts.map +1 -1
- package/lib/components/dataCube/DataCube.js +1 -3
- package/lib/components/dataCube/DataCube.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditor.d.ts.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditor.js +3 -7
- package/lib/components/dataCube/editor/DataCubeEditor.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js +6 -6
- package/lib/components/dataCube/editor/DataCubeEditorColumnsPanel.js.map +1 -1
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.js +5 -5
- package/lib/components/dataCube/editor/DataCubeEditorColumnsSelector.js.map +1 -1
- package/lib/components/dataCube/{editor/DataCubeEditorFilterPanel.d.ts → filter/DataCubeEditorFilter.d.ts} +2 -2
- package/lib/components/dataCube/filter/DataCubeEditorFilter.d.ts.map +1 -0
- package/lib/components/dataCube/{editor/DataCubeEditorFilterPanel.js → filter/DataCubeEditorFilter.js} +44 -39
- package/lib/components/dataCube/filter/DataCubeEditorFilter.js.map +1 -0
- package/lib/index.css +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/dataCube/DataCubeState.d.ts +2 -0
- package/lib/stores/dataCube/DataCubeState.d.ts.map +1 -1
- package/lib/stores/dataCube/DataCubeState.js +4 -1
- package/lib/stores/dataCube/DataCubeState.js.map +1 -1
- package/lib/stores/dataCube/core/filter/DataCubeQueryFilterEditorState.d.ts.map +1 -1
- package/lib/stores/dataCube/core/filter/DataCubeQueryFilterEditorState.js +2 -2
- package/lib/stores/dataCube/core/filter/DataCubeQueryFilterEditorState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsPanelState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsPanelState.js +6 -2
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsPanelState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.d.ts +5 -5
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.js +22 -18
- package/lib/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.js.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts +1 -5
- package/lib/stores/dataCube/editor/DataCubeEditorState.d.ts.map +1 -1
- package/lib/stores/dataCube/editor/DataCubeEditorState.js +3 -10
- package/lib/stores/dataCube/editor/DataCubeEditorState.js.map +1 -1
- package/lib/stores/dataCube/{editor/DataCubeEditorFilterPanelState.d.ts → filter/DataCubeFilterEditorState.d.ts} +10 -11
- package/lib/stores/dataCube/filter/DataCubeFilterEditorState.d.ts.map +1 -0
- package/lib/stores/dataCube/{editor/DataCubeEditorFilterPanelState.js → filter/DataCubeFilterEditorState.js} +27 -15
- package/lib/stores/dataCube/filter/DataCubeFilterEditorState.js.map +1 -0
- package/lib/stores/dataCube/grid/DataCubeGridConfigurationBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridConfigurationBuilder.js +33 -9
- package/lib/stores/dataCube/grid/DataCubeGridConfigurationBuilder.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridControllerState.d.ts +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridControllerState.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridControllerState.js.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridMenuBuilder.d.ts +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridMenuBuilder.d.ts.map +1 -1
- package/lib/stores/dataCube/grid/DataCubeGridMenuBuilder.js +25 -13
- package/lib/stores/dataCube/grid/DataCubeGridMenuBuilder.js.map +1 -1
- package/package.json +4 -4
- package/src/components/dataCube/DataCube.tsx +1 -3
- package/src/components/dataCube/editor/DataCubeEditor.tsx +11 -21
- package/src/components/dataCube/editor/DataCubeEditorColumnsPanel.tsx +8 -8
- package/src/components/dataCube/editor/DataCubeEditorColumnsSelector.tsx +5 -5
- package/src/components/dataCube/{editor/DataCubeEditorFilterPanel.tsx → filter/DataCubeEditorFilter.tsx} +100 -79
- package/src/stores/dataCube/DataCubeState.ts +4 -1
- package/src/stores/dataCube/core/filter/DataCubeQueryFilterEditorState.ts +4 -2
- package/src/stores/dataCube/editor/DataCubeEditorColumnsPanelState.ts +7 -3
- package/src/stores/dataCube/editor/DataCubeEditorColumnsSelectorState.ts +21 -17
- package/src/stores/dataCube/editor/DataCubeEditorState.tsx +7 -11
- package/src/stores/dataCube/{editor/DataCubeEditorFilterPanelState.ts → filter/DataCubeFilterEditorState.tsx} +48 -28
- package/src/stores/dataCube/grid/DataCubeGridConfigurationBuilder.tsx +35 -9
- package/src/stores/dataCube/grid/DataCubeGridControllerState.ts +1 -0
- package/src/stores/dataCube/grid/DataCubeGridMenuBuilder.tsx +37 -16
- package/tsconfig.json +2 -2
- package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.d.ts.map +0 -1
- package/lib/components/dataCube/editor/DataCubeEditorFilterPanel.js.map +0 -1
- package/lib/stores/dataCube/editor/DataCubeEditorFilterPanelState.d.ts.map +0 -1
- package/lib/stores/dataCube/editor/DataCubeEditorFilterPanelState.js.map +0 -1
|
@@ -81,7 +81,9 @@ const DataCubeEditorFilterConditionNodeTextValueEditor = observer(
|
|
|
81
81
|
inputRef.current?.select();
|
|
82
82
|
}
|
|
83
83
|
}}
|
|
84
|
-
onChange={(event) =>
|
|
84
|
+
onChange={(event) => {
|
|
85
|
+
updateValue(event.target.value);
|
|
86
|
+
}}
|
|
85
87
|
/>
|
|
86
88
|
);
|
|
87
89
|
}),
|
|
@@ -286,8 +288,8 @@ const DataCubeEditorFilterConditionNodeColumnSelector = observer(
|
|
|
286
288
|
}
|
|
287
289
|
>(function DataCubeEditorFilterConditionNodeColumnSelector(props, ref) {
|
|
288
290
|
const { value, updateValue, dataCube } = props;
|
|
289
|
-
const
|
|
290
|
-
const matchingColumn =
|
|
291
|
+
const editor = dataCube.filter;
|
|
292
|
+
const matchingColumn = editor.columns.find(
|
|
291
293
|
(column) => column.name === value,
|
|
292
294
|
);
|
|
293
295
|
const [
|
|
@@ -308,7 +310,7 @@ const DataCubeEditorFilterConditionNodeColumnSelector = observer(
|
|
|
308
310
|
{value}
|
|
309
311
|
</FormDropdownMenuTrigger>
|
|
310
312
|
<FormDropdownMenu className="w-32" {...columnsDropdownProps}>
|
|
311
|
-
{
|
|
313
|
+
{editor.columns
|
|
312
314
|
.filter(
|
|
313
315
|
(column) =>
|
|
314
316
|
matchingColumn &&
|
|
@@ -409,7 +411,7 @@ const DataCubeEditorFilterConditionNodeController = observer(
|
|
|
409
411
|
dataCube: DataCubeState;
|
|
410
412
|
}) => {
|
|
411
413
|
const { className, node, dataCube } = props;
|
|
412
|
-
const
|
|
414
|
+
const editor = dataCube.filter;
|
|
413
415
|
|
|
414
416
|
return (
|
|
415
417
|
<div
|
|
@@ -420,21 +422,21 @@ const DataCubeEditorFilterConditionNodeController = observer(
|
|
|
420
422
|
>
|
|
421
423
|
<button
|
|
422
424
|
className="flex h-3.5 w-3.5 items-center justify-center rounded-bl-sm rounded-tl-sm border border-neutral-400 hover:bg-neutral-200"
|
|
423
|
-
onClick={() =>
|
|
425
|
+
onClick={() => editor.addFilterNode(node)}
|
|
424
426
|
title="Insert a new column filter, just after this filter."
|
|
425
427
|
>
|
|
426
428
|
<DataCubeIcon.FilterAddOperator className="stroke-[2.5] text-sm" />
|
|
427
429
|
</button>
|
|
428
430
|
<button
|
|
429
431
|
className="flex h-3.5 w-3.5 items-center justify-center border border-l-0 border-neutral-400 hover:bg-neutral-200"
|
|
430
|
-
onClick={() =>
|
|
432
|
+
onClick={() => editor.removeFilterNode(node)}
|
|
431
433
|
title="Remove this filter"
|
|
432
434
|
>
|
|
433
435
|
<DataCubeIcon.FilterRemoveOperator className="stroke-[2.5] text-sm" />
|
|
434
436
|
</button>
|
|
435
437
|
<button
|
|
436
438
|
className="flex h-3.5 w-3.5 items-center justify-center border border-l-0 border-neutral-400 hover:bg-neutral-200"
|
|
437
|
-
onClick={() =>
|
|
439
|
+
onClick={() => editor.layerFilterNode(node)}
|
|
438
440
|
title="Put this filter in its own sub-group (and combine it with other filters)."
|
|
439
441
|
>
|
|
440
442
|
<DataCubeIcon.FilterGroupOperator className="stroke-[2.5] text-sm" />
|
|
@@ -470,7 +472,7 @@ const DataCubeEditorFilterConditionNodeDisplay = observer(
|
|
|
470
472
|
dataCube: DataCubeState;
|
|
471
473
|
}) => {
|
|
472
474
|
const { node, level, dataCube } = props;
|
|
473
|
-
const
|
|
475
|
+
const editor = dataCube.filter;
|
|
474
476
|
const parentNode = node.parent;
|
|
475
477
|
const nodeIdx = parentNode ? parentNode.children.indexOf(node) : undefined;
|
|
476
478
|
const valueEditorRef = useRef<HTMLElement>(null);
|
|
@@ -497,19 +499,19 @@ const DataCubeEditorFilterConditionNodeDisplay = observer(
|
|
|
497
499
|
className={cn(
|
|
498
500
|
'z-1 absolute h-6 w-full bg-opacity-50 group-hover:bg-sky-100 group-hover:bg-opacity-50',
|
|
499
501
|
{
|
|
500
|
-
'bg-sky-50': node ===
|
|
502
|
+
'bg-sky-50': node === editor.selectedNode,
|
|
501
503
|
'border-[0.5px] border-l-2 border-sky-200 border-l-sky-600':
|
|
502
|
-
node ===
|
|
504
|
+
node === editor.selectedNode,
|
|
503
505
|
},
|
|
504
506
|
)}
|
|
505
|
-
onClick={() =>
|
|
507
|
+
onClick={() => editor.setSelectedNode(node)}
|
|
506
508
|
/>
|
|
507
509
|
<div
|
|
508
510
|
style={{
|
|
509
511
|
paddingLeft: `${level * FILTER_TREE_INDENTATION_SPACE + FILTER_TREE_OFFSET + (level - 1) * FILTER_TREE_CONTROLLER_OFFSET}px`,
|
|
510
512
|
}}
|
|
511
513
|
className="relative h-6 flex-shrink-0"
|
|
512
|
-
onClick={() =>
|
|
514
|
+
onClick={() => editor.setSelectedNode(node)}
|
|
513
515
|
>
|
|
514
516
|
{parentNode && (
|
|
515
517
|
<div
|
|
@@ -521,7 +523,7 @@ const DataCubeEditorFilterConditionNodeDisplay = observer(
|
|
|
521
523
|
>
|
|
522
524
|
<div
|
|
523
525
|
className={cn('h-[1px] w-full flex-1 bg-neutral-200', {
|
|
524
|
-
'bg-sky-600': parentNode ===
|
|
526
|
+
'bg-sky-600': parentNode === editor.selectedGroupNode,
|
|
525
527
|
})}
|
|
526
528
|
/>
|
|
527
529
|
{nodeIdx !== undefined && nodeIdx > 0 && (
|
|
@@ -529,7 +531,7 @@ const DataCubeEditorFilterConditionNodeDisplay = observer(
|
|
|
529
531
|
className={cn(
|
|
530
532
|
'flex h-6 items-center justify-center pl-1 text-xs text-neutral-600',
|
|
531
533
|
{
|
|
532
|
-
'text-sky-600': parentNode ===
|
|
534
|
+
'text-sky-600': parentNode === editor.selectedGroupNode,
|
|
533
535
|
},
|
|
534
536
|
)}
|
|
535
537
|
>
|
|
@@ -559,7 +561,7 @@ const DataCubeEditorFilterConditionNodeDisplay = observer(
|
|
|
559
561
|
{...columnsDropdownProps}
|
|
560
562
|
onClosed={focusOnValueEditor}
|
|
561
563
|
>
|
|
562
|
-
{
|
|
564
|
+
{editor.columns.map((column) => (
|
|
563
565
|
<FormDropdownMenuItem
|
|
564
566
|
key={column.name}
|
|
565
567
|
onClick={() => {
|
|
@@ -567,7 +569,7 @@ const DataCubeEditorFilterConditionNodeDisplay = observer(
|
|
|
567
569
|
const newOp = node.operation.isCompatibleWithColumn(column)
|
|
568
570
|
? node.operation
|
|
569
571
|
: getNullableFirstEntry(
|
|
570
|
-
|
|
572
|
+
editor.dataCube.engine.filterOperations.filter((op) =>
|
|
571
573
|
op.isCompatibleWithColumn(column),
|
|
572
574
|
),
|
|
573
575
|
);
|
|
@@ -597,7 +599,7 @@ const DataCubeEditorFilterConditionNodeDisplay = observer(
|
|
|
597
599
|
{...operatorsDropdownProps}
|
|
598
600
|
onClosed={focusOnValueEditor}
|
|
599
601
|
>
|
|
600
|
-
{
|
|
602
|
+
{editor.dataCube.engine.filterOperations
|
|
601
603
|
.filter((op) => op.isCompatibleWithColumn(node.column))
|
|
602
604
|
.map((op) => (
|
|
603
605
|
<FormDropdownMenuItem
|
|
@@ -639,7 +641,7 @@ const DataCubeEditorFilterGroupNodeDisplay = observer(
|
|
|
639
641
|
dataCube: DataCubeState;
|
|
640
642
|
}) => {
|
|
641
643
|
const { node, level, dataCube } = props;
|
|
642
|
-
const
|
|
644
|
+
const editor = dataCube.filter;
|
|
643
645
|
const parentNode = node.parent;
|
|
644
646
|
const nodeIdx = parentNode ? parentNode.children.indexOf(node) : undefined;
|
|
645
647
|
const [
|
|
@@ -655,19 +657,19 @@ const DataCubeEditorFilterGroupNodeDisplay = observer(
|
|
|
655
657
|
className={cn(
|
|
656
658
|
'z-1 absolute h-6 w-full bg-opacity-50 group-hover:bg-sky-100 group-hover:bg-opacity-50',
|
|
657
659
|
{
|
|
658
|
-
'bg-sky-50': node ===
|
|
660
|
+
'bg-sky-50': node === editor.selectedNode,
|
|
659
661
|
'border-[0.5px] border-l-2 border-sky-200 border-l-sky-600':
|
|
660
|
-
node ===
|
|
662
|
+
node === editor.selectedNode,
|
|
661
663
|
},
|
|
662
664
|
)}
|
|
663
|
-
onClick={() =>
|
|
665
|
+
onClick={() => editor.setSelectedNode(node)}
|
|
664
666
|
/>
|
|
665
667
|
<div
|
|
666
668
|
style={{
|
|
667
669
|
paddingLeft: `${level * FILTER_TREE_INDENTATION_SPACE + FILTER_TREE_OFFSET + (level !== 0 ? (level - 1) * FILTER_TREE_CONTROLLER_OFFSET : 0)}px`,
|
|
668
670
|
}}
|
|
669
671
|
className="relative h-6 flex-shrink-0"
|
|
670
|
-
onClick={() =>
|
|
672
|
+
onClick={() => editor.setSelectedNode(node)}
|
|
671
673
|
>
|
|
672
674
|
{level !== 0 && parentNode && (
|
|
673
675
|
<div
|
|
@@ -679,7 +681,7 @@ const DataCubeEditorFilterGroupNodeDisplay = observer(
|
|
|
679
681
|
>
|
|
680
682
|
<div
|
|
681
683
|
className={cn('h-[1px] w-full flex-1 bg-neutral-200', {
|
|
682
|
-
'bg-sky-600': parentNode ===
|
|
684
|
+
'bg-sky-600': parentNode === editor.selectedGroupNode,
|
|
683
685
|
})}
|
|
684
686
|
/>
|
|
685
687
|
{nodeIdx !== undefined && nodeIdx > 0 && (
|
|
@@ -687,7 +689,7 @@ const DataCubeEditorFilterGroupNodeDisplay = observer(
|
|
|
687
689
|
className={cn(
|
|
688
690
|
'flex h-6 items-center justify-center pl-1 text-xs text-neutral-600',
|
|
689
691
|
{
|
|
690
|
-
'text-sky-600': parentNode ===
|
|
692
|
+
'text-sky-600': parentNode === editor.selectedGroupNode,
|
|
691
693
|
},
|
|
692
694
|
)}
|
|
693
695
|
>
|
|
@@ -757,14 +759,14 @@ const DataCubeEditorFilterGroupDisplay = observer(
|
|
|
757
759
|
dataCube: DataCubeState;
|
|
758
760
|
}) => {
|
|
759
761
|
const { node, level, dataCube } = props;
|
|
760
|
-
const
|
|
762
|
+
const editor = dataCube.filter;
|
|
761
763
|
|
|
762
764
|
return (
|
|
763
765
|
<div className="relative w-full">
|
|
764
766
|
<div
|
|
765
767
|
className={cn('pointer-events-none absolute h-full', {
|
|
766
768
|
'border-[0.5px] border-sky-200 bg-sky-50':
|
|
767
|
-
node ===
|
|
769
|
+
node === editor.selectedGroupNode,
|
|
768
770
|
})}
|
|
769
771
|
style={{
|
|
770
772
|
marginLeft: `${level * FILTER_TREE_INDENTATION_SPACE + FILTER_TREE_OFFSET + level * FILTER_TREE_CONTROLLER_OFFSET - FILTER_TREE_GROUP_HIGHLIGHT_PADDING}px`,
|
|
@@ -781,7 +783,7 @@ const DataCubeEditorFilterGroupDisplay = observer(
|
|
|
781
783
|
className={cn(
|
|
782
784
|
'pointer-events-none absolute z-10 h-[calc(100%_-_12px)] w-0 border-l border-neutral-200',
|
|
783
785
|
{
|
|
784
|
-
'border-sky-600': node ===
|
|
786
|
+
'border-sky-600': node === editor.selectedGroupNode,
|
|
785
787
|
},
|
|
786
788
|
)}
|
|
787
789
|
style={{
|
|
@@ -818,69 +820,88 @@ const DataCubeEditorFilterGroupDisplay = observer(
|
|
|
818
820
|
},
|
|
819
821
|
);
|
|
820
822
|
|
|
821
|
-
export const
|
|
823
|
+
export const DataCubeFilterEditor = observer(
|
|
822
824
|
(props: { dataCube: DataCubeState }) => {
|
|
823
825
|
const { dataCube } = props;
|
|
824
|
-
const
|
|
826
|
+
const editor = dataCube.filter;
|
|
825
827
|
|
|
826
828
|
useEffect(() => {
|
|
827
|
-
|
|
828
|
-
}, [
|
|
829
|
+
editor.setSelectedNode(undefined);
|
|
830
|
+
}, [editor]);
|
|
829
831
|
|
|
830
832
|
return (
|
|
831
|
-
|
|
832
|
-
<div className="
|
|
833
|
-
<div className="
|
|
834
|
-
<
|
|
835
|
-
|
|
836
|
-
<div className="ml-1 flex h-6 items-center text-xl font-medium">
|
|
837
|
-
Filter
|
|
838
|
-
</div>
|
|
839
|
-
</div>
|
|
840
|
-
<div className="flex h-[calc(100%_-_24px)] w-full">
|
|
841
|
-
<div className="flex h-full w-full pt-1">
|
|
842
|
-
<div
|
|
843
|
-
className="relative flex h-full w-full overflow-auto rounded-sm border border-neutral-200"
|
|
844
|
-
onClick={() => panel.setSelectedNode(undefined)}
|
|
845
|
-
>
|
|
846
|
-
{!panel.tree.root && (
|
|
847
|
-
<div className="h-full w-full p-3">
|
|
848
|
-
<div>
|
|
849
|
-
No filter is specified. Click the button below to start.
|
|
850
|
-
</div>
|
|
851
|
-
<button
|
|
852
|
-
className="w-30 mt-2 h-6 border border-neutral-400 bg-neutral-300 px-2 hover:brightness-95"
|
|
853
|
-
onClick={() => {
|
|
854
|
-
panel.initializeTree();
|
|
855
|
-
}}
|
|
856
|
-
>
|
|
857
|
-
Create New Filter
|
|
858
|
-
</button>
|
|
859
|
-
</div>
|
|
860
|
-
)}
|
|
861
|
-
{panel.tree.root && (
|
|
833
|
+
<>
|
|
834
|
+
<div className="relative h-[calc(100%_-_40px)] w-full px-2 pt-2">
|
|
835
|
+
<div className="h-full w-full overflow-auto border border-neutral-300 bg-white">
|
|
836
|
+
<div className="h-full w-full select-none p-2">
|
|
837
|
+
<div className="flex h-full w-full">
|
|
862
838
|
<div
|
|
863
|
-
className="flex
|
|
864
|
-
|
|
865
|
-
// container which when clicked, will clear node selection
|
|
866
|
-
onClick={(event) => event.stopPropagation()}
|
|
839
|
+
className="relative flex h-full w-full overflow-auto rounded-sm border border-neutral-200"
|
|
840
|
+
onClick={() => editor.setSelectedNode(undefined)}
|
|
867
841
|
>
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
842
|
+
{!editor.tree.root && (
|
|
843
|
+
<div className="h-full w-full p-3">
|
|
844
|
+
<div>
|
|
845
|
+
No filter is specified. Click the button below to start.
|
|
846
|
+
</div>
|
|
847
|
+
<button
|
|
848
|
+
className="w-30 mt-2 h-6 border border-neutral-400 bg-neutral-300 px-2 hover:brightness-95"
|
|
849
|
+
onClick={() => {
|
|
850
|
+
editor.initializeTree();
|
|
851
|
+
}}
|
|
852
|
+
>
|
|
853
|
+
Create New Filter
|
|
854
|
+
</button>
|
|
855
|
+
</div>
|
|
856
|
+
)}
|
|
857
|
+
{editor.tree.root && (
|
|
858
|
+
<div
|
|
859
|
+
className="flex flex-col py-1"
|
|
860
|
+
// prevent click event of filter tree from propagating to the
|
|
861
|
+
// container which when clicked, will clear node selection
|
|
862
|
+
onClick={(event) => event.stopPropagation()}
|
|
863
|
+
>
|
|
864
|
+
<DataCubeEditorFilterGroupDisplay
|
|
865
|
+
node={editor.tree.root}
|
|
866
|
+
level={0}
|
|
867
|
+
dataCube={dataCube}
|
|
868
|
+
/>
|
|
869
|
+
<div
|
|
870
|
+
// add a padding so there will always be a clickable area to clear node selection
|
|
871
|
+
className="min-h-6 w-full flex-1"
|
|
872
|
+
onClick={() => editor.setSelectedNode(undefined)}
|
|
873
|
+
/>
|
|
874
|
+
</div>
|
|
875
|
+
)}
|
|
878
876
|
</div>
|
|
879
|
-
|
|
877
|
+
</div>
|
|
880
878
|
</div>
|
|
881
879
|
</div>
|
|
882
880
|
</div>
|
|
883
|
-
|
|
881
|
+
<div className="flex h-10 items-center justify-end px-2">
|
|
882
|
+
<button
|
|
883
|
+
className="h-6 w-20 border border-neutral-400 bg-neutral-300 px-2 hover:brightness-95"
|
|
884
|
+
onClick={() => {
|
|
885
|
+
editor.applyChanges();
|
|
886
|
+
editor.display.close();
|
|
887
|
+
}}
|
|
888
|
+
>
|
|
889
|
+
OK
|
|
890
|
+
</button>
|
|
891
|
+
<button
|
|
892
|
+
className="ml-2 h-6 w-20 border border-neutral-400 bg-neutral-300 px-2 hover:brightness-95"
|
|
893
|
+
onClick={() => editor.display.close()}
|
|
894
|
+
>
|
|
895
|
+
Cancel
|
|
896
|
+
</button>
|
|
897
|
+
<button
|
|
898
|
+
className="ml-2 h-6 w-20 border border-neutral-400 bg-neutral-300 px-2 hover:brightness-95"
|
|
899
|
+
onClick={() => editor.applyChanges()}
|
|
900
|
+
>
|
|
901
|
+
Apply
|
|
902
|
+
</button>
|
|
903
|
+
</div>
|
|
904
|
+
</>
|
|
884
905
|
);
|
|
885
906
|
},
|
|
886
907
|
);
|
|
@@ -25,6 +25,7 @@ import { validateAndBuildQuerySnapshot } from './core/DataCubeQuerySnapshotBuild
|
|
|
25
25
|
import { action, makeObservable, observable } from 'mobx';
|
|
26
26
|
import type { DataCubeEngine } from './DataCubeEngine.js';
|
|
27
27
|
import { ActionAlertType } from '@finos/legend-application';
|
|
28
|
+
import { DataCubeFilterEditorState } from './filter/DataCubeFilterEditorState.js';
|
|
28
29
|
|
|
29
30
|
export class DataCubeTask {
|
|
30
31
|
uuid = uuid();
|
|
@@ -50,6 +51,7 @@ export class DataCubeState {
|
|
|
50
51
|
readonly staticContent: DataCubeStaticContentDisplayState;
|
|
51
52
|
readonly grid: DataCubeGridState;
|
|
52
53
|
readonly editor: DataCubeEditorState;
|
|
54
|
+
readonly filter: DataCubeFilterEditorState;
|
|
53
55
|
|
|
54
56
|
readonly runningTasks = new Map<string, DataCubeTask>();
|
|
55
57
|
|
|
@@ -68,6 +70,7 @@ export class DataCubeState {
|
|
|
68
70
|
this.snapshotManager = new DataCubeQuerySnapshotManager(this);
|
|
69
71
|
this.staticContent = new DataCubeStaticContentDisplayState(this);
|
|
70
72
|
this.editor = new DataCubeEditorState(this);
|
|
73
|
+
this.filter = new DataCubeFilterEditorState(this);
|
|
71
74
|
this.grid = new DataCubeGridState(this);
|
|
72
75
|
}
|
|
73
76
|
|
|
@@ -92,7 +95,7 @@ export class DataCubeState {
|
|
|
92
95
|
this.editor,
|
|
93
96
|
this.grid,
|
|
94
97
|
this.grid.controller,
|
|
95
|
-
|
|
98
|
+
this.filter,
|
|
96
99
|
// TODO this.editor.extendedColumns,
|
|
97
100
|
].map(async (state) => {
|
|
98
101
|
this.snapshotManager.registerSubscriber(state);
|
|
@@ -103,8 +103,8 @@ export class DataCubeFilterEditorConditionTreeNode extends DataCubeFilterEditorT
|
|
|
103
103
|
setValue(value: DataCubeOperationValue | undefined) {
|
|
104
104
|
this.value = value
|
|
105
105
|
? isObservable(value)
|
|
106
|
-
?
|
|
107
|
-
: value
|
|
106
|
+
? value
|
|
107
|
+
: makeObservable(value, { value: observable })
|
|
108
108
|
: undefined;
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -161,6 +161,7 @@ export class DataCubeFilterEditorConditionGroupTreeNode extends DataCubeFilterEd
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
+
|
|
164
165
|
export function buildFilterQuerySnapshot(
|
|
165
166
|
node: DataCubeFilterEditorConditionGroupTreeNode,
|
|
166
167
|
): DataCubeQuerySnapshotFilter {
|
|
@@ -185,6 +186,7 @@ export function buildFilterQuerySnapshot(
|
|
|
185
186
|
}),
|
|
186
187
|
};
|
|
187
188
|
}
|
|
189
|
+
|
|
188
190
|
export function buildFilterEditorTree(
|
|
189
191
|
_node: DataCubeQuerySnapshotFilter,
|
|
190
192
|
parent: DataCubeFilterEditorConditionGroupTreeNode | undefined,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import type { DataCubeQueryEditorPanelState } from './DataCubeEditorPanelState.js';
|
|
24
24
|
import {
|
|
25
25
|
DataCubeEditorColumnsSelectorColumnState,
|
|
26
|
-
|
|
26
|
+
DataCubeEditorColumnsSelectorHiddenColumnsVisibility,
|
|
27
27
|
DataCubeEditorColumnsSelectorState,
|
|
28
28
|
} from './DataCubeEditorColumnsSelectorState.js';
|
|
29
29
|
import type { DataCubeEditorState } from './DataCubeEditorState.js';
|
|
@@ -66,8 +66,8 @@ export class DataCubeEditorColumnsPanelState
|
|
|
66
66
|
this.editor = editor;
|
|
67
67
|
this.dataCube = editor.dataCube;
|
|
68
68
|
this.selector = new DataCubeEditorBasicColumnsSelectorState(editor, {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
initialHiddenColumnsVisibility:
|
|
70
|
+
DataCubeEditorColumnsSelectorHiddenColumnsVisibility.HIDDEN,
|
|
71
71
|
onChange: (selector) => {
|
|
72
72
|
// populate a default configuration for the newly selected columns
|
|
73
73
|
selector.selectedColumns
|
|
@@ -135,6 +135,9 @@ export class DataCubeEditorColumnsPanelState
|
|
|
135
135
|
this.selector.setSelectedColumns(
|
|
136
136
|
// extract selected columns from the configuration since the configuration specifies the order
|
|
137
137
|
// taking into account the group extended columns
|
|
138
|
+
// NOTE: since select() is applied before grouping/aggregation, it's technicaly not possible to
|
|
139
|
+
// unselect the group extended columns, so we will take advantage of the `hidden` property to show
|
|
140
|
+
// group extended columns that are not hidden as selected
|
|
138
141
|
configuration.columns.map((col) => {
|
|
139
142
|
const column = this.selector.getColumn(col.name);
|
|
140
143
|
return new DataCubeEditorColumnsSelectorColumnState(
|
|
@@ -152,6 +155,7 @@ export class DataCubeEditorColumnsPanelState
|
|
|
152
155
|
this.propagateColumnSelectionChanges();
|
|
153
156
|
newSnapshot.data.selectColumns = this.selector.selectedColumns
|
|
154
157
|
// TODO: filter by group extended columns
|
|
158
|
+
// and translate unselection to hidden columns in column configuration
|
|
155
159
|
.map((col) => ({
|
|
156
160
|
name: col.name,
|
|
157
161
|
type: col.type,
|
|
@@ -29,7 +29,7 @@ export class DataCubeEditorColumnsSelectorColumnState {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export enum
|
|
32
|
+
export enum DataCubeEditorColumnsSelectorHiddenColumnsVisibility {
|
|
33
33
|
VISIBLE = 'visible',
|
|
34
34
|
VISIBLE_WITH_WARNING = 'visible-with-warning',
|
|
35
35
|
HIDDEN = 'hidden',
|
|
@@ -49,13 +49,13 @@ export abstract class DataCubeEditorColumnsSelectorState<
|
|
|
49
49
|
readonly onChange?:
|
|
50
50
|
| ((selector: DataCubeEditorColumnsSelectorState<T>) => void)
|
|
51
51
|
| undefined;
|
|
52
|
-
|
|
52
|
+
hiddenColumnsVisibility!: DataCubeEditorColumnsSelectorHiddenColumnsVisibility;
|
|
53
53
|
|
|
54
54
|
constructor(
|
|
55
55
|
editor: DataCubeEditorState,
|
|
56
56
|
options?: {
|
|
57
|
-
|
|
58
|
-
|
|
|
57
|
+
initialHiddenColumnsVisibility?:
|
|
58
|
+
| DataCubeEditorColumnsSelectorHiddenColumnsVisibility
|
|
59
59
|
| undefined;
|
|
60
60
|
onChange?:
|
|
61
61
|
| ((select: DataCubeEditorColumnsSelectorState<T>) => void)
|
|
@@ -76,22 +76,23 @@ export abstract class DataCubeEditorColumnsSelectorState<
|
|
|
76
76
|
selectedColumnsSearchText: observable,
|
|
77
77
|
setSelectedColumnsSearchText: action,
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
hiddenColumnsVisibility: observable,
|
|
80
|
+
setHiddenColumnsVisibility: action,
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
this.editor = editor;
|
|
84
84
|
this.dataCube = editor.dataCube;
|
|
85
85
|
this.onChange = options?.onChange;
|
|
86
|
-
this.
|
|
87
|
-
options?.
|
|
88
|
-
|
|
86
|
+
this.hiddenColumnsVisibility =
|
|
87
|
+
options?.initialHiddenColumnsVisibility ??
|
|
88
|
+
// default to show hidden columns
|
|
89
|
+
DataCubeEditorColumnsSelectorHiddenColumnsVisibility.VISIBLE;
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
setHiddenColumnsVisibility(
|
|
93
|
+
val: DataCubeEditorColumnsSelectorHiddenColumnsVisibility,
|
|
93
94
|
) {
|
|
94
|
-
this.
|
|
95
|
+
this.hiddenColumnsVisibility = val;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
abstract get availableColumns(): T[];
|
|
@@ -105,8 +106,8 @@ export abstract class DataCubeEditorColumnsSelectorState<
|
|
|
105
106
|
.sort((a, b) => a.name.localeCompare(b.name))
|
|
106
107
|
.filter(
|
|
107
108
|
(column) =>
|
|
108
|
-
this.
|
|
109
|
-
|
|
109
|
+
this.hiddenColumnsVisibility !==
|
|
110
|
+
DataCubeEditorColumnsSelectorHiddenColumnsVisibility.HIDDEN ||
|
|
110
111
|
!this.editor.columnProperties.columns.find(
|
|
111
112
|
(col) => col.name === column.name,
|
|
112
113
|
)?.hideFromView,
|
|
@@ -116,8 +117,8 @@ export abstract class DataCubeEditorColumnsSelectorState<
|
|
|
116
117
|
get selectedColumnsForDisplay(): T[] {
|
|
117
118
|
return this.selectedColumns.filter(
|
|
118
119
|
(column) =>
|
|
119
|
-
this.
|
|
120
|
-
|
|
120
|
+
this.hiddenColumnsVisibility !==
|
|
121
|
+
DataCubeEditorColumnsSelectorHiddenColumnsVisibility.HIDDEN ||
|
|
121
122
|
!this.editor.columnProperties.columns.find(
|
|
122
123
|
(col) => col.name === column.name,
|
|
123
124
|
)?.hideFromView,
|
|
@@ -125,6 +126,9 @@ export abstract class DataCubeEditorColumnsSelectorState<
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
setSelectedColumns(val: T[]) {
|
|
129
|
+
// NOTE: since we have a list of columns available which we treat as
|
|
130
|
+
// "templates" to select from, we need to clone these columns in order
|
|
131
|
+
// to avoid modifying the original available columns
|
|
128
132
|
this.selectedColumns = val.map((col) => this.cloneColumn(col));
|
|
129
133
|
this.onChange?.(this);
|
|
130
134
|
}
|
|
@@ -144,5 +148,5 @@ export abstract class DataCubeEditorColumnsSelectorState<
|
|
|
144
148
|
);
|
|
145
149
|
}
|
|
146
150
|
|
|
147
|
-
abstract cloneColumn(column: T): T;
|
|
151
|
+
protected abstract cloneColumn(column: T): T;
|
|
148
152
|
}
|
|
@@ -28,13 +28,10 @@ import { DataCubeConfiguration } from '../core/DataCubeConfiguration.js';
|
|
|
28
28
|
import { DataCubeEditorVerticalPivotsPanelState } from './DataCubeEditorVerticalPivotsPanelState.js';
|
|
29
29
|
import { SingletonModeDisplayState } from '../../LayoutManagerState.js';
|
|
30
30
|
import { DataCubeEditor } from '../../../components/dataCube/editor/DataCubeEditor.js';
|
|
31
|
-
import { DataCubeEditorFilterPanelState } from './DataCubeEditorFilterPanelState.js';
|
|
32
31
|
|
|
33
32
|
export enum DataCubeEditorTab {
|
|
34
33
|
GENERAL_PROPERTIES = 'General Properties',
|
|
35
34
|
COLUMN_PROPERTIES = 'Column Properties',
|
|
36
|
-
EXTENDED_COLUMNS = 'Extended Columns',
|
|
37
|
-
FILTER = 'Filter',
|
|
38
35
|
COLUMNS = 'Columns',
|
|
39
36
|
VERTICAL_PIVOTS = 'Vertical Pivots',
|
|
40
37
|
HORIZONTAL_PIVOTS = 'Horizontal Pivots',
|
|
@@ -44,13 +41,15 @@ export enum DataCubeEditorTab {
|
|
|
44
41
|
|
|
45
42
|
export class DataCubeEditorState extends DataCubeQuerySnapshotController {
|
|
46
43
|
readonly display: SingletonModeDisplayState;
|
|
44
|
+
|
|
45
|
+
readonly code: DataCubeEditorCodePanelState;
|
|
46
|
+
|
|
47
47
|
readonly generalProperties: DataCubeEditorGeneralPropertiesPanelState;
|
|
48
48
|
readonly columnProperties: DataCubeEditorColumnPropertiesPanelState;
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
readonly columns: DataCubeEditorColumnsPanelState;
|
|
51
51
|
readonly verticalPivots: DataCubeEditorVerticalPivotsPanelState;
|
|
52
52
|
readonly sorts: DataCubeEditorSortsPanelState;
|
|
53
|
-
readonly code: DataCubeEditorCodePanelState;
|
|
54
53
|
|
|
55
54
|
currentTab = DataCubeEditorTab.GENERAL_PROPERTIES;
|
|
56
55
|
|
|
@@ -58,10 +57,10 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotController {
|
|
|
58
57
|
super(dataCube);
|
|
59
58
|
|
|
60
59
|
makeObservable(this, {
|
|
61
|
-
applyChanges: action,
|
|
62
|
-
|
|
63
60
|
currentTab: observable,
|
|
64
61
|
setCurrentTab: action,
|
|
62
|
+
|
|
63
|
+
applyChanges: action,
|
|
65
64
|
});
|
|
66
65
|
|
|
67
66
|
this.display = new SingletonModeDisplayState(
|
|
@@ -73,7 +72,6 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotController {
|
|
|
73
72
|
this,
|
|
74
73
|
);
|
|
75
74
|
this.columnProperties = new DataCubeEditorColumnPropertiesPanelState(this);
|
|
76
|
-
this.filter = new DataCubeEditorFilterPanelState(this);
|
|
77
75
|
this.columns = new DataCubeEditorColumnsPanelState(this);
|
|
78
76
|
this.verticalPivots = new DataCubeEditorVerticalPivotsPanelState(this);
|
|
79
77
|
this.sorts = new DataCubeEditorSortsPanelState(this);
|
|
@@ -88,13 +86,12 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotController {
|
|
|
88
86
|
const baseSnapshot = guaranteeNonNullable(this.getLatestSnapshot());
|
|
89
87
|
const snapshot = baseSnapshot.clone();
|
|
90
88
|
|
|
91
|
-
// NOTE: column selection must be processed first so
|
|
89
|
+
// NOTE: column selection must be processed first so necessary
|
|
92
90
|
// prunings can be done to make sure other panel stats are in sync
|
|
93
91
|
// with the current column selection
|
|
94
92
|
this.columns.buildSnapshot(snapshot, baseSnapshot);
|
|
95
93
|
this.verticalPivots.buildSnapshot(snapshot, baseSnapshot);
|
|
96
94
|
this.sorts.buildSnapshot(snapshot, baseSnapshot);
|
|
97
|
-
this.filter.buildSnapshot(snapshot, baseSnapshot);
|
|
98
95
|
|
|
99
96
|
// grid configuration must be processed before processing columns' configuration
|
|
100
97
|
// to properly generate the container configuration
|
|
@@ -118,7 +115,6 @@ export class DataCubeEditorState extends DataCubeQuerySnapshotController {
|
|
|
118
115
|
this.columns.applySnaphot(snapshot, configuration);
|
|
119
116
|
this.verticalPivots.applySnaphot(snapshot, configuration);
|
|
120
117
|
this.sorts.applySnaphot(snapshot, configuration);
|
|
121
|
-
this.filter.applySnaphot(snapshot, configuration);
|
|
122
118
|
|
|
123
119
|
this.generalProperties.applySnaphot(snapshot, configuration);
|
|
124
120
|
this.columnProperties.applySnaphot(snapshot, configuration);
|