@mrfylke/contact-form 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/lib/ContactFormRoot.d.ts +11 -1
  2. package/lib/ContactFormRoot.d.ts.map +1 -1
  3. package/lib/ContactFormRoot.js +2 -2
  4. package/lib/journey-info/index.d.ts.map +1 -1
  5. package/lib/journey-info/index.js +3 -3
  6. package/lib/layouts/contact-page-layout.d.ts.map +1 -1
  7. package/lib/layouts/contact-page-layout.js +10 -4
  8. package/lib/lines/use-lines.d.ts +2 -4
  9. package/lib/lines/use-lines.d.ts.map +1 -1
  10. package/lib/lines/use-lines.js +41 -41
  11. package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
  12. package/lib/means-of-transport/forms/serviceOfferingForm.js +1 -2
  13. package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
  14. package/lib/means-of-transport/means-of-transport-form-machine.js +0 -1
  15. package/lib/modules/config/data.d.ts +3 -0
  16. package/lib/modules/config/data.d.ts.map +1 -0
  17. package/lib/modules/config/data.js +18 -0
  18. package/lib/modules/config/types.d.ts +8 -0
  19. package/lib/modules/config/types.d.ts.map +1 -1
  20. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
  21. package/lib/refund/forms/refund-and-travel-guarantee/index.js +7 -5
  22. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
  23. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +29 -26
  24. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
  25. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +27 -25
  26. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
  27. package/lib/refund/forms/refund-ticket/appTicketRefund.js +2 -16
  28. package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
  29. package/lib/refund/forms/refund-ticket/index.js +4 -2
  30. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
  31. package/lib/refund/forms/refund-ticket/otherTicketRefund.js +5 -13
  32. package/lib/refund/refundFormMachine.d.ts.map +1 -1
  33. package/lib/refund/refundFormMachine.js +13 -10
  34. package/lib/test-utils/setup.d.ts +2 -0
  35. package/lib/test-utils/setup.d.ts.map +1 -0
  36. package/lib/test-utils/setup.js +3 -0
  37. package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
  38. package/lib/ticket-control/forms/feeComplaintForm.js +15 -15
  39. package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -1
  40. package/lib/ticket-control/forms/feedbackForm.js +7 -3
  41. package/lib/ticket-control/index.d.ts.map +1 -1
  42. package/lib/ticket-control/index.js +8 -2
  43. package/lib/ticket-control/ticket-control-form-machine.d.ts +5 -1
  44. package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
  45. package/lib/ticket-control/ticket-control-form-machine.js +9 -4
  46. package/lib/translations/merge-overrides.d.ts.map +1 -1
  47. package/lib/translations/merge-overrides.js +8 -1
  48. package/lib/translations/pages/contact.d.ts +15 -0
  49. package/lib/translations/pages/contact.d.ts.map +1 -1
  50. package/lib/translations/pages/contact.js +14 -0
  51. package/lib/types/submit-payloads.d.ts +21 -11
  52. package/lib/types/submit-payloads.d.ts.map +1 -1
  53. package/lib/types/submit-payloads.js +1 -1
  54. package/lib/validation/validationRules.d.ts.map +1 -1
  55. package/lib/validation/validationRules.js +24 -0
  56. package/package.json +11 -2
@@ -5,16 +5,18 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const use_lines_1 = require("../../../lines/use-lines");
6
6
  const components_1 = require("../../../components");
7
7
  const translations_1 = require("../../../translations");
8
+ const translations_context_1 = require("../../../translations/translations-context");
8
9
  const checkbox_1 = require("../../../components/checkbox");
