@mrfylke/contact-form 0.1.10 → 0.1.21

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 (166) hide show
  1. package/README.md +393 -2
  2. package/lib/ContactFormRoot.d.ts +11 -1
  3. package/lib/ContactFormRoot.d.ts.map +1 -1
  4. package/lib/ContactFormRoot.js +2 -2
  5. package/lib/commoneEvents.d.ts +1 -1
  6. package/lib/commoneEvents.d.ts.map +1 -1
  7. package/lib/components/form/date-selector.d.ts.map +1 -1
  8. package/lib/components/form/date-selector.js +5 -4
  9. package/lib/components/form/departure-time-field.d.ts +16 -0
  10. package/lib/components/form/departure-time-field.d.ts.map +1 -0
  11. package/lib/components/form/departure-time-field.js +28 -0
  12. package/lib/components/form/description-modal.d.ts.map +1 -1
  13. package/lib/components/form/description-modal.js +2 -1
  14. package/lib/components/form/file-input.d.ts.map +1 -1
  15. package/lib/components/form/file-input.js +2 -1
  16. package/lib/components/form/index.d.ts +1 -0
  17. package/lib/components/form/index.d.ts.map +1 -1
  18. package/lib/components/form/index.js +3 -1
  19. package/lib/components/form/input.d.ts.map +1 -1
  20. package/lib/components/form/input.js +2 -1
  21. package/lib/components/form/searchable-select/utils.js +6 -1
  22. package/lib/components/index.d.ts +1 -1
  23. package/lib/components/index.d.ts.map +1 -1
  24. package/lib/components/index.js +2 -1
  25. package/lib/contact.module.css +9 -0
  26. package/lib/error-content/error-content.d.ts.map +1 -1
  27. package/lib/error-content/error-content.js +2 -1
  28. package/lib/group-travel/index.d.ts.map +1 -1
  29. package/lib/group-travel/index.js +3 -1
  30. package/lib/index.d.ts +16 -4
  31. package/lib/index.d.ts.map +1 -1
  32. package/lib/index.js +41 -1
  33. package/lib/journey-info/index.d.ts.map +1 -1
  34. package/lib/journey-info/index.js +14 -8
  35. package/lib/journey-info/journeyInfoStateMachine.d.ts +8 -8
  36. package/lib/layouts/contact-page-layout.d.ts +2 -2
  37. package/lib/layouts/contact-page-layout.d.ts.map +1 -1
  38. package/lib/layouts/contact-page-layout.js +29 -20
  39. package/lib/layouts/container.module.css +1 -1
  40. package/lib/layouts/layout.module.css +23 -2
  41. package/lib/lines/use-departures.d.ts +12 -0
  42. package/lib/lines/use-departures.d.ts.map +1 -0
  43. package/lib/lines/use-departures.js +35 -0
  44. package/lib/lines/use-lines.d.ts +5 -6
  45. package/lib/lines/use-lines.d.ts.map +1 -1
  46. package/lib/lines/use-lines.js +75 -42
  47. package/lib/lost-property/LostPropertyForm.d.ts +10 -0
  48. package/lib/lost-property/LostPropertyForm.d.ts.map +1 -0
  49. package/lib/lost-property/LostPropertyForm.js +65 -0
  50. package/lib/lost-property/LostPropertyMachine.d.ts +116 -0
  51. package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -0
  52. package/lib/lost-property/LostPropertyMachine.js +187 -0
  53. package/lib/lost-property/index.d.ts.map +1 -1
  54. package/lib/lost-property/index.js +27 -3
  55. package/lib/means-of-transport/forms/delayForm.d.ts.map +1 -1
  56. package/lib/means-of-transport/forms/delayForm.js +26 -18
  57. package/lib/means-of-transport/forms/driverForm.d.ts.map +1 -1
  58. package/lib/means-of-transport/forms/driverForm.js +26 -18
  59. package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
  60. package/lib/means-of-transport/forms/injuryForm.js +26 -18
  61. package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
  62. package/lib/means-of-transport/forms/serviceOfferingForm.js +10 -10
  63. package/lib/means-of-transport/forms/stopForm.d.ts.map +1 -1
  64. package/lib/means-of-transport/forms/stopForm.js +13 -12
  65. package/lib/means-of-transport/forms/transportationForm.d.ts.map +1 -1
  66. package/lib/means-of-transport/forms/transportationForm.js +26 -18
  67. package/lib/means-of-transport/index.d.ts.map +1 -1
  68. package/lib/means-of-transport/index.js +13 -4
  69. package/lib/means-of-transport/means-of-transport-form-machine.d.ts +10 -8
  70. package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
  71. package/lib/means-of-transport/means-of-transport-form-machine.js +6 -1
  72. package/lib/modules/config/types.d.ts +56 -1
  73. package/lib/modules/config/types.d.ts.map +1 -1
  74. package/lib/refund/events.d.ts +1 -1
  75. package/lib/refund/events.d.ts.map +1 -1
  76. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
  77. package/lib/refund/forms/refund-and-travel-guarantee/index.js +7 -5
  78. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
  79. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +39 -29
  80. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
  81. package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +37 -28
  82. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
  83. package/lib/refund/forms/refund-ticket/appTicketRefund.js +46 -25
  84. package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
  85. package/lib/refund/forms/refund-ticket/index.js +9 -6
  86. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
  87. package/lib/refund/forms/refund-ticket/otherTicketRefund.js +56 -30
  88. package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
  89. package/lib/refund/forms/residualValueOnTravelCard/index.js +5 -3
  90. package/lib/refund/index.d.ts.map +1 -1
  91. package/lib/refund/index.js +39 -6
  92. package/lib/refund/refundFormMachine.d.ts +37 -13
  93. package/lib/refund/refundFormMachine.d.ts.map +1 -1
  94. package/lib/refund/refundFormMachine.js +107 -11
  95. package/lib/server/journey-planner/index.d.ts.map +1 -1
  96. package/lib/server/journey-planner/index.js +15 -6
  97. package/lib/server/journey-planner/validators.d.ts +2 -0
  98. package/lib/server/journey-planner/validators.d.ts.map +1 -1
  99. package/lib/server/journey-planner/validators.js +1 -0
  100. package/lib/success-content/success-content.d.ts.map +1 -1
  101. package/lib/success-content/success-content.js +2 -1
  102. package/lib/test-utils/setup.d.ts +2 -0
  103. package/lib/test-utils/setup.d.ts.map +1 -0
  104. package/lib/test-utils/setup.js +3 -0
  105. package/lib/ticket-control/events.d.ts +1 -1
  106. package/lib/ticket-control/events.d.ts.map +1 -1
  107. package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
  108. package/lib/ticket-control/forms/feeComplaintForm.js +39 -36
  109. package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -1
  110. package/lib/ticket-control/forms/feedbackForm.js +26 -14
  111. package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
  112. package/lib/ticket-control/forms/postponePayment.js +8 -7
  113. package/lib/ticket-control/index.d.ts.map +1 -1
  114. package/lib/ticket-control/index.js +23 -8
  115. package/lib/ticket-control/ticket-control-form-machine.d.ts +19 -11
  116. package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
  117. package/lib/ticket-control/ticket-control-form-machine.js +25 -5
  118. package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
  119. package/lib/ticketing/forms/app/appAccountForm.js +9 -8
  120. package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
  121. package/lib/ticketing/forms/app/appTicketingForm.js +13 -12
  122. package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
  123. package/lib/ticketing/forms/app/appTravelSuggestionForm.js +6 -5
  124. package/lib/ticketing/forms/app/index.d.ts.map +1 -1
  125. package/lib/ticketing/forms/app/index.js +2 -1
  126. package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
  127. package/lib/ticketing/forms/priceAndTicketTypesForm.js +6 -5
  128. package/lib/ticketing/forms/travel-card/index.d.ts.map +1 -1
  129. package/lib/ticketing/forms/travel-card/index.js +2 -1
  130. package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
  131. package/lib/ticketing/forms/travel-card/orderTravelCard.js +2 -2
  132. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
  133. package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +9 -8
  134. package/lib/ticketing/forms/webshop/index.d.ts.map +1 -1
  135. package/lib/ticketing/forms/webshop/index.js +2 -1
  136. package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
  137. package/lib/ticketing/forms/webshop/webshopAccountForm.js +9 -8
  138. package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
  139. package/lib/ticketing/forms/webshop/webshopTicketingForm.js +12 -11
  140. package/lib/ticketing/index.d.ts.map +1 -1
  141. package/lib/ticketing/index.js +21 -6
  142. package/lib/ticketing/ticketingStateMachine.d.ts +12 -12
  143. package/lib/translations/index.d.ts +1 -1
  144. package/lib/translations/index.d.ts.map +1 -1
  145. package/lib/translations/index.js +2 -1
  146. package/lib/translations/merge-overrides.d.ts.map +1 -1
  147. package/lib/translations/merge-overrides.js +8 -1
  148. package/lib/translations/pages/contact.d.ts +61 -0
  149. package/lib/translations/pages/contact.d.ts.map +1 -1
  150. package/lib/translations/pages/contact.js +64 -2
  151. package/lib/translations/translations-context.d.ts +2 -0
  152. package/lib/translations/translations-context.d.ts.map +1 -1
  153. package/lib/translations/translations-context.js +39 -0
  154. package/lib/types/submit-payloads.d.ts +40 -11
  155. package/lib/types/submit-payloads.d.ts.map +1 -1
  156. package/lib/types/submit-payloads.js +1 -1
  157. package/lib/types.d.ts +1 -1
  158. package/lib/types.d.ts.map +1 -1
  159. package/lib/url-form-type.d.ts +6 -0
  160. package/lib/url-form-type.d.ts.map +1 -0
  161. package/lib/url-form-type.js +21 -0
  162. package/lib/utils.d.ts.map +1 -1
  163. package/lib/utils.js +10 -0
  164. package/lib/validation/validationRules.d.ts.map +1 -1
  165. package/lib/validation/validationRules.js +31 -0
  166. package/package.json +11 -3
