@finos/legend-query-builder 0.6.31 → 0.6.33

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.
Files changed (126) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +3 -1
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/QueryBuilderComponentTestUtils.d.ts.map +1 -1
  5. package/lib/components/QueryBuilderComponentTestUtils.js +2 -2
  6. package/lib/components/QueryBuilderComponentTestUtils.js.map +1 -1
  7. package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
  8. package/lib/components/QueryBuilderConstantExpressionPanel.js +3 -2
  9. package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
  10. package/lib/components/QueryBuilderDiffPanel.js +1 -1
  11. package/lib/components/QueryBuilderDiffPanel.js.map +1 -1
  12. package/lib/components/QueryBuilderNavigationBlocker.js +4 -4
  13. package/lib/components/QueryBuilderNavigationBlocker.js.map +1 -1
  14. package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
  15. package/lib/components/QueryBuilderParametersPanel.js +4 -3
  16. package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
  17. package/lib/components/QueryBuilderPropertyExpressionEditor.js +1 -1
  18. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  19. package/lib/components/QueryBuilderResultPanel.js +4 -4
  20. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  21. package/lib/components/QueryBuilderSideBar.d.ts.map +1 -1
  22. package/lib/components/QueryBuilderSideBar.js +9 -6
  23. package/lib/components/QueryBuilderSideBar.js.map +1 -1
  24. package/lib/components/QueryBuilderTextEditor.d.ts.map +1 -1
  25. package/lib/components/QueryBuilderTextEditor.js +3 -3
  26. package/lib/components/QueryBuilderTextEditor.js.map +1 -1
  27. package/lib/components/explorer/QueryBuilderExplorerPanel.js +2 -2
  28. package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
  29. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +3 -3
  30. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  31. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.d.ts.map +1 -1
  32. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js +1 -1
  33. package/lib/components/fetch-structure/QueryBuilderResultModifierPanel.js.map +1 -1
  34. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.d.ts.map +1 -1
  35. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +9 -6
  36. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
  37. package/lib/components/filter/QueryBuilderFilterPanel.js +3 -3
  38. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  39. package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
  40. package/lib/components/shared/BasicValueSpecificationEditor.js +1 -1
  41. package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
  42. package/lib/components/shared/LambdaEditor.js +3 -3
  43. package/lib/components/shared/LambdaEditor.js.map +1 -1
  44. package/lib/components/workflows/ClassQueryBuilder.d.ts.map +1 -1
  45. package/lib/components/workflows/ClassQueryBuilder.js +6 -4
  46. package/lib/components/workflows/ClassQueryBuilder.js.map +1 -1
  47. package/lib/components/workflows/MappingQueryBuilder.d.ts.map +1 -1
  48. package/lib/components/workflows/MappingQueryBuilder.js +6 -4
  49. package/lib/components/workflows/MappingQueryBuilder.js.map +1 -1
  50. package/lib/components/workflows/ServiceQueryBuilder.d.ts.map +1 -1
  51. package/lib/components/workflows/ServiceQueryBuilder.js +3 -2
  52. package/lib/components/workflows/ServiceQueryBuilder.js.map +1 -1
  53. package/lib/graphManager/protocol/pure/v1/V1_QueryBuilder_PureGraphManagerExtension.js +2 -2
  54. package/lib/graphManager/protocol/pure/v1/V1_QueryBuilder_PureGraphManagerExtension.js.map +1 -1
  55. package/lib/index.css +1 -1
  56. package/lib/package.json +3 -3
  57. package/lib/stores/LegendQueryStorage.d.ts +19 -0
  58. package/lib/stores/LegendQueryStorage.d.ts.map +1 -0
  59. package/lib/stores/LegendQueryStorage.js +20 -0
  60. package/lib/stores/LegendQueryStorage.js.map +1 -0
  61. package/lib/stores/QueryBuilderChangeDetectionState.js +1 -1
  62. package/lib/stores/QueryBuilderChangeDetectionState.js.map +1 -1
  63. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -1
  64. package/lib/stores/QueryBuilderConstantsState.js +1 -1
  65. package/lib/stores/QueryBuilderConstantsState.js.map +1 -1
  66. package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
  67. package/lib/stores/QueryBuilderResultState.js +6 -6
  68. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  69. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  70. package/lib/stores/QueryBuilderState.js +10 -10
  71. package/lib/stores/QueryBuilderState.js.map +1 -1
  72. package/lib/stores/QueryBuilderTextEditorState.js +4 -4
  73. package/lib/stores/QueryBuilderTextEditorState.js.map +1 -1
  74. package/lib/stores/explorer/QueryBuilderExplorerState.d.ts.map +1 -1
  75. package/lib/stores/explorer/QueryBuilderExplorerState.js +4 -4
  76. package/lib/stores/explorer/QueryBuilderExplorerState.js.map +1 -1
  77. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js +3 -3
  78. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.js.map +1 -1
  79. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js +1 -1
  80. package/lib/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.js.map +1 -1
  81. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.d.ts.map +1 -1
  82. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js +7 -4
  83. package/lib/stores/fetch-structure/tds/QueryBuilderTDSState.js.map +1 -1
  84. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +1 -1
  85. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  86. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js +2 -2
  87. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js.map +1 -1
  88. package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
  89. package/lib/stores/filter/QueryBuilderFilterState.js +1 -1
  90. package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
  91. package/package.json +10 -10
  92. package/src/components/QueryBuilder.tsx +8 -1
  93. package/src/components/QueryBuilderComponentTestUtils.tsx +5 -2
  94. package/src/components/QueryBuilderConstantExpressionPanel.tsx +6 -2
  95. package/src/components/QueryBuilderDiffPanel.tsx +1 -1
  96. package/src/components/QueryBuilderNavigationBlocker.tsx +4 -4
  97. package/src/components/QueryBuilderParametersPanel.tsx +9 -3
  98. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +1 -1
  99. package/src/components/QueryBuilderResultPanel.tsx +4 -4
  100. package/src/components/QueryBuilderSideBar.tsx +18 -6
  101. package/src/components/QueryBuilderTextEditor.tsx +14 -6
  102. package/src/components/explorer/QueryBuilderExplorerPanel.tsx +2 -2
  103. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +3 -3
  104. package/src/components/fetch-structure/QueryBuilderResultModifierPanel.tsx +3 -1
  105. package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +13 -6
  106. package/src/components/filter/QueryBuilderFilterPanel.tsx +3 -3
  107. package/src/components/shared/BasicValueSpecificationEditor.tsx +3 -1
  108. package/src/components/shared/LambdaEditor.tsx +3 -3
  109. package/src/components/workflows/ClassQueryBuilder.tsx +12 -4
  110. package/src/components/workflows/MappingQueryBuilder.tsx +12 -4
  111. package/src/components/workflows/ServiceQueryBuilder.tsx +7 -2
  112. package/src/graphManager/protocol/pure/v1/V1_QueryBuilder_PureGraphManagerExtension.ts +2 -2
  113. package/src/stores/LegendQueryStorage.ts +19 -0
  114. package/src/stores/QueryBuilderChangeDetectionState.ts +1 -1
  115. package/src/stores/QueryBuilderConstantsState.ts +3 -1
  116. package/src/stores/QueryBuilderResultState.ts +12 -6
  117. package/src/stores/QueryBuilderState.ts +16 -10
  118. package/src/stores/QueryBuilderTextEditorState.ts +4 -4
  119. package/src/stores/explorer/QueryBuilderExplorerState.ts +6 -4
  120. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeState.ts +3 -3
  121. package/src/stores/fetch-structure/graph-fetch/QueryBuilderGraphFetchTreeUtil.ts +1 -1
  122. package/src/stores/fetch-structure/tds/QueryBuilderTDSState.ts +10 -4
  123. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +1 -1
  124. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.ts +2 -2
  125. package/src/stores/filter/QueryBuilderFilterState.ts +3 -1
  126. package/tsconfig.json +1 -0
