Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix(instance): align GCP connection forms with other engines (#21464)

p0ny766468875222
diff --git a/docs/research/spanner-connection-layout.md b/docs/research/spanner-connection-layout.md
new file mode 100644
index 0000000000..a26cef5036
--- /dev/null
+++ b/docs/research/spanner-connection-layout.md
@@ -0,0 +1,26 @@
+# Spanner connection form layout research
+
+Research date: September 16, 2026. Sources are official product documentation. Visual observations below come from inspecting each documentation screenshot, not from testing the current applications.
+
+## Findings
+
+| Product | Verified pattern | Relevance to Bytebase |
+| --- | --- | --- |
+| [DBeaver Spanner](https://dbeaver.com/docs/dbeaver/Database-driver-Google-Cloud-Spanner/) | The [connection screenshot](https://dbeaver.com/docs/dbeaver/images/database/spanner/google-cloud-spanner-connection-main.png) stacks Project, Instance, and Database as separate full-width rows sharing one label column. Authentication and Credentials are dropdowns in a separate group. Driver properties and SSH have separate tabs. | Strong direct precedent for stacking cloud resource identifiers rather than creating two independent label columns. |
+| [DataGrip PostgreSQL](https://www.jetbrains.com/help/datagrip/postgresql.html) | The [connection screenshot](https://resources.jetbrains.com/help/img/idea/2026.2/db_connection_details_postgresql_default.png) pairs Host and Port on one row; Host is wider than Port (approximately 5:3 input widths in this screenshot). Authentication uses a dropdown. SSH/SSL and Advanced have separate tabs. | Supports treating network address and port as a coupled row, with unequal widths. Exact Bytebase proportions should follow its existing PostgreSQL form, not copy these pixels. |
+| [pgAdmin Server dialog](https://www.pgadmin.org/docs/pgadmin4/latest/server_dialog.html) | The [connection screenshot](https://www.pgadmin.org/static/docs/pgadmin4-9.17-docs/_images/server_connection.png) stacks Host name/address, Port, Maintenance database, and other fields; even Port uses the full input width. Parameters, SSH Tunnel, and Advanced are separate tabs. | Evidence for a coherent single scan path, but also a counterexample: compact paired host/port is not a universal product convention. |
+| [DataGrip Google Cloud](https://www.jetbrains.com/help/datagrip/clouds-google-cloud.html) | Documentation separates account authentication from selecting cloud databases and documents proxy configuration under Extended Connection Settings. | Supports separating ordinary connection information from less common network configuration. It does not establish an exact Spanner endpoint layout. |
+
+## Recommendation (design inference)
+
+Use the existing Bytebase horizontal form pattern: one shared left label column, Project ID and Instance ID on separate rows, then a long Endpoint field with a compact Port at its right, matching PostgreSQL's Hostname/Port row. Keep Authentication as the existing dropdown, including a sole option, per the stated visual-consistency preference. Align helper text beneath its input region.
+
+This combines the most relevant external precedent (DBeaver's stacked Spanner identifiers) with the local consistency requirement. Grouping identifiers under top labels can save a row, but would introduce another layout grammar within the same form. Changing every connection field to top labels is coherent in isolation but requires a broader cross-engine redesign.
+
+The products' separate network/advanced areas are inspiration for a future optional-endpoint disclosure, not evidence that these products hide precisely the same setting. An existing nondefault endpoint should remain visible when editing.
+
+## Limits
+
+- No usability testing was performed; the recommendation is a design judgment based on the supplied Bytebase screenshot and observed product patterns.
+- DBeaver's Spanner text table refers to a Cloud SQL-style instance format; this research uses its screenshot only for layout and does not rely on that questionable format description.
+- DataGrip documentation lists Spanner with basic support, but this research did not find a verified current Spanner-specific connection screenshot. Its PostgreSQL screenshot is the source for host/port observations.
diff --git a/frontend/src/components/instance/DataSourceForm.tsx b/frontend/src/components/instance/DataSourceForm.tsx
index e18ab43617..e33e61397e 100644
--- a/frontend/src/components/instance/DataSourceForm.tsx
+++ b/frontend/src/components/instance/DataSourceForm.tsx
@@ -338,7 +338,7 @@ export function DataSourceForm({
return [
{
value: DataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM,
- label: t("instance.password-type.google-iam"),
+ label: t("instance.password-type.google-cloud-iam"),
},
];
case Engine.MYSQL:
@@ -728,7 +728,9 @@ export function DataSourceForm({
? `secret:${passwordType}`
: `auth:${dataSource.authenticationType}`;
- const authenticationTypeControl = showMainFields && (
+ const authenticationTypeControl = (showMainFields ||
+ basicInfo.engine === Engine.SPANNER ||
+ basicInfo.engine === Engine.BIGQUERY) && (
<FormField
title={t("instance.authentication")}
className="sm:col-span-3 sm:col-start-1"
@@ -794,11 +796,10 @@ export function DataSourceForm({
? authenticationTypeControl
: !optionsOnly && (
<>
+ {!hideAuthentication && authenticationTypeControl}
{/* Main credential fields */}
{showMainFields && (
<>
- {!hideAuthentication && authenticationTypeControl}
-
{/* Kerberos config */}
{dataSource.saslConfig?.mechanism?.case === "krbConfig" && (
<FormField
@@ -1806,27 +1807,6 @@ export function DataSourceForm({
{(basicInfo.engine === Engine.SPANNER ||
basicInfo.engine === Engine.BIGQUERY) && (
<>
- <RadioGroup
- className="sm:col-span-3 sm:col-start-1 textlabel gap-x-4"
- value={String(dataSource.authenticationType)}
- onValueChange={(value) =>
- update({
- authenticationType: Number(
- value
- ) as DataSource_AuthenticationType,
- })
- }
- >
- {supportedAuthenticationTypes.map((item) => (
- <RadioGroupItem
- key={item.value}
- value={String(item.value)}
- disabled={!allowEdit}
- >
- {item.label}
- </RadioGroupItem>
- ))}
- </RadioGroup>
<CredentialSourceForm
dataSource={dataSource}
engine={basicInfo.engine}
diff --git a/frontend/src/components/instance/DataSourceSection.test.tsx b/frontend/src/components/instance/DataSourceSection.test.tsx
index bfd21640e3..b012244f8e 100644
--- a/frontend/src/components/instance/DataSourceSection.test.tsx
+++ b/frontend/src/components/instance/DataSourceSection.test.tsx
@@ -5,11 +5,13 @@ import { beforeEach, describe, expect, test, vi } from "vitest";
import { Engine } from "@/types/proto-es/v1/common_pb";
import {
DataSourceSchema,
+ DataSource_AuthenticationType,
DataSourceType,
InstanceSchema,
} from "@/types/proto-es/v1/instance_service_pb";
-import type { EditDataSource } from "./common";
+import type { DataSourceEditState, EditDataSource } from "./common";
import { DataSourceSection } from "./DataSourceSection";
+import { validateDataSource } from "./validation";
(
globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }
@@ -59,6 +61,7 @@ vi.mock("@/stores/app", () => ({
vi.mock("@/types", () => ({
DATASOURCE_READONLY_USER_NAME: "bytebase_readonly",
+ unknownDataSource: () => create(DataSourceSchema, { authenticationType: DataSource_AuthenticationType.PASSWORD }),
}));
const editDataSource = (
@@ -119,6 +122,7 @@ const renderSection = async () => {
button.textContent?.startsWith("common.read-only")
);
return {
+ container,
unmount: () =>
act(() => {
root.unmount();
@@ -187,3 +191,27 @@ describe("DataSourceSection incomplete markers", () => {
unmount();
});
});
+
+
+test.each([Engine.SPANNER, Engine.BIGQUERY])(
+ "new read-only GCP connections use IAM and require SaaS credentials for engine %s",
+ async (engine) => {
+ let state: DataSourceEditState = {dataSources: [adminDataSource], editingDataSourceId: "admin"};
+ mocks.context = {...mocks.context,
+ basicInfo: create(InstanceSchema, {engine}),
+ adminDataSource: {...adminDataSource, projectId: "valid-project", instanceId: "valid-instance"},
+ setDataSourceEditState: (update: (previous: DataSourceEditState) => DataSourceEditState) => {state = update(state);},
+ };
+ const {container, unmount} = await renderSection();
+ try {
+ const add = container.querySelector("svg.lucide-plus")?.closest("button");
+ expect(add).toBeTruthy();
+ await act(async () => {add!.click();});
+ expect(state.dataSources).toHaveLength(2);
+ const draft = state.dataSources[1];
+ expect(draft.authenticationType).toBe(DataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM);
+ expect(draft.type).toBe(DataSourceType.READ_ONLY);
+ expect(validateDataSource(draft, {engine, isSaaSMode: true}).iamExtension).toBe("specific-credential");
+ } finally {unmount();}
+ }
+);
diff --git a/frontend/src/components/instance/DataSourceSection.tsx b/frontend/src/components/instance/DataSourceSection.tsx
index 6ff8c4c1d6..6e2f3a8a97 100644
--- a/frontend/src/components/instance/DataSourceSection.tsx
+++ b/frontend/src/components/instance/DataSourceSection.tsx
@@ -9,7 +9,7 @@ import { Engine } from "@/types/proto-es/v1/common_pb";
import { DataSourceType } from "@/types/proto-es/v1/instance_service_pb";
import { CreateDataSourceExample } from "./CreateDataSourceExample";
import type { EditDataSource } from "./common";
-import { wrapEditDataSource } from "./common";
+import { createDataSourceDraft } from "./common";
import { DataSourceForm } from "./DataSourceForm";
import { useInstanceFormContext } from "./InstanceFormContext";
import type { InfoSection } from "./info-content";
@@ -60,7 +60,7 @@ export function DataSourceSection({
const handleCreateRODataSource = useCallback(() => {
if (isCreating) return;
const ds = {
- ...wrapEditDataSource(undefined),
+ ...createDataSourceDraft(basicInfo.engine),
type: DataSourceType.READ_ONLY,
host: adminDataSource.host,
port: adminDataSource.port,
diff --git a/frontend/src/components/instance/InstanceFormBody.tsx b/frontend/src/components/instance/InstanceFormBody.tsx
index 9852127c96..ac9e69041e 100644
--- a/frontend/src/components/instance/InstanceFormBody.tsx
+++ b/frontend/src/components/instance/InstanceFormBody.tsx
@@ -72,6 +72,7 @@ import {
supportedEngineV1List,
urlfy,
} from "@/utils";
+import { normalizeAuthenticationType } from "./authentication";
import type { EditDataSource } from "./common";
import {
MongoDBConnectionStringSchemaList,
@@ -106,53 +107,61 @@ function GCPEndpointInput({
allowEdit: boolean;
}>) {
const { t } = useTranslation();
+ const endpointId = useId();
+ const portId = useId();
const [expanded, setExpanded] = useState(false);
const visible = expanded || !!endpoint || !!port;
if (!visible) {
if (!allowEdit) return null;
return (
- <div className="col-span-2">
+ <FormField title={t("instance.endpoint")}>
<Button
type="button"
appearance="link"
size="xs"
- className="h-auto p-0 text-sm"
+ className="h-auto p-0 text-sm self-start"
onClick={() => setExpanded(true)}
>
{t("instance.gcp-endpoint-toggle")}
</Button>
- </div>
+ </FormField>
);
}
return (
- <>
- <FormField title={<>{t("instance.endpoint")}</>}>
+ <FormField
+ title={
+ <FormLabel htmlFor={endpointId}>{t("instance.endpoint")}</FormLabel>
+ }
+ >
+ <div className="flex flex-wrap items-center gap-2">
<Input
+ id={endpointId}
value={endpoint}
placeholder={placeholder}
- className="w-full"
+ className="min-w-0 flex-1"
disabled={!allowEdit}
onChange={(e) => onUpdate({ host: e.target.value.trim() })}
/>
- </FormField>
- <FormField title={<>{t("instance.port")}</>}>
+ <FormLabel htmlFor={portId}>{t("instance.port")}</FormLabel>
<Input
+ id={portId}
+ aria-label={t("instance.port")}
value={port}
placeholder="443"
- className="w-full"
+ className="w-20 shrink-0"
disabled={!allowEdit}
onChange={(e) => {
if (e.target.value && !onlyAllowNumber(e.target.value)) return;
onUpdate({ port: e.target.value.trim() });
}}
/>
- </FormField>
- <p className="col-span-2 text-xs leading-4 text-control-light">
+ </div>
+ <p className="text-xs leading-4 text-control-light">
{t("instance.gcp-endpoint-tip", { example })}
</p>
- </>
+ </FormField>
);
}
@@ -183,7 +192,7 @@ function SpannerHostInput({
const isValidInstanceId = RE_GCP_INSTANCE_ID.test(instanceId);
return (
- <div className="grid grid-cols-2 gap-x-2 gap-y-1">
+ <div className="flex flex-col gap-4">
<FormField
validationField="projectId"
title={
@@ -227,19 +236,19 @@ function SpannerHostInput({
onUpdate({ instanceId: e.target.value.trim() });
}}
/>
+ <p className="text-xs leading-4 text-control-light">
+ {t("instance.find-gcp-project-id-and-instance-id")}{" "}
+ <a
+ href="https://docs.bytebase.com/get-started/connect/gcp?source=console"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="normal-link inline-flex items-center"
+ >
+ {t("common.detailed-guide")}
+ <ExternalLink className="size-4 ml-1" />
+ </a>
+ </p>
</FormField>
- <p className="col-span-2 text-xs leading-4 text-control-light">
- {t("instance.find-gcp-project-id-and-instance-id")}{" "}
- <a
- href="https://docs.bytebase.com/get-started/connect/gcp?source=console"
- target="_blank"
- rel="noopener noreferrer"
- className="normal-link inline-flex items-center"
- >
- {t("common.detailed-guide")}
- <ExternalLink className="size-4 ml-1" />
- </a>
- </p>
<GCPEndpointInput
endpoint={endpoint}
port={port}
@@ -275,7 +284,7 @@ function BigQueryHostInput({
const isValidProjectId = RE_GCP_PROJECT_ID.test(projectId);
return (
- <div className="grid grid-cols-2 gap-x-2 gap-y-1">
+ <div className="flex flex-col gap-4">
<FormField
validationField="projectId"
title={
@@ -297,19 +306,19 @@ function BigQueryHostInput({
onUpdate({ projectId: e.target.value.trim() });
}}
/>
+ <p className="text-xs leading-4 text-control-light">
+ {t("instance.find-gcp-project-id")}{" "}
+ <a
+ href="https://docs.bytebase.com/get-started/connect/gcp?source=console"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="normal-link inline-flex items-center"
+ >
+ {t("common.detailed-guide")}
+ <ExternalLink className="size-4 ml-1" />
+ </a>
+ </p>
</FormField>
- <p className="col-span-2 text-xs leading-4 text-control-light">
- {t("instance.find-gcp-project-id")}{" "}
- <a
- href="https://docs.bytebase.com/get-started/connect/gcp?source=console"
- target="_blank"
- rel="noopener noreferrer"
- className="normal-link inline-flex items-center"
- >
- {t("common.detailed-guide")}
- <ExternalLink className="size-4 ml-1" />
- </a>
- </p>
<GCPEndpointInput
endpoint={endpoint}
port={port}
@@ -1010,7 +1019,13 @@ export function InstanceFormBody({ onOpenInfoPanel }: InstanceFormBodyProps) {
setDataSourceEditState((prev) => {
const dataSources = prev.dataSources.map((ds) => {
if (ds.type !== DataSourceType.ADMIN) return ds;
- const updated = { ...ds };
+ const updated = {
+ ...ds,
+ authenticationType: normalizeAuthenticationType(
+ engine,
+ ds.authenticationType
+ ),
+ };
switch (engine) {
case Engine.SNOWFLAKE: {
clearLocalPlaceholderHost(updated);
@@ -1024,8 +1039,6 @@ export function InstanceFormBody({ onOpenInfoPanel }: InstanceFormBodyProps) {
}
case Engine.SPANNER:
case Engine.BIGQUERY: {
- updated.authenticationType =
- DataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM;
clearLocalPlaceholderHost(updated);
break;
}
diff --git a/frontend/src/components/instance/InstanceFormContext.test.tsx b/frontend/src/components/instance/InstanceFormContext.test.tsx
index 5727c15046..932d03532d 100644
--- a/frontend/src/components/instance/InstanceFormContext.test.tsx
+++ b/frontend/src/components/instance/InstanceFormContext.test.tsx
@@ -20,7 +20,7 @@ import { ProjectSchema } from "@/types/proto-es/v1/project_service_pb";
import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
import { unknownInstance } from "@/types/v1/instance";
import type { EditDataSource } from "./common";
-import { wrapEditDataSource } from "./common";
+import { createDataSourceDraft } from "./common";
import {
InstanceFormProvider,
useInstanceFormContext,
@@ -801,7 +801,7 @@ describe("InstanceFormProvider", () => {
const harness = renderIntoContainer();
try {
await harness.render(<InstanceFormProvider><Capture /></InstanceFormProvider>);
- const draft = wrapEditDataSource(create(DataSourceSchema, {
+ const draft = createDataSourceDraft(Engine.MYSQL, create(DataSourceSchema, {
authenticationType,
host: "project:region:instance",
region: "us-east-1",
@@ -1087,7 +1087,7 @@ describe("InstanceFormProvider", () => {
await harness.render(<InstanceFormProvider><Capture /></InstanceFormProvider>);
await act(async () => {
context.setBasicInfo((previous) => ({ ...previous, engine, title: "Production" }));
- context.setDataSourceEditState((previous) => ({ ...previous, dataSources: [wrapEditDataSource(create(DataSourceSchema, { id: "admin", type: DataSourceType.ADMIN, projectId: "valid-project", instanceId: "valid-instance" }))] }));
+ context.setDataSourceEditState((previous) => ({ ...previous, dataSources: [{ ...createDataSourceDraft(engine), id: "admin", type: DataSourceType.ADMIN, projectId: "valid-project", instanceId: "valid-instance" }] }));
});
expect(context.allowCreate).toBe(false);
await act(async () => { context.setResourceIdValidated(true); });
@@ -1099,7 +1099,8 @@ describe("InstanceFormProvider", () => {
describe("checkDataSource AWS region requirement", () => {
const awsDataSource = (region: string, withCredential: boolean) => {
- const ds = wrapEditDataSource(
+ const ds = createDataSourceDraft(
+ Engine.MYSQL,
create(DataSourceSchema, {
id: "admin",
type: DataSourceType.ADMIN,
@@ -1203,7 +1204,7 @@ describe("InstanceFormProvider", () => {
});
const editedDataSource = (edit: (ds: EditDataSource) => void) => {
- const ds = wrapEditDataSource(storedDataSource);
+ const ds = createDataSourceDraft(Engine.HIVE, storedDataSource);
edit(ds);
return ds;
};
@@ -1314,7 +1315,7 @@ describe("InstanceFormProvider", () => {
});
expect(
await renderWithStored([withoutPort], () =>
- wrapEditDataSource(withoutPort)
+ createDataSourceDraft(Engine.HIVE, withoutPort)
)
).toBe("true");
});
@@ -1327,7 +1328,7 @@ describe("InstanceFormProvider", () => {
});
expect(
await renderWithStored([withTunnel], () =>
- wrapEditDataSource(withTunnel)
+ createDataSourceDraft(Engine.HIVE, withTunnel)
)
).toBe("true");
});
@@ -1343,12 +1344,12 @@ describe("InstanceFormProvider", () => {
});
expect(
await renderWithStored([storedDataSource, readonlyDataSource], () =>
- wrapEditDataSource(readonlyDataSource)
+ createDataSourceDraft(Engine.HIVE, readonlyDataSource)
)
).toBe("false");
expect(
await renderWithStored([storedDataSource, readonlyDataSource], () => {
- const ds = wrapEditDataSource(readonlyDataSource);
+ const ds = createDataSourceDraft(Engine.HIVE, readonlyDataSource);
ds.host = "hive-replica-2.example.com";
return ds;
})
diff --git a/frontend/src/components/instance/authentication.ts b/frontend/src/components/instance/authentication.ts
index 7d5bc6dd72..d9d6f6683a 100644
--- a/frontend/src/components/instance/authentication.ts
+++ b/frontend/src/components/instance/authentication.ts
@@ -1,6 +1,15 @@
+import { Engine } from "@/types/proto-es/v1/common_pb";
import { DataSource_AuthenticationType } from "@/types/proto-es/v1/instance_service_pb";
export const isIAMAuthentication = (type: DataSource_AuthenticationType) =>
type === DataSource_AuthenticationType.AWS_RDS_IAM ||
type === DataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM ||
type === DataSource_AuthenticationType.AZURE_IAM;
+
+export const normalizeAuthenticationType = (
+ engine: Engine,
+ type: DataSource_AuthenticationType
+): DataSource_AuthenticationType =>
+ engine === Engine.SPANNER || engine === Engine.BIGQUERY
+ ? DataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM
+ : type;
diff --git a/frontend/src/components/instance/common.test.ts b/frontend/src/components/instance/common.test.ts
index 7e2ad8f155..4a6f2cc4d9 100644
--- a/frontend/src/components/instance/common.test.ts
+++ b/frontend/src/components/instance/common.test.ts
@@ -4,17 +4,18 @@ import { describe, expect, test } from "vitest";
import { Engine } from "@/types/proto-es/v1/common_pb";
import type { DataSource } from "@/types/proto-es/v1/instance_service_pb";
import {
+ DataSource_AuthenticationType,
DataSourceSchema,
KerberosConfigSchema,
SASLConfigSchema,
} from "@/types/proto-es/v1/instance_service_pb";
import {
calcDataSourceUpdateMask,
+ createDataSourceDraft,
type DataSourceSecretField,
getDataSourceSecretValue,
movesKeytabToNewDestination,
updateDataSourceSecret,
- wrapEditDataSource,
} from "./common";
import {
applyLocalTlsCaSource,
@@ -444,7 +445,7 @@ describe("secret edit intent", () => {
"explicitly clears %s even when the read value is redacted",
(field, path) => {
const original = create(DataSourceSchema, { id: "admin" });
- const untouched = wrapEditDataSource(original);
+ const untouched = createDataSourceDraft(Engine.MYSQL, original);
expect(getDataSourceSecretValue(untouched, field)).toBeUndefined();
expect(
calcDataSourceUpdateMask(original, original, untouched)
@@ -464,7 +465,7 @@ describe("secret edit intent", () => {
test("preserves whitespace and keeps an unrelated hidden secret out of the mask", () => {
const original = create(DataSourceSchema, { id: "admin" });
const changed = updateDataSourceSecret(
- wrapEditDataSource(original),
+ createDataSourceDraft(Engine.MYSQL, original),
"sshPassword",
" secret "
);
@@ -482,3 +483,14 @@ describe("secret edit intent", () => {
).toEqual(["ssh_password"]);
});
});
+
+test.each([Engine.SPANNER, Engine.BIGQUERY])(
+ "initializes new GCP drafts with IAM for engine %s",
+ (engine) => {
+ const draft = createDataSourceDraft(engine);
+ expect(draft.authenticationType).toBe(
+ DataSource_AuthenticationType.GOOGLE_CLOUD_SQL_IAM
+ );
+ expect(draft.pendingCreate).toBe(true);
+ }
+);
diff --git a/frontend/src/components/instance/common.ts b/frontend/src/components/instance/common.ts
index abca0f5235..fefc74e23b 100644
--- a/frontend/src/components/instance/common.ts
+++ b/frontend/src/components/instance/common.ts
@@ -13,6 +13,7 @@ import {
} from "@/types/proto-es/v1/instance_service_pb";
import { PlanType } from "@/types/proto-es/v1/subscription_service_pb";
import { calcUpdateMask } from "@/utils";
+import { normalizeAuthenticationType } from "./authentication";
import { hasSslConfig, SSL_UPDATE_MASK_FIELDS } from "./tls";
export type TlsUpdateState =
@@ -116,13 +117,14 @@ export type DataSourceEditState = {
export const extractDataSourceEditState = (
instance: Instance | undefined
): DataSourceEditState => {
+ const engine = instance?.engine ?? Engine.MYSQL;
const dataSources: EditDataSource[] = [];
instance?.dataSources.forEach((ds) => {
- dataSources.push(wrapEditDataSource(ds));
+ dataSources.push(createDataSourceDraft(engine, ds));
});
const adminDS = dataSources.find((ds) => ds.type === DataSourceType.ADMIN);
if (!adminDS) {
- dataSources.unshift(wrapEditDataSource(undefined));
+ dataSources.unshift(createDataSourceDraft(engine));
}
const editingDataSourceId =
dataSources.find((ds) => ds.type === DataSourceType.ADMIN)?.id ??
@@ -160,9 +162,19 @@ export const extractBasicInfo = (instance: Instance | undefined): BasicInfo => {
};
};
-export const wrapEditDataSource = (ds: DataSource | undefined) => {
+export const createDataSourceDraft = (
+ engine: Engine,
+ ds?: DataSource
+): EditDataSource => {
+ const draft = cloneDeep(ds ?? unknownDataSource());
+ if (ds === undefined) {
+ draft.authenticationType = normalizeAuthenticationType(
+ engine,
+ draft.authenticationType
+ );
+ }
return {
- ...cloneDeep(ds ?? unknownDataSource()),
+ ...draft,
pendingCreate: ds === undefined,
updatedPassword: "",
updatedMasterPassword: "",
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 6e791e1267..6fd284cd90 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1242,6 +1242,7 @@
"external-secret-azure": "Azure Key Vault",
"external-secret-gcp": "GCP Secret Manager",
"external-secret-vault": "Vault (KV v2)",
+ "google-cloud-iam": "Google Cloud IAM",
"google-iam": "Google Cloud SQL IAM",
"password": "Plain Password"
},
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 2dd55471ac..5bcbf31f1e 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1242,6 +1242,7 @@
"external-secret-azure": "Azure Key Vault",
"external-secret-gcp": "GCP Secret Manager",
"external-secret-vault": "Vault (KV v2)",
+ "google-cloud-iam": "Google Cloud IAM",
"google-iam": "Google Cloud SQL IAM",
"password": "Contraseña"
},
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 065a15a1a7..e29641ef06 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1242,6 +1242,7 @@
"external-secret-azure": "Azure Key Vault",
"external-secret-gcp": "GCP シークレット マネージャー",
"external-secret-vault": "ボールト (KV v2)",
+ "google-cloud-iam": "Google Cloud IAM",
"google-iam": "Google Cloud SQL IAM",
"password": "パスワード"
},
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 859c95d21f..b4a214495c 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -1242,6 +1242,7 @@
"external-secret-azure": "Azure Key Vault",
"external-secret-gcp": "GCP Secret Manager",
"external-secret-vault": "Vault (KV v2)",
+ "google-cloud-iam": "Google Cloud IAM",
"google-iam": "Google Cloud SQL IAM",
"password": "Mật khẩu"
},
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index fc707fe960..c8df7c22d0 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1242,6 +1242,7 @@
"external-secret-azure": "Azure Key Vault",
"external-secret-gcp": "GCP Secret Manager",
"external-secret-vault": "Vault (KV v2)",
+ "google-cloud-iam": "Google Cloud IAM",
"google-iam": "Google Cloud SQL IAM",
"password": "密码"
},