@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
@@ -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");
@@ -12,6 +11,7 @@ var FormCategory;
12
11
  FormCategory["RefundOfTicket"] = "refundOfTicket";
13
12
  FormCategory["RefundAndTravelGuarantee"] = "refundAndTravelGuarantee";
14
13
  FormCategory["ResidualValueOnTravelCard"] = "residualValueOnTravelCard";
14
+ FormCategory["TicketBoughtOnBus"] = "ticketBoughtOnBus";
15
15
  })(FormCategory || (exports.FormCategory = FormCategory = {}));
16
16
  var RefundTicketForm;
17
17
  (function (RefundTicketForm) {
@@ -30,6 +30,9 @@ var FormType;
30
30
  FormType["AppTicketRefund"] = "appTicketRefund";
31
31
  FormType["OtherTicketRefund"] = "otherTicketRefund";
32
32
  FormType["ResidualValueOnTravelCard"] = "residualValueOnTravelCard";
33
+ FormType["TicketBoughtOnBus"] = "ticketBoughtOnBus";
34
+ FormType["TravelMoneyRefund"] = "travelMoneyRefund";
35
+ FormType["WebshopTicketRefund"] = "webshopTicketRefund";
33
36
  })(FormType || (exports.FormType = FormType = {}));
34
37
  const setFormTypeAndInitialContext = (context, formType) => {
35
38
  return { ...context, formType: formType, errorMessages: {} };
@@ -43,7 +46,7 @@ const setInitialAgreementAndFormType = (context, isChecked) => {
43
46
  };
44
47
  };
45
48
  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;
