@mrfylke/contact-form 0.1.25 → 0.1.27
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 +41 -13
- package/lib/ContactFormRoot.d.ts.map +1 -1
- package/lib/ContactFormRoot.js +4 -3
- package/lib/components/icon/generated-icons.d.ts +26 -26
- package/lib/components/icon/generated-icons.js +108 -108
- package/lib/contact.module.css +0 -9
- package/lib/group-travel/index.d.ts.map +1 -1
- package/lib/group-travel/index.js +1 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/journey-info/index.d.ts.map +1 -1
- package/lib/journey-info/index.js +10 -8
- package/lib/journey-info/journeyInfoStateMachine.d.ts +2 -2
- package/lib/journey-info/journeyInfoStateMachine.d.ts.map +1 -1
- package/lib/journey-info/journeyInfoStateMachine.js +1 -1
- package/lib/layouts/contact-pages.js +1 -1
- package/lib/lost-property/LostPropertyMachine.d.ts +2 -2
- package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -1
- package/lib/lost-property/LostPropertyMachine.js +1 -1
- package/lib/lost-property-external/index.d.ts.map +1 -1
- package/lib/lost-property-external/index.js +1 -2
- package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
- package/lib/means-of-transport/forms/serviceOfferingForm.js +3 -1
- package/lib/means-of-transport/index.d.ts.map +1 -1
- package/lib/means-of-transport/index.js +8 -2
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +4 -2
- 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 +9 -3
- package/lib/modules/config/context.d.ts +8 -1
- package/lib/modules/config/context.d.ts.map +1 -1
- package/lib/modules/config/context.js +7 -1
- package/lib/modules/config/default-submit.d.ts +3 -0
- package/lib/modules/config/default-submit.d.ts.map +1 -0
- package/lib/modules/config/default-submit.js +13 -0
- package/lib/modules/config/index.d.ts +1 -0
- package/lib/modules/config/index.d.ts.map +1 -1
- package/lib/modules/config/index.js +1 -0
- package/lib/modules/config/types.d.ts +52 -25
- package/lib/modules/config/types.d.ts.map +1 -1
- package/lib/modules/org-data/index.d.ts +1 -2
- package/lib/modules/org-data/index.d.ts.map +1 -1
- package/lib/modules/org-data/index.js +1 -2
- package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/index.js +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
- package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/appTicketRefund.js +18 -2
- package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/index.js +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
- package/lib/refund/forms/refund-ticket/otherTicketRefund.js +19 -3
- package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
- package/lib/refund/forms/residualValueOnTravelCard/index.js +1 -2
- package/lib/refund/index.d.ts.map +1 -1
- package/lib/refund/index.js +9 -0
- package/lib/refund/refundFormMachine.d.ts +11 -2
- package/lib/refund/refundFormMachine.d.ts.map +1 -1
- package/lib/refund/refundFormMachine.js +24 -2
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.d.ts.map +1 -1
- package/lib/server/index.js +3 -1
- package/lib/server/submit-route-handler.d.ts +20 -0
- package/lib/server/submit-route-handler.d.ts.map +1 -0
- package/lib/server/submit-route-handler.js +62 -0
- package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
- package/lib/ticket-control/forms/feeComplaintForm.js +2 -2
- package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
- package/lib/ticket-control/forms/postponePayment.js +2 -2
- package/lib/ticket-control/index.d.ts.map +1 -1
- package/lib/ticket-control/index.js +2 -0
- package/lib/ticket-control/ticket-control-form-machine.d.ts +5 -2
- package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
- package/lib/ticket-control/ticket-control-form-machine.js +14 -4
- package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
- package/lib/ticketing/forms/travel-card/orderTravelCard.js +1 -1
- package/lib/ticketing/ticketingStateMachine.d.ts +2 -2
- package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -1
- package/lib/translations/commons.d.ts +1 -0
- package/lib/translations/commons.d.ts.map +1 -1
- package/lib/translations/commons.js +4 -4
- package/lib/translations/index.d.ts +2 -6
- package/lib/translations/index.d.ts.map +1 -1
- package/lib/translations/index.js +1 -9
- package/lib/translations/language-context.d.ts +0 -8
- package/lib/translations/language-context.d.ts.map +1 -1
- package/lib/translations/language-context.js +1 -31
- package/lib/translations/merge-overrides.d.ts +1 -7
- package/lib/translations/merge-overrides.d.ts.map +1 -1
- package/lib/translations/merge-overrides.js +1 -13
- package/lib/translations/pages/contact.d.ts +9 -4
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +10 -5
- package/lib/translations/server/endpoints.d.ts +0 -62
- package/lib/translations/server/endpoints.d.ts.map +1 -1
- package/lib/translations/server/endpoints.js +0 -62
- package/lib/translations/types.d.ts +0 -6
- package/lib/translations/types.d.ts.map +1 -1
- package/lib/types/submit-payloads.d.ts +2 -0
- package/lib/types/submit-payloads.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/translations/common/index.d.ts +0 -3
- package/lib/translations/common/index.d.ts.map +0 -1
- package/lib/translations/common/index.js +0 -7
- package/lib/translations/common/layout.d.ts +0 -8
- package/lib/translations/common/layout.d.ts.map +0 -1
- package/lib/translations/common/layout.js +0 -11
- package/lib/translations/common/titles.d.ts +0 -4
- package/lib/translations/common/titles.d.ts.map +0 -1
- package/lib/translations/common/titles.js +0 -7
- package/lib/translations/json-to-override.d.ts +0 -19
- package/lib/translations/json-to-override.d.ts.map +0 -1
- package/lib/translations/json-to-override.js +0 -65
- package/lib/translations/load-org-translations.d.ts +0 -19
- package/lib/translations/load-org-translations.d.ts.map +0 -1
- package/lib/translations/load-org-translations.js +0 -23
|
@@ -14,6 +14,8 @@ const RefundSection = ({ state, send }) => {
|
|
|
14
14
|
const { features } = (0, context_1.useContactFormConfig)();
|
|
15
15
|
const ticketTypeOptions = PageText.Contact.input.ticketType.options.filter((option) => option.id == types_1.TicketTypeId.SingleTicket ||
|
|
16
16
|
option.id == types_1.TicketTypeId.PeriodTicket);
|
|
17
|
+
const showTravelCardNumber = !state.context.includeOtherTicketTypeSelector ||
|
|
18
|
+
state.context.ticketType?.id === types_1.TicketTypeId.PeriodTicket;
|
|
17
19
|
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.ticketing.refund.otherTicketRefund.label), children: [state.context.includeOtherTicketTypeSelector && ((0, jsx_runtime_1.jsx)(components_1.Select, { id: "ticketType", label: t(PageText.Contact.input.ticketType.labelRefund), value: state.context.ticketType, valueToId: (option) => option.id, valueToText: (option) => t(option.name), onChange: (value) => {
|
|
18
20
|
if (!value)
|
|
19
21
|
return;
|
|
@@ -24,17 +26,31 @@ const RefundSection = ({ state, send }) => {
|
|
|
24
26
|
});
|
|
25
27
|
}, placeholder: t(PageText.Contact.input.ticketType.optionLabelRefund), options: ticketTypeOptions, isRequired: true, error: state.context?.errorMessages['ticketType']?.[0]
|
|
26
28
|
? t(state.context?.errorMessages['ticketType'][0])
|
|
27
|
-
: undefined })), (0, jsx_runtime_1.jsx)(components_1.Input, { id: "
|
|
29
|
+
: undefined })), features?.includeOrderIdAndAmountInOtherTicketRefund && ((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({
|
|
30
|
+
type: 'ON_INPUT_CHANGE',
|
|
31
|
+
inputName: 'orderId',
|
|
32
|
+
value: e.target.value,
|
|
33
|
+
}), modalContent: {
|
|
34
|
+
description: t(PageText.Contact.input.orderId.description),
|
|
35
|
+
instruction: t(PageText.Contact.input.orderId.instruction),
|
|
36
|
+
bulletPoints: PageText.Contact.input.orderId.descriptionBulletPoints.map((bulletPoint) => t(bulletPoint)),
|
|
37
|
+
} })), showTravelCardNumber && ((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 || '', isRequired: true, errorMessage: state.context.errorMessages['travelCardNumber']?.[0], onChange: (e) => send({
|
|
28
38
|
type: 'ON_INPUT_CHANGE',
|
|
29
39
|
inputName: 'travelCardNumber',
|
|
30
40
|
value: e.target.value,
|
|
31
|
-
})
|
|
41
|
+
}), modalContent: {
|
|
42
|
+
description: t(PageText.Contact.input.travelCardNumber.info),
|
|
43
|
+
} })), features?.includeOrderIdAndAmountInOtherTicketRefund && ((0, jsx_runtime_1.jsx)(components_1.Input, { id: "amount", label: t(PageText.Contact.input.amount.info), type: "text", name: "amount", value: state.context.amount || '', isRequired: true, errorMessage: state.context?.errorMessages['amount']?.[0], onChange: (e) => send({
|
|
44
|
+
type: 'ON_INPUT_CHANGE',
|
|
45
|
+
inputName: 'amount',
|
|
46
|
+
value: e.target.value,
|
|
47
|
+
}) })), (0, jsx_runtime_1.jsx)(components_1.Textarea, { id: "refundReason", description: t(PageText.Contact.input.refundReason.question), value: state.context.refundReason || '', isRequired: true, onChange: (e) => send({
|
|
32
48
|
type: 'ON_INPUT_CHANGE',
|
|
33
49
|
inputName: 'refundReason',
|
|
34
50
|
value: e.target.value,
|
|
35
51
|
}), error: state.context.errorMessages['refundReason']?.[0]
|
|
36
52
|
? t(state.context.errorMessages['refundReason']?.[0])
|
|
37
|
-
: undefined }), features?.enableFileUploads && ((0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "attachments", label: t(PageText.Contact.refund.refundTaxi.taxiReceipt.info), iconLabel: t(PageText.Contact.input.feedback.attachment.receipt), name: "attachments", onChange: (files) => {
|
|
53
|
+
: undefined }), features?.enableFileUploads && ((0, jsx_runtime_1.jsx)(components_1.FileInput, { id: "attachments", label: t(PageText.Contact.refund.refundTaxi.taxiReceipt.info), iconLabel: t(PageText.Contact.input.feedback.attachment.receipt), name: "attachments", isRequired: features?.enableRequiredAttachmentInOtherTicketRefund, onChange: (files) => {
|
|
38
54
|
send({
|
|
39
55
|
type: 'ON_INPUT_CHANGE',
|
|
40
56
|
inputName: 'attachments',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/residualValueOnTravelCard/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/refund/forms/residualValueOnTravelCard/index.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,yBAAyB,GAAI,MAAE,gCAwC3C,CAAC"}
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ResidualValueOnTravelCard = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const contact_module_css_1 = __importDefault(require("../../../contact.module.css"));
|
|
9
8
|
const link_1 = __importDefault(require("next/link"));
|
|
10
9
|
const typography_1 = require("../../../components/typography");
|
|
11
10
|
const translations_1 = require("../../../translations");
|
|
@@ -13,7 +12,7 @@ const components_1 = require("../../../components");
|
|
|
13
12
|
const ResidualValueOnTravelCard = ({}) => {
|
|
14
13
|
const PageText = (0, translations_1.usePageText)();
|
|
15
14
|
const { t } = (0, translations_1.useTranslation)();
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.residualValueOnTravelCard.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: (0, jsx_runtime_1.jsx)(link_1.default, {
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(components_1.Fieldset, { title: t(PageText.Contact.refund.residualValueOnTravelCard.title), children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: (0, jsx_runtime_1.jsx)(link_1.default, { href: t(PageText.Contact.refund.residualValueOnTravelCard.link.href), target: "_blank", rel: "noopener noreferrer", children: t(PageText.Contact.refund.residualValueOnTravelCard.link.text) }) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
17
16
|
.monthlyPayoutDetails) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m__strong", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
18
17
|
.automatedProcessNotice.note) }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(PageText.Contact.refund.residualValueOnTravelCard
|
|
19
18
|
.automatedProcessNotice.text) })] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/refund/index.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,aAAa,mCA2IlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/lib/refund/index.js
CHANGED
|
@@ -33,12 +33,21 @@ const RefundContent = () => {
|
|
|
33
33
|
errorPath,
|
|
34
34
|
includeOtherTicketTypeSelector: features?.includeOtherTicketTypeSelector !== false,
|
|
35
35
|
includeRefundDepartureInfo: features?.includeRefundDepartureInfo === true,
|
|
36
|
+
includeCustomerNumberAndPurchasePlatformInAppTicketRefund: features?.includeCustomerNumberAndPurchasePlatformInAppTicketRefund ===
|
|
37
|
+
true,
|
|
38
|
+
includeOrderIdAndAmountInOtherTicketRefund: features?.includeOrderIdAndAmountInOtherTicketRefund === true,
|
|
39
|
+
enableFileUploads: features?.enableFileUploads === true,
|
|
40
|
+
enableRequiredAttachmentInOtherTicketRefund: features?.enableRequiredAttachmentInOtherTicketRefund === true,
|
|
36
41
|
}), [
|
|
37
42
|
apiConfig.onSubmit,
|
|
38
43
|
successPath,
|
|
39
44
|
errorPath,
|
|
40
45
|
features?.includeOtherTicketTypeSelector,
|
|
41
46
|
features?.includeRefundDepartureInfo,
|
|
47
|
+
features?.includeCustomerNumberAndPurchasePlatformInAppTicketRefund,
|
|
48
|
+
features?.includeOrderIdAndAmountInOtherTicketRefund,
|
|
49
|
+
features?.enableFileUploads,
|
|
50
|
+
features?.enableRequiredAttachmentInOtherTicketRefund,
|
|
42
51
|
]);
|
|
43
52
|
const [state, send] = (0, react_1.useMachine)(machine);
|
|
44
53
|
const displaySubmitButton = state.context.formType &&
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PurchasePlatformType, TransportModeType, ReasonForTransportFailure, TicketType } from '../types';
|
|
2
2
|
import { Line } from '../server/journey-planner/validators';
|
|
3
3
|
import { InputErrorMessages } from '../validation';
|
|
4
|
-
import type {
|
|
4
|
+
import type { FormSlug } from '../modules/config/types';
|
|
5
5
|
export declare enum FormCategory {
|
|
6
6
|
RefundOfTicket = "refundOfTicket",
|
|
7
7
|
RefundAndTravelGuarantee = "refundAndTravelGuarantee",
|
|
@@ -27,6 +27,7 @@ export declare enum FormType {
|
|
|
27
27
|
WebshopTicketRefund = "webshopTicketRefund"
|
|
28
28
|
}
|
|
29
29
|
type SubmitInput = {
|
|
30
|
+
formType?: string;
|
|
30
31
|
firstName?: string;
|
|
31
32
|
lastName?: string;
|
|
32
33
|
email?: string;
|
|
@@ -96,6 +97,10 @@ export type RefundContextProps = {
|
|
|
96
97
|
hasInternationalBankAccount: boolean;
|
|
97
98
|
includeOtherTicketTypeSelector: boolean;
|
|
98
99
|
includeRefundDepartureInfo: boolean;
|
|
100
|
+
includeCustomerNumberAndPurchasePlatformInAppTicketRefund: boolean;
|
|
101
|
+
includeOrderIdAndAmountInOtherTicketRefund: boolean;
|
|
102
|
+
enableFileUploads: boolean;
|
|
103
|
+
enableRequiredAttachmentInOtherTicketRefund: boolean;
|
|
99
104
|
errorMessages: InputErrorMessages;
|
|
100
105
|
firstIncorrectErrorMessage?: string;
|
|
101
106
|
hasSubmissionError?: boolean;
|
|
@@ -105,8 +110,12 @@ export type MachinePaths = {
|
|
|
105
110
|
errorPath: string;
|
|
106
111
|
includeOtherTicketTypeSelector?: boolean;
|
|
107
112
|
includeRefundDepartureInfo?: boolean;
|
|
113
|
+
includeCustomerNumberAndPurchasePlatformInAppTicketRefund?: boolean;
|
|
114
|
+
includeOrderIdAndAmountInOtherTicketRefund?: boolean;
|
|
115
|
+
enableFileUploads?: boolean;
|
|
116
|
+
enableRequiredAttachmentInOtherTicketRefund?: boolean;
|
|
108
117
|
};
|
|
109
|
-
export declare function createRefundStateMachine(onSubmit: (
|
|
118
|
+
export declare function createRefundStateMachine(onSubmit: (slug: FormSlug, state: Record<string, unknown>) => Promise<Response>, paths?: Partial<MachinePaths>): import("xstate").StateMachine<RefundContextProps, {
|
|
110
119
|
type: "ON_INPUT_CHANGE";
|
|
111
120
|
inputName: "formType" | "kilometersDriven" | "fromAddress" | "toAddress" | "amount" | "reasonForTransportFailure" | "orderId" | "customerNumber" | "ticketType" | "travelCardNumber" | "refundReason" | "firstName" | "lastName" | "address" | "postalCode" | "city" | "email" | "phoneNumber" | "bankAccountNumber" | "IBAN" | "SWIFT" | "fromStop" | "toStop" | "date" | "plannedDepartureTime" | "tripId" | "feedback" | "attachments" | "isInitialAgreementChecked" | "hasInternationalBankAccount" | "showInputTravelCardNumber" | "bankCardDetails";
|
|
112
121
|
value: string | boolean | ReasonForTransportFailure | TicketType | Line["quays"][0] | File[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refundFormMachine.d.ts","sourceRoot":"","sources":["../../src/refund/refundFormMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,
|
|
1
|
+
{"version":3,"file":"refundFormMachine.d.ts","sourceRoot":"","sources":["../../src/refund/refundFormMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EAEX,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAWzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,oBAAY,YAAY;IACtB,cAAc,mBAAmB;IACjC,wBAAwB,6BAA6B;IACrD,yBAAyB,8BAA8B;IACvD,iBAAiB,sBAAsB;CACxC;AAED,oBAAY,gBAAgB;IAC1B,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;CACxC;AAED,oBAAY,wBAAwB;IAClC,UAAU,eAAe;IACzB,SAAS,cAAc;CACxB;AAED,oBAAY,QAAQ;IAClB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,yBAAyB,8BAA8B;IACvD,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB;CAC5C;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;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@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.refundStateMachine = exports.FormType = exports.RefundAndTravelGuarantee = exports.RefundTicketForm = exports.FormCategory = void 0;
|
|
4
4
|
exports.createRefundStateMachine = createRefundStateMachine;
|
|
5
|
+
const types_1 = require("../types");
|
|
5
6
|
const xstate_1 = require("xstate");
|
|
6
7
|
const validation_1 = require("../validation");
|
|
7
8
|
const utils_1 = require("../utils");
|
|
@@ -46,7 +47,7 @@ const setInitialAgreementAndFormType = (context, isChecked) => {
|
|
|
46
47
|
};
|
|
47
48
|
};
|
|
48
49
|
const setInputToValidate = (context) => {
|
|
49
|
-
const { formType, firstName, lastName, email, phoneNumber, address, postalCode, city, hasInternationalBankAccount, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, date, kilometersDriven, fromAddress, toAddress, plannedDepartureTime, reasonForTransportFailure, amount, attachments, orderId, ticketType, refundReason, includeOtherTicketTypeSelector, includeRefundDepartureInfo, } = context;
|
|
50
|
+
const { formType, firstName, lastName, email, phoneNumber, address, postalCode, city, hasInternationalBankAccount, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, date, kilometersDriven, fromAddress, toAddress, plannedDepartureTime, reasonForTransportFailure, amount, attachments, orderId, ticketType, refundReason, includeOtherTicketTypeSelector, includeRefundDepartureInfo, includeCustomerNumberAndPurchasePlatformInAppTicketRefund, customerNumber, purchasePlatform, includeOrderIdAndAmountInOtherTicketRefund, enableFileUploads, enableRequiredAttachmentInOtherTicketRefund, } = context;
|
|
50
51
|
const commonFields = {
|
|
51
52
|
formType,
|
|
52
53
|
transportMode,
|
|
@@ -82,6 +83,9 @@ const setInputToValidate = (context) => {
|
|
|
82
83
|
city,
|
|
83
84
|
email,
|
|
84
85
|
phoneNumber,
|
|
86
|
+
...(includeCustomerNumberAndPurchasePlatformInAppTicketRefund
|
|
87
|
+
? { customerNumber, purchasePlatform }
|
|
88
|
+
: {}),
|
|
85
89
|
...(includeRefundDepartureInfo
|
|
86
90
|
? {
|
|
87
91
|
transportMode,
|
|
@@ -96,6 +100,9 @@ const setInputToValidate = (context) => {
|
|
|
96
100
|
case FormType.OtherTicketRefund:
|
|
97
101
|
return {
|
|
98
102
|
formType,
|
|
103
|
+
...(includeOrderIdAndAmountInOtherTicketRefund
|
|
104
|
+
? { orderId, amount }
|
|
105
|
+
: {}),
|
|
99
106
|
...(includeOtherTicketTypeSelector ? { ticketType } : {}),
|
|
100
107
|
refundReason,
|
|
101
108
|
firstName,
|
|
@@ -105,7 +112,13 @@ const setInputToValidate = (context) => {
|
|
|
105
112
|
city,
|
|
106
113
|
email,
|
|
107
114
|
phoneNumber,
|
|
108
|
-
|
|
115
|
+
...(!includeOtherTicketTypeSelector ||
|
|
116
|
+
context.ticketType?.id === types_1.TicketTypeId.PeriodTicket
|
|
117
|
+
? { travelCardNumber: context.travelCardNumber }
|
|
118
|
+
: {}),
|
|
119
|
+
...(enableFileUploads && enableRequiredAttachmentInOtherTicketRefund
|
|
120
|
+
? { attachments }
|
|
121
|
+
: {}),
|
|
109
122
|
...(hasInternationalBankAccount
|
|
110
123
|
? { IBAN, SWIFT }
|
|
111
124
|
: { bankAccountNumber }),
|
|
@@ -171,6 +184,10 @@ function createRefundStateMachine(onSubmit, paths) {
|
|
|
171
184
|
const errorPath = paths?.errorPath ?? '/contact/error';
|
|
172
185
|
const includeOtherTicketTypeSelector = paths?.includeOtherTicketTypeSelector !== false;
|
|
173
186
|
const includeRefundDepartureInfo = paths?.includeRefundDepartureInfo === true;
|
|
187
|
+
const includeCustomerNumberAndPurchasePlatformInAppTicketRefund = paths?.includeCustomerNumberAndPurchasePlatformInAppTicketRefund === true;
|
|
188
|
+
const includeOrderIdAndAmountInOtherTicketRefund = paths?.includeOrderIdAndAmountInOtherTicketRefund === true;
|
|
189
|
+
const enableFileUploads = paths?.enableFileUploads === true;
|
|
190
|
+
const enableRequiredAttachmentInOtherTicketRefund = paths?.enableRequiredAttachmentInOtherTicketRefund === true;
|
|
174
191
|
return (0, xstate_1.setup)({
|
|
175
192
|
types: { context: {}, events: events_1.RefundFormEvents },
|
|
176
193
|
guards: {
|
|
@@ -319,6 +336,10 @@ function createRefundStateMachine(onSubmit, paths) {
|
|
|
319
336
|
hasInternationalBankAccount: false,
|
|
320
337
|
includeOtherTicketTypeSelector,
|
|
321
338
|
includeRefundDepartureInfo,
|
|
339
|
+
includeCustomerNumberAndPurchasePlatformInAppTicketRefund,
|
|
340
|
+
includeOrderIdAndAmountInOtherTicketRefund,
|
|
341
|
+
enableFileUploads,
|
|
342
|
+
enableRequiredAttachmentInOtherTicketRefund,
|
|
322
343
|
errorMessages: {},
|
|
323
344
|
},
|
|
324
345
|
on: {
|
|
@@ -455,6 +476,7 @@ function createRefundStateMachine(onSubmit, paths) {
|
|
|
455
476
|
invoke: {
|
|
456
477
|
src: 'submit',
|
|
457
478
|
input: ({ context }) => ({
|
|
479
|
+
formType: context?.formType,
|
|
458
480
|
transportMode: context?.transportMode,
|
|
459
481
|
line: (0, utils_1.getLineName)(context.line),
|
|
460
482
|
fromStop: context.fromStop?.name,
|
package/lib/server/index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export { getLines } from './journey-planner';
|
|
|
8
8
|
export { getEnturAuthorityId, EnturAuthority, } from './journey-planner/authority';
|
|
9
9
|
export { createLinesRouteHandler, type LinesRouteHandlerOptions, } from './lines-route-handler';
|
|
10
10
|
export { createDeparturesRouteHandler, type DeparturesRouteHandlerOptions, } from './departures-route-handler';
|
|
11
|
+
export { createSubmitRouteHandler, type SubmitRouteHandlerOptions, } from './submit-route-handler';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,uBAAuB,EACvB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,KAAK,6BAA6B,GACnC,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,mBAAmB,EACnB,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,uBAAuB,EACvB,KAAK,wBAAwB,GAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,KAAK,6BAA6B,GACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,wBAAwB,EACxB,KAAK,yBAAyB,GAC/B,MAAM,wBAAwB,CAAC"}
|
package/lib/server/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* API route handlers or server components.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.createDeparturesRouteHandler = exports.createLinesRouteHandler = exports.EnturAuthority = exports.getEnturAuthorityId = exports.getLines = void 0;
|
|
9
|
+
exports.createSubmitRouteHandler = exports.createDeparturesRouteHandler = exports.createLinesRouteHandler = exports.EnturAuthority = exports.getEnturAuthorityId = exports.getLines = void 0;
|
|
10
10
|
var journey_planner_1 = require("./journey-planner");
|
|
11
11
|
Object.defineProperty(exports, "getLines", { enumerable: true, get: function () { return journey_planner_1.getLines; } });
|
|
12
12
|
var authority_1 = require("./journey-planner/authority");
|
|
@@ -16,3 +16,5 @@ var lines_route_handler_1 = require("./lines-route-handler");
|
|
|
16
16
|
Object.defineProperty(exports, "createLinesRouteHandler", { enumerable: true, get: function () { return lines_route_handler_1.createLinesRouteHandler; } });
|
|
17
17
|
var departures_route_handler_1 = require("./departures-route-handler");
|
|
18
18
|
Object.defineProperty(exports, "createDeparturesRouteHandler", { enumerable: true, get: function () { return departures_route_handler_1.createDeparturesRouteHandler; } });
|
|
19
|
+
var submit_route_handler_1 = require("./submit-route-handler");
|
|
20
|
+
Object.defineProperty(exports, "createSubmitRouteHandler", { enumerable: true, get: function () { return submit_route_handler_1.createSubmitRouteHandler; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Next.js App Router handler for POST /api/contact/submit. Reads `$slug`
|
|
3
|
+
* from the JSON body, validates it, and forwards the rest of the body to the
|
|
4
|
+
* connector at that path via `request`.
|
|
5
|
+
*/
|
|
6
|
+
export type SubmitRouteHandlerOptions = {
|
|
7
|
+
/** Sends a request to the org's connector for the given slug path and body. */
|
|
8
|
+
request: (path: `/${string}`, init: RequestInit) => Promise<Response>;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { createSubmitRouteHandler } from '@mrfylke/contact-form/server';
|
|
14
|
+
* export const POST = createSubmitRouteHandler({
|
|
15
|
+
* request: (path, init) => fetch(`${process.env.CONNECTOR_URL}${path}`, init),
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function createSubmitRouteHandler(options: SubmitRouteHandlerOptions): (request: Request) => Promise<Response>;
|
|
20
|
+
//# sourceMappingURL=submit-route-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submit-route-handler.d.ts","sourceRoot":"","sources":["../../src/server/submit-route-handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,yBAAyB,GAAG;IACtC,+EAA+E;IAC/E,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,MAAM,EAAE,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CACvE,CAAC;AAEF;;;;;;;;GAQG;AAIH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,yBAAyB,GACjC,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CA4CzC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Next.js App Router handler for POST /api/contact/submit. Reads `$slug`
|
|
4
|
+
* from the JSON body, validates it, and forwards the rest of the body to the
|
|
5
|
+
* connector at that path via `request`.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.createSubmitRouteHandler = createSubmitRouteHandler;
|
|
9
|
+
/**
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { createSubmitRouteHandler } from '@mrfylke/contact-form/server';
|
|
13
|
+
* export const POST = createSubmitRouteHandler({
|
|
14
|
+
* request: (path, init) => fetch(`${process.env.CONNECTOR_URL}${path}`, init),
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
// Uses Response.json() rather than NextResponse: Turbopack strips
|
|
19
|
+
// `require("next/server")` from this package's compiled output when
|
|
20
|
+
// symlinked (https://github.com/vercel/next.js/issues/74062).
|
|
21
|
+
function createSubmitRouteHandler(options) {
|
|
22
|
+
return async (request) => {
|
|
23
|
+
let body;
|
|
24
|
+
try {
|
|
25
|
+
body = await request.json();
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return Response.json({ message: 'Invalid JSON body' }, { status: 400 });
|
|
29
|
+
}
|
|
30
|
+
const { $slug, ...rest } = body;
|
|
31
|
+
if (typeof $slug !== 'string') {
|
|
32
|
+
return Response.json({ message: 'Missing $slug' }, { status: 400 });
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const response = await options.request(`/${$slug}`, {
|
|
36
|
+
method: 'POST',
|
|
37
|
+
headers: { 'Content-Type': 'application/json' },
|
|
38
|
+
body: JSON.stringify(rest),
|
|
39
|
+
});
|
|
40
|
+
const data = await response.json();
|
|
41
|
+
return Response.json(data, { status: response.status });
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error('[contact-form] submit route error:', error);
|
|
45
|
+
const status = typeof error === 'object' &&
|
|
46
|
+
error !== null &&
|
|
47
|
+
'status' in error &&
|
|
48
|
+
typeof error.status === 'number'
|
|
49
|
+
? error.status
|
|
50
|
+
: 500;
|
|
51
|
+
const message = typeof error === 'object' &&
|
|
52
|
+
error !== null &&
|
|
53
|
+
'data' in error &&
|
|
54
|
+
typeof error.data === 'object' &&
|
|
55
|
+
error.data !== null &&
|
|
56
|
+
'message' in error.data
|
|
57
|
+
? error.data.message
|
|
58
|
+
: 'Failed to submit form';
|
|
59
|
+
return Response.json({ message }, { status });
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feeComplaintForm.d.ts","sourceRoot":"","sources":["../../../src/ticket-control/forms/feeComplaintForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAgBpD,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE;QAAE,OAAO,EAAE,yBAAyB,CAAA;KAAE,CAAC;IAC9C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,uBAAuB,KAAK,IAAI,CAAC;CACvD,CAAC;
|
|
1
|
+
{"version":3,"file":"feeComplaintForm.d.ts","sourceRoot":"","sources":["../../../src/ticket-control/forms/feeComplaintForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAgBpD,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE;QAAE,OAAO,EAAE,yBAAyB,CAAA;KAAE,CAAC;IAC9C,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,uBAAuB,KAAK,IAAI,CAAC;CACvD,CAAC;AA2dF,eAAO,MAAM,gBAAgB,GAAI,iBAAiB,qBAAqB,gCAYtE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -38,11 +38,11 @@ const FormContent = ({ state, send }) => {
|
|
|
38
38
|
value: e.target.value,
|
|
39
39
|
}), modalContent: {
|
|
40
40
|
description: t(PageText.Contact.input.feeNumber.description),
|
|
41
|
-
} }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "feeDate", label: t(PageText.Contact.input.date.feeDate.label), isRequired: true, value: state.context.feeDate, onChange: (feeDate) => send({
|
|
41
|
+
} }), state.context.includeFeeDateInTicketControl && ((0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "feeDate", label: t(PageText.Contact.input.date.feeDate.label), isRequired: true, value: state.context.feeDate, onChange: (feeDate) => send({
|
|
42
42
|
type: 'ON_INPUT_CHANGE',
|
|
43
43
|
inputName: 'feeDate',
|
|
44
44
|
value: feeDate,
|
|
45
|
-
}), errorMessage: state.context?.errorMessages['feeDate']?.[0] }), (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
|
|
45
|
+
}), errorMessage: state.context?.errorMessages['feeDate']?.[0] })), (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
|
|
46
46
|
.title), name: "isAppTicketStorageMode", checked: state.context.isAppTicketStorageMode, onChange: () => send({
|
|
47
47
|
type: 'ON_INPUT_CHANGE',
|
|
48
48
|
inputName: 'isAppTicketStorageMode',
|
|
@@ -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,gCA0H1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -14,11 +14,11 @@ const PostponePaymentForm = ({ state, send, }) => {
|
|
|
14
14
|
value: e.target.value,
|
|
15
15
|
}), modalContent: {
|
|
16
16
|
description: t(PageText.Contact.input.feeNumber.description),
|
|
17
|
-
} }), (0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "feeDate", label: t(PageText.Contact.input.date.feeDate.label), isRequired: true, value: state.context.feeDate, onChange: (feeDate) => send({
|
|
17
|
+
} }), state.context.includeFeeDateInTicketControl && ((0, jsx_runtime_1.jsx)(components_1.DateSelector, { id: "feeDate", label: t(PageText.Contact.input.date.feeDate.label), isRequired: true, value: state.context.feeDate, onChange: (feeDate) => send({
|
|
18
18
|
type: 'ON_INPUT_CHANGE',
|
|
19
19
|
inputName: 'feeDate',
|
|
20
20
|
value: feeDate,
|
|
21
|
-
}), errorMessage: state.context?.errorMessages['feeDate']?.[0] }), (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({
|
|
21
|
+
}), errorMessage: state.context?.errorMessages['feeDate']?.[0] })), (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({
|
|
22
22
|
type: 'ON_INPUT_CHANGE',
|
|
23
23
|
inputName: 'invoiceNumber',
|
|
24
24
|
value: e.target.value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ticket-control/index.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ticket-control/index.tsx"],"names":[],"mappings":"AAmBA,QAAA,MAAM,wBAAwB,mCAuG7B,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
|
@@ -32,12 +32,14 @@ const TicketControlPageContent = () => {
|
|
|
32
32
|
errorPath,
|
|
33
33
|
includeBankAccountFields: features?.includeBankAccountFields !== false,
|
|
34
34
|
includeCustomerNumber: features?.includeCustomerNumberInFeeComplaint !== false,
|
|
35
|
+
includeFeeDateInTicketControl: features?.includeFeeDateInTicketControl === true,
|
|
35
36
|
}), [
|
|
36
37
|
apiConfig.onSubmit,
|
|
37
38
|
successPath,
|
|
38
39
|
errorPath,
|
|
39
40
|
features?.includeBankAccountFields,
|
|
40
41
|
features?.includeCustomerNumberInFeeComplaint,
|
|
42
|
+
features?.includeFeeDateInTicketControl,
|
|
41
43
|
]);
|
|
42
44
|
const [state, send] = (0, react_1.useMachine)(machine);
|
|
43
45
|
const displaySubmitButton = (state.context.formType === 'feeComplaint' &&
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Line } from '../server/journey-planner/validators';
|
|
2
2
|
import { InputErrorMessages } from '../validation';
|
|
3
3
|
import { TransportModeType } from '../types';
|
|
4
|
-
import type {
|
|
4
|
+
import type { FormSlug } from '../modules/config/types';
|
|
5
5
|
export declare enum FormType {
|
|
6
6
|
FeeComplaint = "feeComplaint",
|
|
7
7
|
Feedback = "feedback",
|
|
8
8
|
PostponePayment = "postponePayment"
|
|
9
9
|
}
|
|
10
10
|
type SubmitInput = {
|
|
11
|
+
formType?: string;
|
|
11
12
|
feeNumber?: string;
|
|
12
13
|
feeDate?: string;
|
|
13
14
|
appPhoneNumber?: string;
|
|
@@ -67,6 +68,7 @@ export type TicketControlContextProps = {
|
|
|
67
68
|
hasInternationalBankAccount: boolean;
|
|
68
69
|
includeBankAccountFields: boolean;
|
|
69
70
|
includeCustomerNumber: boolean;
|
|
71
|
+
includeFeeDateInTicketControl: boolean;
|
|
70
72
|
errorMessages: InputErrorMessages;
|
|
71
73
|
firstErrorMessage?: string;
|
|
72
74
|
hasSubmissionError?: boolean;
|
|
@@ -78,8 +80,9 @@ export type MachinePaths = {
|
|
|
78
80
|
export type MachineOptions = MachinePaths & {
|
|
79
81
|
includeBankAccountFields?: boolean;
|
|
80
82
|
includeCustomerNumber?: boolean;
|
|
83
|
+
includeFeeDateInTicketControl?: boolean;
|
|
81
84
|
};
|
|
82
|
-
export declare function createTicketControlFormMachine(onSubmit: (
|
|
85
|
+
export declare function createTicketControlFormMachine(onSubmit: (slug: FormSlug, state: Record<string, unknown>) => Promise<Response>, paths?: Partial<MachineOptions>): import("xstate").StateMachine<TicketControlContextProps, {
|
|
83
86
|
type: "ON_INPUT_CHANGE";
|
|
84
87
|
inputName: "formType" | "feeNumber" | "feeDate" | "invoiceNumber" | "appPhoneNumber" | "customerNumber" | "travelCardNumber" | "isAppTicketStorageMode" | "agreesFirstAgreement" | "agreesSecondAgreement" | "hasInternationalBankAccount" | "dateOfTicketControl" | "timeOfTicketControl";
|
|
85
88
|
value: string | boolean | undefined;
|
|
@@ -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,
|
|
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,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,oBAAY,QAAQ;IAClB,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,eAAe,oBAAoB;CACpC;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAA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M,cAAc,GAAG,YAAY,GAAG;IAC1C,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC,CAAC;AAEF,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,CACR,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,QAAQ,CAAC,EACtB,KAAK,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+PhC;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOpC,CAAC"}
|
|
@@ -21,12 +21,12 @@ 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, feeDate, feedback, phoneNumber, invoiceNumber, appPhoneNumber, customerNumber, travelCardNumber, address, postalCode, city, hasInternationalBankAccount, includeBankAccountFields, includeCustomerNumber, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, dateOfTicketControl, timeOfTicketControl, isAppTicketStorageMode, } = context;
|
|
24
|
+
const { formType, firstName, lastName, email, feeNumber, feeDate, feedback, phoneNumber, invoiceNumber, appPhoneNumber, customerNumber, travelCardNumber, address, postalCode, city, hasInternationalBankAccount, includeBankAccountFields, includeCustomerNumber, includeFeeDateInTicketControl, bankAccountNumber, IBAN, SWIFT, transportMode, line, fromStop, toStop, dateOfTicketControl, timeOfTicketControl, isAppTicketStorageMode, } = context;
|
|
25
25
|
switch (formType) {
|
|
26
26
|
case FormType.FeeComplaint:
|
|
27
27
|
return {
|
|
28
28
|
feeNumber,
|
|
29
|
-
feeDate,
|
|
29
|
+
...(includeFeeDateInTicketControl ? { feeDate } : {}),
|
|
30
30
|
feedback,
|
|
31
31
|
firstName,
|
|
32
32
|
lastName,
|
|
@@ -60,7 +60,14 @@ const setInputsToValidate = (context) => {
|
|
|
60
60
|
email,
|
|
61
61
|
};
|
|
62
62
|
case FormType.PostponePayment:
|
|
63
|
-
return {
|
|
63
|
+
return {
|
|
64
|
+
feeNumber,
|
|
65
|
+
...(includeFeeDateInTicketControl ? { feeDate } : {}),
|
|
66
|
+
invoiceNumber,
|
|
67
|
+
firstName,
|
|
68
|
+
lastName,
|
|
69
|
+
email,
|
|
70
|
+
};
|
|
64
71
|
}
|
|
65
72
|
};
|
|
66
73
|
function createTicketControlFormMachine(onSubmit, paths) {
|
|
@@ -68,6 +75,7 @@ function createTicketControlFormMachine(onSubmit, paths) {
|
|
|
68
75
|
const errorPath = paths?.errorPath ?? '/contact/error';
|
|
69
76
|
const includeBankAccountFields = paths?.includeBankAccountFields !== false;
|
|
70
77
|
const includeCustomerNumber = paths?.includeCustomerNumber !== false;
|
|
78
|
+
const includeFeeDateInTicketControl = paths?.includeFeeDateInTicketControl === true;
|
|
71
79
|
return (0, xstate_1.setup)({
|
|
72
80
|
types: {
|
|
73
81
|
context: {},
|
|
@@ -167,7 +175,7 @@ function createTicketControlFormMachine(onSubmit, paths) {
|
|
|
167
175
|
...input,
|
|
168
176
|
attachments: base64EncodedAttachments,
|
|
169
177
|
};
|
|
170
|
-
const response = await onSubmit('
|
|
178
|
+
const response = await onSubmit('ticket-control', state);
|
|
171
179
|
if (!response.ok)
|
|
172
180
|
throw new Error('Failed to call API');
|
|
173
181
|
return response.ok;
|
|
@@ -182,6 +190,7 @@ function createTicketControlFormMachine(onSubmit, paths) {
|
|
|
182
190
|
hasInternationalBankAccount: false,
|
|
183
191
|
includeBankAccountFields,
|
|
184
192
|
includeCustomerNumber,
|
|
193
|
+
includeFeeDateInTicketControl,
|
|
185
194
|
isAppTicketStorageMode: true,
|
|
186
195
|
errorMessages: {},
|
|
187
196
|
},
|
|
@@ -244,6 +253,7 @@ function createTicketControlFormMachine(onSubmit, paths) {
|
|
|
244
253
|
invoke: {
|
|
245
254
|
src: 'submit',
|
|
246
255
|
input: ({ context }) => ({
|
|
256
|
+
formType: context.formType,
|
|
247
257
|
feeNumber: context.feeNumber,
|
|
248
258
|
feeDate: context.feeDate,
|
|
249
259
|
appPhoneNumber: context.appPhoneNumber,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderTravelCard.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/orderTravelCard.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"orderTravelCard.d.ts","sourceRoot":"","sources":["../../../../src/ticketing/forms/travel-card/orderTravelCard.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB,mCAsC/B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -13,7 +13,7 @@ const link_1 = __importDefault(require("next/link"));
|
|
|
13
13
|
const OrderTravelCardForm = () => {
|
|
14
14
|
const { t } = (0, translations_1.useTranslation)();
|
|
15
15
|
return ((0, jsx_runtime_1.jsx)(components_1.Fieldset, { title: t(translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard.label), children: (0, jsx_runtime_1.jsxs)("ul", { className: contact_module_css_1.default.rules__list, children: [translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard.detailsList.map((paragraph, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(paragraph) }) }, `info-paragraph-${index}`))), (0, jsx_runtime_1.jsxs)("li", { children: [t(translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard.detailWithUrl
|
|
16
|
-
.detail), ' ', (0, jsx_runtime_1.jsx)(link_1.default, {
|
|
16
|
+
.detail), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { href: t(translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard
|
|
17
17
|
.detailWithUrl.href), target: "_blank", rel: "noopener noreferrer", children: t(translations_1.PageText.Contact.ticketing.travelCard.orderTravelCard
|
|
18
18
|
.detailWithUrl.linkText) }), "."] })] }) }));
|
|
19
19
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputErrorMessages } from '../validation';
|
|
2
2
|
import { TicketType } from '../types';
|
|
3
|
-
import type {
|
|
3
|
+
import type { FormSlug } from '../modules/config/types';
|
|
4
4
|
export declare enum FormCategory {
|
|
5
5
|
PriceAndTicketTypes = "priceAndTicketTypes",
|
|
6
6
|
App = "app",
|
|
@@ -68,7 +68,7 @@ export type MachinePaths = {
|
|
|
68
68
|
successPath: string;
|
|
69
69
|
errorPath: string;
|
|
70
70
|
};
|
|
71
|
-
export declare function createTicketingStateMachine(onSubmit: (
|
|
71
|
+
export declare function createTicketingStateMachine(onSubmit: (slug: FormSlug, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<TicketingContextType, {
|
|
72
72
|
type: "VALIDATE";
|
|
73
73
|
} | {
|
|
74
74
|
type: "ON_INPUT_CHANGE";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ticketingStateMachine.d.ts","sourceRoot":"","sources":["../../src/ticketing/ticketingStateMachine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAOzE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ticketingStateMachine.d.ts","sourceRoot":"","sources":["../../src/ticketing/ticketingStateMachine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOjC,CAAC"}
|
|
@@ -11,6 +11,7 @@ export declare const DEFAULT_LANGUAGE_STRING = "no";
|
|
|
11
11
|
export declare const FALLBACK_LANGUAGE = Language.English;
|
|
12
12
|
export type TranslatedString = Translatable<typeof Language, string>;
|
|
13
13
|
export type TranslateFunction = TFunc<typeof Language>;
|
|
14
|
+
export declare function translation(invariant: string): TranslatedString;
|
|
14
15
|
export declare function translation(norwegian: string, english: string, nynorsk: string): TranslatedString;
|
|
15
16
|
export declare function isTranslatedString(a: any): a is TranslatedString;
|
|
16
17
|
export type LocalizedString = {
|