@mrfylke/contact-form 0.1.11 → 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/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 +13 -7
- 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 +19 -16
- 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 +4 -3
- package/lib/lines/use-lines.d.ts.map +1 -1
- package/lib/lines/use-lines.js +43 -10
- 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 -9
- 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 -0
- package/lib/modules/config/types.d.ts +48 -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 +2 -2
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +15 -8
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundTaxiForm.js +15 -8
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +46 -11
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/index.js +8 -7
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +53 -19
- 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 +96 -3
- 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/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 +28 -25
- package/lib/ticket-control/forms/feedbackForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/feedbackForm.js +22 -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 +15 -6
- package/lib/ticket-control/ticket-control-form-machine.d.ts +14 -10
- package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
- package/lib/ticket-control/ticket-control-form-machine.js +17 -2
- 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/pages/contact.d.ts +46 -0
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +50 -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 +19 -0
- package/lib/types/submit-payloads.d.ts.map +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 +7 -0
- package/package.json +1 -2
|
@@ -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,48 +79,48 @@ 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
|
-
}) }), 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(
|
|
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
|
|
108
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({
|
|
109
112
|
type: 'ON_INPUT_CHANGE',
|
|
110
113
|
inputName: 'bankAccountNumber',
|
|
111
114
|
value: e.target.value,
|
|
112
|
-
}) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(
|
|
115
|
+
}) }), (0, jsx_runtime_1.jsx)(checkbox_1.Checkbox, { label: t(PageText.Contact.input.bankInformation.checkbox), checked: state.context.hasInternationalBankAccount, onChange: () => send({
|
|
113
116
|
type: 'ON_INPUT_CHANGE',
|
|
114
117
|
inputName: 'hasInternationalBankAccount',
|
|
115
118
|
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(
|
|
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({
|
|
117
120
|
type: 'ON_INPUT_CHANGE',
|
|
118
121
|
inputName: 'IBAN',
|
|
119
122
|
value: e.target.value,
|
|
120
|
-
}) }), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "SWIFT", label: t(
|
|
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({
|
|
121
124
|
type: 'ON_INPUT_CHANGE',
|
|
122
125
|
inputName: 'SWIFT',
|
|
123
126
|
value: e.target.value,
|
|
@@ -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"}
|
|
@@ -7,21 +7,22 @@ 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',
|
|
@@ -29,7 +30,7 @@ const FeedbackForm = ({ state, send }) => {
|
|
|
29
30
|
});
|
|
30
31
|
}, isRequired: true, error: state.context?.errorMessages['fromStop']?.[0]
|
|
31
32
|
? t(state.context?.errorMessages['fromStop']?.[0])
|
|
32
|
-
: undefined }), (0, jsx_runtime_1.jsx)(components_1.SearchableSelect, { id: "toStop", label: t(
|
|
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) => {
|
|
33
34
|
send({
|
|
34
35
|
type: 'ON_INPUT_CHANGE',
|
|
35
36
|
inputName: 'toStop',
|
|
@@ -37,15 +38,22 @@ const FeedbackForm = ({ state, send }) => {
|
|
|
37
38
|
});
|
|
38
39
|
}, isRequired: true, error: state.context?.errorMessages['toStop']?.[0]
|
|
39
40
|
? t(state.context?.errorMessages['toStop']?.[0])
|
|
40
|
-
: undefined }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "date", label: t(
|
|
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({
|
|
41
42
|
type: 'ON_INPUT_CHANGE',
|
|
42
43
|
inputName: 'dateOfTicketControl',
|
|
43
44
|
value: dateOfTicketControl,
|
|
44
|
-
}), errorMessage: state.context?.errorMessages['dateOfTicketControl']?.[0] }), (0, jsx_runtime_1.jsx)(components_1.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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({
|
|
49
57
|
type: 'ON_INPUT_CHANGE',
|
|
50
58
|
inputName: 'feedback',
|
|
51
59
|
value: e.target.value,
|
|
@@ -53,7 +61,7 @@ const FeedbackForm = ({ state, send }) => {
|
|
|
53
61
|
t(state.context.errorMessages['feedback']?.[0]), fileInputProps: {
|
|
54
62
|
id: 'attachments',
|
|
55
63
|
name: 'attachments',
|
|
56
|
-
iconLabel: t(
|
|
64
|
+
iconLabel: t(PageText.Contact.input.feedback.attachment.generic),
|
|
57
65
|
onChange: (files) => {
|
|
58
66
|
send({
|
|
59
67
|
type: 'ON_INPUT_CHANGE',
|
|
@@ -61,15 +69,15 @@ const FeedbackForm = ({ state, send }) => {
|
|
|
61
69
|
value: files,
|
|
62
70
|
});
|
|
63
71
|
},
|
|
64
|
-
} }) }), (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({
|
|
65
73
|
type: 'ON_INPUT_CHANGE',
|
|
66
74
|
inputName: 'firstName',
|
|
67
75
|
value: e.target.value,
|
|
68
|
-
}) }), (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({
|
|
69
77
|
type: 'ON_INPUT_CHANGE',
|
|
70
78
|
inputName: 'lastName',
|
|
71
79
|
value: e.target.value,
|
|
72
|
-
}) }), (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({
|
|
73
81
|
type: 'ON_INPUT_CHANGE',
|
|
74
82
|
inputName: 'email',
|
|
75
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,6 +19,7 @@ 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
25
|
const { formSchemaOverrides, layout, features } = (0, config_1.useContactFormConfig)();
|
|
@@ -29,11 +31,13 @@ const TicketControlPageContent = () => {
|
|
|
29
31
|
successPath,
|
|
30
32
|
errorPath,
|
|
31
33
|
includeBankAccountFields: features?.includeBankAccountFields !== false,
|
|
34
|
+
includeCustomerNumber: features?.includeCustomerNumberInFeeComplaint !== false,
|
|
32
35
|
}), [
|
|
33
36
|
apiConfig.onSubmit,
|
|
34
37
|
successPath,
|
|
35
38
|
errorPath,
|
|
36
39
|
features?.includeBankAccountFields,
|
|
40
|
+
features?.includeCustomerNumberInFeeComplaint,
|
|
37
41
|
]);
|
|
38
42
|
const [state, send] = (0, react_1.useMachine)(machine);
|
|
39
43
|
const displaySubmitButton = (state.context.formType === 'feeComplaint' &&
|
|
@@ -47,15 +51,20 @@ const TicketControlPageContent = () => {
|
|
|
47
51
|
return allTypes;
|
|
48
52
|
return allTypes.filter((type) => override.includes(type));
|
|
49
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]);
|
|
50
61
|
const onSubmit = async (e) => {
|
|
51
62
|
e.preventDefault();
|
|
52
63
|
send({ type: 'SUBMIT', orderedFormFieldNames: (0, utils_1.findOrderFormFields)(e) });
|
|
53
64
|
};
|
|
54
|
-
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(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
59
|
-
} }) }, 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 }))] }));
|
|
60
69
|
};
|
|
61
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;
|
|
@@ -62,6 +64,7 @@ export type TicketControlContextProps = {
|
|
|
62
64
|
isAppTicketStorageMode: boolean;
|
|
63
65
|
hasInternationalBankAccount: boolean;
|
|
64
66
|
includeBankAccountFields: boolean;
|
|
67
|
+
includeCustomerNumber: boolean;
|
|
65
68
|
errorMessages: InputErrorMessages;
|
|
66
69
|
firstErrorMessage?: string;
|
|
67
70
|
hasSubmissionError?: boolean;
|
|
@@ -72,12 +75,13 @@ export type MachinePaths = {
|
|
|
72
75
|
};
|
|
73
76
|
export type MachineOptions = MachinePaths & {
|
|
74
77
|
includeBankAccountFields?: boolean;
|
|
78
|
+
includeCustomerNumber?: boolean;
|
|
75
79
|
};
|
|
76
80
|
export declare function createTicketControlFormMachine(onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>, paths?: Partial<MachineOptions>): import("xstate").StateMachine<TicketControlContextProps, {
|
|
77
81
|
type: "VALIDATE";
|
|
78
82
|
} | {
|
|
79
83
|
type: "ON_INPUT_CHANGE";
|
|
80
|
-
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";
|
|
81
85
|
value: any;
|
|
82
86
|
} | {
|
|
83
87
|
type: "ON_TRANSPORTMODE_CHANGE";
|
|
@@ -88,7 +92,7 @@ export declare function createTicketControlFormMachine(onSubmit: (schemaName: Fo
|
|
|
88
92
|
} | {
|
|
89
93
|
type: "ON_INPUT_CHANGE";
|
|
90
94
|
inputName: "formType" | "feeNumber" | "invoiceNumber" | "appPhoneNumber" | "customerNumber" | "travelCardNumber" | "isAppTicketStorageMode" | "agreesFirstAgreement" | "agreesSecondAgreement" | "hasInternationalBankAccount" | "dateOfTicketControl" | "timeOfTicketControl";
|
|
91
|
-
value: string | boolean;
|
|
95
|
+
value: string | boolean | undefined;
|
|
92
96
|
} | {
|
|
93
97
|
type: "SELECT_FORM_TYPE";
|
|
94
98
|
formType: FormType;
|
|
@@ -102,6 +106,9 @@ export declare function createTicketControlFormMachine(onSubmit: (schemaName: Fo
|
|
|
102
106
|
logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
|
|
103
107
|
id: string | undefined;
|
|
104
108
|
}, {
|
|
109
|
+
type: "onInputChange";
|
|
110
|
+
params: unknown;
|
|
111
|
+
} | {
|
|
105
112
|
type: "navigateToErrorPage";
|
|
106
113
|
params: unknown;
|
|
107
114
|
} | {
|
|
@@ -122,9 +129,6 @@ export declare function createTicketControlFormMachine(onSubmit: (schemaName: Fo
|
|
|
122
129
|
} | {
|
|
123
130
|
type: "clearSubmissionError";
|
|
124
131
|
params: unknown;
|
|
125
|
-
} | {
|
|
126
|
-
type: "onInputChange";
|
|
127
|
-
params: unknown;
|
|
128
132
|
} | {
|
|
129
133
|
type: "onTransportModeChange";
|
|
130
134
|
params: unknown;
|
|
@@ -179,7 +183,7 @@ export declare const ticketControlFormMachine: import("xstate").StateMachine<Tic
|
|
|
179
183
|
type: "VALIDATE";
|
|
180
184
|
} | {
|
|
181
185
|
type: "ON_INPUT_CHANGE";
|
|
182
|
-
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";
|
|
183
187
|
value: any;
|
|
184
188
|
} | {
|
|
185
189
|
type: "ON_TRANSPORTMODE_CHANGE";
|
|
@@ -190,7 +194,7 @@ export declare const ticketControlFormMachine: import("xstate").StateMachine<Tic
|
|
|
190
194
|
} | {
|
|
191
195
|
type: "ON_INPUT_CHANGE";
|
|
192
196
|
inputName: "formType" | "feeNumber" | "invoiceNumber" | "appPhoneNumber" | "customerNumber" | "travelCardNumber" | "isAppTicketStorageMode" | "agreesFirstAgreement" | "agreesSecondAgreement" | "hasInternationalBankAccount" | "dateOfTicketControl" | "timeOfTicketControl";
|
|
193
|
-
value: string | boolean;
|
|
197
|
+
value: string | boolean | undefined;
|
|
194
198
|
} | {
|
|
195
199
|
type: "SELECT_FORM_TYPE";
|
|
196
200
|
formType: FormType;
|
|
@@ -204,6 +208,9 @@ export declare const ticketControlFormMachine: import("xstate").StateMachine<Tic
|
|
|
204
208
|
logic: import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>;
|
|
205
209
|
id: string | undefined;
|
|
206
210
|
}, {
|
|
211
|
+
type: "onInputChange";
|
|
212
|
+
params: unknown;
|
|
213
|
+
} | {
|
|
207
214
|
type: "navigateToErrorPage";
|
|
208
215
|
params: unknown;
|
|
209
216
|
} | {
|
|
@@ -224,9 +231,6 @@ export declare const ticketControlFormMachine: import("xstate").StateMachine<Tic
|
|
|
224
231
|
} | {
|
|
225
232
|
type: "clearSubmissionError";
|
|
226
233
|
params: unknown;
|
|
227
|
-
} | {
|
|
228
|
-
type: "onInputChange";
|
|
229
|
-
params: unknown;
|
|
230
234
|
} | {
|
|
231
235
|
type: "onTransportModeChange";
|
|
232
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":"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
|
|
1
|
+
{"version":3,"file":"ticket-control-form-machine.d.ts","sourceRoot":"","sources":["../../src/ticket-control/ticket-control-form-machine.ts"],"names":[],"mappings":"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"}
|
|
@@ -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, includeBankAccountFields, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, 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,7 +35,10 @@ const setInputsToValidate = (context) => {
|
|
|
35
35
|
city,
|
|
36
36
|
phoneNumber,
|
|
37
37
|
...(isAppTicketStorageMode
|
|
38
|
-
? {
|
|
38
|
+
? {
|
|
39
|
+
appPhoneNumber,
|
|
40
|
+
...(includeCustomerNumber ? { customerNumber } : {}),
|
|
41
|
+
}
|
|
39
42
|
: { travelCardNumber }),
|
|
40
43
|
...(includeBankAccountFields &&
|
|
41
44
|
(hasInternationalBankAccount
|
|
@@ -63,6 +66,7 @@ function createTicketControlFormMachine(onSubmit, paths) {
|
|
|
63
66
|
const successPath = paths?.successPath ?? '/contact/success';
|
|
64
67
|
const errorPath = paths?.errorPath ?? '/contact/error';
|
|
65
68
|
const includeBankAccountFields = paths?.includeBankAccountFields !== false;
|
|
69
|
+
const includeCustomerNumber = paths?.includeCustomerNumber !== false;
|
|
66
70
|
return (0, xstate_1.setup)({
|
|
67
71
|
types: {
|
|
68
72
|
context: {},
|
|
@@ -127,6 +131,15 @@ function createTicketControlFormMachine(onSubmit, paths) {
|
|
|
127
131
|
hasSubmissionError: undefined,
|
|
128
132
|
};
|
|
129
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
|
+
}
|
|
130
143
|
return {
|
|
131
144
|
...context,
|
|
132
145
|
[inputName]: value,
|
|
@@ -167,6 +180,7 @@ function createTicketControlFormMachine(onSubmit, paths) {
|
|
|
167
180
|
agreesSecondAgreement: false,
|
|
168
181
|
hasInternationalBankAccount: false,
|
|
169
182
|
includeBankAccountFields,
|
|
183
|
+
includeCustomerNumber,
|
|
170
184
|
isAppTicketStorageMode: true,
|
|
171
185
|
errorMessages: {},
|
|
172
186
|
},
|
|
@@ -250,6 +264,7 @@ function createTicketControlFormMachine(onSubmit, paths) {
|
|
|
250
264
|
toStop: context.toStop?.name,
|
|
251
265
|
dateOfTicketControl: context.dateOfTicketControl,
|
|
252
266
|
timeOfTicketControl: context.timeOfTicketControl,
|
|
267
|
+
tripId: context.tripId,
|
|
253
268
|
invoiceNumber: context.invoiceNumber,
|
|
254
269
|
attachments: context.attachments,
|
|
255
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"}
|