9
10
  const RefundTaxiForm = ({ state, send }) => {
10
11
  const { t } = (0, translations_1.useTranslation)();
12
+ const { PageText } = (0, translations_context_1.useMergedTranslations)();
11
13
  const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
12
14
  const transportModeOptions = (0, use_lines_1.useTransportModeOptions)();
13
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.refund.refundTaxi.taxiReceipt.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "amount", label: t(translations_1.PageText.Contact.input.amount.info), type: "text", name: "amount", value: state.context.amount || '', isRequired: true, errorMessage: state.context?.errorMessages['amount']?.[0], onChange: (e) => send({
15
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.refundTaxi.taxiReceipt.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "amount", label: t(PageText.Contact.input.amount.info), type: "text", name: "amount", value: state.context.amount || '', isRequired: true, errorMessage: state.context?.errorMessages['amount']?.[0], onChange: (e) => send({
14
16
  type: 'ON_INPUT_CHANGE',
15
17
  inputName: 'amount',
16
18
  value: e.target.value,
17
- }) }), (0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "attachments", label: t(translations_1.PageText.Contact.refund.refundTaxi.taxiReceipt.info), iconLabel: t(translations_1.PageText.Contact.input.feedback.attachment.receipt), name: "attachments", isRequired: true, onChange: (files) => {
19
+ }) }), (0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "attachments", label: t(PageText.Contact.refund.refundTaxi.taxiReceipt.info), iconLabel: t(PageText.Contact.input.feedback.attachment.receipt), name: "attachments", isRequired: true, onChange: (files) => {
18
20
  send({
19
21
  type: 'ON_INPUT_CHANGE',
20
22
  inputName: 'attachments',
@@ -22,42 +24,42 @@ const RefundTaxiForm = ({ state, send }) => {
22
24
  });
23
25
  }, errorMessage: state.context?.errorMessages['attachments']?.[0]
24
26
  ? t(state.context?.errorMessages['attachments']?.[0])
25
- : undefined })] }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.refund.refundTaxi.aboutYourTrip.title), children: [(0, jsx_runtime_1.jsx)(components_1.Select, { id: "transportMode", label: t(translations_1.PageText.Contact.input.transportMode.label), value: state.context.transportMode || '', onChange: (value) => send({
27
+ : undefined })] }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.refundTaxi.aboutYourTrip.title), children: [(0, jsx_runtime_1.jsx)(components_1.Select, { id: "transportMode", label: t(PageText.Contact.input.transportMode.label), value: state.context.transportMode || '', onChange: (value) => send({
26
28
  type: 'ON_TRANSPORTMODE_CHANGE',
27
29
  value: value,
28
30
  }), isRequired: true, error: state.context?.errorMessages['transportMode']?.[0]
29
31
  ? t(state.context?.errorMessages['transportMode']?.[0])
30
- : undefined, valueToId: (val) => val, valueToText: (val) => t(translations_1.PageText.Contact.input.transportMode.modes[val]), options: transportModeOptions, placeholder: t(translations_1.PageText.Contact.input.transportMode.optionLabel) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "line", label: t(translations_1.PageText.Contact.input.line.label), value: state.context.line, placeholder: t(translations_1.PageText.Contact.input.line.optionLabel), isDisabled: !state.context.transportMode, options: (0, components_1.getLineOptions)(getLinesByMode(state.context.transportMode)), onChange: (value) => {
32
+ : undefined, valueToId: (val) => val, valueToText: (val) => t(PageText.Contact.input.transportMode.modes[val]), options: transportModeOptions, placeholder: t(PageText.Contact.input.transportMode.optionLabel) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "line", label: t(PageText.Contact.input.line.label), value: state.context.line, placeholder: t(PageText.Contact.input.line.optionLabel), isDisabled: !state.context.transportMode, options: (0, components_1.getLineOptions)(getLinesByMode(state.context.transportMode)), onChange: (value) => {
31
33
  send({
32
34
  type: 'ON_LINE_CHANGE',
33
35
  value: value,
34
36
  });
35
37
  }, isRequired: true, error: state.context?.errorMessages['line']?.[0] &&
36
- t(state.context?.errorMessages['line']?.[0]) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "fromStop", label: t(translations_1.PageText.Contact.input.fromStop.label), value: state.context.fromStop, isDisabled: !state.context.line, onChange: (value) => {
38
+ t(state.context?.errorMessages['line']?.[0]) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "fromStop", label: t(PageText.Contact.input.fromStop.label), value: state.context.fromStop, isDisabled: !state.context.line, onChange: (value) => {
37
39
  send({
38
40
  type: 'ON_INPUT_CHANGE',
39
41
  inputName: 'fromStop',
40
42
  value: value,
41
43
  });
42
- }, options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), placeholder: t(translations_1.PageText.Contact.input.fromStop.optionLabel), isRequired: true, error: state.context?.errorMessages['fromStop']?.[0]
44
+ }, options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), placeholder: t(PageText.Contact.input.fromStop.optionLabel), isRequired: true, error: state.context?.errorMessages['fromStop']?.[0]
43
45
  ? t(state.context?.errorMessages['fromStop']?.[0])
44
- : undefined }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "toStop", label: t(translations_1.PageText.Contact.input.toStop.label), value: state.context.toStop, isDisabled: !state.context.line, onChange: (value) => {
46
+ : undefined }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "toStop", label: t(PageText.Contact.input.toStop.label), value: state.context.toStop, isDisabled: !state.context.line, onChange: (value) => {
45
47
  send({
46
48
  type: 'ON_INPUT_CHANGE',
47
49
  inputName: 'toStop',
48
50
  value: value,
49
51
  });
50
- }, placeholder: t(translations_1.PageText.Contact.input.toStop.optionLabel), options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), isRequired: true, error: state.context?.errorMessages['toStop']?.[0]
52
+ }, placeholder: t(PageText.Contact.input.toStop.optionLabel), options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), isRequired: true, error: state.context?.errorMessages['toStop']?.[0]
51
53
  ? t(state.context?.errorMessages['toStop']?.[0])
