diff --git a/src/components/Connections/ConnectionForm.tsx b/src/components/Connections/ConnectionForm.tsx index 9627778c2..b5e5db95a 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) => { @@ -180,13 +191,12 @@ export default function ConnectionForm({ }); }} > -
+
@@ -269,7 +279,7 @@ export default function ConnectionForm({ title={ connectionType ? (
{typeof connectionType?.icon === "string" ? ( diff --git a/src/components/Connections/connectionTypes.tsx b/src/components/Connections/connectionTypes.tsx index 4187d414f..b7d6ec58d 100644 --- a/src/components/Connections/connectionTypes.tsx +++ b/src/components/Connections/connectionTypes.tsx @@ -360,7 +360,7 @@ export const connectionTypes: ConnectionType[] = [ { title: "Redis", icon: "redis", - value: ConnectionValueType.AWS, + value: ConnectionValueType.Redis, fields: [ { label: "Name", @@ -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) => {