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,34 +1,13 @@
import { ViewModel } from "../../contracts/view-models/ViewModel";
import type { ResetPasswordFormState, ResetPasswordUIState } from "./ResetPasswordInterfaces";
/**
* Reset Password ViewModel
*
* Client-side state management for reset password flow.
* Immutable, class-based, contains only UI state.
*/
export interface ResetPasswordFormField {
value: string;
error?: string;
touched: boolean;
validating: boolean;
}
export interface ResetPasswordFormState {
fields: {
newPassword: ResetPasswordFormField;
confirmPassword: ResetPasswordFormField;
};
isValid: boolean;
isSubmitting: boolean;
submitError?: string;
submitCount: number;
}
export interface ResetPasswordUIState {
showPassword: boolean;
showConfirmPassword: boolean;
}
export class ResetPasswordViewModel {
export class ResetPasswordViewModel extends ViewModel {
constructor(
public readonly token: string,
public readonly returnTo: string,
@@ -38,7 +17,9 @@ export class ResetPasswordViewModel {
public readonly successMessage: string | null = null,
public readonly mutationPending: boolean = false,
public readonly mutationError: string | null = null
) {}
) {
super();
}
withFormState(formState: ResetPasswordFormState): ResetPasswordViewModel {
return new ResetPasswordViewModel(
@@ -99,4 +80,4 @@ export class ResetPasswordViewModel {
get submitError(): string | undefined {
return this.formState.submitError || this.mutationError || undefined;
}
}
}