52
- : undefined }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "date", label: t(translations_1.PageText.Contact.input.date.label), isRequired: true, value: state.context.date, onChange: (date) => send({
54
+ : undefined }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "date", label: t(PageText.Contact.input.date.label), isRequired: true, value: state.context.date, onChange: (date) => send({
53
55
  type: 'ON_INPUT_CHANGE',
54
56
  inputName: 'date',
55
57
  value: date,
56
- }), errorMessage: state.context?.errorMessages['date']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.TimeSelector, { id: "plannedDepartureTime", isRequired: true, label: t(translations_1.PageText.Contact.input.plannedDepartureTime.label), value: state.context.plannedDepartureTime, onChange: (time) => send({
58
+ }), errorMessage: state.context?.errorMessages['date']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.TimeSelector, { id: "plannedDepartureTime", isRequired: true, label: t(PageText.Contact.input.plannedDepartureTime.label), value: state.context.plannedDepartureTime, onChange: (time) => send({
57
59
  type: 'ON_INPUT_CHANGE',
58
60
  inputName: 'plannedDepartureTime',
59
61
  value: time,
60
- }), errorMessage: state.context?.errorMessages['plannedDepartureTime']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.Select, { id: "reasonForTransportFailure", label: t(translations_1.PageText.Contact.input.reasonForTransportFailure.label), value: state.context.reasonForTransportFailure, disabled: !state.context.line, onChange: (value) => {
62
+ }), errorMessage: state.context?.errorMessages['plannedDepartureTime']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.Select, { id: "reasonForTransportFailure", label: t(PageText.Contact.input.reasonForTransportFailure.label), value: state.context.reasonForTransportFailure, disabled: !state.context.line, onChange: (value) => {
61
63
  if (!value)
62
64
  return;
63
65
  send({
@@ -65,15 +67,15 @@ const RefundTaxiForm = ({ state, send }) => {
65
67
  inputName: 'reasonForTransportFailure',
66
68
  value: value,
67
69
  });
68
- }, placeholder: t(translations_1.PageText.Contact.input.reasonForTransportFailure.optionLabel), options: translations_1.PageText.Contact.input.reasonForTransportFailure.options, isRequired: true, error: state.context?.errorMessages['reasonForTransportFailure']?.[0]
70
+ }, placeholder: t(PageText.Contact.input.reasonForTransportFailure.optionLabel), options: PageText.Contact.input.reasonForTransportFailure.options, isRequired: true, error: state.context?.errorMessages['reasonForTransportFailure']?.[0]
69
71
  ? t(state.context?.errorMessages['reasonForTransportFailure']?.[0])
70
- : undefined, valueToId: (option) => option.id, valueToText: (option) => t(option.name) })] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.input.feedback.optionalTitle), children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "feedback", value: state.context.feedback || '', onChange: (e) => send({
72
+ : undefined, valueToId: (option) => option.id, valueToText: (option) => t(option.name) })] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.feedback.optionalTitle), children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "feedback", value: state.context.feedback || '', onChange: (e) => send({
71
73
  type: 'ON_INPUT_CHANGE',
72
74
  inputName: 'feedback',
73
75
  value: e.target.value,
74
76
  }), fileInputProps: {
75
77
  id: 'attachments',
76
- iconLabel: t(translations_1.PageText.Contact.input.feedback.attachment.generic),
78
+ iconLabel: t(PageText.Contact.input.feedback.attachment.generic),
77
79
  name: 'attachments',
78
80
  onChange: (files) => {
79
81
  send({
@@ -82,48 +84,48 @@ const RefundTaxiForm = ({ state, send }) => {
82
84
  value: files,
83
85
  });
84
86
  },
85
- } }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(translations_1.PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
87
+ } }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(PageText.Contact.input.firstName.label), type: "text", autoComplete: "given-name additional-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0], onChange: (e) => send({
86
88
  type: 'ON_INPUT_CHANGE',
87
89
  inputName: 'firstName',
88
90
  value: e.target.value,
