@licklist/design 0.75.1-dev.5 → 0.75.1-dev.7
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/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
- package/dist/events/edit-event-modal/IntervalInput.js +12 -2
- package/dist/events/edit-event-modal/hooks/useValidationOptions.d.ts +6 -2
- package/dist/events/edit-event-modal/hooks/useValidationOptions.d.ts.map +1 -1
- package/dist/events/edit-event-modal/hooks/useValidationOptions.js +16 -5
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts +2 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts.map +1 -1
- package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +2 -1
- package/dist/iframe/payment/payment-status-page/component/PaymentStatusBody.d.ts +2 -1
- package/dist/iframe/payment/payment-status-page/component/PaymentStatusBody.d.ts.map +1 -1
- package/dist/iframe/payment/payment-status-page/component/PaymentStatusBody.js +2 -1
- package/dist/iframe/payment/status-body/StatusBody.d.ts +2 -1
- package/dist/iframe/payment/status-body/StatusBody.d.ts.map +1 -1
- package/dist/iframe/payment/status-body/StatusBody.js +15 -1
- package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/utils.js +6 -2
- package/dist/zone/form/components/DescriptionControl.js +1 -1
- package/package.json +1 -1
- package/src/events/edit-event-modal/IntervalInput.tsx +11 -1
- package/src/events/edit-event-modal/hooks/useValidationOptions.tsx +26 -9
- package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +3 -0
- package/src/iframe/payment/payment-status-page/component/PaymentStatusBody.tsx +3 -0
- package/src/iframe/payment/status-body/StatusBody.tsx +8 -1
- package/src/recurring-date-picker-input/utils.ts +5 -2
- package/src/zone/form/components/DescriptionControl.tsx +1 -1
- package/yarn.lock +413 -369
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntervalInput.d.ts","sourceRoot":"","sources":["../../../src/events/edit-event-modal/IntervalInput.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAA;AAIxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG7D,UAAU,kBAAkB;IAC1B,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAyB,EACzB,YAAoB,EACrB,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"IntervalInput.d.ts","sourceRoot":"","sources":["../../../src/events/edit-event-modal/IntervalInput.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,6DAA6D,CAAA;AAIxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAG7D,UAAU,kBAAkB;IAC1B,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAyB,EACzB,YAAoB,EACrB,EAAE,kBAAkB,2CA4KpB"}
|
|
@@ -111,14 +111,14 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
111
111
|
}
|
|
112
112
|
function IntervalInput(param) {
|
|
113
113
|
var _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, editedProductSet = param.editedProductSet, productSetId = param.productSetId, productSets = param.productSets, _param_disabledRecurrent = param.disabledRecurrent, disabledRecurrent = _param_disabledRecurrent === void 0 ? false : _param_disabledRecurrent, _param_isCopyCreate = param.isCopyCreate, isCopyCreate = _param_isCopyCreate === void 0 ? false : _param_isCopyCreate;
|
|
114
|
-
var _errors_start, _errors_end;
|
|
114
|
+
var _errors_start, _errors_end, _errors_end1;
|
|
115
115
|
var t = useTranslation([
|
|
116
116
|
'Design',
|
|
117
117
|
'Validation'
|
|
118
118
|
]).t;
|
|
119
119
|
var _useFormContext = useFormContext(), register = _useFormContext.register, errors = _useFormContext.formState.errors, control = _useFormContext.control, trigger = _useFormContext.trigger, setValue = _useFormContext.setValue;
|
|
120
120
|
var formattedDuration = useFormattedDuration();
|
|
121
|
-
var validationOptions = useValidationOptions();
|
|
121
|
+
var validationOptions = useValidationOptions({});
|
|
122
122
|
var rrule = useWatch({
|
|
123
123
|
control: control,
|
|
124
124
|
name: 'rrule'
|
|
@@ -182,6 +182,12 @@ function IntervalInput(param) {
|
|
|
182
182
|
setValue('rrule', null);
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
|
+
useEffect(function() {
|
|
186
|
+
if (!start) return;
|
|
187
|
+
trigger('end');
|
|
188
|
+
}, [
|
|
189
|
+
start
|
|
190
|
+
]);
|
|
185
191
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
186
192
|
children: [
|
|
187
193
|
/*#__PURE__*/ jsxs(Form.Row, {
|
|
@@ -250,6 +256,10 @@ function IntervalInput(param) {
|
|
|
250
256
|
children: formattedDuration && "lasts ".concat(formattedDuration)
|
|
251
257
|
})
|
|
252
258
|
]
|
|
259
|
+
}),
|
|
260
|
+
/*#__PURE__*/ jsx(Form.Control.Feedback, {
|
|
261
|
+
type: "invalid",
|
|
262
|
+
children: (_errors_end1 = errors.end) === null || _errors_end1 === void 0 ? void 0 : _errors_end1.message
|
|
253
263
|
})
|
|
254
264
|
]
|
|
255
265
|
}),
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
interface useValidationOptionsProps {
|
|
2
|
+
maxDurationExceeded?: number;
|
|
3
|
+
}
|
|
4
|
+
export declare const useValidationOptions: ({ maxDurationExceeded }: useValidationOptionsProps) => {
|
|
2
5
|
start: {
|
|
3
6
|
required: string;
|
|
4
7
|
};
|
|
5
8
|
end: {
|
|
6
9
|
required: string;
|
|
7
|
-
validate: (value:
|
|
10
|
+
validate: (value: string) => string | true;
|
|
8
11
|
};
|
|
9
12
|
};
|
|
13
|
+
export {};
|
|
10
14
|
//# sourceMappingURL=useValidationOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useValidationOptions.d.ts","sourceRoot":"","sources":["../../../../src/events/edit-event-modal/hooks/useValidationOptions.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB;;
|
|
1
|
+
{"version":3,"file":"useValidationOptions.d.ts","sourceRoot":"","sources":["../../../../src/events/edit-event-modal/hooks/useValidationOptions.tsx"],"names":[],"mappings":"AAIA,UAAU,yBAAyB;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,eAAO,MAAM,oBAAoB,4BAAkC,yBAAyB;;kBAUhF,MAAM;;;kBAMN,MAAM;0BACM,MAAM;;CAsB7B,CAAA"}
|
|
@@ -2,7 +2,8 @@ import { DateTime } from 'luxon';
|
|
|
2
2
|
import { useFormContext, useWatch } from 'react-hook-form';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
|
|
5
|
-
var useValidationOptions = function() {
|
|
5
|
+
var useValidationOptions = function(param) {
|
|
6
|
+
var _param_maxDurationExceeded = param.maxDurationExceeded, maxDurationExceeded = _param_maxDurationExceeded === void 0 ? 24 : _param_maxDurationExceeded;
|
|
6
7
|
var control = useFormContext().control;
|
|
7
8
|
var t = useTranslation([
|
|
8
9
|
'Design',
|
|
@@ -22,11 +23,21 @@ var useValidationOptions = function() {
|
|
|
22
23
|
required: t('Validation:fieldRequired', {
|
|
23
24
|
attribute: t('end')
|
|
24
25
|
}),
|
|
25
|
-
// TODO: uncomment when event splitting is implemented
|
|
26
|
-
// and extract into plugins
|
|
27
26
|
validate: function(value) {
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
if (!value || !start) return true;
|
|
28
|
+
var startDt = DateTime.fromISO(start);
|
|
29
|
+
var endDt = DateTime.fromISO(value);
|
|
30
|
+
var diffMillis = endDt.diff(startDt).toMillis();
|
|
31
|
+
if (diffMillis <= 0) {
|
|
32
|
+
return t('Validation:fieldValidEventEnd');
|
|
33
|
+
}
|
|
34
|
+
var maxDurationExceededHours = maxDurationExceeded * 60 * 60 * 1000;
|
|
35
|
+
if (diffMillis > maxDurationExceededHours) {
|
|
36
|
+
return t('Design:eventMaxDurationExceeded', {
|
|
37
|
+
maxHours: maxDurationExceeded
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
30
41
|
}
|
|
31
42
|
}
|
|
32
43
|
};
|
|
@@ -17,8 +17,9 @@ interface PaymentStatusComponentProps {
|
|
|
17
17
|
showCloseButton?: boolean;
|
|
18
18
|
email?: string;
|
|
19
19
|
totalAmount?: number;
|
|
20
|
+
getBookingPDF?: () => Promise<void>;
|
|
20
21
|
paymentMetadata?: PaymentMetadata;
|
|
21
22
|
}
|
|
22
|
-
export declare const PaymentStatusPage: ({ onCloseWindow, onBack, onTryAgain, isLoading, status, isAppUsingInIframe, bookingSummaryProps, EventCardComponent, showCloseButton, email, totalAmount, paymentMetadata, }: PaymentStatusComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const PaymentStatusPage: ({ onCloseWindow, onBack, onTryAgain, isLoading, status, getBookingPDF, isAppUsingInIframe, bookingSummaryProps, EventCardComponent, showCloseButton, email, totalAmount, paymentMetadata, }: PaymentStatusComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
export {};
|
|
24
25
|
//# sourceMappingURL=PaymentStatusPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentStatusPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-status-page/PaymentStatusPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAA;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAG7D,eAAO,MAAM,mBAAmB,WAAW,CAAA;AAC3C,eAAO,MAAM,oBAAoB,YAAY,CAAA;AAC7C,eAAO,MAAM,oBAAoB,YAAY,CAAA;AAE7C,MAAM,MAAM,WAAW,GACnB,OAAO,oBAAoB,GAC3B,OAAO,mBAAmB,GAC1B,OAAO,oBAAoB,CAAA;AAE/B,UAAU,2BAA2B;IACnC,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,WAAW,CAAA;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;IACzC,kBAAkB,CAAC,EAAE,SAAS,CAAA;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,eAAe,CAAA;CAClC;AASD,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"PaymentStatusPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-status-page/PaymentStatusPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAQjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAA;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAG7D,eAAO,MAAM,mBAAmB,WAAW,CAAA;AAC3C,eAAO,MAAM,oBAAoB,YAAY,CAAA;AAC7C,eAAO,MAAM,oBAAoB,YAAY,CAAA;AAE7C,MAAM,MAAM,WAAW,GACnB,OAAO,oBAAoB,GAC3B,OAAO,mBAAmB,GAC1B,OAAO,oBAAoB,CAAA;AAE/B,UAAU,2BAA2B;IACnC,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,WAAW,CAAA;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;IACzC,kBAAkB,CAAC,EAAE,SAAS,CAAA;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,eAAe,CAAC,EAAE,eAAe,CAAA;CAClC;AASD,eAAO,MAAM,iBAAiB,gMAc3B,2BAA2B,4CAkI7B,CAAA"}
|
|
@@ -60,7 +60,7 @@ var _obj;
|
|
|
60
60
|
var titles = (_obj = {}, _define_property(_obj, ORDER_STATUS_SUCCESS, 'purchaseSuccessful'), _define_property(_obj, ORDER_STATUS_PENDING, 'pendingPayment'), _define_property(_obj, ORDER_STATUS_FAILED, 'purchaseFailed'), _obj);
|
|
61
61
|
// @TODO In future think, how to reuse this component in Iframe Pending, Success and Failed Pages
|
|
62
62
|
var PaymentStatusPage = function(param) {
|
|
63
|
-
var onCloseWindow = param.onCloseWindow, onBack = param.onBack, onTryAgain = param.onTryAgain, isLoading = param.isLoading, status = param.status, isAppUsingInIframe = param.isAppUsingInIframe, bookingSummaryProps = param.bookingSummaryProps, EventCardComponent = param.EventCardComponent, _param_showCloseButton = param.showCloseButton, showCloseButton = _param_showCloseButton === void 0 ? false : _param_showCloseButton, email = param.email, _param_totalAmount = param.totalAmount, totalAmount = _param_totalAmount === void 0 ? 0 : _param_totalAmount, paymentMetadata = param.paymentMetadata;
|
|
63
|
+
var onCloseWindow = param.onCloseWindow, onBack = param.onBack, onTryAgain = param.onTryAgain, isLoading = param.isLoading, status = param.status, getBookingPDF = param.getBookingPDF, isAppUsingInIframe = param.isAppUsingInIframe, bookingSummaryProps = param.bookingSummaryProps, EventCardComponent = param.EventCardComponent, _param_showCloseButton = param.showCloseButton, showCloseButton = _param_showCloseButton === void 0 ? false : _param_showCloseButton, email = param.email, _param_totalAmount = param.totalAmount, totalAmount = _param_totalAmount === void 0 ? 0 : _param_totalAmount, paymentMetadata = param.paymentMetadata;
|
|
64
64
|
var t = useTranslation('Design').t;
|
|
65
65
|
if (isLoading) return /*#__PURE__*/ jsx(LoaderIndicator, {
|
|
66
66
|
isLoaded: false
|
|
@@ -97,6 +97,7 @@ var PaymentStatusPage = function(param) {
|
|
|
97
97
|
EventCardComponent,
|
|
98
98
|
/*#__PURE__*/ jsx(PaymentStatusBody, {
|
|
99
99
|
status: status,
|
|
100
|
+
getBookingPDF: getBookingPDF,
|
|
100
101
|
onBack: onBack || onCloseWindow,
|
|
101
102
|
onTryAgain: onTryAgain,
|
|
102
103
|
email: email
|
|
@@ -2,9 +2,10 @@ import { OrderStatus } from '../PaymentStatusPage';
|
|
|
2
2
|
interface PaymentStatusBodyProps {
|
|
3
3
|
status: OrderStatus;
|
|
4
4
|
onBack: () => void;
|
|
5
|
+
getBookingPDF?: () => Promise<void>;
|
|
5
6
|
onTryAgain?: () => void;
|
|
6
7
|
email?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare const PaymentStatusBody: ({ status, onBack, onTryAgain, email, }: PaymentStatusBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const PaymentStatusBody: ({ status, onBack, onTryAgain, getBookingPDF, email, }: PaymentStatusBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=PaymentStatusBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentStatusBody.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/payment/payment-status-page/component/PaymentStatusBody.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,WAAW,EACZ,MAAM,sBAAsB,CAAA;AAG7B,UAAU,sBAAsB;IAC9B,MAAM,EAAE,WAAW,CAAA;IACnB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"PaymentStatusBody.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/payment/payment-status-page/component/PaymentStatusBody.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,WAAW,EACZ,MAAM,sBAAsB,CAAA;AAG7B,UAAU,sBAAsB;IAC9B,MAAM,EAAE,WAAW,CAAA;IACnB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,iBAAiB,0DAM3B,sBAAsB,4CAkBxB,CAAA"}
|
|
@@ -4,11 +4,12 @@ import { ORDER_STATUS_SUCCESS, ORDER_STATUS_PENDING } from '../PaymentStatusPage
|
|
|
4
4
|
import { StatusBody } from '../../status-body/StatusBody.js';
|
|
5
5
|
|
|
6
6
|
var PaymentStatusBody = function(param) {
|
|
7
|
-
var status = param.status, onBack = param.onBack, onTryAgain = param.onTryAgain, email = param.email;
|
|
7
|
+
var status = param.status, onBack = param.onBack, onTryAgain = param.onTryAgain, getBookingPDF = param.getBookingPDF, email = param.email;
|
|
8
8
|
var t = useTranslation('Design').t;
|
|
9
9
|
if (status === ORDER_STATUS_SUCCESS) {
|
|
10
10
|
return /*#__PURE__*/ jsx(StatusBody, {
|
|
11
11
|
onBack: onBack,
|
|
12
|
+
getBookingPDF: getBookingPDF,
|
|
12
13
|
title: t('orderConfirmationAndReceiptSendToYourEmail', {
|
|
13
14
|
email: email
|
|
14
15
|
})
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
interface StatusBodyProps {
|
|
2
2
|
onTryAgain?: () => void;
|
|
3
3
|
onBack: () => void;
|
|
4
|
+
getBookingPDF?: () => void;
|
|
4
5
|
title?: string;
|
|
5
6
|
}
|
|
6
|
-
export declare const StatusBody: ({ onTryAgain, onBack, title }: StatusBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const StatusBody: ({ onTryAgain, onBack, title, getBookingPDF }: StatusBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
8
9
|
//# sourceMappingURL=StatusBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBody.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/status-body/StatusBody.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusBody.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/status-body/StatusBody.tsx"],"names":[],"mappings":"AAIA,UAAU,eAAe;IACvB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,eAAO,MAAM,UAAU,iDAAkD,eAAe,4CAiBvF,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Button } from 'react-bootstrap';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
3
4
|
import { useTranslation } from 'react-i18next';
|
|
4
5
|
|
|
5
6
|
var StatusBody = function(param) {
|
|
6
|
-
var onTryAgain = param.onTryAgain, onBack = param.onBack, title = param.title;
|
|
7
|
+
var onTryAgain = param.onTryAgain, onBack = param.onBack, title = param.title, getBookingPDF = param.getBookingPDF;
|
|
7
8
|
var t = useTranslation('Design').t;
|
|
8
9
|
return /*#__PURE__*/ jsxs("div", {
|
|
9
10
|
className: "status-body-wrapper mt-4",
|
|
@@ -12,6 +13,19 @@ var StatusBody = function(param) {
|
|
|
12
13
|
className: "status-body-wrapper__text",
|
|
13
14
|
children: title
|
|
14
15
|
}),
|
|
16
|
+
getBookingPDF && /*#__PURE__*/ jsxs("div", {
|
|
17
|
+
className: "mt-2",
|
|
18
|
+
children: [
|
|
19
|
+
/*#__PURE__*/ jsx("p", {
|
|
20
|
+
className: "status-body-wrapper__text",
|
|
21
|
+
children: t('youCanDownload')
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsx(Link, {
|
|
24
|
+
onClick: getBookingPDF,
|
|
25
|
+
children: t('ticketDownloadLink')
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
}),
|
|
15
29
|
/*#__PURE__*/ jsxs("div", {
|
|
16
30
|
className: "d-flex buttons-wrapper",
|
|
17
31
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAA;AAGrF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEjD,eAAO,MAAM,sBAAsB,yBAGhC;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,SAAS,CAAA;CACrB,KAAG,OAWH,CAAA;AAED,MAAM,MAAM,kBAAkB,GAC1B,SAAS,CAAC,KAAK,GACf,SAAS,CAAC,MAAM,GAChB,SAAS,CAAC,OAAO,GACjB,SAAS,CAAC,MAAM,CAAA;AAEpB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,kBAAkB,CAAA;IACxB,SAAS,CAAC,EAAE,OAAO,EAAE,CAAA;IACrB,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,qBAAqB,qBAG/B;IACD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb,KAoEM,kBACN,CAAA;AAED,eAAO,MAAM,sBAAsB,cACtB,OAAO,EAAE,cACR,QAAQ,EAAE,GAAG,SAAS,YACxB,MAAM,KACf;IAED,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/recurring-date-picker-input/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAA;AAGrF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEjD,eAAO,MAAM,sBAAsB,yBAGhC;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,SAAS,CAAA;CACrB,KAAG,OAWH,CAAA;AAED,MAAM,MAAM,kBAAkB,GAC1B,SAAS,CAAC,KAAK,GACf,SAAS,CAAC,MAAM,GAChB,SAAS,CAAC,OAAO,GACjB,SAAS,CAAC,MAAM,CAAA;AAEpB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,kBAAkB,CAAA;IACxB,SAAS,CAAC,EAAE,OAAO,EAAE,CAAA;IACrB,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,qBAAqB,qBAG/B;IACD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb,KAoEM,kBACN,CAAA;AAED,eAAO,MAAM,sBAAsB,cACtB,OAAO,EAAE,cACR,QAAQ,EAAE,GAAG,SAAS,YACxB,MAAM,KACf;IAED,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAsFjC,CAAA"}
|
|
@@ -95,7 +95,9 @@ var useWorkHoursValidation = function() {
|
|
|
95
95
|
var intervalsByDay = workHours.map(function(workhour, index, self) {
|
|
96
96
|
var res = [];
|
|
97
97
|
var startTime = fromIso(workhour.start, timeZone);
|
|
98
|
-
var endTime = fromIso(workhour.end, timeZone)
|
|
98
|
+
var endTime = fromIso(workhour.end, timeZone).plus({
|
|
99
|
+
minute: 1
|
|
100
|
+
});
|
|
99
101
|
if (endTime > startTime) {
|
|
100
102
|
res.push(Interval.fromDateTimes(startTime, endTime));
|
|
101
103
|
} else {
|
|
@@ -140,7 +142,9 @@ var useWorkHoursValidation = function() {
|
|
|
140
142
|
return !interval.contains(time);
|
|
141
143
|
});
|
|
142
144
|
var attribute = notFittingIntervals.map(function(interval) {
|
|
143
|
-
return interval.toFormat('HH:mm')
|
|
145
|
+
return "".concat(interval.start.toFormat('HH:mm'), " - ").concat(interval.end.minus({
|
|
146
|
+
minutes: 1
|
|
147
|
+
}).toFormat('HH:mm'));
|
|
144
148
|
}).join(', ');
|
|
145
149
|
if (notFittingIntervalsByDay.length !== 0) {
|
|
146
150
|
return t('outsideWorkingHours', {
|
package/package.json
CHANGED
|
@@ -45,7 +45,7 @@ export function IntervalInput({
|
|
|
45
45
|
} = useFormContext<IntervalInputValues>()
|
|
46
46
|
|
|
47
47
|
const formattedDuration = useFormattedDuration()
|
|
48
|
-
const validationOptions = useValidationOptions()
|
|
48
|
+
const validationOptions = useValidationOptions({})
|
|
49
49
|
|
|
50
50
|
const rrule = useWatch({ control, name: 'rrule' })
|
|
51
51
|
const start = useWatch({ control, name: 'start' })
|
|
@@ -106,6 +106,12 @@ export function IntervalInput({
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (!start) return
|
|
111
|
+
|
|
112
|
+
trigger('end')
|
|
113
|
+
},[start])
|
|
114
|
+
|
|
109
115
|
return (
|
|
110
116
|
<>
|
|
111
117
|
<Form.Row className='interval-container'>
|
|
@@ -153,6 +159,10 @@ export function IntervalInput({
|
|
|
153
159
|
{formattedDuration && `lasts ${formattedDuration}`}
|
|
154
160
|
</Form.Text>
|
|
155
161
|
</Form.Group>
|
|
162
|
+
|
|
163
|
+
<Form.Control.Feedback type='invalid'>
|
|
164
|
+
{errors.end?.message}
|
|
165
|
+
</Form.Control.Feedback>
|
|
156
166
|
</Form.Row>
|
|
157
167
|
{start && (
|
|
158
168
|
<Form.Group controlId={recurrentId}>
|
|
@@ -2,9 +2,14 @@ import { DateTime } from 'luxon'
|
|
|
2
2
|
import { useFormContext, useWatch } from 'react-hook-form'
|
|
3
3
|
import { useTranslation } from 'react-i18next'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface useValidationOptionsProps {
|
|
6
|
+
maxDurationExceeded?: number
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const useValidationOptions = ({ maxDurationExceeded = 24 }: useValidationOptionsProps) => {
|
|
6
10
|
const { control } = useFormContext()
|
|
7
11
|
const { t } = useTranslation(['Design', 'Validation'])
|
|
12
|
+
|
|
8
13
|
const start = useWatch({ control, name: 'start' })
|
|
9
14
|
|
|
10
15
|
return {
|
|
@@ -18,14 +23,26 @@ export const useValidationOptions = () => {
|
|
|
18
23
|
required: t('Validation:fieldRequired', {
|
|
19
24
|
attribute: t('end'),
|
|
20
25
|
}) as string,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
value
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
validate: (value: string) => {
|
|
27
|
+
if (!value || !start) return true
|
|
28
|
+
|
|
29
|
+
const startDt = DateTime.fromISO(start)
|
|
30
|
+
const endDt = DateTime.fromISO(value)
|
|
31
|
+
const diffMillis = endDt.diff(startDt).toMillis()
|
|
32
|
+
|
|
33
|
+
if (diffMillis <= 0) {
|
|
34
|
+
return t('Validation:fieldValidEventEnd') as string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const maxDurationExceededHours = maxDurationExceeded * 60 * 60 * 1000
|
|
38
|
+
if (diffMillis > maxDurationExceededHours) {
|
|
39
|
+
return t('Design:eventMaxDurationExceeded', {
|
|
40
|
+
maxHours: maxDurationExceeded,
|
|
41
|
+
}) as string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return true
|
|
45
|
+
},
|
|
29
46
|
},
|
|
30
47
|
}
|
|
31
48
|
}
|
|
@@ -31,6 +31,7 @@ interface PaymentStatusComponentProps {
|
|
|
31
31
|
showCloseButton?: boolean
|
|
32
32
|
email?: string
|
|
33
33
|
totalAmount?: number
|
|
34
|
+
getBookingPDF?: () => Promise<void>
|
|
34
35
|
paymentMetadata?: PaymentMetadata
|
|
35
36
|
}
|
|
36
37
|
|
|
@@ -47,6 +48,7 @@ export const PaymentStatusPage = ({
|
|
|
47
48
|
onTryAgain,
|
|
48
49
|
isLoading,
|
|
49
50
|
status,
|
|
51
|
+
getBookingPDF,
|
|
50
52
|
isAppUsingInIframe,
|
|
51
53
|
bookingSummaryProps,
|
|
52
54
|
EventCardComponent,
|
|
@@ -106,6 +108,7 @@ export const PaymentStatusPage = ({
|
|
|
106
108
|
{EventCardComponent}
|
|
107
109
|
<PaymentStatusBody
|
|
108
110
|
status={status}
|
|
111
|
+
getBookingPDF={getBookingPDF}
|
|
109
112
|
onBack={onBack || onCloseWindow}
|
|
110
113
|
onTryAgain={onTryAgain}
|
|
111
114
|
email={email}
|
|
@@ -9,6 +9,7 @@ import { StatusBody } from '../../status-body/StatusBody'
|
|
|
9
9
|
interface PaymentStatusBodyProps {
|
|
10
10
|
status: OrderStatus
|
|
11
11
|
onBack: () => void
|
|
12
|
+
getBookingPDF?: () => Promise<void>
|
|
12
13
|
onTryAgain?: () => void
|
|
13
14
|
email?: string
|
|
14
15
|
}
|
|
@@ -17,6 +18,7 @@ export const PaymentStatusBody = ({
|
|
|
17
18
|
status,
|
|
18
19
|
onBack,
|
|
19
20
|
onTryAgain,
|
|
21
|
+
getBookingPDF,
|
|
20
22
|
email,
|
|
21
23
|
}: PaymentStatusBodyProps) => {
|
|
22
24
|
const { t } = useTranslation('Design')
|
|
@@ -25,6 +27,7 @@ export const PaymentStatusBody = ({
|
|
|
25
27
|
return (
|
|
26
28
|
<StatusBody
|
|
27
29
|
onBack={onBack}
|
|
30
|
+
getBookingPDF={getBookingPDF}
|
|
28
31
|
title={t('orderConfirmationAndReceiptSendToYourEmail', { email })}
|
|
29
32
|
/>
|
|
30
33
|
)
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { Button } from 'react-bootstrap'
|
|
2
|
+
import { Link } from 'react-router-dom'
|
|
2
3
|
import { useTranslation } from 'react-i18next'
|
|
3
4
|
|
|
4
5
|
interface StatusBodyProps {
|
|
5
6
|
onTryAgain?: () => void
|
|
6
7
|
onBack: () => void
|
|
8
|
+
getBookingPDF?: () => void
|
|
7
9
|
title?: string
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
export const StatusBody = ({ onTryAgain, onBack, title }: StatusBodyProps) => {
|
|
12
|
+
export const StatusBody = ({ onTryAgain, onBack, title, getBookingPDF }: StatusBodyProps) => {
|
|
11
13
|
const { t } = useTranslation('Design')
|
|
12
14
|
|
|
13
15
|
return (
|
|
14
16
|
<div className='status-body-wrapper mt-4'>
|
|
15
17
|
{title && <p className='status-body-wrapper__text'>{title}</p>}
|
|
18
|
+
{getBookingPDF && <div className='mt-2'>
|
|
19
|
+
<p className='status-body-wrapper__text'>{t('youCanDownload')}</p>
|
|
20
|
+
<Link onClick={getBookingPDF} >{t('ticketDownloadLink')}</Link>
|
|
21
|
+
</div>
|
|
22
|
+
}
|
|
16
23
|
<div className='d-flex buttons-wrapper'>
|
|
17
24
|
{onTryAgain && <Button onClick={onTryAgain}>{t('tryAgain')}</Button>}
|
|
18
25
|
<Button onClick={onBack}>{t('backToSite')}</Button>
|
|
@@ -144,7 +144,7 @@ export const useWorkHoursValidation = (
|
|
|
144
144
|
const res: Interval[] = []
|
|
145
145
|
|
|
146
146
|
const startTime = fromIso(workhour.start, timeZone)
|
|
147
|
-
const endTime = fromIso(workhour.end, timeZone)
|
|
147
|
+
const endTime = fromIso(workhour.end, timeZone).plus({ minute: 1 })
|
|
148
148
|
|
|
149
149
|
if (endTime > startTime) {
|
|
150
150
|
res.push(Interval.fromDateTimes(startTime, endTime))
|
|
@@ -194,7 +194,10 @@ export const useWorkHoursValidation = (
|
|
|
194
194
|
.filter((interval) => !interval.contains(time))
|
|
195
195
|
|
|
196
196
|
const attribute = notFittingIntervals
|
|
197
|
-
.map(
|
|
197
|
+
.map(
|
|
198
|
+
(interval) =>
|
|
199
|
+
`${interval.start.toFormat('HH:mm')} - ${interval.end.minus({ minutes: 1 }).toFormat('HH:mm')}`,
|
|
200
|
+
)
|
|
198
201
|
.join(', ')
|
|
199
202
|
|
|
200
203
|
if (notFittingIntervalsByDay.length !== 0) {
|