@finos/legend-extension-dsl-data-space 6.1.1 → 6.1.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"DataSpaceQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/components/query/DataSpaceQueryEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAkEH,eAAO,MAAM,oBAAoB;;CAyB/B,CAAC"}
1
+ {"version":3,"file":"DataSpaceQueryEditor.d.ts","sourceRoot":"","sources":["../../../src/components/query/DataSpaceQueryEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAqEH,eAAO,MAAM,oBAAoB;;CAyB/B,CAAC"}
@@ -22,12 +22,14 @@ import { LEGEND_QUERY_PATH_PARAM_TOKEN, LEGEND_QUERY_QUERY_PARAM_TOKEN, QueryEdi
22
22
  import { useParams } from 'react-router';
23
23
  import { DataSpaceQueryEditorStore } from '../../stores/query/DataSpaceQueryEditorStore.js';
24
24
  import { DATA_SPACE_QUERY_EDITOR_PATH_PARAM_TOKEN, } from '../../stores/query/DSLDataSpace_LegendQueryRouter.js';
25
+ import { useSDLCServerClient } from '@finos/legend-server-sdlc';
25
26
  const DataSpaceQueryEditorStoreProvider = ({ children, gav, dataSpacePath, executionContext, runtimePath, classPath, }) => {
26
27
  const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
27
28
  const applicationStore = useLegendQueryApplicationStore();
28
29
  const depotServerClient = useDepotServerClient();
30
+ const sdlcServerClient = useSDLCServerClient();
29
31
  const baseStore = useLegendQueryBaseStore();
30
- const store = useLocalObservable(() => new DataSpaceQueryEditorStore(applicationStore, depotServerClient, baseStore.pluginManager, groupId, artifactId, versionId, dataSpacePath, executionContext, runtimePath, classPath));
32
+ const store = useLocalObservable(() => new DataSpaceQueryEditorStore(applicationStore, depotServerClient, sdlcServerClient, baseStore.pluginManager, groupId, artifactId, versionId, dataSpacePath, executionContext, runtimePath, classPath));
31
33
  return (_jsx(QueryEditorStoreContext.Provider, { value: store, children: children }));
32
34
  };
33
35
  export const DataSpaceQueryEditor = observer(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"DataSpaceQueryEditor.js","sourceRoot":"","sources":["../../../src/components/query/DataSpaceQueryEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,WAAW,EACX,uBAAuB,EACvB,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAGL,wCAAwC,GACzC,MAAM,sDAAsD,CAAC;AAE9D,MAAM,iCAAiC,GAOlC,CAAC,EACJ,QAAQ,EACR,GAAG,EACH,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,SAAS,GACV,EAAE,EAAE;IACH,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACpE,MAAM,gBAAgB,GAAG,8BAA8B,EAAE,CAAC;IAC1D,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;IACjD,MAAM,SAAS,GAAG,uBAAuB,EAAE,CAAC;IAC5C,MAAM,KAAK,GAAG,kBAAkB,CAC9B,GAAG,EAAE,CACH,IAAI,yBAAyB,CAC3B,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,CAAC,aAAa,EACvB,OAAO,EACP,UAAU,EACV,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,SAAS,CACV,CACJ,CAAC;IACF,OAAO,CACL,KAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAC3C,QAAQ,GACwB,CACpC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,GAAG,EAAE;IAChD,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,MAAM,GAAG,SAAS,EAAkC,CAAC;IAC3D,MAAM,GAAG,GAAG,MAAM,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAAC;IACtD,MAAM,aAAa,GACjB,MAAM,CAAC,wCAAwC,CAAC,eAAe,CAAC,CAAC;IACnE,MAAM,gBAAgB,GACpB,MAAM,CAAC,wCAAwC,CAAC,iBAAiB,CAAC,CAAC;IACrE,MAAM,WAAW,GAAG,MAAM,CAAC,6BAA6B,CAAC,YAAY,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,kBAAkB,CAClC,gBAAgB,CAAC,SAAS,CAAC,kBAAkB,EAAE,EAC/C,IAAI,CACL,CAAC,8BAA8B,CAAC,UAAU,CAAC,CAAC;IAE7C,OAAO,CACL,KAAC,iCAAiC,IAChC,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,YAEpB,KAAC,WAAW,KAAG,GACmB,CACrC,CAAC;AACJ,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"DataSpaceQueryEditor.js","sourceRoot":"","sources":["../../../src/components/query/DataSpaceQueryEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/D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pC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,GAAG,EAAE;IAChD,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,MAAM,GAAG,SAAS,EAAkC,CAAC;IAC3D,MAAM,GAAG,GAAG,MAAM,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAAC;IACtD,MAAM,aAAa,GACjB,MAAM,CAAC,wCAAwC,CAAC,eAAe,CAAC,CAAC;IACnE,MAAM,gBAAgB,GACpB,MAAM,CAAC,wCAAwC,CAAC,iBAAiB,CAAC,CAAC;IACrE,MAAM,WAAW,GAAG,MAAM,CAAC,6BAA6B,CAAC,YAAY,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,kBAAkB,CAClC,gBAAgB,CAAC,SAAS,CAAC,kBAAkB,EAAE,EAC/C,IAAI,CACL,CAAC,8BAA8B,CAAC,UAAU,CAAC,CAAC;IAE7C,OAAO,CACL,KAAC,iCAAiC,IAChC,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,YAEpB,KAAC,WAAW,KAAG,GACmB,CACrC,CAAC;AACJ,CAAC,CAAC,CAAC"}
package/lib/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-extension-dsl-data-space v6.1.1
1
+ /** @license @finos/legend-extension-dsl-data-space v6.1.5
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-extension-dsl-data-space",
3
- "version": "6.1.1",
3
+ "version": "6.1.5",
4
4
  "description": "Legend extension for Data Space DSL",
5
5
  "keywords": [
6
6
  "legend",
@@ -50,9 +50,10 @@
50
50
  "@finos/legend-extension-dsl-diagram": "workspace:*",
51
51
  "@finos/legend-graph": "workspace:*",
52
52
  "@finos/legend-server-depot": "workspace:*",
53
+ "@finos/legend-server-sdlc": "workspace:*",
53
54
  "@finos/legend-shared": "workspace:*",
54
55
  "@finos/legend-storage": "workspace:*",
55
- "@types/react": "18.0.15",
56
+ "@types/react": "18.0.17",
56
57
  "mobx": "6.6.1",
57
58
  "mobx-react-lite": "3.4.0",
58
59
  "react": "18.2.0",
@@ -65,11 +66,11 @@
65
66
  "@finos/legend-dev-utils": "workspace:*",
66
67
  "@jest/globals": "28.1.3",
67
68
  "cross-env": "7.0.3",
68
- "eslint": "8.21.0",
69
+ "eslint": "8.22.0",
69
70
  "jest": "28.1.3",
70
71
  "npm-run-all": "4.1.5",
71
72
  "rimraf": "3.0.2",
72
- "sass": "1.54.0",
73
+ "sass": "1.54.4",
73
74
  "typescript": "4.7.4"
74
75
  },
75
76
  "peerDependencies": {
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import { QueryEditorStore, type QueryExportConfiguration, type LegendQueryPluginManager, type LegendQueryApplicationStore } from '@finos/legend-application-query';
17
17
  import type { DepotServerClient, ProjectGAVCoordinates } from '@finos/legend-server-depot';
18
+ import type { SDLCServerClient } from '@finos/legend-server-sdlc';
18
19
  export declare class DataSpaceQueryEditorStore extends QueryEditorStore {
19
20
  groupId: string;
20
21
  artifactId: string;
@@ -23,7 +24,7 @@ export declare class DataSpaceQueryEditorStore extends QueryEditorStore {
23
24
  executionContext: string;
24
25
  runtimePath: string | undefined;
25
26
  classPath: string | undefined;
26
- constructor(applicationStore: LegendQueryApplicationStore, depotServerClient: DepotServerClient, pluginManager: LegendQueryPluginManager, groupId: string, artifactId: string, versionId: string, dataSpacePath: string, executionContext: string, runtimePath: string | undefined, executionKey: string | undefined);
27
+ constructor(applicationStore: LegendQueryApplicationStore, depotServerClient: DepotServerClient, sdlcServerClient: SDLCServerClient, pluginManager: LegendQueryPluginManager, groupId: string, artifactId: string, versionId: string, dataSpacePath: string, executionContext: string, runtimePath: string | undefined, executionKey: string | undefined);
27
28
  getProjectInfo(): ProjectGAVCoordinates;
28
29
  setUpBuilderState(): Promise<void>;
29
30
  getExportConfiguration(): Promise<QueryExportConfiguration>;
@@ -1 +1 @@
1
- {"version":3,"file":"DataSpaceQueryEditorStore.d.ts","sourceRoot":"","sources":["../../../src/stores/query/DataSpaceQueryEditorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,EACL,gBAAgB,EAChB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EACjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AAkBpC,qBAAa,yBAA0B,SAAQ,gBAAgB;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;gBAG5B,gBAAgB,EAAE,2BAA2B,EAC7C,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,wBAAwB,EACvC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,YAAY,EAAE,MAAM,GAAG,SAAS;IAalC,cAAc,IAAI,qBAAqB;IAQjC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAsClC,sBAAsB,IAAI,OAAO,CAAC,wBAAwB,CAAC;CAgBlE"}
1
+ {"version":3,"file":"DataSpaceQueryEditorStore.d.ts","sourceRoot":"","sources":["../../../src/stores/query/DataSpaceQueryEditorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,OAAO,EACL,gBAAgB,EAChB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EACjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AAWpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAYlE,qBAAa,yBAA0B,SAAQ,gBAAgB;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;gBAG5B,gBAAgB,EAAE,2BAA2B,EAC7C,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,wBAAwB,EACvC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,YAAY,EAAE,MAAM,GAAG,SAAS;IAalC,cAAc,IAAI,qBAAqB;IAQjC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IA4DlC,sBAAsB,IAAI,OAAO,CAAC,wBAAwB,CAAC;CAgBlE"}
@@ -13,9 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { extractElementNameFromPath, QueryTaggedValue, } from '@finos/legend-graph';
16
+ import { extractElementNameFromPath, QueryTaggedValue, RuntimePointer, PackageableElementExplicitReference, getAllClassMappings, isSystemElement, } from '@finos/legend-graph';
17
17
  import { QueryEditorStore, } from '@finos/legend-application-query';
18
- import { guaranteeNonNullable, uuid } from '@finos/legend-shared';
18
+ import { getNullableFirstElement, guaranteeNonNullable, uuid, } from '@finos/legend-shared';
19
19
  import { QUERY_PROFILE_PATH, QUERY_PROFILE_TAG_DATA_SPACE, } from '../../DSLDataSpace_Const.js';
20
20
  import { getDataSpace } from '../../graphManager/DSLDataSpace_GraphManagerHelper.js';
21
21
  const createQueryDataSpaceTaggedValue = (dataSpacePath) => {
@@ -33,8 +33,8 @@ export class DataSpaceQueryEditorStore extends QueryEditorStore {
33
33
  executionContext;
34
34
  runtimePath;
35
35
  classPath;
36
- constructor(applicationStore, depotServerClient, pluginManager, groupId, artifactId, versionId, dataSpacePath, executionContext, runtimePath, executionKey) {
37
- super(applicationStore, depotServerClient, pluginManager);
36
+ constructor(applicationStore, depotServerClient, sdlcServerClient, pluginManager, groupId, artifactId, versionId, dataSpacePath, executionContext, runtimePath, executionKey) {
37
+ super(applicationStore, depotServerClient, sdlcServerClient, pluginManager);
38
38
  this.groupId = groupId;
39
39
  this.artifactId = artifactId;
40
40
  this.versionId = versionId;
@@ -56,18 +56,28 @@ export class DataSpaceQueryEditorStore extends QueryEditorStore {
56
56
  const dataSpace = getDataSpace(this.dataSpacePath, this.graphManagerState.graph);
57
57
  const executionContext = guaranteeNonNullable(dataSpace.executionContexts.find((context) => context.name === this.executionContext), `Can't find execution context '${this.executionContext}'`);
58
58
  this.queryBuilderState.querySetupState.setMapping(executionContext.mapping.value);
59
- this.queryBuilderState.querySetupState.setRuntimeValue((this.runtimePath
59
+ this.queryBuilderState.querySetupState.setRuntimeValue(new RuntimePointer(PackageableElementExplicitReference.create(this.runtimePath
60
60
  ? this.graphManagerState.graph.getRuntime(this.runtimePath)
61
- : executionContext.defaultRuntime.value).runtimeValue);
61
+ : executionContext.defaultRuntime.value)));
62
62
  if (this.classPath) {
63
63
  this.queryBuilderState.changeClass(this.queryBuilderState.graphManagerState.graph.getClass(this.classPath));
64
64
  this.queryBuilderState.querySetupState.setClassIsReadOnly(true);
65
65
  }
66
66
  else {
67
- // TODO?: should we set the class here automatically?
68
- // initialize query builder state after setting up
69
- this.queryBuilderState.resetQueryBuilder();
70
- this.queryBuilderState.resetQuerySetup();
67
+ // try to find a class to set
68
+ // first, find classes which is mapped by the mapping
69
+ // then, find any classes except for class coming from system
70
+ // if none found, default to a dummy blank query
71
+ const defaultClass = getNullableFirstElement(this.queryBuilderState.querySetupState.mapping
72
+ ? getAllClassMappings(this.queryBuilderState.querySetupState.mapping).map((classMapping) => classMapping.class.value)
73
+ : []) ??
74
+ getNullableFirstElement(this.queryBuilderState.graphManagerState.graph.classes.filter((el) => !isSystemElement(el)));
75
+ if (defaultClass) {
76
+ this.queryBuilderState.changeClass(defaultClass);
77
+ }
78
+ else {
79
+ this.queryBuilderState.initialize(this.queryBuilderState.graphManagerState.graphManager.createDefaultBasicRawLambda());
80
+ }
71
81
  }
72
82
  }
73
83
  async getExportConfiguration() {
@@ -1 +1 @@
1
- {"version":3,"file":"DataSpaceQueryEditorStore.js","sourceRoot":"","sources":["../../../src/stores/query/DataSpaceQueryEditorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,GAIjB,MAAM,iCAAiC,CAAC;AAKzC,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EACL,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AAErF,MAAM,+BAA+B,GAAG,CACtC,aAAqB,EACH,EAAE;IACpB,MAAM,WAAW,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAC3C,WAAW,CAAC,OAAO,GAAG,kBAAkB,CAAC;IACzC,WAAW,CAAC,GAA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AC;gBAClB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;gBAC7B,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;gBACnC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;gBACjC,KAAK,CAAC,YAAY,GAAG;oBACnB,+BAA+B,CAAC,IAAI,CAAC,aAAa,CAAC;iBACpD,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"DataSpaceQueryEditorStore.js","sourceRoot":"","sources":["../../../src/stores/query/DataSpaceQueryEditorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,0BAA0B,EAC1B,gBAAgB,EAChB,cAAc,EACd,mCAAmC,EACnC,mBAAmB,EACnB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,GAIjB,MAAM,iCAAiC,CAAC;AAKzC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AAGrF,MAAM,+BAA+B,GAAG,CACtC,aAAqB,EACH,EAAE;IACpB,MAAM,WAAW,GAAG,IAAI,gBAAgB,EAAE,CAAC;IAC3C,WAAW,CAAC,OAAO,GAAG,kBAAkB,CAAC;IACzC,WAAW,CAAC,GAAG,GAAG,4BAA4B,CAAC;IAC/C,WAAW,CAAC,KAAK,GAAG,aAAa,CAAC;IAClC,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,OAAO,yBAA0B,SAAQ,gBAAgB;IAC7D,OAAO,CAAS;IAChB,UAAU,CAAS;IACnB,SAAS,CAAS;IAClB,aAAa,CAAS;IACtB,gBAAgB,CAAS;IACzB,WAAW,CA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AAC,WAAW,CAAC,YAAY,CAAC,CAAC;aAClD;iBAAM;gBACL,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAC/B,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,YAAY,CAAC,2BAA2B,EAAE,CACpF,CAAC;aACH;SACF;IACH,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,OAAO;YACL,WAAW,EAAE,iBAAiB,0BAA0B,CACtD,IAAI,CAAC,aAAa,CACnB,IAAI,IAAI,CAAC,gBAAgB,GAAG;YAC7B,SAAS,EAAE,CAAC,KAAY,EAAQ,EAAE;gBAChC,KAAK,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC;gBAClB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;gBAC7B,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;gBACnC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;gBACjC,KAAK,CAAC,YAAY,GAAG;oBACnB,+BAA+B,CAAC,IAAI,CAAC,aAAa,CAAC;iBACpD,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-extension-dsl-data-space",
3
- "version": "6.1.1",
3
+ "version": "6.1.5",
4
4
  "description": "Legend extension for Data Space DSL",
5
5
  "keywords": [
6
6
  "legend",
@@ -43,16 +43,17 @@
43
43
  "test:watch": "jest --watch"
44
44
  },
45
45
  "dependencies": {
46
- "@finos/legend-application": "7.0.3",
47
- "@finos/legend-application-query": "5.0.2",
48
- "@finos/legend-application-studio": "13.0.2",
49
- "@finos/legend-art": "2.0.12",
50
- "@finos/legend-extension-dsl-diagram": "5.0.2",
51
- "@finos/legend-graph": "13.0.1",
52
- "@finos/legend-server-depot": "3.0.3",
53
- "@finos/legend-shared": "5.0.2",
54
- "@finos/legend-storage": "3.0.2",
55
- "@types/react": "18.0.15",
46
+ "@finos/legend-application": "7.1.1",
47
+ "@finos/legend-application-query": "5.2.2",
48
+ "@finos/legend-application-studio": "13.1.1",
49
+ "@finos/legend-art": "3.0.1",
50
+ "@finos/legend-extension-dsl-diagram": "5.0.5",
51
+ "@finos/legend-graph": "14.0.1",
52
+ "@finos/legend-server-depot": "3.0.6",
53
+ "@finos/legend-server-sdlc": "4.0.8",
54
+ "@finos/legend-shared": "6.0.1",
55
+ "@finos/legend-storage": "3.0.5",
56
+ "@types/react": "18.0.17",
56
57
  "mobx": "6.6.1",
57
58
  "mobx-react-lite": "3.4.0",
58
59
  "react": "18.2.0",
@@ -62,14 +63,14 @@
62
63
  "serializr": "2.0.5"
63
64
  },
64
65
  "devDependencies": {
65
- "@finos/legend-dev-utils": "2.0.8",
66
+ "@finos/legend-dev-utils": "2.0.11",
66
67
  "@jest/globals": "28.1.3",
67
68
  "cross-env": "7.0.3",
68
- "eslint": "8.21.0",
69
+ "eslint": "8.22.0",
69
70
  "jest": "28.1.3",
70
71
  "npm-run-all": "4.1.5",
71
72
  "rimraf": "3.0.2",
72
- "sass": "1.54.0",
73
+ "sass": "1.54.4",
73
74
  "typescript": "4.7.4"
74
75
  },
75
76
  "peerDependencies": {
@@ -36,6 +36,7 @@ import {
36
36
  type DataSpaceQueryEditorQueryParams,
37
37
  DATA_SPACE_QUERY_EDITOR_PATH_PARAM_TOKEN,
38
38
  } from '../../stores/query/DSLDataSpace_LegendQueryRouter.js';
39
+ import { useSDLCServerClient } from '@finos/legend-server-sdlc';
39
40
 
40
41
  const DataSpaceQueryEditorStoreProvider: React.FC<{
41
42
  children: React.ReactNode;
@@ -55,12 +56,14 @@ const DataSpaceQueryEditorStoreProvider: React.FC<{
55
56
  const { groupId, artifactId, versionId } = parseGAVCoordinates(gav);
56
57
  const applicationStore = useLegendQueryApplicationStore();
57
58
  const depotServerClient = useDepotServerClient();
59
+ const sdlcServerClient = useSDLCServerClient();
58
60
  const baseStore = useLegendQueryBaseStore();
59
61
  const store = useLocalObservable(
60
62
  () =>
61
63
  new DataSpaceQueryEditorStore(
62
64
  applicationStore,
63
65
  depotServerClient,
66
+ sdlcServerClient,
64
67
  baseStore.pluginManager,
65
68
  groupId,
66
69
  artifactId,
@@ -18,6 +18,10 @@ import {
18
18
  type Query,
19
19
  extractElementNameFromPath,
20
20
  QueryTaggedValue,
21
+ RuntimePointer,
22
+ PackageableElementExplicitReference,
23
+ getAllClassMappings,
24
+ isSystemElement,
21
25
  } from '@finos/legend-graph';
22
26
  import {
23
27
  QueryEditorStore,
@@ -29,12 +33,17 @@ import type {
29
33
  DepotServerClient,
30
34
  ProjectGAVCoordinates,
31
35
  } from '@finos/legend-server-depot';
32
- import { guaranteeNonNullable, uuid } from '@finos/legend-shared';
36
+ import {
37
+ getNullableFirstElement,
38
+ guaranteeNonNullable,
39
+ uuid,
40
+ } from '@finos/legend-shared';
33
41
  import {
34
42
  QUERY_PROFILE_PATH,
35
43
  QUERY_PROFILE_TAG_DATA_SPACE,
36
44
  } from '../../DSLDataSpace_Const.js';
37
45
  import { getDataSpace } from '../../graphManager/DSLDataSpace_GraphManagerHelper.js';
46
+ import type { SDLCServerClient } from '@finos/legend-server-sdlc';
38
47
 
39
48
  const createQueryDataSpaceTaggedValue = (
40
49
  dataSpacePath: string,
@@ -58,6 +67,7 @@ export class DataSpaceQueryEditorStore extends QueryEditorStore {
58
67
  constructor(
59
68
  applicationStore: LegendQueryApplicationStore,
60
69
  depotServerClient: DepotServerClient,
70
+ sdlcServerClient: SDLCServerClient,
61
71
  pluginManager: LegendQueryPluginManager,
62
72
  groupId: string,
63
73
  artifactId: string,
@@ -67,7 +77,7 @@ export class DataSpaceQueryEditorStore extends QueryEditorStore {
67
77
  runtimePath: string | undefined,
68
78
  executionKey: string | undefined,
69
79
  ) {
70
- super(applicationStore, depotServerClient, pluginManager);
80
+ super(applicationStore, depotServerClient, sdlcServerClient, pluginManager);
71
81
 
72
82
  this.groupId = groupId;
73
83
  this.artifactId = artifactId;
@@ -104,10 +114,13 @@ export class DataSpaceQueryEditorStore extends QueryEditorStore {
104
114
  executionContext.mapping.value,
105
115
  );
106
116
  this.queryBuilderState.querySetupState.setRuntimeValue(
107
- (this.runtimePath
108
- ? this.graphManagerState.graph.getRuntime(this.runtimePath)
109
- : executionContext.defaultRuntime.value
110
- ).runtimeValue,
117
+ new RuntimePointer(
118
+ PackageableElementExplicitReference.create(
119
+ this.runtimePath
120
+ ? this.graphManagerState.graph.getRuntime(this.runtimePath)
121
+ : executionContext.defaultRuntime.value,
122
+ ),
123
+ ),
111
124
  );
112
125
 
113
126
  if (this.classPath) {
@@ -116,11 +129,30 @@ export class DataSpaceQueryEditorStore extends QueryEditorStore {
116
129
  );
117
130
  this.queryBuilderState.querySetupState.setClassIsReadOnly(true);
118
131
  } else {
119
- // TODO?: should we set the class here automatically?
120
-
121
- // initialize query builder state after setting up
122
- this.queryBuilderState.resetQueryBuilder();
123
- this.queryBuilderState.resetQuerySetup();
132
+ // try to find a class to set
133
+ // first, find classes which is mapped by the mapping
134
+ // then, find any classes except for class coming from system
135
+ // if none found, default to a dummy blank query
136
+ const defaultClass =
137
+ getNullableFirstElement(
138
+ this.queryBuilderState.querySetupState.mapping
139
+ ? getAllClassMappings(
140
+ this.queryBuilderState.querySetupState.mapping,
141
+ ).map((classMapping) => classMapping.class.value)
142
+ : [],
143
+ ) ??
144
+ getNullableFirstElement(
145
+ this.queryBuilderState.graphManagerState.graph.classes.filter(
146
+ (el) => !isSystemElement(el),
147
+ ),
148
+ );
149
+ if (defaultClass) {
150
+ this.queryBuilderState.changeClass(defaultClass);
151
+ } else {
152
+ this.queryBuilderState.initialize(
153
+ this.queryBuilderState.graphManagerState.graphManager.createDefaultBasicRawLambda(),
154
+ );
155
+ }
124
156
  }
125
157
  }
126
158