From 27159c5ac68b06db8eaf9bc51c2c9bd922ec9353 Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Thu, 26 Oct 2023 22:49:03 +0300 Subject: [PATCH 1/3] fix: fix incorrect type for redis connection --- src/components/Connections/connectionTypes.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Connections/connectionTypes.tsx b/src/components/Connections/connectionTypes.tsx index 4187d414f..5be90f4c1 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", From f6872821418101fbb1efe942f586120b492c0a9c Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Thu, 26 Oct 2023 22:50:29 +0300 Subject: [PATCH 2/3] fix: fix insecure_tls to string and back from boolean Closes #1451 --- src/components/Connections/ConnectionForm.tsx | 17 ++++++++++++++--- src/components/Connections/connectionTypes.tsx | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/Connections/ConnectionForm.tsx b/src/components/Connections/ConnectionForm.tsx index 9627778c2..5d8cc414f 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 5be90f4c1..b7d6ec58d 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) => { From 70eda187a34c1b17afa9a6391b22ec2009791cec Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Fri, 27 Oct 2023 21:49:10 +0300 Subject: [PATCH 3/3] fix: fix scroll issues for the connection form --- src/components/Connections/ConnectionForm.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/Connections/ConnectionForm.tsx b/src/components/Connections/ConnectionForm.tsx index 5d8cc414f..b5e5db95a 100644 --- a/src/components/Connections/ConnectionForm.tsx +++ b/src/components/Connections/ConnectionForm.tsx @@ -191,13 +191,12 @@ export default function ConnectionForm({ }); }} > -
+
@@ -280,7 +279,7 @@ export default function ConnectionForm({ title={ connectionType ? (
{typeof connectionType?.icon === "string" ? (