@finos/legend-extension-dsl-data-space 0.2.0 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/lib/DSLDataSpace_Extension.d.ts +0 -10
  3. package/lib/DSLDataSpace_Extension.d.ts.map +1 -1
  4. package/lib/DSLDataSpace_Extension.js +0 -24
  5. package/lib/DSLDataSpace_Extension.js.map +1 -1
  6. package/lib/components/DataSpaceViewer.js +17 -17
  7. package/lib/components/DataSpaceViewer.js.map +1 -1
  8. package/lib/components/query/{DSLDataSpace_QueryPlugin.d.ts → DSLDataSpace_LegendQueryPlugin.d.ts} +4 -5
  9. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.d.ts.map +1 -0
  10. package/lib/components/query/{DSLDataSpace_QueryPlugin.js → DSLDataSpace_LegendQueryPlugin.js} +4 -7
  11. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.js.map +1 -0
  12. package/lib/components/query/DataSpaceQuerySetup.js +7 -7
  13. package/lib/components/query/DataSpaceQuerySetup.js.map +1 -1
  14. package/lib/components/studio/{DSLDataSpace_StudioPlugin.d.ts → DSLDataSpace_LegendStudioPlugin.d.ts} +4 -6
  15. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.d.ts.map +1 -0
  16. package/lib/components/studio/{DSLDataSpace_StudioPlugin.js → DSLDataSpace_LegendStudioPlugin.js} +4 -22
  17. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.js.map +1 -0
  18. package/lib/graph/DSLDataSpace_PureGraphPlugin.d.ts +1 -2
  19. package/lib/graph/DSLDataSpace_PureGraphPlugin.d.ts.map +1 -1
  20. package/lib/graph/DSLDataSpace_PureGraphPlugin.js +0 -3
  21. package/lib/graph/DSLDataSpace_PureGraphPlugin.js.map +1 -1
  22. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.d.ts +1 -2
  23. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.d.ts.map +1 -1
  24. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.js +0 -3
  25. package/lib/graphManager/DSLDataSpace_PureGraphManagerPlugin.js.map +1 -1
  26. package/lib/index.css +2 -2
  27. package/lib/index.css.map +1 -1
  28. package/lib/index.d.ts +5 -0
  29. package/lib/index.d.ts.map +1 -1
  30. package/lib/index.js +5 -0
  31. package/lib/index.js.map +1 -1
  32. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts +2 -3
  33. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
  34. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js +5 -8
  35. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js.map +1 -1
  36. package/lib/stores/query/DataSpaceQuerySetupState.d.ts +2 -0
  37. package/lib/stores/query/DataSpaceQuerySetupState.d.ts.map +1 -1
  38. package/lib/stores/query/DataSpaceQuerySetupState.js +15 -1
  39. package/lib/stores/query/DataSpaceQuerySetupState.js.map +1 -1
  40. package/package.json +19 -20
  41. package/src/DSLDataSpace_Extension.ts +0 -30
  42. package/src/components/query/{DSLDataSpace_QueryPlugin.tsx → DSLDataSpace_LegendQueryPlugin.tsx} +2 -7
  43. package/src/components/query/DataSpaceQuerySetup.tsx +2 -2
  44. package/src/components/studio/{DSLDataSpace_StudioPlugin.tsx → DSLDataSpace_LegendStudioPlugin.tsx} +5 -27
  45. package/src/graph/DSLDataSpace_PureGraphPlugin.ts +1 -8
  46. package/src/graphManager/DSLDataSpace_PureGraphManagerPlugin.ts +0 -5
  47. package/src/index.ts +12 -0
  48. package/src/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.ts +5 -10
  49. package/src/stores/query/DataSpaceQuerySetupState.ts +31 -0
  50. package/tsconfig.json +2 -7
  51. package/lib/components/query/DSLDataSpace_QueryPlugin.d.ts.map +0 -1
  52. package/lib/components/query/DSLDataSpace_QueryPlugin.js.map +0 -1
  53. package/lib/components/studio/DSLDataSpace_StudioPlugin.d.ts.map +0 -1
  54. package/lib/components/studio/DSLDataSpace_StudioPlugin.js.map +0 -1
  55. package/lib/components/studio/EnterpriseModelExplorer.d.ts +0 -21
  56. package/lib/components/studio/EnterpriseModelExplorer.d.ts.map +0 -1
  57. package/lib/components/studio/EnterpriseModelExplorer.js +0 -70
  58. package/lib/components/studio/EnterpriseModelExplorer.js.map +0 -1
  59. package/lib/components/studio/EnterpriseModelExplorerStoreProvider.d.ts +0 -21
  60. package/lib/components/studio/EnterpriseModelExplorerStoreProvider.d.ts.map +0 -1
  61. package/lib/components/studio/EnterpriseModelExplorerStoreProvider.js +0 -35
  62. package/lib/components/studio/EnterpriseModelExplorerStoreProvider.js.map +0 -1
  63. package/lib/components/studio/TaxonomyTree.d.ts +0 -23
  64. package/lib/components/studio/TaxonomyTree.d.ts.map +0 -1
  65. package/lib/components/studio/TaxonomyTree.js +0 -78
  66. package/lib/components/studio/TaxonomyTree.js.map +0 -1
  67. package/lib/components/studio/TaxonomyViewer.d.ts +0 -22
  68. package/lib/components/studio/TaxonomyViewer.d.ts.map +0 -1
  69. package/lib/components/studio/TaxonomyViewer.js +0 -59
  70. package/lib/components/studio/TaxonomyViewer.js.map +0 -1
  71. package/lib/stores/studio/EnterpriseModelExplorerStore.d.ts +0 -93
  72. package/lib/stores/studio/EnterpriseModelExplorerStore.d.ts.map +0 -1
  73. package/lib/stores/studio/EnterpriseModelExplorerStore.js +0 -300
  74. package/lib/stores/studio/EnterpriseModelExplorerStore.js.map +0 -1
  75. package/src/components/studio/EnterpriseModelExplorer.tsx +0 -229
  76. package/src/components/studio/EnterpriseModelExplorerStoreProvider.tsx +0 -61
  77. package/src/components/studio/TaxonomyTree.tsx +0 -179
  78. package/src/components/studio/TaxonomyViewer.tsx +0 -187
  79. package/src/stores/studio/EnterpriseModelExplorerStore.tsx +0 -514