89
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(translations_1.PageText.Contact.input.lastName.label), type: "text", autoComplete: "family-name", name: "lastName", value: state.context.lastName || '', isRequired: true, errorMessage: state.context?.errorMessages['lastName']?.[0], onChange: (e) => send({
91
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(PageText.Contact.input.lastName.label), type: "text", autoComplete: "family-name", name: "lastName", value: state.context.lastName || '', isRequired: true, errorMessage: state.context?.errorMessages['lastName']?.[0], onChange: (e) => send({
90
92
  type: 'ON_INPUT_CHANGE',
91
93
  inputName: 'lastName',
92
94
  value: e.target.value,
93
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "address", label: t(translations_1.PageText.Contact.input.address.label), type: "text", autoComplete: "street-address", name: "address", value: state.context.address || '', isRequired: true, errorMessage: state.context?.errorMessages['address']?.[0], onChange: (e) => send({
95
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "address", label: t(PageText.Contact.input.address.label), type: "text", autoComplete: "street-address", name: "address", value: state.context.address || '', isRequired: true, errorMessage: state.context?.errorMessages['address']?.[0], onChange: (e) => send({
94
96
  type: 'ON_INPUT_CHANGE',
95
97
  inputName: 'address',
96
98
  value: e.target.value,
97
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "postalCode", label: t(translations_1.PageText.Contact.input.postalCode.label), type: "text", autoComplete: "postal-code", name: "postalCode", value: state.context.postalCode || '', isRequired: true, errorMessage: state.context?.errorMessages['postalCode']?.[0], onChange: (e) => send({
99
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "postalCode", label: t(PageText.Contact.input.postalCode.label), type: "text", autoComplete: "postal-code", name: "postalCode", value: state.context.postalCode || '', isRequired: true, errorMessage: state.context?.errorMessages['postalCode']?.[0], onChange: (e) => send({
98
100
  type: 'ON_INPUT_CHANGE',
99
101
  inputName: 'postalCode',
100
102
  value: e.target.value,
101
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "city", label: t(translations_1.PageText.Contact.input.city.label), type: "text", name: "city", value: state.context.city || '', isRequired: true, errorMessage: state.context?.errorMessages['city']?.[0], onChange: (e) => send({
103
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "city", label: t(PageText.Contact.input.city.label), type: "text", name: "city", value: state.context.city || '', isRequired: true, errorMessage: state.context?.errorMessages['city']?.[0], onChange: (e) => send({
102
104
  type: 'ON_INPUT_CHANGE',
103
105
  inputName: 'city',
104
106
  value: e.target.value,
105
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(translations_1.PageText.Contact.input.email.label), type: "email", autoComplete: "email", name: "email", value: state.context.email || '', isRequired: true, errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
107
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(PageText.Contact.input.email.label), type: "email", autoComplete: "email", name: "email", value: state.context.email || '', isRequired: true, errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
106
108
  type: 'ON_INPUT_CHANGE',
107
109
  inputName: 'email',
108
110
  value: e.target.value,
109
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(translations_1.PageText.Contact.input.phoneNumber.label), type: "tel", name: "phoneNumber", value: state.context.phoneNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['phoneNumber']?.[0], onChange: (e) => send({
111
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(PageText.Contact.input.phoneNumber.label), type: "tel", name: "phoneNumber", value: state.context.phoneNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['phoneNumber']?.[0], onChange: (e) => send({
110
112
  type: 'ON_INPUT_CHANGE',
111
113
  inputName: 'phoneNumber',
112
114
  value: e.target.value,
113
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "bankAccountNumber", label: t(translations_1.PageText.Contact.input.bankInformation.bankAccountNumber.label), placeholder: t(translations_1.PageText.Contact.input.bankInformation.bankAccountNumber
115
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "bankAccountNumber", label: t(PageText.Contact.input.bankInformation.bankAccountNumber.label), placeholder: t(PageText.Contact.input.bankInformation.bankAccountNumber
114
116
  .placeholder), type: "text", name: "bankAccountNumber", value: state.context.bankAccountNumber || '', disabled: state.context.hasInternationalBankAccount, isRequired: true, errorMessage: state.context?.errorMessages['bankAccountNumber']?.[0], onChange: (e) => send({
115
117
  type: 'ON_INPUT_CHANGE',
116
118
  inputName: 'bankAccountNumber',
117
119
  value: e.target.value,
118
- }) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(translations_1.PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
120
+ }) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
119
121
  type: 'ON_INPUT_CHANGE',
120
122
  inputName: 'hasInternationalBankAccount',
121
123
  value: !state.context.hasInternationalBankAccount,
122
- }) }), state.context.hasInternationalBankAccount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "IBAN", label: t(translations_1.PageText.Contact.input.bankInformation.IBAN.label), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
124
+ }) }), state.context.hasInternationalBankAccount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "IBAN", label: t(PageText.Contact.input.bankInformation.IBAN.label), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
123
125
  type: 'ON_INPUT_CHANGE',
124
126
  inputName: 'IBAN',
125
127
  value: e.target.value,
126
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(translations_1.PageText.Contact.input.bankInformation.SWIFT.label), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
128
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(PageText.Contact.input.bankInformation.SWIFT.label), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
127
129
  type: 'ON_INPUT_CHANGE',
128
130
  inputName: 'SWIFT',
129
131
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"appTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/appTicketRefund.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,iBAAiB,oBAAoB,4CA+GpE,CAAC;AAkIF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,KAAK,EACL,IAAI,GACL,EAAE,oBAAoB,2CAOtB"}
1
+ {"version":3,"file":"appTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/appTicketRefund.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,iBAAiB,oBAAoB,4CAwDpE,CAAC;AAkIF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,KAAK,EACL,IAAI,GACL,EAAE,oBAAoB,2CAOtB"}
@@ -7,25 +7,11 @@ const components_1 = require("../../../components");
7
7
  const translations_1 = require("../../../translations");
8
8
  const AppTicketRefund = ({ state, send }) => {
9
9
  const { t } = (0, translations_1.useTranslation)();
10
- return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.ticketing.refund.appTicketRefund.label), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "customerNumber", label: t(translations_1.PageText.Contact.input.customerNumber.label), type: "text", name: "customerNumber", value: state.context.customerNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['customerNumber']?.[0], onChange: (e) => send({
11
- type: 'ON_INPUT_CHANGE',
12
- inputName: 'customerNumber',
13
- value: e.target.value,
14
- }), modalContent: {
15
- description: t(translations_1.PageText.Contact.input.customerNumber.description),
16
- } }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(translations_1.PageText.Contact.input.orderId.label(true)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
10
+ return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.ticketing.refund.appTicketRefund.label), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(translations_1.PageText.Contact.input.referenceNumber.label), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
17
11
  type: 'ON_INPUT_CHANGE',
18
12
  inputName: 'orderId',
19
13
  value: e.target.value,
20
- }), modalContent: {
21
- description: t(translations_1.PageText.Contact.input.orderId.description),
22
- bulletPoints: translations_1.PageText.Contact.input.orderId.descriptionBulletPoints.map((bulletPoint) => t(bulletPoint)),
23
- } }), (0, jsx_runtime_1.jsx)(components_1.Select, { id: "purchasePlatform", label: t(translations_1.PageText.Contact.input.purchasePlatform.label), value: state.context.purchasePlatform || '', onChange: (value) => send({
24
- type: 'ON_PURCHASE_PLATFORM_CHANGE',
25
- value: value,
26
- }), isRequired: true, error: state.context?.errorMessages['purchasePlatform']?.[0]
27
- ? t(state.context?.errorMessages['purchasePlatform']?.[0])
28
- : undefined, valueToId: (val) => val, valueToText: (val) => t(translations_1.PageText.Contact.input.purchasePlatform.platforms[val]), options: ['enturApp', 'enturWeb', 'framApp', 'framWeb'], placeholder: t(translations_1.PageText.Contact.input.purchasePlatform.optionLabel) }), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", description: t(translations_1.PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
14
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", description: t(translations_1.PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
29
15
  type: 'ON_INPUT_CHANGE',
30
16
  inputName: 'refundReason',
31
17
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAUnC,OAAO,EAAE,kBAAkB,EAAoB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,4CAsGxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAWnC,OAAO,EAAE,kBAAkB,EAAoB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIhD,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,SAAS,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,4CAyHxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -16,15 +16,17 @@ const otherTicketRefund_1 = __importDefault(require("./otherTicketRefund"));
16
16
  const checkbox_1 = require("../../../components/checkbox");
17
17
  const RefundTicketForms = ({ state, send }) => {
18
18
  const { t } = (0, translations_1.useTranslation)();
19
+ const { initialAgreement } = (0, translations_1.useMergedTranslations)().PageText.Contact.ticketing.refund;
20
+ const { refundableTicketTypes, nonRefundableTicketTypes } = initialAgreement;
19
21
  const displayAppTicketRefund = state.context.isInitialAgreementChecked &&
20
22
  state.context.formType === 'appTicketRefund';
21
23
  const displayOtherTicketRefund = state.context.isInitialAgreementChecked &&
22
24
  state.context.formType === 'otherTicketRefund';
23
25
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.ticketing.refund.initialAgreement
24
26
  .ticketRefundAvailability.title), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: translations_1.PageText.Contact.ticketing.refund.initialAgreement.ticketRefundAvailability.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(rule) }) }, index))) }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.ticketing.refund.initialAgreement
