@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.
- 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__/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/__lib__/to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.d.ts +38 -0
- package/lib/__lib__/to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.d.ts.map +1 -0
- package/lib/__lib__/{query/DSL_DataSpace_LegendQueryNavigation.js → to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.js} +33 -13
- package/lib/__lib__/to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.js.map +1 -0
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +3 -3
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
- package/lib/components/index.d.ts +6 -4
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +6 -4
- package/lib/components/index.js.map +1 -1
- package/lib/components/query-builder/DataSpaceAdvancedSearchModal.d.ts.map +1 -0
- package/lib/components/query-builder/DataSpaceAdvancedSearchModal.js.map +1 -0
- package/lib/components/{query → query-builder}/DataSpaceQueryBuilder.d.ts +2 -5
- package/lib/components/query-builder/DataSpaceQueryBuilder.d.ts.map +1 -0
- package/lib/components/{query → query-builder}/DataSpaceQueryBuilder.js +5 -24
- package/lib/components/query-builder/DataSpaceQueryBuilder.js.map +1 -0
- package/lib/components/{query → query-builder}/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts +1 -1
- package/lib/components/query-builder/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts.map +1 -0
- package/lib/components/{query → query-builder}/DataSpaceQueryBuilderTemplateQueryPanelContent.js +4 -4
- package/lib/components/query-builder/DataSpaceQueryBuilderTemplateQueryPanelContent.js.map +1 -0
- package/lib/components/query-builder/QueryDataSpaceUtil.d.ts.map +1 -0
- package/lib/components/query-builder/QueryDataSpaceUtil.js.map +1 -0
- package/lib/components/{query → query-builder}/index.d.ts +3 -1
- package/lib/components/query-builder/index.d.ts.map +1 -0
- package/lib/components/{query → query-builder}/index.js +3 -1
- package/lib/components/query-builder/index.js.map +1 -0
- 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 +4 -0
- package/lib/graph-manager/index.d.ts.map +1 -1
- package/lib/graph-manager/index.js +5 -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 +3 -8
- 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 +2 -3
- package/lib/stores/query/DataSpaceAdvancedSearchState.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 +3 -3
- 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/lib/{__lib__/studio/DSL_DataSpace_LegendStudioDocumentation.d.ts → stores/shared/DataSpaceUtils.d.ts} +4 -5
- package/lib/stores/shared/DataSpaceUtils.d.ts.map +1 -0
- package/lib/stores/shared/DataSpaceUtils.js +32 -0
- package/lib/stores/shared/DataSpaceUtils.js.map +1 -0
- package/package.json +4 -9
- package/src/{components → __lib__}/query/DSL_DataSpace_LegendQueryDocumentation.ts +1 -1
- package/src/__lib__/shared/DSL_DataSpace_LegendNavigation.ts +57 -0
- package/src/__lib__/{query/DSL_DataSpace_LegendQueryNavigation.ts → to-delete/DSL_DataSpace_LegendQueryNavigation_to_delete.ts} +41 -46
- package/src/components/DSL_DataSpace_LegendApplicationPlugin.tsx +6 -6
- package/src/components/index.ts +15 -4
- package/src/components/{query → query-builder}/DataSpaceAdvancedSearchModal.tsx +1 -1
- package/src/components/{query → query-builder}/DataSpaceQueryBuilder.tsx +7 -68
- package/src/components/{query → query-builder}/DataSpaceQueryBuilderTemplateQueryPanelContent.tsx +5 -5
- package/src/components/{studio → query-builder}/index.ts +7 -1
- package/src/graph-manager/index.ts +6 -0
- package/src/stores/query/DataSpaceAdvancedSearchState.ts +8 -3
- package/src/stores/{query → query-builder}/DataSpaceQueryBuilderState.ts +6 -3
- package/src/stores/shared/DataSpaceUtils.ts +42 -0
- package/tsconfig.json +12 -26
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts +0 -65
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.d.ts.map +0 -1
- package/lib/__lib__/query/DSL_DataSpace_LegendQueryNavigation.js.map +0 -1
- 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.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_LegendQueryApplicationPlugin.d.ts +0 -29
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.d.ts.map +0 -1
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.js +0 -242
- package/lib/components/query/DSL_DataSpace_LegendQueryApplicationPlugin.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/query/DataSpaceAdvancedSearchModal.d.ts.map +0 -1
- package/lib/components/query/DataSpaceAdvancedSearchModal.js.map +0 -1
- package/lib/components/query/DataSpaceQueryBuilder.d.ts.map +0 -1
- package/lib/components/query/DataSpaceQueryBuilder.js.map +0 -1
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.d.ts.map +0 -1
- package/lib/components/query/DataSpaceQueryBuilderTemplateQueryPanelContent.js.map +0 -1
- package/lib/components/query/DataSpaceQueryCreator.d.ts +0 -19
- package/lib/components/query/DataSpaceQueryCreator.d.ts.map +0 -1
- package/lib/components/query/DataSpaceQueryCreator.js +0 -41
- package/lib/components/query/DataSpaceQueryCreator.js.map +0 -1
- package/lib/components/query/DataSpaceQuerySetup.d.ts +0 -21
- package/lib/components/query/DataSpaceQuerySetup.d.ts.map +0 -1
- package/lib/components/query/DataSpaceQuerySetup.js +0 -63
- package/lib/components/query/DataSpaceQuerySetup.js.map +0 -1
- package/lib/components/query/DataSpaceTemplateQueryCreator.d.ts +0 -19
- package/lib/components/query/DataSpaceTemplateQueryCreator.d.ts.map +0 -1
- package/lib/components/query/DataSpaceTemplateQueryCreator.js +0 -37
- package/lib/components/query/DataSpaceTemplateQueryCreator.js.map +0 -1
- package/lib/components/query/QueryDataSpaceUtil.d.ts.map +0 -1
- package/lib/components/query/QueryDataSpaceUtil.js.map +0 -1
- package/lib/components/query/index.d.ts.map +0 -1
- package/lib/components/query/index.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/DataSpaceQueryCreatorStore.d.ts +0 -38
- package/lib/stores/query/DataSpaceQueryCreatorStore.d.ts.map +0 -1
- package/lib/stores/query/DataSpaceQueryCreatorStore.js +0 -149
- package/lib/stores/query/DataSpaceQueryCreatorStore.js.map +0 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.d.ts +0 -51
- package/lib/stores/query/DataSpaceQuerySetupStore.d.ts.map +0 -1
- package/lib/stores/query/DataSpaceQuerySetupStore.js +0 -107
- package/lib/stores/query/DataSpaceQuerySetupStore.js.map +0 -1
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.d.ts +0 -35
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.d.ts.map +0 -1
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.js +0 -108
- package/lib/stores/query/DataSpaceTemplateQueryCreatorStore.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/query/DSL_DataSpace_LegendQueryApplicationPlugin.tsx +0 -445
- package/src/components/query/DataSpaceQueryCreator.tsx +0 -99
- package/src/components/query/DataSpaceQuerySetup.tsx +0 -165
- package/src/components/query/DataSpaceTemplateQueryCreator.tsx +0 -82
- package/src/components/query/index.ts +0 -17
- 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/stores/query/DataSpaceQueryCreatorStore.ts +0 -308
- package/src/stores/query/DataSpaceQuerySetupStore.ts +0 -205
- package/src/stores/query/DataSpaceTemplateQueryCreatorStore.ts +0 -207
- package/src/stores/query/DataSpaceTemplateQueryPromotionReviewerStore.ts +0 -636
- package/src/stores/studio/DataSpacePreviewState.ts +0 -195
- /package/lib/components/{query → query-builder}/DataSpaceAdvancedSearchModal.d.ts +0 -0
- /package/lib/components/{query → query-builder}/DataSpaceAdvancedSearchModal.js +0 -0
- /package/lib/components/{query → query-builder}/QueryDataSpaceUtil.d.ts +0 -0
- /package/lib/components/{query → query-builder}/QueryDataSpaceUtil.js +0 -0
- /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/{query → query-builder}/QueryDataSpaceUtil.ts +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,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
|
-
);
|
@@ -1,292 +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 { BlankPanelContent, GitBranchIcon, clsx } from '@finos/legend-art';
|
18
|
-
import { observer, useLocalObservable } from 'mobx-react-lite';
|
19
|
-
import { useApplicationStore } from '@finos/legend-application';
|
20
|
-
import { DataSpaceTemplateQueryPromotionReviewerStore } from '../../stores/query/DataSpaceTemplateQueryPromotionReviewerStore.js';
|
21
|
-
import {
|
22
|
-
DATA_SPACE_TEMPLATE_QUERY_PROMOTION_ROUTE_PATTERN_TOKEN,
|
23
|
-
type DataSpaceTemplateQueryPromotionReviewerPathParams,
|
24
|
-
} from '../../__lib__/query/DSL_DataSpace_LegendQueryNavigation.js';
|
25
|
-
import { useParams } from '@finos/legend-application/browser';
|
26
|
-
import {
|
27
|
-
ActivityBarMenu,
|
28
|
-
LEGEND_STUDIO_TEST_ID,
|
29
|
-
useLegendStudioApplicationStore,
|
30
|
-
useLegendStudioBaseStore,
|
31
|
-
} from '@finos/legend-application-studio';
|
32
|
-
import { createContext, useContext } from 'react';
|
33
|
-
import { guaranteeNonNullable } from '@finos/legend-shared';
|
34
|
-
import { flowResult } from 'mobx';
|
35
|
-
import { DocumentationLink } from '@finos/legend-lego/application';
|
36
|
-
import { DSL_DATASPACE_LEGEND_QUERY_DOCUMENTATION_KEY } from '../query/DSL_DataSpace_LegendQueryDocumentation.js';
|
37
|
-
|
38
|
-
const TemplateQueryPromotionReviewerStoreContext = createContext<
|
39
|
-
DataSpaceTemplateQueryPromotionReviewerStore | undefined
|
40
|
-
>(undefined);
|
41
|
-
|
42
|
-
const DataSpaceTemplateQueryPromotionReviewerStoreProvider: React.FC<{
|
43
|
-
children: React.ReactNode;
|
44
|
-
dataSpacePath: string;
|
45
|
-
queryId: string;
|
46
|
-
}> = ({ children, dataSpacePath, queryId }) => {
|
47
|
-
const applicationStore = useLegendStudioApplicationStore();
|
48
|
-
const baseStore = useLegendStudioBaseStore();
|
49
|
-
const store = useLocalObservable(
|
50
|
-
() =>
|
51
|
-
new DataSpaceTemplateQueryPromotionReviewerStore(
|
52
|
-
applicationStore,
|
53
|
-
baseStore.sdlcServerClient,
|
54
|
-
baseStore.depotServerClient,
|
55
|
-
),
|
56
|
-
);
|
57
|
-
store.initialize(queryId, dataSpacePath);
|
58
|
-
return (
|
59
|
-
<TemplateQueryPromotionReviewerStoreContext.Provider value={store}>
|
60
|
-
{children}
|
61
|
-
</TemplateQueryPromotionReviewerStoreContext.Provider>
|
62
|
-
);
|
63
|
-
};
|
64
|
-
|
65
|
-
const useTemplateQueryPromotionReviewerStore =
|
66
|
-
(): DataSpaceTemplateQueryPromotionReviewerStore =>
|
67
|
-
guaranteeNonNullable(
|
68
|
-
useContext(TemplateQueryPromotionReviewerStoreContext),
|
69
|
-
`Can't find query productionizer store in context`,
|
70
|
-
);
|
71
|
-
|
72
|
-
const TemplateQueryPromotionReviewerContent = observer(() => {
|
73
|
-
const applicationStore = useApplicationStore();
|
74
|
-
const queryPromotionReviewerStore = useTemplateQueryPromotionReviewerStore();
|
75
|
-
const isLoadingEditor = !queryPromotionReviewerStore.initState.hasCompleted;
|
76
|
-
|
77
|
-
// workspace name
|
78
|
-
const changeWorkspaceName: React.ChangeEventHandler<HTMLInputElement> = (
|
79
|
-
event,
|
80
|
-
) => queryPromotionReviewerStore.setWorkspaceName(event.target.value);
|
81
|
-
|
82
|
-
// template query
|
83
|
-
const onChangeTemplateQueryId: React.ChangeEventHandler<HTMLInputElement> = (
|
84
|
-
event,
|
85
|
-
) => queryPromotionReviewerStore.setTemplateQueryId(event.target.value);
|
86
|
-
|
87
|
-
const onChangeTemplateQueryTitle: React.ChangeEventHandler<
|
88
|
-
HTMLInputElement
|
89
|
-
> = (event) =>
|
90
|
-
queryPromotionReviewerStore.setTemplateQueryTitle(event.target.value);
|
91
|
-
|
92
|
-
const onChangeTemplateQueryDescription: React.ChangeEventHandler<
|
93
|
-
HTMLInputElement
|
94
|
-
> = (event) =>
|
95
|
-
queryPromotionReviewerStore.setTemplateQueryDescription(event.target.value);
|
96
|
-
|
97
|
-
// actions
|
98
|
-
const promoteTemplateQuery = (): void => {
|
99
|
-
flowResult(queryPromotionReviewerStore.promoteAsTemplateQuery()).catch(
|
100
|
-
applicationStore.alertUnhandledError,
|
101
|
-
);
|
102
|
-
};
|
103
|
-
|
104
|
-
return (
|
105
|
-
<div className="app__page">
|
106
|
-
{isLoadingEditor && (
|
107
|
-
<BlankPanelContent>
|
108
|
-
{queryPromotionReviewerStore.initState.message ??
|
109
|
-
queryPromotionReviewerStore.graphManagerState.systemBuildState
|
110
|
-
.message ??
|
111
|
-
queryPromotionReviewerStore.graphManagerState.dependenciesBuildState
|
112
|
-
.message ??
|
113
|
-
queryPromotionReviewerStore.graphManagerState.generationsBuildState
|
114
|
-
.message ??
|
115
|
-
queryPromotionReviewerStore.graphManagerState.graphBuildState
|
116
|
-
.message}
|
117
|
-
</BlankPanelContent>
|
118
|
-
)}
|
119
|
-
<div className="template-query-promotor">
|
120
|
-
<div className="template-query-promotor__body">
|
121
|
-
<div className="activity-bar">
|
122
|
-
<ActivityBarMenu />
|
123
|
-
</div>
|
124
|
-
<div
|
125
|
-
className="template-query-promotor__content"
|
126
|
-
data-testid={LEGEND_STUDIO_TEST_ID.SETUP__CONTENT}
|
127
|
-
>
|
128
|
-
<div className="template-query-promotor__content__main">
|
129
|
-
<div className="template-query-promotor__title">
|
130
|
-
Promote as Curated Template Query
|
131
|
-
<DocumentationLink
|
132
|
-
documentationKey={
|
133
|
-
DSL_DATASPACE_LEGEND_QUERY_DOCUMENTATION_KEY.CURATED_TEMPLATE_QUERY
|
134
|
-
}
|
135
|
-
/>
|
136
|
-
</div>
|
137
|
-
<div className="template-query-promotor__title__prompt">
|
138
|
-
We will promote this query as a curated template query in
|
139
|
-
dataspace. This automated process will generate a code review
|
140
|
-
and workspace. Please get the generated code review reviewed and
|
141
|
-
approved.
|
142
|
-
</div>
|
143
|
-
<div className="template-query-promotor__group template-query-promotor__group--workspace">
|
144
|
-
<div className="template-query-promotor__group__header">
|
145
|
-
workspace
|
146
|
-
</div>
|
147
|
-
<div className="template-query-promotor__group__content">
|
148
|
-
<div className="template-query-promotor__input">
|
149
|
-
<div
|
150
|
-
className="template-query-promotor__input__icon"
|
151
|
-
title="workspace"
|
152
|
-
>
|
153
|
-
<GitBranchIcon className="template-query-promotor__input__icon--workspce" />
|
154
|
-
</div>
|
155
|
-
<div className="input-group template-query-promotor__input__input">
|
156
|
-
<input
|
157
|
-
className={clsx(
|
158
|
-
'input input--dark input-group__input',
|
159
|
-
{
|
160
|
-
'input-group__input--error':
|
161
|
-
!queryPromotionReviewerStore.isWorkspaceNameValid,
|
162
|
-
},
|
163
|
-
)}
|
164
|
-
spellCheck={false}
|
165
|
-
value={queryPromotionReviewerStore.workspaceName}
|
166
|
-
placeholder="Enter a name for your workspace"
|
167
|
-
onChange={changeWorkspaceName}
|
168
|
-
/>
|
169
|
-
{!queryPromotionReviewerStore.isWorkspaceNameValid && (
|
170
|
-
<div className="input-group__error-message">
|
171
|
-
Workspace already existed
|
172
|
-
</div>
|
173
|
-
)}
|
174
|
-
</div>
|
175
|
-
</div>
|
176
|
-
</div>
|
177
|
-
</div>
|
178
|
-
<div className="template-query-promotor__group template-query-promotor__group--template">
|
179
|
-
<div className="template-query-promotor__group__header">
|
180
|
-
template query
|
181
|
-
</div>
|
182
|
-
<div className="template-query-promotor__group__content">
|
183
|
-
<div className="template-query-promotor__input">
|
184
|
-
<div className="template-query-promotor__input__label">
|
185
|
-
id
|
186
|
-
</div>
|
187
|
-
<div className="input-group template-query-promotor__input__input">
|
188
|
-
<input
|
189
|
-
className={clsx(
|
190
|
-
'input input--dark input-group__input',
|
191
|
-
{
|
192
|
-
'input-group__input--error':
|
193
|
-
!queryPromotionReviewerStore.isTemplateQueryIdValid,
|
194
|
-
},
|
195
|
-
)}
|
196
|
-
spellCheck={false}
|
197
|
-
placeholder="Create an id for your template query"
|
198
|
-
value={queryPromotionReviewerStore.templateQueryId}
|
199
|
-
onChange={onChangeTemplateQueryId}
|
200
|
-
/>
|
201
|
-
{!queryPromotionReviewerStore.isTemplateQueryIdValid && (
|
202
|
-
<div className="input-group__error-message">
|
203
|
-
Invalid template query id
|
204
|
-
</div>
|
205
|
-
)}
|
206
|
-
</div>
|
207
|
-
</div>
|
208
|
-
<div className="template-query-promotor__input">
|
209
|
-
<div className="template-query-promotor__input__label">
|
210
|
-
title
|
211
|
-
</div>
|
212
|
-
<div className="input-group template-query-promotor__input__input">
|
213
|
-
<input
|
214
|
-
className="input input--dark input-group__input"
|
215
|
-
spellCheck={false}
|
216
|
-
placeholder="Create a title for your template query"
|
217
|
-
value={queryPromotionReviewerStore.templateQueryTitle}
|
218
|
-
onChange={onChangeTemplateQueryTitle}
|
219
|
-
/>
|
220
|
-
</div>
|
221
|
-
</div>
|
222
|
-
<div className="template-query-promotor__input">
|
223
|
-
<div className="template-query-promotor__input__label">
|
224
|
-
description
|
225
|
-
</div>
|
226
|
-
<div className="input-group template-query-promotor__input__input">
|
227
|
-
<input
|
228
|
-
className="input input--dark input-group__input"
|
229
|
-
spellCheck={false}
|
230
|
-
placeholder="Add some descriptions for your template query"
|
231
|
-
value={
|
232
|
-
queryPromotionReviewerStore.templateQueryDescription
|
233
|
-
}
|
234
|
-
onChange={onChangeTemplateQueryDescription}
|
235
|
-
/>
|
236
|
-
</div>
|
237
|
-
</div>
|
238
|
-
</div>
|
239
|
-
</div>
|
240
|
-
<div className="template-query-promotor__actions">
|
241
|
-
<button
|
242
|
-
className="template-query-promotor__next-btn btn--dark"
|
243
|
-
onClick={promoteTemplateQuery}
|
244
|
-
disabled={
|
245
|
-
queryPromotionReviewerStore.promoteState.isInProgress ||
|
246
|
-
!queryPromotionReviewerStore.currentQuery ||
|
247
|
-
!queryPromotionReviewerStore.currentQueryInfo ||
|
248
|
-
!queryPromotionReviewerStore.currentProject ||
|
249
|
-
!queryPromotionReviewerStore
|
250
|
-
.currentProjectConfigurationStatus?.isConfigured ||
|
251
|
-
!queryPromotionReviewerStore.workspaceName ||
|
252
|
-
!queryPromotionReviewerStore.templateQueryTitle ||
|
253
|
-
!queryPromotionReviewerStore.isWorkspaceNameValid ||
|
254
|
-
!queryPromotionReviewerStore.isTemplateQueryIdValid
|
255
|
-
}
|
256
|
-
>
|
257
|
-
Promote Query
|
258
|
-
</button>
|
259
|
-
</div>
|
260
|
-
</div>
|
261
|
-
</div>
|
262
|
-
</div>
|
263
|
-
<div
|
264
|
-
data-testid={LEGEND_STUDIO_TEST_ID.STATUS_BAR}
|
265
|
-
className="editor__status-bar"
|
266
|
-
/>
|
267
|
-
</div>
|
268
|
-
</div>
|
269
|
-
);
|
270
|
-
});
|
271
|
-
|
272
|
-
export const DataSpaceTemplateQueryPromotionReviewer = observer(() => {
|
273
|
-
const parameters =
|
274
|
-
useParams<DataSpaceTemplateQueryPromotionReviewerPathParams>();
|
275
|
-
const dataSpacePath =
|
276
|
-
parameters[
|
277
|
-
DATA_SPACE_TEMPLATE_QUERY_PROMOTION_ROUTE_PATTERN_TOKEN.DATA_SPACE_PATH
|
278
|
-
];
|
279
|
-
const queryId =
|
280
|
-
parameters[
|
281
|
-
DATA_SPACE_TEMPLATE_QUERY_PROMOTION_ROUTE_PATTERN_TOKEN.QUERY_ID
|
282
|
-
];
|
283
|
-
|
284
|
-
return (
|
285
|
-
<DataSpaceTemplateQueryPromotionReviewerStoreProvider
|
286
|
-
dataSpacePath={dataSpacePath}
|
287
|
-
queryId={queryId}
|
288
|
-
>
|
289
|
-
<TemplateQueryPromotionReviewerContent />
|
290
|
-
</DataSpaceTemplateQueryPromotionReviewerStoreProvider>
|
291
|
-
);
|
292
|
-
});
|