@finos/legend-extension-dsl-data-space 10.2.4 → 10.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/{components → __lib__}/query/DSL_DataSpace_LegendQueryDocumentation.d.ts +1 -1
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryDocumentation.d.ts.map +1 -0
- package/lib/{components → __lib__}/query/DSL_DataSpace_LegendQueryDocumentation.js +4 -4
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryDocumentation.js.map +1 -0
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts +0 -12
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts.map +1 -1
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.js +0 -12
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.js.map +1 -1
- package/lib/__lib__/shared/DSL_DataSpace_LegendNavigation.d.ts +15 -0
- package/lib/__lib__/shared/DSL_DataSpace_LegendNavigation.d.ts.map +1 -0
- package/lib/__lib__/shared/DSL_DataSpace_LegendNavigation.js +32 -0
- package/lib/__lib__/shared/DSL_DataSpace_LegendNavigation.js.map +1 -0
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +1 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
- package/lib/components/index.d.ts +4 -2
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +4 -2
- package/lib/components/index.js.map +1 -1
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js +3 -2
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js.map +1 -1
- package/lib/components/query/DataSpaceQueryBuilder.d.ts +2 -5
- package/lib/components/query/DataSpaceQueryBuilder.d.ts.map +1 -1
- package/lib/components/query/DataSpaceQueryBuilder.js +5 -24
- package/lib/components/query/DataSpaceQueryBuilder.js.map +1 -1
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts +1 -1
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts.map +1 -1
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.js +2 -2
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.js.map +1 -1
- package/lib/components/query/DataSpaceQuerySetup.js +1 -1
- package/lib/components/query/DataSpaceQuerySetup.js.map +1 -1
- package/lib/components/shared/DSL_DataSpace_Icon.d.ts.map +1 -0
- package/lib/components/shared/DSL_DataSpace_Icon.js.map +1 -0
- package/lib/graph-manager/index.d.ts +3 -0
- package/lib/graph-manager/index.d.ts.map +1 -1
- package/lib/graph-manager/index.js +4 -0
- package/lib/graph-manager/index.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -4
- package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts +1 -1
- package/lib/stores/query/DataSpaceAdvancedSearchState.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceAdvancedSearchState.js +1 -1
- package/lib/stores/query/DataSpaceAdvancedSearchState.js.map +1 -1
- package/lib/stores/query/DataSpaceQueryCreatorStore.js +1 -1
- package/lib/stores/query/DataSpaceQueryCreatorStore.js.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.d.ts +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.d.ts.map +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.js +1 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.js.map +1 -1
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.js +1 -1
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.js.map +1 -1
- package/lib/stores/{query → query-builder}/DataSpaceQueryBuilderState.d.ts +2 -2
- package/lib/stores/query-builder/DataSpaceQueryBuilderState.d.ts.map +1 -0
- package/lib/stores/{query → query-builder}/DataSpaceQueryBuilderState.js +2 -2
- package/lib/stores/query-builder/DataSpaceQueryBuilderState.js.map +1 -0
- package/lib/stores/shared/DataSpaceInfo.d.ts.map +1 -0
- package/lib/stores/shared/DataSpaceInfo.js.map +1 -0
- package/package.json +1 -4
- package/src/{components → __lib__}/query/DSL_DataSpace_LegendQueryDocumentation.ts +1 -1
- package/src/__lib__/query/DSL_DataSpace_LegendQueryNavigation.ts +0 -34
- package/src/__lib__/shared/DSL_DataSpace_LegendNavigation.ts +57 -0
- package/src/components/DSL_DataSpace_LegendApplicationPlugin.tsx +1 -1
- package/src/components/index.ts +6 -2
- package/src/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.tsx +3 -3
- package/src/components/query/DataSpaceAdvancedSearchModal.tsx +1 -1
- package/src/components/query/DataSpaceQueryBuilder.tsx +7 -68
- package/src/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.tsx +3 -3
- package/src/components/query/DataSpaceQuerySetup.tsx +1 -1
- package/src/graph-manager/index.ts +5 -0
- package/src/stores/query/DataSpaceAdvancedSearchState.ts +4 -1
- package/src/stores/query/DataSpaceQueryCreatorStore.ts +2 -2
- package/src/stores/query/DataSpaceQuerySetupStore.ts +4 -1
- package/src/stores/query/DataSpaceTemplateQueryCreatorStore.ts +2 -2
- package/src/stores/{query → query-builder}/DataSpaceQueryBuilderState.ts +5 -2
- package/tsconfig.json +5 -13
- package/lib/__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.d.ts +0 -17
- package/lib/__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.d.ts.map +0 -1
- package/lib/__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.js +0 -54
- package/lib/__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.js.map +0 -1
- package/lib/__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.d.ts +0 -20
- package/lib/__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.d.ts.map +0 -1
- package/lib/__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.js +0 -21
- package/lib/__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.js.map +0 -1
- package/lib/components/DSL_DataSpace_Icon.d.ts.map +0 -1
- package/lib/components/DSL_DataSpace_Icon.js.map +0 -1
- package/lib/components/query/DSL_DataSpace_LegendQueryDocumentation.d.ts.map +0 -1
- package/lib/components/query/DSL_DataSpace_LegendQueryDocumentation.js.map +0 -1
- package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts +0 -39
- package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts.map +0 -1
- package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js +0 -207
- package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js.map +0 -1
- package/lib/components/studio/DataSpacePreviewAction.d.ts +0 -25
- package/lib/components/studio/DataSpacePreviewAction.d.ts.map +0 -1
- package/lib/components/studio/DataSpacePreviewAction.js +0 -53
- package/lib/components/studio/DataSpacePreviewAction.js.map +0 -1
- package/lib/components/studio/DataSpaceQueryAction.d.ts +0 -22
- package/lib/components/studio/DataSpaceQueryAction.d.ts.map +0 -1
- package/lib/components/studio/DataSpaceQueryAction.js +0 -29
- package/lib/components/studio/DataSpaceQueryAction.js.map +0 -1
- package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.d.ts +0 -19
- package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.d.ts.map +0 -1
- package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.js +0 -81
- package/lib/components/studio/DataSpaceTemplateQueryPromoteReview.js.map +0 -1
- package/lib/components/studio/index.d.ts +0 -17
- package/lib/components/studio/index.d.ts.map +0 -1
- package/lib/components/studio/index.js +0 -17
- package/lib/components/studio/index.js.map +0 -1
- package/lib/stores/query/DataSpaceInfo.d.ts.map +0 -1
- package/lib/stores/query/DataSpaceInfo.js.map +0 -1
- package/lib/stores/query/DataSpaceQueryBuilderState.d.ts.map +0 -1
- package/lib/stores/query/DataSpaceQueryBuilderState.js.map +0 -1
- package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.d.ts +0 -61
- package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.d.ts.map +0 -1
- package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.js +0 -407
- package/lib/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.js.map +0 -1
- package/lib/stores/studio/DataSpacePreviewState.d.ts +0 -33
- package/lib/stores/studio/DataSpacePreviewState.d.ts.map +0 -1
- package/lib/stores/studio/DataSpacePreviewState.js +0 -117
- package/lib/stores/studio/DataSpacePreviewState.js.map +0 -1
- package/src/__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.ts +0 -54
- package/src/__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.ts +0 -20
- package/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx +0 -297
- package/src/components/studio/DataSpacePreviewAction.tsx +0 -136
- package/src/components/studio/DataSpaceQueryAction.tsx +0 -34
- package/src/components/studio/DataSpaceTemplateQueryPromoteReview.tsx +0 -292
- package/src/components/studio/index.ts +0 -17
- package/src/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.ts +0 -636
- package/src/stores/studio/DataSpacePreviewState.ts +0 -195
- /package/lib/components/{DSL_DataSpace_Icon.d.ts → shared/DSL_DataSpace_Icon.d.ts} +0 -0
- /package/lib/components/{DSL_DataSpace_Icon.js → shared/DSL_DataSpace_Icon.js} +0 -0
- /package/lib/stores/{query → shared}/DataSpaceInfo.d.ts +0 -0
- /package/lib/stores/{query → shared}/DataSpaceInfo.js +0 -0
- /package/src/components/{DSL_DataSpace_Icon.tsx → shared/DSL_DataSpace_Icon.tsx} +0 -0
- /package/src/stores/{query → shared}/DataSpaceInfo.ts +0 -0
@@ -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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CAAC,gBAAgB,CAAC,MAAM,CAAC,mBAAmB,EAAE;wBAChE,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,SAAS,CAAC,YAAY,CACxE,+DAA+D,CAC7D,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,MAAM,CAAC,mBAAmB,EAC5D,OAAO,EACP,UAAU,EACV,SAAS,EACT,WAAW,CACZ,CACF,CAAC;qBACH;yBAAM;wBACL,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,aAAa,CACjE,yCAAyC,CAC1C,CAAC;qBACH;gBACH,CAAC;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,WAAW,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SAC1E;gBAAS;YACR,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;SAC/C;IACH,CAAC"}
|
@@ -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,297 +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 NewElementFromStateCreator,
|
20
|
-
type ElementClassifier,
|
21
|
-
type DragElementClassifier,
|
22
|
-
type ElementIconGetter,
|
23
|
-
type DSL_LegendStudioApplicationPlugin_Extension,
|
24
|
-
type NewElementState,
|
25
|
-
type ElementEditorStateCreator,
|
26
|
-
type EditorStore,
|
27
|
-
type ElementEditorState,
|
28
|
-
type PureGrammarParserElementDocumentationGetter,
|
29
|
-
type PureGrammarParserDocumentationGetter,
|
30
|
-
type PureGrammarParserKeywordSuggestionGetter,
|
31
|
-
type PureGrammarParserElementSnippetSuggestionsGetter,
|
32
|
-
UnsupportedElementEditorState,
|
33
|
-
LegendStudioApplicationPlugin,
|
34
|
-
type ExplorerContextMenuItemRendererConfiguration,
|
35
|
-
type EditorExtensionStateBuilder,
|
36
|
-
type EditorExtensionComponentRendererConfiguration,
|
37
|
-
PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY,
|
38
|
-
} from '@finos/legend-application-studio';
|
39
|
-
import {
|
40
|
-
PackageableElementExplicitReference,
|
41
|
-
stub_Mapping,
|
42
|
-
stub_PackageableRuntime,
|
43
|
-
type PackageableElement,
|
44
|
-
} from '@finos/legend-graph';
|
45
|
-
import {
|
46
|
-
DataSpace,
|
47
|
-
DataSpaceExecutionContext,
|
48
|
-
} from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
49
|
-
import { DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY } from '../../__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.js';
|
50
|
-
import { SIMPLE_DATA_SPACE_SNIPPET } from '../../__lib__/studio/DSL_DataSpace_LegendStudioCodeSnippet.js';
|
51
|
-
import type {
|
52
|
-
ApplicationPageEntry,
|
53
|
-
DocumentationEntry,
|
54
|
-
} from '@finos/legend-application';
|
55
|
-
import { DataSpaceIcon } from '../DSL_DataSpace_Icon.js';
|
56
|
-
import { DataSpacePreviewState } from '../../stores/studio/DataSpacePreviewState.js';
|
57
|
-
import {
|
58
|
-
DataSpacePreviewDialog,
|
59
|
-
DataSpacePreviewAction,
|
60
|
-
} from './DataSpacePreviewAction.js';
|
61
|
-
import type { PureGrammarTextSuggestion } from '@finos/legend-lego/code-editor';
|
62
|
-
import { DataSpaceQueryAction } from './DataSpaceQueryAction.js';
|
63
|
-
import { DataSpaceTemplateQueryPromotionReviewer } from './DataSpaceTemplateQueryPromoteReview.js';
|
64
|
-
import { DATA_SPACE_QUERY_ROUTE_PATTERN } from '../../__lib__/query/DSL_DataSpace_LegendQueryNavigation.js';
|
65
|
-
|
66
|
-
const DATA_SPACE_ELEMENT_TYPE = 'DATA SPACE';
|
67
|
-
const DATA_SPACE_ELEMENT_PROJECT_EXPLORER_DND_TYPE =
|
68
|
-
'PROJECT_EXPLORER_DATA_SPACE';
|
69
|
-
|
70
|
-
const PURE_GRAMMAR_DATA_SPACE_PARSER_NAME = 'DataSpace';
|
71
|
-
const PURE_GRAMMAR_DATA_SPACE_ELEMENT_TYPE_LABEL = 'DataSpace';
|
72
|
-
|
73
|
-
export class DSL_DataSpace_LegendStudioApplicationPlugin
|
74
|
-
extends LegendStudioApplicationPlugin
|
75
|
-
implements DSL_LegendStudioApplicationPlugin_Extension
|
76
|
-
{
|
77
|
-
constructor() {
|
78
|
-
super(packageJson.extensions.applicationStudioPlugin, packageJson.version);
|
79
|
-
}
|
80
|
-
|
81
|
-
override getExtraRequiredDocumentationKeys(): string[] {
|
82
|
-
return [
|
83
|
-
DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY.CONCEPT_ELEMENT_DATA_SPACE,
|
84
|
-
DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER,
|
85
|
-
];
|
86
|
-
}
|
87
|
-
|
88
|
-
override getExtraApplicationPageEntries(): ApplicationPageEntry[] {
|
89
|
-
return [
|
90
|
-
{
|
91
|
-
key: 'promote-as-curated-template-query-page',
|
92
|
-
addressPatterns: [
|
93
|
-
DATA_SPACE_QUERY_ROUTE_PATTERN.PROMOTE_TEMPLATE_QUERY,
|
94
|
-
],
|
95
|
-
renderer: DataSpaceTemplateQueryPromotionReviewer,
|
96
|
-
},
|
97
|
-
];
|
98
|
-
}
|
99
|
-
|
100
|
-
override getExtraExplorerContextMenuItemRendererConfigurations(): ExplorerContextMenuItemRendererConfiguration[] {
|
101
|
-
return [
|
102
|
-
{
|
103
|
-
key: 'data-space-query',
|
104
|
-
renderer: (editorStore, element) => {
|
105
|
-
if (element instanceof DataSpace) {
|
106
|
-
return <DataSpaceQueryAction dataSpace={element} />;
|
107
|
-
}
|
108
|
-
return undefined;
|
109
|
-
},
|
110
|
-
},
|
111
|
-
{
|
112
|
-
key: 'data-space-preview',
|
113
|
-
renderer: (editorStore, element) => {
|
114
|
-
if (element instanceof DataSpace) {
|
115
|
-
return <DataSpacePreviewAction dataSpace={element} />;
|
116
|
-
}
|
117
|
-
return undefined;
|
118
|
-
},
|
119
|
-
},
|
120
|
-
];
|
121
|
-
}
|
122
|
-
|
123
|
-
override getExtraEditorExtensionStateBuilders(): EditorExtensionStateBuilder[] {
|
124
|
-
return [(editorStore) => new DataSpacePreviewState(editorStore)];
|
125
|
-
}
|
126
|
-
|
127
|
-
override getExtraEditorExtensionComponentRendererConfigurations(): EditorExtensionComponentRendererConfiguration[] {
|
128
|
-
return [
|
129
|
-
{
|
130
|
-
key: 'data-space-preview',
|
131
|
-
renderer: (editorStore) => <DataSpacePreviewDialog />,
|
132
|
-
},
|
133
|
-
];
|
134
|
-
}
|
135
|
-
|
136
|
-
getExtraPureGrammarKeywords(): string[] {
|
137
|
-
return [PURE_GRAMMAR_DATA_SPACE_ELEMENT_TYPE_LABEL];
|
138
|
-
}
|
139
|
-
|
140
|
-
getExtraSupportedElementTypes(): string[] {
|
141
|
-
return [DATA_SPACE_ELEMENT_TYPE];
|
142
|
-
}
|
143
|
-
|
144
|
-
getExtraSupportedElementTypesWithCategory?(): Map<string, string[]> {
|
145
|
-
const elementTypesWithCategoryMap = new Map<string, string[]>();
|
146
|
-
elementTypesWithCategoryMap.set(
|
147
|
-
PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY.QUERY,
|
148
|
-
[DATA_SPACE_ELEMENT_TYPE],
|
149
|
-
);
|
150
|
-
return elementTypesWithCategoryMap;
|
151
|
-
}
|
152
|
-
|
153
|
-
getExtraElementClassifiers(): ElementClassifier[] {
|
154
|
-
return [
|
155
|
-
(element: PackageableElement): string | undefined => {
|
156
|
-
if (element instanceof DataSpace) {
|
157
|
-
return DATA_SPACE_ELEMENT_TYPE;
|
158
|
-
}
|
159
|
-
return undefined;
|
160
|
-
},
|
161
|
-
];
|
162
|
-
}
|
163
|
-
|
164
|
-
getExtraElementIconGetters(): ElementIconGetter[] {
|
165
|
-
return [
|
166
|
-
(type: string): React.ReactNode | undefined => {
|
167
|
-
if (type === DATA_SPACE_ELEMENT_TYPE) {
|
168
|
-
return <DataSpaceIcon />;
|
169
|
-
}
|
170
|
-
return undefined;
|
171
|
-
},
|
172
|
-
];
|
173
|
-
}
|
174
|
-
|
175
|
-
getExtraNewElementFromStateCreators(): NewElementFromStateCreator[] {
|
176
|
-
return [
|
177
|
-
(
|
178
|
-
type: string,
|
179
|
-
name: string,
|
180
|
-
state: NewElementState,
|
181
|
-
): PackageableElement | undefined => {
|
182
|
-
if (type === DATA_SPACE_ELEMENT_TYPE) {
|
183
|
-
const dataSpace = new DataSpace(name);
|
184
|
-
const dataSpaceExecutionContext = new DataSpaceExecutionContext();
|
185
|
-
dataSpaceExecutionContext.name = 'dummyContext';
|
186
|
-
dataSpaceExecutionContext.mapping =
|
187
|
-
PackageableElementExplicitReference.create(stub_Mapping());
|
188
|
-
dataSpaceExecutionContext.defaultRuntime =
|
189
|
-
PackageableElementExplicitReference.create(
|
190
|
-
stub_PackageableRuntime(),
|
191
|
-
);
|
192
|
-
dataSpace.executionContexts = [dataSpaceExecutionContext];
|
193
|
-
dataSpace.defaultExecutionContext = dataSpaceExecutionContext;
|
194
|
-
return dataSpace;
|
195
|
-
}
|
196
|
-
return undefined;
|
197
|
-
},
|
198
|
-
];
|
199
|
-
}
|
200
|
-
|
201
|
-
getExtraElementEditorStateCreators(): ElementEditorStateCreator[] {
|
202
|
-
return [
|
203
|
-
(
|
204
|
-
editorStore: EditorStore,
|
205
|
-
element: PackageableElement,
|
206
|
-
): ElementEditorState | undefined => {
|
207
|
-
if (element instanceof DataSpace) {
|
208
|
-
return new UnsupportedElementEditorState(editorStore, element);
|
209
|
-
}
|
210
|
-
return undefined;
|
211
|
-
},
|
212
|
-
];
|
213
|
-
}
|
214
|
-
|
215
|
-
getExtraDragElementClassifiers(): DragElementClassifier[] {
|
216
|
-
return [
|
217
|
-
(element: PackageableElement): string | undefined => {
|
218
|
-
if (element instanceof DataSpace) {
|
219
|
-
return DATA_SPACE_ELEMENT_PROJECT_EXPLORER_DND_TYPE;
|
220
|
-
}
|
221
|
-
return undefined;
|
222
|
-
},
|
223
|
-
];
|
224
|
-
}
|
225
|
-
|
226
|
-
getExtraPureGrammarTextEditorDragElementTypes(): string[] {
|
227
|
-
return [DATA_SPACE_ELEMENT_PROJECT_EXPLORER_DND_TYPE];
|
228
|
-
}
|
229
|
-
|
230
|
-
getExtraPureGrammarParserElementDocumentationGetters(): PureGrammarParserElementDocumentationGetter[] {
|
231
|
-
return [
|
232
|
-
(
|
233
|
-
editorStore: EditorStore,
|
234
|
-
parserKeyword: string,
|
235
|
-
elementKeyword: string,
|
236
|
-
): DocumentationEntry | undefined => {
|
237
|
-
if (parserKeyword === PURE_GRAMMAR_DATA_SPACE_PARSER_NAME) {
|
238
|
-
if (elementKeyword === PURE_GRAMMAR_DATA_SPACE_ELEMENT_TYPE_LABEL) {
|
239
|
-
return editorStore.applicationStore.documentationService.getDocEntry(
|
240
|
-
DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY.CONCEPT_ELEMENT_DATA_SPACE,
|
241
|
-
);
|
242
|
-
}
|
243
|
-
}
|
244
|
-
return undefined;
|
245
|
-
},
|
246
|
-
];
|
247
|
-
}
|
248
|
-
|
249
|
-
getExtraPureGrammarParserDocumentationGetters(): PureGrammarParserDocumentationGetter[] {
|
250
|
-
return [
|
251
|
-
(
|
252
|
-
editorStore: EditorStore,
|
253
|
-
parserKeyword: string,
|
254
|
-
): DocumentationEntry | undefined => {
|
255
|
-
if (parserKeyword === PURE_GRAMMAR_DATA_SPACE_PARSER_NAME) {
|
256
|
-
return editorStore.applicationStore.documentationService.getDocEntry(
|
257
|
-
DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER,
|
258
|
-
);
|
259
|
-
}
|
260
|
-
return undefined;
|
261
|
-
},
|
262
|
-
];
|
263
|
-
}
|
264
|
-
|
265
|
-
getExtraPureGrammarParserKeywordSuggestionGetters(): PureGrammarParserKeywordSuggestionGetter[] {
|
266
|
-
return [
|
267
|
-
(editorStore: EditorStore): PureGrammarTextSuggestion[] => [
|
268
|
-
{
|
269
|
-
text: PURE_GRAMMAR_DATA_SPACE_PARSER_NAME,
|
270
|
-
description: `(dsl)`,
|
271
|
-
documentation:
|
272
|
-
editorStore.applicationStore.documentationService.getDocEntry(
|
273
|
-
DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY.GRAMMAR_PARSER,
|
274
|
-
),
|
275
|
-
insertText: PURE_GRAMMAR_DATA_SPACE_PARSER_NAME,
|
276
|
-
},
|
277
|
-
],
|
278
|
-
];
|
279
|
-
}
|
280
|
-
|
281
|
-
getExtraPureGrammarParserElementSnippetSuggestionsGetters(): PureGrammarParserElementSnippetSuggestionsGetter[] {
|
282
|
-
return [
|
283
|
-
(
|
284
|
-
editorStore: EditorStore,
|
285
|
-
parserKeyword: string,
|
286
|
-
): PureGrammarTextSuggestion[] | undefined =>
|
287
|
-
parserKeyword === PURE_GRAMMAR_DATA_SPACE_PARSER_NAME
|
288
|
-
? [
|
289
|
-
{
|
290
|
-
text: PURE_GRAMMAR_DATA_SPACE_ELEMENT_TYPE_LABEL,
|
291
|
-
insertText: SIMPLE_DATA_SPACE_SNIPPET,
|
292
|
-
},
|
293
|
-
]
|
294
|
-
: undefined,
|
295
|
-
];
|
296
|
-
}
|
297
|
-
}
|
@@ -1,136 +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 { useApplicationStore } from '@finos/legend-application';
|
18
|
-
import {
|
19
|
-
MenuContentItem,
|
20
|
-
BlankPanelContent,
|
21
|
-
TimesCircleIcon,
|
22
|
-
PanelLoadingIndicator,
|
23
|
-
Dialog,
|
24
|
-
TimesIcon,
|
25
|
-
Modal,
|
26
|
-
ModalHeader,
|
27
|
-
ModalTitle,
|
28
|
-
ModalHeaderActions,
|
29
|
-
} from '@finos/legend-art';
|
30
|
-
import { flowResult } from 'mobx';
|
31
|
-
import { observer } from 'mobx-react-lite';
|
32
|
-
import { DataSpaceViewer } from '../DataSpaceViewer.js';
|
33
|
-
import type { DataSpace } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
34
|
-
import { useEditorStore } from '@finos/legend-application-studio';
|
35
|
-
import { DataSpacePreviewState } from '../../stores/studio/DataSpacePreviewState.js';
|
36
|
-
|
37
|
-
export const DataSpacePreviewAction = observer(
|
38
|
-
(props: { dataSpace: DataSpace }) => {
|
39
|
-
const { dataSpace } = props;
|
40
|
-
const editorStore = useEditorStore();
|
41
|
-
const applicationStore = useApplicationStore();
|
42
|
-
const dataSpacePreviewState =
|
43
|
-
DataSpacePreviewState.retrieveNullableState(editorStore);
|
44
|
-
if (!dataSpacePreviewState) {
|
45
|
-
return null;
|
46
|
-
}
|
47
|
-
|
48
|
-
const previewDataSpace = (): void => {
|
49
|
-
flowResult(dataSpacePreviewState.previewDataSpace(dataSpace)).catch(
|
50
|
-
applicationStore.alertUnhandledError,
|
51
|
-
);
|
52
|
-
};
|
53
|
-
|
54
|
-
return (
|
55
|
-
<MenuContentItem onClick={previewDataSpace}>Preview</MenuContentItem>
|
56
|
-
);
|
57
|
-
},
|
58
|
-
);
|
59
|
-
|
60
|
-
export const DataSpacePreviewDialog = observer(() => {
|
61
|
-
const editorStore = useEditorStore();
|
62
|
-
const applicationStore = editorStore.applicationStore;
|
63
|
-
const dataSpacePreviewState =
|
64
|
-
DataSpacePreviewState.retrieveNullableState(editorStore);
|
65
|
-
if (!dataSpacePreviewState) {
|
66
|
-
return null;
|
67
|
-
}
|
68
|
-
|
69
|
-
const onClose = (): void => {
|
70
|
-
dataSpacePreviewState.setDataSpace(undefined);
|
71
|
-
};
|
72
|
-
|
73
|
-
return (
|
74
|
-
<Dialog
|
75
|
-
open={Boolean(dataSpacePreviewState.dataSpace)}
|
76
|
-
onClose={onClose}
|
77
|
-
classes={{
|
78
|
-
root: 'editor-modal__root-container',
|
79
|
-
container: 'editor-modal__container',
|
80
|
-
paper:
|
81
|
-
'editor-modal__content data-space-preview__dialog__container__content',
|
82
|
-
}}
|
83
|
-
>
|
84
|
-
<Modal
|
85
|
-
darkMode={
|
86
|
-
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
|
87
|
-
}
|
88
|
-
className="editor-modal data-space-preview__dialog"
|
89
|
-
>
|
90
|
-
<ModalHeader className="data-space-preview__dialog__header">
|
91
|
-
<ModalTitle title="Preview Data Space" />
|
92
|
-
<ModalHeaderActions>
|
93
|
-
<button
|
94
|
-
className="modal__header__action"
|
95
|
-
title="Close"
|
96
|
-
onClick={onClose}
|
97
|
-
>
|
98
|
-
<TimesIcon />
|
99
|
-
</button>
|
100
|
-
</ModalHeaderActions>
|
101
|
-
</ModalHeader>
|
102
|
-
<div className="data-space-preview__dialog__content">
|
103
|
-
<PanelLoadingIndicator
|
104
|
-
isLoading={dataSpacePreviewState.loadDataSpaceState.isInProgress}
|
105
|
-
/>
|
106
|
-
{dataSpacePreviewState.dataSpaceViewerState && (
|
107
|
-
<DataSpaceViewer
|
108
|
-
dataSpaceViewerState={dataSpacePreviewState.dataSpaceViewerState}
|
109
|
-
/>
|
110
|
-
)}
|
111
|
-
{!dataSpacePreviewState.dataSpaceViewerState && (
|
112
|
-
<>
|
113
|
-
{dataSpacePreviewState.loadDataSpaceState.isInProgress && (
|
114
|
-
<BlankPanelContent>
|
115
|
-
{dataSpacePreviewState.loadDataSpaceState.message}
|
116
|
-
</BlankPanelContent>
|
117
|
-
)}
|
118
|
-
{dataSpacePreviewState.loadDataSpaceState.hasFailed && (
|
119
|
-
<BlankPanelContent>
|
120
|
-
<div className="data-space-preview__dialog__content--failed">
|
121
|
-
<div className="data-space-preview__dialog__content--failed__icon">
|
122
|
-
<TimesCircleIcon />
|
123
|
-
</div>
|
124
|
-
<div className="data-space-preview__dialog__content--failed__text">
|
125
|
-
{`Can't load data space`}
|
126
|
-
</div>
|
127
|
-
</div>
|
128
|
-
</BlankPanelContent>
|
129
|
-
)}
|
130
|
-
</>
|
131
|
-
)}
|
132
|
-
</div>
|
133
|
-
</Modal>
|
134
|
-
</Dialog>
|
135
|
-
);
|
136
|
-
});
|
@@ -1,34 +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 { MenuContentItem } from '@finos/legend-art';
|
18
|
-
import { observer } from 'mobx-react-lite';
|
19
|
-
import type { DataSpace } from '../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
20
|
-
import { useEditorStore } from '@finos/legend-application-studio';
|
21
|
-
import { queryDataSpace } from '../query/DataSpaceQueryBuilder.js';
|
22
|
-
|
23
|
-
export const DataSpaceQueryAction = observer(
|
24
|
-
(props: { dataSpace: DataSpace }) => {
|
25
|
-
const { dataSpace } = props;
|
26
|
-
const editorStore = useEditorStore();
|
27
|
-
const buildQuery = editorStore.applicationStore.guardUnhandledError(
|
28
|
-
async () => {
|
29
|
-
await queryDataSpace(dataSpace, editorStore);
|
30
|
-
},
|
31
|
-
);
|
32
|
-
return <MenuContentItem onClick={buildQuery}>Query...</MenuContentItem>;
|
33
|
-
},
|
34
|
-
);
|