25
- .refundableTicketTypes.title), children: [(0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: translations_1.PageText.Contact.ticketing.refund.initialAgreement.refundableTicketTypes.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(rule) }) }, index))) }), (0, jsx_runtime_1.jsxs)(typography_1.Typo.p, { textType: "body__m", children: [t(translations_1.PageText.Contact.ticketing.refund.initialAgreement
27
+ .refundableTicketTypes.title), children: [(0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: refundableTicketTypes.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(rule) }) }, index))) }), (0, jsx_runtime_1.jsxs)(typography_1.Typo.p, { textType: "body__m", children: [t(translations_1.PageText.Contact.ticketing.refund.initialAgreement
26
28
  .refundableTicketTypes.info.text), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { href: 'travel-guarantee', children: t(translations_1.PageText.Contact.ticketing.refund.initialAgreement
27
- .refundableTicketTypes.info.link) })] }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(translations_1.PageText.Contact.ticketing.refund.initialAgreement
29
+ .refundableTicketTypes.info.link) })] }), nonRefundableTicketTypes.rules.length > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "heading__m", children: t(nonRefundableTicketTypes.title) }), (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: nonRefundableTicketTypes.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(rule) }) }, index))) })] })), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(translations_1.PageText.Contact.ticketing.refund.initialAgreement
28
30
  .refundableTicketTypes.checkbox), checked: state.context.isInitialAgreementChecked, onChange: () => send({
29
31
  type: 'ON_INPUT_CHANGE',
30
32
  inputName: 'isInitialAgreementChecked',
@@ -1 +1 @@
1
- {"version":3,"file":"otherTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/otherTicketRefund.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAQhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAI7D,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AA0VF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,4CAOxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"otherTicketRefund.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-ticket/otherTicketRefund.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAQhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAK7D,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE;QAAE,OAAO,EAAE,kBAAkB,CAAA;KAAE,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,gBAAgB,KAAK,IAAI,CAAC;CAChD,CAAC;AA8TF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,4CAOxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -6,8 +6,10 @@ const translations_1 = require("../../../translations");
6
6
  const components_1 = require("../../../components");
7
7
  const checkbox_1 = require("../../../components/checkbox");
8
8
  const types_1 = require("../../../types");
9
+ const context_1 = require("../../../modules/config/context");
9
10
  const RefundSection = ({ state, send }) => {
10
11
  const { t } = (0, translations_1.useTranslation)();
12
+ const { features } = (0, context_1.useContactFormConfig)();
11
13
  const ticketTypeOptions = translations_1.PageText.Contact.input.ticketType.options.filter((option) => option.id == types_1.TicketTypeId.SingleTicket ||
12
14
  option.id == types_1.TicketTypeId.PeriodTicket);
13
15
  return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.ticketing.refund.otherTicketRefund.label), children: [(0, jsx_runtime_1.jsx)(components_1.Select, { id: "ticketType", label: t(translations_1.PageText.Contact.input.ticketType.labelRefund), value: state.context.ticketType, valueToId: (option) => option.id, valueToText: (option) => t(option.name), onChange: (value) => {
@@ -24,27 +26,17 @@ const RefundSection = ({ state, send }) => {
24
26
  type: 'ON_INPUT_CHANGE',
25
27
  inputName: 'orderId',
26
28
  value: e.target.value,
27
- }), modalContent: {
28
- description: t(translations_1.PageText.Contact.input.orderId.description),
29
- instruction: t(translations_1.PageText.Contact.input.orderId.instruction),
30
- bulletPoints: translations_1.PageText.Contact.input.orderId.descriptionBulletPoints.map((bulletPoint) => t(bulletPoint)),
31
- } }), state.context.ticketType?.id === types_1.TicketTypeId.PeriodTicket && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(translations_1.PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', modalContent: {
32
- description: t(translations_1.PageText.Contact.input.travelCardNumber.info),
33
- }, isRequired: true, errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
29
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(translations_1.PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', isRequired: true, errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
34
30
  type: 'ON_INPUT_CHANGE',
35
31
  inputName: 'travelCardNumber',
36
32
  value: e.target.value,
37
- }) })), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "amount", label: t(translations_1.PageText.Contact.input.amount.info), type: "text", name: "amount", value: state.context.amount || '', isRequired: true, errorMessage: state.context?.errorMessages['amount']?.[0], onChange: (e) => send({
38
- type: 'ON_INPUT_CHANGE',
39
- inputName: 'amount',
40
- value: e.target.value,
41
33
  }) }), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", description: t(translations_1.PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
42
34
  type: 'ON_INPUT_CHANGE',
43
35
  inputName: 'refundReason',
44
36
  value: e.target.value,
45
37
  }), error: state.context.errorMessages['refundReason']?.[0]
46
38
  ? t(state.context.errorMessages['refundReason']?.[0])
