view data fixes

This commit is contained in:
2026-01-23 15:30:23 +01:00
parent e22033be38
commit f8099f04bc
213 changed files with 3466 additions and 3003 deletions

View File

@@ -1,28 +1,13 @@
import { ViewModel } from "../../contracts/view-models/ViewModel";
import type { ForgotPasswordFormState } from "./ForgotPasswordInterfaces";
/**
* Forgot Password ViewModel
*
* Client-side state management for forgot password flow.
* Immutable, class-based, contains only UI state.
*/
export interface ForgotPasswordFormField {
value: string;
error?: string;
touched: boolean;
validating: boolean;
}
export interface ForgotPasswordFormState {
fields: {
email: ForgotPasswordFormField;
};
isValid: boolean;
isSubmitting: boolean;
submitError?: string;
submitCount: number;
}
export class ForgotPasswordViewModel {
export class ForgotPasswordViewModel extends ViewModel {
constructor(
public readonly returnTo: string,
public readonly formState: ForgotPasswordFormState,
@@ -31,7 +16,9 @@ export class ForgotPasswordViewModel {
public readonly magicLink: string | null = null,
public readonly mutationPending: boolean = false,
public readonly mutationError: string | null = null
) {}
) {
super();
}
withFormState(formState: ForgotPasswordFormState): ForgotPasswordViewModel {
return new ForgotPasswordViewModel(
@@ -76,4 +63,4 @@ export class ForgotPasswordViewModel {
get submitError(): string | undefined {
return this.formState.submitError || this.mutationError || undefined;
}
}
}