@finos/legend-extension-dsl-data-space 4.0.3 → 5.0.0

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 (97) hide show
  1. package/lib/DSLDataSpace_Const.d.ts +18 -0
  2. package/lib/DSLDataSpace_Const.d.ts.map +1 -0
  3. package/lib/DSLDataSpace_Const.js +20 -0
  4. package/lib/DSLDataSpace_Const.js.map +1 -0
  5. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  6. package/lib/components/DataSpaceViewer.js +30 -27
  7. package/lib/components/DataSpaceViewer.js.map +1 -1
  8. package/lib/components/query/{DSLDataSpace_LegendQueryPlugin.d.ts → DSLDataSpace_LegendQueryApplicationPlugin.d.ts} +6 -3
  9. package/lib/components/query/DSLDataSpace_LegendQueryApplicationPlugin.d.ts.map +1 -0
  10. package/lib/components/query/{DSLDataSpace_LegendQueryPlugin.js → DSLDataSpace_LegendQueryApplicationPlugin.js} +27 -3
  11. package/lib/components/query/DSLDataSpace_LegendQueryApplicationPlugin.js.map +1 -0
  12. package/lib/components/query/DataSpaceQueryEditor.d.ts +20 -0
  13. package/lib/components/query/DataSpaceQueryEditor.d.ts.map +1 -0
  14. package/lib/components/query/DataSpaceQueryEditor.js +43 -0
  15. package/lib/components/query/DataSpaceQueryEditor.js.map +1 -0
  16. package/lib/components/query/DataSpaceQuerySetup.d.ts.map +1 -1
  17. package/lib/components/query/DataSpaceQuerySetup.js +4 -17
  18. package/lib/components/query/DataSpaceQuerySetup.js.map +1 -1
  19. package/lib/components/studio/{DSLDataSpace_LegendStudioPlugin.d.ts → DSLDataSpace_LegendStudioApplicationPlugin.d.ts} +3 -3
  20. package/lib/components/studio/DSLDataSpace_LegendStudioApplicationPlugin.d.ts.map +1 -0
  21. package/lib/components/studio/{DSLDataSpace_LegendStudioPlugin.js → DSLDataSpace_LegendStudioApplicationPlugin.js} +3 -3
  22. package/lib/components/studio/DSLDataSpace_LegendStudioApplicationPlugin.js.map +1 -0
  23. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.d.ts +2 -1
  24. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.d.ts.map +1 -1
  25. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.js +4 -0
  26. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.js.map +1 -1
  27. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts +50 -0
  28. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -0
  29. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js +48 -0
  30. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js.map +1 -0
  31. package/lib/graphManager/protocol/DSLDataSpace_PureGraphManagerExtension.d.ts +23 -0
  32. package/lib/graphManager/protocol/DSLDataSpace_PureGraphManagerExtension.d.ts.map +1 -0
  33. package/lib/graphManager/protocol/DSLDataSpace_PureGraphManagerExtension.js +21 -0
  34. package/lib/graphManager/protocol/DSLDataSpace_PureGraphManagerExtension.js.map +1 -0
  35. package/lib/graphManager/protocol/DSLDataSpace_PureGraphManagerExtensionBuilder.d.ts +18 -0
  36. package/lib/graphManager/protocol/DSLDataSpace_PureGraphManagerExtensionBuilder.d.ts.map +1 -0
  37. package/lib/graphManager/protocol/DSLDataSpace_PureGraphManagerExtensionBuilder.js +20 -0
  38. package/lib/graphManager/protocol/DSLDataSpace_PureGraphManagerExtensionBuilder.js.map +1 -0
  39. package/lib/graphManager/protocol/v1/V1_DSLDataSpace_PureGraphManagerExtension.d.ts +26 -0
  40. package/lib/graphManager/protocol/v1/V1_DSLDataSpace_PureGraphManagerExtension.d.ts.map +1 -0
  41. package/lib/graphManager/protocol/v1/V1_DSLDataSpace_PureGraphManagerExtension.js +131 -0
  42. package/lib/graphManager/protocol/v1/V1_DSLDataSpace_PureGraphManagerExtension.js.map +1 -0
  43. package/lib/graphManager/protocol/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +53 -0
  44. package/lib/graphManager/protocol/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -0
  45. package/lib/graphManager/protocol/v1/engine/analytics/V1_DataSpaceAnalysis.js +78 -0
  46. package/lib/graphManager/protocol/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -0
  47. package/lib/index.css +2 -2
  48. package/lib/index.css.map +1 -1
  49. package/lib/index.d.ts +4 -2
  50. package/lib/index.d.ts.map +1 -1
  51. package/lib/index.js +4 -2
  52. package/lib/index.js.map +1 -1
  53. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts +3 -1
  54. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts.map +1 -1
  55. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js +1 -1
  56. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js.map +1 -1
  57. package/lib/package.json +6 -5
  58. package/lib/stores/DataSpaceViewerState.d.ts +7 -11
  59. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  60. package/lib/stores/DataSpaceViewerState.js +10 -32
  61. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  62. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.d.ts +32 -0
  63. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.d.ts.map +1 -0
  64. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.js +34 -0
  65. package/lib/stores/query/DSLDataSpace_LegendQueryRouter.js.map +1 -0
  66. package/lib/stores/query/DataSpaceQueryEditorStore.d.ts +31 -0
  67. package/lib/stores/query/DataSpaceQueryEditorStore.d.ts.map +1 -0
  68. package/lib/stores/query/DataSpaceQueryEditorStore.js +87 -0
  69. package/lib/stores/query/DataSpaceQueryEditorStore.js.map +1 -0
  70. package/lib/stores/query/DataSpaceQuerySetupState.d.ts +3 -4
  71. package/lib/stores/query/DataSpaceQuerySetupState.d.ts.map +1 -1
  72. package/lib/stores/query/DataSpaceQuerySetupState.js +34 -44
  73. package/lib/stores/query/DataSpaceQuerySetupState.js.map +1 -1
  74. package/package.json +16 -15
  75. package/src/DSLDataSpace_Const.ts +20 -0
  76. package/src/components/DataSpaceViewer.tsx +56 -66
  77. package/src/components/query/{DSLDataSpace_LegendQueryPlugin.tsx → DSLDataSpace_LegendQueryApplicationPlugin.tsx} +39 -2
  78. package/src/components/query/DataSpaceQueryEditor.tsx +106 -0
  79. package/src/components/query/DataSpaceQuerySetup.tsx +23 -32
  80. package/src/components/studio/{DSLDataSpace_LegendStudioPlugin.tsx → DSLDataSpace_LegendStudioApplicationPlugin.tsx} +8 -8
  81. package/src/graphManager/DSLDataSpace_PureGraphManagerPlugin.ts +6 -0
  82. package/src/graphManager/action/analytics/DataSpaceAnalysis.ts +64 -0
  83. package/src/graphManager/protocol/DSLDataSpace_PureGraphManagerExtension.ts +42 -0
  84. package/src/graphManager/protocol/DSLDataSpace_PureGraphManagerExtensionBuilder.ts +27 -0
  85. package/src/graphManager/protocol/v1/V1_DSLDataSpace_PureGraphManagerExtension.ts +228 -0
  86. package/src/graphManager/protocol/v1/engine/analytics/V1_DataSpaceAnalysis.ts +117 -0
  87. package/src/index.ts +4 -2
  88. package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.ts +1 -1
  89. package/src/stores/DataSpaceViewerState.ts +23 -54
  90. package/src/stores/query/DSLDataSpace_LegendQueryRouter.ts +69 -0
  91. package/src/stores/query/DataSpaceQueryEditorStore.ts +141 -0
  92. package/src/stores/query/DataSpaceQuerySetupState.ts +65 -73
  93. package/tsconfig.json +11 -2
  94. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.d.ts.map +0 -1
  95. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.js.map +0 -1
  96. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.d.ts.map +0 -1
  97. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.js.map +0 -1
