@finos/legend-extension-dsl-data-space 9.1.4 → 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.
Files changed (168) hide show
  1. package/lib/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.d.ts +1 -1
  2. package/lib/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.d.ts.map +1 -1
  3. package/lib/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.js +15 -2
  4. package/lib/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.js.map +1 -1
  5. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts +0 -4
  6. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.d.ts.map +1 -1
  7. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js +0 -3
  8. package/lib/components/DSL_DataSpace_LegendApplicationPlugin.js.map +1 -1
  9. package/lib/components/DataSpaceDataAccess.d.ts +23 -0
  10. package/lib/components/DataSpaceDataAccess.d.ts.map +1 -0
  11. package/lib/components/DataSpaceDataAccess.js +34 -0
  12. package/lib/components/DataSpaceDataAccess.js.map +1 -0
  13. package/lib/components/DataSpaceDescription.d.ts +23 -0
  14. package/lib/components/DataSpaceDescription.d.ts.map +1 -0
  15. package/lib/components/DataSpaceDescription.js +26 -0
  16. package/lib/components/DataSpaceDescription.js.map +1 -0
  17. package/lib/components/DataSpaceDiagramViewer.d.ts +23 -0
  18. package/lib/components/DataSpaceDiagramViewer.d.ts.map +1 -0
  19. package/lib/components/DataSpaceDiagramViewer.js +75 -0
  20. package/lib/components/DataSpaceDiagramViewer.js.map +1 -0
  21. package/lib/components/DataSpaceExecutionContextViewer.d.ts +23 -0
  22. package/lib/components/DataSpaceExecutionContextViewer.d.ts.map +1 -0
  23. package/lib/components/DataSpaceExecutionContextViewer.js +58 -0
  24. package/lib/components/DataSpaceExecutionContextViewer.js.map +1 -0
  25. package/lib/components/DataSpaceInfoPanel.d.ts +23 -0
  26. package/lib/components/DataSpaceInfoPanel.d.ts.map +1 -0
  27. package/lib/components/DataSpaceInfoPanel.js +38 -0
  28. package/lib/components/DataSpaceInfoPanel.js.map +1 -0
  29. package/lib/components/DataSpaceMarkdownTextViewer.d.ts +20 -0
  30. package/lib/components/DataSpaceMarkdownTextViewer.d.ts.map +1 -0
  31. package/lib/components/DataSpaceMarkdownTextViewer.js +25 -0
  32. package/lib/components/DataSpaceMarkdownTextViewer.js.map +1 -0
  33. package/lib/components/DataSpaceModelsDocumentation.d.ts +23 -0
  34. package/lib/components/DataSpaceModelsDocumentation.d.ts.map +1 -0
  35. package/lib/components/DataSpaceModelsDocumentation.js +58 -0
  36. package/lib/components/DataSpaceModelsDocumentation.js.map +1 -0
  37. package/lib/components/{studio/DataSpacePreview.d.ts → DataSpacePlaceholder.d.ts} +4 -4
  38. package/lib/components/DataSpacePlaceholder.d.ts.map +1 -0
  39. package/lib/components/DataSpacePlaceholder.js +18 -0
  40. package/lib/components/DataSpacePlaceholder.js.map +1 -0
  41. package/lib/components/DataSpaceQuickStart.d.ts +23 -0
  42. package/lib/components/DataSpaceQuickStart.d.ts.map +1 -0
  43. package/lib/components/DataSpaceQuickStart.js +108 -0
  44. package/lib/components/DataSpaceQuickStart.js.map +1 -0
  45. package/lib/components/DataSpaceSupportPanel.d.ts +23 -0
  46. package/lib/components/DataSpaceSupportPanel.d.ts.map +1 -0
  47. package/lib/components/DataSpaceSupportPanel.js +40 -0
  48. package/lib/components/DataSpaceSupportPanel.js.map +1 -0
  49. package/lib/components/DataSpaceViewer.d.ts.map +1 -1
  50. package/lib/components/DataSpaceViewer.js +40 -276
  51. package/lib/components/DataSpaceViewer.js.map +1 -1
  52. package/lib/components/DataSpaceViewerActivityBar.d.ts +23 -0
  53. package/lib/components/DataSpaceViewerActivityBar.d.ts.map +1 -0
  54. package/lib/components/DataSpaceViewerActivityBar.js +105 -0
  55. package/lib/components/DataSpaceViewerActivityBar.js.map +1 -0
  56. package/lib/components/DataSpaceWiki.d.ts +23 -0
  57. package/lib/components/DataSpaceWiki.d.ts.map +1 -0
  58. package/lib/components/DataSpaceWiki.js +12 -0
  59. package/lib/components/DataSpaceWiki.js.map +1 -0
  60. package/lib/components/query/DataSpaceAdvancedSearchModal.js +1 -1
  61. package/lib/components/query/DataSpaceAdvancedSearchModal.js.map +1 -1
  62. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts +1 -2
  63. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts.map +1 -1
  64. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js +0 -13
  65. package/lib/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.js.map +1 -1
  66. package/lib/components/studio/DataSpacePreviewAction.js +1 -1
  67. package/lib/components/studio/DataSpacePreviewAction.js.map +1 -1
  68. package/lib/graph/DSL_DataSpace_HashUtils.d.ts +3 -2
  69. package/lib/graph/DSL_DataSpace_HashUtils.d.ts.map +1 -1
  70. package/lib/graph/DSL_DataSpace_HashUtils.js +3 -2
  71. package/lib/graph/DSL_DataSpace_HashUtils.js.map +1 -1
  72. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts +23 -0
  73. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.d.ts.map +1 -1
  74. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js +50 -0
  75. package/lib/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js.map +1 -1
  76. package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.d.ts +5 -0
  77. package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.d.ts.map +1 -1
  78. package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.js +7 -0
  79. package/lib/graphManager/DSL_DataSpace_PureGraphManagerPlugin.js.map +1 -1
  80. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts +39 -5
  81. package/lib/graphManager/action/analytics/DataSpaceAnalysis.d.ts.map +1 -1
  82. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js +40 -8
  83. package/lib/graphManager/action/analytics/DataSpaceAnalysis.js.map +1 -1
  84. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.d.ts.map +1 -1
  85. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js +70 -11
  86. package/lib/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.js.map +1 -1
  87. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.d.ts.map +1 -1
  88. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js +62 -10
  89. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.js.map +1 -1
  90. package/lib/graphManager/protocol/pure/v1/V1_DSL_DataSpace_SystemModels.json +7 -0
  91. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts +39 -0
  92. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.d.ts.map +1 -1
  93. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js +92 -3
  94. package/lib/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.js.map +1 -1
  95. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts +23 -0
  96. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.d.ts.map +1 -1
  97. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js +50 -0
  98. package/lib/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.js.map +1 -1
  99. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts +0 -1
  100. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.d.ts.map +1 -1
  101. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js +33 -5
  102. package/lib/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.js.map +1 -1
  103. package/lib/index.css +2 -2
  104. package/lib/index.css.map +1 -1
  105. package/lib/index.d.ts +2 -1
  106. package/lib/index.d.ts.map +1 -1
  107. package/lib/index.js +2 -1
  108. package/lib/index.js.map +1 -1
  109. package/lib/package.json +10 -6
  110. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.d.ts +32 -0
  111. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.d.ts.map +1 -0
  112. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.js +17 -0
  113. package/lib/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.js.map +1 -0
  114. package/lib/stores/DataSpaceViewerState.d.ts +17 -14
  115. package/lib/stores/DataSpaceViewerState.d.ts.map +1 -1
  116. package/lib/stores/DataSpaceViewerState.js +25 -12
  117. package/lib/stores/DataSpaceViewerState.js.map +1 -1
  118. package/lib/stores/studio/DataSpacePreviewState.d.ts.map +1 -1
  119. package/lib/stores/studio/DataSpacePreviewState.js +0 -3
  120. package/lib/stores/studio/DataSpacePreviewState.js.map +1 -1
  121. package/package.json +21 -17
  122. package/src/application/studio/DSL_DataSpace_LegendStudioCodeSnippet.ts +15 -2
  123. package/src/components/DSL_DataSpace_LegendApplicationPlugin.ts +0 -9
  124. package/src/components/DataSpaceDataAccess.tsx +66 -0
  125. package/src/components/DataSpaceDescription.tsx +55 -0
  126. package/src/components/DataSpaceDiagramViewer.tsx +199 -0
  127. package/src/components/DataSpaceExecutionContextViewer.tsx +167 -0
  128. package/src/components/DataSpaceInfoPanel.tsx +170 -0
  129. package/src/components/DataSpaceMarkdownTextViewer.tsx +33 -0
  130. package/src/components/DataSpaceModelsDocumentation.tsx +99 -0
  131. package/src/components/DataSpacePlaceholder.tsx +21 -0
  132. package/src/components/DataSpaceQuickStart.tsx +381 -0
  133. package/src/components/DataSpaceSupportPanel.tsx +80 -0
  134. package/src/components/DataSpaceViewer.tsx +88 -1052
  135. package/src/components/DataSpaceViewerActivityBar.tsx +215 -0
  136. package/src/components/DataSpaceWiki.tsx +41 -0
  137. package/src/components/query/DataSpaceAdvancedSearchModal.tsx +1 -1
  138. package/src/components/studio/DSL_DataSpace_LegendStudioApplicationPlugin.tsx +0 -15
  139. package/src/components/studio/DataSpacePreviewAction.tsx +1 -1
  140. package/src/graph/DSL_DataSpace_HashUtils.ts +3 -2
  141. package/src/graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.ts +60 -0
  142. package/src/graphManager/DSL_DataSpace_PureGraphManagerPlugin.ts +9 -0
  143. package/src/graphManager/action/analytics/DataSpaceAnalysis.ts +54 -15
  144. package/src/graphManager/protocol/pure/DSL_DataSpace_PureProtocolProcessorPlugin.ts +99 -14
  145. package/src/graphManager/protocol/pure/v1/V1_DSL_DataSpace_PureGraphManagerExtension.ts +86 -17
  146. package/src/graphManager/protocol/pure/v1/V1_DSL_DataSpace_SystemModels.json +7 -0
  147. package/src/graphManager/protocol/pure/v1/engine/analytics/V1_DataSpaceAnalysis.ts +140 -2
  148. package/src/graphManager/protocol/pure/v1/model/packageableElements/dataSpace/V1_DSL_DataSpace_DataSpace.ts +60 -0
  149. package/src/graphManager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataSpace_ProtocolHelper.ts +51 -7
  150. package/src/index.ts +2 -4
  151. package/src/stores/DSL_DataSpace_LegendApplicationPlugin_Extension.ts +41 -0
  152. package/src/stores/DataSpaceViewerState.ts +39 -20
  153. package/src/stores/studio/DataSpacePreviewState.ts +0 -5
  154. package/tsconfig.json +13 -3
  155. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.d.ts +0 -28
  156. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.d.ts.map +0 -1
  157. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.js +0 -30
  158. package/lib/application/studio/DSL_DataSpace_LegendStudioNavigation.js.map +0 -1
  159. package/lib/components/studio/DataSpacePreview.d.ts.map +0 -1
  160. package/lib/components/studio/DataSpacePreview.js +0 -52
  161. package/lib/components/studio/DataSpacePreview.js.map +0 -1
  162. package/lib/stores/studio/DataSpacePreviewStore.d.ts +0 -34
  163. package/lib/stores/studio/DataSpacePreviewStore.d.ts.map +0 -1
  164. package/lib/stores/studio/DataSpacePreviewStore.js +0 -98
  165. package/lib/stores/studio/DataSpacePreviewStore.js.map +0 -1
  166. package/src/application/studio/DSL_DataSpace_LegendStudioNavigation.ts +0 -53
  167. package/src/components/studio/DataSpacePreview.tsx +0 -129
  168. package/src/stores/studio/DataSpacePreviewStore.ts +0 -172
