@finos/legend-extension-dsl-data-space 9.1.5 → 9.1.6
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.
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts +0 -4
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts.map +1 -1
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +0 -3
- package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
- package/lib/components/DataSpaceDataAccess.d.ts +23 -0
- package/lib/components/DataSpaceDataAccess.d.ts.map +1 -0
- package/lib/components/DataSpaceDataAccess.js +34 -0
- package/lib/components/DataSpaceDataAccess.js.map +1 -0
- package/lib/components/DataSpaceDescription.d.ts +23 -0
- package/lib/components/DataSpaceDescription.d.ts.map +1 -0
- package/lib/components/DataSpaceDescription.js +26 -0
- package/lib/components/DataSpaceDescription.js.map +1 -0
- package/lib/components/DataSpaceDiagramViewer.d.ts.map +1 -1
- package/lib/components/DataSpaceDiagramViewer.js +7 -9
- package/lib/components/DataSpaceDiagramViewer.js.map +1 -1
- package/lib/components/DataSpaceExecutionContextViewer.d.ts.map +1 -1
- package/lib/components/DataSpaceExecutionContextViewer.js +6 -6
- package/lib/components/DataSpaceExecutionContextViewer.js.map +1 -1
- package/lib/components/DataSpaceMarkdownTextViewer.d.ts +20 -0
- package/lib/components/DataSpaceMarkdownTextViewer.d.ts.map +1 -0
- package/lib/components/DataSpaceMarkdownTextViewer.js +25 -0
- package/lib/components/DataSpaceMarkdownTextViewer.js.map +1 -0
- package/lib/components/DataSpaceModelsDocumentation.d.ts.map +1 -1
- package/lib/components/DataSpaceModelsDocumentation.js +33 -35
- package/lib/components/DataSpaceModelsDocumentation.js.map +1 -1
- package/lib/components/DataSpacePlaceholder.d.ts +20 -0
- package/lib/components/DataSpacePlaceholder.d.ts.map +1 -0
- package/lib/components/DataSpacePlaceholder.js +18 -0
- package/lib/components/DataSpacePlaceholder.js.map +1 -0
- package/lib/components/DataSpaceQuickStart.d.ts +7 -1
- package/lib/components/DataSpaceQuickStart.d.ts.map +1 -1
- package/lib/components/DataSpaceQuickStart.js +92 -1
- package/lib/components/DataSpaceQuickStart.js.map +1 -1
- package/lib/components/DataSpaceSupportPanel.js +1 -1
- package/lib/components/DataSpaceSupportPanel.js.map +1 -1
- package/lib/components/DataSpaceViewer.d.ts.map +1 -1
- package/lib/components/DataSpaceViewer.js +21 -8
- package/lib/components/DataSpaceViewer.js.map +1 -1
- package/lib/components/DataSpaceWiki.d.ts.map +1 -1
- package/lib/components/DataSpaceWiki.js +4 -28
- package/lib/components/DataSpaceWiki.js.map +1 -1
- package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.d.ts +5 -0
- package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.d.ts.map +1 -1
- package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.js +7 -0
- package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.js.map +1 -1
- package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts +3 -0
- package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
- package/lib/graphManager/action/analytics/DataSpaceAnalysis.js +5 -0
- package/lib/graphManager/action/analytics/DataSpaceAnalysis.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
- package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +14 -2
- package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +1 -1
- package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +3 -3
- package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.d.ts +32 -0
- package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.d.ts.map +1 -0
- package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.js +17 -0
- package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.js.map +1 -0
- package/lib/stores/DataSpaceViewerState.d.ts +1 -0
- package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
- package/lib/stores/DataSpaceViewerState.js +6 -0
- package/lib/stores/DataSpaceViewerState.js.map +1 -1
- package/package.json +11 -11
- package/src/components/DSL_DataSpace_LegendApplicationPlugin.ts +0 -9
- package/src/components/DataSpaceDataAccess.tsx +66 -0
- package/src/components/DataSpaceDescription.tsx +55 -0
- package/src/components/DataSpaceDiagramViewer.tsx +69 -61
- package/src/components/DataSpaceExecutionContextViewer.tsx +12 -18
- package/src/components/DataSpaceMarkdownTextViewer.tsx +33 -0
- package/src/components/DataSpaceModelsDocumentation.tsx +59 -52
- package/src/components/DataSpacePlaceholder.tsx +21 -0
- package/src/components/DataSpaceQuickStart.tsx +366 -0
- package/src/components/DataSpaceSupportPanel.tsx +4 -4
- package/src/components/DataSpaceViewer.tsx +58 -32
- package/src/components/DataSpaceWiki.tsx +5 -40
- package/src/graphManager/DSL_DataSpace_PureGraphManagerPlugin.ts +9 -0
- package/src/graphManager/action/analytics/DataSpaceAnalysis.ts +8 -0
- package/src/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +21 -2
- package/src/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +1 -1
- package/src/index.ts +2 -4
- package/src/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.ts +41 -0
- package/src/stores/DataSpaceViewerState.ts +15 -0
- package/tsconfig.json +5 -0
|
@@ -13,3 +13,369 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
|
|
17
|
+
import { observer } from 'mobx-react-lite';
|
|
18
|
+
import {
|
|
19
|
+
AnchorLinkIcon,
|
|
20
|
+
CodeIcon,
|
|
21
|
+
CopyIcon,
|
|
22
|
+
MoreVerticalIcon,
|
|
23
|
+
QueryIcon,
|
|
24
|
+
QuestionCircleIcon,
|
|
25
|
+
clsx,
|
|
26
|
+
} from '@finos/legend-art';
|
|
27
|
+
import { type DataSpaceViewerState } from '../stores/DataSpaceViewerState.js';
|
|
28
|
+
import { AgGridReact } from '@ag-grid-community/react';
|
|
29
|
+
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
|
|
30
|
+
import {
|
|
31
|
+
EDITOR_LANGUAGE,
|
|
32
|
+
TextInputEditor,
|
|
33
|
+
useApplicationStore,
|
|
34
|
+
} from '@finos/legend-application';
|
|
35
|
+
import {
|
|
36
|
+
DataSpaceExecutableTDSResult,
|
|
37
|
+
type DataSpaceExecutableAnalysisResult,
|
|
38
|
+
} from '../graphManager/action/analytics/DataSpaceAnalysis.js';
|
|
39
|
+
import { DataSpaceMarkdownTextViewer } from './DataSpaceMarkdownTextViewer.js';
|
|
40
|
+
import type { DSL_DataSpace_LegendApplicationPlugin_Extension } from '../stores/DSL_DataSpace_LegendApplicationPlugin_Extension.js';
|
|
41
|
+
import { useState } from 'react';
|
|
42
|
+
|
|
43
|
+
enum TDS_EXECUTABLE_ACTION_TAB {
|
|
44
|
+
COLUMN_SPECS = 'COLUMN_SPECS',
|
|
45
|
+
QUERY = 'QUERY',
|
|
46
|
+
QUERY_TEXT = 'QUERY_TEXT',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const DataSpaceExecutableTDSResultView = observer(
|
|
50
|
+
(props: {
|
|
51
|
+
dataSpaceViewerState: DataSpaceViewerState;
|
|
52
|
+
executableAnalysisResult: DataSpaceExecutableAnalysisResult;
|
|
53
|
+
tdsResult: DataSpaceExecutableTDSResult;
|
|
54
|
+
}) => {
|
|
55
|
+
const { dataSpaceViewerState, executableAnalysisResult, tdsResult } = props;
|
|
56
|
+
const applicationStore = useApplicationStore();
|
|
57
|
+
const [selectedTab, setSelectedTab] = useState<string>(
|
|
58
|
+
TDS_EXECUTABLE_ACTION_TAB.COLUMN_SPECS,
|
|
59
|
+
);
|
|
60
|
+
const queryText = executableAnalysisResult.info?.query;
|
|
61
|
+
|
|
62
|
+
const columnSpecifications = tdsResult.columns;
|
|
63
|
+
const extractTDSExecutableActionConfigurations =
|
|
64
|
+
applicationStore.pluginManager
|
|
65
|
+
.getApplicationPlugins()
|
|
66
|
+
.flatMap(
|
|
67
|
+
(plugin) =>
|
|
68
|
+
(
|
|
69
|
+
plugin as DSL_DataSpace_LegendApplicationPlugin_Extension
|
|
70
|
+
).getExtraDataSpaceTDSExecutableActionConfigurations?.() ?? [],
|
|
71
|
+
);
|
|
72
|
+
const currentTabExtensionConfig =
|
|
73
|
+
extractTDSExecutableActionConfigurations.find(
|
|
74
|
+
(config) => config.key === selectedTab,
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div className="data-space__viewer__quickstart__item">
|
|
79
|
+
<div className="data-space__viewer__quickstart__item__header">
|
|
80
|
+
<div className="data-space__viewer__quickstart__item__header__title">
|
|
81
|
+
{executableAnalysisResult.title}
|
|
82
|
+
</div>
|
|
83
|
+
<div className="data-space__viewer__quickstart__item__header__type data-space__viewer__quickstart__item__header__type--tds">
|
|
84
|
+
TDS
|
|
85
|
+
</div>
|
|
86
|
+
<div className="data-space__viewer__quickstart__item__header__anchor">
|
|
87
|
+
<AnchorLinkIcon />
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
{executableAnalysisResult.description !== undefined && (
|
|
91
|
+
<div className="data-space__viewer__quickstart__item__description">
|
|
92
|
+
<DataSpaceMarkdownTextViewer
|
|
93
|
+
value={executableAnalysisResult.description}
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
<div className="data-space__viewer__quickstart__item__content">
|
|
98
|
+
<div className="data-space__viewer__quickstart__item__content__tab__header">
|
|
99
|
+
<div className="data-space__viewer__quickstart__item__content__tabs">
|
|
100
|
+
<button
|
|
101
|
+
className={clsx(
|
|
102
|
+
'data-space__viewer__quickstart__item__content__tab',
|
|
103
|
+
{
|
|
104
|
+
'data-space__viewer__quickstart__item__content__tab--active':
|
|
105
|
+
selectedTab === TDS_EXECUTABLE_ACTION_TAB.COLUMN_SPECS,
|
|
106
|
+
},
|
|
107
|
+
)}
|
|
108
|
+
tabIndex={-1}
|
|
109
|
+
onClick={() =>
|
|
110
|
+
setSelectedTab(TDS_EXECUTABLE_ACTION_TAB.COLUMN_SPECS)
|
|
111
|
+
}
|
|
112
|
+
>
|
|
113
|
+
<div className="data-space__viewer__quickstart__item__content__tab__label">
|
|
114
|
+
Column Specifications
|
|
115
|
+
</div>
|
|
116
|
+
</button>
|
|
117
|
+
<button
|
|
118
|
+
className={clsx(
|
|
119
|
+
'data-space__viewer__quickstart__item__content__tab',
|
|
120
|
+
{
|
|
121
|
+
'data-space__viewer__quickstart__item__content__tab--active':
|
|
122
|
+
selectedTab === TDS_EXECUTABLE_ACTION_TAB.QUERY,
|
|
123
|
+
},
|
|
124
|
+
)}
|
|
125
|
+
tabIndex={-1}
|
|
126
|
+
onClick={() => setSelectedTab(TDS_EXECUTABLE_ACTION_TAB.QUERY)}
|
|
127
|
+
>
|
|
128
|
+
<div className="data-space__viewer__quickstart__item__content__tab__icon">
|
|
129
|
+
<QueryIcon className="data-space__viewer__quickstart__item__content__tab__icon--query" />
|
|
130
|
+
</div>
|
|
131
|
+
<div className="data-space__viewer__quickstart__item__content__tab__label">
|
|
132
|
+
Query
|
|
133
|
+
</div>
|
|
134
|
+
</button>
|
|
135
|
+
{extractTDSExecutableActionConfigurations.map((config) => (
|
|
136
|
+
<button
|
|
137
|
+
key={config.key}
|
|
138
|
+
className={clsx(
|
|
139
|
+
'data-space__viewer__quickstart__item__content__tab',
|
|
140
|
+
{
|
|
141
|
+
'data-space__viewer__quickstart__item__content__tab--active':
|
|
142
|
+
selectedTab === config.key,
|
|
143
|
+
},
|
|
144
|
+
)}
|
|
145
|
+
tabIndex={-1}
|
|
146
|
+
onClick={() => setSelectedTab(config.key)}
|
|
147
|
+
>
|
|
148
|
+
{config.icon !== undefined && (
|
|
149
|
+
<div className="data-space__viewer__quickstart__item__content__tab__icon">
|
|
150
|
+
{config.icon}
|
|
151
|
+
</div>
|
|
152
|
+
)}
|
|
153
|
+
<div className="data-space__viewer__quickstart__item__content__tab__label">
|
|
154
|
+
{config.title}
|
|
155
|
+
</div>
|
|
156
|
+
</button>
|
|
157
|
+
))}
|
|
158
|
+
</div>
|
|
159
|
+
{queryText !== undefined && (
|
|
160
|
+
<button
|
|
161
|
+
className={clsx(
|
|
162
|
+
'data-space__viewer__quickstart__item__content__tab',
|
|
163
|
+
{
|
|
164
|
+
'data-space__viewer__quickstart__item__content__tab--active':
|
|
165
|
+
selectedTab === TDS_EXECUTABLE_ACTION_TAB.QUERY_TEXT,
|
|
166
|
+
},
|
|
167
|
+
)}
|
|
168
|
+
tabIndex={-1}
|
|
169
|
+
onClick={() =>
|
|
170
|
+
setSelectedTab(TDS_EXECUTABLE_ACTION_TAB.QUERY_TEXT)
|
|
171
|
+
}
|
|
172
|
+
>
|
|
173
|
+
<div className="data-space__viewer__quickstart__item__content__tab__icon">
|
|
174
|
+
<CodeIcon className="data-space__viewer__quickstart__item__content__tab__icon--query" />
|
|
175
|
+
</div>
|
|
176
|
+
</button>
|
|
177
|
+
)}
|
|
178
|
+
</div>
|
|
179
|
+
<div className="data-space__viewer__quickstart__item__content__tab__content">
|
|
180
|
+
{selectedTab === TDS_EXECUTABLE_ACTION_TAB.COLUMN_SPECS && (
|
|
181
|
+
<div className="data-space__viewer__quickstart__tds__column-specs data-space__viewer__grid ag-theme-balham-dark">
|
|
182
|
+
<AgGridReact
|
|
183
|
+
rowData={columnSpecifications}
|
|
184
|
+
gridOptions={{
|
|
185
|
+
suppressScrollOnNewData: true,
|
|
186
|
+
getRowId: (rowData) => rowData.data.uuid,
|
|
187
|
+
}}
|
|
188
|
+
modules={[ClientSideRowModelModule]}
|
|
189
|
+
suppressFieldDotNotation={true}
|
|
190
|
+
columnDefs={[
|
|
191
|
+
{
|
|
192
|
+
minWidth: 50,
|
|
193
|
+
sortable: true,
|
|
194
|
+
resizable: true,
|
|
195
|
+
field: 'name',
|
|
196
|
+
headerName: `Column (${columnSpecifications.length})`,
|
|
197
|
+
flex: 1,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
minWidth: 50,
|
|
201
|
+
sortable: false,
|
|
202
|
+
resizable: true,
|
|
203
|
+
field: 'documentation',
|
|
204
|
+
headerName: 'Documentation',
|
|
205
|
+
flex: 1,
|
|
206
|
+
wrapText: true,
|
|
207
|
+
autoHeight: true,
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
minWidth: 50,
|
|
211
|
+
sortable: false,
|
|
212
|
+
resizable: true,
|
|
213
|
+
field: 'sample_values',
|
|
214
|
+
headerName: 'Sample Values',
|
|
215
|
+
flex: 1,
|
|
216
|
+
},
|
|
217
|
+
]}
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
220
|
+
)}
|
|
221
|
+
{selectedTab === TDS_EXECUTABLE_ACTION_TAB.QUERY && (
|
|
222
|
+
<div className="data-space__viewer__quickstart__tds__query">
|
|
223
|
+
<div className="data-space__viewer__quickstart__tds__query__actions">
|
|
224
|
+
<button
|
|
225
|
+
className="data-space__viewer__quickstart__tds__query__action btn--dark"
|
|
226
|
+
tabIndex={-1}
|
|
227
|
+
onClick={() => {
|
|
228
|
+
// TODO: wire this so we can go to the query for the service
|
|
229
|
+
}}
|
|
230
|
+
>
|
|
231
|
+
Open in Query
|
|
232
|
+
</button>
|
|
233
|
+
<button
|
|
234
|
+
className="data-space__viewer__quickstart__tds__query__action btn--dark"
|
|
235
|
+
tabIndex={-1}
|
|
236
|
+
disabled={true}
|
|
237
|
+
>
|
|
238
|
+
Open in Query with Test Data
|
|
239
|
+
</button>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
)}
|
|
243
|
+
{selectedTab === TDS_EXECUTABLE_ACTION_TAB.QUERY_TEXT &&
|
|
244
|
+
queryText !== undefined && (
|
|
245
|
+
<div className="data-space__viewer__quickstart__tds__query-text">
|
|
246
|
+
<div className="data-space__viewer__quickstart__tds__query-text__content">
|
|
247
|
+
<TextInputEditor
|
|
248
|
+
inputValue={queryText}
|
|
249
|
+
isReadOnly={true}
|
|
250
|
+
language={EDITOR_LANGUAGE.PURE}
|
|
251
|
+
showMiniMap={false}
|
|
252
|
+
hideGutter={true}
|
|
253
|
+
/>
|
|
254
|
+
</div>
|
|
255
|
+
<div className="data-space__viewer__quickstart__tds__query-text__actions">
|
|
256
|
+
<button
|
|
257
|
+
className="data-space__viewer__quickstart__tds__query-text__action"
|
|
258
|
+
tabIndex={-1}
|
|
259
|
+
title="Copy"
|
|
260
|
+
onClick={() => {
|
|
261
|
+
applicationStore.clipboardService
|
|
262
|
+
.copyTextToClipboard(queryText)
|
|
263
|
+
.catch(applicationStore.alertUnhandledError);
|
|
264
|
+
}}
|
|
265
|
+
>
|
|
266
|
+
<CopyIcon />
|
|
267
|
+
</button>
|
|
268
|
+
<button
|
|
269
|
+
className="data-space__viewer__quickstart__tds__query-text__action"
|
|
270
|
+
tabIndex={-1}
|
|
271
|
+
>
|
|
272
|
+
<MoreVerticalIcon />
|
|
273
|
+
</button>
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
)}
|
|
277
|
+
{currentTabExtensionConfig?.renderer(
|
|
278
|
+
dataSpaceViewerState,
|
|
279
|
+
executableAnalysisResult,
|
|
280
|
+
tdsResult,
|
|
281
|
+
)}
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
);
|
|
286
|
+
},
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
const DataSpaceExecutableAnalysisResultView = observer(
|
|
290
|
+
(props: {
|
|
291
|
+
dataSpaceViewerState: DataSpaceViewerState;
|
|
292
|
+
executableAnalysisResult: DataSpaceExecutableAnalysisResult;
|
|
293
|
+
}) => {
|
|
294
|
+
const { dataSpaceViewerState, executableAnalysisResult } = props;
|
|
295
|
+
|
|
296
|
+
if (
|
|
297
|
+
executableAnalysisResult.result instanceof DataSpaceExecutableTDSResult
|
|
298
|
+
) {
|
|
299
|
+
return (
|
|
300
|
+
<DataSpaceExecutableTDSResultView
|
|
301
|
+
dataSpaceViewerState={dataSpaceViewerState}
|
|
302
|
+
executableAnalysisResult={executableAnalysisResult}
|
|
303
|
+
tdsResult={executableAnalysisResult.result}
|
|
304
|
+
/>
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
return (
|
|
308
|
+
<div className="data-space__viewer__quickstart__item">
|
|
309
|
+
<div className="data-space__viewer__quickstart__item__header">
|
|
310
|
+
<div className="data-space__viewer__quickstart__item__header__title">
|
|
311
|
+
{executableAnalysisResult.title}
|
|
312
|
+
</div>
|
|
313
|
+
<div className="data-space__viewer__quickstart__item__header__type">
|
|
314
|
+
UNKNOWN
|
|
315
|
+
</div>
|
|
316
|
+
<div className="data-space__viewer__quickstart__item__header__anchor">
|
|
317
|
+
<AnchorLinkIcon />
|
|
318
|
+
</div>
|
|
319
|
+
</div>
|
|
320
|
+
{executableAnalysisResult.description !== undefined && (
|
|
321
|
+
<div className="data-space__viewer__quickstart__item__description">
|
|
322
|
+
<DataSpaceMarkdownTextViewer
|
|
323
|
+
value={executableAnalysisResult.description}
|
|
324
|
+
/>
|
|
325
|
+
</div>
|
|
326
|
+
)}
|
|
327
|
+
</div>
|
|
328
|
+
);
|
|
329
|
+
},
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
export const DataSpaceQuickStart = observer(
|
|
333
|
+
(props: { dataSpaceViewerState: DataSpaceViewerState }) => {
|
|
334
|
+
const { dataSpaceViewerState } = props;
|
|
335
|
+
const applicationStore = useApplicationStore();
|
|
336
|
+
const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
|
|
337
|
+
const documentationUrl = analysisResult.supportInfo?.documentationUrl;
|
|
338
|
+
|
|
339
|
+
const seeDocumentation = (): void => {
|
|
340
|
+
if (documentationUrl) {
|
|
341
|
+
applicationStore.navigationService.navigator.visitAddress(
|
|
342
|
+
documentationUrl,
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
return (
|
|
348
|
+
<div className="data-space__viewer__wiki__section">
|
|
349
|
+
<div className="data-space__viewer__wiki__section__header">
|
|
350
|
+
<div className="data-space__viewer__wiki__section__header__label">
|
|
351
|
+
Quick Start
|
|
352
|
+
<div className="data-space__viewer__wiki__section__header__anchor">
|
|
353
|
+
<AnchorLinkIcon />
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
|
+
{Boolean(documentationUrl) && (
|
|
357
|
+
<button
|
|
358
|
+
className="data-space__viewer__wiki__section__header__documentation"
|
|
359
|
+
tabIndex={-1}
|
|
360
|
+
onClick={seeDocumentation}
|
|
361
|
+
title="See Documentation"
|
|
362
|
+
>
|
|
363
|
+
<QuestionCircleIcon />
|
|
364
|
+
</button>
|
|
365
|
+
)}
|
|
366
|
+
</div>
|
|
367
|
+
<div className="data-space__viewer__wiki__section__content">
|
|
368
|
+
<div className="data-space__viewer__quickstart">
|
|
369
|
+
{analysisResult.executables.map((executable) => (
|
|
370
|
+
<DataSpaceExecutableAnalysisResultView
|
|
371
|
+
key={executable.uuid}
|
|
372
|
+
dataSpaceViewerState={dataSpaceViewerState}
|
|
373
|
+
executableAnalysisResult={executable}
|
|
374
|
+
/>
|
|
375
|
+
))}
|
|
376
|
+
</div>
|
|
377
|
+
</div>
|
|
378
|
+
</div>
|
|
379
|
+
);
|
|
380
|
+
},
|
|
381
|
+
);
|
|
@@ -27,14 +27,14 @@ const DataSpaceSupportEmailViewer = observer(
|
|
|
27
27
|
const { dataSpaceSupportEmail } = props;
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
|
-
<div className="data-
|
|
31
|
-
<div className="data-
|
|
32
|
-
<div className="data-
|
|
30
|
+
<div className="data-space__viewer__support__email">
|
|
31
|
+
<div className="data-space__viewer__support__email__entry">
|
|
32
|
+
<div className="data-space__viewer__support__email__entry__icon">
|
|
33
33
|
<EnvelopIcon />
|
|
34
34
|
</div>
|
|
35
35
|
<a
|
|
36
36
|
href={`mailto:${dataSpaceSupportEmail.address}`}
|
|
37
|
-
className="data-
|
|
37
|
+
className="data-space__viewer__support__email__entry__content"
|
|
38
38
|
>
|
|
39
39
|
{dataSpaceSupportEmail.address}
|
|
40
40
|
</a>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
|
18
|
-
import { BlankPanelContent, clsx } from '@finos/legend-art';
|
|
18
|
+
import { BlankPanelContent, VerifiedIcon, clsx } from '@finos/legend-art';
|
|
19
19
|
import {
|
|
20
20
|
type DataSpaceViewerState,
|
|
21
21
|
DATA_SPACE_VIEWER_ACTIVITY_MODE,
|
|
@@ -25,38 +25,48 @@ import { DataSpaceInfoPanel } from './DataSpaceInfoPanel.js';
|
|
|
25
25
|
import { DataSpaceSupportPanel } from './DataSpaceSupportPanel.js';
|
|
26
26
|
import { DataSpaceWiki } from './DataSpaceWiki.js';
|
|
27
27
|
import { DataSpaceViewerActivityBar } from './DataSpaceViewerActivityBar.js';
|
|
28
|
+
import { useRef, useState } from 'react';
|
|
28
29
|
|
|
29
|
-
const
|
|
30
|
-
(props: {
|
|
31
|
-
|
|
30
|
+
const DataSpaceHeader = observer(
|
|
31
|
+
(props: {
|
|
32
|
+
dataSpaceViewerState: DataSpaceViewerState;
|
|
33
|
+
showFullHeader: boolean;
|
|
34
|
+
}) => {
|
|
35
|
+
const { dataSpaceViewerState, showFullHeader } = props;
|
|
36
|
+
const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
|
|
32
37
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<div className="data-space__viewer__title__link">
|
|
55
|
-
<ExternalLinkSquareIcon />
|
|
56
|
-
</div>
|
|
57
|
-
</button>
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className={clsx('data-space__viewer__header', {
|
|
41
|
+
'data-space__viewer__header--floating': showFullHeader,
|
|
42
|
+
})}
|
|
43
|
+
>
|
|
44
|
+
<div
|
|
45
|
+
className={clsx('data-space__viewer__header__content', {
|
|
46
|
+
'data-space__viewer__header__content--expanded':
|
|
47
|
+
dataSpaceViewerState.isExpandedModeEnabled,
|
|
48
|
+
})}
|
|
49
|
+
>
|
|
50
|
+
<div
|
|
51
|
+
className="data-space__viewer__header__title"
|
|
52
|
+
title={`${analysisResult.title ?? analysisResult.name} - ${
|
|
53
|
+
analysisResult.path
|
|
54
|
+
}`}
|
|
55
|
+
>
|
|
56
|
+
<div className="data-space__viewer__header__title__label">
|
|
57
|
+
{analysisResult.title ?? analysisResult.name}
|
|
58
58
|
</div>
|
|
59
|
-
|
|
59
|
+
{dataSpaceViewerState.isVerified && (
|
|
60
|
+
<VerifiedIcon
|
|
61
|
+
className="data-space__viewer__header__title__verified-badge"
|
|
62
|
+
title="Verified Data Space"
|
|
63
|
+
/>
|
|
64
|
+
)}
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
},
|
|
60
70
|
);
|
|
61
71
|
|
|
62
72
|
const DataSpacePlaceholderPanel: React.FC<{ message: string }> = (props) => {
|
|
@@ -72,6 +82,13 @@ const DataSpacePlaceholderPanel: React.FC<{ message: string }> = (props) => {
|
|
|
72
82
|
export const DataSpaceViewer = observer(
|
|
73
83
|
(props: { dataSpaceViewerState: DataSpaceViewerState }) => {
|
|
74
84
|
const { dataSpaceViewerState } = props;
|
|
85
|
+
const bodyElement = useRef<HTMLDivElement>(null);
|
|
86
|
+
const [showFullHeader, setShowFullHeader] = useState(false);
|
|
87
|
+
|
|
88
|
+
const onScroll: React.UIEventHandler<HTMLDivElement> = (event) => {
|
|
89
|
+
setShowFullHeader(event.currentTarget.scrollTop > 0);
|
|
90
|
+
};
|
|
91
|
+
|
|
75
92
|
const isShowingWiki = [
|
|
76
93
|
DATA_SPACE_VIEWER_ACTIVITY_MODE.DESCRIPTION,
|
|
77
94
|
DATA_SPACE_VIEWER_ACTIVITY_MODE.DIAGRAM_VIEWER,
|
|
@@ -85,13 +102,22 @@ export const DataSpaceViewer = observer(
|
|
|
85
102
|
<DataSpaceViewerActivityBar
|
|
86
103
|
dataSpaceViewerState={dataSpaceViewerState}
|
|
87
104
|
/>
|
|
88
|
-
<div
|
|
105
|
+
<div
|
|
106
|
+
ref={bodyElement}
|
|
107
|
+
className="data-space__viewer__body"
|
|
108
|
+
onScroll={onScroll}
|
|
109
|
+
>
|
|
110
|
+
<DataSpaceHeader
|
|
111
|
+
dataSpaceViewerState={dataSpaceViewerState}
|
|
112
|
+
showFullHeader={showFullHeader}
|
|
113
|
+
/>
|
|
89
114
|
<div
|
|
90
115
|
className={clsx('data-space__viewer__frame', {
|
|
91
116
|
'data-space__viewer__frame--boundless': isShowingWiki,
|
|
117
|
+
'data-space__viewer__frame--expanded':
|
|
118
|
+
dataSpaceViewerState.isExpandedModeEnabled,
|
|
92
119
|
})}
|
|
93
120
|
>
|
|
94
|
-
<DataSpaceTitle dataSpaceViewerState={dataSpaceViewerState} />
|
|
95
121
|
<div className="data-space__viewer__content">
|
|
96
122
|
{isShowingWiki && (
|
|
97
123
|
<DataSpaceWiki dataSpaceViewerState={dataSpaceViewerState} />
|
|
@@ -14,50 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { MarkdownTextViewer } from '@finos/legend-art';
|
|
18
17
|
import type { DataSpaceViewerState } from '../stores/DataSpaceViewerState.js';
|
|
19
18
|
import { observer } from 'mobx-react-lite';
|
|
20
19
|
import { DataSpaceDiagramViewer } from './DataSpaceDiagramViewer.js';
|
|
21
20
|
import { DataSpaceModelsDocumentation } from './DataSpaceModelsDocumentation.js';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const { dataSpaceViewerState } = props;
|
|
26
|
-
const analysisResult = dataSpaceViewerState.dataSpaceAnalysisResult;
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<div className="data-space__viewer__wiki__section">
|
|
30
|
-
<div className="data-space__viewer__wiki__section__header">
|
|
31
|
-
Description
|
|
32
|
-
</div>
|
|
33
|
-
<div className="data-space__viewer__wiki__section__content">
|
|
34
|
-
<div className="data-space__viewer__description">
|
|
35
|
-
{analysisResult.description !== undefined && (
|
|
36
|
-
<div className="data-space__viewer__description__content">
|
|
37
|
-
<MarkdownTextViewer
|
|
38
|
-
className="data-space__viewer__description__content__markdown-content"
|
|
39
|
-
value={{
|
|
40
|
-
value: analysisResult.description,
|
|
41
|
-
}}
|
|
42
|
-
components={{
|
|
43
|
-
h1: 'h2',
|
|
44
|
-
h2: 'h3',
|
|
45
|
-
h3: 'h4',
|
|
46
|
-
}}
|
|
47
|
-
/>
|
|
48
|
-
</div>
|
|
49
|
-
)}
|
|
50
|
-
{analysisResult.description === undefined && (
|
|
51
|
-
<div className="data-space__viewer__description--empty">
|
|
52
|
-
No description
|
|
53
|
-
</div>
|
|
54
|
-
)}
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
},
|
|
60
|
-
);
|
|
21
|
+
import { DataSpaceQuickStart } from './DataSpaceQuickStart.js';
|
|
22
|
+
import { DataSpaceDataAccess } from './DataSpaceDataAccess.js';
|
|
23
|
+
import { DataSpaceDescription } from './DataSpaceDescription.js';
|
|
61
24
|
|
|
62
25
|
export const DataSpaceWiki = observer(
|
|
63
26
|
(props: { dataSpaceViewerState: DataSpaceViewerState }) => {
|
|
@@ -70,6 +33,8 @@ export const DataSpaceWiki = observer(
|
|
|
70
33
|
<DataSpaceModelsDocumentation
|
|
71
34
|
dataSpaceViewerState={dataSpaceViewerState}
|
|
72
35
|
/>
|
|
36
|
+
<DataSpaceQuickStart dataSpaceViewerState={dataSpaceViewerState} />
|
|
37
|
+
<DataSpaceDataAccess dataSpaceViewerState={dataSpaceViewerState} />
|
|
73
38
|
</div>
|
|
74
39
|
);
|
|
75
40
|
},
|
|
@@ -29,12 +29,21 @@ import { DSL_DataSpace_buildGraphManagerExtension } from './protocol/pure/DSL_Da
|
|
|
29
29
|
|
|
30
30
|
export const PURE_GRAMMAR_DATA_SPACE_PARSER_NAME = 'DataSpace';
|
|
31
31
|
export const PURE_GRAMMAR_DATA_SPACE_ELEMENT_TYPE_LABEL = 'DataSpace';
|
|
32
|
+
export const PURE_ENTERPRISE_PROFILE_PATH = 'meta::pure::profiles::enterprise';
|
|
33
|
+
export const PURE_ENTERPRISE_PROFILE_TAXONOMY_NODE_STEREOTYPE = 'taxonomyNodes';
|
|
34
|
+
export const PURE_DATA_SPACE_INFO_PROFILE_PATH =
|
|
35
|
+
'meta::pure::metamodel::dataSpace::profiles::DataSpaceInfo';
|
|
36
|
+
export const PURE_DATA_SPACE_INFO_PROFILE_VERIFIED_STEREOTYPE = 'Verified';
|
|
32
37
|
|
|
33
38
|
export class DSL_DataSpace_PureGraphManagerPlugin extends PureGraphManagerPlugin {
|
|
34
39
|
constructor() {
|
|
35
40
|
super(packageJson.extensions.pureGraphManagerPlugin, packageJson.version);
|
|
36
41
|
}
|
|
37
42
|
|
|
43
|
+
override getExtraExposedSystemElementPath(): string[] {
|
|
44
|
+
return [PURE_ENTERPRISE_PROFILE_PATH, PURE_DATA_SPACE_INFO_PROFILE_PATH];
|
|
45
|
+
}
|
|
46
|
+
|
|
38
47
|
override getExtraPureGraphManagerExtensionBuilders(): PureGraphManagerExtensionBuilder[] {
|
|
39
48
|
return [DSL_DataSpace_buildGraphManagerExtension];
|
|
40
49
|
}
|
|
@@ -83,10 +83,16 @@ export class DataSpaceServiceExecutableInfo extends DataSpaceExecutableInfo {
|
|
|
83
83
|
export abstract class DataSpaceExecutableResult {}
|
|
84
84
|
|
|
85
85
|
export class DataSpaceExecutableTDSResultColumn {
|
|
86
|
+
readonly uuid = uuid();
|
|
87
|
+
|
|
86
88
|
name!: string;
|
|
87
89
|
type?: string | undefined;
|
|
88
90
|
relationalType?: string | undefined;
|
|
89
91
|
documentation?: string | undefined;
|
|
92
|
+
|
|
93
|
+
// TODO: we need to think of how we want to support sample values, should we rely on the type here
|
|
94
|
+
// or should we rely on actual execution result on test data?
|
|
95
|
+
sampleValues = '';
|
|
90
96
|
}
|
|
91
97
|
|
|
92
98
|
export class DataSpaceExecutableTDSResult extends DataSpaceExecutableResult {
|
|
@@ -94,6 +100,8 @@ export class DataSpaceExecutableTDSResult extends DataSpaceExecutableResult {
|
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
export class DataSpaceExecutableAnalysisResult {
|
|
103
|
+
readonly uuid = uuid();
|
|
104
|
+
|
|
97
105
|
title!: string;
|
|
98
106
|
description?: string | undefined;
|
|
99
107
|
executable!: string;
|
|
@@ -41,8 +41,14 @@ import {
|
|
|
41
41
|
uniq,
|
|
42
42
|
type PlainObject,
|
|
43
43
|
} from '@finos/legend-shared';
|
|
44
|
-
import {
|
|
45
|
-
|
|
44
|
+
import {
|
|
45
|
+
DataSpaceSupportCombinedInfo,
|
|
46
|
+
DataSpaceSupportEmail,
|
|
47
|
+
} from '../../../../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
|
|
48
|
+
import {
|
|
49
|
+
V1_DataSpaceSupportCombinedInfo,
|
|
50
|
+
V1_DataSpaceSupportEmail,
|
|
51
|
+
} from '../../../../graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js';
|
|
46
52
|
import {
|
|
47
53
|
DataSpaceAnalysisResult,
|
|
48
54
|
DataSpaceDiagramAnalysisResult,
|
|
@@ -160,11 +166,24 @@ export class V1_DSL_DataSpace_PureGraphManagerExtension extends DSL_DataSpace_Pu
|
|
|
160
166
|
if (analysisResult.supportInfo) {
|
|
161
167
|
if (analysisResult.supportInfo instanceof V1_DataSpaceSupportEmail) {
|
|
162
168
|
const supportEmail = new DataSpaceSupportEmail();
|
|
169
|
+
supportEmail.documentationUrl =
|
|
170
|
+
analysisResult.supportInfo.documentationUrl;
|
|
163
171
|
supportEmail.address = guaranteeNonEmptyString(
|
|
164
172
|
analysisResult.supportInfo.address,
|
|
165
173
|
`Data space support email 'address' field is missing or empty`,
|
|
166
174
|
);
|
|
167
175
|
result.supportInfo = supportEmail;
|
|
176
|
+
} else if (
|
|
177
|
+
analysisResult.supportInfo instanceof V1_DataSpaceSupportCombinedInfo
|
|
178
|
+
) {
|
|
179
|
+
const combinedInfo = new DataSpaceSupportCombinedInfo();
|
|
180
|
+
combinedInfo.documentationUrl =
|
|
181
|
+
analysisResult.supportInfo.documentationUrl;
|
|
182
|
+
combinedInfo.website = analysisResult.supportInfo.website;
|
|
183
|
+
combinedInfo.faqUrl = analysisResult.supportInfo.faqUrl;
|
|
184
|
+
combinedInfo.supportUrl = analysisResult.supportInfo.supportUrl;
|
|
185
|
+
combinedInfo.emails = analysisResult.supportInfo.emails;
|
|
186
|
+
result.supportInfo = combinedInfo;
|
|
168
187
|
}
|
|
169
188
|
// NOTE: we will relax the check and not throw here for unknown support info type
|
|
170
189
|
}
|
|
@@ -294,7 +294,7 @@ export class V1_DataSpaceExecutableAnalysisResult {
|
|
|
294
294
|
executable: primitive(),
|
|
295
295
|
description: optional(primitive()),
|
|
296
296
|
info: optionalCustom(() => SKIP, V1_deserializeDataSpaceExecutableInfo),
|
|
297
|
-
|
|
297
|
+
result: custom(() => SKIP, V1_deserializeDataSpaceExecutableResult),
|
|
298
298
|
title: primitive(),
|
|
299
299
|
}),
|
|
300
300
|
);
|