47
- : undefined }), (0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "attachments", label: t(translations_1.PageText.Contact.refund.refundTaxi.taxiReceipt.info), iconLabel: t(translations_1.PageText.Contact.input.feedback.attachment.receipt), name: "attachments", isRequired: true, onChange: (files) => {
39
+ : undefined }), features?.enableFileUploads && ((0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "attachments", label: t(translations_1.PageText.Contact.refund.refundTaxi.taxiReceipt.info), iconLabel: t(translations_1.PageText.Contact.input.feedback.attachment.receipt), name: "attachments", onChange: (files) => {
48
40
  send({
49
41
  type: 'ON_INPUT_CHANGE',
50
42
  inputName: 'attachments',
@@ -52,7 +44,7 @@ const RefundSection = ({ state, send }) => {
52
44
  });
53
45
  }, errorMessage: state.context?.errorMessages['attachments']?.[0]
54
46
  ? t(state.context?.errorMessages['attachments']?.[0])
55
- : undefined })] }));
47
+ : undefined }))] }));
56
48
  };
57
49
  const AboutYouSection = ({ state, send }) => {
58
50
  const { t } = (0, translations_1.useTranslation)();
@@ -1 +1 @@
1
- {"version":3,"file":"refundFormMachine.d.ts","sourceRoot":"","sources":["../../src/refund/refundFormMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EAEX,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAWzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,oBAAY,YAAY;IACtB,cAAc,mBAAmB;IACjC,wBAAwB,6BAA6B;IACrD,yBAAyB,8BAA8B;CACxD;AAED,oBAAY,gBAAgB;IAC1B,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;CACxC;AAED,oBAAY,wBAAwB;IAClC,UAAU,eAAe;IACzB,SAAS,cAAc;CACxB;AAED,oBAAY,QAAQ;IAClB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,yBAAyB,8BAA8B;CACxD;AAED,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAA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Y,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAEpD,yBAAyB,EAAE,OAAO,CAAC;IACnC,2BAA2B,EAAE,OAAO,CAAC;IACrC,aAAa,EAAE,kBAAkB,CAAC;IAClC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAiHF,MAAM,MAAM,YAAY,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,CACR,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,QAAQ,CAAC,EACtB,KAAK,CAAC,EAAE,YAAY;;;uEAjMI,aAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0iBvC;AAED,eAAO,MAAM,kBAAkB;;;uEA5iBL,aAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmjBvC,CAAC"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.refundStateMachine = exports.FormType = exports.RefundAndTravelGuarantee = exports.RefundTicketForm = exports.FormCategory = void 0;
4
4
  exports.createRefundStateMachine = createRefundStateMachine;
5
- const types_1 = require("../types");
6
5
  const xstate_1 = require("xstate");
7
6
  const validation_1 = require("../validation");
8
7
  const utils_1 = require("../utils");
@@ -43,7 +42,7 @@ const setInitialAgreementAndFormType = (context, isChecked) => {
43
42
  };
44
43
  };
45
44
  const setInputToValidate = (context) => {
46
- const { formType, firstName, lastName, email, phoneNumber, address, postalCode, city, hasInternationalBankAccount, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, date, kilometersDriven, fromAddress, toAddress, plannedDepartureTime, reasonForTransportFailure, amount, attachments, customerNumber, orderId, ticketType, travelCardNumber, refundReason, purchasePlatform, } = context;
45
+ const { formType, firstName, lastName, email, phoneNumber, address, postalCode, city, hasInternationalBankAccount, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, date, kilometersDriven, fromAddress, toAddress, plannedDepartureTime, reasonForTransportFailure, amount, attachments, orderId, ticketType, travelCardNumber, refundReason, } = context;
47
46
  const commonFields = {
48
47
  formType,
49
48
  transportMode,
@@ -70,10 +69,8 @@ const setInputToValidate = (context) => {
70
69
  case FormType.AppTicketRefund:
71
70
  return {
72
71
  formType,
73
- customerNumber,
74
- orderId,
72
+ referenceNumber: orderId,
75
73
  refundReason,
76
- purchasePlatform,
77
74
  firstName,
78
75
  lastName,
79
76
  address,
@@ -87,7 +84,7 @@ const setInputToValidate = (context) => {
87
84
  formType,
88
85
  ticketType,
89
86
  refundReason,
90
- amount,
87
+ travelCardNumber,
91
88
  firstName,
92
89
  lastName,
93
90
  address,
@@ -96,9 +93,6 @@ const setInputToValidate = (context) => {
96
93
  email,
97
94
  phoneNumber,
98
95
  orderId,
99
- attachments,
100
- ...(ticketType &&
101
- ticketType.id === types_1.TicketTypeId.PeriodTicket && { travelCardNumber }),
102
96
  ...(hasInternationalBankAccount
103
97
  ? { IBAN, SWIFT }
104
98
  : { bankAccountNumber }),
@@ -146,7 +140,16 @@ function createRefundStateMachine(onSubmit, paths) {
146
140
  setValidationErrors: (0, xstate_1.assign)(({ context, event }) => {
147
141
  if (event.type === 'SUBMIT') {
148
142
  const inputsToValidate = setInputToValidate(context);
149
- const errors = (0, validation_1.commonInputValidator)(inputsToValidate);
143
+ const rawErrors = (0, validation_1.commonInputValidator)(inputsToValidate);
144
+ // AppTicketRefund validates orderId under key 'referenceNumber' for correct
145
+ // error messages, but the form field uses 'orderId' as its inputName.
146
+ const errors = context.formType === FormType.AppTicketRefund &&
147
+ rawErrors.referenceNumber
148
+ ? (({ referenceNumber, ...rest }) => ({
149
+ ...rest,
150
+ orderId: referenceNumber,
151
+ }))(rawErrors)
152
+ : rawErrors;
150
153
  return {
151
154
  firstIncorrectErrorMessage: (0, utils_1.findFirstErrorMessage)(event.orderedFormFieldNames, errors),
152
155
  errorMessages: { ...errors },
@@ -0,0 +1,2 @@
1
+ import '@testing-library/jest-dom/vitest';
2
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/test-utils/setup.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("@testing-library/jest-dom/vitest");
@@ -1 +1 @@
1
- {"version":3,"file":"feeComplaintForm.d.ts","sourceRoot":"","sources":["../../../src/ticket-control/forms/feeComplaintForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAMpD,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE;QAAE,OAAO,EAAE,yBAAyB,CAAA;KAAE,CAAC;IAC9C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,uBAAuB,KAAK,IAAI,CAAC;CACvD,CAAC;AA6bF,eAAO,MAAM,gBAAgB,GAAI,iBAAiB,qBAAqB,4CAYtE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"feeComplaintForm.d.ts","sourceRoot":"","sources":["../../../src/ticket-control/forms/feeComplaintForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAMpD,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE;QAAE,OAAO,EAAE,yBAAyB,CAAA;KAAE,CAAC;IAC9C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,uBAAuB,KAAK,IAAI,CAAC;CACvD,CAAC;AAmcF,eAAO,MAAM,gBAAgB,GAAI,iBAAiB,qBAAqB,4CAYtE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -104,24 +104,24 @@ const FormContent = ({ state, send }) => {
104
104
  type: 'ON_INPUT_CHANGE',
105
105
  inputName: 'phoneNumber',
106
106
  value: e.target.value,
107
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "bankAccountNumber", label: t(translations_1.PageText.Contact.input.bankInformation.bankAccountNumber.label), placeholder: t(translations_1.PageText.Contact.input.bankInformation.bankAccountNumber
108
- .placeholder), type: "text", name: "bankAccountNumber", value: state.context.bankAccountNumber || '', disabled: state.context.hasInternationalBankAccount, isRequired: true, errorMessage: state.context?.errorMessages['bankAccountNumber']?.[0], onChange: (e) => send({
109
- type: 'ON_INPUT_CHANGE',
110
- inputName: 'bankAccountNumber',
111
- value: e.target.value,
112
- }) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(translations_1.PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
113
- type: 'ON_INPUT_CHANGE',
114
- inputName: 'hasInternationalBankAccount',
115
- value: !state.context.hasInternationalBankAccount,
116
- }) }), state.context.hasInternationalBankAccount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "IBAN", label: t(translations_1.PageText.Contact.input.bankInformation.IBAN.label), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
107
+ }) }), state.context.includeBankAccountFields && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "bankAccountNumber", label: t(translations_1.PageText.Contact.input.bankInformation.bankAccountNumber.label), placeholder: t(translations_1.PageText.Contact.input.bankInformation.bankAccountNumber
108
+ .placeholder), type: "text", name: "bankAccountNumber", value: state.context.bankAccountNumber || '', disabled: state.context.hasInternationalBankAccount, isRequired: true, errorMessage: state.context?.errorMessages['bankAccountNumber']?.[0], onChange: (e) => send({
117
109
  type: 'ON_INPUT_CHANGE',
118
- inputName: 'IBAN',
110
+ inputName: 'bankAccountNumber',
119
111
  value: e.target.value,
120
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(translations_1.PageText.Contact.input.bankInformation.SWIFT.label), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
112
+ }) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(translations_1.PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
121
113
  type: 'ON_INPUT_CHANGE',
122
- inputName: 'SWIFT',
123
- value: e.target.value,
124
- }) })] }))] })] }));
114
+ inputName: 'hasInternationalBankAccount',
115
+ value: !state.context.hasInternationalBankAccount,
116
+ }) }), state.context.hasInternationalBankAccount && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "IBAN", label: t(translations_1.PageText.Contact.input.bankInformation.IBAN.label), type: "string", name: "IBAN", value: state.context.IBAN || '', isRequired: true, errorMessage: state.context?.errorMessages['IBAN']?.[0], onChange: (e) => send({
117
+ type: 'ON_INPUT_CHANGE',
118
+ inputName: 'IBAN',
119
+ value: e.target.value,
120
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(translations_1.PageText.Contact.input.bankInformation.SWIFT.label), type: "string", name: "SWIFT", value: state.context.SWIFT || '', isRequired: true, errorMessage: state.context?.errorMessages['SWIFT']?.[0], onChange: (e) => send({
121
+ type: 'ON_INPUT_CHANGE',
122
+ inputName: 'SWIFT',
123
+ value: e.target.value,
124
+ }) })] }))] }))] })] }));
125
125
  };
