@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
|
@@ -7,41 +7,53 @@ const typography_1 = require("../../components/typography");
|
|
|
7
7
|
const use_lines_1 = require("../../lines/use-lines");
|
|
8
8
|
const components_1 = require("../../components");
|
|
9
9
|
const FeedbackForm = ({ state, send }) => {
|
|
10
|
+
const PageText = (0, translations_1.usePageText)();
|
|
10
11
|
const { t } = (0, translations_1.useTranslation)();
|
|
11
12
|
const { getLinesByMode, getQuaysByLine } = (0, use_lines_1.useLines)();
|
|
12
13
|
const transportModeOptions = (0, use_lines_1.useTransportModeOptions)();
|
|
13
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketControl.feedback.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.ticketControl.feedback.info) }), (0, jsx_runtime_1.jsx)(components_1.Select, { id: "transportMode", label: t(PageText.Contact.input.transportMode.label), value: state.context.transportMode || '', onChange: (value) => send({
|
|
14
15
|
type: 'ON_TRANSPORTMODE_CHANGE',
|
|
15
16
|
value: value,
|
|
16
17
|
}), isRequired: true, error: state.context?.errorMessages['transportMode']?.[0]
|
|
17
18
|
? t(state.context?.errorMessages['transportMode']?.[0])
|
|
18
|
-
: undefined, valueToId: (val) => val, valueToText: (val) => t(
|
|
19
|
+
: undefined, valueToId: (val) => val, valueToText: (val) => t(PageText.Contact.input.transportMode.modes[val]), options: transportModeOptions, placeholder: t(PageText.Contact.input.transportMode.optionLabel) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "line", label: t(PageText.Contact.input.line.label), value: state.context.line, placeholder: t(PageText.Contact.input.line.optionLabel), isDisabled: !state.context.transportMode, options: (0, components_1.getLineOptions)(getLinesByMode(state.context.transportMode)), onChange: (value) => {
|
|
19
20
|
send({
|
|
20
21
|
type: 'ON_LINE_CHANGE',
|
|
21
22
|
value: value,
|
|
22
23
|
});
|
|
23
24
|
}, isRequired: true, error: state.context?.errorMessages['line']?.[0] &&
|
|
24
|
-
t(state.context?.errorMessages['line']?.[0]) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "fromStop", label: t(
|
|
25
|
+
t(state.context?.errorMessages['line']?.[0]) }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "fromStop", label: t(PageText.Contact.input.fromStop.label), value: state.context.fromStop, placeholder: t(PageText.Contact.input.fromStop.optionLabel), isDisabled: !state.context.line, options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), onChange: (value) => {
|
|
25
26
|
send({
|
|
26
27
|
type: 'ON_INPUT_CHANGE',
|
|
27
28
|
inputName: 'fromStop',
|
|
28
29
|
value: value,
|
|
29
30
|
});
|
|
30
|
-
}
|
|
31
|
+
}, isRequired: true, error: state.context?.errorMessages['fromStop']?.[0]
|
|
32
|
+
? t(state.context?.errorMessages['fromStop']?.[0])
|
|
33
|
+
: undefined }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "toStop", label: t(PageText.Contact.input.toStop.label), value: state.context.toStop, placeholder: t(PageText.Contact.input.toStop.optionLabel), isDisabled: !state.context.line, options: (0, components_1.getStopOptions)(getQuaysByLine(state.context.line?.id ?? '')), onChange: (value) => {
|
|
31
34
|
send({
|
|
32
35
|
type: 'ON_INPUT_CHANGE',
|
|
33
36
|
inputName: 'toStop',
|
|
34
37
|
value: value,
|
|
35
38
|
});
|
|
36
|
-
}
|
|
39
|
+
}, isRequired: true, error: state.context?.errorMessages['toStop']?.[0]
|
|
40
|
+
? t(state.context?.errorMessages['toStop']?.[0])
|
|
41
|
+
: undefined }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "date", label: t(PageText.Contact.input.date.label), isRequired: true, value: state.context.dateOfTicketControl, onChange: (dateOfTicketControl) => send({
|
|
37
42
|
type: 'ON_INPUT_CHANGE',
|
|
38
43
|
inputName: 'dateOfTicketControl',
|
|
39
44
|
value: dateOfTicketControl,
|
|
40
|
-
}), errorMessage: state.context?.errorMessages['dateOfTicketControl']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
}), errorMessage: state.context?.errorMessages['dateOfTicketControl']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.DepartureTimeField, { id: "timeOfTicketControl", date: state.context.dateOfTicketControl, lineId: state.context.line?.id, fromStopId: state.context.fromStop?.id, toStopId: state.context.toStop?.id, selectedTripId: state.context.tripId, plannedDepartureTime: state.context.timeOfTicketControl, onChange: (timeOfTicketControl, tripId) => {
|
|
46
|
+
send({
|
|
47
|
+
type: 'ON_INPUT_CHANGE',
|
|
48
|
+
inputName: 'timeOfTicketControl',
|
|
49
|
+
value: timeOfTicketControl,
|
|
50
|
+
});
|
|
51
|
+
send({
|
|
52
|
+
type: 'ON_INPUT_CHANGE',
|
|
53
|
+
inputName: 'tripId',
|
|
54
|
+
value: tripId,
|
|
55
|
+
});
|
|
56
|
+
}, isRequired: true, errorMessage: state.context?.errorMessages['timeOfTicketControl']?.[0] })] }), (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({
|
|
45
57
|
type: 'ON_INPUT_CHANGE',
|
|
46
58
|
inputName: 'feedback',
|
|
47
59
|
value: e.target.value,
|
|
@@ -49,7 +61,7 @@ const FeedbackForm = ({ state, send }) => {
|
|
|
49
61
|
t(state.context.errorMessages['feedback']?.[0]), fileInputProps: {
|
|
50
62
|
id: 'attachments',
|
|
51
63
|
name: 'attachments',
|
|
52
|
-
iconLabel: t(
|
|
64
|
+
iconLabel: t(PageText.Contact.input.feedback.attachment.generic),
|
|
53
65
|
onChange: (files) => {
|
|
54
66
|
send({
|
|
55
67
|
type: 'ON_INPUT_CHANGE',
|
|
@@ -57,15 +69,15 @@ const FeedbackForm = ({ state, send }) => {
|
|
|
57
69
|
value: files,
|
|
58
70
|
});
|
|
59
71
|
},
|
|
60
|
-
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
72
|
+
} }) }), (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 additonal-name", name: "firstName", value: state.context.firstName || '', isRequired: true, errorMessage: state.context?.errorMessages['firstName']?.[0] || undefined, onChange: (e) => send({
|
|
61
73
|
type: 'ON_INPUT_CHANGE',
|
|
62
74
|
inputName: 'firstName',
|
|
63
75
|
value: e.target.value,
|
|
64
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(
|
|
76
|
+
}) }), (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] || undefined, onChange: (e) => send({
|
|
65
77
|
type: 'ON_INPUT_CHANGE',
|
|
66
78
|
inputName: 'lastName',
|
|
67
79
|
value: e.target.value,
|
|
68
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(
|
|
80
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(PageText.Contact.input.email.label), type: "email", name: "email", value: state.context.email || '', isRequired: true, errorMessage: state.context?.errorMessages['email']?.[0] || undefined, onChange: (e) => send({
|
|
69
81
|
type: 'ON_INPUT_CHANGE',
|
|
70
82
|
inputName: 'email',
|
|
71
83
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postponePayment.d.ts","sourceRoot":"","sources":["../../../src/ticket-control/forms/postponePayment.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,KAAK,wBAAwB,GAAG;IAC9B,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,mBAAmB,GAAI,kBAGjC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"postponePayment.d.ts","sourceRoot":"","sources":["../../../src/ticket-control/forms/postponePayment.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,KAAK,wBAAwB,GAAG;IAC9B,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,mBAAmB,GAAI,kBAGjC,wBAAwB,4CAyG1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -6,28 +6,29 @@ const components_1 = require("../../components");
|
|
|
6
6
|
const translations_1 = require("../../translations");
|
|
7
7
|
const typography_1 = require("../../components/typography");
|
|
8
8
|
const PostponePaymentForm = ({ state, send, }) => {
|
|
9
|
+
const PageText = (0, translations_1.usePageText)();
|
|
9
10
|
const { t } = (0, translations_1.useTranslation)();
|
|
10
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketControl.postponePayment.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.ticketControl.postponePayment.info) }), (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({
|
|
11
12
|
type: 'ON_INPUT_CHANGE',
|
|
12
13
|
inputName: 'feeNumber',
|
|
13
14
|
value: e.target.value,
|
|
14
15
|
}), modalContent: {
|
|
15
|
-
description: t(
|
|
16
|
-
} }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "invoiceNumber", label: t(
|
|
16
|
+
description: t(PageText.Contact.input.feeNumber.description),
|
|
17
|
+
} }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "invoiceNumber", label: t(PageText.Contact.input.invoiceNumber.label), type: "number", name: "invoiceNumber", value: state.context.invoiceNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['invoiceNumber']?.[0], onChange: (e) => send({
|
|
17
18
|
type: 'ON_INPUT_CHANGE',
|
|
18
19
|
inputName: 'invoiceNumber',
|
|
19
20
|
value: e.target.value,
|
|
20
21
|
}), modalContent: {
|
|
21
|
-
description: t(
|
|
22
|
-
} })] }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
22
|
+
description: t(PageText.Contact.input.invoiceNumber.description),
|
|
23
|
+
} })] }), (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({
|
|
23
24
|
type: 'ON_INPUT_CHANGE',
|
|
24
25
|
inputName: 'firstName',
|
|
25
26
|
value: e.target.value,
|
|
26
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(
|
|
27
|
+
}) }), (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({
|
|
27
28
|
type: 'ON_INPUT_CHANGE',
|
|
28
29
|
inputName: 'lastName',
|
|
29
30
|
value: e.target.value,
|
|
30
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(
|
|
31
|
+
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(PageText.Contact.input.email.label), type: "email", name: "email", value: state.context.email || '', isRequired: true, errorMessage: state.context?.errorMessages['email']?.[0], onChange: (e) => send({
|
|
31
32
|
type: 'ON_INPUT_CHANGE',
|
|
32
33
|
inputName: 'email',
|
|
33
34
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ticket-control/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ticket-control/index.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,wBAAwB,+CAoG7B,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -9,6 +9,7 @@ const react_1 = require("@xstate/react");
|
|
|
9
9
|
const react_2 = require("react");
|
|
10
10
|
const config_1 = require("../modules/config");
|
|
11
11
|
const ticket_control_form_machine_1 = require("./ticket-control-form-machine");
|
|
12
|
+
const url_form_type_1 = require("../url-form-type");
|
|
12
13
|
const contact_module_css_1 = __importDefault(require("../contact.module.css"));
|
|
13
14
|
const button_1 = require("../components/button");
|
|
14
15
|
const feeComplaintForm_1 = __importDefault(require("./forms/feeComplaintForm"));
|
|
@@ -18,9 +19,10 @@ const components_1 = require("../components");
|
|
|
18
19
|
const utils_1 = require("../utils");
|
|
19
20
|
const error_message_1 = __importDefault(require("../components/error-message/error-message"));
|
|
20
21
|
const TicketControlPageContent = () => {
|
|
22
|
+
const PageText = (0, translations_1.usePageText)();
|
|
21
23
|
const { t } = (0, translations_1.useTranslation)();
|
|
22
24
|
const apiConfig = (0, config_1.useApiConfig)();
|
|
23
|
-
const { formSchemaOverrides, layout } = (0, config_1.useContactFormConfig)();
|
|
25
|
+
const { formSchemaOverrides, layout, features } = (0, config_1.useContactFormConfig)();
|
|
24
26
|
const successPath = layout?.successPath ??
|
|
25
27
|
(layout?.basePath ? `${layout.basePath}/success` : '/contact/success');
|
|
26
28
|
const errorPath = layout?.errorPath ??
|
|
@@ -28,7 +30,15 @@ const TicketControlPageContent = () => {
|
|
|
28
30
|
const machine = (0, react_2.useMemo)(() => (0, ticket_control_form_machine_1.createTicketControlFormMachine)(apiConfig.onSubmit, {
|
|
29
31
|
successPath,
|
|
30
32
|
errorPath,
|
|
31
|
-
|
|
33
|
+
includeBankAccountFields: features?.includeBankAccountFields !== false,
|
|
34
|
+
includeCustomerNumber: features?.includeCustomerNumberInFeeComplaint !== false,
|
|
35
|
+
}), [
|
|
36
|
+
apiConfig.onSubmit,
|
|
37
|
+
successPath,
|
|
38
|
+
errorPath,
|
|
39
|
+
features?.includeBankAccountFields,
|
|
40
|
+
features?.includeCustomerNumberInFeeComplaint,
|
|
41
|
+
]);
|
|
32
42
|
const [state, send] = (0, react_1.useMachine)(machine);
|
|
33
43
|
const displaySubmitButton = (state.context.formType === 'feeComplaint' &&
|
|
34
44
|
state.context.agreesSecondAgreement) ||
|
|
@@ -41,15 +51,20 @@ const TicketControlPageContent = () => {
|
|
|
41
51
|
return allTypes;
|
|
42
52
|
return allTypes.filter((type) => override.includes(type));
|
|
43
53
|
}, [formSchemaOverrides]);
|
|
54
|
+
const enabledFormTypesRef = (0, react_2.useRef)(enabledFormTypes);
|
|
55
|
+
(0, react_2.useEffect)(() => {
|
|
56
|
+
const { type } = (0, url_form_type_1.readFormTypeParam)(enabledFormTypesRef.current);
|
|
57
|
+
if (type) {
|
|
58
|
+
send({ type: 'SELECT_FORM_TYPE', formType: type });
|
|
59
|
+
}
|
|
60
|
+
}, [send]);
|
|
44
61
|
const onSubmit = async (e) => {
|
|
45
62
|
e.preventDefault();
|
|
46
63
|
send({ type: 'SUBMIT', orderedFormFieldNames: (0, utils_1.findOrderFormFields)(e) });
|
|
47
64
|
};
|
|
48
|
-
return ((0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, className: contact_module_css_1.default.form, children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
} }) }, formType))) }) }), state.matches({ editing: 'feeComplaint' }) && ((0, jsx_runtime_1.jsx)(feeComplaintForm_1.default, { state: state, send: send })), state.matches({ editing: 'feedback' }) && ((0, jsx_runtime_1.jsx)(feedbackForm_1.default, { state: state, send: send })), state.matches({ editing: 'postponePayment' }) && ((0, jsx_runtime_1.jsx)(postponePayment_1.default, { state: state, send: send })), state.context.hasSubmissionError && ((0, jsx_runtime_1.jsx)(error_message_1.default, { message: t(translations_1.PageText.Contact.error.info), id: "submission-error" })), displaySubmitButton && ((0, jsx_runtime_1.jsx)(button_1.Button, { title: t(translations_1.PageText.Contact.submit), mode: 'interactive_0--bordered', buttonProps: { type: 'submit' }, state: state.matches('submitting') ? 'loading' : undefined, className: contact_module_css_1.default.submitButton }))] }));
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)("form", { onSubmit: onSubmit, className: contact_module_css_1.default.form, children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketControl.title), children: (0, jsx_runtime_1.jsx)("ul", { className: contact_module_css_1.default.form_options__list, children: enabledFormTypes.map((formType) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(components_1.Radio, { label: t(PageText.Contact.ticketControl[formType].description), checked: state.matches({ editing: formType }), onChange: () => {
|
|
66
|
+
(0, url_form_type_1.setFormTypeParam)(formType);
|
|
67
|
+
send({ type: 'SELECT_FORM_TYPE', formType: formType });
|
|
68
|
+
} }) }, formType))) }) }), state.matches({ editing: 'feeComplaint' }) && ((0, jsx_runtime_1.jsx)(feeComplaintForm_1.default, { state: state, send: send })), state.matches({ editing: 'feedback' }) && ((0, jsx_runtime_1.jsx)(feedbackForm_1.default, { state: state, send: send })), state.matches({ editing: 'postponePayment' }) && ((0, jsx_runtime_1.jsx)(postponePayment_1.default, { state: state, send: send })), state.context.hasSubmissionError && ((0, jsx_runtime_1.jsx)(error_message_1.default, { message: t(PageText.Contact.error.info), id: "submission-error" })), displaySubmitButton && ((0, jsx_runtime_1.jsx)(button_1.Button, { title: t(PageText.Contact.submit), mode: 'interactive_0--bordered', buttonProps: { type: 'submit' }, state: state.matches('submitting') ? 'loading' : undefined, className: contact_module_css_1.default.submitButton }))] }));
|
|
54
69
|
};
|
|
55
70
|
exports.default = TicketControlPageContent;
|
|
@@ -29,6 +29,7 @@ type SubmitInput = {
|
|
|
29
29
|
toStop?: string;
|
|
30
30
|
dateOfTicketControl?: string;
|
|
31
31
|
timeOfTicketControl?: string;
|
|
32
|
+
tripId?: string;
|
|
32
33
|
feedback?: string;
|
|
33
34
|
invoiceNumber?: string;
|
|
34
35
|
};
|
|
@@ -54,6 +55,7 @@ export type TicketControlContextProps = {
|
|
|
54
55
|
toStop?: Line['quays'][0] | undefined;
|
|
55
56
|
dateOfTicketControl?: string;
|
|
56
57
|
timeOfTicketControl?: string;
|
|
58
|
+
tripId?: string;
|
|
57
59
|
feedback?: string;
|
|
58
60
|
invoiceNumber?: string;
|
|
59
61
|
formType?: FormType;
|
|
@@ -61,6 +63,8 @@ export type TicketControlContextProps = {
|
|
|
61
63
|
agreesSecondAgreement: boolean;
|
|
62
64
|
isAppTicketStorageMode: boolean;
|
|
63
65
|
hasInternationalBankAccount: boolean;
|
|
66
|
+
includeBankAccountFields: boolean;
|
|
67
|
+
includeCustomerNumber: boolean;
|
|
64
68
|
errorMessages: InputErrorMessages;
|
|
65
69
|
firstErrorMessage?: string;
|
|
66
70
|
hasSubmissionError?: boolean;
|
|
@@ -69,11 +73,15 @@ export type MachinePaths = {
|
|
|
69
73
|
successPath: string;
|
|
70
74
|
errorPath: string;
|
|
71
75
|
};
|
|
72
|
-
export
|
|
76
|
+
export type MachineOptions = MachinePaths & {
|
|
77
|
+
includeBankAccountFields?: boolean;
|
|
78
|
+
includeCustomerNumber?: boolean;
|
|
79
|
+
};
|
|
80
|
+
export declare function createTicketControlFormMachine(onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>, paths?: Partial<MachineOptions>): import("xstate").StateMachine<TicketControlContextProps, {
|
|
73
81
|
type: "VALIDATE";
|
|
74
82
|
} | {
|
|
75
83
|
type: "ON_INPUT_CHANGE";
|
|
76
|
-
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime";
|
|
84
|
+
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
|
|
77
85
|
value: any;
|
|
78
86
|
} | {
|
|
79
87
|
type: "ON_TRANSPORTMODE_CHANGE";
|
|
@@ -84,7 +92,7 @@ export declare function createTicketControlFormMachine(onSubmit: (schemaName: Fo
|
|
|
84
92
|
} | {
|
|
85
93
|
type: "ON_INPUT_CHANGE";
|
|
86
94
|
inputName: "formType" | "feeNumber" | "invoiceNumber" | "appPhoneNumber" | "customerNumber" | "travelCardNumber" | "isAppTicketStorageMode" | "agreesFirstAgreement" | "agreesSecondAgreement" | "hasInternationalBankAccount" | "dateOfTicketControl" | "timeOfTicketControl";
|
|
87
|
-
value: string | boolean;
|
|
95
|
+
value: string | boolean | undefined;
|
|
88
96
|
} | {
|
|
89
97
|
type: "SELECT_FORM_TYPE";
|
|
90
98
|
formType: FormType;
|
|
@@ -98,6 +106,9 @@ export declare function createTicketControlFormMachine(onSubmit: (schemaName: Fo
|
|
|
98
106
|
logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
|
|
99
107
|
id: string | undefined;
|
|
100
108
|
}, {
|
|
109
|
+
type: "onInputChange";
|
|
110
|
+
params: unknown;
|
|
111
|
+
} | {
|
|
101
112
|
type: "navigateToErrorPage";
|
|
102
113
|
params: unknown;
|
|
103
114
|
} | {
|
|
@@ -118,9 +129,6 @@ export declare function createTicketControlFormMachine(onSubmit: (schemaName: Fo
|
|
|
118
129
|
} | {
|
|
119
130
|
type: "clearSubmissionError";
|
|
120
131
|
params: unknown;
|
|
121
|
-
} | {
|
|
122
|
-
type: "onInputChange";
|
|
123
|
-
params: unknown;
|
|
124
132
|
} | {
|
|
125
133
|
type: "onTransportModeChange";
|
|
126
134
|
params: unknown;
|
|
@@ -175,7 +183,7 @@ export declare const ticketControlFormMachine: import("xstate").StateMachine<Tic
|
|
|
175
183
|
type: "VALIDATE";
|
|
176
184
|
} | {
|
|
177
185
|
type: "ON_INPUT_CHANGE";
|
|
178
|
-
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime";
|
|
186
|
+
inputName: "address" | "attachments" | "bankAccountNumber" | "city" | "date" | "email" | "firstName" | "feedback" | "IBAN" | "lastName" | "phoneNumber" | "postalCode" | "SWIFT" | "toStop" | "fromStop" | "plannedDepartureTime" | "tripId";
|
|
179
187
|
value: any;
|
|
180
188
|
} | {
|
|
181
189
|
type: "ON_TRANSPORTMODE_CHANGE";
|
|
@@ -186,7 +194,7 @@ export declare const ticketControlFormMachine: import("xstate").StateMachine<Tic
|
|
|
186
194
|
} | {
|
|
187
195
|
type: "ON_INPUT_CHANGE";
|
|
188
196
|
inputName: "formType" | "feeNumber" | "invoiceNumber" | "appPhoneNumber" | "customerNumber" | "travelCardNumber" | "isAppTicketStorageMode" | "agreesFirstAgreement" | "agreesSecondAgreement" | "hasInternationalBankAccount" | "dateOfTicketControl" | "timeOfTicketControl";
|
|
189
|
-
value: string | boolean;
|
|
197
|
+
value: string | boolean | undefined;
|
|
190
198
|
} | {
|
|
191
199
|
type: "SELECT_FORM_TYPE";
|
|
192
200
|
formType: FormType;
|
|
@@ -200,6 +208,9 @@ export declare const ticketControlFormMachine: import("xstate").StateMachine<Tic
|
|
|
200
208
|
logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
|
|
201
209
|
id: string | undefined;
|
|
202
210
|
}, {
|
|
211
|
+
type: "onInputChange";
|
|
212
|
+
params: unknown;
|
|
213
|
+
} | {
|
|
203
214
|
type: "navigateToErrorPage";
|
|
204
215
|
params: unknown;
|
|
205
216
|
} | {
|
|
@@ -220,9 +231,6 @@ export declare const ticketControlFormMachine: import("xstate").StateMachine<Tic
|
|
|
220
231
|
} | {
|
|
221
232
|
type: "clearSubmissionError";
|
|
222
233
|
params: unknown;
|
|
223
|
-
} | {
|
|
224
|
-
type: "onInputChange";
|
|
225
|
-
params: unknown;
|
|
226
234
|
} | {
|
|
227
235
|
type: "onTransportModeChange";
|
|
228
236
|
params: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticket-control-form-machine.d.ts","sourceRoot":"","sources":["../../src/ticket-control/ticket-control-form-machine.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,oBAAY,QAAQ;IAClB,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,eAAe,oBAAoB;CACpC;AAED,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,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OAAO,CAAC,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0PhC;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC"}
|
|
@@ -21,7 +21,7 @@ const disagreeAgreements = (context) => {
|
|
|
21
21
|
};
|
|
22
22
|
const setInputsToValidate = (context) => {
|
|
23
23
|
// Destructure the needed fields from context
|
|
24
|
-
const { formType, firstName, lastName, email, feeNumber, feedback, phoneNumber, invoiceNumber, appPhoneNumber, customerNumber, travelCardNumber, address, postalCode, city, hasInternationalBankAccount, bankAccountNumber, IBAN, SWIFT, transportMode, line, dateOfTicketControl, timeOfTicketControl, isAppTicketStorageMode, } = context;
|
|
24
|
+
const { formType, firstName, lastName, email, feeNumber, feedback, phoneNumber, invoiceNumber, appPhoneNumber, customerNumber, travelCardNumber, address, postalCode, city, hasInternationalBankAccount, includeBankAccountFields, includeCustomerNumber, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, dateOfTicketControl, timeOfTicketControl, isAppTicketStorageMode, } = context;
|
|
25
25
|
switch (formType) {
|
|
26
26
|
case FormType.FeeComplaint:
|
|
27
27
|
return {
|
|
@@ -35,16 +35,22 @@ const setInputsToValidate = (context) => {
|
|
|
35
35
|
city,
|
|
36
36
|
phoneNumber,
|
|
37
37
|
...(isAppTicketStorageMode
|
|
38
|
-
? {
|
|
38
|
+
? {
|
|
39
|
+
appPhoneNumber,
|
|
40
|
+
...(includeCustomerNumber ? { customerNumber } : {}),
|
|
41
|
+
}
|
|
39
42
|
: { travelCardNumber }),
|
|
40
|
-
...(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
...(includeBankAccountFields &&
|
|
44
|
+
(hasInternationalBankAccount
|
|
45
|
+
? { IBAN, SWIFT }
|
|
46
|
+
: { bankAccountNumber })),
|
|
43
47
|
};
|
|
44
48
|
case FormType.Feedback:
|
|
45
49
|
return {
|
|
46
50
|
transportMode,
|
|
47
51
|
line,
|
|
52
|
+
fromStop,
|
|
53
|
+
toStop,
|
|
48
54
|
dateOfTicketControl,
|
|
49
55
|
timeOfTicketControl,
|
|
50
56
|
feedback,
|
|
@@ -59,6 +65,8 @@ const setInputsToValidate = (context) => {
|
|
|
59
65
|
function createTicketControlFormMachine(onSubmit, paths) {
|
|
60
66
|
const successPath = paths?.successPath ?? '/contact/success';
|
|
61
67
|
const errorPath = paths?.errorPath ?? '/contact/error';
|
|
68
|
+
const includeBankAccountFields = paths?.includeBankAccountFields !== false;
|
|
69
|
+
const includeCustomerNumber = paths?.includeCustomerNumber !== false;
|
|
62
70
|
return (0, xstate_1.setup)({
|
|
63
71
|
types: {
|
|
64
72
|
context: {},
|
|
@@ -123,6 +131,15 @@ function createTicketControlFormMachine(onSubmit, paths) {
|
|
|
123
131
|
hasSubmissionError: undefined,
|
|
124
132
|
};
|
|
125
133
|
}
|
|
134
|
+
if (inputName === 'dateOfTicketControl' || inputName === 'fromStop') {
|
|
135
|
+
return {
|
|
136
|
+
...context,
|
|
137
|
+
[inputName]: value,
|
|
138
|
+
timeOfTicketControl: undefined,
|
|
139
|
+
tripId: undefined,
|
|
140
|
+
hasSubmissionError: undefined,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
126
143
|
return {
|
|
127
144
|
...context,
|
|
128
145
|
[inputName]: value,
|
|
@@ -162,6 +179,8 @@ function createTicketControlFormMachine(onSubmit, paths) {
|
|
|
162
179
|
agreesFirstAgreement: false,
|
|
163
180
|
agreesSecondAgreement: false,
|
|
164
181
|
hasInternationalBankAccount: false,
|
|
182
|
+
includeBankAccountFields,
|
|
183
|
+
includeCustomerNumber,
|
|
165
184
|
isAppTicketStorageMode: true,
|
|
166
185
|
errorMessages: {},
|
|
167
186
|
},
|
|
@@ -245,6 +264,7 @@ function createTicketControlFormMachine(onSubmit, paths) {
|
|
|
245
264
|
toStop: context.toStop?.name,
|
|
246
265
|
dateOfTicketControl: context.dateOfTicketControl,
|
|
247
266
|
timeOfTicketControl: context.timeOfTicketControl,
|
|
267
|
+
tripId: context.tripId,
|
|
248
268
|
invoiceNumber: context.invoiceNumber,
|
|
249
269
|
attachments: context.attachments,
|
|
250
270
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appAccountForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appAccountForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,iBAAiB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"appAccountForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appAccountForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,iBAAiB,mBAAmB,4CAgIlE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -5,8 +5,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const translations_1 = require("../../../translations");
|
|
6
6
|
const components_1 = require("../../../components");
|
|
7
7
|
const AppAccountForm = ({ state, send }) => {
|
|
8
|
+
const PageText = (0, translations_1.usePageText)();
|
|
8
9
|
const { t } = (0, translations_1.useTranslation)();
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
|
|
10
11
|
type: 'ON_INPUT_CHANGE',
|
|
11
12
|
inputName: 'question',
|
|
12
13
|
value: e.target.value,
|
|
@@ -15,7 +16,7 @@ const AppAccountForm = ({ state, send }) => {
|
|
|
15
16
|
: undefined, fileInputProps: {
|
|
16
17
|
id: 'attachments',
|
|
17
18
|
name: 'attachments',
|
|
18
|
-
iconLabel: t(
|
|
19
|
+
iconLabel: t(PageText.Contact.input.question.attachment),
|
|
19
20
|
onChange: (files) => {
|
|
20
21
|
send({
|
|
21
22
|
type: 'ON_INPUT_CHANGE',
|
|
@@ -23,25 +24,25 @@ const AppAccountForm = ({ state, send }) => {
|
|
|
23
24
|
value: files,
|
|
24
25
|
});
|
|
25
26
|
},
|
|
26
|
-
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
27
|
+
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "customerNumber", label: t(PageText.Contact.input.customerNumber.label), type: "text", name: "customerNumber", value: state.context.customerNumber || '', isRequired: true, errorMessage: state.context?.errorMessages['customerNumber']?.[0], onChange: (e) => send({
|
|
27
28
|
type: 'ON_INPUT_CHANGE',
|
|
28
29
|
inputName: 'customerNumber',
|
|
29
30
|
value: e.target.value,
|
|
30
31
|
}), modalContent: {
|
|
31
|
-
description: t(
|
|
32
|
-
} }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(
|
|
32
|
+
description: t(PageText.Contact.input.customerNumber.description),
|
|
33
|
+
} }), (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({
|
|
33
34
|
type: 'ON_INPUT_CHANGE',
|
|
34
35
|
inputName: 'firstName',
|
|
35
36
|
value: e.target.value,
|
|
36
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(
|
|
37
|
+
}) }), (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({
|
|
37
38
|
type: 'ON_INPUT_CHANGE',
|
|
38
39
|
inputName: 'lastName',
|
|
39
40
|
value: e.target.value,
|
|
40
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(
|
|
41
|
+
}) }), (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({
|
|
41
42
|
type: 'ON_INPUT_CHANGE',
|
|
42
43
|
inputName: 'email',
|
|
43
44
|
value: e.target.value,
|
|
44
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(
|
|
45
|
+
}) }), (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({
|
|
45
46
|
type: 'ON_INPUT_CHANGE',
|
|
46
47
|
inputName: 'phoneNumber',
|
|
47
48
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appTicketingForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appTicketingForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,iBAAiB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"appTicketingForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appTicketingForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,iBAAiB,qBAAqB,4CAyJtE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -5,16 +5,17 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const translations_1 = require("../../../translations");
|
|
6
6
|
const components_1 = require("../../../components");
|
|
7
7
|
const AppTicketingForm = ({ state, send }) => {
|
|
8
|
+
const PageText = (0, translations_1.usePageText)();
|
|
8
9
|
const { t } = (0, translations_1.useTranslation)();
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.app.appTicketing.title), children: (0, jsx_runtime_1.jsx)(components_1.Input, { id: "orderId", label: t(PageText.Contact.input.orderId.label(false)), type: "text", name: "orderId", value: state.context.orderId || '', isRequired: true, errorMessage: state.context?.errorMessages['orderId']?.[0], onChange: (e) => send({
|
|
10
11
|
type: 'ON_INPUT_CHANGE',
|
|
11
12
|
inputName: 'orderId',
|
|
12
13
|
value: e.target.value,
|
|
13
14
|
}), modalContent: {
|
|
14
|
-
description: t(
|
|
15
|
-
instruction: t(
|
|
16
|
-
bulletPoints:
|
|
17
|
-
} }) }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(
|
|
15
|
+
description: t(PageText.Contact.input.orderId.description),
|
|
16
|
+
instruction: t(PageText.Contact.input.orderId.instruction),
|
|
17
|
+
bulletPoints: PageText.Contact.input.orderId.descriptionBulletPoints.map((bulletpoint) => t(bulletpoint)),
|
|
18
|
+
} }) }), (0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(PageText.Contact.input.question.title), isRequired: true, children: (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "question", description: t(PageText.Contact.input.question.info), value: state.context.question || '', onChange: (e) => send({
|
|
18
19
|
type: 'ON_INPUT_CHANGE',
|
|
19
20
|
inputName: 'question',
|
|
20
21
|
value: e.target.value,
|
|
@@ -23,7 +24,7 @@ const AppTicketingForm = ({ state, send }) => {
|
|
|
23
24
|
: undefined, fileInputProps: {
|
|
24
25
|
id: 'attachments',
|
|
25
26
|
name: 'attachments',
|
|
26
|
-
iconLabel: t(
|
|
27
|
+
iconLabel: t(PageText.Contact.input.question.attachment),
|
|
27
28
|
onChange: (files) => {
|
|
28
29
|
send({
|
|
29
30
|
type: 'ON_INPUT_CHANGE',
|
|
@@ -31,25 +32,25 @@ const AppTicketingForm = ({ state, send }) => {
|
|
|
31
32
|
value: files,
|
|
32
33
|
});
|
|
33
34
|
},
|
|
34
|
-
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(
|
|
35
|
+
} }) }), (0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.aboutYouInfo.title), children: [(0, jsx_runtime_1.jsx)(components_1.Input, { id: "customerNumber", label: t(PageText.Contact.input.customerNumber.labelOptional), type: "text", name: "customerNumber", value: state.context.customerNumber || '', errorMessage: state.context?.errorMessages['customerNumber']?.[0], onChange: (e) => send({
|
|
35
36
|
type: 'ON_INPUT_CHANGE',
|
|
36
37
|
inputName: 'customerNumber',
|
|
37
38
|
value: e.target.value,
|
|
38
39
|
}), modalContent: {
|
|
39
|
-
description: t(
|
|
40
|
-
} }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "firstName", label: t(
|
|
40
|
+
description: t(PageText.Contact.input.customerNumber.description),
|
|
41
|
+
} }), (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({
|
|
41
42
|
type: 'ON_INPUT_CHANGE',
|
|
42
43
|
inputName: 'firstName',
|
|
43
44
|
value: e.target.value,
|
|
44
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "lastName", label: t(
|
|
45
|
+
}) }), (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({
|
|
45
46
|
type: 'ON_INPUT_CHANGE',
|
|
46
47
|
inputName: 'lastName',
|
|
47
48
|
value: e.target.value,
|
|
48
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "email", label: t(
|
|
49
|
+
}) }), (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({
|
|
49
50
|
type: 'ON_INPUT_CHANGE',
|
|
50
51
|
inputName: 'email',
|
|
51
52
|
value: e.target.value,
|
|
52
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "phoneNumber", label: t(
|
|
53
|
+
}) }), (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({
|
|
53
54
|
type: 'ON_INPUT_CHANGE',
|
|
54
55
|
inputName: 'phoneNumber',
|
|
55
56
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appTravelSuggestionForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appTravelSuggestionForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,kBAGrC,4BAA4B,
|
|
1
|
+
{"version":3,"file":"appTravelSuggestionForm.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/app/appTravelSuggestionForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IACzC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,mBAAmB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,kBAGrC,4BAA4B,4CA6F9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|