49
+ 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, refundReason, includeOtherTicketTypeSelector, includeRefundDepartureInfo, } = context;
47
50
  const commonFields = {
48
51
  formType,
49
52
  transportMode,
@@ -70,10 +73,8 @@ const setInputToValidate = (context) => {
70
73
  case FormType.AppTicketRefund:
71
74
  return {
72
75
  formType,
73
- customerNumber,
74
- orderId,
76
+ referenceNumber: orderId,
75
77
  refundReason,
76
- purchasePlatform,
77
78
  firstName,
78
79
  lastName,
79
80
  address,
@@ -81,13 +82,22 @@ const setInputToValidate = (context) => {
81
82
  city,
82
83
  email,
83
84
  phoneNumber,
85
+ ...(includeRefundDepartureInfo
86
+ ? {
87
+ transportMode,
88
+ line,
89
+ fromStop,
90
+ toStop,
91
+ date,
92
+ plannedDepartureTime,
93
+ }
94
+ : {}),
84
95
  };
85
96
  case FormType.OtherTicketRefund:
86
97
  return {
87
98
  formType,
88
- ticketType,
99
+ ...(includeOtherTicketTypeSelector ? { ticketType } : {}),
89
100
  refundReason,
90
- amount,
91
101
  firstName,
92
102
  lastName,
93
103
  address,
@@ -96,18 +106,71 @@ const setInputToValidate = (context) => {
96
106
  email,
97
107
  phoneNumber,
98
108
  orderId,
99
- attachments,
100
- ...(ticketType &&
101
- ticketType.id === types_1.TicketTypeId.PeriodTicket && { travelCardNumber }),
109
+ ...(hasInternationalBankAccount
110
+ ? { IBAN, SWIFT }
111
+ : { bankAccountNumber }),
112
+ ...(includeRefundDepartureInfo
113
+ ? {
114
+ transportMode,
115
+ line,
116
+ fromStop,
117
+ toStop,
118
+ date,
119
+ plannedDepartureTime,
120
+ }
121
+ : {}),
122
+ };
123
+ case FormType.TicketBoughtOnBus:
124
+ return {
125
+ formType,
126
+ transportMode,
127
+ line,
128
+ fromStop,
129
+ toStop,
130
+ date,
131
+ plannedDepartureTime,
132
+ bankCardDetails: context.bankCardDetails,
133
+ refundReason,
134
+ firstName,
135
+ lastName,
136
+ email,
137
+ };
138
+ case FormType.TravelMoneyRefund:
139
+ return {
140
+ formType,
141
+ travelCardNumber: context.travelCardNumber,
142
+ refundReason,
143
+ firstName,
144
+ lastName,
145
+ address,
146
+ postalCode,
147
+ city,
148
+ email,
149
+ phoneNumber,
102
150
  ...(hasInternationalBankAccount
103
151
  ? { IBAN, SWIFT }
104
152
  : { bankAccountNumber }),
105
153
  };
154
+ case FormType.WebshopTicketRefund:
155
+ return {
156
+ formType,
157
+ travelCardNumber: context.travelCardNumber,
158
+ refundReason,
159
+ firstName,
160
+ lastName,
161
+ address,
162
+ postalCode,
163
+ city,
164
+ email,
165
+ phoneNumber,
166
+ };
106
167
  }
107
168
  };
108
169
  function createRefundStateMachine(onSubmit, paths) {
109
170
  const successPath = paths?.successPath ?? '/contact/success';
110
171
  const errorPath = paths?.errorPath ?? '/contact/error';
172
+ const includeOtherTicketTypeSelector = paths?.includeOtherTicketTypeSelector !== false;
173
+ const includeRefundDepartureInfo = paths?.includeRefundDepartureInfo === true;
111
174
  return (0, xstate_1.setup)({
112
175
  types: { context: {}, events: events_1.RefundFormEvents },
113
176
  guards: {
@@ -122,6 +185,8 @@ function createRefundStateMachine(onSubmit, paths) {
122
185
  event.formCategory === FormCategory.RefundAndTravelGuarantee,
123
186
  isResidualValueOnTravelCard: ({ event }) => event.type === 'SELECT_FORM_CATEGORY' &&
124
187
  event.formCategory === FormCategory.ResidualValueOnTravelCard,
188
+ isTicketBoughtOnBus: ({ event }) => event.type === 'SELECT_FORM_CATEGORY' &&
189
+ event.formCategory === FormCategory.TicketBoughtOnBus,
125
190
  isAppTicketRefund: ({ event }) => event.type === 'SELECT_REFUND_TICKET_FORM' &&
126
191
  event.refundTicketForm === RefundTicketForm.AppTicketRefund,
127
192
  isOtherTicketRefund: ({ event }) => event.type === 'SELECT_REFUND_TICKET_FORM' &&
@@ -146,7 +211,16 @@ function createRefundStateMachine(onSubmit, paths) {
146
211
  setValidationErrors: (0, xstate_1.assign)(({ context, event }) => {
147
212
  if (event.type === 'SUBMIT') {
148
213
  const inputsToValidate = setInputToValidate(context);
149
- const errors = (0, validation_1.commonInputValidator)(inputsToValidate);
214
+ const rawErrors = (0, validation_1.commonInputValidator)(inputsToValidate);
215
+ // AppTicketRefund validates orderId under key 'referenceNumber' for correct
216
+ // error messages, but the form field uses 'orderId' as its inputName.
217
+ const errors = context.formType === FormType.AppTicketRefund &&
218
+ rawErrors.referenceNumber
219
+ ? (({ referenceNumber, ...rest }) => ({
220
+ ...rest,
221
+ orderId: referenceNumber,
222
+ }))(rawErrors)
223
+ : rawErrors;
150
224
  return {
151
225
  firstIncorrectErrorMessage: (0, utils_1.findFirstErrorMessage)(event.orderedFormFieldNames, errors),
152
226
  errorMessages: { ...errors },
@@ -189,9 +263,16 @@ function createRefundStateMachine(onSubmit, paths) {
189
263
  };
190
264
  }
191
265
  context.errorMessages[inputName] = [];
266
+ const clearsDeparture = inputName === 'fromStop' ||
267
+ inputName === 'toStop' ||
268
+ inputName === 'date';
192
269
  return {
193
270
  ...context,
194
271
  [inputName]: value,
272
+ ...(clearsDeparture && {
273
+ plannedDepartureTime: undefined,
274
+ tripId: undefined,
275
+ }),
195
276
  hasSubmissionError: undefined,
196
277
  };
197
278
  }
@@ -236,6 +317,8 @@ function createRefundStateMachine(onSubmit, paths) {
236
317
  context: {
237
318
  isInitialAgreementChecked: false,
238
319
  hasInternationalBankAccount: false,
320
+ includeOtherTicketTypeSelector,
321
+ includeRefundDepartureInfo,
239
322
  errorMessages: {},
240
323
  },
241
324
  on: {
@@ -267,6 +350,10 @@ function createRefundStateMachine(onSubmit, paths) {
267
350
  guard: 'isResidualValueOnTravelCard',
268
351
  target: `#${FormCategory.ResidualValueOnTravelCard}`,
269
352
  },
353
+ {
354
+ guard: 'isTicketBoughtOnBus',
355
+ target: `#${FormCategory.TicketBoughtOnBus}`,
356
+ },
270
357
  ],
271
358
  },
272
359
  refundTicketFormHandler: {
@@ -343,6 +430,13 @@ function createRefundStateMachine(onSubmit, paths) {
343
430
  formType: () => FormType.ResidualValueOnTravelCard,
344
431
  }),
345
432
  },
433
+ ticketBoughtOnBus: {
434
+ id: 'ticketBoughtOnBus',
435
+ entry: (0, xstate_1.assign)({
436
+ formType: () => FormType.TicketBoughtOnBus,
437
+ }),
438
+ exit: 'clearValidationErrors',
439
+ },
346
440
  history: { type: 'history', history: 'deep' },
347
441
  },
348
442
  },
@@ -367,6 +461,7 @@ function createRefundStateMachine(onSubmit, paths) {
367
461
  toStop: context.toStop?.name,
368
462
  date: context?.date,
369
463
  plannedDepartureTime: context?.plannedDepartureTime,
464
+ tripId: context?.tripId,
370
465
  kilometersDriven: context?.kilometersDriven,
371
466
  fromAddress: context?.fromAddress,
372
467
  toAddress: context?.toAddress,
@@ -390,6 +485,7 @@ function createRefundStateMachine(onSubmit, paths) {
390
485
  travelCardNumber: context?.travelCardNumber,
391
486
  refundReason: context?.refundReason,
392
487
  purchasePlatform: context?.purchasePlatform,
488
+ bankCardDetails: context?.bankCardDetails,
393
489
  }),
394
490
  onDone: { target: 'success' },
395
491
  onError: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/journey-planner/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAe,MAAM,cAAc,CAAC;AAgBjD;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAmD5E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/journey-planner/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAe,MAAM,cAAc,CAAC;AAgBjD;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CA+D5E"}
@@ -36,9 +36,11 @@ async function getLines(fallbackAuthorityId) {
36
36
  transportSubmode: (0, transport_mode_1.isTransportSubmodeType)(line.transportSubmode)
37
37
  ? line.transportSubmode
38
38
  : null,
39
- quays: line.quays.map((quay) => ({
40
- id: quay.id,
41
- name: quay.name,
39
+ quays: line.quays
40
+ .map((quay) => ({ id: quay.id, name: quay.name }))
41
+ .sort((a, b) => a.name.localeCompare(b.name, undefined, {
42
+ numeric: true,
43
+ sensitivity: 'base',
42
44
  })),
43
45
  }));
44
46
  const validated = validators_1.linesSchema.safeParse(data);
@@ -46,8 +48,12 @@ async function getLines(fallbackAuthorityId) {
46
48
  throw validated.error;
47
49
  }
48
50
  validated.data.sort((a, b) => {
49
- if (a.publicCode === null && b.publicCode === null)
50
- return 0;
51
+ if (a.publicCode === null && b.publicCode === null) {
52
+ return a.name.localeCompare(b.name, undefined, {
53
+ numeric: true,
54
+ sensitivity: 'base',
55
+ });
56
+ }
51
57
  if (a.publicCode === null)
52
58
  return 1;
53
59
  if (b.publicCode === null)
@@ -57,7 +63,10 @@ async function getLines(fallbackAuthorityId) {
57
63
  if (aIsNumber && bIsNumber) {
58
64
  return Number(a.publicCode) - Number(b.publicCode);
59
65
  }
60
- return a.publicCode.localeCompare(b.publicCode);
66
+ return a.publicCode.localeCompare(b.publicCode, undefined, {
67
+ numeric: true,
68
+ sensitivity: 'base',
69
+ });
61
70
  });
62
71
  return validated.data;
63
72
  }
@@ -8,6 +8,7 @@ export declare const lineSchema: z.ZodObject<{
8
8
  quays: z.ZodArray<z.ZodObject<{
9
9
  id: z.ZodString;
10
10
  name: z.ZodString;
11
+ description: z.ZodNullable<z.ZodString>;
11
12
  }, z.core.$strip>>;
12
13
  }, z.core.$strip>;
13
14
  export declare const linesSchema: z.ZodArray<z.ZodObject<{
@@ -19,6 +20,7 @@ export declare const linesSchema: z.ZodArray<z.ZodObject<{
19
20
  quays: z.ZodArray<z.ZodObject<{
20
21
  id: z.ZodString;
21
22
  name: z.ZodString;
23
+ description: z.ZodNullable<z.ZodString>;
22
24
  }, z.core.$strip>>;
23
25
  }, z.core.$strip>>;
24
26
  export type Line = z.infer<typeof lineSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../src/server/journey-planner/validators.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,UAAU;;;;;;;;;;iBAYrB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;kBAAsB,CAAC;AAE/C,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../src/server/journey-planner/validators.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,UAAU;;;;;;;;;;;iBAarB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;kBAAsB,CAAC;AAE/C,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -12,6 +12,7 @@ exports.lineSchema = zod_1.z.object({
12
12
  quays: zod_1.z.array(zod_1.z.object({
13
13
  id: zod_1.z.string(),
14
14
  name: zod_1.z.string(),
15
+ description: zod_1.z.string().nullable(),
15
16
  })),
16
17
  });
17
18
  exports.linesSchema = zod_1.z.array(exports.lineSchema);
@@ -1 +1 @@
1
- {"version":3,"file":"success-content.d.ts","sourceRoot":"","sources":["../../src/success-content/success-content.tsx"],"names":[],"mappings":"AAOA,wBAAgB,cAAc,4CAmB7B"}
1
+ {"version":3,"file":"success-content.d.ts","sourceRoot":"","sources":["../../src/success-content/success-content.tsx"],"names":[],"mappings":"AAOA,wBAAgB,cAAc,4CAoB7B"}
@@ -12,8 +12,9 @@ const icon_1 = require("../components/icon");
12
12
  const typography_1 = require("../components/typography");
13
13
  const config_1 = require("../modules/config");
14
14
  function SuccessContent() {
15
+ const PageText = (0, translations_1.usePageText)();
15
16
  const { t } = (0, translations_1.useTranslation)();
16
17
  const { layout } = (0, config_1.useContactFormConfig)();
17
18
  const backHref = layout?.basePath ?? '/contact';
18
- return ((0, jsx_runtime_1.jsxs)("section", { className: success_content_module_css_1.default.container, children: [(0, jsx_runtime_1.jsx)(button_1.ButtonLink, { mode: "transparent", href: backHref, title: t(translations_1.PageText.Contact.error.backButton), icon: { left: (0, jsx_runtime_1.jsx)(icon_1.MonoIcon, { icon: "navigation/ArrowLeft" }) } }), (0, jsx_runtime_1.jsx)(typography_1.Typo.h2, { textType: "heading__xl", children: t(translations_1.PageText.Contact.success.title) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.success.info) })] }));
19
+ return ((0, jsx_runtime_1.jsxs)("section", { className: success_content_module_css_1.default.container, children: [(0, jsx_runtime_1.jsx)(button_1.ButtonLink, { mode: "transparent", href: backHref, title: t(PageText.Contact.error.backButton), icon: { left: (0, jsx_runtime_1.jsx)(icon_1.MonoIcon, { icon: "navigation/ArrowLeft" }) } }), (0, jsx_runtime_1.jsx)(typography_1.Typo.h2, { textType: "heading__xl", children: t(PageText.Contact.success.title) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.success.info) })] }));
19
20
  }
@@ -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");
@@ -3,7 +3,7 @@ import { FormType } from './ticket-control-form-machine';
3
3
  type TicketControlSpecificFormEvents = {
4
4
  type: 'ON_INPUT_CHANGE';
5
5
  inputName: 'formType' | 'feeNumber' | 'invoiceNumber' | 'appPhoneNumber' | 'customerNumber' | 'travelCardNumber' | 'isAppTicketStorageMode' | 'agreesFirstAgreement' | 'agreesSecondAgreement' | 'hasInternationalBankAccount' | 'dateOfTicketControl' | 'timeOfTicketControl';
6
- value: string | boolean;
6
+ value: string | boolean | undefined;
7
7
  } | {
8
8
  type: 'SELECT_FORM_TYPE';
9
9
  formType: FormType;
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/ticket-control/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,KAAK,+BAA+B,GAChC;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EACL,UAAU,GACV,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,wBAAwB,GACxB,sBAAsB,GACtB,uBAAuB,GACvB,6BAA6B,GAC7B,qBAAqB,GACrB,qBAAqB,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB,GACD;IACE,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;CACpB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC,CAAC;AACN,eAAO,MAAM,uBAAuB,EAChC,+BAA+B,GAC/B,OAAO,YAAY,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/ticket-control/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,KAAK,+BAA+B,GAChC;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EACL,UAAU,GACV,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,wBAAwB,GACxB,sBAAsB,GACtB,uBAAuB,GACvB,6BAA6B,GAC7B,qBAAqB,GACrB,qBAAqB,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CACrC,GACD;IACE,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;CACpB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC,CAAC;AACN,eAAO,MAAM,uBAAuB,EAChC,+BAA+B,GAC/B,OAAO,YAAY,CAAC"}
@@ -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;AAUpD,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;AA0cF,eAAO,MAAM,gBAAgB,GAAI,iBAAiB,qBAAqB,4CAYtE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -11,56 +11,59 @@ const translations_1 = require("../../translations");
11
11
  const typography_1 = require("../../components/typography");
12
12
  const checkbox_1 = require("../../components/checkbox");
13
13
  const FirstAgreement = ({ state, send }) => {
14
+ const PageText = (0, translations_1.usePageText)();
14
15
  const { t } = (0, translations_1.useTranslation)();
15
- return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.ticketControl.feeComplaint.firstAgreement.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.ticketControl.feeComplaint.firstAgreement.question) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m__strong", children: t(translations_1.PageText.Contact.ticketControl.feeComplaint.firstAgreement
16
- .labelRules) }), (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: translations_1.PageText.Contact.ticketControl.feeComplaint.firstAgreement.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: t(rule) }) }, index))) })] }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(translations_1.PageText.Contact.ticketControl.feeComplaint.firstAgreement.checkbox), checked: state.context.agreesFirstAgreement, onChange: () => send({
16
+ return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketControl.feeComplaint.firstAgreement.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.ticketControl.feeComplaint.firstAgreement.question) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m__strong", children: t(PageText.Contact.ticketControl.feeComplaint.firstAgreement
17
+ .labelRules) }), (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: PageText.Contact.ticketControl.feeComplaint.firstAgreement.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: t(rule) }) }, index))) })] }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.ticketControl.feeComplaint.firstAgreement.checkbox), checked: state.context.agreesFirstAgreement, onChange: () => send({
17
18
  type: 'ON_INPUT_CHANGE',
18
19
  inputName: 'agreesFirstAgreement',
19
20
  value: !state.context.agreesFirstAgreement,
20
21
  }) })] }));
