fix(forms): give sign-in, forbidden and retry-later save failures their own state (08-01)
Every non-input save failure became "unavailable" under the "review the entered information" summary, with no sign-in button. useAppForm now reports reauth-required, forbidden and retry-later with the failure, and FormFailureStatus shows each one's copy and action outside ErrorSummary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2afee67150
commit
9894a70f04
@@ -8,6 +8,7 @@ import {
|
||||
ErrorSummary,
|
||||
Form,
|
||||
FormActions,
|
||||
FormFailureStatus,
|
||||
FormPage,
|
||||
FormField,
|
||||
useAppForm,
|
||||
@@ -21,6 +22,7 @@ import {
|
||||
toCreateReferenceCommand,
|
||||
type ReferenceResourceFormValues,
|
||||
} from "./reference-resource-form.ts";
|
||||
import { useReferenceFailureAction } from "./use-reference-failure-action.ts";
|
||||
import { useReferenceCreate } from "./use-reference-feature.ts";
|
||||
|
||||
const FIELD_LABELS = Object.freeze({
|
||||
@@ -44,6 +46,7 @@ export default function ReferenceResourceFormPage() {
|
||||
mapToCommand: toCreateReferenceCommand,
|
||||
submit,
|
||||
});
|
||||
const failureAction = useReferenceFailureAction(form.failure ?? undefined);
|
||||
const mutationEffectUnknown =
|
||||
mutation.state.indicator === "mutation-effect-unknown";
|
||||
const mutationBlocked =
|
||||
@@ -129,7 +132,16 @@ export default function ReferenceResourceFormPage() {
|
||||
</FormActions>
|
||||
}
|
||||
feedback={
|
||||
mutationEffectUnknown ? (
|
||||
form.failure ? (
|
||||
<FormFailureStatus
|
||||
failure={form.failure}
|
||||
onAction={
|
||||
form.result === "retry-later"
|
||||
? () => void form.submitForm()
|
||||
: failureAction
|
||||
}
|
||||
/>
|
||||
) : mutationEffectUnknown ? (
|
||||
<>
|
||||
<AsyncSurface
|
||||
state={mutation.state}
|
||||
|
||||
Reference in New Issue
Block a user