improvements: resolve more commit state issues form value reveal change

This commit is contained in:
Scott Wilson
2025-09-18 12:09:28 -07:00
parent 120b767f16
commit 999ce3fec6
6 changed files with 13 additions and 14 deletions
@@ -143,7 +143,7 @@ const RenderSecretChanges = ({ onDiscard, change }: RenderResourceProps) => {
{
version: 1, // placeholder, not used
secretKey,
secretValue
secretValue: secretValue || undefined
}
]
}}
@@ -126,7 +126,10 @@ export const SecretItem = memo(
const [isFieldFocused, setIsFieldFocused] = useToggle();
const queryClient = useQueryClient();
const canFetchSecretValue = !originalSecret.secretValueHidden && !originalSecret.isEmpty;
const canFetchSecretValue =
!originalSecret.secretValueHidden &&
!originalSecret.isEmpty &&
pendingAction !== PendingAction.Create;
const fetchSecretValueParams = {
environment,
@@ -508,13 +511,15 @@ export const SecretItem = memo(
control={control}
render={({ field }) => (
<SecretInput
isLoadingValue={isLoadingSecretValue}
isLoadingValue={isLoadingSecretValue && Boolean(secret.idOverride)}
isErrorLoadingValue={isErrorFetchingSecretValue}
key="value-overriden"
isVisible={isVisible}
isReadOnly={isReadOnly}
{...field}
onFocus={() => setIsFieldFocused.on()}
onFocus={() => {
if (secret.idOverride) setIsFieldFocused.on();
}}
onBlur={() => {
setIsFieldFocused.off();
field.onBlur();
@@ -27,7 +27,7 @@ export const SecretRotationSecretRow = ({
{
environment,
secretPath,
secretKey: secret!.key,
secretKey: secret?.key ?? "",
projectId: currentProject.id
},
{