diff --git a/src/components/Connections/ConnectionForm.tsx b/src/components/Connections/ConnectionForm.tsx index 9627778c23..5d8cc414f2 100644 --- a/src/components/Connections/ConnectionForm.tsx +++ b/src/components/Connections/ConnectionForm.tsx @@ -15,6 +15,7 @@ import { Icon } from "../Icon"; import React from "react"; import { FaTrash } from "react-icons/fa"; import { Button } from "../Button"; +import { mapValues, method } from "lodash"; export type Connection = { altID?: string; @@ -56,6 +57,7 @@ export type Connection = { username?: string; webhook?: string; workstation?: string; + properties?: Record; }; type ConnectionFormProps = React.HTMLProps & { @@ -98,13 +100,22 @@ export default function ConnectionForm({ const convertData = (data: Connection) => { if (connectionType?.preSubmitConverter) { - return connectionType.preSubmitConverter(data as any) as Connection; + const x = connectionType.preSubmitConverter(data as any) as Connection; + return { + ...x, + properties: mapValues(x.properties, method("toString")) + }; } const result: Record = {}; connectionType?.fields.forEach((field) => { - result[field.key] = data[field.key as keyof Connection]!; + result[field.key] = + data[field.key as keyof Omit]!; }); - return result as Connection; + return { + ...result, + name: data.name, + properties: mapValues(data.properties, method("toString")) + } as Connection; }; const getFieldView = (field: Field) => { diff --git a/src/components/Connections/connectionTypes.tsx b/src/components/Connections/connectionTypes.tsx index 5be90f4c10..b7d6ec58d8 100644 --- a/src/components/Connections/connectionTypes.tsx +++ b/src/components/Connections/connectionTypes.tsx @@ -591,7 +591,7 @@ export const connectionTypes: ConnectionType[] = [ ...data, region: data.properties?.region, profile: data.properties?.profile, - insecure_tls: data.properties?.insecureTLS + insecure_tls: data.properties?.insecureTLS === "true" } as Connection; }, preSubmitConverter: (data: Record) => {