@finos/legend-extension-dsl-data-space 10.2.4 → 10.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. package/lib/{components → __lib__}/query/DSL_DataSpace_LegendQueryDocumentation.d.ts +1 -1
  2. package/lib/__lib__/query/DSL_DataSpace_LegendQueryDocumentation.d.ts.map +1 -0
  3. package/lib/{components → __lib__}/query/DSL_DataSpace_LegendQueryDocumentation.js +4 -4
  4. package/lib/__lib__/query/DSL_DataSpace_LegendQueryDocumentation.js.map +1 -0
  5. package/lib/__lib__/shared/DSL_DataSpace_LegendNavigation.d.ts +15 -0
  6. package/lib/__lib__/shared/DSL_DataSpace_LegendNavigation.d.ts.map +1 -0
  7. package/lib/__lib__/shared/DSL_DataSpace_LegendNavigation.js +32 -0
  8. package/lib/__lib__/shared/DSL_DataSpace_LegendNavigation.js.map +1 -0
  9. package/lib/__lib__/to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.d.ts +38 -0
  10. package/lib/__lib__/to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.d.ts.map +1 -0
  11. package/lib/__lib__/{query/DSL_DataSpace_LegendQueryNavigation.js → to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.js} +33 -13
  12. package/lib/__lib__/to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.js.map +1 -0
  13. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +3 -3
  14. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
  15. package/lib/components/index.d.ts +6 -4
  16. package/lib/components/index.d.ts.map +1 -1
  17. package/lib/components/index.js +6 -4
  18. package/lib/components/index.js.map +1 -1
  19. package/lib/components/query-builder/DataSpaceAdvancedSearchModal.d.ts.map +1 -0
  20. package/lib/components/query-builder/DataSpaceAdvancedSearchModal.js.map +1 -0
  21. package/lib/components/{query → query-builder}/DataSpaceQueryBuilder.d.ts +2 -5
  22. package/lib/components/query-builder/DataSpaceQueryBuilder.d.ts.map +1 -0
  23. package/lib/components/{query → query-builder}/DataSpaceQueryBuilder.js +5 -24
  24. package/lib/components/query-builder/DataSpaceQueryBuilder.js.map +1 -0
  25. package/lib/components/{query → query-builder}/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts +1 -1
  26. package/lib/components/query-builder/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts.map +1 -0
  27. package/lib/components/{query → query-builder}/DataSpaceQueryBuilderTemplateQueryPanelContent.js +4 -4
  28. package/lib/components/query-builder/DataSpaceQueryBuilderTemplateQueryPanelContent.js.map +1 -0
  29. package/lib/components/query-builder/QueryDataSpaceUtil.d.ts.map +1 -0
  30. package/lib/components/query-builder/QueryDataSpaceUtil.js.map +1 -0
  31. package/lib/components/{query → query-builder}/index.d.ts +3 -1
  32. package/lib/components/query-builder/index.d.ts.map +1 -0
  33. package/lib/components/{query → query-builder}/index.js +3 -1
  34. package/lib/components/query-builder/index.js.map +1 -0
  35. package/lib/components/shared/DSL_DataSpace_Icon.d.ts.map +1 -0
  36. package/lib/components/shared/DSL_DataSpace_Icon.js.map +1 -0
  37. package/lib/graph-manager/index.d.ts +4 -0
  38. package/lib/graph-manager/index.d.ts.map +1 -1
  39. package/lib/graph-manager/index.js +5 -0
  40. package/lib/graph-manager/index.js.map +1 -1
  41. package/lib/index.css +2 -2
  42. package/lib/index.css.map +1 -1
  43. package/lib/package.json +3 -8
  44. package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts +1 -1
  45. package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts.map +1 -1
  46. package/lib/stores/query/DataSpaceAdvancedSearchState.js +2 -3
  47. package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
  48. package/lib/stores/{query → query-builder}/DataSpaceQueryBuilderState.d.ts +2 -2
  49. package/lib/stores/query-builder/DataSpaceQueryBuilderState.d.ts.map +1 -0
  50. package/lib/stores/{query → query-builder}/DataSpaceQueryBuilderState.js +3 -3
  51. package/lib/stores/query-builder/DataSpaceQueryBuilderState.js.map +1 -0
  52. package/lib/stores/shared/DataSpaceInfo.d.ts.map +1 -0
  53. package/lib/stores/shared/DataSpaceInfo.js.map +1 -0
  54. package/lib/{__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.d.ts → stores/shared/DataSpaceUtils.d.ts} +4 -5
  55. package/lib/stores/shared/DataSpaceUtils.d.ts.map +1 -0
  56. package/lib/stores/shared/DataSpaceUtils.js +32 -0
  57. package/lib/stores/shared/DataSpaceUtils.js.map +1 -0
  58. package/package.json +4 -9
  59. package/src/{components → __lib__}/query/DSL_DataSpace_LegendQueryDocumentation.ts +1 -1
  60. package/src/__lib__/shared/DSL_DataSpace_LegendNavigation.ts +57 -0
  61. package/src/__lib__/{query/DSL_DataSpace_LegendQueryNavigation.ts → to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.ts} +41 -46
  62. package/src/components/DSL_DataSpace_LegendApplicationPlugin.tsx +6 -6
  63. package/src/components/index.ts +15 -4
  64. package/src/components/{query → query-builder}/DataSpaceAdvancedSearchModal.tsx +1 -1
  65. package/src/components/{query → query-builder}/DataSpaceQueryBuilder.tsx +7 -68
  66. package/src/components/{query → query-builder}/DataSpaceQueryBuilderTemplateQueryPanelContent.tsx +5 -5
  67. package/src/components/{studio → query-builder}/index.ts +7 -1
  68. package/src/graph-manager/index.ts +6 -0
  69. package/src/stores/query/DataSpaceAdvancedSearchState.ts +8 -3
  70. package/src/stores/{query → query-builder}/DataSpaceQueryBuilderState.ts +6 -3
  71. package/src/stores/shared/DataSpaceUtils.ts +42 -0
  72. package/tsconfig.json +12 -26
  73. package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts +0 -65
  74. package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts.map +0 -1
  75. package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.js.map +0 -1
  76. package/lib/__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.d.ts +0 -17
  77. package/lib/__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.d.ts.map +0 -1
  78. package/lib/__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.js +0 -54
  79. package/lib/__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.js.map +0 -1
  80. package/lib/__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.d.ts.map +0 -1
  81. package/lib/__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.js +0 -21
  82. package/lib/__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.js.map +0 -1
  83. package/lib/components/DSL_DataSpace_Icon.d.ts.map +0 -1
  84. package/lib/components/DSL_DataSpace_Icon.js.map +0 -1
  85. package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.d.ts +0 -29
  86. package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.d.ts.map +0 -1
  87. package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js +0 -242
  88. package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js.map +0 -1
  89. package/lib/components/query/DSL_DataSpace_LegendQueryDocumentation.d.ts.map +0 -1
  90. package/lib/components/query/DSL_DataSpace_LegendQueryDocumentation.js.map +0 -1
  91. package/lib/components/query/DataSpaceAdvancedSearchModal.d.ts.map +0 -1
  92. package/lib/components/query/DataSpaceAdvancedSearchModal.js.map +0 -1
  93. package/lib/components/query/DataSpaceQueryBuilder.d.ts.map +0 -1
  94. package/lib/components/query/DataSpaceQueryBuilder.js.map +0 -1
  95. package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts.map +0 -1
  96. package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.js.map +0 -1
  97. package/lib/components/query/DataSpaceQueryCreator.d.ts +0 -19
  98. package/lib/components/query/DataSpaceQueryCreator.d.ts.map +0 -1
  99. package/lib/components/query/DataSpaceQueryCreator.js +0 -41
  100. package/lib/components/query/DataSpaceQueryCreator.js.map +0 -1
  101. package/lib/components/query/DataSpaceQuerySetup.d.ts +0 -21
  102. package/lib/components/query/DataSpaceQuerySetup.d.ts.map +0 -1
  103. package/lib/components/query/DataSpaceQuerySetup.js +0 -63
  104. package/lib/components/query/DataSpaceQuerySetup.js.map +0 -1
  105. package/lib/components/query/DataSpaceTemplateQueryCreator.d.ts +0 -19
  106. package/lib/components/query/DataSpaceTemplateQueryCreator.d.ts.map +0 -1
  107. package/lib/components/query/DataSpaceTemplateQueryCreator.js +0 -37
  108. package/lib/components/query/DataSpaceTemplateQueryCreator.js.map +0 -1
  109. package/lib/components/query/QueryDataSpaceUtil.d.ts.map +0 -1
  110. package/lib/components/query/QueryDataSpaceUtil.js.map +0 -1
  111. package/lib/components/query/index.d.ts.map +0 -1
  112. package/lib/components/query/index.js.map +0 -1
  113. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts +0 -39
  114. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts.map +0 -1
  115. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js +0 -207
  116. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js.map +0 -1
  117. package/lib/components/studio/DataSpacePreviewAction.d.ts +0 -25
  118. package/lib/components/studio/DataSpacePreviewAction.d.ts.map +0 -1
  119. package/lib/components/studio/DataSpacePreviewAction.js +0 -53
  120. package/lib/components/studio/DataSpacePreviewAction.js.map +0 -1
  121. package/lib/components/studio/DataSpaceQueryAction.d.ts +0 -22
  122. package/lib/components/studio/DataSpaceQueryAction.d.ts.map +0 -1
  123. package/lib/components/studio/DataSpaceQueryAction.js +0 -29
  124. package/lib/components/studio/DataSpaceQueryAction.js.map +0 -1
  125. package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.d.ts +0 -19
  126. package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.d.ts.map +0 -1
  127. package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.js +0 -81
  128. package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.js.map +0 -1
  129. package/lib/components/studio/index.d.ts +0 -17
  130. package/lib/components/studio/index.d.ts.map +0 -1
  131. package/lib/components/studio/index.js +0 -17
  132. package/lib/components/studio/index.js.map +0 -1
  133. package/lib/stores/query/DataSpaceInfo.d.ts.map +0 -1
  134. package/lib/stores/query/DataSpaceInfo.js.map +0 -1
  135. package/lib/stores/query/DataSpaceQueryBuilderState.d.ts.map +0 -1
  136. package/lib/stores/query/DataSpaceQueryBuilderState.js.map +0 -1
  137. package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts +0 -38
  138. package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts.map +0 -1
  139. package/lib/stores/query/DataSpaceQueryCreatorStore.js +0 -149
  140. package/lib/stores/query/DataSpaceQueryCreatorStore.js.map +0 -1
  141. package/lib/stores/query/DataSpaceQuerySetupStore.d.ts +0 -51
  142. package/lib/stores/query/DataSpaceQuerySetupStore.d.ts.map +0 -1
  143. package/lib/stores/query/DataSpaceQuerySetupStore.js +0 -107
  144. package/lib/stores/query/DataSpaceQuerySetupStore.js.map +0 -1
  145. package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.d.ts +0 -35
  146. package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.d.ts.map +0 -1
  147. package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.js +0 -108
  148. package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.js.map +0 -1
  149. package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.d.ts +0 -61
  150. package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.d.ts.map +0 -1
  151. package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.js +0 -407
  152. package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.js.map +0 -1
  153. package/lib/stores/studio/DataSpacePreviewState.d.ts +0 -33
  154. package/lib/stores/studio/DataSpacePreviewState.d.ts.map +0 -1
  155. package/lib/stores/studio/DataSpacePreviewState.js +0 -117
  156. package/lib/stores/studio/DataSpacePreviewState.js.map +0 -1
  157. package/src/__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.ts +0 -54
  158. package/src/__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.ts +0 -20
  159. package/src/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.tsx +0 -445
  160. package/src/components/query/DataSpaceQueryCreator.tsx +0 -99
  161. package/src/components/query/DataSpaceQuerySetup.tsx +0 -165
  162. package/src/components/query/DataSpaceTemplateQueryCreator.tsx +0 -82
  163. package/src/components/query/index.ts +0 -17
  164. package/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx +0 -297
  165. package/src/components/studio/DataSpacePreviewAction.tsx +0 -136
  166. package/src/components/studio/DataSpaceQueryAction.tsx +0 -34
  167. package/src/components/studio/DataSpaceTemplateQueryPromoteReview.tsx +0 -292
  168. package/src/stores/query/DataSpaceQueryCreatorStore.ts +0 -308
  169. package/src/stores/query/DataSpaceQuerySetupStore.ts +0 -205
  170. package/src/stores/query/DataSpaceTemplateQueryCreatorStore.ts +0 -207
  171. package/src/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.ts +0 -636
  172. package/src/stores/studio/DataSpacePreviewState.ts +0 -195
  173. /package/lib/components/{query → query-builder}/DataSpaceAdvancedSearchModal.d.ts +0 -0
  174. /package/lib/components/{query → query-builder}/DataSpaceAdvancedSearchModal.js +0 -0
  175. /package/lib/components/{query → query-builder}/QueryDataSpaceUtil.d.ts +0 -0
  176. /package/lib/components/{query → query-builder}/QueryDataSpaceUtil.js +0 -0
  177. /package/lib/components/{DSL_DataSpace_Icon.d.ts → shared/DSL_DataSpace_Icon.d.ts} +0 -0
  178. /package/lib/components/{DSL_DataSpace_Icon.js → shared/DSL_DataSpace_Icon.js} +0 -0
  179. /package/lib/stores/{query → shared}/DataSpaceInfo.d.ts +0 -0
  180. /package/lib/stores/{query → shared}/DataSpaceInfo.js +0 -0
  181. /package/src/components/{query → query-builder}/QueryDataSpaceUtil.ts +0 -0
  182. /package/src/components/{DSL_DataSpace_Icon.tsx → shared/DSL_DataSpace_Icon.tsx} +0 -0
  183. /package/src/stores/{query → shared}/DataSpaceInfo.ts +0 -0
