@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.
- package/README.md +393 -2
- package/lib/ContactFormRoot.d.ts +11 -1
- package/lib/ContactFormRoot.d.ts.map +1 -1
- package/lib/ContactFormRoot.js +2 -2
- package/lib/commoneEvents.d.ts +1 -1
- package/lib/commoneEvents.d.ts.map +1 -1
- package/lib/components/form/date-selector.d.ts.map +1 -1
- package/lib/components/form/date-selector.js +5 -4
- package/lib/components/form/departure-time-field.d.ts +16 -0
- package/lib/components/form/departure-time-field.d.ts.map +1 -0
- package/lib/components/form/departure-time-field.js +28 -0
- package/lib/components/form/description-modal.d.ts.map +1 -1
- package/lib/components/form/description-modal.js +2 -1
- package/lib/components/form/file-input.d.ts.map +1 -1
- package/lib/components/form/file-input.js +2 -1
- package/lib/components/form/index.d.ts +1 -0
- package/lib/components/form/index.d.ts.map +1 -1
- package/lib/components/form/index.js +3 -1
- package/lib/components/form/input.d.ts.map +1 -1
- package/lib/components/form/input.js +2 -1
- package/lib/components/form/searchable-select/utils.js +6 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +2 -1
- package/lib/contact.module.css +9 -0
- package/lib/error-content/error-content.d.ts.map +1 -1
- package/lib/error-content/error-content.js +2 -1
- package/lib/group-travel/index.d.ts.map +1 -1
- package/lib/group-travel/index.js +3 -1
- package/lib/index.d.ts +16 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +41 -1
- package/lib/journey-info/index.d.ts.map +1 -1
- package/lib/journey-info/index.js +14 -8
- package/lib/journey-info/journeyInfoStateMachine.d.ts +8 -8
- package/lib/layouts/contact-page-layout.d.ts +2 -2
- package/lib/layouts/contact-page-layout.d.ts.map +1 -1
- package/lib/layouts/contact-page-layout.js +29 -20
- package/lib/layouts/container.module.css +1 -1
- package/lib/layouts/layout.module.css +23 -2
- package/lib/lines/use-departures.d.ts +12 -0
- package/lib/lines/use-departures.d.ts.map +1 -0
- package/lib/lines/use-departures.js +35 -0
- package/lib/lines/use-lines.d.ts +5 -6
- package/lib/lines/use-lines.d.ts.map +1 -1
- package/lib/lines/use-lines.js +75 -42
- package/lib/lost-property/LostPropertyForm.d.ts +10 -0
- package/lib/lost-property/LostPropertyForm.d.ts.map +1 -0
- package/lib/lost-property/LostPropertyForm.js +65 -0
- package/lib/lost-property/LostPropertyMachine.d.ts +116 -0
- package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -0
- package/lib/lost-property/LostPropertyMachine.js +187 -0
- package/lib/lost-property/index.d.ts.map +1 -1
- package/lib/lost-property/index.js +27 -3
- package/lib/means-of-transport/forms/delayForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/delayForm.js +26 -18
- package/lib/means-of-transport/forms/driverForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/driverForm.js +26 -18
- package/lib/means-of-transport/forms/injuryForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/injuryForm.js +26 -18
- package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/serviceOfferingForm.js +10 -10
- package/lib/means-of-transport/forms/stopForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/stopForm.js +13 -12
- package/lib/means-of-transport/forms/transportationForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/transportationForm.js +26 -18
- package/lib/means-of-transport/index.d.ts.map +1 -1
- package/lib/means-of-transport/index.js +13 -4
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +10 -8
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
- package/lib/means-of-transport/means-of-transport-form-machine.js +6 -1
- package/lib/modules/config/types.d.ts +56 -1
- package/lib/modules/config/types.d.ts.map +1 -1
- package/lib/refund/events.d.ts +1 -1
- package/lib/refund/events.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.js +7 -5
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +39 -29
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +37 -28
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +46 -25
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/index.js +9 -6
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +56 -30
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
- package/lib/refund/forms/residualValueOnTravelCard/index.js +5 -3
- package/lib/refund/index.d.ts.map +1 -1
- package/lib/refund/index.js +39 -6
- package/lib/refund/refundFormMachine.d.ts +37 -13
- package/lib/refund/refundFormMachine.d.ts.map +1 -1
- package/lib/refund/refundFormMachine.js +107 -11
- package/lib/server/journey-planner/index.d.ts.map +1 -1
- package/lib/server/journey-planner/index.js +15 -6
- package/lib/server/journey-planner/validators.d.ts +2 -0
- package/lib/server/journey-planner/validators.d.ts.map +1 -1
- package/lib/server/journey-planner/validators.js +1 -0
- package/lib/success-content/success-content.d.ts.map +1 -1
- package/lib/success-content/success-content.js +2 -1
- package/lib/test-utils/setup.d.ts +2 -0
- package/lib/test-utils/setup.d.ts.map +1 -0
- package/lib/test-utils/setup.js +3 -0
- package/lib/ticket-control/events.d.ts +1 -1
- package/lib/ticket-control/events.d.ts.map +1 -1
- package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/feeComplaintForm.js +39 -36
- package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/feedbackForm.js +26 -14
- package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
- package/lib/ticket-control/forms/postponePayment.js +8 -7
- package/lib/ticket-control/index.d.ts.map +1 -1
- package/lib/ticket-control/index.js +23 -8
- package/lib/ticket-control/ticket-control-form-machine.d.ts +19 -11
- package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
- package/lib/ticket-control/ticket-control-form-machine.js +25 -5
- package/lib/ticketing/forms/app/appAccountForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appAccountForm.js +9 -8
- package/lib/ticketing/forms/app/appTicketingForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appTicketingForm.js +13 -12
- package/lib/ticketing/forms/app/appTravelSuggestionForm.d.ts.map +1 -1
- package/lib/ticketing/forms/app/appTravelSuggestionForm.js +6 -5
- package/lib/ticketing/forms/app/index.d.ts.map +1 -1
- package/lib/ticketing/forms/app/index.js +2 -1
- package/lib/ticketing/forms/priceAndTicketTypesForm.d.ts.map +1 -1
- package/lib/ticketing/forms/priceAndTicketTypesForm.js +6 -5
- package/lib/ticketing/forms/travel-card/index.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/index.js +2 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.js +2 -2
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/travelCardQuestionForm.js +9 -8
- package/lib/ticketing/forms/webshop/index.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/index.js +2 -1
- package/lib/ticketing/forms/webshop/webshopAccountForm.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/webshopAccountForm.js +9 -8
- package/lib/ticketing/forms/webshop/webshopTicketingForm.d.ts.map +1 -1
- package/lib/ticketing/forms/webshop/webshopTicketingForm.js +12 -11
- package/lib/ticketing/index.d.ts.map +1 -1
- package/lib/ticketing/index.js +21 -6
- package/lib/ticketing/ticketingStateMachine.d.ts +12 -12
- package/lib/translations/index.d.ts +1 -1
- package/lib/translations/index.d.ts.map +1 -1
- package/lib/translations/index.js +2 -1
- package/lib/translations/merge-overrides.d.ts.map +1 -1
- package/lib/translations/merge-overrides.js +8 -1
- package/lib/translations/pages/contact.d.ts +61 -0
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +64 -2
- package/lib/translations/translations-context.d.ts +2 -0
- package/lib/translations/translations-context.d.ts.map +1 -1
- package/lib/translations/translations-context.js +39 -0
- package/lib/types/submit-payloads.d.ts +40 -11
- package/lib/types/submit-payloads.d.ts.map +1 -1
- package/lib/types/submit-payloads.js +1 -1
- package/lib/types.d.ts +1 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/url-form-type.d.ts +6 -0
- package/lib/url-form-type.d.ts.map +1 -0
- package/lib/url-form-type.js +21 -0
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +10 -0
- package/lib/validation/validationRules.d.ts.map +1 -1
- package/lib/validation/validationRules.js +31 -0
- 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,
|
|
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
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
|
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,
|
|
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
|
|
40
|
-
id: quay.id,
|
|
41
|
-
|
|
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
|
|
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
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"success-content.d.ts","sourceRoot":"","sources":["../../src/success-content/success-content.tsx"],"names":[],"mappings":"AAOA,wBAAgB,cAAc,
|
|
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(
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/test-utils/setup.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC"}
|
|
@@ -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;
|
|
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;
|
|
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(
|
|
16
|
-
.labelRules) }), (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.rules__list, children:
|
|
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(
|
|
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(
|
|
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(
|
|
38
|
-
} }), (0, jsx_runtime_1.jsx)(typography_1.Typo.h3, { textType: "heading__m", children: t(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
57
|
-
} })] })), !state.context.isAppTicketStorageMode && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "travelCardNumber", label: t(
|
|
58
|
-
description: t(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
108
|
-
|
|
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: '
|
|
113
|
+
inputName: 'bankAccountNumber',
|
|
119
114
|
value: e.target.value,
|
|
120
|
-
}) }), (0, jsx_runtime_1.jsx)(
|
|
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: '
|
|
123
|
-
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,
|
|
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"}
|