@@ -0,0 +1,381 @@
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 { 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
+ );
@@ -0,0 +1,80 @@
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 { observer } from 'mobx-react-lite';
18
+ import { BlankPanelContent, EnvelopIcon } from '@finos/legend-art';
19
+ import { DataSpaceSupportEmail } from '../graph/metamodel/pure/model/packageableElements/dataSpace/DSL_DataSpace_DataSpace.js';
20
+ import { type DataSpaceViewerState } from '../stores/DataSpaceViewerState.js';
21
+
22
+ const DataSpaceSupportEmailViewer = observer(
23
+ (props: {
24
+ dataSpaceViewerState: DataSpaceViewerState;
25
+ dataSpaceSupportEmail: DataSpaceSupportEmail;
26
+ }) => {
27
+ const { dataSpaceSupportEmail } = props;
28
+
29
+ return (
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
+ <EnvelopIcon />
34
+ </div>
35
+ <a
36
+ href={`mailto:${dataSpaceSupportEmail.address}`}
37
+ className="data-space__viewer__support__email__entry__content"
38
+ >
39
+ {dataSpaceSupportEmail.address}
40
+ </a>
41
+ </div>
42
+ </div>
43
+ );
44
+ },
45
+ );
46
+
47
+ const DataSpaceSupport = observer(
48
+ (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
49
+ const { dataSpaceViewerState } = props;
50
+ const supportInfo =
51
+ dataSpaceViewerState.dataSpaceAnalysisResult.supportInfo;
52
+
53
+ if (supportInfo === undefined) {
54
+ return <BlankPanelContent>No support info available</BlankPanelContent>;
55
+ } else if (supportInfo instanceof DataSpaceSupportEmail) {
56
+ return (
57
+ <DataSpaceSupportEmailViewer
58
+ dataSpaceViewerState={dataSpaceViewerState}
59
+ dataSpaceSupportEmail={supportInfo}
60
+ />
61
+ );
62
+ }
63
+ return (
64
+ <BlankPanelContent>{`Can't display support info`}</BlankPanelContent>
65
+ );
66
+ },
67
+ );
68
+
69
+ export const DataSpaceSupportPanel = observer(
70
+ (props: { dataSpaceViewerState: DataSpaceViewerState }) => {
71
+ const { dataSpaceViewerState } = props;
72
+ return (
73
+ <div className="data-space__viewer__panel">
74
+ <div className="data-space__viewer__support-info">
75
+ <DataSpaceSupport dataSpaceViewerState={dataSpaceViewerState} />
76
+ </div>
77
+ </div>
78
+ );
79
+ },
80
+ );