@finos/legend-query-builder 3.0.6 → 3.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. package/lib/__lib__/QueryBuilderDocumentation.d.ts +0 -1
  2. package/lib/__lib__/QueryBuilderDocumentation.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderDocumentation.js +0 -1
  4. package/lib/__lib__/QueryBuilderDocumentation.js.map +1 -1
  5. package/lib/__lib__/QueryBuilderEvent.d.ts +18 -0
  6. package/lib/__lib__/QueryBuilderEvent.d.ts.map +1 -1
  7. package/lib/__lib__/QueryBuilderEvent.js +20 -0
  8. package/lib/__lib__/QueryBuilderEvent.js.map +1 -1
  9. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts +14 -0
  10. package/lib/__lib__/QueryBuilderTelemetryHelper.d.ts.map +1 -1
  11. package/lib/__lib__/QueryBuilderTelemetryHelper.js +43 -1
  12. package/lib/__lib__/QueryBuilderTelemetryHelper.js.map +1 -1
  13. package/lib/components/QueryBuilder.d.ts +0 -1
  14. package/lib/components/QueryBuilder.d.ts.map +1 -1
  15. package/lib/components/QueryBuilder.js +25 -34
  16. package/lib/components/QueryBuilder.js.map +1 -1
  17. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts +0 -1
  18. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
  19. package/lib/components/QueryBuilderConstantExpressionPanel.js +11 -15
  20. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
  21. package/lib/components/QueryBuilderDiffPanel.d.ts +0 -1
  22. package/lib/components/QueryBuilderDiffPanel.d.ts.map +1 -1
  23. package/lib/components/QueryBuilderParametersPanel.d.ts +0 -1
  24. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  25. package/lib/components/QueryBuilderParametersPanel.js +16 -20
  26. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  27. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +0 -1
  28. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  29. package/lib/components/QueryBuilderResultPanel.d.ts +0 -1
  30. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  31. package/lib/components/QueryBuilderSideBar.d.ts +0 -1
  32. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  33. package/lib/components/QueryBuilderTextEditor.d.ts +0 -1
  34. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  35. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts +0 -1
  36. package/lib/components/QueryBuilderUnsupportedQueryEditor.d.ts.map +1 -1
  37. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts +0 -1
  38. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.d.ts.map +1 -1
  39. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts +0 -1
  40. package/lib/components/explorer/QueryBuilderMilestoningEditor.d.ts.map +1 -1
  41. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts +0 -1
  42. package/lib/components/explorer/QueryBuilderPropertySearchPanel.d.ts.map +1 -1
  43. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts +0 -1
  44. package/lib/components/fetch-structure/QueryBuilderFetchStructurePanel.d.ts.map +1 -1
  45. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts +0 -1
  46. package/lib/components/fetch-structure/QueryBuilderGraphFetchTreePanel.d.ts.map +1 -1
  47. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +0 -1
  48. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  49. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +13 -3
  50. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  51. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts +0 -1
  52. package/lib/components/fetch-structure/QueryBuilderPostTDSPanel.d.ts.map +1 -1
  53. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts +0 -1
  54. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  55. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts +0 -1
  56. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  57. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +1 -1
  58. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  59. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts +0 -1
  60. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
  61. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +2 -2
  62. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
  63. package/lib/components/filter/QueryBuilderFilterPanel.d.ts +0 -1
  64. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  65. package/lib/components/filter/QueryBuilderFilterPanel.js +14 -3
  66. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  67. package/lib/components/shared/LambdaEditor.d.ts +0 -1
  68. package/lib/components/shared/LambdaEditor.d.ts.map +1 -1
  69. package/lib/components/shared/LambdaParameterValuesEditor.d.ts +0 -1
  70. package/lib/components/shared/LambdaParameterValuesEditor.d.ts.map +1 -1
  71. package/lib/components/shared/LambdaParameterValuesEditor.js +2 -1
  72. package/lib/components/shared/LambdaParameterValuesEditor.js.map +1 -1
  73. package/lib/components/shared/QueryBuilderVariableSelector.d.ts +0 -1
  74. package/lib/components/shared/QueryBuilderVariableSelector.d.ts.map +1 -1
  75. package/lib/components/watermark/QueryBuilderWatermark.d.ts +0 -1
  76. package/lib/components/watermark/QueryBuilderWatermark.d.ts.map +1 -1
  77. package/lib/index.css +2 -2
  78. package/lib/index.css.map +1 -1
  79. package/lib/index.d.ts +2 -0
  80. package/lib/index.d.ts.map +1 -1
  81. package/lib/index.js +2 -0
  82. package/lib/index.js.map +1 -1
  83. package/lib/package.json +5 -5
  84. package/lib/stores/QueryBuilderState.d.ts +1 -2
  85. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  86. package/lib/stores/QueryBuilderState.js +7 -8
  87. package/lib/stores/QueryBuilderState.js.map +1 -1
  88. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts +2 -1
  89. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  90. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +1 -1
  91. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  92. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.d.ts +2 -1
  93. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.d.ts.map +1 -1
  94. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.js +18 -15
  95. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.js.map +1 -1
  96. package/package.json +13 -13
  97. package/src/__lib__/QueryBuilderDocumentation.ts +0 -2
  98. package/src/__lib__/QueryBuilderEvent.ts +20 -0
  99. package/src/__lib__/QueryBuilderTelemetryHelper.ts +131 -1
  100. package/src/components/QueryBuilder.tsx +147 -188
  101. package/src/components/QueryBuilderConstantExpressionPanel.tsx +7 -12
  102. package/src/components/QueryBuilderParametersPanel.tsx +6 -10
  103. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +96 -60
  104. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +1 -3
  105. package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +2 -4
  106. package/src/components/filter/QueryBuilderFilterPanel.tsx +102 -60
  107. package/src/components/shared/LambdaParameterValuesEditor.tsx +6 -5
  108. package/src/index.ts +2 -0
  109. package/src/stores/QueryBuilderState.ts +6 -11
  110. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +1 -1
  111. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.ts +43 -25