@@ -5,59 +5,68 @@ 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 typography_1 = require("../../../components/typography");
8
9
  const checkbox_1 = require("../../../components/checkbox");
9
10
  const RefundCarForm = ({ state, send }) => {
10
11
  const { t } = (0, translations_1.useTranslation)();
12
+ const PageText = (0, translations_1.usePageText)();
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.refundCar.aboutTheCarTrip.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "kilometersDriven", label: t(translations_1.PageText.Contact.input.kilometersDriven.label), type: "text", name: "kilometersDriven", value: state.context.kilometersDriven || '', isRequired: true, errorMessage: state.context?.errorMessages['kilometersDriven']?.[0] || undefined, 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.refundCar.aboutTheCarTrip.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.refundCar.info) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "kilometersDriven", label: t(PageText.Contact.input.kilometersDriven.label), type: "text", name: "kilometersDriven", value: state.context.kilometersDriven || '', isRequired: true, errorMessage: state.context?.errorMessages['kilometersDriven']?.[0] || undefined, onChange: (e) => send({
14
16
  type: 'ON_INPUT_CHANGE',
15
17
  inputName: 'kilometersDriven',
16
18
  value: e.target.value,
17
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "fromAddress", label: t(translations_1.PageText.Contact.input.fromAddress.label), type: "text", name: "fromAddress", value: state.context.fromAddress || '', isRequired: true, errorMessage: state.context?.errorMessages['fromAddress']?.[0] || undefined, onChange: (e) => send({
19
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "fromAddress", label: t(PageText.Contact.input.fromAddress.label), type: "text", name: "fromAddress", value: state.context.fromAddress || '', isRequired: true, errorMessage: state.context?.errorMessages['fromAddress']?.[0] || undefined, onChange: (e) => send({
18
20
  type: 'ON_INPUT_CHANGE',
19
21
  inputName: 'fromAddress',
20
22
  value: e.target.value,
21
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "toAddress", label: t(translations_1.PageText.Contact.input.toAddress.label), type: "text", name: "toAddress", value: state.context.toAddress || '', isRequired: true, errorMessage: state.context?.errorMessages['toAddress']?.[0] || undefined, onChange: (e) => send({
23
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "toAddress", label: t(PageText.Contact.input.toAddress.label), type: "text", name: "toAddress", value: state.context.toAddress || '', isRequired: true, errorMessage: state.context?.errorMessages['toAddress']?.[0] || undefined, onChange: (e) => send({
22
24
  type: 'ON_INPUT_CHANGE',
23
25
  inputName: 'toAddress',
24
26
  value: e.target.value,
25
- }) })] }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.refund.refundCar.aboutThePlanedTrip.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
+ }) })] }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.refundCar.aboutThePlanedTrip.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({
57
- type: 'ON_INPUT_CHANGE',
58
- inputName: 'plannedDepartureTime',
59
- 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) => {
58
+ }), errorMessage: state.context?.errorMessages['date']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.DepartureTimeField, { date: state.context.date, lineId: state.context.line?.id, fromStopId: state.context.fromStop?.id, toStopId: state.context.toStop?.id, selectedTripId: state.context.tripId, plannedDepartureTime: state.context.plannedDepartureTime, onChange: (time, tripId) => {
59
+ send({
60
+ type: 'ON_INPUT_CHANGE',
61
+ inputName: 'plannedDepartureTime',
62
+ value: time,
63
+ });
64
+ send({
65
+ type: 'ON_INPUT_CHANGE',
66
+ inputName: 'tripId',
67
+ value: tripId,
68
+ });
69
+ }, isRequired: true, 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
70
  if (!value)
62
71
  return;
63
72
  send({
@@ -65,16 +74,17 @@ const RefundCarForm = ({ state, send }) => {
65
74
  inputName: 'reasonForTransportFailure',
66
75
  value: value,
67
76
  });
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]
77
+ }, placeholder: t(PageText.Contact.input.reasonForTransportFailure.optionLabel), options: PageText.Contact.input.reasonForTransportFailure.options, isRequired: true, error: state.context?.errorMessages['reasonForTransportFailure']?.[0]
69
78
  ? 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({
79
+ : 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
80
  type: 'ON_INPUT_CHANGE',
72
81
  inputName: 'feedback',
73
82
  value: e.target.value,
74
83
  }), fileInputProps: {
75
84
  id: 'attachments',
76
85
  name: 'attachments',
77
- iconLabel: t(translations_1.PageText.Contact.input.feedback.attachment.generic),
86
+ iconLabel: t(PageText.Contact.refund.refundAndTravelGuarantee
87
+ .feedbackAttachmentLabel),
78
88
  onChange: (files) => {
79
89
  send({
80
90
  type: 'ON_INPUT_CHANGE',
@@ -82,48 +92,48 @@ const RefundCarForm = ({ state, send }) => {
82
92
  value: files,
83
93
  });
84
94
  },
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({
95
+ } }) }), (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
96
  type: 'ON_INPUT_CHANGE',
87
97
  inputName: 'firstName',
88
98
  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({
99
+ }) }), (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
100
  type: 'ON_INPUT_CHANGE',
91
101
  inputName: 'lastName',
92
102
  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({
103
+ }) }), (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
104
  type: 'ON_INPUT_CHANGE',
95
105
  inputName: 'address',
96
106
  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({
107
+ }) }), (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
108
  type: 'ON_INPUT_CHANGE',
99
109
  inputName: 'postalCode',
100
110
  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({
111
+ }) }), (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
112
  type: 'ON_INPUT_CHANGE',
103
113
  inputName: 'city',
104
114
  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({
115
+ }) }), (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
116
  type: 'ON_INPUT_CHANGE',
107
117
  inputName: 'email',
108
118
  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({
119
+ }) }), (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
120
  type: 'ON_INPUT_CHANGE',
111
121
  inputName: 'phoneNumber',
112
122
  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
123
+ }) }), (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
124
  .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
125
  type: 'ON_INPUT_CHANGE',
116
126
  inputName: 'bankAccountNumber',
117
127
  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({
128
+ }) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
119
129
  type: 'ON_INPUT_CHANGE',
120
130
  inputName: 'hasInternationalBankAccount',
121
131
  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({
132
+ }) }), 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
133
  type: 'ON_INPUT_CHANGE',