@@ -13,27 +13,18 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { QueryTaggedValue } from '@finos/legend-graph';
17
- import { CreateQueryInfoState, QuerySetupState, generateCreateQueryRoute, } from '@finos/legend-query';
16
+ import { QuerySetupState, generateStudioProjectViewUrl, } from '@finos/legend-query';
18
17
  import { DepotScope, ProjectData, SNAPSHOT_VERSION_ALIAS, } from '@finos/legend-server-depot';
19
18
  import { ActionState, assertErrorThrown, } from '@finos/legend-shared';
20
19
  import { action, flow, flowResult, makeObservable, observable } from 'mobx';
21
- import { getDataSpace } from '../../graphManager/DSLDataSpace_GraphManagerHelper.js';
20
+ import { getDSLDataSpaceGraphManagerExtension } from '../../graphManager/protocol/DSLDataSpace_PureGraphManagerExtension.js';
22
21
  import { DATA_SPACE_ELEMENT_CLASSIFIER_PATH } from '../../models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js';
23
22
  import { DataSpaceViewerState } from '../DataSpaceViewerState.js';
24
- const QUERY_PROFILE_PATH = 'meta::pure::profiles::query';
25
- const QUERY_PROFILE_TAG_DATA_SPACE = 'dataSpace';
26
- export const createQueryDataSpaceTaggedValue = (dataSpacePath) => {
27
- const taggedValue = new QueryTaggedValue();
28
- taggedValue.profile = QUERY_PROFILE_PATH;
29
- taggedValue.tag = QUERY_PROFILE_TAG_DATA_SPACE;
30
- taggedValue.value = dataSpacePath;
31
- return taggedValue;
32
- };
23
+ import { generateDataSpaceQueryEditorRoute } from './DSLDataSpace_LegendQueryRouter.js';
33
24
  export class DataSpaceQuerySetupState extends QuerySetupState {
34
25
  dataSpaces = [];
35
26
  loadDataSpacesState = ActionState.create();
36
- setUpDataSpaceState = ActionState.create();
27
+ loadDataSpaceState = ActionState.create();
37
28
  currentDataSpace;
38
29
  dataSpaceViewerState;
39
30
  toGetSnapShot = false;
@@ -48,7 +39,7 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
48
39
  setDataSpaceViewerState: action,
49
40
  setToGetSnapShot: action,
50
41
  loadDataSpaces: flow,
51
- setUpDataSpace: flow,
42
+ loadDataSpace: flow,
52
43
  proceedToCreateQuery: flow,
53
44
  });