@@ -1,61 +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 { createContext, useContext } from 'react';
18
- import { useLocalObservable } from 'mobx-react-lite';
19
- import { useApplicationStore } from '@finos/legend-application';
20
- import { guaranteeNonNullable } from '@finos/legend-shared';
21
- import { useDepotServerClient } from '@finos/legend-server-depot';
22
- import { useGraphManagerState } from '@finos/legend-graph';
23
- import { EnterpriseModelExplorerStore } from '../../stores/studio/EnterpriseModelExplorerStore';
24
- import type { StudioConfig } from '@finos/legend-studio';
25
- import { useStudioStore } from '@finos/legend-studio';
26
-
27
- const EnterpriseModelExplorerStoreContext = createContext<
28
- EnterpriseModelExplorerStore | undefined
29
- >(undefined);
30
-
31
- export const EnterpriseModelExplorerStoreProvider = ({
32
- children,
33
- }: {
34
- children: React.ReactNode;
35
- }): React.ReactElement => {
36
- const applicationStore = useApplicationStore<StudioConfig>();
37
- const depotServerClient = useDepotServerClient();
38
- const graphManagerState = useGraphManagerState();
39
- const studioStore = useStudioStore();
40
- const store = useLocalObservable(
41
- () =>
42
- new EnterpriseModelExplorerStore(
43
- applicationStore,
44
- depotServerClient,
45
- graphManagerState,
46
- studioStore.pluginManager,
47
- ),
48
- );
49
- return (
50
- <EnterpriseModelExplorerStoreContext.Provider value={store}>
51
- {children}
52
- </EnterpriseModelExplorerStoreContext.Provider>
53
- );
54
- };
55
-
56
- export const useEnterpriseModelExplorerStore =
57
- (): EnterpriseModelExplorerStore =>
58
- guaranteeNonNullable(
59
- useContext(EnterpriseModelExplorerStoreContext),
60
- `Can't find enterprise model explorer store in context`,
61
- );
@@ -1,179 +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 { useState } from 'react';
18
- import { observer } from 'mobx-react-lite';
19
- import type { TaxonomyTreeNodeData } from '../../stores/studio/EnterpriseModelExplorerStore';
20
- import {
21
- generateTaxonomyNodeRoute,
22
- TaxonomyViewerState,
23
- } from '../../stores/studio/EnterpriseModelExplorerStore';
24
- import type { TreeData, TreeNodeContainerProps } from '@finos/legend-art';
25
- import {
26
- ContextMenu,
27
- MenuContent,
28
- MenuContentItem,
29
- CircleIcon,
30
- EmptyCircleIcon,
31
- ChevronDownIcon,
32
- ChevronRightIcon,
33
- clsx,
34
- TreeView,
35
- } from '@finos/legend-art';
36
- import { useEnterpriseModelExplorerStore } from './EnterpriseModelExplorerStoreProvider';
37
- import { isNonNullable } from '@finos/legend-shared';
38
- import { useApplicationStore } from '@finos/legend-application';
39
-
40
- const TaxonomyTreeNodeContainer = observer(
41
- (
42
- props: TreeNodeContainerProps<
43
- TaxonomyTreeNodeData,
44
- {
45
- treeData: TreeData<TaxonomyTreeNodeData>;
46
- }
47
- >,
48
- ) => {
49
- const { node, level, stepPaddingInRem, onNodeSelect, innerProps } = props;
50
- const { treeData } = innerProps;
51
- const [isSelectedFromContextMenu, setIsSelectedFromContextMenu] =
52
- useState(false);
53
- const applicationStore = useApplicationStore();
54
- const enterpriseModelExplorerStore = useEnterpriseModelExplorerStore();
55
- const expandIcon = !node.childrenIds.length ? (
56
- <div />
57
- ) : node.isOpen ? (
58
- <ChevronDownIcon />
59
- ) : (
60
- <ChevronRightIcon />
61
- );
62
- const selectNode = (): void => onNodeSelect?.(node);
63
- const toggleExpand = (event: React.MouseEvent): void => {
64
- event.preventDefault();
65
- event.stopPropagation();
66
- if (node.childrenIds.length) {
67
- node.isOpen = !node.isOpen;
68
- }
69
- enterpriseModelExplorerStore.setTreeData({
70
- ...treeData,
71
- });
72
- };
73
- const onContextMenuOpen = (): void => setIsSelectedFromContextMenu(true);
74
- const onContextMenuClose = (): void => setIsSelectedFromContextMenu(false);
75
- const copyLink = (): void => {
76
- applicationStore
77
- .copyTextToClipboard(
78
- applicationStore.navigator.generateLocation(
79
- generateTaxonomyNodeRoute(node.id),
80
- ),
81
- )
82
- .then(() =>
83
- applicationStore.notifySuccess(
84
- 'Copied taxonomy node link to clipboard',
85
- ),
86
- )
87
- .catch(applicationStore.alertIllegalUnhandledError);
88
- };
89
-
90
- return (
91
- <ContextMenu
92
- content={
93
- <MenuContent>
94
- <MenuContentItem onClick={copyLink}>Copy Link</MenuContentItem>
95
- </MenuContent>
96
- }
97
- menuProps={{ elevation: 7 }}
98
- onOpen={onContextMenuOpen}
99
- onClose={onContextMenuClose}
100
- >
101
- <div
102
- className={clsx(
103
- 'tree-view__node__container enterprise-taxonomy-tree__node__container',
104
- {
105
- 'menu__trigger--on-menu-open':
106
- !node.isSelected && isSelectedFromContextMenu,
107
- },
108
- {
109
- 'enterprise-taxonomy-tree__node__container--selected':
110
- node ===
111
- enterpriseModelExplorerStore.currentTaxonomyViewerState
112
- ?.taxonomyNode,
113
- },
114
- )}
115
- onClick={selectNode}
116
- style={{
117
- paddingLeft: `${level * (stepPaddingInRem ?? 1)}rem`,
118
- display: 'flex',
119
- }}
120
- >
121
- <div className="tree-view__node__icon enterprise-taxonomy-tree__node__icon">
122
- <button
123
- className="enterprise-taxonomy-tree__node__icon__expand"
124
- tabIndex={-1}
125
- onClick={toggleExpand}
126
- >
127
- {expandIcon}
128
- </button>
129
- <div className="enterprise-taxonomy-tree__node__icon__type">
130
- {node.childrenIds.length ? <CircleIcon /> : <EmptyCircleIcon />}
131
- </div>
132
- </div>
133
- <button
134
- className="tree-view__node__label enterprise-taxonomy-tree__node__label"
135
- tabIndex={-1}
136
- >
137
- {node.label}
138
- </button>
139
- </div>
140
- </ContextMenu>
141
- );
142
- },
143
- );
144
-
145
- export const TaxonomyTree = observer(
146
- (props: { treeData: TreeData<TaxonomyTreeNodeData> }) => {
147
- const { treeData } = props;
148
- const enterpriseModelExplorerStore = useEnterpriseModelExplorerStore();
149
-
150
- const onNodeSelect = (node: TaxonomyTreeNodeData): void => {
151
- enterpriseModelExplorerStore.setCurrentTaxonomyViewerState(
152
- new TaxonomyViewerState(enterpriseModelExplorerStore, node),
153
- );
154
- enterpriseModelExplorerStore.setTreeData({ ...treeData });
155
- };
156
-
157
- const getChildNodes = (
158
- node: TaxonomyTreeNodeData,
159
- ): TaxonomyTreeNodeData[] =>
160
- node.childrenIds
161
- .map((id) => treeData.nodes.get(id))
162
- .filter(isNonNullable)
163
- .sort((a, b) => a.label.localeCompare(b.label));
164
-
165
- return (
166
- <TreeView
167
- components={{
168
- TreeNodeContainer: TaxonomyTreeNodeContainer,
169
- }}
170
- treeData={treeData}
171
- onNodeSelect={onNodeSelect}
172
- getChildNodes={getChildNodes}
173
- innerProps={{
174
- treeData,
175
- }}
176
- />
177
- );
178
- },
179
- );
@@ -1,187 +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 { useState } from 'react';
18
- import { observer } from 'mobx-react-lite';
19
- import type {
20
- RawDataSpace,
21
- TaxonomyViewerState,
22
- } from '../../stores/studio/EnterpriseModelExplorerStore';
23
- import { generateDataSpaceRoute } from '../../stores/studio/EnterpriseModelExplorerStore';
24
- import {
25
- BlankPanelContent,
26
- clsx,
27
- PanelLoadingIndicator,
28
- SquareIcon,
29
- ResizablePanel,
30
- ResizablePanelGroup,
31
- ResizablePanelSplitter,
32
- ContextMenu,
33
- MenuContent,
34
- MenuContentItem,
35
- } from '@finos/legend-art';
36
- import { DataSpaceViewer } from '../DataSpaceViewer';
37
- import { flowResult } from 'mobx';
38
- import { useApplicationStore } from '@finos/legend-application';
39
- import { generateGAVCoordinates } from '@finos/legend-server-depot';
40
-
41
- const TaxonomyDataSpaceItem = observer(
42
- (props: {
43
- rawDataSpace: RawDataSpace;
44
- taxonomyViewerState: TaxonomyViewerState;
45
- selectDataSpace: () => void;
46
- }) => {
47
- const { rawDataSpace, taxonomyViewerState, selectDataSpace } = props;
48
- const [isSelectedFromContextMenu, setIsSelectedFromContextMenu] =
49
- useState(false);
50
- const applicationStore = useApplicationStore();
51
- const isSelected = rawDataSpace === taxonomyViewerState.currentDataSpace;
52
- const onContextMenuOpen = (): void => setIsSelectedFromContextMenu(true);
53
- const onContextMenuClose = (): void => setIsSelectedFromContextMenu(false);
54
- const copyLink = (): void => {
55
- applicationStore
56
- .copyTextToClipboard(
57
- applicationStore.navigator.generateLocation(
58
- generateDataSpaceRoute(
59
- taxonomyViewerState.taxonomyNode.id,
60
- generateGAVCoordinates(
61
- rawDataSpace.groupId,
62
- rawDataSpace.artifactId,
63
- rawDataSpace.versionId,
64
- ),
65
- rawDataSpace.path,
66
- ),
67
- ),
68
- )
69
- .then(() =>
70
- applicationStore.notifySuccess('Copied data space link to clipboard'),
71
- )
72
- .catch(applicationStore.alertIllegalUnhandledError);
73
- };
74
-
75
- return (
76
- <ContextMenu
77
- content={
78
- <MenuContent>
79
- <MenuContentItem onClick={copyLink}>Copy Link</MenuContentItem>
80
- </MenuContent>
81
- }
82
- menuProps={{ elevation: 7 }}
83
- onOpen={onContextMenuOpen}
84
- onClose={onContextMenuClose}
85
- key={rawDataSpace.id}
86
- >
87
- <button
88
- className={clsx(
89
- 'taxonomy-viewer__explorer__entry',
90
- {
91
- 'menu__trigger--on-menu-open':
92
- !isSelected && isSelectedFromContextMenu,
93
- },
94
- {
95
- 'taxonomy-viewer__explorer__entry--active': isSelected,
96
- },
97
- )}
98
- tabIndex={-1}
99
- onClick={selectDataSpace}
100
- title={rawDataSpace.id}
101
- >
102
- <div className="taxonomy-viewer__explorer__entry__icon">
103
- <SquareIcon />
104
- </div>
105
- <div className="taxonomy-viewer__explorer__entry__path">
106
- {rawDataSpace.path}
107
- </div>
108
- </button>
109
- </ContextMenu>
110
- );
111
- },
112
- );
113
-
114
- const TaxonomyViewerExplorer = observer(
115
- (props: { taxonomyViewerState: TaxonomyViewerState }) => {
116
- const { taxonomyViewerState } = props;
117
- const applicationStore = useApplicationStore();
118
- const taxonomyNode = taxonomyViewerState.taxonomyNode;
119
- const selectDataSpace =
120
- (rawDataSpace: RawDataSpace): (() => void) =>
121
- (): void => {
122
- flowResult(
123
- taxonomyViewerState.initializeDataSpaceViewer(rawDataSpace),
124
- ).catch(applicationStore.alertIllegalUnhandledError);
125
- };
126
-
127
- return (
128
- <div className="panel taxonomy-viewer__explorer">
129
- <div className="panel__header taxonomy-viewer__explorer__header">
130
- <div className="panel__header__title taxonomy-viewer__explorer__header__title">
131
- Dataspaces ({taxonomyNode.rawDataSpaces.length})
132
- </div>
133
- </div>
134
- <div className="panel__content taxonomy-viewer__explorer__content">
135
- {taxonomyNode.rawDataSpaces.length === 0 && (
136
- <BlankPanelContent>No data space available</BlankPanelContent>
137
- )}
138
- {taxonomyNode.rawDataSpaces.length !== 0 &&
139
- taxonomyNode.rawDataSpaces.map((rawDataSpace) => (
140
- <TaxonomyDataSpaceItem
141
- key={rawDataSpace.id}
142
- rawDataSpace={rawDataSpace}
143
- selectDataSpace={selectDataSpace(rawDataSpace)}
144
- taxonomyViewerState={taxonomyViewerState}
145
- />
146
- ))}
147
- </div>
148
- </div>
149
- );
150
- },
151
- );
152
-
153
- export const TaxonomyViewer = observer(
154
- (props: { taxonomyViewerState: TaxonomyViewerState }) => {
155
- const { taxonomyViewerState } = props;
156
-
157
- return (
158
- <div className="taxonomy-viewer">
159
- <ResizablePanelGroup orientation="vertical">
160
- <ResizablePanel minSize={300} size={300}>
161
- <TaxonomyViewerExplorer taxonomyViewerState={taxonomyViewerState} />
162
- </ResizablePanel>
163
- <ResizablePanelSplitter />
164
- <ResizablePanel minSize={300}>
165
- {taxonomyViewerState.dataSpaceViewerState && (
166
- <DataSpaceViewer
167
- dataSpaceViewerState={taxonomyViewerState.dataSpaceViewerState}
168
- />
169
- )}
170
- {!taxonomyViewerState.dataSpaceViewerState &&
171
- taxonomyViewerState.initDataSpaceViewerState.isInProgress && (
172
- <div className="taxonomy-viewer__content-placeholder">
173
- <PanelLoadingIndicator isLoading={true} />
174
- <BlankPanelContent>Loading data space...</BlankPanelContent>
175
- </div>
176
- )}
177
- {!taxonomyViewerState.dataSpaceViewerState && (
178
- <div className="taxonomy-viewer__content-placeholder">
179
- <BlankPanelContent>No data space selected</BlankPanelContent>
180
- </div>
181
- )}
182
- </ResizablePanel>
183
- </ResizablePanelGroup>
184
- </div>
185
- );
186
- },
187
- );