Skip to content

Commit

Permalink
chore: update the complaint form and state machine (#345)
Browse files Browse the repository at this point in the history
* Update export and import logic

* Update translations.

* Update machine events.

* Update the complaint form state machine and form.

* Extend validation of common forms.

* Update after reordering some of the  structure in contact.ts

* Set error to undefined. Will be fixed when the feedback state machine and form will be updated in another PR.

* Update src/translations/pages/contact.ts

Co-authored-by: Morten Nordseth <43166974+mortennordseth@users.noreply.github.com>

* Update src/page-modules/contact/validation/commonFieldValidator.ts

Co-authored-by: Morten Nordseth <43166974+mortennordseth@users.noreply.github.com>

---------

Co-authored-by: Morten Nordseth <43166974+mortennordseth@users.noreply.github.com>
  • Loading branch information
jonasbrunvoll and mortennordseth authored Sep 20, 2024
1 parent 1975878 commit 2b0b6bf
Show file tree
Hide file tree
Showing 10 changed files with 737 additions and 1,022 deletions.
1 change: 1 addition & 0 deletions src/page-modules/contact/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export {

export { PostponePaymentForm } from './ticket-control';
export { RefundForm } from './travel-guarantee';
export { FeeComplaintForm } from './ticket-control/complaint';
export { type Line } from './server/journey-planner/validators';
export { shouldShowContactPage } from './utils';
28 changes: 21 additions & 7 deletions src/page-modules/contact/machineEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import { TranslatedString } from '@atb/translations';
export type ReasonForTransportFailure = { id: string; name: TranslatedString };

export const machineEvents = {} as
| { type: 'TOGGLE' }
| { type: 'TAXI' }
| { type: 'CAR' }
| { type: 'OTHER' }
| { type: 'VALIDATE' }
| { type: 'SET_BANK_ACCOUNT_FOREIGN' }
| { type: 'SET_STATE_SUBMITTED'; stateSubmitted: string | undefined }
| {
type: 'TOGGLE';
field:
| 'isAppTicketStorageMode'
| 'agreesFirstAgreement'
| 'agreesSecondAgreement'
| 'hasInternationalBankAccount';
}
| {
type: 'UPDATE_FIELD';
field:
Expand All @@ -34,12 +37,23 @@ export const machineEvents = {} as
| 'city'
| 'bankAccountNumber'
| 'IBAN'
| 'SWIFT';
| 'SWIFT'
| 'feeNumber'
| 'appPhoneNumber'
| 'customerNumber'
| 'travelCardNumber'
| 'isAppTicketStorageMode';
value:
| string
| number
| Line
| Line['quays'][0]
| TransportModeType
| ReasonForTransportFailure;
};
}

// travel-guarantee
| { type: 'TAXI' }
| { type: 'CAR' }
| { type: 'OTHER' }
| { type: 'SET_STATE_SUBMITTED'; stateSubmitted: string | undefined };
Loading

0 comments on commit 2b0b6bf

Please sign in to comment.