Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export const ScopeConfigSelect = ({ plugin, connectionId, scopeConfigId, onCance
[data, scopeConfigId],
);

const defaultName = useMemo(() => `shared-config-<${(data ?? []).length}>`, [data]);

useEffect(() => {
setTrId(scopeConfigId);
}, [scopeConfigId]);
Expand Down Expand Up @@ -103,6 +105,7 @@ export const ScopeConfigSelect = ({ plugin, connectionId, scopeConfigId, onCance
<ScopeConfigForm
plugin={plugin}
connectionId={connectionId}
defaultName={defaultName}
onCancel={handleHideDialog}
onSubmit={handleSubmit}
/>
Expand Down
8 changes: 7 additions & 1 deletion config-ui/src/routes/connection/connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,18 @@ export const Connection = () => {

const handleScopeConfigChange = async (scopeConfigId?: ID) => {
if (!scopeConfigId) {
setVersion(version + 1);
return;
}

const [success, res] = await operator(() => API.scopeConfig.check(plugin, scopeConfigId), { hideToast: true });

if (success) {
if (!res.projects) {
setVersion(version + 1);
return;
}

modal.success({
closable: true,
centered: true,
Expand All @@ -250,7 +256,7 @@ export const Connection = () => {
</div>
<ul>
{res.projects.map((it: any) => (
<li style={{ marginBottom: 10 }}>
<li key={it.name} style={{ marginBottom: 10 }}>
<Space>
<span>{it.name}</span>
<Button
Expand Down