54
45
  }
@@ -62,16 +53,10 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
62
53
  this.toGetSnapShot = val;
63
54
  }
64
55
  *loadDataSpaces(searchText) {
65
- if (this.queryStore.initState.isInInitialState) {
66
- yield flowResult(this.queryStore.initialize());
67
- }
68
- else if (this.queryStore.initState.isInProgress) {
69
- return;
70
- }
71
56
  const isValidSearchString = searchText.length >= 3;
72
57
  this.loadDataSpacesState.inProgress();
73
58
  try {
74
- this.dataSpaces = (yield this.queryStore.depotServerClient.getEntitiesByClassifierPath(DATA_SPACE_ELEMENT_CLASSIFIER_PATH, {
59
+ this.dataSpaces = (yield this.setupStore.depotServerClient.getEntitiesByClassifierPath(DATA_SPACE_ELEMENT_CLASSIFIER_PATH, {
75
60
  search: isValidSearchString ? searchText : undefined,
76
61
  scope: this.toGetSnapShot
77
62
  ? DepotScope.SNAPSHOT
@@ -90,43 +75,48 @@ export class DataSpaceQuerySetupState extends QuerySetupState {
90
75
  catch (error) {
91
76
  assertErrorThrown(error);
92
77
  this.loadDataSpacesState.fail();
93
- this.queryStore.applicationStore.notifyError(error);
78
+ this.setupStore.applicationStore.notifyError(error);
94
79
  }
95
80
  }
96
- *setUpDataSpace(dataSpace) {
97
- if (this.queryStore.initState.isInInitialState) {
98
- yield flowResult(this.queryStore.initialize());
99
- }
100
- else if (this.queryStore.initState.isInProgress) {
101
- return;
102
- }
103
- this.setUpDataSpaceState.inProgress();
81
+ *loadDataSpace(dataSpace) {
82
+ this.loadDataSpaceState.inProgress();
83
+ this.loadDataSpaceState.setMessage(`Initializing...`);
104
84
  try {
105
- const projectData = ProjectData.serialization.fromJson((yield flowResult(this.queryStore.depotServerClient.getProject(dataSpace.groupId, dataSpace.artifactId))));
106
- yield flowResult(this.queryStore.buildGraph(projectData, dataSpace.versionId));
107
- this.dataSpaceViewerState = new DataSpaceViewerState(this.queryStore.graphManagerState, dataSpace.groupId, dataSpace.artifactId, dataSpace.versionId, getDataSpace(dataSpace.path, this.queryStore.graphManagerState.graph), {
108
- viewProject: (groupId, artifactId, versionId, entityPath) => this.queryStore.viewStudioProject(groupId, artifactId, versionId, entityPath),
85
+ // fetch project
86
+ this.loadDataSpaceState.setMessage(`Fetching project...`);
87
+ const project = ProjectData.serialization.fromJson((yield flowResult(this.setupStore.depotServerClient.getProject(dataSpace.groupId, dataSpace.artifactId))));
88
+ // fetch entities
89
+ this.loadDataSpaceState.setMessage(`Fetching entities...`);
90
+ const entities = (yield this.setupStore.depotServerClient.getEntities(project, dataSpace.versionId));
91
+ // fetch dependencies
92
+ this.loadDataSpaceState.setMessage(`Fetching dependencies...`);
93
+ const dependencyEntitiesIndex = (yield flowResult(this.setupStore.depotServerClient.getIndexedDependencyEntities(project, dataSpace.versionId)));
94
+ // analyze data space
95
+ this.loadDataSpaceState.setMessage(`Analyzing data space...`);
96
+ const analysisResult = (yield getDSLDataSpaceGraphManagerExtension(this.setupStore.graphManagerState.graphManager).analyzeDataSpace(dataSpace.path, entities, dependencyEntitiesIndex));
97
+ this.dataSpaceViewerState = new DataSpaceViewerState(dataSpace.groupId, dataSpace.artifactId, dataSpace.versionId, analysisResult, {
98
+ viewProject: (groupId, artifactId, versionId, entityPath) => this.setupStore.applicationStore.navigator.openNewWindow(generateStudioProjectViewUrl(this.setupStore.applicationStore.config.studioUrl, groupId, artifactId, versionId, entityPath)),
109
99
  onDiagramClassDoubleClick: (classView) => {
110
100
  this.proceedToCreateQuery(classView.class.value);
111
101
  },
112
102
  });
113
- this.setUpDataSpaceState.pass();
103
+ this.loadDataSpaceState.pass();
114
104
  }
115
105
  catch (error) {
116
106
  assertErrorThrown(error);
117
- this.setUpDataSpaceState.fail();
118
- this.queryStore.applicationStore.notifyError(error);
107
+ this.loadDataSpaceState.fail();
108
+ this.setupStore.applicationStore.notifyError(error);
109
+ }
110
+ finally {
111
+ this.loadDataSpaceState.setMessage(undefined);
119
112
  }
120
113
  }
121
114
  *proceedToCreateQuery(_class) {
122
115
  if (this.dataSpaceViewerState) {
123
- const projectData = ProjectData.serialization.fromJson((yield flowResult(this.queryStore.depotServerClient.getProject(this.dataSpaceViewerState.groupId, this.dataSpaceViewerState.artifactId))));
124
- const queryInfoState = new CreateQueryInfoState(this.queryStore, projectData, this.dataSpaceViewerState.versionId, this.dataSpaceViewerState.currentExecutionContext.mapping.value, this.dataSpaceViewerState.currentRuntime);
125
- queryInfoState.taggedValues = [
126
- createQueryDataSpaceTaggedValue(this.dataSpaceViewerState.dataSpace.path),
127
- ];
128
- this.queryStore.setQueryInfoState(queryInfoState);
129
- this.queryStore.applicationStore.navigator.goTo(generateCreateQueryRoute(this.dataSpaceViewerState.groupId, this.dataSpaceViewerState.artifactId, this.dataSpaceViewerState.versionId, this.dataSpaceViewerState.currentExecutionContext.mapping.value.path, this.dataSpaceViewerState.currentRuntime.path, _class?.path));
116
+ this.setupStore.applicationStore.navigator.goTo(generateDataSpaceQueryEditorRoute(this.dataSpaceViewerState.groupId, this.dataSpaceViewerState.artifactId, this.dataSpaceViewerState.versionId, this.dataSpaceViewerState.dataSpaceAnalysisResult.path, this.dataSpaceViewerState.currentExecutionContext.name, this.dataSpaceViewerState.currentRuntime ===
117
+ this.dataSpaceViewerState.currentExecutionContext.defaultRuntime
118
+ ? undefined
119
+ : this.dataSpaceViewerState.currentRuntime.path, _class?.path));
130
120
  this.setupStore.setSetupState(undefined);
131
121
  }
132
122
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DataSpaceQuerySetupState.js","sourceRoot":"","sources":["../../../src/stores/query/DataSpaceQuerySetupState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAc,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAEL,oBAAoB,EACpB,eAAe,EACf,wBAAwB,GACzB,MAAM,qBAAqB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AAC;aACF,CACF,CAAC;YACF,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;SAChC;QAAC,OAAO,KAAK,EAAE;YACd,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SACrD;gBAAS;YACR,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;SAC/C;IACH,CAAC;IAED,CAAC,oBAAoB,CAAC,MAAc;QAClC,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC7B,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAC7C,iCAAiC,CAC/B,IAAI,CAAC,oBAAoB,CAAC,OAAO,EACjC,IAAI,CAAC,oBAAoB,CAAC,UAAU,EACpC,IAAI,CAAC,oBAAoB,CAAC,SAAS,EACnC,IAAI,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,IAAI,EACtD,IAAI,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,IAAI,EACtD,IAAI,CAAC,oBAAoB,CAAC,cAAc;gBACtC,IAAI,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,cAAc;gBAChE,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,IAAI,EACjD,MAAM,EAAE,IAAI,CACb,CACF,CAAC;YACF,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1C;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-extension-dsl-data-space",
3
- "version": "4.0.3",
3
+ "version": "5.0.0",
4
4
  "description": "Legend extension for Data Space DSL",
5
5
  "keywords": [
6
6
  "legend",
@@ -43,32 +43,33 @@
43
43
  "test:watch": "jest --watch"
44
44
  },
45
45
  "dependencies": {
46
- "@finos/legend-application": "6.0.0",
47
- "@finos/legend-art": "2.0.6",
48
- "@finos/legend-extension-dsl-diagram": "4.1.4",
49
- "@finos/legend-graph": "10.1.0",
50
- "@finos/legend-model-storage": "2.0.6",
51
- "@finos/legend-query": "3.2.1",
52
- "@finos/legend-server-depot": "2.0.6",
53
- "@finos/legend-shared": "4.0.3",
54
- "@finos/legend-studio": "11.0.1",
46
+ "@finos/legend-application": "7.0.0",
47
+ "@finos/legend-art": "2.0.9",
48
+ "@finos/legend-extension-dsl-diagram": "4.1.7",
49
+ "@finos/legend-graph": "11.0.0",
50
+ "@finos/legend-model-storage": "2.0.7",
51
+ "@finos/legend-query": "4.0.0",
52
+ "@finos/legend-server-depot": "3.0.0",
53
+ "@finos/legend-shared": "5.0.0",
54
+ "@finos/legend-studio": "12.0.0",
55
55
  "@types/react": "18.0.15",
56
56
  "mobx": "6.6.1",
57
57
  "mobx-react-lite": "3.4.0",
58
58
  "react": "18.2.0",
59
59
  "react-dom": "18.2.0",
60
60
  "react-resize-detector": "7.1.2",
61
+ "react-router": "5.3.3",
61
62
  "serializr": "2.0.5"
62
63
  },
63
64
  "devDependencies": {
64
- "@finos/legend-dev-utils": "2.0.5",
65
- "@jest/globals": "28.1.2",
65
+ "@finos/legend-dev-utils": "2.0.6",
66
+ "@jest/globals": "28.1.3",
66
67
  "cross-env": "7.0.3",
67
- "eslint": "8.19.0",
68
- "jest": "28.1.2",
68
+ "eslint": "8.20.0",
69
+ "jest": "28.1.3",
69
70
  "npm-run-all": "4.1.5",
70
71
  "rimraf": "3.0.2",
71
- "sass": "1.53.0",
72
+ "sass": "1.54.0",
72
73
  "typescript": "4.7.4"
73
74
  },
74
75
  "peerDependencies": {
@@ -0,0 +1,20 @@
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
+ // NOTE: these are non-compilable profile and tag that we come up with for query
18
+ // so that it records the dataSpace it is created from
19
+ export const QUERY_PROFILE_PATH = 'meta::pure::profiles::query';
20
+ export const QUERY_PROFILE_TAG_DATA_SPACE = 'dataSpace';
@@ -39,16 +39,16 @@ import {
39
39
  type Diagram,
40
40
  DiagramRenderer,
41
41
  } from '@finos/legend-extension-dsl-diagram';
42
+ import { DataSpaceSupportEmail } from '../models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
42
43
  import {
43
- DataSpaceSupportEmail,
44
- type DataSpaceExecutionContext,
45
- type DataSpaceSupportInfo,
46
- } from '../models/metamodels/pure/model/packageableElements/dataSpace/DSLDataSpace_DataSpace.js';
47
- import type { PackageableRuntime } from '@finos/legend-graph';
44
+ extractElementNameFromPath,
45
+ type PackageableRuntime,
46
+ } from '@finos/legend-graph';
48
47
  import {
49
48
  type DataSpaceViewerState,
50
49
  DATA_SPACE_VIEWER_ACTIVITY_MODE,
51
50
  } from '../stores/DataSpaceViewerState.js';
51
+ import type { DataSpaceExecutionContextAnalysisResult } from '../graphManager/action/analytics/DataSpaceAnalysis.js';
52
52
 
53
53
  interface DataSpaceViewerActivityConfig {
54
54
  mode: DATA_SPACE_VIEWER_ACTIVITY_MODE;
@@ -113,16 +113,12 @@ const buildDiagramOption = (diagram: Diagram): DiagramOption => ({
113
113
  const DataSpaceModelsOverview = observer(
114
114
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
115
115
  const { dataSpaceViewerState } = props;
116
+ const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
116
117
 
117
118
  // diagram selector
118
119
  const diagramCanvasRef = useRef<HTMLDivElement>(null);
119
- const diagramOptions = dataSpaceViewerState.featuredDiagrams
120
- .concat(
121
- dataSpaceViewerState.diagrams.filter(
122
- (diagram) => !dataSpaceViewerState.featuredDiagrams.includes(diagram),
123
- ),
124
- )
125
- .map(buildDiagramOption);
120
+ const diagramOptions =
121
+ analysisResult.featuredDiagrams.map(buildDiagramOption);
126
122
  const selectedDiagramOption = dataSpaceViewerState.currentDiagram
127
123
  ? buildDiagramOption(dataSpaceViewerState.currentDiagram)
128
124
  : null;
@@ -131,22 +127,8 @@ const DataSpaceModelsOverview = observer(
131
127
  dataSpaceViewerState.setCurrentDiagram(option.value);
132
128
  }
133
129
  };
134
- const formatDiagramOptionLabel = (
135
- option: DiagramOption,
136
- ): React.ReactNode => (
137
- <div className="data-space__viewer__diagrams__dropdown__option">
138
- <div className="data-space__viewer__diagrams__dropdown__option__label">
139
- {option.label}
140
- </div>
141
- {dataSpaceViewerState.featuredDiagrams.includes(option.value) && (
142
- <div className="data-space__viewer__diagrams__dropdown__option__tag">
143
- featured
144
- </div>
145
- )}
146
- </div>
147
- );
148
130
 
149
- if (dataSpaceViewerState.diagrams.length === 0) {
131
+ if (analysisResult.featuredDiagrams.length === 0) {
150
132
  return <BlankPanelContent>No diagrams available</BlankPanelContent>;
151
133
  }
152
134
  return (
@@ -159,7 +141,6 @@ const DataSpaceModelsOverview = observer(
159
141
  value={selectedDiagramOption}
160
142
  placeholder="Search for a diagram"
161
143
  darkMode={true}
162
- formatOptionLabel={formatDiagramOptionLabel}
163
144
  />
164
145
  </div>
165
146
  <div className="data-space__viewer__diagrams__content">
@@ -186,10 +167,10 @@ const DataSpaceModelsOverview = observer(
186
167
 
187
168
  type ExecutionContextOption = {
188
169
  label: string;
189
- value: DataSpaceExecutionContext;
170
+ value: DataSpaceExecutionContextAnalysisResult;
190
171
  };
191
172
  const buildExecutionContextOption = (
192
- value: DataSpaceExecutionContext,
173
+ value: DataSpaceExecutionContextAnalysisResult,
193
174
  ): ExecutionContextOption => ({
194
175
  label: value.name,
195
176
  value: value,
@@ -207,12 +188,15 @@ const buildRuntimeOption = (value: PackageableRuntime): RuntimeOption => ({
207
188
  const DataSpaceExecutionViewer = observer(
208
189
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
209
190
  const { dataSpaceViewerState } = props;
191
+ const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
192
+ const executionContexts = Array.from(
193
+ dataSpaceViewerState.dataSpaceAnalysisResult.executionContextsIndex.values(),
194
+ );
210
195
 
211
196
  // execution
212
- const executionContextOptions =
213
- dataSpaceViewerState.dataSpace.executionContexts.map(
214
- buildExecutionContextOption,
215
- );
197
+ const executionContextOptions = executionContexts.map(
198
+ buildExecutionContextOption,
199
+ );
216
200
  const selectedExecutionContextOption = buildExecutionContextOption(
217
201
  dataSpaceViewerState.currentExecutionContext,
218
202
  );
@@ -230,8 +214,7 @@ const DataSpaceExecutionViewer = observer(
230
214
  <div className="data-space__viewer__execution__entry__content__dropdown__option__label">
231
215
  {option.label}
232
216
  </div>
233
- {option.value ===
234
- dataSpaceViewerState.dataSpace.defaultExecutionContext && (
217
+ {option.value === analysisResult.defaultExecutionContext && (
235
218
  <div className="data-space__viewer__execution__entry__content__dropdown__option__tag">
236
219
  default
237
220
  </div>
@@ -241,7 +224,9 @@ const DataSpaceExecutionViewer = observer(
241
224
 
242
225
  // runtime
243
226
  const runtimeOptions =
244
- dataSpaceViewerState.runtimes.map(buildRuntimeOption);
227
+ dataSpaceViewerState.currentExecutionContext.compatibleRuntimes.map(
228
+ buildRuntimeOption,
229
+ );
245
230
  const selectedRuntimeOption = buildRuntimeOption(
246
231
  dataSpaceViewerState.currentRuntime,
247
232
  );
@@ -258,7 +243,7 @@ const DataSpaceExecutionViewer = observer(
258
243
  {option.label}
259
244
  </div>
260
245
  {option.value ===
261
- dataSpaceViewerState.currentExecutionContext.defaultRuntime.value && (
246
+ dataSpaceViewerState.currentExecutionContext.defaultRuntime && (
262
247
  <div className="data-space__viewer__execution__entry__content__dropdown__option__tag">
263
248
  default
264
249
  </div>
@@ -298,7 +283,7 @@ const DataSpaceExecutionViewer = observer(
298
283
  <PURE_MappingIcon />
299
284
  </div>
300
285
  <div className="data-space__viewer__execution__entry__content data-space__viewer__execution__entry__content__text">
301
- {dataSpaceViewerState.currentExecutionContext.mapping.value.path}
286
+ {dataSpaceViewerState.currentExecutionContext.mapping.path}
302
287
  </div>
303
288
  </div>
304
289
  <div className="data-space__viewer__execution__entry">
@@ -324,8 +309,7 @@ const DataSpaceExecutionViewer = observer(
324
309
  const DataSpaceTags = observer(
325
310
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
326
311
  const { dataSpaceViewerState } = props;
327
-
328
- const dataSpace = dataSpaceViewerState.dataSpace;
312
+ const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
329
313
 
330
314
  return (
331
315
  <div className="data-space__viewer__tags">
@@ -333,24 +317,26 @@ const DataSpaceTags = observer(
333
317
  <div className="data-space__viewer__tags__section__title">
334
318
  Tagged Values
335
319
  </div>
336
- {dataSpace.taggedValues.length !== 0 &&
337
- dataSpace.taggedValues.map((taggedValue) => (
320
+ {analysisResult.taggedValues.length !== 0 &&
321
+ analysisResult.taggedValues.map((taggedValue) => (
338
322
  <div
339
323
  key={taggedValue._UUID}
340
324
  className="data-space__viewer__tags__section__entry"
341
325
  >
342
326
  <div
343
327
  className="data-space__viewer__tags__tagged-value__tag"
344
- title={`${taggedValue.tag.ownerReference.value.name}.${taggedValue.tag.value.value}`}
328
+ title={`${taggedValue.profile}.${taggedValue.tag}`}
345
329
  >
346
- {taggedValue.tag.value.value}
330
+ {`${extractElementNameFromPath(taggedValue.profile)}.${
331
+ taggedValue.tag
332
+ }`}
347
333
  </div>
348
334
  <div className="data-space__viewer__tags__tagged-value__value">
349
335
  {taggedValue.value}
350
336
  </div>
351
337
  </div>
352
338
  ))}
353
- {dataSpace.taggedValues.length === 0 && (
339
+ {analysisResult.taggedValues.length === 0 && (
354
340
  <div className="data-space__viewer__tags__section__placeholder">
355
341
  (empty)
356
342
  </div>
@@ -360,19 +346,21 @@ const DataSpaceTags = observer(
360
346
  <div className="data-space__viewer__tags__section__title">
361
347
  Stereotypes
362
348
  </div>
363
- {dataSpace.stereotypes.length !== 0 &&
364
- dataSpace.stereotypes.map((stereotype) => (
349
+ {analysisResult.stereotypes.length !== 0 &&
350
+ analysisResult.stereotypes.map((stereotype) => (
365
351
  <div
366
- key={stereotype.value._UUID}
352
+ key={stereotype._UUID}
367
353
  className="data-space__viewer__tags__section__entry"
368
- title={`${stereotype.ownerReference.value.name}.${stereotype.value.value}`}
354
+ title={`${stereotype.profile}.${stereotype.value}`}
369
355
  >
370
356
  <div className="data-space__viewer__tags__steoreotype">
371
- {stereotype.value.value}
357
+ {`${extractElementNameFromPath(stereotype.profile)}.${
358
+ stereotype.value
359
+ }`}
372
360
  </div>
373
361
  </div>
374
362
  ))}
375
- {dataSpace.stereotypes.length === 0 && (
363
+ {analysisResult.stereotypes.length === 0 && (
376
364
  <div className="data-space__viewer__tags__section__placeholder">
377
365
  (empty)
378
366
  </div>
@@ -409,18 +397,18 @@ const DataSpaceSupportEmailViewer = observer(
409
397
  );
410
398
 
411
399
  const DataSpaceSupportInfoViewerInner = observer(
412
- (props: {
413
- dataSpaceViewerState: DataSpaceViewerState;
414
- dataSpaceSupportInfo: DataSpaceSupportInfo | undefined;
415
- }) => {
416
- const { dataSpaceViewerState, dataSpaceSupportInfo } = props;
417
- if (dataSpaceSupportInfo === undefined) {
400
+ (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
401
+ const { dataSpaceViewerState } = props;
402
+ const supportInfo =
403
+ dataSpaceViewerState.dataSpaceAnalysisResult.supportInfo;
404
+
405
+ if (supportInfo === undefined) {
418
406
  return <BlankPanelContent>No support info available</BlankPanelContent>;
419
- } else if (dataSpaceSupportInfo instanceof DataSpaceSupportEmail) {
407
+ } else if (supportInfo instanceof DataSpaceSupportEmail) {
420
408
  return (
421
409
  <DataSpaceSupportEmailViewer
422
410
  dataSpaceViewerState={dataSpaceViewerState}
423
- dataSpaceSupportEmail={dataSpaceSupportInfo}
411
+ dataSpaceSupportEmail={supportInfo}
424
412
  />
425
413
  );
426
414
  }
@@ -433,7 +421,7 @@ const DataSpaceSupportInfoViewerInner = observer(
433
421
  export const DataSpaceViewer = observer(
434
422
  (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
435
423
  const { dataSpaceViewerState } = props;
436
- const dataSpace = dataSpaceViewerState.dataSpace;
424
+ const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
437
425
  const changeActivity =
438
426
  (activity: DATA_SPACE_VIEWER_ACTIVITY_MODE): (() => void) =>
439
427
  (): void =>
@@ -482,7 +470,7 @@ export const DataSpaceViewer = observer(
482
470
  dataSpaceViewerState.groupId,
483
471
  dataSpaceViewerState.artifactId,
484
472
  dataSpaceViewerState.versionId,
485
- dataSpace.path,
473
+ analysisResult.path,
486
474
  );
487
475
 
488
476
  return (
@@ -495,7 +483,7 @@ export const DataSpaceViewer = observer(
495
483
  onClick={viewProject}
496
484
  >
497
485
  <div className="data-space__viewer__path__label">
498
- {dataSpace.path}
486
+ {analysisResult.path}
499
487
  </div>
500
488
  <div className="data-space__viewer__path__link">
501
489
  <ExternalLinkSquareIcon />
@@ -503,10 +491,13 @@ export const DataSpaceViewer = observer(
503
491
  </button>
504
492
  <div
505
493
  className={clsx('data-space__viewer__description', {
506
- 'data-space__viewer__description--empty': !dataSpace.description,
494
+ 'data-space__viewer__description--empty':
495
+ !analysisResult.description,
507
496
  })}
508
497
  >
509
- {dataSpace.description ? dataSpace.description : 'No description'}
498
+ {analysisResult.description
499
+ ? analysisResult.description
500
+ : 'No description'}
510
501
  </div>
511
502
  </div>
512
503
  <div className="data-space__viewer__content">
@@ -569,7 +560,6 @@ export const DataSpaceViewer = observer(
569
560
  <div className="data-space__viewer__main-panel__content data-space__viewer__support-info">
570
561
  <DataSpaceSupportInfoViewerInner
571
562
  dataSpaceViewerState={dataSpaceViewerState}
572
- dataSpaceSupportInfo={dataSpace.supportInfo}
573
563
  />
574
564
  </div>
575
565
  )}
@@ -16,21 +16,39 @@
16
16
 
17
17
  import packageJson from '../../../package.json';
18
18
  import {
19
- LegendQueryPlugin,
19
+ type QueryEditorStore,
20
+ type QueryEditorHeaderLabeler,
20
21
  type QuerySetupOptionRendererConfiguration,
21
22
  type QuerySetupRenderer,
22
23
  type QuerySetupState,
23
24
  type QuerySetupStore,
25
+ LegendQueryApplicationPlugin,
24
26
  } from '@finos/legend-query';
25
27
  import { SquareIcon } from '@finos/legend-art';
26
28
  import { DataSpaceQuerySetupState } from '../../stores/query/DataSpaceQuerySetupState.js';
27
29
  import { DataspaceQuerySetup } from './DataSpaceQuerySetup.js';
30
+ import type { ApplicationPageEntry } from '@finos/legend-application';
31
+ import { DATA_SPACE_QUERY_EDITOR_ROUTE_PATTERN } from '../../stores/query/DSLDataSpace_LegendQueryRouter.js';
32
+ import { DataSpaceQueryEditor } from './DataSpaceQueryEditor.js';
33
+ import { DataSpaceQueryEditorStore } from '../../stores/query/DataSpaceQueryEditorStore.js';
34
+ import { extractElementNameFromPath } from '@finos/legend-graph';
28
35
 
29
- export class DSLDataSpace_LegendQueryPlugin extends LegendQueryPlugin {
36
+ export class DSLDataSpace_LegendQueryApplicationPlugin extends LegendQueryApplicationPlugin {
30
37
  constructor() {
31
38
  super(packageJson.extensions.queryPlugin, packageJson.version);
32
39
  }
33
40
 
41
+ override getExtraApplicationPageEntries(): ApplicationPageEntry[] {
42
+ return [
43
+ // data space query editor
44
+ {
45
+ key: 'data-space-query-editor-application-page',
46
+ urlPatterns: [DATA_SPACE_QUERY_EDITOR_ROUTE_PATTERN],
47
+ renderer: DataSpaceQueryEditor,
48
+ },
49
+ ];
50
+ }
51
+
34
52
  override getExtraQuerySetupOptionRendererConfigurations(): QuerySetupOptionRendererConfiguration[] {
35
53
  return [
36
54
  {
@@ -68,4 +86,23 @@ export class DSLDataSpace_LegendQueryPlugin extends LegendQueryPlugin {
68
86
  },
69
87
  ];
70
88
  }
89
+
90
+ override getExtraQueryEditorHeaderLabelers(): QueryEditorHeaderLabeler[] {
91
+ return [
92
+ (editorStore: QueryEditorStore): React.ReactNode | undefined => {
93
+ if (editorStore instanceof DataSpaceQueryEditorStore) {
94
+ return (
95
+ <div className="query-editor__header__label">
96
+ <SquareIcon className="query-editor__header__label__icon icon--data-space" />
97
+ {extractElementNameFromPath(editorStore.dataSpacePath)}
98
+ <div className="query-editor__header__label__tag">
99
+ {editorStore.executionContext}
100
+ </div>
101
+ </div>
102
+ );
103
+ }
104
+ return undefined;
105
+ },
106
+ ];
107
+ }
71
108
  }