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
6 changes: 5 additions & 1 deletion config-ui/src/plugins/components/connection-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,18 @@ export const ConnectionForm = ({ plugin, connectionId, onSuccess }: Props) => {
const {
name,
connection: { docLink, fields, initialValues },
} = getPluginConfig(plugin);
} = getPluginConfig(plugin) ?? {};

const disabled = useMemo(() => {
return Object.values(errors).some(Boolean);
}, [errors]);

const sanitizedCustomHeaders = useMemo(() => sanitizeCustomHeaders(values.customHeaders), [values.customHeaders]);

if (!plugin || !name) {
return null;
}

const handleTest = async () => {
const isUpdate = type === 'update' && !!connectionId;
await operator(
Expand Down
5 changes: 3 additions & 2 deletions config-ui/src/routes/connection/connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ export const Connections = () => {
setPlugin(plugin);
};

const handleShowFormDialog = () => {
const handleShowFormDialog = (pluginName?: string) => {
setType('form');
if (pluginName) setPlugin(pluginName);
};

const handleHideDialog = () => {
Expand Down Expand Up @@ -168,7 +169,7 @@ export const Connections = () => {
<ConnectionList plugin={plugin} onCreate={handleShowFormDialog} />
</Modal>
)}
{type === 'form' && pluginConfig && (
{type === 'form' && plugin && pluginConfig && (
<Modal
open
width={820}
Expand Down
Loading