124
134
  inputName: 'IBAN',
125
135
  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({
136
+ }) }), (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
137
  type: 'ON_INPUT_CHANGE',
128
138
  inputName: 'SWIFT',
129
139
  value: e.target.value,
@@ -1 +1 @@
1
- {"version":3,"file":"refundTaxiForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundTaxiForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAgB7D,KAAK,mBAAmB,GAAG;IACzB,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,cAAc,GAAI,iBAAiB,mBAAmB,4CA0alE,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"refundTaxiForm.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/refund-and-travel-guarantee/refundTaxiForm.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAgB7D,KAAK,mBAAmB,GAAG;IACzB,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,cAAc,GAAI,iBAAiB,mBAAmB,4CAqblE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -8,13 +8,14 @@ const translations_1 = require("../../../translations");
8
8
  const checkbox_1 = require("../../../components/checkbox");
9
9
  const RefundTaxiForm = ({ state, send }) => {
10
10
  const { t } = (0, translations_1.useTranslation)();
11
+ const PageText = (0, translations_1.usePageText)();
11
12
  const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
12
13
  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({
14
+ 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
15
  type: 'ON_INPUT_CHANGE',
15
16
  inputName: 'amount',
16
17
  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) => {
18
+ }) }), (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
19
  send({
19
20
  type: 'ON_INPUT_CHANGE',
20
21
  inputName: 'attachments',
@@ -22,42 +23,49 @@ const RefundTaxiForm = ({ state, send }) => {
22
23
  });
23
24
  }, errorMessage: state.context?.errorMessages['attachments']?.[0]
24
25
  ? 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({
26
+ : 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
27
  type: 'ON_TRANSPORTMODE_CHANGE',
27
28
  value: value,
28
29
  }), isRequired: true, error: state.context?.errorMessages['transportMode']?.[0]
29
30
  ? 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) => {
31
+ : 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
32
  send({
32
33
  type: 'ON_LINE_CHANGE',
33
34
  value: value,
34
35
  });
35
36
  }, 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) => {
37
+ 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
38
  send({
38
39
  type: 'ON_INPUT_CHANGE',
39
40
  inputName: 'fromStop',
40
41
  value: value,
41
42
  });
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]
43
+ }, 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
44
  ? 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) => {
45
+ : 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
46
  send({
46
47
  type: 'ON_INPUT_CHANGE',
47
48
  inputName: 'toStop',
48
49
  value: value,
49
50
  });
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]
51
+ }, 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
52
  ? 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({
53
+ : 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
54
  type: 'ON_INPUT_CHANGE',
54
55
  inputName: 'date',
55
56
  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({
57
- type: 'ON_INPUT_CHANGE',
58
- inputName: 'plannedDepartureTime',
59
- 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) => {
57
+ }), errorMessage: state.context?.errorMessages['date']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.DepartureTimeField, { date: state.context.date, lineId: state.context.line?.id, fromStopId: state.context.fromStop?.id, toStopId: state.context.toStop?.id, selectedTripId: state.context.tripId, plannedDepartureTime: state.context.plannedDepartureTime, onChange: (time, tripId) => {
58
+ send({
59
+ type: 'ON_INPUT_CHANGE',
60
+ inputName: 'plannedDepartureTime',
61
+ value: time,
62
+ });
63
+ send({
64
+ type: 'ON_INPUT_CHANGE',
65
+ inputName: 'tripId',
66
+ value: tripId,
67
+ });
68
+ }, isRequired: true, 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
69
  if (!value)
62
70
  return;
63
71
  send({
@@ -65,15 +73,16 @@ const RefundTaxiForm = ({ state, send }) => {
65
73
  inputName: 'reasonForTransportFailure',
66
74
  value: value,
67
75
  });
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]
76
+ }, placeholder: t(PageText.Contact.input.reasonForTransportFailure.optionLabel), options: PageText.Contact.input.reasonForTransportFailure.options, isRequired: true, error: state.context?.errorMessages['reasonForTransportFailure']?.[0]
69
77
  ? 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({
78
+ : 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
79
  type: 'ON_INPUT_CHANGE',
72
80
  inputName: 'feedback',
73
81
  value: e.target.value,
74
82
  }), fileInputProps: {
75
83
  id: 'attachments',
76
- iconLabel: t(translations_1.PageText.Contact.input.feedback.attachment.generic),
84
+ iconLabel: t(PageText.Contact.refund.refundAndTravelGuarantee
85
+ .feedbackAttachmentLabel),
77
86
  name: 'attachments',
78
87
  onChange: (files) => {
79
88
  send({
@@ -82,48 +91,48 @@ const RefundTaxiForm = ({ state, send }) => {
82
91
  value: files,
83
92
  });
84
93
  },
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({
94
+ } }) }), (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
95
  type: 'ON_INPUT_CHANGE',
87
96
  inputName: 'firstName',
88
97
  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({
98
+ }) }), (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
99
  type: 'ON_INPUT_CHANGE',
91
100
  inputName: 'lastName',
92
101
  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({
102
+ }) }), (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
103
  type: 'ON_INPUT_CHANGE',
95
104
  inputName: 'address',
96
105
  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({
106
+ }) }), (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
107
  type: 'ON_INPUT_CHANGE',
99
108
  inputName: 'postalCode',
100
109
  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({
110
+ }) }), (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
111
  type: 'ON_INPUT_CHANGE',
103
112
  inputName: 'city',
104
113
  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({
114
+ }) }), (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
115
  type: 'ON_INPUT_CHANGE',
107
116
  inputName: 'email',
108
117
  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({
118
+ }) }), (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
119
  type: 'ON_INPUT_CHANGE',
111
120
  inputName: 'phoneNumber',
112
121
  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
122
+ }) }), (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
123
  .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
124
  type: 'ON_INPUT_CHANGE',
116
125
  inputName: 'bankAccountNumber',
117
126
  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({
127
+ }) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
119
128
  type: 'ON_INPUT_CHANGE',
120
129
  inputName: 'hasInternationalBankAccount',
121
130
  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({
131
+ }) }), 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
132
  type: 'ON_INPUT_CHANGE',