126
126
  const FeeComplaintForm = ({ state, send }) => {
127
127
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(FirstAgreement, { state: state, send: send }), state.context.agreesFirstAgreement && ((0, jsx_runtime_1.jsx)(SecondAgreement, { state: state, send: send })), state.context.agreesSecondAgreement && ((0, jsx_runtime_1.jsx)(FormContent, { state: state, send: send }))] }));
@@ -1 +1 @@
1
- {"version":3,"file":"feedbackForm.d.ts","sourceRoot":"","sources":["../../../src/ticket-control/forms/feedbackForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAe3E,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE;QAAE,OAAO,EAAE,yBAAyB,CAAA;KAAE,CAAC;IAC9C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,uBAAuB,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,iBAAiB,iBAAiB,4CAwN9D,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"feedbackForm.d.ts","sourceRoot":"","sources":["../../../src/ticket-control/forms/feedbackForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAe3E,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE;QAAE,OAAO,EAAE,yBAAyB,CAAA;KAAE,CAAC;IAC9C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,uBAAuB,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,iBAAiB,iBAAiB,4CAoO9D,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -21,19 +21,23 @@ const FeedbackForm = ({ state, send }) => {
21
21
  value: value,
22
22
  });
23
23
  }, isRequired: true, error: state.context?.errorMessages['line']?.[0] &&