@@ -44,6 +44,9 @@ import {
44
44
  useDragPreviewLayer,
45
45
  BlankPanelContent,
46
46
  PanelContent,
47
+ MoreVerticalIcon,
48
+ MenuContentItemIcon,
49
+ MenuContentItemLabel,
47
50
  } from '@finos/legend-art';
48
51
  import {
49
52
  type ValueSpecification,
@@ -97,6 +100,7 @@ import {
97
100
  QUERY_BUILDER_WINDOW_COLUMN_DND_TYPE,
98
101
  } from '../../stores/fetch-structure/tds/window/QueryBuilderWindowState.js';
99
102
  import type { QueryBuilderTDSColumnState } from '../../stores/fetch-structure/tds/QueryBuilderTDSColumnState.js';
103
+ import { QueryBuilderTelemetryHelper } from '../../__lib__/QueryBuilderTelemetryHelper.js';
100
104
 
101
105
  const QueryBuilderPostFilterConditionContextMenu = observer(
102
106
  forwardRef<
@@ -765,22 +769,37 @@ const QueryBuilderPostFilterPanelContent = observer(
765
769
  const rootNode = postFilterState.getRootNode();
766
770
  // actions
767
771
  const collapseTree = (): void => {
772
+ QueryBuilderTelemetryHelper.logEvent_PostFilterCollapseTreeLaunched(
773
+ applicationStore.telemetryService,
774
+ );
768
775
  postFilterState.setSelectedNode(undefined);
769
776
  postFilterState.collapseTree();
770
777
  };
771
778
  const expandTree = (): void => {
779
+ QueryBuilderTelemetryHelper.logEvent_PostFilterExpandTreeLaunched(
780
+ applicationStore.telemetryService,
781
+ );
772
782
  postFilterState.setSelectedNode(undefined);
773
783
  postFilterState.expandTree();
774
784
  };
775
785
  const pruneTree = (): void => {
786
+ QueryBuilderTelemetryHelper.logEvent_PostFilterCleanupTreeLaunched(
787
+ applicationStore.telemetryService,
788
+ );
776
789
  postFilterState.suppressClickawayEventListener();
777
790
  postFilterState.pruneTree();
778
791
  };
779
792
  const simplifyTree = (): void => {
793
+ QueryBuilderTelemetryHelper.logEvent_PostFilterSimplifyTreeLaunched(
794
+ applicationStore.telemetryService,
795
+ );
780
796
  postFilterState.suppressClickawayEventListener();
781
797
  postFilterState.simplifyTree();
782
798
  };
783
799
  const createCondition = (): void => {
800
+ QueryBuilderTelemetryHelper.logEvent_PostFilterCreateConditionLaunched(
801
+ applicationStore.telemetryService,
802
+ );
784
803
  postFilterState.suppressClickawayEventListener();
785
804
  postFilterState.addNodeFromNode(
786
805
  new QueryBuilderPostFilterTreeBlankConditionNodeData(undefined),
@@ -794,6 +813,9 @@ const QueryBuilderPostFilterPanelContent = observer(
794
813
  rootNode instanceof QueryBuilderPostFilterTreeGroupNodeData)); // or if it is the root note, it has to be a group node
795
814
 
796
815
  const createGroupCondition = (): void => {
816
+ QueryBuilderTelemetryHelper.logEvent_PostFilterCreateLogicalGroupLaunched(
817
+ applicationStore.telemetryService,
818
+ );
797
819
  postFilterState.suppressClickawayEventListener();
798
820
  if (allowGroupCreation) {
799
821
  postFilterState.addGroupConditionNodeFromNode(
@@ -802,6 +824,9 @@ const QueryBuilderPostFilterPanelContent = observer(
802
824
  }
803
825
  };
804
826
  const newGroupWithCondition = (): void => {
827
+ QueryBuilderTelemetryHelper.logEvent_PostFilterCreateGroupFromConditionLaunched(
828
+ applicationStore.telemetryService,
829
+ );
805
830
  postFilterState.suppressClickawayEventListener();
806
831
  if (
807
832
  postFilterState.selectedNode instanceof
@@ -889,69 +914,80 @@ const QueryBuilderPostFilterPanelContent = observer(
889
914
  <div className="panel__header__title__label">post-filter</div>
890
915
  </div>
891
916
  <div className="panel__header__actions">
892
- <button
893
- className="panel__header__action"
894
- onClick={createCondition}
895
- tabIndex={-1}
896
- title="Create Condition"
897
- >
898
- <PlusIcon />
899
- </button>
900
- <button
917
+ <DropdownMenu
901
918
  className="panel__header__action"
902
- disabled={
903
- !(
904
- postFilterState.selectedNode instanceof
905
- QueryBuilderPostFilterTreeConditionNodeData
906
- )
919
+ title="Show Filter Options Menu..."
920
+ content={
921
+ <MenuContent>
922
+ <MenuContentItem onClick={createCondition}>
923
+ <MenuContentItemIcon>
924
+ <PlusIcon />
925
+ </MenuContentItemIcon>
926
+ <MenuContentItemLabel>
927
+ Create Condition
928
+ </MenuContentItemLabel>
929
+ </MenuContentItem>
930
+ <MenuContentItem
931
+ disabled={
932
+ !(
933
+ postFilterState.selectedNode instanceof
934
+ QueryBuilderPostFilterTreeConditionNodeData
935
+ )
936
+ }
937
+ onClick={newGroupWithCondition}
938
+ >
939
+ <MenuContentItemIcon>
940
+ <PlusCircleIcon />
941
+ </MenuContentItemIcon>
942
+ <MenuContentItemLabel>
943
+ Create Group From Condition
944
+ </MenuContentItemLabel>
945
+ </MenuContentItem>
946
+ <MenuContentItem
947
+ disabled={!allowGroupCreation}
948
+ title={
949
+ !allowGroupCreation
950
+ ? 'Please select a filter node first to create logical group'
951
+ : ''
952
+ }
953
+ onClick={createGroupCondition}
954
+ >
955
+ <MenuContentItemIcon>
956
+ <NewFolderIcon />
957
+ </MenuContentItemIcon>
958
+ <MenuContentItemLabel>
959
+ Create Logical Group
960
+ </MenuContentItemLabel>
961
+ </MenuContentItem>
962
+ <MenuContentItem onClick={pruneTree}>
963
+ <MenuContentItemIcon>
964
+ <TrashIcon />
965
+ </MenuContentItemIcon>
966
+ <MenuContentItemLabel>Cleanup Tree</MenuContentItemLabel>
967
+ </MenuContentItem>
968
+ <MenuContentItem onClick={simplifyTree}>
969
+ <MenuContentItemIcon>
970
+ <CircleIcon />
971
+ </MenuContentItemIcon>
972
+ <MenuContentItemLabel>Simplify Tree</MenuContentItemLabel>
973
+ </MenuContentItem>
974
+ <MenuContentItem onClick={collapseTree}>
975
+ <MenuContentItemIcon>
976
+ <CompressIcon />
977
+ </MenuContentItemIcon>
978
+ <MenuContentItemLabel>Collapse Tree</MenuContentItemLabel>
979
+ </MenuContentItem>
980
+ <MenuContentItem onClick={expandTree}>
981
+ <MenuContentItemIcon>
982
+ <ExpandIcon />
983
+ </MenuContentItemIcon>
984
+ <MenuContentItemLabel>Expand Tree</MenuContentItemLabel>
985
+ </MenuContentItem>
986
+ </MenuContent>
907
987
  }
908
- onClick={newGroupWithCondition}
909
- tabIndex={-1}
910
- title="Create Group From Condition"
911
- >
912
- <PlusCircleIcon />
913
- </button>
914
- <button
915
- className="panel__header__action"
916
- disabled={!allowGroupCreation}
917
- onClick={createGroupCondition}
918
- tabIndex={-1}
919
- title="Create Logical Group"
920
988
  >
921
- <NewFolderIcon />
922
- </button>
923
- <button
924
- className="panel__header__action"
925
- onClick={pruneTree}
926
- tabIndex={-1}
927
- title="Cleanup Tree"
928
- >
929
- <TrashIcon />
930
- </button>
931
- <button
932
- className="panel__header__action"
933
- onClick={simplifyTree}
934
- tabIndex={-1}
935
- title="Simplify Tree"
936
- >
937
- <CircleIcon />
938
- </button>
939
- <button
940
- className="panel__header__action"
941
- onClick={collapseTree}
942
- tabIndex={-1}
943
- title="Collapse Tree"
944
- >
945
- <CompressIcon />
946
- </button>
947
- <button
948
- className="panel__header__action"
949
- onClick={expandTree}
950
- tabIndex={-1}
951
- title="Expand Tree"
952
- >
953
- <ExpandIcon />
954
- </button>
989
+ <MoreVerticalIcon className="query-builder__icon__more-options" />
990
+ </DropdownMenu>
955
991
  </div>
956
992
  </div>
957
993
  <PanelContent>
@@ -372,9 +372,7 @@ const QueryBuilderProjectionColumnEditor = observer(
372
372
  spellCheck={false}
373
373
  value={projectionColumnState.columnName}
374
374
  onChange={changeColumnName}
375
- validationErrorMessage={
376
- isDuplicatedColumnName ? 'Duplicated column' : undefined
377
- }
375
+ error={isDuplicatedColumnName ? 'Duplicated column' : undefined}
378
376
  />
379
377
  </div>
380
378
  <div className="query-builder__projection__column__value">
@@ -513,9 +513,7 @@ const QueryBuilderWindowColumnModalEditor = observer(
513
513
  spellCheck={false}
514
514
  value={windowColumnState.columnName}
515
515
  onChange={changeColumnName}
516
- validationErrorMessage={
517
- isDuplicatedColumnName ? 'Duplicated column' : undefined
518
- }
516
+ error={isDuplicatedColumnName ? 'Duplicated column' : undefined}
519
517
  />
520
518
  </PanelFormSection>
521
519
  </div>
@@ -1087,7 +1085,7 @@ const QueryBuilderWindowColumnEditor = observer(
1087
1085
  spellCheck={false}
1088
1086
  value={windowColumnState.columnName}
1089
1087
  onChange={changeColumnName}
1090
- validationErrorMessage={
1088
+ error={
1091
1089
  isDuplicatedColumnName
1092
1090
  ? 'Duplicated column'
1093
1091
  : isInvalidColumnName
@@ -43,6 +43,9 @@ import {
43
43
  PanelEntryDropZonePlaceholder,
44
44
  useDragPreviewLayer,
45
45
  PanelContent,
46
+ MoreVerticalIcon,
47
+ MenuContentItemIcon,
48
+ MenuContentItemLabel,
46
49
  } from '@finos/legend-art';
47
50
  import {
48
51
  type QueryBuilderFilterConditionDragSource,
@@ -84,6 +87,7 @@ import {
84
87
  type QueryBuilderVariableDragSource,
85
88
  QUERY_BUILDER_VARIABLE_DND_TYPE,
86
89
  } from '../shared/BasicValueSpecificationEditor.js';
90
+ import { QueryBuilderTelemetryHelper } from '../../__lib__/QueryBuilderTelemetryHelper.js';
87
91
 
88
92
  const QueryBuilderFilterGroupConditionEditor = observer(
89
93
  (props: {
@@ -335,6 +339,10 @@ const QueryBuilderFilterConditionContextMenu = observer(
335
339
  filterState.addGroupConditionNodeFromNode(node);
336
340
  };
337
341
  const newGroupWithCondition = (): void => {
342
+ QueryBuilderTelemetryHelper.logEvent_FilterCreateGroupFromConditionLaunched(
343
+ queryBuilderState.applicationStore.telemetryService,
344
+ );
345
+
338
346
  filterState.suppressClickawayEventListener();
339
347
  filterState.newGroupWithConditionFromNode(undefined, node);
340
348
  };
@@ -677,26 +685,42 @@ const QueryBuilderFilterTree = observer(
677
685
  export const QueryBuilderFilterPanel = observer(
678
686
  (props: { queryBuilderState: QueryBuilderState }) => {
679
687
  const { queryBuilderState } = props;
688
+
680
689
  const applicationStore = useApplicationStore();
681
690
  const filterState = queryBuilderState.filterState;
682
691
  const rootNode = filterState.getRootNode();
683
692
  const collapseTree = (): void => {
693
+ QueryBuilderTelemetryHelper.logEvent_FilterCollapseTreeLaunched(
694
+ queryBuilderState.applicationStore.telemetryService,
695
+ );
684
696
  filterState.setSelectedNode(undefined);
685
697
  filterState.collapseTree();
686
698
  };
687
699
  const expandTree = (): void => {
700
+ QueryBuilderTelemetryHelper.logEvent_FilterExpandTreeLaunched(
701
+ queryBuilderState.applicationStore.telemetryService,
702
+ );
688
703
  filterState.setSelectedNode(undefined);
689
704
  filterState.expandTree();
690
705
  };
691
706
  const pruneTree = (): void => {
707
+ QueryBuilderTelemetryHelper.logEvent_FilterCleanupTreeLaunched(
708
+ queryBuilderState.applicationStore.telemetryService,
709
+ );
692
710
  filterState.suppressClickawayEventListener();
693
711
  filterState.pruneTree();
694
712
  };
695
713
  const simplifyTree = (): void => {
714
+ QueryBuilderTelemetryHelper.logEvent_FilterSimplifyTreeLaunched(
715
+ queryBuilderState.applicationStore.telemetryService,
716
+ );
696
717
  filterState.suppressClickawayEventListener();
697
718
  filterState.simplifyTree();
698
719
  };
699
720
  const createCondition = (): void => {
721
+ QueryBuilderTelemetryHelper.logEvent_FilterCreateConditionLaunched(
722
+ queryBuilderState.applicationStore.telemetryService,
723
+ );
700
724
  filterState.suppressClickawayEventListener();
701
725
  filterState.addNodeFromNode(
702
726
  new QueryBuilderFilterTreeBlankConditionNodeData(undefined),
@@ -709,12 +733,18 @@ export const QueryBuilderFilterPanel = observer(
709
733
  (filterState.selectedNode !== rootNode || // either not a root node
710
734
  rootNode instanceof QueryBuilderFilterTreeGroupNodeData)); // or if it is the root note, it has to be a group node
711
735
  const createGroupCondition = (): void => {
736
+ QueryBuilderTelemetryHelper.logEvent_FilterCreateLogicalGroupLaunched(
737
+ queryBuilderState.applicationStore.telemetryService,
738
+ );
712
739
  filterState.suppressClickawayEventListener();
713
740
  if (allowGroupCreation) {
714
741
  filterState.addGroupConditionNodeFromNode(filterState.selectedNode);
715
742
  }
716
743
  };
717
744
  const newGroupWithCondition = (): void => {
745
+ QueryBuilderTelemetryHelper.logEvent_FilterCreateLogicalGroupLaunched(
746
+ applicationStore.telemetryService,
747
+ );
718
748
  filterState.suppressClickawayEventListener();
719
749
  if (
720
750
  filterState.selectedNode instanceof
@@ -812,70 +842,82 @@ export const QueryBuilderFilterPanel = observer(
812
842
  <div className="panel__header__title">
813
843
  <div className="panel__header__title__label">filter</div>
814
844
  </div>
845
+
815
846
  <div className="panel__header__actions">
816
- <button
817
- className="panel__header__action"
818
- onClick={createCondition}
819
- tabIndex={-1}
820
- title="Create Condition"
821
- >
822
- <PlusIcon />
823
- </button>
824
- <button
847
+ <DropdownMenu
825
848
  className="panel__header__action"
826
- disabled={
827
- !(
828
- filterState.selectedNode instanceof
829
- QueryBuilderFilterTreeConditionNodeData
830
- )
849
+ title="Show Filter Options Menu..."
850
+ content={
851
+ <MenuContent>
852
+ <MenuContentItem onClick={createCondition}>
853
+ <MenuContentItemIcon>
854
+ <PlusIcon />
855
+ </MenuContentItemIcon>
856
+ <MenuContentItemLabel>
857
+ Create Condition
858
+ </MenuContentItemLabel>
859
+ </MenuContentItem>
860
+ <MenuContentItem
861
+ disabled={
862
+ !(
863
+ filterState.selectedNode instanceof
864
+ QueryBuilderFilterTreeConditionNodeData
865
+ )
866
+ }
867
+ onClick={newGroupWithCondition}
868
+ >
869
+ <MenuContentItemIcon>
870
+ <PlusCircleIcon />
871
+ </MenuContentItemIcon>
872
+ <MenuContentItemLabel>
873
+ Create Group From Condition
874
+ </MenuContentItemLabel>
875
+ </MenuContentItem>
876
+ <MenuContentItem
877
+ disabled={!allowGroupCreation}
878
+ title={
879
+ !allowGroupCreation
880
+ ? 'Please select a filter node first to create logical group'
881
+ : ''
882
+ }
883
+ onClick={createGroupCondition}
884
+ >
885
+ <MenuContentItemIcon>
886
+ <NewFolderIcon />
887
+ </MenuContentItemIcon>
888
+ <MenuContentItemLabel>
889
+ Create Logical Group
890
+ </MenuContentItemLabel>
891
+ </MenuContentItem>
892
+ <MenuContentItem onClick={pruneTree}>
893
+ <MenuContentItemIcon>
894
+ <TrashIcon />
895
+ </MenuContentItemIcon>
896
+ <MenuContentItemLabel>Cleanup Tree</MenuContentItemLabel>
897
+ </MenuContentItem>
898
+ <MenuContentItem onClick={simplifyTree}>
899
+ <MenuContentItemIcon>
900
+ <CircleIcon />
901
+ </MenuContentItemIcon>
902
+ <MenuContentItemLabel>Simplify Tree</MenuContentItemLabel>
903
+ </MenuContentItem>
904
+ <MenuContentItem onClick={collapseTree}>
905
+ <MenuContentItemIcon>
906
+ <CompressIcon />
907
+ </MenuContentItemIcon>
908
+ <MenuContentItemLabel>Collapse Tree</MenuContentItemLabel>
909
+ </MenuContentItem>
910
+ <MenuContentItem onClick={expandTree}>
911
+ <MenuContentItemIcon>
912
+ <ExpandIcon />
913
+ </MenuContentItemIcon>
914
+ <MenuContentItemLabel>Expand Tree</MenuContentItemLabel>
915
+ </MenuContentItem>
916
+ </MenuContent>
831
917
  }
832
- onClick={newGroupWithCondition}
833
- tabIndex={-1}
834
- title="Create Group From Condition"
835
918
  >
836
- <PlusCircleIcon />
837
- </button>
838
- <button
839
- className="panel__header__action"
840
- disabled={!allowGroupCreation}
841
- onClick={createGroupCondition}
842
- tabIndex={-1}
843
- title="Create Logical Group"
844
- >
845
- <NewFolderIcon />
846
- </button>
847
- <button
848
- className="panel__header__action"
849
- onClick={pruneTree}
850
- tabIndex={-1}
851
- title="Cleanup Tree"
852
- >
853
- <TrashIcon />
854
- </button>
855
- <button
856
- className="panel__header__action"
857
- onClick={simplifyTree}
858
- tabIndex={-1}
859
- title="Simplify Tree"
860
- >
861
- <CircleIcon />
862
- </button>
863
- <button
864
- className="panel__header__action"
865
- onClick={collapseTree}
866
- tabIndex={-1}
867
- title="Collapse Tree"
868
- >
869
- <CompressIcon />
870
- </button>
871
- <button
872
- className="panel__header__action"
873
- onClick={expandTree}
874
- tabIndex={-1}
875
- title="Expand Tree"
876
- >
877
- <ExpandIcon />
878
- </button>
919
+ <MoreVerticalIcon className="query-builder__icon__more-options" />
920
+ </DropdownMenu>
879
921
  </div>
880
922
  </div>
881
923
  <PanelContent>
@@ -30,6 +30,7 @@ import {
30
30
  type ObserverContext,
31
31
  PrimitiveType,
32
32
  } from '@finos/legend-graph';
33
+ import { prettyCONSTName } from '@finos/legend-shared';
33
34
  import { observer } from 'mobx-react-lite';
34
35
  import { useState } from 'react';
35
36
  import type { LambdaParametersState } from '../../stores/shared/LambdaParameterState.js';
@@ -119,15 +120,15 @@ export const LambdaParameterValuesEditor = observer(
119
120
  )}
120
121
  {submitAction && (
121
122
  <ModalFooterButton
122
- inProgress={isSubmitAction}
123
- inProgressText={`${submitAction.label}...`}
123
+ inProgressText={
124
+ isSubmitAction ? `${submitAction.label}...` : undefined
125
+ }
124
126
  onClick={submit}
125
- text={submitAction.label}
127
+ text={prettyCONSTName(submitAction.label)}
126
128
  />
127
129
  )}
128
130
  <ModalFooterButton
129
- inProgress={isClosingAction}
130
- inProgressText={'Closing...'}
131
+ inProgressText={isClosingAction ? 'Closing...' : undefined}
131
132
  onClick={close}
132
133
  text="Close"
133
134
  />
package/src/index.ts CHANGED
@@ -52,6 +52,8 @@ export * from './components/QuerySetupUtils.js';
52
52
  export * from './components/QueryBuilderTextEditor.js';
53
53
 
54
54
  export { QueryBuilderTextEditorMode } from './stores/QueryBuilderTextEditorState.js';
55
+ export { buildSerialzieFunctionWithGraphFetch } from './stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeValueSpecificationBuilder.js';
56
+ export { buildGetAllFunction } from './stores/QueryBuilderValueSpecificationBuilder.js';
55
57
 
56
58
  // ------------------------------------------- Shared components -------------------------------------------
57
59
 
@@ -87,6 +87,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
87
87
  readonly changeDetectionState: QueryBuilderChangeDetectionState;
88
88
  readonly queryCompileState = ActionState.create();
89
89
  readonly observerContext: ObserverContext;
90
+ readonly saveQueryProgressState = ActionState.create();
90
91
 
91
92
  explorerState: QueryBuilderExplorerState;
92
93
  functionsExplorerState: QueryFunctionsExplorerState;
@@ -102,8 +103,6 @@ export abstract class QueryBuilderState implements CommandRegistrar {
102
103
  resultState: QueryBuilderResultState;
103
104
  textEditorState: QueryBuilderTextEditorState;
104
105
  unsupportedQueryState: QueryBuilderUnsupportedQueryState;
105
-
106
- titleOfQuery: string | undefined;
107
106
  showFunctionsExplorerPanel = false;
108
107
  showParametersPanel = false;
109
108
  isEditingWatermark = false;
@@ -129,7 +128,6 @@ export abstract class QueryBuilderState implements CommandRegistrar {
129
128
  fetchStructureState: observable,
130
129
  filterState: observable,
131
130
  watermarkState: observable,
132
- titleOfQuery: observable,
133
131
  checkEntitlementsState: observable,
134
132
  resultState: observable,
135
133
  textEditorState: observable,
@@ -155,8 +153,6 @@ export abstract class QueryBuilderState implements CommandRegistrar {
155
153
  setMapping: action,
156
154
  setRuntimeValue: action,
157
155
 
158
- setTitleOfQuery: action,
159
-
160
156
  resetQueryResult: action,
161
157
  resetQueryContent: action,
162
158
  changeClass: action,
@@ -259,10 +255,6 @@ export abstract class QueryBuilderState implements CommandRegistrar {
259
255
  this.runtimeValue = val;
260
256
  }
261
257
 
262
- setTitleOfQuery(val: string | undefined): void {
263
- this.titleOfQuery = val;
264
- }
265
-
266
258
  get isQuerySupported(): boolean {
267
259
  return !this.unsupportedQueryState.rawLambda;
268
260
  }
@@ -437,7 +429,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
437
429
  }
438
430
  } catch (error) {
439
431
  assertErrorThrown(error);
440
- this.resetQueryResult();
432
+ this.resetQueryResult({ preserveResult: options?.preserveResult });
441
433
  this.resetQueryContent();
442
434
  this.unsupportedQueryState.setLambdaError(error);
443
435
  this.unsupportedQueryState.setRawLambda(query);
@@ -448,13 +440,14 @@ export abstract class QueryBuilderState implements CommandRegistrar {
448
440
  )
449
441
  .map((param) => observe_ValueSpecification(param, this.observerContext))
450
442
  .filter(filterByType(VariableExpression));
451
- processParameters(parameters, this);
443
+ processParameters(parameters, this, previousStateParameterValues);
452
444
  }
453
445
  }
454
446
 
455
447
  async saveQuery(
456
448
  onSaveQuery: (lambda: RawLambda) => Promise<void>,
457
449
  ): Promise<void> {
450
+ this.saveQueryProgressState.inProgress();
458
451
  try {
459
452
  const query = this.buildQuery();
460
453
  await onSaveQuery(query);
@@ -463,6 +456,8 @@ export abstract class QueryBuilderState implements CommandRegistrar {
463
456
  this.applicationStore.notificationService.notifyError(
464
457
  `Can't save query: ${error.message}`,
465
458
  );
459
+ } finally {
460
+ this.saveQueryProgressState.complete();
466
461
  }
467
462
  }
468
463
 
@@ -41,7 +41,7 @@ import { buildWatermarkExpression } from './watermark/QueryBuilderWatermarkValue
41
41
  import { buildExecutionQueryFromLambdaFunction } from './shared/LambdaParameterState.js';
42
42
  import type { QueryBuilderConstantExpressionState } from './QueryBuilderConstantsState.js';
43
43
 
44
- const buildGetAllFunction = (
44
+ export const buildGetAllFunction = (
45
45
  _class: Class,
46
46
  multiplicity: Multiplicity,
47
47
  ): SimpleFunctionExpression => {