Merged in fix/sw-2501-remove-continue-button-light (pull request #1892)

fix(sw-2501): remove the continue buttons on enter details

This removes the continue buttons on the enter details page.

This is only that, not the refactoring of the whole enter details page with changing to one form etc. Since I just didn’t complete that refactor today I decided to do this light variant for now.

A quick explanation is that the continue buttons are removed and instead the form is submitted (meaning saving the form data to the store) on blur on the input elements IF the form is valid. If it’s invalid we change the isComplete flag in the store to false. This will hopefully also fix a bug where you were able to submit old data if the new data is invalid.

When clicking the submit button and a room is incomplete/invalid the browser scrolls to the first invalid room.

Approved-by: Erik Tiekstra
This commit is contained in:
Niclas Edenvin
2025-04-30 08:56:16 +00:00
parent 7070770581
commit 341be43a53
10 changed files with 111 additions and 135 deletions

View File

@@ -5,6 +5,7 @@ import type { RoomState } from "@/types/stores/enter-details"
export interface RoomContextValue {
actions: {
setIncomplete: () => void
updateBedType: (data: BedTypeSchema) => void
updateBreakfast: (data: BreakfastPackage | false) => void
updateJoin: (join: boolean) => void

View File

@@ -60,6 +60,7 @@ export interface Room extends InitialRoomData {
export interface RoomState {
actions: {
setIncomplete: () => void
updateBedType: (data: BedTypeSchema) => void
updateBreakfast: (data: BreakfastPackage | false) => void
updateJoin: (join: boolean) => void