@finos/legend-extension-dsl-data-space-studio 0.2.1 → 0.2.3
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 +12 -9
- 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
|
@@ -14,13 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
PanelFormSection,
|
|
19
|
-
CustomSelectorInput,
|
|
20
|
-
PanelFormTextField,
|
|
21
|
-
ListEditor,
|
|
22
|
-
WarningIcon,
|
|
23
|
-
} from '@finos/legend-art';
|
|
17
|
+
import { clsx, PlusIcon, TimesIcon, WarningIcon } from '@finos/legend-art';
|
|
24
18
|
import {
|
|
25
19
|
DataSpaceSupportEmail,
|
|
26
20
|
DataSpaceSupportCombinedInfo,
|
|
@@ -31,246 +25,242 @@ import {
|
|
|
31
25
|
dataSpace_setDocumentationUrl,
|
|
32
26
|
dataSpace_combined_setWebsite,
|
|
33
27
|
dataSpace_combined_setFaqUrl,
|
|
28
|
+
dataSpace_combined_setSupportUrl,
|
|
34
29
|
dataSpace_combined_addEmail,
|
|
35
30
|
dataSpace_combined_deleteEmail,
|
|
36
31
|
dataSpace_setSupportInfo,
|
|
37
32
|
} from '../../stores/studio/DSL_DataSpace_GraphModifierHelper.js';
|
|
38
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
EditorFormSection,
|
|
35
|
+
useEditorStore,
|
|
36
|
+
} from '@finos/legend-application-studio';
|
|
39
37
|
import { DataSpaceEditorState } from '../../stores/DataSpaceEditorState.js';
|
|
40
38
|
import { useState } from 'react';
|
|
41
39
|
|
|
40
|
+
type SupportInfoKind = 'none' | 'email' | 'combined';
|
|
41
|
+
|
|
42
|
+
const SupportLinkField = (props: {
|
|
43
|
+
label: string;
|
|
44
|
+
value: string | undefined;
|
|
45
|
+
placeholder: string;
|
|
46
|
+
isReadOnly: boolean;
|
|
47
|
+
onChange: (value: string) => void;
|
|
48
|
+
}): React.ReactNode => (
|
|
49
|
+
<label className="dataSpace-editor-field">
|
|
50
|
+
<span className="dataSpace-editor-field__label">{props.label}</span>
|
|
51
|
+
<input
|
|
52
|
+
className="input input--dark dataSpace-editor-field__input"
|
|
53
|
+
spellCheck={false}
|
|
54
|
+
disabled={props.isReadOnly}
|
|
55
|
+
value={props.value ?? ''}
|
|
56
|
+
onChange={(event): void => props.onChange(event.target.value)}
|
|
57
|
+
placeholder={props.placeholder}
|
|
58
|
+
/>
|
|
59
|
+
</label>
|
|
60
|
+
);
|
|
61
|
+
|
|
42
62
|
export const DataSpaceSupportInfoSection = observer(() => {
|
|
43
63
|
const editorStore = useEditorStore();
|
|
44
|
-
|
|
45
64
|
const dataSpaceState =
|
|
46
65
|
editorStore.tabManagerState.getCurrentEditorState(DataSpaceEditorState);
|
|
47
66
|
const dataSpace = dataSpaceState.dataSpace;
|
|
67
|
+
const isReadOnly = dataSpaceState.isReadOnly;
|
|
68
|
+
const supportInfo = dataSpace.supportInfo;
|
|
69
|
+
const [newEmail, setNewEmail] = useState('');
|
|
48
70
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
71
|
+
const kind: SupportInfoKind =
|
|
72
|
+
supportInfo instanceof DataSpaceSupportCombinedInfo
|
|
73
|
+
? 'combined'
|
|
74
|
+
: supportInfo instanceof DataSpaceSupportEmail
|
|
75
|
+
? 'email'
|
|
76
|
+
: 'none';
|
|
77
|
+
|
|
78
|
+
const changeKind = (type: SupportInfoKind): void => {
|
|
79
|
+
if (type === kind) {
|
|
52
80
|
return;
|
|
53
81
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const supportInfo = new DataSpaceSupportEmail();
|
|
60
|
-
if (dataSpace.supportInfo instanceof DataSpaceSupportCombinedInfo) {
|
|
61
|
-
supportInfo.address = dataSpace.supportInfo.emails?.[0] ?? '';
|
|
62
|
-
supportInfo.documentationUrl = dataSpace.supportInfo.documentationUrl;
|
|
82
|
+
if (type === 'combined') {
|
|
83
|
+
const combined = new DataSpaceSupportCombinedInfo();
|
|
84
|
+
if (supportInfo instanceof DataSpaceSupportEmail) {
|
|
85
|
+
combined.emails = supportInfo.address ? [supportInfo.address] : [];
|
|
86
|
+
combined.documentationUrl = supportInfo.documentationUrl;
|
|
63
87
|
}
|
|
64
|
-
dataSpace_setSupportInfo(dataSpace,
|
|
65
|
-
} else if (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (
|
|
71
|
-
dataSpace.supportInfo instanceof DataSpaceSupportEmail &&
|
|
72
|
-
dataSpace.supportInfo.address
|
|
73
|
-
) {
|
|
74
|
-
supportInfo.emails = [dataSpace.supportInfo.address];
|
|
75
|
-
supportInfo.documentationUrl = dataSpace.supportInfo.documentationUrl;
|
|
88
|
+
dataSpace_setSupportInfo(dataSpace, combined);
|
|
89
|
+
} else if (type === 'email') {
|
|
90
|
+
const email = new DataSpaceSupportEmail();
|
|
91
|
+
if (supportInfo instanceof DataSpaceSupportCombinedInfo) {
|
|
92
|
+
email.address = supportInfo.emails?.[0] ?? '';
|
|
93
|
+
email.documentationUrl = supportInfo.documentationUrl;
|
|
76
94
|
}
|
|
77
|
-
dataSpace_setSupportInfo(dataSpace,
|
|
95
|
+
dataSpace_setSupportInfo(dataSpace, email);
|
|
78
96
|
} else {
|
|
79
97
|
dataSpace_setSupportInfo(dataSpace, undefined);
|
|
80
98
|
}
|
|
81
99
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (dataSpace.supportInfo instanceof DataSpaceSupportCombinedInfo) {
|
|
91
|
-
dataSpace_combined_deleteEmail(dataSpace.supportInfo, email);
|
|
100
|
+
const addEmail = (): void => {
|
|
101
|
+
const email = newEmail.trim();
|
|
102
|
+
if (
|
|
103
|
+
email &&
|
|
104
|
+
supportInfo instanceof DataSpaceSupportCombinedInfo &&
|
|
105
|
+
!supportInfo.emails?.includes(email)
|
|
106
|
+
) {
|
|
107
|
+
dataSpace_combined_addEmail(supportInfo, email);
|
|
92
108
|
}
|
|
109
|
+
setNewEmail('');
|
|
93
110
|
};
|
|
111
|
+
// the single-email form is kept for data spaces that already use it
|
|
112
|
+
const kinds: { kind: SupportInfoKind; label: string }[] = [
|
|
113
|
+
{ kind: 'none', label: 'None' },
|
|
114
|
+
...(kind === 'email'
|
|
115
|
+
? [{ kind: 'email' as const, label: 'Email only' }]
|
|
116
|
+
: []),
|
|
117
|
+
{ kind: 'combined', label: 'Contacts and links' },
|
|
118
|
+
];
|
|
94
119
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<div className="panel__content__form__section__header__label">
|
|
103
|
-
{item}
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
);
|
|
107
|
-
},
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
const NewSupportEmailComponent = observer(
|
|
111
|
-
(props: { onFinishEditing: () => void }) => {
|
|
112
|
-
const { onFinishEditing } = props;
|
|
113
|
-
const [email, setEmail] = useState('');
|
|
114
|
-
|
|
115
|
-
return (
|
|
116
|
-
<div className="dataSpace-editor__general__support-info__new-email">
|
|
117
|
-
<div className="panel__content__form__section__list__new-item__input">
|
|
118
|
-
<input
|
|
119
|
-
className="input input-group__input panel__content__form__section__input input--dark"
|
|
120
|
-
type="email"
|
|
121
|
-
placeholder="Enter email"
|
|
122
|
-
value={email}
|
|
123
|
-
onChange={(event) => {
|
|
124
|
-
setEmail(event.target.value);
|
|
125
|
-
}}
|
|
126
|
-
/>
|
|
127
|
-
</div>
|
|
120
|
+
return (
|
|
121
|
+
<EditorFormSection
|
|
122
|
+
title="Support"
|
|
123
|
+
description="Who to contact about this data space, and where to read more."
|
|
124
|
+
>
|
|
125
|
+
<div className="dataSpace-editor-segmented dataSpace-editor-segmented--large">
|
|
126
|
+
{kinds.map((option) => (
|
|
128
127
|
<button
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
128
|
+
key={option.kind}
|
|
129
|
+
className={clsx('dataSpace-editor-segmented__option', {
|
|
130
|
+
'dataSpace-editor-segmented__option--active':
|
|
131
|
+
kind === option.kind,
|
|
132
|
+
})}
|
|
133
|
+
disabled={isReadOnly}
|
|
134
|
+
aria-pressed={kind === option.kind}
|
|
135
|
+
onClick={(): void => changeKind(option.kind)}
|
|
135
136
|
>
|
|
136
|
-
|
|
137
|
+
{option.label}
|
|
137
138
|
</button>
|
|
138
|
-
|
|
139
|
-
);
|
|
140
|
-
},
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
return (
|
|
144
|
-
<PanelFormSection className="dataSpace-editor__general__support-info">
|
|
145
|
-
<div className="panel__content__form__section__header__label">
|
|
146
|
-
Support Information
|
|
139
|
+
))}
|
|
147
140
|
</div>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
value ?? '',
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
}}
|
|
202
|
-
placeholder="Enter documentation URL"
|
|
203
|
-
/>
|
|
204
|
-
</PanelFormSection>
|
|
205
|
-
) : dataSpace.supportInfo instanceof DataSpaceSupportCombinedInfo ? (
|
|
206
|
-
<div>
|
|
207
|
-
<ListEditor
|
|
208
|
-
title="Emails"
|
|
209
|
-
items={dataSpace.supportInfo.emails}
|
|
210
|
-
keySelector={(element: string) => element}
|
|
211
|
-
ItemComponent={SupportEmailComponent}
|
|
212
|
-
NewItemComponent={NewSupportEmailComponent}
|
|
213
|
-
handleRemoveItem={handleSupportInfoEmailRemove}
|
|
214
|
-
isReadOnly={dataSpaceState.isReadOnly}
|
|
215
|
-
emptyMessage="No emails specified"
|
|
216
|
-
/>
|
|
217
|
-
{(dataSpace.supportInfo.emails === undefined ||
|
|
218
|
-
dataSpace.supportInfo.emails.length === 0) && (
|
|
219
|
-
<div className="service-editor__owner__validation">
|
|
141
|
+
{supportInfo instanceof DataSpaceSupportCombinedInfo && (
|
|
142
|
+
<>
|
|
143
|
+
<div className="dataSpace-editor-field">
|
|
144
|
+
<span className="dataSpace-editor-field__label">Contacts</span>
|
|
145
|
+
<div className="dataSpace-editor-chips">
|
|
146
|
+
{(supportInfo.emails ?? []).map((email) => (
|
|
147
|
+
<span key={email} className="dataSpace-editor-chips__chip">
|
|
148
|
+
{email}
|
|
149
|
+
{!isReadOnly && (
|
|
150
|
+
<button
|
|
151
|
+
className="dataSpace-editor-chips__remove"
|
|
152
|
+
onClick={(): void =>
|
|
153
|
+
dataSpace_combined_deleteEmail(supportInfo, email)
|
|
154
|
+
}
|
|
155
|
+
title={`Remove ${email}`}
|
|
156
|
+
>
|
|
157
|
+
<TimesIcon />
|
|
158
|
+
</button>
|
|
159
|
+
)}
|
|
160
|
+
</span>
|
|
161
|
+
))}
|
|
162
|
+
{!isReadOnly && (
|
|
163
|
+
<span className="dataSpace-editor-chips__new">
|
|
164
|
+
<input
|
|
165
|
+
className="dataSpace-editor-chips__input"
|
|
166
|
+
type="email"
|
|
167
|
+
spellCheck={false}
|
|
168
|
+
value={newEmail}
|
|
169
|
+
onChange={(event): void => setNewEmail(event.target.value)}
|
|
170
|
+
onKeyDown={(event): void => {
|
|
171
|
+
if (event.key === 'Enter') {
|
|
172
|
+
addEmail();
|
|
173
|
+
}
|
|
174
|
+
}}
|
|
175
|
+
placeholder="Add an email, then Enter"
|
|
176
|
+
/>
|
|
177
|
+
{newEmail && (
|
|
178
|
+
<button
|
|
179
|
+
className="dataSpace-editor-chips__add"
|
|
180
|
+
onClick={addEmail}
|
|
181
|
+
title="Add this email"
|
|
182
|
+
>
|
|
183
|
+
<PlusIcon />
|
|
184
|
+
</button>
|
|
185
|
+
)}
|
|
186
|
+
</span>
|
|
187
|
+
)}
|
|
188
|
+
</div>
|
|
189
|
+
{!supportInfo.emails?.length && (
|
|
190
|
+
<span className="dataSpace-editor-field__error">
|
|
220
191
|
<WarningIcon />
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
</div>
|
|
224
|
-
</div>
|
|
192
|
+
At least one email is required
|
|
193
|
+
</span>
|
|
225
194
|
)}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
195
|
+
</div>
|
|
196
|
+
<div className="dataSpace-editor-grid">
|
|
197
|
+
<SupportLinkField
|
|
198
|
+
label="Documentation"
|
|
199
|
+
value={supportInfo.documentationUrl}
|
|
200
|
+
placeholder="https://"
|
|
201
|
+
isReadOnly={isReadOnly}
|
|
202
|
+
onChange={(value): void =>
|
|
203
|
+
dataSpace_setDocumentationUrl(supportInfo, value)
|
|
204
|
+
}
|
|
205
|
+
/>
|
|
206
|
+
<SupportLinkField
|
|
207
|
+
label="Website"
|
|
208
|
+
value={supportInfo.website}
|
|
209
|
+
placeholder="https://"
|
|
210
|
+
isReadOnly={isReadOnly}
|
|
211
|
+
onChange={(value): void =>
|
|
212
|
+
dataSpace_combined_setWebsite(supportInfo, value)
|
|
213
|
+
}
|
|
238
214
|
/>
|
|
239
|
-
<
|
|
240
|
-
|
|
241
|
-
value={
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
)
|
|
246
|
-
|
|
247
|
-
dataSpace.supportInfo,
|
|
248
|
-
value ?? '',
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
}}
|
|
252
|
-
placeholder="Enter website URL"
|
|
215
|
+
<SupportLinkField
|
|
216
|
+
label="FAQ"
|
|
217
|
+
value={supportInfo.faqUrl}
|
|
218
|
+
placeholder="https://"
|
|
219
|
+
isReadOnly={isReadOnly}
|
|
220
|
+
onChange={(value): void =>
|
|
221
|
+
dataSpace_combined_setFaqUrl(supportInfo, value)
|
|
222
|
+
}
|
|
253
223
|
/>
|
|
254
|
-
<
|
|
255
|
-
|
|
256
|
-
value={
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
)
|
|
261
|
-
|
|
262
|
-
dataSpace.supportInfo,
|
|
263
|
-
value ?? '',
|
|
264
|
-
);
|
|
265
|
-
}
|
|
266
|
-
}}
|
|
267
|
-
placeholder="Enter FAQ URL"
|
|
224
|
+
<SupportLinkField
|
|
225
|
+
label="Support page"
|
|
226
|
+
value={supportInfo.supportUrl}
|
|
227
|
+
placeholder="https://"
|
|
228
|
+
isReadOnly={isReadOnly}
|
|
229
|
+
onChange={(value): void =>
|
|
230
|
+
dataSpace_combined_setSupportUrl(supportInfo, value)
|
|
231
|
+
}
|
|
268
232
|
/>
|
|
269
233
|
</div>
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
234
|
+
</>
|
|
235
|
+
)}
|
|
236
|
+
{supportInfo instanceof DataSpaceSupportEmail && (
|
|
237
|
+
<div className="dataSpace-editor-grid">
|
|
238
|
+
<SupportLinkField
|
|
239
|
+
label="Email"
|
|
240
|
+
value={supportInfo.address}
|
|
241
|
+
placeholder="team@example.com"
|
|
242
|
+
isReadOnly={isReadOnly}
|
|
243
|
+
onChange={(value): void =>
|
|
244
|
+
dataSpace_email_setSupportInfoEmail(supportInfo, value)
|
|
245
|
+
}
|
|
246
|
+
/>
|
|
247
|
+
<SupportLinkField
|
|
248
|
+
label="Documentation"
|
|
249
|
+
value={supportInfo.documentationUrl}
|
|
250
|
+
placeholder="https://"
|
|
251
|
+
isReadOnly={isReadOnly}
|
|
252
|
+
onChange={(value): void =>
|
|
253
|
+
dataSpace_setDocumentationUrl(supportInfo, value)
|
|
254
|
+
}
|
|
255
|
+
/>
|
|
256
|
+
</div>
|
|
257
|
+
)}
|
|
258
|
+
{!supportInfo && (
|
|
259
|
+
<div className="dataSpace-editor-table__empty">
|
|
260
|
+
No support information: people who open this data space won't see
|
|
261
|
+
who to contact.
|
|
262
|
+
</div>
|
|
263
|
+
)}
|
|
264
|
+
</EditorFormSection>
|
|
275
265
|
);
|
|
276
266
|
});
|
|
@@ -112,10 +112,9 @@ export class DataSpaceEditorState extends ElementEditorState {
|
|
|
112
112
|
availableRelatedDataSpaces: observable,
|
|
113
113
|
dataSpace: computed,
|
|
114
114
|
relatedDataSpaceTaggedValues: computed,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
deprecationNotice: computed,
|
|
115
|
+
// NOTE: the statuses (verified, in development, external, deprecation notice) are plain
|
|
116
|
+
// getters, not computed: the editor's header stays mounted across tabs, and a computed
|
|
117
|
+
// first read before the graph is observed would keep its stale value
|
|
119
118
|
reprocess: action,
|
|
120
119
|
isValidDataSpaceElement: action,
|
|
121
120
|
getDataSpaceElementOptions: action,
|
|
@@ -170,7 +170,9 @@ export const dataSpace_removeElement = action(
|
|
|
170
170
|
(dataSpace: DataSpace, element: DataSpaceElementPointer): void => {
|
|
171
171
|
if (dataSpace.elements) {
|
|
172
172
|
const index = dataSpace.elements.indexOf(element);
|
|
173
|
-
|
|
173
|
+
if (index !== -1) {
|
|
174
|
+
dataSpace.elements.splice(index, 1);
|
|
175
|
+
}
|
|
174
176
|
}
|
|
175
177
|
},
|
|
176
178
|
);
|
|
@@ -194,7 +196,9 @@ export const dataSpace_removeExecutable = action(
|
|
|
194
196
|
(dataSpace: DataSpace, executable: DataSpaceExecutable): void => {
|
|
195
197
|
if (dataSpace.executables) {
|
|
196
198
|
const index = dataSpace.executables.indexOf(executable);
|
|
197
|
-
|
|
199
|
+
if (index !== -1) {
|
|
200
|
+
dataSpace.executables.splice(index, 1);
|
|
201
|
+
}
|
|
198
202
|
}
|
|
199
203
|
},
|
|
200
204
|
);
|