@finos/legend-query-builder 4.14.29 → 4.14.30

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 (46) hide show
  1. package/lib/components/QueryBuilder.d.ts.map +1 -1
  2. package/lib/components/QueryBuilder.js +28 -4
  3. package/lib/components/QueryBuilder.js.map +1 -1
  4. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts.map +1 -1
  5. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +2 -1
  6. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
  7. package/lib/index.css +0 -16
  8. package/lib/index.d.ts +1 -0
  9. package/lib/index.d.ts.map +1 -1
  10. package/lib/index.js +1 -0
  11. package/lib/index.js.map +1 -1
  12. package/lib/package.json +1 -1
  13. package/lib/stores/QueryBuilderState.d.ts +7 -1
  14. package/lib/stores/QueryBuilderState.d.ts.map +1 -1
  15. package/lib/stores/QueryBuilderState.js +10 -2
  16. package/lib/stores/QueryBuilderState.js.map +1 -1
  17. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.d.ts.map +1 -1
  18. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js +2 -1
  19. package/lib/stores/__test-utils__/QueryBuilderStateTestUtils.js.map +1 -1
  20. package/lib/stores/workflow/QueryBuilderWorkFlowState.d.ts +23 -0
  21. package/lib/stores/workflow/QueryBuilderWorkFlowState.d.ts.map +1 -0
  22. package/lib/stores/workflow/QueryBuilderWorkFlowState.js +24 -0
  23. package/lib/stores/workflow/QueryBuilderWorkFlowState.js.map +1 -0
  24. package/lib/stores/workflows/FunctionQueryBuilderState.d.ts +2 -1
  25. package/lib/stores/workflows/FunctionQueryBuilderState.d.ts.map +1 -1
  26. package/lib/stores/workflows/FunctionQueryBuilderState.js +2 -2
  27. package/lib/stores/workflows/FunctionQueryBuilderState.js.map +1 -1
  28. package/lib/stores/workflows/MappingQueryBuilderState.d.ts +2 -1
  29. package/lib/stores/workflows/MappingQueryBuilderState.d.ts.map +1 -1
  30. package/lib/stores/workflows/MappingQueryBuilderState.js +2 -2
  31. package/lib/stores/workflows/MappingQueryBuilderState.js.map +1 -1
  32. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts +2 -1
  33. package/lib/stores/workflows/ServiceQueryBuilderState.d.ts.map +1 -1
  34. package/lib/stores/workflows/ServiceQueryBuilderState.js +2 -2
  35. package/lib/stores/workflows/ServiceQueryBuilderState.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/components/QueryBuilder.tsx +137 -0
  38. package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +2 -0
  39. package/src/index.ts +1 -0
  40. package/src/stores/QueryBuilderState.ts +11 -0
  41. package/src/stores/__test-utils__/QueryBuilderStateTestUtils.ts +2 -0
  42. package/src/stores/workflow/QueryBuilderWorkFlowState.ts +27 -0
  43. package/src/stores/workflows/FunctionQueryBuilderState.ts +3 -1
  44. package/src/stores/workflows/MappingQueryBuilderState.ts +9 -1
  45. package/src/stores/workflows/ServiceQueryBuilderState.ts +9 -1
  46. package/tsconfig.json +1 -0
@@ -51,6 +51,7 @@ import {
51
51
  } from '../../stores/__test-utils__/QueryBuilderStateTestUtils.js';
52
52
  import { STYLE_PREFIX, STYLE_PREFIX__DARK } from '@finos/legend-art';
53
53
  import { expect } from '@jest/globals';
54
+ import { QueryBuilderAdvancedWorkflowState } from '../../stores/workflow/QueryBuilderWorkFlowState.js';
54
55
 
55
56
  const getSelectorContainerClassName = (lightMode?: boolean): string =>
56
57
  '.' + `${lightMode ? STYLE_PREFIX : STYLE_PREFIX__DARK}__value-container`;