21
22
  };
22
23
  const SecondAgreement = ({ state, send }) => {
24
+ const PageText = (0, translations_1.usePageText)();
23
25
  const { t } = (0, translations_1.useTranslation)();
24
- return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.ticketControl.feeComplaint.secondAgreement.title), children: [(0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: translations_1.PageText.Contact.ticketControl.feeComplaint.secondAgreement.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: t(rule) }) }, index))) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(translations_1.PageText.Contact.ticketControl.feeComplaint.secondAgreement.info) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(translations_1.PageText.Contact.ticketControl.feeComplaint.secondAgreement.checkbox), checked: state.context.agreesSecondAgreement, onChange: () => send({
26
+ return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketControl.feeComplaint.secondAgreement.title), children: [(0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children: PageText.Contact.ticketControl.feeComplaint.secondAgreement.rules.map((rule, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.span, { textType: "body__m", children: t(rule) }) }, index))) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.ticketControl.feeComplaint.secondAgreement.info) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.ticketControl.feeComplaint.secondAgreement.checkbox), checked: state.context.agreesSecondAgreement, onChange: () => send({
25
27
  type: 'ON_INPUT_CHANGE',
26
28
  inputName: 'agreesSecondAgreement',
27
29
  value: !state.context.agreesSecondAgreement,
28
30
  }) })] }));
