Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(studio): hide secret visibility controls in pipeline edit forms (#51010)

Danny White68d5011514b9
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AnalyticsBucket/Fields.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AnalyticsBucket/Fields.tsx
index 2d7f789dfd8..c3caabba08d 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AnalyticsBucket/Fields.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/AnalyticsBucket/Fields.tsx
@@ -303,6 +303,7 @@ export const AnalyticsBucketFields = ({
<div className="flex items-center justify-center">
<Button
className="w-7"
+ aria-label={showCatalogToken ? 'Hide catalog token' : 'Show catalog token'}
icon={showCatalogToken ? <Eye /> : <EyeOff />}
onClick={() => setShowCatalogToken(!showCatalogToken)}
/>
@@ -408,18 +409,23 @@ export const AnalyticsBucketFields = ({
<FormControl>
<Input
{...field}
- type={showSecretAccessKey ? 'text' : 'password'}
+ type={showSecretAccessKey && !editMode ? 'text' : 'password'}
value={field.value ?? ''}
placeholder={
editMode ? STORED_SECRET_PLACEHOLDER : 'Provide the secret access key'
}
/>
</FormControl>
- <Button
- icon={showSecretAccessKey ? <Eye /> : <EyeOff />}
- className="w-7 absolute right-1 top-[4px]"
- onClick={() => setShowSecretAccessKey(!showSecretAccessKey)}
- />
+ {!editMode && (
+ <Button
+ aria-label={
+ showSecretAccessKey ? 'Hide secret access key' : 'Show secret access key'
+ }
+ icon={showSecretAccessKey ? <Eye /> : <EyeOff />}
+ className="w-7 absolute right-1 top-[4px]"
+ onClick={() => setShowSecretAccessKey(!showSecretAccessKey)}
+ />
+ )}
</FormItemLayout>
)}
/>
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/ClickHouse/Fields.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/ClickHouse/Fields.tsx
index 26bcb5c71ea..099629cf804 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/ClickHouse/Fields.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/ClickHouse/Fields.tsx
@@ -83,26 +83,28 @@ export const ClickHouseFields = ({
labelOptional="Optional"
description={
editMode
- ? 'Enter a new password to replace the stored one. The eye button shows only what you enter.'
+ ? 'Enter a new password to replace the stored one.'
: 'Leave blank if the ClickHouse user has no password.'
}
>
<FormControl>
<PasswordInput
value={field.value ?? ''}
- type={showPassword ? 'text' : 'password'}
+ type={showPassword && !editMode ? 'text' : 'password'}
placeholder={editMode ? STORED_SECRET_PLACEHOLDER : undefined}
onChange={(event) => field.onChange(event.target.value)}
actions={
- <div className="flex items-center justify-center">
- <Button
- className="w-7"
- title={passwordVisibilityLabel}
- aria-label={passwordVisibilityLabel}
- icon={showPassword ? <Eye /> : <EyeOff />}
- onClick={() => setShowPassword(!showPassword)}
- />
- </div>
+ !editMode && (
+ <div className="flex items-center justify-center">
+ <Button
+ className="w-7"
+ title={passwordVisibilityLabel}
+ aria-label={passwordVisibilityLabel}
+ icon={showPassword ? <Eye /> : <EyeOff />}
+ onClick={() => setShowPassword(!showPassword)}
+ />
+ </div>
+ )
}
/>
</FormControl>
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DuckLake/Fields.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DuckLake/Fields.tsx
index 338e6955492..ea5231e0743 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DuckLake/Fields.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/DuckLake/Fields.tsx
@@ -405,7 +405,7 @@ const DuckLakeCustomFields = ({
<FormControl>
<PasswordInput
value={field.value ?? ''}
- type={showCatalogUrl ? 'text' : 'password'}
+ type={showCatalogUrl && !editMode ? 'text' : 'password'}
placeholder={
editMode
? STORED_SECRET_PLACEHOLDER
@@ -413,13 +413,16 @@ const DuckLakeCustomFields = ({
}
onChange={(event) => field.onChange(event.target.value)}
actions={
- <div className="flex items-center justify-center">
- <Button
- className="w-7"
- icon={showCatalogUrl ? <Eye /> : <EyeOff />}
- onClick={() => setShowCatalogUrl(!showCatalogUrl)}
- />
- </div>
+ !editMode && (
+ <div className="flex items-center justify-center">
+ <Button
+ className="w-7"
+ aria-label={showCatalogUrl ? 'Hide catalog URL' : 'Show catalog URL'}
+ icon={showCatalogUrl ? <Eye /> : <EyeOff />}
+ onClick={() => setShowCatalogUrl(!showCatalogUrl)}
+ />
+ </div>
+ )
}
/>
</FormControl>
@@ -520,16 +523,21 @@ const DuckLakeCustomFields = ({
<FormControl>
<Input
{...field}
- type={showSecretAccessKey ? 'text' : 'password'}
+ type={showSecretAccessKey && !editMode ? 'text' : 'password'}
placeholder={editMode ? STORED_SECRET_PLACEHOLDER : 'my-secret-key'}
value={field.value ?? ''}
/>
</FormControl>
- <Button
- icon={showSecretAccessKey ? <Eye /> : <EyeOff />}
- className="w-7 absolute right-6 top-[4px]"
- onClick={() => setShowSecretAccessKey(!showSecretAccessKey)}
- />
+ {!editMode && (
+ <Button
+ aria-label={
+ showSecretAccessKey ? 'Hide secret access key' : 'Show secret access key'
+ }
+ icon={showSecretAccessKey ? <Eye /> : <EyeOff />}
+ className="w-7 absolute right-6 top-[4px]"
+ onClick={() => setShowSecretAccessKey(!showSecretAccessKey)}
+ />
+ )}
</FormItemLayout>
)}
/>
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/Snowflake/Fields.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/Snowflake/Fields.tsx
index 137f9fde687..c42033e66d9 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/Snowflake/Fields.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/Snowflake/Fields.tsx
@@ -239,21 +239,23 @@ export const SnowflakeFields = ({
<FormControl>
<PasswordInput
value={field.value ?? ''}
- type={showPrivateKeyPassphrase ? 'text' : 'password'}
+ type={showPrivateKeyPassphrase && !editMode ? 'text' : 'password'}
placeholder={editMode ? STORED_SECRET_PLACEHOLDER : undefined}
onChange={(event) => field.onChange(event.target.value)}
actions={
- <div className="flex items-center justify-center">
- <Button
- className="w-7"
- title={showPrivateKeyPassphrase ? 'Hide passphrase' : 'Show passphrase'}
- aria-label={
- showPrivateKeyPassphrase ? 'Hide passphrase' : 'Show passphrase'
- }
- icon={showPrivateKeyPassphrase ? <Eye /> : <EyeOff />}
- onClick={() => setShowPrivateKeyPassphrase(!showPrivateKeyPassphrase)}
- />
- </div>
+ !editMode && (
+ <div className="flex items-center justify-center">
+ <Button
+ className="w-7"
+ title={showPrivateKeyPassphrase ? 'Hide passphrase' : 'Show passphrase'}
+ aria-label={
+ showPrivateKeyPassphrase ? 'Hide passphrase' : 'Show passphrase'
+ }
+ icon={showPrivateKeyPassphrase ? <Eye /> : <EyeOff />}
+ onClick={() => setShowPrivateKeyPassphrase(!showPrivateKeyPassphrase)}
+ />
+ </div>
+ )
}
/>
</FormControl>