This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 33f7d340f fix(ui): guard against empty plugin prop on connection
creation page (#8918)
33f7d340f is described below
commit 33f7d340fa7a56071137aaf710f941ece6f4c182
Author: bujjibabukatta <[email protected]>
AuthorDate: Fri Jun 12 19:22:21 2026 +0530
fix(ui): guard against empty plugin prop on connection creation page (#8918)
---
config-ui/src/plugins/components/connection-form/index.tsx | 6 +++++-
config-ui/src/routes/connection/connections.tsx | 5 +++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/config-ui/src/plugins/components/connection-form/index.tsx
b/config-ui/src/plugins/components/connection-form/index.tsx
index 26432cee7..b61c1d5d0 100644
--- a/config-ui/src/plugins/components/connection-form/index.tsx
+++ b/config-ui/src/plugins/components/connection-form/index.tsx
@@ -110,7 +110,7 @@ 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);
@@ -118,6 +118,10 @@ export const ConnectionForm = ({ plugin, connectionId,
onSuccess }: Props) => {
const sanitizedCustomHeaders = useMemo(() =>
sanitizeCustomHeaders(values.customHeaders), [values.customHeaders]);
+ if (!plugin || !name) {
+ return null;
+ }
+
const handleTest = async () => {
const isUpdate = type === 'update' && !!connectionId;
await operator(
diff --git a/config-ui/src/routes/connection/connections.tsx
b/config-ui/src/routes/connection/connections.tsx
index 62427c45c..87b358b9e 100644
--- a/config-ui/src/routes/connection/connections.tsx
+++ b/config-ui/src/routes/connection/connections.tsx
@@ -61,8 +61,9 @@ export const Connections = () => {
setPlugin(plugin);
};
- const handleShowFormDialog = () => {
+ const handleShowFormDialog = (pluginName?: string) => {
setType('form');
+ if (pluginName) setPlugin(pluginName);
};
const handleHideDialog = () => {
@@ -168,7 +169,7 @@ export const Connections = () => {
<ConnectionList plugin={plugin} onCreate={handleShowFormDialog} />
</Modal>
)}
- {type === 'form' && pluginConfig && (
+ {type === 'form' && plugin && pluginConfig && (
<Modal
open
width={820}