124
133
  inputName: 'IBAN',
125
134
  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({
135
+ }) }), (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
136
  type: 'ON_INPUT_CHANGE',
128
137
  inputName: 'SWIFT',
129
138
  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;AAkBhD,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,4CAyDpE,CAAC;AAqQF,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAC7C,KAAK,EACL,IAAI,GACL,EAAE,oBAAoB,2CAWtB"}
@@ -5,27 +5,16 @@ exports.default = AppTicketRefundContent;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const components_1 = require("../../../components");
7
7
  const translations_1 = require("../../../translations");
8
+ const context_1 = require("../../../modules/config/context");
9
+ const use_lines_1 = require("../../../lines/use-lines");
8
10
  const AppTicketRefund = ({ state, send }) => {
11
+ const PageText = (0, translations_1.usePageText)();
9
12
  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({
13
+ return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.refund.appTicketRefund.label), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(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
14
  type: 'ON_INPUT_CHANGE',
18
15
  inputName: 'orderId',
19
16
  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({
17
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", description: t(PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
29
18
  type: 'ON_INPUT_CHANGE',
30
19
  inputName: 'refundReason',
31
20
  value: e.target.value,
@@ -33,7 +22,7 @@ const AppTicketRefund = ({ state, send }) => {
33
22
  ? t(state.context.errorMessages['refundReason']?.[0])
34
23
  : undefined, fileInputProps: {
35
24
  id: 'attachments',
36
- iconLabel: t(translations_1.PageText.Contact.input.feedback.attachment.receipt),
25
+ iconLabel: t(PageText.Contact.input.feedback.attachment.receipt),
37
26
  name: 'attachments',
38
27
  onChange: (files) => {
39
28
  send({
@@ -45,38 +34,70 @@ const AppTicketRefund = ({ state, send }) => {
45
34
  } })] }));
46
35
  };
47
36
  exports.AppTicketRefund = AppTicketRefund;
37
+ const DepartureSection = ({ state, send }) => {
38
+ const PageText = (0, translations_1.usePageText)();
39
+ const { t } = (0, translations_1.useTranslation)();
40
+ const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
41
+ const transportModeOptions = (0, use_lines_1.useTransportModeOptions)();
42
+ return ((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({
43
+ type: 'ON_TRANSPORTMODE_CHANGE',
44
+ value: value,
45
+ }), isRequired: true, error: state.context?.errorMessages['transportMode']?.[0]
46
+ ? t(state.context?.errorMessages['transportMode']?.[0])
47
+ : 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) => {
48
+ send({ type: 'ON_LINE_CHANGE', value });
49
+ }, isRequired: true, error: state.context?.errorMessages['line']?.[0] &&
50
+ 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) => send({ type: 'ON_INPUT_CHANGE', inputName: 'fromStop', value }), 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]
51
+ ? t(state.context?.errorMessages['fromStop']?.[0])
52
+ : 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) => send({ type: 'ON_INPUT_CHANGE', inputName: 'toStop', value }), options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), placeholder: t(PageText.Contact.input.toStop.optionLabel), isRequired: true, error: state.context?.errorMessages['toStop']?.[0]
53
+ ? t(state.context?.errorMessages['toStop']?.[0])
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({ type: 'ON_INPUT_CHANGE', inputName: 'date', value: date }), errorMessage: state.context?.errorMessages['date']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.DepartureTimeField, { date: state.context.date, lineId: state.context.line?.id, fromStopId: state.context.fromStop?.id, toStopId: state.context.toStop?.id, selectedTripId: state.context.tripId, plannedDepartureTime: state.context.plannedDepartureTime, onChange: (time, tripId) => {
55
+ send({
56
+ type: 'ON_INPUT_CHANGE',
57
+ inputName: 'plannedDepartureTime',
58
+ value: time,
59
+ });
60
+ send({
61
+ type: 'ON_INPUT_CHANGE',
62
+ inputName: 'tripId',
63
+ value: tripId,
64
+ });
65
+ }, isRequired: true, errorMessage: state.context.errorMessages['plannedDepartureTime']?.[0] })] }));
66
+ };
48
67
  const AboutYouSection = ({ state, send }) => {
68
+ const PageText = (0, translations_1.usePageText)();
49
69
  const { t } = (0, translations_1.useTranslation)();
50
- return ((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({
70
+ return ((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({
51
71
  type: 'ON_INPUT_CHANGE',
52
72
  inputName: 'firstName',
53
73
  value: e.target.value,
54
- }) }), (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({
74
+ }) }), (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({
55
75
  type: 'ON_INPUT_CHANGE',
56
76
  inputName: 'lastName',
57
77
  value: e.target.value,
58
- }) }), (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({
78
+ }) }), (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({
59
79
  type: 'ON_INPUT_CHANGE',
60
80
  inputName: 'address',
61
81
  value: e.target.value,
62
- }) }), (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({
82
+ }) }), (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({
63
83
  type: 'ON_INPUT_CHANGE',
64
84
  inputName: 'postalCode',
65
85
  value: e.target.value,
66
- }) }), (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({
86
+ }) }), (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({
67
87
  type: 'ON_INPUT_CHANGE',
68
88
  inputName: 'city',
69
89
  value: e.target.value,
70
- }) }), (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({
90
+ }) }), (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({
71
91
  type: 'ON_INPUT_CHANGE',
72
92
  inputName: 'email',
73
93
  value: e.target.value,
74
- }) }), (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({
94
+ }) }), (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({
75
95
  type: 'ON_INPUT_CHANGE',
76
96
  inputName: 'phoneNumber',
77
97
  value: e.target.value,
78
98
  }) })] }));
