{!fields?.length ? (
@@ -42,20 +44,29 @@ export const ReadReplicas = ({
) : (
[
+ data={(readReplicas ?? []).map((field, i) => [
i + 1,
{getDatabaseConnectionDisplayName(field.databaseUrl)}
,
- }
- mode="destructive"
- onClick={() => {
- setValue(
- name,
- readReplicas.filter((_, index) => index !== i)
- );
- }}
- />,
+
+ }
+ onClick={() => {
+ setActiveRow(i);
+ setMode('edit');
+ }}
+ />
+ }
+ onClick={() => {
+ setValue(
+ name,
+ readReplicas.filter((_, index) => index !== i)
+ );
+ }}
+ />
+
,
])}
showActionCell
/>
@@ -69,6 +80,7 @@ export const ReadReplicas = ({
append({
databaseUrl: { connectionType: 'databaseUrl', url: '' },
});
+ setActiveRow(readReplicas?.length ?? 0);
}}
mode="primary"
icon={}
@@ -77,10 +89,10 @@ export const ReadReplicas = ({
)}
- {mode === 'add' && (
+ {(mode === 'add' || mode === 'edit') && (
diff --git a/frontend/libs/console/legacy-ce/src/lib/features/ConnectDBRedesign/components/ConnectPostgresWidget/parts/UsePreparedStatements.tsx b/frontend/libs/console/legacy-ce/src/lib/features/ConnectDBRedesign/components/ConnectPostgresWidget/parts/UsePreparedStatements.tsx
index 26ddd0c2702..e82715e0ec9 100644
--- a/frontend/libs/console/legacy-ce/src/lib/features/ConnectDBRedesign/components/ConnectPostgresWidget/parts/UsePreparedStatements.tsx
+++ b/frontend/libs/console/legacy-ce/src/lib/features/ConnectDBRedesign/components/ConnectPostgresWidget/parts/UsePreparedStatements.tsx
@@ -3,7 +3,7 @@ import { BooleanInput } from './BooleanInput';
export const UsePreparedStatements = ({ name }: { name: string }) => {
return (