@finos/legend-extension-dsl-data-space 0.0.6 → 1.0.1

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 (70) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/lib/DSLDataSpace_Extension.d.ts +0 -5
  3. package/lib/DSLDataSpace_Extension.d.ts.map +1 -1
  4. package/lib/DSLDataSpace_Extension.js +0 -12
  5. package/lib/DSLDataSpace_Extension.js.map +1 -1
  6. package/lib/components/{studio/DataSpaceEditor.d.ts → DataSpaceViewer.d.ts} +5 -2
  7. package/lib/components/DataSpaceViewer.d.ts.map +1 -0
  8. package/lib/components/DataSpaceViewer.js +186 -0
  9. package/lib/components/DataSpaceViewer.js.map +1 -0
  10. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.d.ts +24 -0
  11. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.d.ts.map +1 -0
  12. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.js +51 -0
  13. package/lib/components/query/DSLDataSpace_LegendQueryPlugin.js.map +1 -0
  14. package/lib/components/query/DataSpaceQuerySetup.d.ts +22 -0
  15. package/lib/components/query/DataSpaceQuerySetup.d.ts.map +1 -0
  16. package/lib/components/query/DataSpaceQuerySetup.js +95 -0
  17. package/lib/components/query/DataSpaceQuerySetup.js.map +1 -0
  18. package/lib/components/studio/{DSLDataSpace_StudioPlugin.d.ts → DSLDataSpace_LegendStudioPlugin.d.ts} +5 -6
  19. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.d.ts.map +1 -0
  20. package/lib/components/studio/{DSLDataSpace_StudioPlugin.js → DSLDataSpace_LegendStudioPlugin.js} +7 -18
  21. package/lib/components/studio/DSLDataSpace_LegendStudioPlugin.js.map +1 -0
  22. package/lib/graph/DSLDataSpace_PureGraphPlugin.js +1 -1
  23. package/lib/graph/DSLDataSpace_PureGraphPlugin.js.map +1 -1
  24. package/lib/index.css +2 -2
  25. package/lib/index.css.map +1 -1
  26. package/lib/index.d.ts +5 -0
  27. package/lib/index.d.ts.map +1 -1
  28. package/lib/index.js +5 -0
  29. package/lib/index.js.map +1 -1
  30. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts +39 -1
  31. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
  32. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js +110 -8
  33. package/lib/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.js.map +1 -1
  34. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts +1 -0
  35. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.d.ts.map +1 -1
  36. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js +1 -1
  37. package/lib/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.js.map +1 -1
  38. package/lib/stores/DataSpaceViewerState.d.ts +59 -0
  39. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -0
  40. package/lib/stores/DataSpaceViewerState.js +137 -0
  41. package/lib/stores/DataSpaceViewerState.js.map +1 -0
  42. package/lib/stores/query/DataSpaceQuerySetupState.d.ts +49 -0
  43. package/lib/stores/query/DataSpaceQuerySetupState.d.ts.map +1 -0
  44. package/lib/stores/query/DataSpaceQuerySetupState.js +129 -0
  45. package/lib/stores/query/DataSpaceQuerySetupState.js.map +1 -0
  46. package/package.json +26 -21
  47. package/src/DSLDataSpace_Extension.ts +0 -15
  48. package/src/components/DataSpaceViewer.tsx +598 -0
  49. package/src/components/query/DSLDataSpace_LegendQueryPlugin.tsx +76 -0
  50. package/src/components/query/DataSpaceQuerySetup.tsx +234 -0
  51. package/src/components/studio/{DSLDataSpace_StudioPlugin.tsx → DSLDataSpace_LegendStudioPlugin.tsx} +17 -27
  52. package/src/graph/DSLDataSpace_PureGraphPlugin.ts +1 -1
  53. package/src/index.ts +12 -0
  54. package/src/models/protocols/pure/DSLDataSpace_PureProtocolProcessorPlugin.ts +192 -6
  55. package/src/models/protocols/pure/v1/transformation/pureProtocol/V1_DSLDataSpace_ProtocolHelper.ts +1 -1
  56. package/src/stores/DataSpaceViewerState.ts +202 -0
  57. package/src/stores/query/DataSpaceQuerySetupState.ts +235 -0
  58. package/tsconfig.json +7 -3
  59. package/tsconfig.package.json +1 -0
  60. package/lib/components/studio/DSLDataSpace_StudioPlugin.d.ts.map +0 -1
  61. package/lib/components/studio/DSLDataSpace_StudioPlugin.js.map +0 -1
  62. package/lib/components/studio/DataSpaceEditor.d.ts.map +0 -1
  63. package/lib/components/studio/DataSpaceEditor.js +0 -98
  64. package/lib/components/studio/DataSpaceEditor.js.map +0 -1
  65. package/lib/stores/studio/DataSpaceEditorState.d.ts +0 -42
  66. package/lib/stores/studio/DataSpaceEditorState.d.ts.map +0 -1
  67. package/lib/stores/studio/DataSpaceEditorState.js +0 -76
  68. package/lib/stores/studio/DataSpaceEditorState.js.map +0 -1
  69. package/src/components/studio/DataSpaceEditor.tsx +0 -272
  70. package/src/stores/studio/DataSpaceEditorState.ts +0 -108