29
31
  };
30
32
  const FormContent = ({ state, send }) => {
33
+ const PageText = (0, translations_1.usePageText)();
31
34
  const { t } = (0, translations_1.useTranslation)();
32
- 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.ticketControl.feeComplaint.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "feeNumber", label: t(translations_1.PageText.Contact.input.feeNumber.label), type: "number", name: "feeNumber", value: state.context.feeNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['feeNumber']?.[0], onChange: (e) => send({
35
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketControl.feeComplaint.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "feeNumber", label: t(PageText.Contact.input.feeNumber.label), type: "number", name: "feeNumber", value: state.context.feeNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['feeNumber']?.[0], onChange: (e) => send({
33
36
  type: 'ON_INPUT_CHANGE',
34
37
  inputName: 'feeNumber',
35
38
  value: e.target.value,
36
39
  }), modalContent: {
37
- description: t(translations_1.PageText.Contact.input.feeNumber.description),
38
- } }), (0, jsx_runtime_1.jsx)(typography_1.Typo.h3, { textType: "heading__m", children: t(translations_1.PageText.Contact.ticketControl.feeComplaint.ticketStorage.question) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(translations_1.PageText.Contact.ticketControl.feeComplaint.ticketStorage.app
40
+ description: t(PageText.Contact.input.feeNumber.description),
41
+ } }), (0, jsx_runtime_1.jsx)(typography_1.Typo.h3, { textType: "heading__m", children: t(PageText.Contact.ticketControl.feeComplaint.ticketStorage.question) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.ticketControl.feeComplaint.ticketStorage.app
39
42
  .title), name: "isAppTicketStorageMode", checked: state.context.isAppTicketStorageMode, onChange: () => send({
40
43
  type: 'ON_INPUT_CHANGE',
41
44
  inputName: 'isAppTicketStorageMode',
42
45
  value: !state.context.isAppTicketStorageMode,
43
- }) }), (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(translations_1.PageText.Contact.input.travelCardNumber.labelRadioButton), name: "isAppTicketStorageMode", checked: !state.context.isAppTicketStorageMode, onChange: () => send({
46
+ }) }), (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.input.travelCardNumber.labelRadioButton), name: "isAppTicketStorageMode", checked: !state.context.isAppTicketStorageMode, onChange: () => send({
44
47
  type: 'ON_INPUT_CHANGE',
45
48
  inputName: 'isAppTicketStorageMode',
46
49
  value: !state.context.isAppTicketStorageMode,
47
- }) })] }), state.context.isAppTicketStorageMode && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "appPhoneNumber", label: t(translations_1.PageText.Contact.input.appPhoneNumber.label), type: "tel", name: "appPhoneNumber", value: state.context.appPhoneNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['appPhoneNumber']?.[0], onChange: (e) => send({
50
+ }) })] }), state.context.isAppTicketStorageMode && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "appPhoneNumber", label: t(PageText.Contact.input.appPhoneNumber.label), type: "tel", name: "appPhoneNumber", value: state.context.appPhoneNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['appPhoneNumber']?.[0], onChange: (e) => send({
48
51
  type: 'ON_INPUT_CHANGE',
49
52
  inputName: 'appPhoneNumber',
50
53
  value: e.target.value,
51
- }) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "customerNumber", label: t(translations_1.PageText.Contact.input.customerNumber.label), type: "number", name: "customerNumber", value: state.context.customerNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['customerNumber']?.[0], onChange: (e) => send({
54
+ }) }), state.context.includeCustomerNumber && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "customerNumber", label: t(PageText.Contact.input.customerNumber.label), type: "number", name: "customerNumber", value: state.context.customerNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['customerNumber']?.[0], onChange: (e) => send({
52
55
  type: 'ON_INPUT_CHANGE',
53
56
  inputName: 'customerNumber',
54
57
  value: e.target.value,
55
58
  }), modalContent: {
56
- description: t(translations_1.PageText.Contact.input.customerNumber.description),
57
- } })] })), !state.context.isAppTicketStorageMode && ((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: {
58
- description: t(translations_1.PageText.Contact.input.travelCardNumber.info),
59
+ description: t(PageText.Contact.input.customerNumber.description),
60
+ } }))] })), !state.context.isAppTicketStorageMode && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(PageText.Contact.input.travelCardNumber.label), type: "text", name: "travelCardNumber", value: state.context.travelCardNumber || '', modalContent: {
61
+ description: t(PageText.Contact.input.travelCardNumber.info),
59
62
  }, isRequired: true, errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