79
99
  };
80
100
  function AppTicketRefundContent({ state, send, }) {
81
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(exports.AppTicketRefund, { state: state, send: send }), (0, jsx_runtime_1.jsx)(AboutYouSection, { state: state, send: send })] }));
101
+ const { features } = (0, context_1.useContactFormConfig)();
102
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(exports.AppTicketRefund, { state: state, send: send }), (0, jsx_runtime_1.jsx)(AboutYouSection, { state: state, send: send }), features?.includeRefundDepartureInfo && ((0, jsx_runtime_1.jsx)(DepartureSection, { state: state, send: send }))] }));
82
103
  }
@@ -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;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,4CAmIxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -15,21 +15,24 @@ const refundFormMachine_1 = require("../../refundFormMachine");
15
15
  const otherTicketRefund_1 = __importDefault(require("./otherTicketRefund"));
16
16
  const checkbox_1 = require("../../../components/checkbox");
17
17
  const RefundTicketForms = ({ state, send }) => {
18
+ const PageText = (0, translations_1.usePageText)();
18
19
  const { t } = (0, translations_1.useTranslation)();
20
+ const { initialAgreement } = PageText.Contact.ticketing.refund;
21
+ const { refundableTicketTypes, nonRefundableTicketTypes } = initialAgreement;
19
22
  const displayAppTicketRefund = state.context.isInitialAgreementChecked &&
20
23
  state.context.formType === 'appTicketRefund';
21
24
  const displayOtherTicketRefund = state.context.isInitialAgreementChecked &&
22
25
  state.context.formType === 'otherTicketRefund';
23
- 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
- .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
26
- .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
26
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.refund.initialAgreement
27
+ .ticketRefundAvailability.title), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: 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(PageText.Contact.ticketing.refund.initialAgreement
28
+ .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(PageText.Contact.ticketing.refund.initialAgreement
29
+ .refundableTicketTypes.info.text), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { className: contact_module_css_1.default.link, href: '?type=refundAndTravelGuarantee&agreed=true', target: "_blank", rel: "noopener noreferrer", children: t(PageText.Contact.ticketing.refund.initialAgreement
30
+ .refundableTicketTypes.info.link) })] }), t(refundableTicketTypes.info.note) && ((0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(refundableTicketTypes.info.note) })), 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(PageText.Contact.ticketing.refund.initialAgreement
28
31
  .refundableTicketTypes.checkbox), checked: state.context.isInitialAgreementChecked, onChange: () => send({
29
32
  type: 'ON_INPUT_CHANGE',
30
33
  inputName: 'isInitialAgreementChecked',
31
34
  value: !state.context.isInitialAgreementChecked,
32
- }) })] }), state.context.isInitialAgreementChecked && ((0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.ticketing.refund.description), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: Object.values(refundFormMachine_1.RefundTicketForm).map((refundTicketForm) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(translations_1.PageText.Contact.ticketing.refund[refundTicketForm].label), checked: state.context.formType === refundTicketForm, onChange: () => send({
35
+ }) })] }), state.context.isInitialAgreementChecked && ((0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.refund.description), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: Object.values(refundFormMachine_1.RefundTicketForm).map((refundTicketForm) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.ticketing.refund[refundTicketForm].label), checked: state.context.formType === refundTicketForm, onChange: () => send({
33
36
  type: 'SELECT_REFUND_TICKET_FORM',
34
37
  refundTicketForm: refundTicketForm,
35
38
  }) }) }, refundTicketForm))) }) })), displayAppTicketRefund && (0, jsx_runtime_1.jsx)(appTicketRefund_1.default, { state: state, send: send }), displayOtherTicketRefund && ((0, jsx_runtime_1.jsx)(otherTicketRefund_1.default, { state: state, send: send }))] }));
@@ -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;AAahD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,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;AAmcF,eAAO,MAAM,iBAAiB,GAAI,iBAAiB,sBAAsB,4CAWxE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}