@@ -1,76 +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 { computed, action, makeObservable, observable } from 'mobx';
17
- import { guaranteeNonNullable, guaranteeType } from '@finos/legend-shared';
18
- import { ElementEditorState } from '@finos/legend-studio';
19
- import { DataSpace } from '../../models/metamodels/pure/model/packageableElements/dataSpace/DataSpace';
20
- import { Diagram } from '@finos/legend-extension-dsl-diagram';
21
- export var DATA_SPACE_VIEWER_ACTIVITY_MODE;
22
- (function (DATA_SPACE_VIEWER_ACTIVITY_MODE) {
23
- DATA_SPACE_VIEWER_ACTIVITY_MODE["MODELS"] = "MODELS";
24
- DATA_SPACE_VIEWER_ACTIVITY_MODE["EXECUTION"] = "EXECUTION";
25
- DATA_SPACE_VIEWER_ACTIVITY_MODE["ENTITLEMENT"] = "ENTITLEMENT";
26
- DATA_SPACE_VIEWER_ACTIVITY_MODE["SUPPORT"] = "SUPPORT";
27
- })(DATA_SPACE_VIEWER_ACTIVITY_MODE || (DATA_SPACE_VIEWER_ACTIVITY_MODE = {}));
28
- export class DataSpaceEditorState extends ElementEditorState {
29
- _renderer;
30
- currentDiagram;
31
- currentActivity = DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS;
32
- diagrams = [];
33
- constructor(editorStore, element) {
34
- super(editorStore, element);
35
- makeObservable(this, {
36
- _renderer: observable,
37
- currentDiagram: observable,
38
- currentActivity: observable,
39
- renderer: computed,
40
- dataSpace: computed,
41
- setRenderer: action,
42
- setCurrentDiagram: action,
43
- setCurrentActivity: action,
44
- reprocess: action,
45
- });
46
- this.dataSpace.featuredDiagrams.forEach((diagram) => {
47
- this.diagrams.push(this.editorStore.graphManagerState.graph.getExtensionElement(diagram, Diagram));
48
- });
49
- if (this.diagrams.length !== 0) {
50
- this.setCurrentDiagram(this.diagrams[0]);
51
- }
52
- }
53
- get dataSpace() {
54
- return guaranteeType(this.element, DataSpace, 'Element inside data space editor state must be a data space element');
55
- }
56
- get renderer() {
57
- return guaranteeNonNullable(this._renderer, `Diagram renderer must be initialized (this is likely caused by calling this method at the wrong place)`);
58
- }
59
- get isDiagramRendererInitialized() {
60
- return Boolean(this._renderer);
61
- }
62
- setRenderer(val) {
63
- this._renderer = val;
64
- }
65
- setCurrentDiagram(val) {
66
- this.currentDiagram = val;
67
- }
68
- setCurrentActivity(val) {
69
- this.currentActivity = val;
70
- }
71
- reprocess(newElement, editorStore) {
72
- const newElementEditorState = new DataSpaceEditorState(editorStore, newElement);
73
- return newElementEditorState;
74
- }
75
- }
76
- //# sourceMappingURL=DataSpaceEditorState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataSpaceEditorState.js","sourceRoot":"","sources":["../../../src/stores/studio/DataSpaceEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,4EAA4E,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAE9D,MAAM,CAAN,IAAY,+BAKX;AALD,WAAY,+BAA+B;IACzC,oDAAiB,CAAA;IACjB,0DAAuB,CAAA;IACvB,8DAA2B,CAAA;IAC3B,sDAAmB,CAAA;AACrB,CAAC,EALW,+BAA+B,KAA/B,+BAA+B,QAK1C;AAED,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IAC1D,SAAS,CAA+B;IACxC,cAAc,CAAuB;IACrC,eAAe,GAAG,+BAA+B,CAAC,MAAM,CAAC;IACzD,QAAQ,GAAc,EAAE,CAAC;IAEzB,YAAY,WAAwB,EAAE,OAA2B;QAC/D,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE5B,cAAc,CAAC,IAAI,EAAE;YACnB,SAAS,EAAE,UAAU;YACrB,cAAc,EAAE,UAAU;YAC1B,eAAe,EAAE,UAAU;YAC3B,QAAQ,EAAE,QAAQ;YAClB,SAAS,EAAE,QAAQ;YACnB,WAAW,EAAE,MAAM;YACnB,iBAAiB,EAAE,MAAM;YACzB,kBAAkB,EAAE,MAAM;YAC1B,SAAS,EAAE,MAAM;SAClB,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAClD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAChB,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,mBAAmB,CAC1D,OAAO,EACP,OAAO,CACR,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1C;IACH,CAAC;IAED,IAAI,SAAS;QACX,OAAO,aAAa,CAClB,IAAI,CAAC,OAAO,EACZ,SAAS,EACT,qEAAqE,CACtE,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,oBAAoB,CACzB,IAAI,CAAC,SAAS,EACd,wGAAwG,CACzG,CAAC;IACJ,CAAC;IAED,IAAI,4BAA4B;QAC9B,OAAO,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,WAAW,CAAC,GAAoB;QAC9B,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;IACvB,CAAC;IAED,iBAAiB,CAAC,GAAY;QAC5B,IAAI,CAAC,cAAc,GAAG,GAAG,CAAC;IAC5B,CAAC;IAED,kBAAkB,CAAC,GAAoC;QACrD,IAAI,CAAC,eAAe,GAAG,GAAG,CAAC;IAC7B,CAAC;IAED,SAAS,CACP,UAA8B,EAC9B,WAAwB;QAExB,MAAM,qBAAqB,GAAG,IAAI,oBAAoB,CACpD,WAAW,EACX,UAAU,CACX,CAAC;QACF,OAAO,qBAAqB,CAAC;IAC/B,CAAC;CACF"}
@@ -1,272 +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 { useRef, useEffect } from 'react';
18
- import { observer } from 'mobx-react-lite';
19
- import { useEditorStore } from '@finos/legend-studio';
20
- import { useResizeDetector } from 'react-resize-detector';
21
- import {
22
- BlankPanelContent,
23
- ShapesIcon,
24
- PlayIcon,
25
- UserIcon,
26
- QuestionCircleIcon,
27
- clsx,
28
- CustomSelectorInput,
29
- } from '@finos/legend-art';
30
- import {
31
- DataSpaceEditorState,
32
- DATA_SPACE_VIEWER_ACTIVITY_MODE,
33
- } from '../../stores/studio/DataSpaceEditorState';
34
- import type { Diagram } from '@finos/legend-extension-dsl-diagram';
35
- import { DiagramRenderer } from '@finos/legend-extension-dsl-diagram';
36
-
37
- interface DataSpaceViewerActivityConfig {
38
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE;
39
- title: string;
40
- icon: React.ReactElement;
41
- }
42
-
43
- const DataSpaceDiagramCanvas = observer(
44
- (
45
- props: {
46
- dataSpaceEditorState: DataSpaceEditorState;
47
- diagram: Diagram;
48
- },
49
- ref: React.Ref<HTMLDivElement>,
50
- ) => {
51
- const { dataSpaceEditorState, diagram } = props;
52
- const diagramCanvasRef =
53
- ref as React.MutableRefObject<HTMLDivElement | null>;
54
-
55
- const { width, height } = useResizeDetector<HTMLDivElement>({
56
- refreshMode: 'debounce',
57
- refreshRate: 50,
58
- targetRef: diagramCanvasRef,
59
- });
60
-
61
- useEffect(() => {
62
- if (diagramCanvasRef.current) {
63
- const renderer = new DiagramRenderer(diagramCanvasRef.current, diagram);
64
- dataSpaceEditorState.setRenderer(renderer);
65
- renderer.render();
66
- renderer.autoRecenter();
67
- }
68
- }, [diagramCanvasRef, dataSpaceEditorState, diagram]);
69
-
70
- useEffect(() => {
71
- if (dataSpaceEditorState.isDiagramRendererInitialized) {
72
- dataSpaceEditorState.renderer.refresh();
73
- }
74
- }, [dataSpaceEditorState, width, height]);
75
-
76
- return (
77
- <div
78
- ref={diagramCanvasRef}
79
- className="diagram-canvas"
80
- tabIndex={0}
81
- onContextMenu={(event): void => event.preventDefault()}
82
- />
83
- );
84
- },
85
- { forwardRef: true },
86
- );
87
-
88
- type DiagramOption = { label: string; value: Diagram };
89
- const buildDiagramOption = (diagram: Diagram): DiagramOption => ({
90
- label: diagram.name,
91
- value: diagram,
92
- });
93
-
94
- const DataSpaceModelsOverview = observer(
95
- (props: { dataSpaceEditorState: DataSpaceEditorState }) => {
96
- const { dataSpaceEditorState } = props;
97
- const diagramCanvasRef = useRef<HTMLDivElement>(null);
98
- const diagramOptions =
99
- dataSpaceEditorState.diagrams.map(buildDiagramOption);
100
- const selectedDiagramOption = dataSpaceEditorState.currentDiagram
101
- ? buildDiagramOption(dataSpaceEditorState.currentDiagram)
102
- : null;
103
- const onDiagramOptionChange = (option: DiagramOption): void => {
104
- if (option.value !== dataSpaceEditorState.currentDiagram) {
105
- dataSpaceEditorState.setCurrentDiagram(option.value);
106
- }
107
- };
108
-
109
- return (
110
- <>
111
- {dataSpaceEditorState.diagrams.length !== 0 && (
112
- <div className="data-space-viewer__main-panel__content data-space-viewer__overview-panel">
113
- <div className="data-space-viewer__overview-panel__header">
114
- <CustomSelectorInput
115
- className="data-space-viewer__overview-panel__diagram-selector"
116
- options={diagramOptions}
117
- onChange={onDiagramOptionChange}
118
- value={selectedDiagramOption}
119
- placeholder="Search for a diagram"
120
- darkMode={true}
121
- />
122
- </div>
123
- <div className="data-space-viewer__overview-panel__content">
124
- {dataSpaceEditorState.currentDiagram && (
125
- <DataSpaceDiagramCanvas
126
- dataSpaceEditorState={dataSpaceEditorState}
127
- diagram={dataSpaceEditorState.currentDiagram}
128
- ref={diagramCanvasRef}
129
- />
130
- )}
131
- </div>
132
- </div>
133
- )}
134
- {dataSpaceEditorState.diagrams.length === 0 && (
135
- <BlankPanelContent>No diagrams available</BlankPanelContent>
136
- )}
137
- </>
138
- );
139
- },
140
- );
141
-
142
- export const DataSpaceViewer = observer(() => {
143
- const editorStore = useEditorStore();
144
- const dataSpaceEditorState =
145
- editorStore.getCurrentEditorState(DataSpaceEditorState);
146
- const dataSpace = dataSpaceEditorState.dataSpace;
147
- const changeActivity =
148
- (activity: DATA_SPACE_VIEWER_ACTIVITY_MODE): (() => void) =>
149
- (): void =>
150
- dataSpaceEditorState.setCurrentActivity(activity);
151
-
152
- const activities: DataSpaceViewerActivityConfig[] = [
153
- {
154
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS,
155
- title: 'Models Overview',
156
- icon: <ShapesIcon />,
157
- },
158
- {
159
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION,
160
- title: 'Execution Context',
161
- icon: <PlayIcon />,
162
- },
163
- {
164
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.ENTITLEMENT,
165
- title: 'Entitlement',
166
- icon: <UserIcon />,
167
- },
168
- {
169
- mode: DATA_SPACE_VIEWER_ACTIVITY_MODE.SUPPORT,
170
- title: 'Support',
171
- icon: <QuestionCircleIcon />,
172
- },
173
- ];
174
-
175
- return (
176
- <div className="data-space-viewer">
177
- <div className="data-space-viewer__header">
178
- <div className="data-space-viewer__path">{dataSpace.path}</div>
179
- <div className="data-space-viewer__gav">
180
- <div className="data-space-viewer__gav__group-id">
181
- {dataSpace.groupId}
182
- </div>
183
- <div className="data-space-viewer__gav__separator">:</div>
184
- <div className="data-space-viewer__gav__artifact-id">
185
- {dataSpace.artifactId}
186
- </div>
187
- <div className="data-space-viewer__gav__separator">:</div>
188
- <div className="data-space-viewer__gav__version-id">
189
- {dataSpace.versionId}
190
- </div>
191
- </div>
192
- <div className="data-space-viewer__description">
193
- {dataSpace.description ? (
194
- dataSpace.description
195
- ) : (
196
- <div className="data-space-viewer__description--empty">
197
- No description
198
- </div>
199
- )}
200
- </div>
201
- </div>
202
- <div className="data-space-viewer__content">
203
- <div className="data-space-viewer__body">
204
- <div className="data-space-viewer__activity-bar">
205
- <div className="data-space-viewer__activity-bar__items">
206
- {activities.map((activity) => (
207
- <button
208
- key={activity.mode}
209
- className={clsx('data-space-viewer__activity-bar__item', {
210
- 'data-space-viewer__activity-bar__item--active':
211
- dataSpaceEditorState.currentActivity === activity.mode,
212
- })}
213
- onClick={changeActivity(activity.mode)}
214
- tabIndex={-1}
215
- title={activity.title}
216
- >
217
- {activity.icon}
218
- </button>
219
- ))}
220
- </div>
221
- </div>
222
- <div className="data-space-viewer__main-panel">
223
- {dataSpaceEditorState.currentActivity ===
224
- DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS && (
225
- <DataSpaceModelsOverview
226
- dataSpaceEditorState={dataSpaceEditorState}
227
- />
228
- )}
229
- {/* {dataSpaceEditorState.currentActivity ===
230
- DATA_SPACE_VIEWER_ACTIVITY_MODE.EXECUTION && (
231
- <div className="data-space-viewer__main-panel__content data-space-viewer__execution-panel">
232
- <div className="data-space-viewer__panel__info-entry">
233
- <div className="data-space-viewer__panel__info-entry__icon">
234
- <MappingIcon />
235
- </div>
236
- <div className="data-space-viewer__panel__info-entry__content">
237
- {dataSpace.mapping}
238
- </div>
239
- </div>
240
- <div className="data-space-viewer__panel__info-entry">
241
- <div className="data-space-viewer__panel__info-entry__icon">
242
- <RuntimeIcon />
243
- </div>
244
- <div className="data-space-viewer__panel__info-entry__content">
245
- {dataSpace.runtime}
246
- </div>
247
- </div>
248
- </div>
249
- )} */}
250
- {dataSpaceEditorState.currentActivity ===
251
- DATA_SPACE_VIEWER_ACTIVITY_MODE.ENTITLEMENT && (
252
- <BlankPanelContent>(WIP)</BlankPanelContent>
253
- )}
254
- {/* {dataSpaceEditorState.currentActivity ===
255
- DATA_SPACE_VIEWER_ACTIVITY_MODE.SUPPORT && (
256
- <div className="data-space-viewer__main-panel__content data-space-viewer__support-panel">
257
- <div className="data-space-viewer__panel__info-entry">
258
- <div className="data-space-viewer__panel__info-entry__icon">
259
- <EnvelopIcon />
260
- </div>
261
- <div className="data-space-viewer__panel__info-entry__content">
262
- {dataSpace.supportInfo ?? '(no support contact available)'}
263
- </div>
264
- </div>
265
- </div>
266
- )} */}
267
- </div>
268
- </div>
269
- </div>
270
- </div>
271
- );
272
- });
@@ -1,108 +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 { computed, action, makeObservable, observable } from 'mobx';
18
- import type { EditorStore } from '@finos/legend-studio';
19
- import { guaranteeNonNullable, guaranteeType } from '@finos/legend-shared';
20
- import { ElementEditorState } from '@finos/legend-studio';
21
- import type { PackageableElement } from '@finos/legend-graph';
22
- import { DataSpace } from '../../models/metamodels/pure/model/packageableElements/dataSpace/DataSpace';
23
- import type { DiagramRenderer } from '@finos/legend-extension-dsl-diagram';
24
- import { Diagram } from '@finos/legend-extension-dsl-diagram';
25
-
26
- export enum DATA_SPACE_VIEWER_ACTIVITY_MODE {
27
- MODELS = 'MODELS',
28
- EXECUTION = 'EXECUTION',
29
- ENTITLEMENT = 'ENTITLEMENT',
30
- SUPPORT = 'SUPPORT',
31
- }
32
-
33
- export class DataSpaceEditorState extends ElementEditorState {
34
- _renderer?: DiagramRenderer | undefined;
35
- currentDiagram?: Diagram | undefined;
36
- currentActivity = DATA_SPACE_VIEWER_ACTIVITY_MODE.MODELS;
37
- diagrams: Diagram[] = [];
38
-
39
- constructor(editorStore: EditorStore, element: PackageableElement) {
40
- super(editorStore, element);
41
-
42
- makeObservable(this, {
43
- _renderer: observable,
44
- currentDiagram: observable,
45
- currentActivity: observable,
46
- renderer: computed,
47
- dataSpace: computed,
48
- setRenderer: action,
49
- setCurrentDiagram: action,
50
- setCurrentActivity: action,
51
- reprocess: action,
52
- });
53
-
54
- this.dataSpace.featuredDiagrams.forEach((diagram) => {
55
- this.diagrams.push(
56
- this.editorStore.graphManagerState.graph.getExtensionElement(
57
- diagram,
58
- Diagram,
59
- ),
60
- );
61
- });
62
- if (this.diagrams.length !== 0) {
63
- this.setCurrentDiagram(this.diagrams[0]);
64
- }
65
- }
66
-
67
- get dataSpace(): DataSpace {
68
- return guaranteeType(
69
- this.element,
70
- DataSpace,
71
- 'Element inside data space editor state must be a data space element',
72
- );
73
- }
74
-
75
- get renderer(): DiagramRenderer {
76
- return guaranteeNonNullable(
77
- this._renderer,
78
- `Diagram renderer must be initialized (this is likely caused by calling this method at the wrong place)`,
79
- );
80
- }
81
-
82
- get isDiagramRendererInitialized(): boolean {
83
- return Boolean(this._renderer);
84
- }
85
-
86
- setRenderer(val: DiagramRenderer): void {
87
- this._renderer = val;
88
- }
89
-
90
- setCurrentDiagram(val: Diagram): void {
91
- this.currentDiagram = val;
92
- }
93
-
94
- setCurrentActivity(val: DATA_SPACE_VIEWER_ACTIVITY_MODE): void {
95
- this.currentActivity = val;
96
- }
97
-
98
- reprocess(
99
- newElement: PackageableElement,
100
- editorStore: EditorStore,
101
- ): ElementEditorState {
102
- const newElementEditorState = new DataSpaceEditorState(
103
- editorStore,
104
- newElement,
105
- );
106
- return newElementEditorState;
107
- }
108
- }