60
63
  type: 'ON_INPUT_CHANGE',
61
64
  inputName: 'travelCardNumber',
62
65
  value: e.target.value,
63
- }) }))] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.input.feedback.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "feedback", value: state.context.feedback || '', onChange: (e) => send({
66
+ }) }))] }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.feedback.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "feedback", value: state.context.feedback || '', onChange: (e) => send({
64
67
  type: 'ON_INPUT_CHANGE',
65
68
  inputName: 'feedback',
66
69
  value: e.target.value,
@@ -68,7 +71,7 @@ const FormContent = ({ state, send }) => {
68
71
  t(state.context.errorMessages['feedback']?.[0]), fileInputProps: {
69
72
  id: 'attachments',
70
73
  name: 'attachments',
71
- iconLabel: t(translations_1.PageText.Contact.input.feedback.attachment.generic),
74
+ iconLabel: t(PageText.Contact.input.feedback.attachment.generic),
72
75
  onChange: (files) => {
73
76
  send({
74
77
  type: 'ON_INPUT_CHANGE',
@@ -76,52 +79,52 @@ const FormContent = ({ state, send }) => {
76
79
  value: files,
77
80
  });
78
81
  },
79
- } }) }), (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({
82
+ } }) }), (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({
80
83
  type: 'ON_INPUT_CHANGE',
81
84
  inputName: 'firstName',
82
85
  value: e.target.value,
83
- }) }), (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({
86
+ }) }), (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({
84
87
  type: 'ON_INPUT_CHANGE',
85
88
  inputName: 'lastName',
86
89
  value: e.target.value,
87
- }) }), (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({
90
+ }) }), (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({
88
91
  type: 'ON_INPUT_CHANGE',
89
92
  inputName: 'address',
90
93
  value: e.target.value,
91
- }) }), (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({
94
+ }) }), (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({
92
95
  type: 'ON_INPUT_CHANGE',
93
96
  inputName: 'postalCode',
94
97
  value: e.target.value,
95
- }) }), (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({
98
+ }) }), (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({
96
99
  type: 'ON_INPUT_CHANGE',
97
100
  inputName: 'city',
98
101
  value: e.target.value,
99
- }) }), (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({
102
+ }) }), (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({
100
103
  type: 'ON_INPUT_CHANGE',
101
104
  inputName: 'email',
102
105
  value: e.target.value,
103
- }) }), (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({
106
+ }) }), (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({
104
107
  type: 'ON_INPUT_CHANGE',
105
108
  inputName: 'phoneNumber',
106
109
  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({
110
+ }) }), 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(PageText.Contact.input.bankInformation.bankAccountNumber.label), placeholder: t(PageText.Contact.input.bankInformation.bankAccountNumber
111
+ .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
112
  type: 'ON_INPUT_CHANGE',
118
- inputName: 'IBAN',
113
+ inputName: 'bankAccountNumber',
119
114
  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({
115
+ }) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
121
116
  type: 'ON_INPUT_CHANGE',
122
- inputName: 'SWIFT',
123
- value: e.target.value,
124
- }) })] }))] })] }));
117
+ inputName: 'hasInternationalBankAccount',
118
+ value: !state.context.hasInternationalBankAccount,
119
+ }) }), 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({
120
+ type: 'ON_INPUT_CHANGE',
121
+ inputName: 'IBAN',
122
+ value: e.target.value,
123
+ }) }), (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({
124
+ type: 'ON_INPUT_CHANGE',
125
+ inputName: 'SWIFT',
126
+ value: e.target.value,
127
+ }) })] }))] }))] })] }));
125
128
  };
126
129
  const FeeComplaintForm = ({ state, send }) => {
127
130
  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,4CA8O9D,CAAC;AAEF,eAAe,YAAY,CAAC"}