24
- t(state.context?.errorMessages['line']?.[0]) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "fromStop", label: t(translations_1.PageText.Contact.input.fromStop.optionalLabel), value: state.context.fromStop, placeholder: t(translations_1.PageText.Contact.input.fromStop.optionLabel), isDisabled: !state.context.line, options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), onChange: (value) => {
24
+ t(state.context?.errorMessages['line']?.[0]) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "fromStop", label: t(translations_1.PageText.Contact.input.fromStop.label), value: state.context.fromStop, placeholder: t(translations_1.PageText.Contact.input.fromStop.optionLabel), isDisabled: !state.context.line, options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), onChange: (value) => {
25
25
  send({
26
26
  type: 'ON_INPUT_CHANGE',
27
27
  inputName: 'fromStop',
28
28
  value: value,
29
29
  });
30
- } }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "toStop", label: t(translations_1.PageText.Contact.input.toStop.optionalLabel), value: state.context.toStop, placeholder: t(translations_1.PageText.Contact.input.toStop.optionLabel), isDisabled: !state.context.line, options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), onChange: (value) => {
30
+ }, isRequired: true, error: state.context?.errorMessages['fromStop']?.[0]
31
+ ? t(state.context?.errorMessages['fromStop']?.[0])
32
+ : undefined }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "toStop", label: t(translations_1.PageText.Contact.input.toStop.label), value: state.context.toStop, placeholder: t(translations_1.PageText.Contact.input.toStop.optionLabel), isDisabled: !state.context.line, options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), onChange: (value) => {
31
33
  send({
32
34
  type: 'ON_INPUT_CHANGE',
33
35
  inputName: 'toStop',
34
36
  value: value,
35
37
  });
36
- } }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "date", label: t(translations_1.PageText.Contact.input.date.label), isRequired: true, value: state.context.dateOfTicketControl, onChange: (dateOfTicketControl) => send({
38
+ }, isRequired: true, error: state.context?.errorMessages['toStop']?.[0]
39
+ ? t(state.context?.errorMessages['toStop']?.[0])
40
+ : undefined }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "date", label: t(translations_1.PageText.Contact.input.date.label), isRequired: true, value: state.context.dateOfTicketControl, onChange: (dateOfTicketControl) => send({
37
41
  type: 'ON_INPUT_CHANGE',
38
42
  inputName: 'dateOfTicketControl',
39
43
  value: dateOfTicketControl,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ticket-control/index.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,wBAAwB,+CAmF7B,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ticket-control/index.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,wBAAwB,+CAyF7B,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
@@ -20,7 +20,7 @@ const error_message_1 = __importDefault(require("../components/error-message/err
20
20
  const TicketControlPageContent = () => {
21
21
  const { t } = (0, translations_1.useTranslation)();
22
22
  const apiConfig = (0, config_1.useApiConfig)();
23
- const { formSchemaOverrides, layout } = (0, config_1.useContactFormConfig)();
23
+ const { formSchemaOverrides, layout, features } = (0, config_1.useContactFormConfig)();
24
24
  const successPath = layout?.successPath ??
25
25
  (layout?.basePath ? `${layout.basePath}/success` : '/contact/success');
26
26
  const errorPath = layout?.errorPath ??
@@ -28,7 +28,13 @@ const TicketControlPageContent = () => {
28
28
  const machine = (0, react_2.useMemo)(() => (0, ticket_control_form_machine_1.createTicketControlFormMachine)(apiConfig.onSubmit, {
29
29
  successPath,
30
30
  errorPath,
31
- }), [apiConfig.onSubmit, successPath, errorPath]);
31
+ includeBankAccountFields: features?.includeBankAccountFields !== false,
32
+ }), [
33
+ apiConfig.onSubmit,
34
+ successPath,
35
+ errorPath,
36
+ features?.includeBankAccountFields,
37
+ ]);
32
38
  const [state, send] = (0, react_1.useMachine)(machine);
33
39
  const displaySubmitButton = (state.context.formType === 'feeComplaint' &&
34
40
  state.context.agreesSecondAgreement) ||
@@ -61,6 +61,7 @@ export type TicketControlContextProps = {
61
61
  agreesSecondAgreement: boolean;
62
62
  isAppTicketStorageMode: boolean;
63
63
  hasInternationalBankAccount: boolean;
64
+ includeBankAccountFields: boolean;
64
65
  errorMessages: InputErrorMessages;
65
66
  firstErrorMessage?: string;
66
67
  hasSubmissionError?: boolean;
@@ -69,7 +70,10 @@ export type MachinePaths = {
69
70
  successPath: string;
70
71
  errorPath: string;
71
72
  };
72
- export declare function createTicketControlFormMachine(onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<TicketControlContextProps, {
73
+ export type MachineOptions = MachinePaths & {
74
+ includeBankAccountFields?: boolean;
75
+ };
76
+ export declare function createTicketControlFormMachine(onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>, paths?: Partial<MachineOptions>): import("xstate").StateMachine<TicketControlContextProps, {
73
77
  type: "VALIDATE";
74
78
  } | {
75
79
  type: "ON_INPUT_CHANGE";
@@ -1 +1 @@
1
- {"version":3,"file":"ticket-control-form-machine.d.ts","sourceRoot":"","sources":["../../src/ticket-control/ticket-control-form-machine.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,IA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