@finos/legend-extension-dsl-data-space 6.1.2 → 6.1.6

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/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-extension-dsl-data-space v6.1.2
1
+ /** @license @finos/legend-extension-dsl-data-space v6.1.6
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.2",
3
+ "version": "6.1.6",
4
4
  "description": "Legend extension for Data Space DSL",
5
5
  "keywords": [
6
6
  "legend",
@@ -52,7 +52,7 @@
52
52
  "@finos/legend-server-depot": "workspace:*",
53
53
  "@finos/legend-shared": "workspace:*",
54
54
  "@finos/legend-storage": "workspace:*",
55
- "@types/react": "18.0.15",
55
+ "@types/react": "18.0.17",
56
56
  "mobx": "6.6.1",
57
57
  "mobx-react-lite": "3.4.0",
58
58
  "react": "18.2.0",
@@ -65,11 +65,11 @@
65
65
  "@finos/legend-dev-utils": "workspace:*",
66
66
  "@jest/globals": "28.1.3",
67
67
  "cross-env": "7.0.3",
68
- "eslint": "8.21.0",
68
+ "eslint": "8.22.0",
69
69
  "jest": "28.1.3",
70
70
  "npm-run-all": "4.1.5",
71
71
  "rimraf": "3.0.2",
72
- "sass": "1.54.0",
72
+ "sass": "1.54.4",
73
73
  "typescript": "4.7.4"
74
74
  },
75
75
  "peerDependencies": {
@@ -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;AAsBpC,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;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) => {
@@ -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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aAAM;YACL,qDAAqD;YAErD,kDAAkD;YAClD,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,CAAC;YAC3C,IAAI,CAAC,iBAAiB,CAAC,eAAe,EAAE,CAAC;SAC1C;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"}
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;AAErF,MAAM,+BAA+B,GAAG,CACtC,aAAqB,EACH,EA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CAC/C,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC;gBACnD,CAAC,CAAC,EAAE,CACP;gBACD,uBAAuB,CACrB,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAC3D,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC,CAC7B,CACF,CAAC;YACJ,IAAI,YAAY,EAAE;gBAChB,IAAI,CAAC,iBAAiB,CAAC,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.2",
3
+ "version": "6.1.6",
4
4
  "description": "Legend extension for Data Space DSL",
5
5
  "keywords": [
6
6
  "legend",
@@ -43,16 +43,16 @@
43
43
  "test:watch": "jest --watch"
44
44
  },
45
45
  "dependencies": {
46
- "@finos/legend-application": "7.0.4",
47
- "@finos/legend-application-query": "5.1.0",
48
- "@finos/legend-application-studio": "13.0.3",
49
- "@finos/legend-art": "2.1.0",
50
- "@finos/legend-extension-dsl-diagram": "5.0.3",
51
- "@finos/legend-graph": "13.0.2",
52
- "@finos/legend-server-depot": "3.0.4",
53
- "@finos/legend-shared": "5.0.3",
54
- "@finos/legend-storage": "3.0.3",
55
- "@types/react": "18.0.15",
46
+ "@finos/legend-application": "7.1.2",
47
+ "@finos/legend-application-query": "5.2.3",
48
+ "@finos/legend-application-studio": "13.1.2",
49
+ "@finos/legend-art": "3.0.1",
50
+ "@finos/legend-extension-dsl-diagram": "5.0.6",
51
+ "@finos/legend-graph": "14.0.2",
52
+ "@finos/legend-server-depot": "3.0.6",
53
+ "@finos/legend-shared": "6.0.1",
54
+ "@finos/legend-storage": "3.0.5",
55
+ "@types/react": "18.0.17",
56
56
  "mobx": "6.6.1",
57
57
  "mobx-react-lite": "3.4.0",
58
58
  "react": "18.2.0",
@@ -62,14 +62,14 @@
62
62
  "serializr": "2.0.5"
63
63
  },
64
64
  "devDependencies": {
65
- "@finos/legend-dev-utils": "2.0.9",
65
+ "@finos/legend-dev-utils": "2.0.11",
66
66
  "@jest/globals": "28.1.3",
67
67
  "cross-env": "7.0.3",
68
- "eslint": "8.21.0",
68
+ "eslint": "8.22.0",
69
69
  "jest": "28.1.3",
70
70
  "npm-run-all": "4.1.5",
71
71
  "rimraf": "3.0.2",
72
- "sass": "1.54.0",
72
+ "sass": "1.54.4",
73
73
  "typescript": "4.7.4"
74
74
  },
75
75
  "peerDependencies": {
@@ -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,7 +33,11 @@ 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,
@@ -104,10 +112,13 @@ export class DataSpaceQueryEditorStore extends QueryEditorStore {
104
112
  executionContext.mapping.value,
105
113
  );
106
114
  this.queryBuilderState.querySetupState.setRuntimeValue(
107
- (this.runtimePath
108
- ? this.graphManagerState.graph.getRuntime(this.runtimePath)
109
- : executionContext.defaultRuntime.value
110
- ).runtimeValue,
115
+ new RuntimePointer(
116
+ PackageableElementExplicitReference.create(
117
+ this.runtimePath
118
+ ? this.graphManagerState.graph.getRuntime(this.runtimePath)
119
+ : executionContext.defaultRuntime.value,
120
+ ),
121
+ ),
111
122
  );
112
123
 
113
124
  if (this.classPath) {
@@ -116,11 +127,30 @@ export class DataSpaceQueryEditorStore extends QueryEditorStore {
116
127
  );
117
128
  this.queryBuilderState.querySetupState.setClassIsReadOnly(true);
118
129
  } 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();
130
+ // try to find a class to set
131
+ // first, find classes which is mapped by the mapping
132
+ // then, find any classes except for class coming from system
133
+ // if none found, default to a dummy blank query
134
+ const defaultClass =
135
+ getNullableFirstElement(
136
+ this.queryBuilderState.querySetupState.mapping
137
+ ? getAllClassMappings(
138
+ this.queryBuilderState.querySetupState.mapping,
139
+ ).map((classMapping) => classMapping.class.value)
140
+ : [],
141
+ ) ??
142
+ getNullableFirstElement(
143
+ this.queryBuilderState.graphManagerState.graph.classes.filter(
144
+ (el) => !isSystemElement(el),
145
+ ),
146
+ );
147
+ if (defaultClass) {
148
+ this.queryBuilderState.changeClass(defaultClass);
149
+ } else {
150
+ this.queryBuilderState.initialize(
151
+ this.queryBuilderState.graphManagerState.graphManager.createDefaultBasicRawLambda(),
152
+ );
153
+ }
124
154
  }
125
155
  }
126
156