@@ -679,7 +679,9 @@ export class QueryBuilderExplorerState {
679
679
  this.refreshTreeData();
680
680
  } catch (error) {
681
681
  assertErrorThrown(error);
682
- this.queryBuilderState.applicationStore.notifyError(error.message);
682
+ this.queryBuilderState.applicationStore.notificationService.notifyError(
683
+ error.message,
684
+ );
683
685
  } finally {
684
686
  this.mappingModelCoverageAnalysisState.complete();
685
687
  }
@@ -691,7 +693,7 @@ export class QueryBuilderExplorerState {
691
693
  ): GeneratorFn<void> {
692
694
  const runtime = this.queryBuilderState.runtimeValue;
693
695
  if (!runtime) {
694
- this.queryBuilderState.applicationStore.notifyWarning(
696
+ this.queryBuilderState.applicationStore.notificationService.notifyWarning(
695
697
  `Can't preview data for property '${node.property.name}': runtime is not specified`,
696
698
  );
697
699
  return;
@@ -704,7 +706,7 @@ export class QueryBuilderExplorerState {
704
706
  return;
705
707
  }
706
708
  if (this.previewDataState.isGeneratingPreviewData) {
707
- this.queryBuilderState.applicationStore.notifyWarning(
709
+ this.queryBuilderState.applicationStore.notificationService.notifyWarning(
708
710
  `Can't preview data for property '${node.property.name}': another preview request is being executed`,
709
711
  );
710
712
  return;
@@ -786,7 +788,7 @@ export class QueryBuilderExplorerState {
786
788
  }
787
789
  } catch (error) {
788
790
  assertErrorThrown(error);
789
- this.queryBuilderState.applicationStore.notifyWarning(
791
+ this.queryBuilderState.applicationStore.notificationService.notifyWarning(
790
792
  `Can't preview data for property '${node.property.name}'. Error: ${error.message}`,
791
793
  );
792
794
  this.previewDataState.setPreviewData(undefined);
@@ -181,7 +181,7 @@ export class QueryBuilderGraphFetchTreeState
181
181
  },
182
182
  ): void {
183
183
  if (!this.treeData) {
184
- this.queryBuilderState.applicationStore.notifyWarning(
184
+ this.queryBuilderState.applicationStore.notificationService.notifyWarning(
185
185
  `Can't add property: graph-fetch tree has not been properly initialized`,
186
186
  );
187
187
  return;
@@ -211,7 +211,7 @@ export class QueryBuilderGraphFetchTreeState
211
211
 
212
212
  fetchProperties(nodes: QueryBuilderExplorerTreePropertyNodeData[]): void {
213
213
  if (!this.treeData) {
214
- this.queryBuilderState.applicationStore.notifyWarning(
214
+ this.queryBuilderState.applicationStore.notificationService.notifyWarning(
215
215
  `Can't add property: graph-fetch tree has not been properly initialized`,
216
216
  );
217
217
  return;
@@ -224,7 +224,7 @@ export class QueryBuilderGraphFetchTreeState
224
224
 
225
225
  checkBeforeChangingImplementation(onChange: () => void): void {
226
226
  if (this.treeData?.rootIds.length) {
227
- this.queryBuilderState.applicationStore.setActionAlertInfo({
227
+ this.queryBuilderState.applicationStore.alertService.setActionAlertInfo({
228
228
  message:
229
229
  'Current graph-fetch will be lost when switching to projection mode. Do you still want to proceed?',
230
230
  type: ActionAlertType.CAUTION,
@@ -253,7 +253,7 @@ export const addQueryBuilderPropertyNode = (
253
253
  parentExplorerTreeNode.parentId,
254
254
  );
255
255
  } else {
256
- queryBuilderState.applicationStore.notifyError(
256
+ queryBuilderState.applicationStore.notificationService.notifyError(
257
257
  `Can't cast the root class of graph fetch structure to its subtype`,
258
258
  );
259
259
  return;
@@ -96,6 +96,7 @@ import { QueryBuilderWindowState } from './window/QueryBuilderWindowState.js';
96
96
  import type { QueryBuilderTDS_WindowOperator } from './window/operators/QueryBuilderTDS_WindowOperator.js';
97
97
  import { getQueryBuilderCoreWindowOperators } from './window/QueryBuilderWindowGroupByOperatorLoader.js';
98
98
  import type { QueryBuilderTDSColumnState } from './QueryBuilderTDSColumnState.js';
99
+ import { LEGEND_QUERY_SETTINGS_KEY } from '../../LegendQueryStorage.js';
99
100
 
100
101
  export class QueryBuilderTDSState
101
102
  extends QueryBuilderFetchStructureImplementationState
@@ -107,7 +108,7 @@ export class QueryBuilderTDSState
107
108
  readonly resultSetModifierState: QueryResultSetModifierState;
108
109
  projectionColumns: QueryBuilderProjectionColumnState[] = [];
109
110
  isConvertDerivationProjectionObjects = false;
110
- showPostFilterPanel = false;
111
+ showPostFilterPanel: boolean;
111
112
  showWindowFuncPanel = false;
112
113
 
113
114
  postFilterOperators: QueryBuilderPostFilterOperator[] =
@@ -152,6 +153,11 @@ export class QueryBuilderTDSState
152
153
  this,
153
154
  this.windowFuncOperators,
154
155
  );
156
+ this.showPostFilterPanel =
157
+ this.queryBuilderState.applicationStore.storageService.settingsStore.getBooleanValue(
158
+ LEGEND_QUERY_SETTINGS_KEY.EDITOR_SHOW_POST_FILTER,
159
+ false,
160
+ );
155
161
  }
156
162
 
157
163
  get type(): string {
@@ -360,7 +366,7 @@ export class QueryBuilderTDSState
360
366
  });
361
367
  } catch (error) {
362
368
  assertErrorThrown(error);
363
- this.queryBuilderState.applicationStore.log.error(
369
+ this.queryBuilderState.applicationStore.logService.error(
364
370
  LogEvent.create(GRAPH_MANAGER_EVENT.PARSING_FAILURE),
365
371
  error,
366
372
  );
@@ -609,7 +615,7 @@ export class QueryBuilderTDSState
609
615
  }
610
616
 
611
617
  checkBeforeClearingColumns(onChange: () => void): void {
612
- this.queryBuilderState.applicationStore.setActionAlertInfo({
618
+ this.queryBuilderState.applicationStore.alertService.setActionAlertInfo({
613
619
  message:
614
620
  'You will be clearing all projection columns. Do you still want to proceed?',
615
621
  type: ActionAlertType.CAUTION,
@@ -637,7 +643,7 @@ export class QueryBuilderTDSState
637
643
  // but we make the assumption that if there is no projection column, there should
638
644
  // not be any post-filter at all
639
645
  ) {
640
- this.queryBuilderState.applicationStore.setActionAlertInfo({
646
+ this.queryBuilderState.applicationStore.alertService.setActionAlertInfo({
641
647
  message:
642
648
  this.showPostFilterPanel && this.postFilterState.nodes.size > 0
643
649
  ? 'With graph-fetch mode, post filter is not supported. Current projection columns and post filters will be lost when switching to the graph-fetch mode. Do you still want to proceed?'
@@ -452,7 +452,7 @@ export class PostFilterConditionState implements Hashable {
452
452
  }
453
453
  } catch (error) {
454
454
  assertErrorThrown(error);
455
- this.postFilterState.tdsState.queryBuilderState.applicationStore.notifyError(
455
+ this.postFilterState.tdsState.queryBuilderState.applicationStore.notificationService.notifyError(
456
456
  `Can't drag column '${columnState.columnName}' due to: ${error.message}`,
457
457
  );
458
458
  }
@@ -215,7 +215,7 @@ class QueryBuilderDerivationProjectionLambdaState extends LambdaEditorState {
215
215
  if (error instanceof ParserError) {
216
216
  this.setParserError(error);
217
217
  }
218
- this.queryBuilderState.applicationStore.log.error(
218
+ this.queryBuilderState.applicationStore.logService.error(
219
219
  LogEvent.create(GRAPH_MANAGER_EVENT.PARSING_FAILURE),
220
220
  error,
221
221
  );
@@ -251,7 +251,7 @@ class QueryBuilderDerivationProjectionLambdaState extends LambdaEditorState {
251
251
  this.clearErrors();
252
252
  } catch (error) {
253
253
  assertErrorThrown(error);
254
- this.queryBuilderState.applicationStore.log.error(
254
+ this.queryBuilderState.applicationStore.logService.error(
255
255
  LogEvent.create(GRAPH_MANAGER_EVENT.PARSING_FAILURE),
256
256
  error,
257
257
  );
@@ -158,7 +158,9 @@ export class FilterConditionState implements Hashable {
158
158
  new FilterConditionState(this.filterState, propertyExpression);
159
159
  } catch (error) {
160
160
  assertErrorThrown(error);
161
- this.filterState.queryBuilderState.applicationStore.notifyError(error);
161
+ this.filterState.queryBuilderState.applicationStore.notificationService.notifyError(
162
+ error,
163
+ );
162
164
  return;
163
165
  }
164
166
 
package/tsconfig.json CHANGED
@@ -48,6 +48,7 @@
48
48
  "./src/graphManager/protocol/pure/QueryBuilder_PureProtocolProcessorPlugin.ts",
49
49
  "./src/graphManager/protocol/pure/v1/V1_QueryBuilder_PureGraphManagerExtension.ts",
50
50
  "./src/graphManager/protocol/pure/v1/V1_QueryValueSpecificationBuilderHelper.ts",
51
+ "./src/stores/LegendQueryStorage.ts",
51
52
  "./src/stores/QueryBuilderBootstraper.ts",
52
53
  "./src/stores/QueryBuilderChangeDetectionState.ts",
53
54
  "./src/stores/QueryBuilderCommand.ts",