@@ -1,33 +0,0 @@
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
- import { EditorExtensionState, type EditorStore } from '@finos/legend-application-studio';
17
- import { type GeneratorFn, ActionState } from '@finos/legend-shared';
18
- import type { DataSpace } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
19
- import { DataSpaceViewerState } from '../DataSpaceViewerState.js';
20
- export declare class DataSpacePreviewState extends EditorExtensionState {
21
- private static readonly IDENTIFIER;
22
- readonly editorStore: EditorStore;
23
- readonly loadDataSpaceState: ActionState;
24
- dataSpace?: DataSpace | undefined;
25
- dataSpaceViewerState?: DataSpaceViewerState | undefined;
26
- constructor(editorStore: EditorStore);
27
- get INTERNAL__identifierKey(): string;
28
- static retrieveNullableState(editorStore: EditorStore): DataSpacePreviewState | undefined;
29
- static retrieveState(editorStore: EditorStore): DataSpacePreviewState;
30
- setDataSpace(val: DataSpace | undefined): void;
31
- previewDataSpace(dataSpace: DataSpace): GeneratorFn<void>;
32
- }
33
- //# sourceMappingURL=DataSpacePreviewState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataSpacePreviewState.d.ts","sourceRoot":"","sources":["../../../src/stores/studio/DataSpacePreviewState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,oBAAoB,EAEpB,KAAK,WAAW,EACjB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,KAAK,WAAW,EAEhB,WAAW,EAEZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2FAA2F,CAAC;AAG3H,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIlE,qBAAa,qBAAsB,SAAQ,oBAAoB;IAC7D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAwB;IAE1D,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,kBAAkB,cAAwB;IAEnD,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;gBAE5C,WAAW,EAAE,WAAW;IAapC,IAAa,uBAAuB,IAAI,MAAM,CAE7C;IAED,MAAM,CAAC,qBAAqB,CAC1B,WAAW,EAAE,WAAW,GACvB,qBAAqB,GAAG,SAAS;IAqBpC,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,WAAW,GAAG,qBAAqB;IAOrE,YAAY,CAAC,GAAG,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI;IAO7C,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC;CAgG3D"}
@@ -1,117 +0,0 @@
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
- import { EditorExtensionState, queryClass, } from '@finos/legend-application-studio';
17
- import { guaranteeNonNullable, ActionState, assertErrorThrown, } from '@finos/legend-shared';
18
- import { action, flow, makeObservable, observable } from 'mobx';
19
- import { DSL_DataSpace_getGraphManagerExtension } from '../../graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.js';
20
- import { DataSpaceViewerState } from '../DataSpaceViewerState.js';
21
- import { InMemoryGraphData } from '@finos/legend-graph';
22
- import { EXTERNAL_APPLICATION_NAVIGATION__generateServiceQueryCreatorUrl } from '../../__lib__/DSL_DataSpace_LegendApplicationNavigation.js';
23
- export class DataSpacePreviewState extends EditorExtensionState {
24
- static IDENTIFIER = 'data-space-preview';
25
- editorStore;
26
- loadDataSpaceState = ActionState.create();
27
- dataSpace;
28
- dataSpaceViewerState;
29
- constructor(editorStore) {
30
- super();
31
- makeObservable(this, {
32
- dataSpace: observable,
33
- dataSpaceViewerState: observable,
34
- setDataSpace: action,
35
- previewDataSpace: flow,
36
- });
37
- this.editorStore = editorStore;
38
- }
39
- get INTERNAL__identifierKey() {
40
- return DataSpacePreviewState.IDENTIFIER;
41
- }
42
- static retrieveNullableState(editorStore) {
43
- return editorStore.extensionStates.find((extensionState) => {
44
- if (
45
- /**
46
- * In development mode, when we make changes in certain areas like utils or base states, the following `instanceof`
47
- * check will fail as if there were multiple copies of the classes with the same name, this could be caused by either
48
- * React `fast-refresh` or `webpack HMR`; we didn't have time to really do a thorough debug here, as such,
49
- * we will just do a simple key check to match the right state to bypass the problem for development mode.
50
- */
51
- // eslint-disable-next-line no-process-env
52
- process.env.NODE_ENV === 'development') {
53
- return (extensionState.INTERNAL__identifierKey ===
54
- DataSpacePreviewState.IDENTIFIER);
55
- }
56
- return extensionState instanceof DataSpacePreviewState;
57
- });
58
- }
59
- static retrieveState(editorStore) {
60
- return guaranteeNonNullable(DataSpacePreviewState.retrieveNullableState(editorStore), `Can't find data space preview state: make sure it is added as an editor extension state`);
61
- }
62
- setDataSpace(val) {
63
- this.dataSpace = val;
64
- if (val === undefined) {
65
- this.dataSpaceViewerState = undefined;
66
- }
67
- }
68
- *previewDataSpace(dataSpace) {
69
- this.setDataSpace(dataSpace);
70
- this.loadDataSpaceState.inProgress();
71
- this.loadDataSpaceState.setMessage(`Initializing...`);
72
- try {
73
- const groupId = this.editorStore.projectConfigurationEditorState
74
- .currentProjectConfiguration.groupId;
75
- const artifactId = this.editorStore.projectConfigurationEditorState
76
- .currentProjectConfiguration.artifactId;
77
- const versionId = 'LOCAL';
78
- // analyze data space
79
- const analysisResult = (yield DSL_DataSpace_getGraphManagerExtension(this.editorStore.graphManagerState.graphManager).analyzeDataSpace(dataSpace.path, async () => this.editorStore.graphManagerState.graph.allOwnElements
80
- .map((element) => this.editorStore.graphManagerState.graphManager.elementToEntity(element))
81
- .concat(this.editorStore.graphManagerState.graph.dependencyManager.allOwnElements.map((element) => this.editorStore.graphManagerState.graphManager.elementToEntity(element))), undefined, this.loadDataSpaceState));
82
- this.dataSpaceViewerState = new DataSpaceViewerState(this.editorStore.applicationStore, this.editorStore.graphManagerState, groupId, artifactId, versionId, analysisResult, {
83
- retrieveGraphData: () => new InMemoryGraphData(this.editorStore.graphManagerState.graph),
84
- queryDataSpace: () => {
85
- this.editorStore.applicationStore.notificationService.notifyWarning('This feature is not supported in preview mode');
86
- },
87
- viewProject: () => {
88
- this.editorStore.applicationStore.notificationService.notifyWarning('This feature is not supported in preview mode');
89
- },
90
- viewSDLCProject: async () => {
91
- this.editorStore.applicationStore.notificationService.notifyWarning('This feature is not supported in preview mode');
92
- },
93
- queryClass: (_class) => {
94
- queryClass(_class, this.editorStore).catch(this.editorStore.applicationStore.alertUnhandledError);
95
- },
96
- openServiceQuery: (servicePath) => {
97
- if (this.editorStore.applicationStore.config.queryApplicationUrl) {
98
- this.editorStore.applicationStore.navigationService.navigator.visitAddress(EXTERNAL_APPLICATION_NAVIGATION__generateServiceQueryCreatorUrl(this.editorStore.applicationStore.config.queryApplicationUrl, groupId, artifactId, versionId, servicePath));
99
- }
100
- else {
101
- this.editorStore.applicationStore.notificationService.notifyWarning('Query application URL is not configured');
102
- }
103
- },
104
- });
105
- this.loadDataSpaceState.pass();
106
- }
107
- catch (error) {
108
- assertErrorThrown(error);
109
- this.loadDataSpaceState.fail();
110
- this.editorStore.applicationStore.notificationService.notifyError(error);
111
- }
112
- finally {
113
- this.loadDataSpaceState.setMessage(undefined);
114
- }
115
- }
116
- }
117
- //# sourceMappingURL=DataSpacePreviewState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataSpacePreviewState.js","sourceRoot":"","sources":["../../../src/stores/studio/DataSpacePreviewState.ts"],"names":[],"mappings":"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"}
@@ -1,54 +0,0 @@
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 const SIMPLE_DATA_SPACE_SNIPPET = `DataSpace \${1:model::NewDataSpace}
18
- {
19
- executionContexts:
20
- [
21
- {
22
- name: '\${5:Some Context}';
23
- title: 'New Execution Context';
24
- description: 'some information about the execution context';
25
- mapping: \${6:model::SomeMapping};
26
- defaultRuntime: \${7:model::SomeRuntime};
27
- }
28
- ];
29
- defaultExecutionContext: '\${5:Some Context}';
30
- // description: 'description of the data models';
31
- // diagrams:
32
- // [
33
- // {
34
- // title: 'Some Diagram';
35
- // description: 'some diagram';
36
- // diagram: model::SomeDiagram;
37
- // }
38
- // ];
39
- // elements:
40
- // [
41
- // model::SomeClass,
42
- // ];
43
- // executables:
44
- // [
45
- // {
46
- // title: 'Some Executable';
47
- // description: 'some executable';
48
- // executable: model::SomeExecutable;
49
- // }
50
- // ];
51
- // supportInfo: Email {
52
- // address: 'someEmail@test.org';
53
- // };
54
- }`;
@@ -1,20 +0,0 @@
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 enum DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY {
18
- GRAMMAR_PARSER = 'dsl-dataspace.grammar.parser',
19
- CONCEPT_ELEMENT_DATA_SPACE = 'dsl-dataspace.concept.element.data-space',
20
- }
@@ -1,445 +0,0 @@
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
- import packageJson from '../../../package.json' assert { type: 'json' };
18
- import {
19
- type ExistingQueryEditorStateBuilder,
20
- type QueryEditorStore,
21
- type QuerySetupActionConfiguration,
22
- ExistingQueryEditorStore,
23
- LegendQueryApplicationPlugin,
24
- LEGEND_QUERY_APP_EVENT,
25
- createViewProjectHandler,
26
- createViewSDLCProjectHandler,
27
- type QueryEditorActionConfiguration,
28
- type NewQueryNavigationPath,
29
- } from '@finos/legend-application-query';
30
- import { ArrowCircleUpIcon, SquareIcon } from '@finos/legend-art';
31
- import {
32
- ActionAlertActionType,
33
- ActionAlertType,
34
- type ApplicationPageEntry,
35
- } from '@finos/legend-application';
36
- import {
37
- DATA_SPACE_QUERY_ROUTE_PATTERN,
38
- generateDataSpaceQueryCreatorRoute,
39
- generateDataSpaceQuerySetupRoute,
40
- generateDataSpaceTemplateQueryPromotionRoute,
41
- } from '../../__lib__/query/DSL_DataSpace_LegendQueryNavigation.js';
42
- import { DataSpaceQueryCreator } from './DataSpaceQueryCreator.js';
43
- import {
44
- type Query,
45
- type Mapping,
46
- type PackageableRuntime,
47
- } from '@finos/legend-graph';
48
- import {
49
- DataSpaceQueryBuilderState,
50
- DataSpaceProjectInfo,
51
- } from '../../stores/query/DataSpaceQueryBuilderState.js';
52
- import type { DataSpaceInfo } from '../../stores/query/DataSpaceInfo.js';
53
- import { getOwnDataSpace } from '../../graph-manager/DSL_DataSpace_GraphManagerHelper.js';
54
- import {
55
- assertErrorThrown,
56
- buildUrl,
57
- guaranteeNonNullable,
58
- LogEvent,
59
- } from '@finos/legend-shared';
60
- import type { QueryBuilderState } from '@finos/legend-query-builder';
61
- import { DataSpaceQuerySetup } from './DataSpaceQuerySetup.js';
62
- import { DSL_DataSpace_getGraphManagerExtension } from '../../graph-manager/protocol/pure/DSL_DataSpace_PureGraphManagerExtension.js';
63
- import {
64
- LATEST_VERSION_ALIAS,
65
- StoreProjectData,
66
- } from '@finos/legend-server-depot';
67
- import { retrieveAnalyticsResultCache } from '../../graph-manager/action/analytics/DataSpaceAnalysisHelper.js';
68
- import { flowResult } from 'mobx';
69
- import type {
70
- DataSpace,
71
- DataSpaceExecutionContext,
72
- } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
73
- import { DataSpaceTemplateQueryCreator } from './DataSpaceTemplateQueryCreator.js';
74
- import { DataSpaceTemplateQueryCreatorStore } from '../../stores/query/DataSpaceTemplateQueryCreatorStore.js';
75
- import { parseProjectIdentifier } from '@finos/legend-storage';
76
- import { getDataSpaceQueryInfo } from './QueryDataSpaceUtil.js';
77
-
78
- const resolveExecutionContext = (
79
- dataSpace: DataSpace,
80
- queryMapping: Mapping,
81
- queryRuntime: PackageableRuntime,
82
- ): DataSpaceExecutionContext | undefined => {
83
- const matchingExecContexts = dataSpace.executionContexts.filter(
84
- (ec) => ec.mapping.value === queryMapping,
85
- );
86
- if (matchingExecContexts.length > 1) {
87
- const matchRuntime = matchingExecContexts.find(
88
- (exec) => exec.defaultRuntime.value.path === queryRuntime.path,
89
- );
90
- // TODO: we will safely do this for now. Long term we should save exec context key into query store
91
- // we should make runtime/mapping optional
92
- return matchRuntime ?? matchingExecContexts[0];
93
- }
94
- return matchingExecContexts[0];
95
- };
96
-
97
- export class DSL_DataSpace_LegendQueryApplicationPlugin extends LegendQueryApplicationPlugin {
98
- constructor() {
99
- super(packageJson.extensions.applicationQueryPlugin, packageJson.version);
100
- }
101
-
102
- override getExtraRootAppRedirectPath(): string | undefined {
103
- return DATA_SPACE_QUERY_ROUTE_PATTERN.SETUP;
104
- }
105
-
106
- override getExtraApplicationPageEntries(): ApplicationPageEntry[] {
107
- return [
108
- // data space query editor setup
109
- {
110
- key: 'data-space-query-setup-application-page',
111
- addressPatterns: [DATA_SPACE_QUERY_ROUTE_PATTERN.SETUP],
112
- renderer: DataSpaceQuerySetup,
113
- },
114
- // data space template query creator
115
- // Heads-up: TEMPLATE_QUERY must come before CREATE as it has a more specific pattern than CREATE.
116
- {
117
- key: 'data-space-template-query-viewer-application-page',
118
- addressPatterns: [DATA_SPACE_QUERY_ROUTE_PATTERN.TEMPLATE_QUERY],
119
- renderer: DataSpaceTemplateQueryCreator,
120
- },
121
- // data space query editor
122
- {
123
- key: 'data-space-query-editor-application-page',
124
- addressPatterns: [DATA_SPACE_QUERY_ROUTE_PATTERN.CREATE],
125
- renderer: DataSpaceQueryCreator,
126
- },
127
- ];
128
- }
129
-
130
- override getExtraQuerySetupActionConfigurations(): QuerySetupActionConfiguration[] {
131
- return [
132
- {
133
- key: 'create-query-from-data-space',
134
- isAdvanced: false,
135
- isCreateAction: true,
136
- action: async (setupStore) => {
137
- setupStore.applicationStore.navigationService.navigator.goToLocation(
138
- generateDataSpaceQuerySetupRoute(),
139
- );
140
- },
141
- label: 'Create query from data space',
142
- className: 'query-setup__landing-page__action--data-space',
143
- icon: (
144
- <SquareIcon className="query-setup__landing-page__icon--data-space" />
145
- ),
146
- },
147
- ];
148
- }
149
-
150
- override getExtraExistingQueryEditorStateBuilders(): ExistingQueryEditorStateBuilder[] {
151
- return [
152
- async (
153
- query: Query,
154
- editorStore: ExistingQueryEditorStore,
155
- ): Promise<QueryBuilderState | undefined> => {
156
- const dataSpacePath = getDataSpaceQueryInfo(query);
157
- if (dataSpacePath) {
158
- const dataSpace = getOwnDataSpace(
159
- dataSpacePath,
160
- editorStore.graphManagerState.graph,
161
- );
162
- const mapping = query.mapping.value;
163
- const matchingExecutionContext = resolveExecutionContext(
164
- dataSpace,
165
- mapping,
166
- query.runtime.value,
167
- );
168
- if (!matchingExecutionContext) {
169
- // if a matching execution context is not found, it means this query is not
170
- // properly created from a data space, therefore, we cannot support this case
171
- return undefined;
172
- }
173
- let dataSpaceAnalysisResult;
174
- try {
175
- const project = StoreProjectData.serialization.fromJson(
176
- await editorStore.depotServerClient.getProject(
177
- query.groupId,
178
- query.artifactId,
179
- ),
180
- );
181
- dataSpaceAnalysisResult =
182
- await DSL_DataSpace_getGraphManagerExtension(
183
- editorStore.graphManagerState.graphManager,
184
- ).retrieveDataSpaceAnalysisFromCache(() =>
185
- retrieveAnalyticsResultCache(
186
- project,
187
- query.versionId,
188
- dataSpace.path,
189
- editorStore.depotServerClient,
190
- ),
191
- );
192
- } catch {
193
- // do nothing
194
- }
195
- const projectInfo = new DataSpaceProjectInfo(
196
- query.groupId,
197
- query.artifactId,
198
- query.versionId,
199
- createViewProjectHandler(editorStore.applicationStore),
200
- createViewSDLCProjectHandler(
201
- editorStore.applicationStore,
202
- editorStore.depotServerClient,
203
- ),
204
- );
205
- const sourceInfo = {
206
- groupId: projectInfo.groupId,
207
- artifactId: projectInfo.artifactId,
208
- versionId: projectInfo.versionId,
209
- dataSpace: dataSpace.path,
210
- };
211
- const dataSpaceQueryBuilderState = new DataSpaceQueryBuilderState(
212
- editorStore.applicationStore,
213
- editorStore.graphManagerState,
214
- editorStore.depotServerClient,
215
- dataSpace,
216
- matchingExecutionContext,
217
- (dataSpaceInfo: DataSpaceInfo) => {
218
- if (dataSpaceInfo.defaultExecutionContext) {
219
- const proceed = (): void =>
220
- editorStore.applicationStore.navigationService.navigator.goToLocation(
221
- generateDataSpaceQueryCreatorRoute(
222
- guaranteeNonNullable(dataSpaceInfo.groupId),
223
- guaranteeNonNullable(dataSpaceInfo.artifactId),
224
- LATEST_VERSION_ALIAS, //always default to latest
225
- dataSpaceInfo.path,
226
- guaranteeNonNullable(
227
- dataSpaceInfo.defaultExecutionContext,
228
- ),
229
- undefined,
230
- undefined,
231
- ),
232
- );
233
- const updateQueryAndProceed = async (): Promise<void> => {
234
- try {
235
- await flowResult(
236
- editorStore.updateState.updateQuery(undefined, undefined),
237
- );
238
- proceed();
239
- } catch (error) {
240
- assertErrorThrown(error);
241
- editorStore.applicationStore.logService.error(
242
- LogEvent.create(LEGEND_QUERY_APP_EVENT.GENERIC_FAILURE),
243
- error,
244
- );
245
- editorStore.applicationStore.notificationService.notifyError(
246
- error,
247
- );
248
- }
249
- };
250
- if (
251
- !query.isCurrentUserQuery ||
252
- !editorStore.queryBuilderState?.changeDetectionState
253
- .hasChanged
254
- ) {
255
- proceed();
256
- } else {
257
- editorStore.applicationStore.alertService.setActionAlertInfo({
258
- message: `To change the data space, you need to save the current query
259
- to proceed`,
260
- type: ActionAlertType.CAUTION,
261
- actions: [
262
- {
263
- label: 'Save query and Proceed',
264
- type: ActionAlertActionType.PROCEED_WITH_CAUTION,
265
- handler: () => {
266
- updateQueryAndProceed().catch(
267
- editorStore.applicationStore.alertUnhandledError,
268
- );
269
- },
270
- },
271
- {
272
- label: 'Abort',
273
- type: ActionAlertActionType.PROCEED,
274
- default: true,
275
- },
276
- ],
277
- });
278
- }
279
- } else {
280
- editorStore.applicationStore.notificationService.notifyWarning(
281
- `Can't switch data space: default execution context not specified`,
282
- );
283
- }
284
- },
285
- true,
286
- dataSpaceAnalysisResult,
287
- undefined,
288
- undefined,
289
- undefined,
290
- projectInfo,
291
- editorStore.applicationStore.config.options.queryBuilderConfig,
292
- sourceInfo,
293
- );
294
- const mappingModelCoverageAnalysisResult =
295
- dataSpaceAnalysisResult?.executionContextsIndex.get(
296
- matchingExecutionContext.name,
297
- )?.mappingModelCoverageAnalysisResult;
298
- if (mappingModelCoverageAnalysisResult) {
299
- dataSpaceQueryBuilderState.explorerState.mappingModelCoverageAnalysisResult =
300
- mappingModelCoverageAnalysisResult;
301
- }
302
- return dataSpaceQueryBuilderState;
303
- }
304
- return undefined;
305
- },
306
- ];
307
- }
308
-
309
- override getExtraNewQueryNavigationPaths(): NewQueryNavigationPath[] {
310
- return [
311
- (
312
- query: Query,
313
- editorStore: ExistingQueryEditorStore,
314
- ): string | undefined => {
315
- const dataSpacePath = getDataSpaceQueryInfo(query);
316
- const queryBuilderState = editorStore.queryBuilderState;
317
- if (
318
- dataSpacePath &&
319
- queryBuilderState instanceof DataSpaceQueryBuilderState
320
- ) {
321
- queryBuilderState.executionContext.name;
322
- return generateDataSpaceQueryCreatorRoute(
323
- query.groupId,
324
- query.artifactId,
325
- query.versionId,
326
- dataSpacePath,
327
- // TODO: fix execution key once that is fixed
328
- queryBuilderState.executionContext.name,
329
- undefined,
330
- undefined,
331
- );
332
- }
333
- return undefined;
334
- },
335
- ];
336
- }
337
-
338
- override getExtraQueryHeaders(): ((
339
- editorStore: QueryEditorStore,
340
- ) => React.ReactNode | undefined)[] {
341
- return [
342
- (editorStore: QueryEditorStore): React.ReactNode | undefined => {
343
- if (editorStore instanceof DataSpaceTemplateQueryCreatorStore) {
344
- return (
345
- <div className="query-editor__dataspace__header">
346
- <div className="query-editor__header__content__main query-editor__header__content__title__text query-editor__dataspace__header__title__text">
347
- {editorStore.templateQueryTitle}
348
- </div>
349
- <div className="query-editor__dataspace__header__title__tag">
350
- template
351
- </div>
352
- </div>
353
- );
354
- }
355
- return undefined;
356
- },
357
- ];
358
- }
359
-
360
- override getExtraQueryEditorActionConfigurations(): QueryEditorActionConfiguration[] {
361
- return [
362
- {
363
- key: 'promote-as-curated-template-query',
364
- renderer: (editorStore, queryBuilderState) => {
365
- const proceedCuratedTemplateQueryPromotion =
366
- async (): Promise<void> => {
367
- if (
368
- !(
369
- editorStore instanceof ExistingQueryEditorStore &&
370
- queryBuilderState instanceof DataSpaceQueryBuilderState
371
- )
372
- ) {
373
- return;
374
- }
375
- // fetch project data
376
- const project = StoreProjectData.serialization.fromJson(
377
- await editorStore.depotServerClient.getProject(
378
- editorStore.lightQuery.groupId,
379
- editorStore.lightQuery.artifactId,
380
- ),
381
- );
382
-
383
- // find the matching SDLC instance
384
- const projectIDPrefix = parseProjectIdentifier(
385
- project.projectId,
386
- ).prefix;
387
- const matchingSDLCEntry =
388
- editorStore.applicationStore.config.studioInstances.find(
389
- (entry) => entry.sdlcProjectIDPrefix === projectIDPrefix,
390
- );
391
- if (matchingSDLCEntry) {
392
- editorStore.applicationStore.navigationService.navigator.visitAddress(
393
- buildUrl([
394
- editorStore.applicationStore.config.studioApplicationUrl,
395
- generateDataSpaceTemplateQueryPromotionRoute(
396
- editorStore.lightQuery.groupId,
397
- editorStore.lightQuery.artifactId,
398
- editorStore.lightQuery.versionId,
399
- queryBuilderState.dataSpace.path,
400
- editorStore.lightQuery.id,
401
- ),
402
- ]),
403
- );
404
- } else {
405
- editorStore.applicationStore.notificationService.notifyWarning(
406
- `Can't find the corresponding SDLC instance to productionize the query`,
407
- );
408
- }
409
- };
410
-
411
- const proceed = (): void => {
412
- queryBuilderState.changeDetectionState.alertUnsavedChanges(() => {
413
- proceedCuratedTemplateQueryPromotion().catch(
414
- editorStore.applicationStore.alertUnhandledError,
415
- );
416
- });
417
- };
418
-
419
- return (
420
- <>
421
- {editorStore instanceof ExistingQueryEditorStore &&
422
- queryBuilderState instanceof DataSpaceQueryBuilderState && (
423
- <button
424
- className="query-editor__header__action btn--dark"
425
- tabIndex={-1}
426
- onClick={proceed}
427
- title={
428
- !(editorStore instanceof ExistingQueryEditorStore)
429
- ? 'Please save your query first before promoting'
430
- : 'Promote Curated Template query...'
431
- }
432
- >
433
- <ArrowCircleUpIcon className="query-editor__header__action__icon--productionize" />
434
- <div className="query-editor__header__action__label">
435
- Promote as Template Query
436
- </div>
437
- </button>
438
- )}
439
- </>
440
- );
441
- },
442
- },
443
- ];
444
- }
445
- }