use __INFISICAL_UNCHANGED__ instead of empty string for unchanged

placeholder
This commit is contained in:
x032205
2025-10-21 15:57:44 -04:00
parent 407a7e6075
commit 65b36e6232
6 changed files with 29 additions and 11 deletions
@@ -34,7 +34,7 @@ export const PostgresAccountForm = ({ account, resourceId, resourceType, onSubmi
...account,
credentials: {
...account.credentials,
password: "******"
password: "__INFISICAL_UNCHANGED__"
}
}
: undefined
@@ -38,14 +38,14 @@ export const SqlAccountFields = ({ isUpdate }: { isUpdate: boolean }) => {
type={showPassword ? "text" : "password"}
autoComplete="new-password"
onFocus={() => {
if (isUpdate && field.value === "******") {
if (isUpdate && field.value === "__INFISICAL_UNCHANGED__") {
field.onChange("");
}
setShowPassword(true);
}}
onBlur={() => {
if (isUpdate && field.value === "") {
field.onChange("******");
field.onChange("__INFISICAL_UNCHANGED__");
}
setShowPassword(false);
}}
@@ -37,7 +37,7 @@ export const PostgresResourceForm = ({ resource, onSubmit }: Props) => {
rotationAccountCredentials: resource.rotationAccountCredentials
? {
...resource.rotationAccountCredentials,
password: "******"
password: "__INFISICAL_UNCHANGED__"
}
: resource.rotationAccountCredentials
}
@@ -55,14 +55,14 @@ export const SqlRotateAccountFields = ({ isUpdate }: { isUpdate: boolean }) => {
type={showPassword ? "text" : "password"}
autoComplete="new-password"
onFocus={() => {
if (isUpdate && field.value === "******") {
if (isUpdate && field.value === "__INFISICAL_UNCHANGED__") {
field.onChange("");
}
setShowPassword(true);
}}
onBlur={() => {
if (isUpdate && field.value === "") {
field.onChange("******");
field.onChange("__INFISICAL_UNCHANGED__");
}
setShowPassword(false);
}}