@finos/legend-extension-dsl-data-space-studio 0.2.0 → 0.2.2
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/DataSpaceEditor.d.ts.map +1 -1
- package/lib/components/DataSpaceEditor.js +34 -3
- package/lib/components/DataSpaceEditor.js.map +1 -1
- package/lib/components/DataSpaceExecutionContextEditor.d.ts.map +1 -1
- package/lib/components/DataSpaceExecutionContextEditor.js +50 -6
- package/lib/components/DataSpaceExecutionContextEditor.js.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceDiagramsSection.d.ts.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceDiagramsSection.js +26 -35
- package/lib/components/DataSpaceGeneralEditor/DataSpaceDiagramsSection.js.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceElementsSection.d.ts.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceElementsSection.js +23 -29
- package/lib/components/DataSpaceGeneralEditor/DataSpaceElementsSection.js.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceExecutablesSection.d.ts.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceExecutablesSection.js +16 -5
- package/lib/components/DataSpaceGeneralEditor/DataSpaceExecutablesSection.js.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceGeneralEditor.d.ts.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceGeneralEditor.js +13 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceGeneralEditor.js.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceHomeTab.d.ts.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceHomeTab.js +6 -6
- package/lib/components/DataSpaceGeneralEditor/DataSpaceHomeTab.js.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceInfoTab.d.ts.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceInfoTab.js +7 -3
- package/lib/components/DataSpaceGeneralEditor/DataSpaceInfoTab.js.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceRelatedDataSpacesSection.d.ts.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceRelatedDataSpacesSection.js +14 -24
- package/lib/components/DataSpaceGeneralEditor/DataSpaceRelatedDataSpacesSection.js.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceSidebar.d.ts +4 -0
- package/lib/components/DataSpaceGeneralEditor/DataSpaceSidebar.d.ts.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceSidebar.js +4 -2
- package/lib/components/DataSpaceGeneralEditor/DataSpaceSidebar.js.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceSupportInfoSection.d.ts.map +1 -1
- package/lib/components/DataSpaceGeneralEditor/DataSpaceSupportInfoSection.js +49 -83
- package/lib/components/DataSpaceGeneralEditor/DataSpaceSupportInfoSection.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +4 -1
- package/lib/stores/DataSpaceEditorState.d.ts.map +1 -1
- package/lib/stores/DataSpaceEditorState.js +3 -4
- package/lib/stores/DataSpaceEditorState.js.map +1 -1
- package/lib/stores/studio/DSL_DataSpace_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/studio/DSL_DataSpace_GraphModifierHelper.js +6 -2
- package/lib/stores/studio/DSL_DataSpace_GraphModifierHelper.js.map +1 -1
- package/package.json +13 -10
- package/src/components/DataSpaceEditor.tsx +109 -23
- package/src/components/DataSpaceExecutionContextEditor.tsx +123 -57
- package/src/components/DataSpaceGeneralEditor/DataSpaceDiagramsSection.tsx +129 -100
- package/src/components/DataSpaceGeneralEditor/DataSpaceElementsSection.tsx +135 -78
- package/src/components/DataSpaceGeneralEditor/DataSpaceExecutablesSection.tsx +58 -31
- package/src/components/DataSpaceGeneralEditor/DataSpaceGeneralEditor.tsx +17 -0
- package/src/components/DataSpaceGeneralEditor/DataSpaceHomeTab.tsx +52 -51
- package/src/components/DataSpaceGeneralEditor/DataSpaceInfoTab.tsx +91 -36
- package/src/components/DataSpaceGeneralEditor/DataSpaceRelatedDataSpacesSection.tsx +67 -58
- package/src/components/DataSpaceGeneralEditor/DataSpaceSidebar.tsx +24 -2
- package/src/components/DataSpaceGeneralEditor/DataSpaceSupportInfoSection.tsx +204 -214
- package/src/stores/DataSpaceEditorState.ts +3 -4
- package/src/stores/studio/DSL_DataSpace_GraphModifierHelper.ts +6 -2
|
@@ -26,11 +26,23 @@ import { DataSpaceHomeTab } from './DataSpaceHomeTab.js';
|
|
|
26
26
|
import { DataSpaceExecutionContextEditor } from '../DataSpaceExecutionContextEditor.js';
|
|
27
27
|
import { DataspaceExecutablesSection } from './DataSpaceExecutablesSection.js';
|
|
28
28
|
import { DataSpaceInfoTab } from './DataSpaceInfoTab.js';
|
|
29
|
+
import {
|
|
30
|
+
dataSpaceNeedsExecutionContextOrExecutable,
|
|
31
|
+
hasExecutionContextValidationError,
|
|
32
|
+
} from './DataSpaceValidation.js';
|
|
29
33
|
|
|
30
34
|
export const DataSpaceGeneralEditor = observer(() => {
|
|
31
35
|
const editorStore = useEditorStore();
|
|
32
36
|
const dataSpaceState =
|
|
33
37
|
editorStore.tabManagerState.getCurrentEditorState(DataSpaceEditorState);
|
|
38
|
+
const dataSpace = dataSpaceState.dataSpace;
|
|
39
|
+
const executionContexts = dataSpace.executionContexts ?? [];
|
|
40
|
+
const tabsWithIssues = [
|
|
41
|
+
dataSpaceNeedsExecutionContextOrExecutable(dataSpace) &&
|
|
42
|
+
DATA_SPACE_TAB.HOME,
|
|
43
|
+
executionContexts.some(hasExecutionContextValidationError) &&
|
|
44
|
+
DATA_SPACE_TAB.EXECUTION_CONTEXTS,
|
|
45
|
+
].filter((tab): tab is DATA_SPACE_TAB => Boolean(tab));
|
|
34
46
|
|
|
35
47
|
const renderTab = (): React.ReactNode => {
|
|
36
48
|
switch (dataSpaceState.selectedTab) {
|
|
@@ -51,6 +63,11 @@ export const DataSpaceGeneralEditor = observer(() => {
|
|
|
51
63
|
<DataSpaceSidebar
|
|
52
64
|
selectedTab={dataSpaceState.selectedTab}
|
|
53
65
|
setSelectedTab={(tab): void => dataSpaceState.setSelectedTab(tab)}
|
|
66
|
+
counts={{
|
|
67
|
+
[DATA_SPACE_TAB.EXECUTION_CONTEXTS]: executionContexts.length,
|
|
68
|
+
[DATA_SPACE_TAB.EXECUTABLES]: dataSpace.executables?.length ?? 0,
|
|
69
|
+
}}
|
|
70
|
+
tabsWithIssues={tabsWithIssues}
|
|
54
71
|
/>
|
|
55
72
|
<div className="dataSpace-editor__general__content">{renderTab()}</div>
|
|
56
73
|
</PanelContentLists>
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
|
+
EditorForm,
|
|
19
|
+
EditorFormSection,
|
|
18
20
|
useEditorStore,
|
|
19
21
|
useLegendAISuggestTelemetry,
|
|
20
22
|
LEGEND_STUDIO_DOCUMENTATION_KEY,
|
|
@@ -23,12 +25,7 @@ import {
|
|
|
23
25
|
type DSL_DataSpace_LegendStudioApplicationPlugin_Extension,
|
|
24
26
|
} from '@finos/legend-application-studio';
|
|
25
27
|
import { DataSpace } from '@finos/legend-extension-dsl-data-space/graph';
|
|
26
|
-
import {
|
|
27
|
-
PanelForm,
|
|
28
|
-
PanelFormTextField,
|
|
29
|
-
PanelLoadingIndicator,
|
|
30
|
-
SparkleIcon,
|
|
31
|
-
} from '@finos/legend-art';
|
|
28
|
+
import { PanelLoadingIndicator, SparkleIcon } from '@finos/legend-art';
|
|
32
29
|
import { observer } from 'mobx-react-lite';
|
|
33
30
|
import { useState } from 'react';
|
|
34
31
|
import {
|
|
@@ -195,7 +192,7 @@ export const DataSpaceHomeTab = observer(() => {
|
|
|
195
192
|
};
|
|
196
193
|
|
|
197
194
|
return (
|
|
198
|
-
<
|
|
195
|
+
<EditorForm>
|
|
199
196
|
{dataSpaceNeedsExecutionContextOrExecutable(dataSpace) && (
|
|
200
197
|
<InlineIssue
|
|
201
198
|
issue={{
|
|
@@ -205,50 +202,54 @@ export const DataSpaceHomeTab = observer(() => {
|
|
|
205
202
|
}}
|
|
206
203
|
/>
|
|
207
204
|
)}
|
|
208
|
-
{aiDocSuggester && (
|
|
209
|
-
<div className="dataSpace-editor__ai-suggest">
|
|
210
|
-
<button
|
|
211
|
-
className="dataSpace-editor__ai-suggest-btn"
|
|
212
|
-
onClick={(): void => runSuggestWithAI(false)}
|
|
213
|
-
disabled={isSuggestingWithAI || isReadOnly}
|
|
214
|
-
title="Use AI to suggest titles and descriptions for this data space, its execution contexts, diagrams, and executables"
|
|
215
|
-
>
|
|
216
|
-
<SparkleIcon />
|
|
217
|
-
<span>
|
|
218
|
-
{isSuggestingWithAI ? 'Suggesting...' : 'Suggest with AI'}
|
|
219
|
-
</span>
|
|
220
|
-
</button>
|
|
221
|
-
<span className="dataSpace-editor__ai-suggest__hint">
|
|
222
|
-
Fill in titles and descriptions, then review which to keep
|
|
223
|
-
</span>
|
|
224
|
-
</div>
|
|
225
|
-
)}
|
|
226
205
|
<PanelLoadingIndicator isLoading={isSuggestingWithAI && !aiSuggestion} />
|
|
227
|
-
<
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
206
|
+
<EditorFormSection
|
|
207
|
+
title="About"
|
|
208
|
+
description="The title and description people see when they browse and search data spaces."
|
|
209
|
+
actions={
|
|
210
|
+
aiDocSuggester && (
|
|
211
|
+
<button
|
|
212
|
+
className="dataSpace-editor__ai-suggest-btn"
|
|
213
|
+
onClick={(): void => runSuggestWithAI(false)}
|
|
214
|
+
disabled={isSuggestingWithAI || isReadOnly}
|
|
215
|
+
title="Use AI to suggest titles and descriptions for this data space, its execution contexts, diagrams, and executables, then review which to keep"
|
|
216
|
+
>
|
|
217
|
+
<SparkleIcon />
|
|
218
|
+
<span>
|
|
219
|
+
{isSuggestingWithAI ? 'Suggesting...' : 'Suggest with AI'}
|
|
220
|
+
</span>
|
|
221
|
+
</button>
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
>
|
|
225
|
+
<label className="dataSpace-editor-field">
|
|
226
|
+
<span className="dataSpace-editor-field__label">Title</span>
|
|
227
|
+
<input
|
|
228
|
+
className="input input--dark dataSpace-editor-field__input"
|
|
229
|
+
spellCheck={false}
|
|
230
|
+
disabled={isReadOnly}
|
|
231
|
+
value={dataSpace.title ?? ''}
|
|
232
|
+
onChange={(event): void =>
|
|
233
|
+
handleTitleChange(event.target.value || undefined)
|
|
234
|
+
}
|
|
235
|
+
placeholder={dataSpace.name}
|
|
236
|
+
/>
|
|
237
|
+
</label>
|
|
238
|
+
<label className="dataSpace-editor-field">
|
|
239
|
+
<span className="dataSpace-editor-field__label">Description</span>
|
|
240
|
+
<textarea
|
|
241
|
+
className="input input--dark dataSpace-editor-field__textarea"
|
|
242
|
+
spellCheck={false}
|
|
243
|
+
disabled={isReadOnly}
|
|
244
|
+
value={dataSpace.description ?? ''}
|
|
245
|
+
onChange={(event): void => {
|
|
246
|
+
handleDescriptionChange(event.target.value);
|
|
247
|
+
}}
|
|
248
|
+
rows={4}
|
|
249
|
+
placeholder="What data this data space gives access to, and who it is for"
|
|
250
|
+
/>
|
|
251
|
+
</label>
|
|
252
|
+
</EditorFormSection>
|
|
252
253
|
{aiSuggestion && (
|
|
253
254
|
<DataSpaceAISuggestionReviewModal
|
|
254
255
|
key={aiSuggestion.id}
|
|
@@ -263,6 +264,6 @@ export const DataSpaceHomeTab = observer(() => {
|
|
|
263
264
|
<DataSpaceDiagramsSection />
|
|
264
265
|
<DataSpaceElementsSection />
|
|
265
266
|
<DataSpaceSupportInfoSection />
|
|
266
|
-
</
|
|
267
|
+
</EditorForm>
|
|
267
268
|
);
|
|
268
269
|
});
|
|
@@ -14,54 +14,109 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import { useEditorStore } from '@finos/legend-application-studio';
|
|
18
17
|
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} from '@finos/legend-
|
|
18
|
+
EditorForm,
|
|
19
|
+
EditorFormSection,
|
|
20
|
+
useEditorStore,
|
|
21
|
+
} from '@finos/legend-application-studio';
|
|
22
|
+
import { CheckSquareIcon, clsx, SquareIcon } from '@finos/legend-art';
|
|
23
23
|
import { observer } from 'mobx-react-lite';
|
|
24
24
|
import { DataSpaceEditorState } from '../../stores/DataSpaceEditorState.js';
|
|
25
25
|
import { DataSpaceRelatedDataSpacesSection } from './DataSpaceRelatedDataSpacesSection.js';
|
|
26
26
|
|
|
27
|
+
const StatusCheckbox = (props: {
|
|
28
|
+
label: string;
|
|
29
|
+
hint: string;
|
|
30
|
+
checked: boolean;
|
|
31
|
+
isReadOnly: boolean;
|
|
32
|
+
onChange: (value: boolean) => void;
|
|
33
|
+
}): React.ReactNode => (
|
|
34
|
+
<button
|
|
35
|
+
className={clsx('dataSpace-editor-checkbox', {
|
|
36
|
+
'dataSpace-editor-checkbox--checked': props.checked,
|
|
37
|
+
})}
|
|
38
|
+
role="checkbox"
|
|
39
|
+
aria-checked={props.checked}
|
|
40
|
+
disabled={props.isReadOnly}
|
|
41
|
+
onClick={(): void => props.onChange(!props.checked)}
|
|
42
|
+
>
|
|
43
|
+
{props.checked ? <CheckSquareIcon /> : <SquareIcon />}
|
|
44
|
+
<span className="dataSpace-editor-checkbox__text">
|
|
45
|
+
<span className="dataSpace-editor-checkbox__label">{props.label}</span>
|
|
46
|
+
<span className="dataSpace-editor-checkbox__hint">{props.hint}</span>
|
|
47
|
+
</span>
|
|
48
|
+
</button>
|
|
49
|
+
);
|
|
50
|
+
|
|
27
51
|
export const DataSpaceInfoTab = observer(() => {
|
|
28
52
|
const editorStore = useEditorStore();
|
|
29
53
|
const dataSpaceState =
|
|
30
54
|
editorStore.tabManagerState.getCurrentEditorState(DataSpaceEditorState);
|
|
31
55
|
const isReadOnly = dataSpaceState.isReadOnly;
|
|
56
|
+
const deprecationNotice = dataSpaceState.deprecationNotice;
|
|
32
57
|
|
|
33
58
|
return (
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
<EditorForm>
|
|
60
|
+
<EditorFormSection
|
|
61
|
+
title="Status"
|
|
62
|
+
description="How this data space is marked."
|
|
63
|
+
>
|
|
64
|
+
<div className="dataSpace-editor-checkboxes">
|
|
65
|
+
<StatusCheckbox
|
|
66
|
+
label="Verified"
|
|
67
|
+
hint="Marks this data space as verified."
|
|
68
|
+
checked={dataSpaceState.isVerified}
|
|
69
|
+
isReadOnly={isReadOnly}
|
|
70
|
+
onChange={(value): void => dataSpaceState.toggleVerified(value)}
|
|
71
|
+
/>
|
|
72
|
+
<StatusCheckbox
|
|
73
|
+
label="In development"
|
|
74
|
+
hint="Marks this data space as still in development."
|
|
75
|
+
checked={dataSpaceState.isInDevelopment}
|
|
76
|
+
isReadOnly={isReadOnly}
|
|
77
|
+
onChange={(value): void =>
|
|
78
|
+
dataSpaceState.toggleInDevelopment(value)
|
|
79
|
+
}
|
|
80
|
+
/>
|
|
81
|
+
<StatusCheckbox
|
|
82
|
+
label="External"
|
|
83
|
+
hint="Marks this data space as externally sourced."
|
|
84
|
+
checked={dataSpaceState.isExternal}
|
|
85
|
+
isReadOnly={isReadOnly}
|
|
86
|
+
onChange={(value): void => dataSpaceState.toggleExternal(value)}
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
</EditorFormSection>
|
|
90
|
+
<EditorFormSection
|
|
91
|
+
title="Deprecation"
|
|
92
|
+
description="A notice marks the data space as deprecated. Say what to use instead."
|
|
93
|
+
>
|
|
94
|
+
<label className="dataSpace-editor-field">
|
|
95
|
+
<span className="dataSpace-editor-field__label">Notice</span>
|
|
96
|
+
<textarea
|
|
97
|
+
className="input input--dark dataSpace-editor-field__textarea"
|
|
98
|
+
spellCheck={false}
|
|
99
|
+
disabled={isReadOnly}
|
|
100
|
+
rows={2}
|
|
101
|
+
value={deprecationNotice ?? ''}
|
|
102
|
+
onChange={(event): void =>
|
|
103
|
+
dataSpaceState.setDeprecationNotice(
|
|
104
|
+
event.target.value || undefined,
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
placeholder="Leave empty unless the data space is deprecated, e.g. 'Use model::NewDataSpace instead.'"
|
|
108
|
+
/>
|
|
109
|
+
</label>
|
|
110
|
+
{deprecationNotice && (
|
|
111
|
+
<div className="dataSpace-editor-notice-preview">
|
|
112
|
+
<span className="dataSpace-editor-notice-preview__label">
|
|
113
|
+
Deprecated
|
|
114
|
+
</span>
|
|
115
|
+
{deprecationNotice}
|
|
116
|
+
</div>
|
|
117
|
+
)}
|
|
118
|
+
</EditorFormSection>
|
|
64
119
|
<DataSpaceRelatedDataSpacesSection />
|
|
65
|
-
</
|
|
120
|
+
</EditorForm>
|
|
66
121
|
);
|
|
67
122
|
});
|
|
@@ -14,88 +14,97 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
|
|
17
|
+
import {
|
|
18
|
+
EditorFormSection,
|
|
19
|
+
useEditorStore,
|
|
20
|
+
} from '@finos/legend-application-studio';
|
|
21
|
+
import { CustomSelectorInput, PlusIcon, TimesIcon } from '@finos/legend-art';
|
|
19
22
|
import { type ResolvedDataSpaceEntityWithOrigin } from '@finos/legend-extension-dsl-data-space/application';
|
|
20
23
|
import { observer } from 'mobx-react-lite';
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
type RelatedDataSpaceRow,
|
|
24
|
-
} from '../../stores/DataSpaceEditorState.js';
|
|
24
|
+
import { useState } from 'react';
|
|
25
|
+
import { DataSpaceEditorState } from '../../stores/DataSpaceEditorState.js';
|
|
25
26
|
|
|
26
27
|
export const DataSpaceRelatedDataSpacesSection = observer(() => {
|
|
27
28
|
const editorStore = useEditorStore();
|
|
28
29
|
const applicationStore = editorStore.applicationStore;
|
|
29
30
|
const darkMode =
|
|
30
31
|
!applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
|
|
31
|
-
|
|
32
32
|
const dataSpaceState =
|
|
33
33
|
editorStore.tabManagerState.getCurrentEditorState(DataSpaceEditorState);
|
|
34
|
+
const isReadOnly = dataSpaceState.isReadOnly;
|
|
35
|
+
const rows = dataSpaceState.relatedDataSpaceRows;
|
|
36
|
+
const [isAdding, setIsAdding] = useState(false);
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
return (
|
|
39
|
+
<EditorFormSection
|
|
40
|
+
title="Related data spaces"
|
|
41
|
+
description="Other data spaces people may want, listed under Related Data Spaces."
|
|
42
|
+
>
|
|
43
|
+
{rows.length ? (
|
|
44
|
+
<div className="dataSpace-editor-table dataSpace-editor-table--related">
|
|
45
|
+
{rows.map((row) => (
|
|
46
|
+
<div key={row.id} className="dataSpace-editor-table__row">
|
|
47
|
+
<div className="dataSpace-editor-table__element">
|
|
48
|
+
<span className="dataSpace-editor-table__element__name">
|
|
49
|
+
{row.label}
|
|
50
|
+
</span>
|
|
51
|
+
</div>
|
|
52
|
+
<button
|
|
53
|
+
className="dataSpace-editor-table__remove-btn"
|
|
54
|
+
disabled={isReadOnly}
|
|
55
|
+
onClick={(): void =>
|
|
56
|
+
dataSpaceState.removeRelatedDataSpaceRow(row)
|
|
57
|
+
}
|
|
58
|
+
title="Remove this related data space"
|
|
59
|
+
>
|
|
60
|
+
<TimesIcon />
|
|
61
|
+
</button>
|
|
62
|
+
</div>
|
|
63
|
+
))}
|
|
55
64
|
</div>
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<div className="panel__content__form__section__list__new-item__input">
|
|
65
|
+
) : (
|
|
66
|
+
<div className="dataSpace-editor-table__empty">
|
|
67
|
+
No related data spaces.
|
|
68
|
+
</div>
|
|
69
|
+
)}
|
|
70
|
+
{isAdding ? (
|
|
71
|
+
<div className="dataSpace-editor-add-picker">
|
|
66
72
|
<CustomSelectorInput
|
|
67
73
|
options={dataSpaceState.getRelatedDataSpaceOptions()}
|
|
68
74
|
onChange={(option: {
|
|
69
75
|
label: string;
|
|
70
76
|
value: ResolvedDataSpaceEntityWithOrigin;
|
|
71
|
-
}) => {
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
}): void => {
|
|
78
|
+
dataSpaceState.addRelatedDataSpace(option.value);
|
|
79
|
+
setIsAdding(false);
|
|
74
80
|
}}
|
|
75
81
|
placeholder={
|
|
76
82
|
dataSpaceState.loadRelatedDataSpacesState.isInProgress
|
|
77
|
-
? 'Loading
|
|
78
|
-
: '
|
|
83
|
+
? 'Loading data spaces...'
|
|
84
|
+
: 'Choose a data space to add...'
|
|
79
85
|
}
|
|
80
86
|
isLoading={dataSpaceState.loadRelatedDataSpacesState.isInProgress}
|
|
81
87
|
darkMode={darkMode}
|
|
88
|
+
autoFocus={true}
|
|
89
|
+
openMenuOnFocus={true}
|
|
82
90
|
/>
|
|
91
|
+
<button
|
|
92
|
+
className="dataSpace-editor-add-picker__cancel"
|
|
93
|
+
onClick={(): void => setIsAdding(false)}
|
|
94
|
+
>
|
|
95
|
+
Cancel
|
|
96
|
+
</button>
|
|
83
97
|
</div>
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
NewItemComponent={NewRelatedDataSpaceComponent}
|
|
96
|
-
handleRemoveItem={handleRemoveRelatedDataSpace}
|
|
97
|
-
isReadOnly={dataSpaceState.isReadOnly}
|
|
98
|
-
emptyMessage="No related Data Spaces specified"
|
|
99
|
-
/>
|
|
98
|
+
) : (
|
|
99
|
+
<button
|
|
100
|
+
className="dataSpace-editor-add-btn"
|
|
101
|
+
disabled={isReadOnly}
|
|
102
|
+
onClick={(): void => setIsAdding(true)}
|
|
103
|
+
>
|
|
104
|
+
<PlusIcon />
|
|
105
|
+
Add related data space
|
|
106
|
+
</button>
|
|
107
|
+
)}
|
|
108
|
+
</EditorFormSection>
|
|
100
109
|
);
|
|
101
110
|
});
|
|
@@ -35,8 +35,12 @@ export const DataSpaceSidebar = observer(
|
|
|
35
35
|
(props: {
|
|
36
36
|
selectedTab: DATA_SPACE_TAB;
|
|
37
37
|
setSelectedTab: (tab: DATA_SPACE_TAB) => void;
|
|
38
|
+
/** how many items each tab holds, for the tabs that hold a list */
|
|
39
|
+
counts?: Partial<Record<DATA_SPACE_TAB, number>>;
|
|
40
|
+
/** tabs with something to fix */
|
|
41
|
+
tabsWithIssues?: DATA_SPACE_TAB[];
|
|
38
42
|
}) => {
|
|
39
|
-
const { selectedTab, setSelectedTab } = props;
|
|
43
|
+
const { selectedTab, setSelectedTab, counts, tabsWithIssues } = props;
|
|
40
44
|
return (
|
|
41
45
|
<div
|
|
42
46
|
className="data-space__viewer__activity-bar dataSpace-editor__sidebar"
|
|
@@ -54,10 +58,28 @@ export const DataSpaceSidebar = observer(
|
|
|
54
58
|
tabIndex={-1}
|
|
55
59
|
title={item.tab}
|
|
56
60
|
>
|
|
57
|
-
|
|
61
|
+
<span className="dataSpace-editor__sidebar__item__icon">
|
|
62
|
+
{item.icon}
|
|
63
|
+
{tabsWithIssues?.includes(item.tab) && (
|
|
64
|
+
<span
|
|
65
|
+
className="dataSpace-editor__sidebar__item__issue"
|
|
66
|
+
title="Something here needs fixing"
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
69
|
+
</span>
|
|
58
70
|
<span className="dataSpace-editor__sidebar__item__label">
|
|
59
71
|
{item.tab}
|
|
60
72
|
</span>
|
|
73
|
+
{counts?.[item.tab] !== undefined && (
|
|
74
|
+
<span
|
|
75
|
+
className={clsx('dataSpace-editor__sidebar__item__count', {
|
|
76
|
+
'dataSpace-editor__sidebar__item__count--empty':
|
|
77
|
+
!counts[item.tab],
|
|
78
|
+
})}
|
|
79
|
+
>
|
|
80
|
+
{counts[item.tab]}
|
|
81
|
+
</span>
|
|
82
|
+
)}
|
|
61
83
|
</button>
|
|
62
84
|
))}
|
|
63
85
|
</div>
|