improvements: address feedback 2

This commit is contained in:
Scott Wilson
2025-09-17 19:39:21 -07:00
parent 5a4b83d900
commit a95f491454
3 changed files with 29 additions and 15 deletions
@@ -127,6 +127,7 @@ export const SecretItem = memo(
const queryClient = useQueryClient();
const canFetchSecretValue =
// TODO NOTE FOR PR PROGRESS: may need to remove !isPending, messes with key edits not fetching proper value
!originalSecret.secretValueHidden && !originalSecret.isEmpty && !isPending;
const fetchSecretValueParams = {
@@ -201,7 +202,17 @@ export const SecretItem = memo(
return secret.valueOverride || "";
};
const formMethods = useForm<TFormSchema>({
const {
handleSubmit,
control,
register,
watch,
setValue,
reset,
getValues,
trigger,
formState: { isDirty, isSubmitting, errors }
} = useForm<TFormSchema>({
defaultValues: {
...secret,
valueOverride: getOverrideDefaultValue(),
@@ -215,18 +226,6 @@ export const SecretItem = memo(
resolver: zodResolver(formSchema)
});
const {
handleSubmit,
control,
register,
watch,
setValue,
reset,
getValues,
trigger,
formState: { isDirty, isSubmitting, errors }
} = formMethods;
const secretName = watch("key");
const overrideAction = watch("overrideAction");
const hasComment = Boolean(watch("comment"));