@@ -198,6 +199,7 @@ export const TEST__setUpQueryBuilder = async (
198
199
  const queryBuilderState = new INTERNAL__BasicQueryBuilderState(
199
200
  MOCK__applicationStore,
200
201
  graphManagerState,
202
+ QueryBuilderAdvancedWorkflowState.INSTANCE,
201
203
  undefined,
202
204
  );
203
205
  const mapping = graphManagerState.graph.getMapping(mappingPath);
package/src/index.ts CHANGED
@@ -93,3 +93,4 @@ export * from './stores/QueryBuilder_LegendApplicationPlugin_Extension.js';
93
93
 
94
94
  export * from './stores/data-access/DataAccessState.js';
95
95
  export * from './components/data-access/DataAccessOverview.js';
96
+ export * from './stores/workflow/QueryBuilderWorkFlowState.js';
@@ -109,6 +109,7 @@ import {
109
109
  import type { QueryBuilderConfig } from '../graph-manager/QueryBuilderConfig.js';
110
110
  import { QUERY_BUILDER_EVENT } from '../__lib__/QueryBuilderEvent.js';
111
111
  import { QueryBuilderChangeHistoryState } from './QueryBuilderChangeHistoryState.js';
112
+ import { type QueryBuilderWorkflowState } from './workflow/QueryBuilderWorkFlowState.js';
112
113
 
113
114
  export interface QuerySDLC {}
114
115
 
@@ -118,6 +119,11 @@ export type QueryStateInfo = QuerySDLC & {
118
119
  runtime: string;
119
120
  };
120
121
 
122
+ export enum QUERY_BUILDER_LAMBDA_WRITER_MODE {
123
+ STANDARD = 'STANDARD',
124
+ TYPED_FETCH_STRUCTURE = 'TYPED_FETCH_STRUCTURE',
125
+ }
126
+
121
127
  export abstract class QueryBuilderState implements CommandRegistrar {
122
128
  readonly applicationStore: GenericLegendApplicationStore;
123
129
  readonly graphManagerState: GraphManagerState;
@@ -126,6 +132,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
126
132
  readonly queryCompileState = ActionState.create();
127
133
  readonly observerContext: ObserverContext;
128
134
  readonly config: QueryBuilderConfig | undefined;
135
+ readonly workflowState: QueryBuilderWorkflowState;
129
136
 
130
137
  explorerState: QueryBuilderExplorerState;
131
138
  functionsExplorerState: QueryFunctionsExplorerState;
@@ -168,6 +175,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
168
175
  constructor(
169
176
  applicationStore: GenericLegendApplicationStore,
170
177
  graphManagerState: GraphManagerState,
178
+ workflowState: QueryBuilderWorkflowState,
171
179
  config: QueryBuilderConfig | undefined,
172
180
  sourceInfo?: QuerySDLC | undefined,
173
181
  ) {
@@ -245,6 +253,8 @@ export abstract class QueryBuilderState implements CommandRegistrar {
245
253
  this.changeDetectionState = new QueryBuilderChangeDetectionState(this);
246
254
  this.changeHistoryState = new QueryBuilderChangeHistoryState(this);
247
255
  this.config = config;
256
+
257
+ this.workflowState = workflowState;
248
258
  this.sourceInfo = sourceInfo;
249
259
  }
250
260
 
@@ -789,6 +799,7 @@ export abstract class QueryBuilderState implements CommandRegistrar {
789
799
  const basicState = new INTERNAL__BasicQueryBuilderState(
790
800
  this.applicationStore,
791
801
  this.graphManagerState,
802
+ this.workflowState,
792
803
  undefined,
793
804
  );
794
805
  basicState.class = this.class;
@@ -41,6 +41,7 @@ import {
41
41
  INTERNAL__BasicQueryBuilderState,
42
42
  type QueryBuilderState,
43
43
  } from '../QueryBuilderState.js';
44
+ import { QueryBuilderAdvancedWorkflowState } from '../workflow/QueryBuilderWorkFlowState.js';
44
45
 
45
46
  export class TEST__LegendApplicationPluginManager
46
47
  extends LegendApplicationPluginManager<LegendApplicationPlugin>
@@ -131,6 +132,7 @@ export const TEST__setUpQueryBuilderState = async (
131
132
  const queryBuilderState = new INTERNAL__BasicQueryBuilderState(
132
133
  applicationStore,
133
134
  graphManagerState,
135
+ QueryBuilderAdvancedWorkflowState.INSTANCE,
134
136
  undefined,
135
137
  );
136
138
  if (rawLambda) {
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ export abstract class QueryBuilderWorkflowState {
18
+ abstract get showStatusBar(): boolean;
19
+ }
20
+
21
+ export class QueryBuilderAdvancedWorkflowState extends QueryBuilderWorkflowState {
22
+ get showStatusBar(): boolean {
23
+ return true;
24
+ }
25
+
26
+ static INSTANCE = new QueryBuilderAdvancedWorkflowState();
27
+ }
@@ -21,6 +21,7 @@ import type {
21
21
  } from '@finos/legend-graph';
22
22
  import { ClassQueryBuilderState } from './ClassQueryBuilderState.js';
23
23
  import type { QueryBuilderConfig } from '../../graph-manager/QueryBuilderConfig.js';
24
+ import type { QueryBuilderWorkflowState } from '../workflow/QueryBuilderWorkFlowState.js';
24
25
 
25
26
  // Note: We may want to move it to extend QueryBuilderState directly
26
27
  // but for now we will use the same setup as class as class, mapping, runtime are editable
@@ -30,10 +31,11 @@ export class FunctionQueryBuilderState extends ClassQueryBuilderState {
30
31
  constructor(
31
32
  applicationStore: GenericLegendApplicationStore,
32
33
  graphManagerState: GraphManagerState,
34
+ workflowState: QueryBuilderWorkflowState,
33
35
  functionElemenet: ConcreteFunctionDefinition,
34
36
  config: QueryBuilderConfig | undefined,
35
37
  ) {
36
- super(applicationStore, graphManagerState, config);
38
+ super(applicationStore, graphManagerState, workflowState, config);
37
39
  this.functionElement = functionElemenet;
38
40
  this.showParametersPanel = true;
39
41
  }
@@ -28,6 +28,7 @@ import { getNullableFirstEntry } from '@finos/legend-shared';
28
28
  import { renderMappingQueryBuilderSetupPanelContent } from '../../components/workflows/MappingQueryBuilder.js';
29
29
  import { QueryBuilderState } from '../QueryBuilderState.js';
30
30
  import type { QueryBuilderConfig } from '../../graph-manager/QueryBuilderConfig.js';
31
+ import type { QueryBuilderWorkflowState } from '../workflow/QueryBuilderWorkFlowState.js';
31
32
 
32
33
  export class MappingQueryBuilderState extends QueryBuilderState {
33
34
  readonly onMappingChange?: ((val: Mapping) => void) | undefined;
@@ -39,12 +40,19 @@ export class MappingQueryBuilderState extends QueryBuilderState {
39
40
  constructor(
40
41
  applicationStore: GenericLegendApplicationStore,
41
42
  graphManagerState: GraphManagerState,
43
+ workflowState: QueryBuilderWorkflowState,
42
44
  onMappingChange?: ((val: Mapping) => void) | undefined,
43
45
  onRuntimeChange?: ((val: Runtime) => void) | undefined,
44
46
  config?: QueryBuilderConfig | undefined,
45
47
  sourceInfo?: object | undefined,
46
48
  ) {
47
- super(applicationStore, graphManagerState, config, sourceInfo);
49
+ super(
50
+ applicationStore,
51
+ graphManagerState,
52
+ workflowState,
53
+ config,
54
+ sourceInfo,
55
+ );
48
56
 
49
57
  this.onMappingChange = onMappingChange;
50
58
  this.onRuntimeChange = onRuntimeChange;
@@ -34,6 +34,7 @@ import { action, makeObservable, observable } from 'mobx';
34
34
  import { renderServiceQueryBuilderSetupPanelContent } from '../../components/workflows/ServiceQueryBuilder.js';
35
35
  import { QueryBuilderState } from '../QueryBuilderState.js';
36
36
  import type { QueryBuilderConfig } from '../../graph-manager/QueryBuilderConfig.js';
37
+ import type { QueryBuilderWorkflowState } from '../workflow/QueryBuilderWorkFlowState.js';
37
38
 
38
39
  export type ServiceExecutionContext = {
39
40
  key: string;
@@ -58,6 +59,7 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
58
59
  constructor(
59
60
  applicationStore: GenericLegendApplicationStore,
60
61
  graphManagerState: GraphManagerState,
62
+ workflowState: QueryBuilderWorkflowState,
61
63
  service: Service,
62
64
  usableServices: Service[] | undefined,
63
65
  executionContextKey?: string | undefined,
@@ -68,7 +70,13 @@ export class ServiceQueryBuilderState extends QueryBuilderState {
68
70
  config?: QueryBuilderConfig | undefined,
69
71
  sourceInfo?: object | undefined,
70
72
  ) {
71
- super(applicationStore, graphManagerState, config, sourceInfo);
73
+ super(
74
+ applicationStore,
75
+ graphManagerState,
76
+ workflowState,
77
+ config,
78
+ sourceInfo,
79
+ );
72
80
 
73
81
  makeObservable(this, {
74
82
  selectedExecutionContext: observable,
package/tsconfig.json CHANGED
@@ -177,6 +177,7 @@
177
177
  "./src/stores/watermark/QueryBuilderWatermarkState.ts",
178
178
  "./src/stores/watermark/QueryBuilderWatermarkStateBuilder.ts",
179
179
  "./src/stores/watermark/QueryBuilderWatermarkValueSpecificationBuilder.ts",
180
+ "./src/stores/workflow/QueryBuilderWorkFlowState.ts",
180
181
  "./src/stores/workflows/ClassQueryBuilderState.ts",
181
182
  "./src/stores/workflows/FunctionQueryBuilderState.ts",
182
183
  "./src/stores/workflows/MappingQueryBuilderState.ts",