@licklist/design 0.59.0-dev.8 → 0.59.0
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/bitbucket-pipelines.yml +8 -0
- package/dist/calendar/Calendar.d.ts +1 -1
- package/dist/calendar/Calendar.d.ts.map +1 -1
- package/dist/calendar/Calendar.js +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts +2 -2
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +1 -3
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +1 -3
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +1 -3
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
- package/dist/iframe/activity-card/ActivityCard.d.ts +1 -2
- package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
- package/dist/iframe/activity-card/ActivityCard.js +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts +1 -2
- package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
- package/dist/iframe/page/components/PageBody/constants.d.ts +1 -1
- package/dist/iframe/page/components/PageBody/constants.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/constants.js +1 -1
- package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.js +1 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
- package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.d.ts +1 -3
- package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
- package/dist/iframe/ryft/utils/ryft-form.d.ts +1 -2
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.js +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
- package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
- package/dist/product-set/control/DateInput.d.ts.map +1 -1
- package/dist/product-set/control/DateInput.js +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +1 -4
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.d.ts.map +1 -1
- package/dist/product-set/product/ProductControl.js +1 -1
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts +0 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
- package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +1 -3
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
- package/dist/recurring-date-picker-input/utils.d.ts +0 -12
- package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/utils.js +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/booking/results/components/ResultCard.js +1 -1
- package/dist/sales/coupon/control/CouponFormControl.d.ts +1 -2
- package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
- package/dist/sales/coupon/control/CouponFormControl.js +1 -1
- package/dist/sales/coupon/form/CouponFrom.d.ts +2 -2
- package/dist/sales/coupon/form/CouponFrom.d.ts.map +1 -1
- package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
- package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
- package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
- package/dist/static/manual-date-picker/constants/index.d.ts +1 -4
- package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/constants/index.js +1 -1
- package/dist/static/manual-date-picker/utils/index.d.ts +0 -4
- package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/utils/index.js +1 -1
- package/dist/styles/activity-card/ListActivitiesCard.scss +1 -1
- package/dist/styles/iframe-events/Card.scss +8 -24
- package/dist/styles/iframe-events/PoweredBy.scss +2 -2
- package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -5
- package/dist/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
- package/dist/styles/iframe-page/Page.scss +0 -1
- package/dist/styles/iframe-page/PageBody.scss +9 -32
- package/dist/styles/iframe-page/PageHeader.scss +39 -41
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +113 -99
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/typeahead/Typeahead.d.ts +1 -2
- package/dist/typeahead/Typeahead.d.ts.map +1 -1
- package/dist/typeahead/Typeahead.js +1 -1
- package/dist/zone/form/ZoneForm.d.ts +2 -2
- package/dist/zone/form/ZoneForm.d.ts.map +1 -1
- package/dist/zone/form/ZoneForm.js +1 -1
- package/dist/zone/form/components/ZoneControl.d.ts +2 -2
- package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneControl.js +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
- package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
- package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
- package/dist/zone/form/utils/dates.d.ts.map +1 -1
- package/jest.config.js +29 -0
- package/package.json +35 -10
- package/src/calendar/Calendar.stories.tsx +0 -23
- package/src/calendar/Calendar.tsx +5 -5
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +5 -0
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +0 -4
- package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +8 -10
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +0 -4
- package/src/iframe/activity-card/ActivityCard.tsx +2 -4
- package/src/iframe/event/event-card/IframeEventCard.stories.tsx +0 -1
- package/src/iframe/event/event-card/IframeEventCard.tsx +8 -7
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +1 -1
- package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +1 -3
- package/src/iframe/page/components/PageBody/constants.ts +1 -1
- package/src/iframe/page/components/PageBody/hooks/useResizePageBody.ts +3 -3
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -6
- package/src/iframe/payment/payment-page/PaymentPage.tsx +2 -2
- package/src/iframe/ryft/RyftPaymentForm.tsx +3 -20
- package/src/iframe/ryft/utils/ryft-form.ts +5 -11
- package/src/product-set/control/DateAndRecurrenceInput.tsx +2 -3
- package/src/product-set/control/DateInput.tsx +5 -4
- package/src/product-set/control/ProductSetControl.tsx +1 -1
- package/src/product-set/form/ProductCategoriesControl.tsx +1 -1
- package/src/product-set/form/ProductSetForm.tsx +1 -5
- package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -2
- package/src/product-set/product/ProductControl.tsx +38 -38
- package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +2 -0
- package/src/product-set/product-category/ProductCategoryControl.tsx +27 -89
- package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +18 -4
- package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +1 -0
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -11
- package/src/recurring-date-picker-input/utils.ts +0 -77
- package/src/sales/booking/results/BookingResults.stories.tsx +2 -3
- package/src/sales/booking/results/components/ResultCard.tsx +5 -2
- package/src/sales/coupon/control/CouponFormControl.tsx +50 -29
- package/src/sales/coupon/form/CouponFrom.tsx +15 -5
- package/src/setting/admin/AdminSettingForm.tsx +2 -2
- package/src/sortable-tree/SortableTreeItem.tsx +1 -1
- package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
- package/src/static/manual-date-picker/constants/index.ts +2 -6
- package/src/static/manual-date-picker/utils/index.ts +0 -11
- package/src/static/switch/BooleanSwitch.tsx +1 -1
- package/src/styles/activity-card/ListActivitiesCard.scss +1 -1
- package/src/styles/iframe-events/Card.scss +8 -24
- package/src/styles/iframe-events/PoweredBy.scss +2 -2
- package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -5
- package/src/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
- package/src/styles/iframe-page/Page.scss +0 -1
- package/src/styles/iframe-page/PageBody.scss +9 -32
- package/src/styles/iframe-page/PageHeader.scss +39 -41
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +113 -99
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/typeahead/Typeahead.tsx +3 -16
- package/src/zone/form/ZoneForm.tsx +2 -3
- package/src/zone/form/components/ZoneControl.tsx +3 -3
- package/src/zone/form/components/ZoneRecurrencesControl.tsx +5 -7
- package/src/zone/form/utils/dates.ts +10 -9
- package/tests/Auth/Authorizer.test.tsx +194 -0
- package/tests/Auth/Layout/UserNavDropDown.test.tsx +43 -0
- package/tests/Auth/Layout/UserNavDropDownToggle.test.tsx +33 -0
- package/tests/Auth/Login/LoginComponent.test.tsx +246 -0
- package/tests/Auth/Login/LoginFormComponent.test.tsx +182 -0
- package/tests/Auth/Register/RegisterComponent.test.tsx +285 -0
- package/tests/Auth/Register/RegisterFormComponent.test.tsx +170 -0
- package/tests/Auth/Settings/Dashboard/IpInput.test.tsx +130 -0
- package/tests/Auth/Social/SocialCallbackComponent.test.tsx +133 -0
- package/tests/Auth/Social/SocialFormComponent.test.tsx +118 -0
- package/tests/FileUpload/FileUpload.test.tsx +42 -0
- package/tests/Notification/EmailTemplate.test.tsx +82 -0
- package/tests/ProductSet/ProductSetPopover.test.tsx +40 -0
- package/tests/Report/Report.test.tsx +48 -0
- package/tests/Sales/Coupon.test.tsx +51 -0
- package/tests/Sales/SalesAndVIews.test.tsx +63 -0
- package/tests/SnippetTemplates/SnippetTemplates.test.tsx +56 -0
- package/tests/Table/FilterHelperComponent.test.tsx +88 -0
- package/tests/Table/PaginationHelperComponent.test.tsx +109 -0
- package/tests/Table/PerPageHelperComponent.test.tsx +34 -0
- package/tests/Table/TableHelperComponent.test.tsx +295 -0
- package/tests/TipTapEditor/TipTapEditor.test.tsx +28 -0
- package/tests/__mock__/hooks/useAuthApi.ts +13 -0
- package/tests/__mock__/hooks/useAuthMock.ts +13 -0
- package/tests/__mock__/hooks/useFormMock.ts +27 -0
- package/tests/__mock__/hooks/useNotificationMock.ts +13 -0
- package/tests/__mock__/hooks/useQueryMock.ts +16 -0
- package/tests/__mock__/hooks/useSocialApiMock.ts +20 -0
- package/tests/__mock__/hooks/useTranslationMock.ts +17 -0
- package/tests/__mock__/hooks/useUserApiMock.ts +18 -0
- package/tests/__mock__/hooks/useUserMock.ts +13 -0
- package/tests/__mock__/styleMock.js +1 -0
- package/tests/__mock__/windowMock.ts +5 -0
- package/tests/packages/react-query.tsx +28 -0
- package/tests/setupTests.ts +10 -0
- package/dist/sales/coupon/utils/index.d.ts +0 -7
- package/dist/sales/coupon/utils/index.d.ts.map +0 -1
- package/dist/sales/coupon/utils/index.js +0 -1
- package/src/sales/coupon/utils/index.ts +0 -13
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
PAGE_LEFT_BLOCK_CONTAINER_ID,
|
|
17
17
|
PAGE_LEFT_BLOCK_MAP_DEFAULT_SIZE,
|
|
18
18
|
PAGE_CALENDAR_SELECT_WRAPPER,
|
|
19
|
-
|
|
19
|
+
PAYMENT_LINK_PAGE_BODY,
|
|
20
20
|
} from "../constants";
|
|
21
21
|
import { ChangeRightBlockHeightEvent } from "../types";
|
|
22
22
|
|
|
@@ -52,10 +52,10 @@ export const useResizePageBody = () => {
|
|
|
52
52
|
? calenderWrapper.clientHeight
|
|
53
53
|
: 0;
|
|
54
54
|
|
|
55
|
-
const paymentLinkPageBody = document.getElementById(
|
|
55
|
+
const paymentLinkPageBody = document.getElementById(PAYMENT_LINK_PAGE_BODY);
|
|
56
56
|
if (paymentLinkPageBody) {
|
|
57
57
|
paymentLinkPageBody.scroll({
|
|
58
|
-
top: -
|
|
58
|
+
top: -rightBlockHeight,
|
|
59
59
|
behavior: "smooth",
|
|
60
60
|
});
|
|
61
61
|
}
|
|
@@ -63,7 +63,7 @@ const processedPaymentSummary = ({
|
|
|
63
63
|
const total = calculateTotalPrice(order, externalPaymentDetail);
|
|
64
64
|
|
|
65
65
|
const totalDiscount = calculateTotalDiscount(order.payments);
|
|
66
|
-
|
|
66
|
+
const totalWithDiscount = total - Number(totalDiscount);
|
|
67
67
|
let summaryItems: SummaryItem[] = [
|
|
68
68
|
{
|
|
69
69
|
translateKey: AMOUNT_TOTAL,
|
|
@@ -74,7 +74,7 @@ const processedPaymentSummary = ({
|
|
|
74
74
|
if (totalDiscount) {
|
|
75
75
|
summaryItems.push({
|
|
76
76
|
translateKey: AMOUNT_WITH_DISCOUNT,
|
|
77
|
-
price:
|
|
77
|
+
price: totalWithDiscount < 0 ? 0 : totalWithDiscount,
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -84,17 +84,17 @@ const processedPaymentSummary = ({
|
|
|
84
84
|
|
|
85
85
|
summaryItems.push({
|
|
86
86
|
translateKey: TOTAL_PAID,
|
|
87
|
-
price: order.
|
|
87
|
+
price: totalWithDiscount <= 0 ? 0 : order.totalAmount,
|
|
88
88
|
});
|
|
89
|
-
if (
|
|
89
|
+
if (totalWithDiscount <= 0) {
|
|
90
90
|
return summaryItems;
|
|
91
91
|
}
|
|
92
92
|
summaryItems = [...summaryItems, ...externalPaymentDetail];
|
|
93
93
|
|
|
94
|
-
if (order.
|
|
94
|
+
if (totalWithDiscount > order.totalAmount) {
|
|
95
95
|
summaryItems.push({
|
|
96
96
|
translateKey: REMAINING_TO_PAY,
|
|
97
|
-
price: order.
|
|
97
|
+
price: totalWithDiscount - order.totalAmount,
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
return summaryItems;
|
|
@@ -16,7 +16,7 @@ import { PaymentTimer } from "./PaymentTimer";
|
|
|
16
16
|
import { Page, PageBody } from "../../page";
|
|
17
17
|
import { BookingSummary } from "../../order-process";
|
|
18
18
|
import { cartSumByOrderProducts } from "../../order-process/components/BookingSummary/utils";
|
|
19
|
-
import {
|
|
19
|
+
import { PAYMENT_LINK_PAGE_BODY } from "../../page/components/PageBody/constants";
|
|
20
20
|
|
|
21
21
|
export interface PaymentMetadata {
|
|
22
22
|
total: number;
|
|
@@ -126,7 +126,7 @@ export const PaymentPage = ({
|
|
|
126
126
|
onCloseButtonClick={isIframePayment ? onGoBack : undefined}
|
|
127
127
|
/> */}
|
|
128
128
|
<PageBody
|
|
129
|
-
id={
|
|
129
|
+
id={PAYMENT_LINK_PAGE_BODY}
|
|
130
130
|
leftBlock={
|
|
131
131
|
<PageBody.LeftBlock>
|
|
132
132
|
<div className="d-flex align-items-center mb-5">
|
|
@@ -12,8 +12,6 @@ import {
|
|
|
12
12
|
RYFT_STATUS_PENDING_ACTION,
|
|
13
13
|
AttemptPaymentResponse,
|
|
14
14
|
} from "@licklist/plugins/dist/hooks/Ryft/useRyftPayment";
|
|
15
|
-
import { ProviderPaymentSettings } from "@licklist/core/dist/DataMapper/Setting/ProviderPaymentSettingsDataMapper";
|
|
16
|
-
|
|
17
15
|
import { BlockLoader, ButtonLoader } from "../../static";
|
|
18
16
|
import { injectComponentsInRyftForm } from "./utils/ryft-form";
|
|
19
17
|
|
|
@@ -42,13 +40,11 @@ export interface RyftPaymentFormProps {
|
|
|
42
40
|
) => Promise<void>;
|
|
43
41
|
onSubmit: () => Promise<AttemptPaymentResponse>;
|
|
44
42
|
resetReferrer?: () => void;
|
|
45
|
-
providerPaymentSettings?: ProviderPaymentSettings;
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
export const RyftPaymentForm = ({
|
|
49
46
|
accountId,
|
|
50
47
|
isCreateLoading,
|
|
51
|
-
providerPaymentSettings,
|
|
52
48
|
initRyft,
|
|
53
49
|
resetReferrer,
|
|
54
50
|
onSubmit,
|
|
@@ -123,26 +119,13 @@ export const RyftPaymentForm = ({
|
|
|
123
119
|
};
|
|
124
120
|
|
|
125
121
|
useEffect(
|
|
126
|
-
() => {
|
|
127
|
-
if (
|
|
128
|
-
!formRef.current?.childNodes?.length ||
|
|
129
|
-
formRef.current?.childNodes?.length < 3 ||
|
|
130
|
-
!accountId.data?.account_id
|
|
131
|
-
) {
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
injectComponentsInRyftForm({
|
|
135
|
-
t,
|
|
136
|
-
additionalPaymentMethodsEnabled:
|
|
137
|
-
providerPaymentSettings?.additionalPaymentMethodsEnabled,
|
|
138
|
-
});
|
|
139
|
-
},
|
|
122
|
+
() => injectComponentsInRyftForm({ t }),
|
|
140
123
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
141
124
|
[formRef.current?.childNodes?.length]
|
|
142
125
|
);
|
|
143
126
|
|
|
144
127
|
useEffect(() => {
|
|
145
|
-
if (!accountId.data
|
|
128
|
+
if (!accountId.data || accountId.isError) return;
|
|
146
129
|
|
|
147
130
|
initRyft(
|
|
148
131
|
() => {
|
|
@@ -156,7 +139,7 @@ export const RyftPaymentForm = ({
|
|
|
156
139
|
);
|
|
157
140
|
|
|
158
141
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
159
|
-
}, [accountId.data
|
|
142
|
+
}, [accountId.data]);
|
|
160
143
|
|
|
161
144
|
if (accountId.isLoading || accountId.isFetching || isCreateLoading)
|
|
162
145
|
return (
|
|
@@ -2,18 +2,17 @@ import { TFunction } from "react-i18next";
|
|
|
2
2
|
|
|
3
3
|
export const injectComponentsInRyftForm = ({
|
|
4
4
|
t,
|
|
5
|
-
additionalPaymentMethodsEnabled,
|
|
6
5
|
}: {
|
|
7
6
|
t: TFunction<string[]>;
|
|
8
|
-
additionalPaymentMethodsEnabled?: boolean;
|
|
9
7
|
}) => {
|
|
10
8
|
const cardContainer = document.getElementById("ryft-pay-iframe");
|
|
9
|
+
const oldCardDividerContainer = document.getElementById(
|
|
10
|
+
"card-title-container"
|
|
11
|
+
);
|
|
11
12
|
|
|
12
|
-
if (!cardContainer) {
|
|
13
|
+
if (!cardContainer || oldCardDividerContainer) {
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
15
|
-
// Removing of the old title container
|
|
16
|
-
document.getElementById("card-title-container")?.remove();
|
|
17
16
|
|
|
18
17
|
const cardTitle = document.createElement("div");
|
|
19
18
|
const cardText = document.createElement("div");
|
|
@@ -27,14 +26,10 @@ export const injectComponentsInRyftForm = ({
|
|
|
27
26
|
|
|
28
27
|
const payGrid = document.getElementById("ryft-pay-grid");
|
|
29
28
|
|
|
30
|
-
if (!payGrid
|
|
29
|
+
if (!payGrid) {
|
|
31
30
|
return;
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
// Removing of the old mobile title container and divider container
|
|
35
|
-
document.getElementById("mobile-pay-title")?.remove();
|
|
36
|
-
document.getElementById("mobile-pay-divider-container")?.remove();
|
|
37
|
-
|
|
38
33
|
// Adding title and divider for apple and google pay button
|
|
39
34
|
const mobilePayTitle = document.createElement("div");
|
|
40
35
|
const dividerText = document.createElement("div");
|
|
@@ -42,7 +37,6 @@ export const injectComponentsInRyftForm = ({
|
|
|
42
37
|
const container = document.createElement("div");
|
|
43
38
|
mobilePayTitle.className = "mobile-pay-title";
|
|
44
39
|
mobilePayTitle.innerText = t("Design:expressCheckoutWith");
|
|
45
|
-
mobilePayTitle.id = "mobile-pay-title";
|
|
46
40
|
dividerText.id = "mobile-pay-divider-text";
|
|
47
41
|
dividerText.innerText = "or";
|
|
48
42
|
divider.id = "mobile-pay-divider";
|
|
@@ -36,7 +36,7 @@ export interface DateAndRecurrenceInputValues {
|
|
|
36
36
|
|
|
37
37
|
interface DateAndRecurrenceInputProps {
|
|
38
38
|
isEventEditProductSet?: boolean;
|
|
39
|
-
workHours
|
|
39
|
+
workHours?: WorkHour[];
|
|
40
40
|
providerHasBookingManagement: boolean;
|
|
41
41
|
isLoading?: boolean;
|
|
42
42
|
}
|
|
@@ -90,7 +90,7 @@ export const DateAndRecurrenceInput = ({
|
|
|
90
90
|
clearEditState();
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
const popoverId = useId()
|
|
93
|
+
const popoverId = useId()!;
|
|
94
94
|
|
|
95
95
|
const { t } = useTranslation("Design");
|
|
96
96
|
|
|
@@ -228,7 +228,6 @@ export const DateAndRecurrenceInput = ({
|
|
|
228
228
|
defaultValues={editState.values}
|
|
229
229
|
onChange={handleRecurringDateChange}
|
|
230
230
|
onDelete={handleDelete}
|
|
231
|
-
workHours={workHours}
|
|
232
231
|
>
|
|
233
232
|
{providerHasBookingManagement && (
|
|
234
233
|
<AvailableTimesControl
|
|
@@ -5,8 +5,9 @@ import { Form, OverlayTrigger, Popover } from "react-bootstrap";
|
|
|
5
5
|
import { useFieldArray, useFormContext } from "react-hook-form";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
7
|
import { useClickAway } from "react-use";
|
|
8
|
-
import { TIMEZONE
|
|
8
|
+
import { TIMEZONE } from "@licklist/core/dist/Config/Date";
|
|
9
9
|
import { ProductSetRecurrence } from "@licklist/core/dist/DataMapper/Product/ProductSetRecurrenceDataMapper";
|
|
10
|
+
import { TIME_FORMAT } from "@licklist/core/dist/Config/Date";
|
|
10
11
|
import { DateTime } from "luxon";
|
|
11
12
|
import RRule, { Frequency } from "rrule";
|
|
12
13
|
import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
|
|
@@ -26,6 +27,7 @@ import {
|
|
|
26
27
|
import { ProductSetRecurrenceOverridesControl } from "./ProductSetRecurrenceOverridesControl";
|
|
27
28
|
import { MAX_QUANTITY_RECURRENCE_DATE_IN_OVERRIDE } from "../product/constants";
|
|
28
29
|
|
|
30
|
+
|
|
29
31
|
export interface DateAndRecurrenceInputValues {
|
|
30
32
|
menuRecurrences?: Partial<ProductSetRecurrence>[];
|
|
31
33
|
}
|
|
@@ -57,7 +59,7 @@ export const DateInput = ({
|
|
|
57
59
|
control,
|
|
58
60
|
keyName: "_id",
|
|
59
61
|
});
|
|
60
|
-
|
|
62
|
+
|
|
61
63
|
const [isDatePopoverVisible, setIsDatePopoverVisible] = useState(false);
|
|
62
64
|
const availableTimesFormRef = useRef<AvailableTimesControlRef>();
|
|
63
65
|
const [editState, setEditState] = useState<{
|
|
@@ -92,7 +94,6 @@ export const DateInput = ({
|
|
|
92
94
|
// Hotfix for an issue with Popover close & open actions
|
|
93
95
|
setTimeout(() => {
|
|
94
96
|
setEditState({ index, values: next });
|
|
95
|
-
setAvailableTimes(next.availableTimes || []);
|
|
96
97
|
setIsDatePopoverVisible(() => true);
|
|
97
98
|
}, 100);
|
|
98
99
|
};
|
|
@@ -220,7 +221,7 @@ export const DateInput = ({
|
|
|
220
221
|
workHours={workHours}
|
|
221
222
|
isLoading={isLoading}
|
|
222
223
|
ref={availableTimesFormRef}
|
|
223
|
-
defaultValues={
|
|
224
|
+
defaultValues={[]}
|
|
224
225
|
errorMessage={
|
|
225
226
|
errors?.menuRecurrences?.[`${editState?.index}`]
|
|
226
227
|
?.availableTimes?.message
|
|
@@ -85,7 +85,7 @@ export interface ProductSetControlProps {
|
|
|
85
85
|
fieldSets?: FieldSet[];
|
|
86
86
|
showEmailTemplate?: boolean;
|
|
87
87
|
showSmsTemplate?: boolean;
|
|
88
|
-
workHours
|
|
88
|
+
workHours?: WorkHour[];
|
|
89
89
|
providerHasBookingManagement?: boolean;
|
|
90
90
|
isOverrides?: boolean;
|
|
91
91
|
}
|
|
@@ -26,16 +26,12 @@ import { checkAvailableTimesErrors, getFilteredTemplates } from "../utils";
|
|
|
26
26
|
export interface WithIsLoading {
|
|
27
27
|
isLoading: boolean;
|
|
28
28
|
}
|
|
29
|
-
export interface WithIdOptional {
|
|
30
|
-
id?: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
29
|
export interface WithId {
|
|
34
30
|
id: number;
|
|
35
31
|
}
|
|
36
32
|
export interface ProductSetFormValues
|
|
37
33
|
extends FormValues,
|
|
38
|
-
|
|
34
|
+
WithId,
|
|
39
35
|
ProductSetControlValues {
|
|
40
36
|
steps: Step[];
|
|
41
37
|
isOverrides?: boolean;
|
|
@@ -24,10 +24,8 @@ export const useSortableTreeFunctions = ({
|
|
|
24
24
|
const cancelChanges = (index: number) => {
|
|
25
25
|
if (isOverrides) return;
|
|
26
26
|
if (!previousValue) {
|
|
27
|
-
// eslint-disable-next-line consistent-return
|
|
28
27
|
return remove(index);
|
|
29
28
|
}
|
|
30
|
-
// eslint-disable-next-line consistent-return
|
|
31
29
|
return setValue(`${fieldName}.${index}` as const, previousValue);
|
|
32
30
|
};
|
|
33
31
|
|
|
@@ -7,17 +7,14 @@ import {
|
|
|
7
7
|
QUANTITY_TYPE_LIST_DTO,
|
|
8
8
|
QUANTITY_TYPE_RECHARGING,
|
|
9
9
|
} from "@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper";
|
|
10
|
-
import {
|
|
11
|
-
ProductType,
|
|
12
|
-
PRODUCT_DEfAULT_COLORS,
|
|
13
|
-
} from "@licklist/core/dist/DataMapper/Product/ProductDataMapper";
|
|
10
|
+
import { ProductType } from "@licklist/core/dist/DataMapper/Product/ProductDataMapper";
|
|
14
11
|
import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
|
|
15
|
-
import clsx from "clsx";
|
|
16
12
|
import {
|
|
17
13
|
FieldNamePrefixPath,
|
|
18
14
|
FormValues,
|
|
19
15
|
} from "@licklist/plugins/dist/types/services/Form/hook-form-service";
|
|
20
16
|
import { useId } from "@react-aria/utils";
|
|
17
|
+
import clsx from "clsx";
|
|
21
18
|
import React, {
|
|
22
19
|
ChangeEvent,
|
|
23
20
|
useCallback,
|
|
@@ -39,7 +36,7 @@ import {
|
|
|
39
36
|
} from "react-hook-form";
|
|
40
37
|
import { useTranslation } from "react-i18next";
|
|
41
38
|
import { useImages } from "@licklist/plugins/dist/hooks/Media/useImages";
|
|
42
|
-
|
|
39
|
+
import { PRODUCT_DEfAULT_COLORS } from "@licklist/core/dist/DataMapper/Product/ProductDataMapper";
|
|
43
40
|
import {
|
|
44
41
|
Image,
|
|
45
42
|
IMAGE_TYPE_IMAGE,
|
|
@@ -149,7 +146,7 @@ export function ProductControl<T extends FormValues>({
|
|
|
149
146
|
clearErrors,
|
|
150
147
|
} = useFormContext<T>();
|
|
151
148
|
|
|
152
|
-
const { setLoading
|
|
149
|
+
const { setLoading } = useContext(ProductSetLoadingContext);
|
|
153
150
|
const { t } = useTranslation(["Design", "Validation", "ProductSet"]);
|
|
154
151
|
const [expanded, setExpanded] = useState(false);
|
|
155
152
|
const [initialImages, setInitialImages] = useState<Image[] | null>(null);
|
|
@@ -162,8 +159,8 @@ export function ProductControl<T extends FormValues>({
|
|
|
162
159
|
|
|
163
160
|
const advancedId = useId();
|
|
164
161
|
const nameId = useId();
|
|
165
|
-
|
|
166
|
-
const productGroupId = useId();
|
|
162
|
+
// @TODO: no need for v1 release
|
|
163
|
+
// const productGroupId = useId();
|
|
167
164
|
const descriptionId = useId();
|
|
168
165
|
const termsAndConditionsId = useId();
|
|
169
166
|
const isAvailableId = useId();
|
|
@@ -403,35 +400,6 @@ export function ProductControl<T extends FormValues>({
|
|
|
403
400
|
isRequired={false}
|
|
404
401
|
defaultColors={PRODUCT_DEfAULT_COLORS}
|
|
405
402
|
/>
|
|
406
|
-
|
|
407
|
-
<Form.Group controlId={productGroupId}>
|
|
408
|
-
<Form.Label>{t("productGroup")}</Form.Label>
|
|
409
|
-
<Form.Control
|
|
410
|
-
as="select"
|
|
411
|
-
{...register(`${fieldNamePrefix}.productGroupId` as Path<T>)}
|
|
412
|
-
isInvalid={HookFormService.isInvalid<T>(
|
|
413
|
-
`${fieldNamePrefix}.productGroupId` as Path<T>,
|
|
414
|
-
errors
|
|
415
|
-
)}
|
|
416
|
-
disabled={isLoading}
|
|
417
|
-
defaultValue=""
|
|
418
|
-
>
|
|
419
|
-
<option value="">{t("Design:selectProductGroup")}</option>
|
|
420
|
-
{productGroupList.map((productGroup) => {
|
|
421
|
-
return (
|
|
422
|
-
<option value={productGroup.id} key={productGroup.id}>
|
|
423
|
-
{productGroup.value}
|
|
424
|
-
</option>
|
|
425
|
-
);
|
|
426
|
-
})}
|
|
427
|
-
</Form.Control>
|
|
428
|
-
<Form.Control.Feedback type="invalid">
|
|
429
|
-
{HookFormService.getErrors<T>(
|
|
430
|
-
`${fieldNamePrefix}.productGroupId` as Path<T>,
|
|
431
|
-
errors
|
|
432
|
-
)}
|
|
433
|
-
</Form.Control.Feedback>
|
|
434
|
-
</Form.Group>
|
|
435
403
|
</Col>
|
|
436
404
|
</Row>
|
|
437
405
|
|
|
@@ -704,6 +672,38 @@ export function ProductControl<T extends FormValues>({
|
|
|
704
672
|
</Collapse>
|
|
705
673
|
|
|
706
674
|
<Row>
|
|
675
|
+
{/* @TODO: no need for v1 release
|
|
676
|
+
<Col xs={12} sm={6}>
|
|
677
|
+
<Form.Group controlId={productGroupId}>
|
|
678
|
+
<Form.Label>{t("productGroup")}</Form.Label>
|
|
679
|
+
<Form.Control
|
|
680
|
+
as="select"
|
|
681
|
+
{...register(`${fieldNamePrefix}.productGroupId` as Path<T>)}
|
|
682
|
+
isInvalid={HookFormService.isInvalid<T>(
|
|
683
|
+
`${fieldNamePrefix}.productGroupId` as Path<T>,
|
|
684
|
+
errors
|
|
685
|
+
)}
|
|
686
|
+
disabled={isLoading}
|
|
687
|
+
defaultValue=""
|
|
688
|
+
>
|
|
689
|
+
<option value="">{t("Design:selectProductGroup")}</option>
|
|
690
|
+
{productGroupList.map((productGroup) => {
|
|
691
|
+
return (
|
|
692
|
+
<option value={productGroup.id} key={productGroup.id}>
|
|
693
|
+
{productGroup.value}
|
|
694
|
+
</option>
|
|
695
|
+
);
|
|
696
|
+
})}
|
|
697
|
+
</Form.Control>
|
|
698
|
+
<Form.Control.Feedback type="invalid">
|
|
699
|
+
{HookFormService.getErrors<T>(
|
|
700
|
+
`${fieldNamePrefix}.productGroupId` as Path<T>,
|
|
701
|
+
errors
|
|
702
|
+
)}
|
|
703
|
+
</Form.Control.Feedback>
|
|
704
|
+
</Form.Group>
|
|
705
|
+
</Col> */}
|
|
706
|
+
|
|
707
707
|
<Col xs={12}>
|
|
708
708
|
{hasBookingManagement && (
|
|
709
709
|
<ProductBookingManagementControl<T>
|
|
@@ -5,6 +5,8 @@ import { FieldNamePrefixPath } from "@licklist/plugins/dist/types/services/Form/
|
|
|
5
5
|
import { useWatch } from "react-hook-form";
|
|
6
6
|
import { FormNumberInput } from "../../../static";
|
|
7
7
|
|
|
8
|
+
|
|
9
|
+
|
|
8
10
|
interface FixedDurationOptionsProps<T> extends FieldNamePrefixPath<T> {
|
|
9
11
|
isOverrides?: boolean;
|
|
10
12
|
}
|
|
@@ -26,7 +26,6 @@ export interface ProductCategoryControlValues extends FormValues {
|
|
|
26
26
|
name: string;
|
|
27
27
|
minSubItems: number | null;
|
|
28
28
|
maxSubItems: number | null;
|
|
29
|
-
overallQuantity?: number | null;
|
|
30
29
|
quantityType: QuantityType;
|
|
31
30
|
type: CategoryType;
|
|
32
31
|
isTimeRelated: boolean;
|
|
@@ -103,7 +102,6 @@ export function ProductCategoryControl({
|
|
|
103
102
|
const collectUserInfoId = useId();
|
|
104
103
|
const hasTicketId = useId();
|
|
105
104
|
const zoneId = useId();
|
|
106
|
-
const overallQuantityId = useId();
|
|
107
105
|
|
|
108
106
|
const allowDepositsId = useId();
|
|
109
107
|
const remainderExpireAfterId = useId();
|
|
@@ -129,7 +127,7 @@ export function ProductCategoryControl({
|
|
|
129
127
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
130
128
|
}, [maxSubItems, fieldNamePrefix]);
|
|
131
129
|
|
|
132
|
-
const
|
|
130
|
+
const shouldShowZoneSelect =
|
|
133
131
|
category.type === CATEGORY_TYPE_FIXED_DURATION ||
|
|
134
132
|
category.type === CATEGORY_TYPE_GAME;
|
|
135
133
|
|
|
@@ -329,111 +327,51 @@ export function ProductCategoryControl({
|
|
|
329
327
|
</Form.Group>
|
|
330
328
|
</Col>
|
|
331
329
|
</Row>
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
<
|
|
337
|
-
<
|
|
338
|
-
className="arrow-up-btn"
|
|
339
|
-
onClick={() => {
|
|
340
|
-
const currentOverallCapacity = Number(
|
|
341
|
-
getValues(`${fieldNamePrefix}.overallQuantity`) || 0
|
|
342
|
-
);
|
|
343
|
-
setValue(
|
|
344
|
-
`${fieldNamePrefix}.overallQuantity`,
|
|
345
|
-
currentOverallCapacity + 1,
|
|
346
|
-
{ shouldValidate: true }
|
|
347
|
-
);
|
|
348
|
-
}}
|
|
349
|
-
>
|
|
350
|
-
<InputGroup.Text className="py-0 px-3">
|
|
351
|
-
<IncrementIcon />
|
|
352
|
-
</InputGroup.Text>
|
|
353
|
-
</InputGroup.Prepend>
|
|
330
|
+
|
|
331
|
+
{shouldShowZoneSelect && (
|
|
332
|
+
<Row>
|
|
333
|
+
<Col>
|
|
334
|
+
<Form.Group controlId={zoneId}>
|
|
335
|
+
<Form.Label>{t("Design:zone")}</Form.Label>
|
|
354
336
|
<Controller
|
|
355
337
|
control={control}
|
|
356
|
-
name={`${fieldNamePrefix}.
|
|
338
|
+
name={`${fieldNamePrefix}.zoneId`}
|
|
357
339
|
render={({ field }) => (
|
|
358
340
|
<Form.Control
|
|
359
|
-
|
|
360
|
-
step={1}
|
|
361
|
-
type="number"
|
|
341
|
+
as="select"
|
|
362
342
|
disabled={isOverride}
|
|
363
343
|
isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
|
|
364
|
-
`${fieldNamePrefix}.
|
|
344
|
+
`${fieldNamePrefix}.zoneId`,
|
|
365
345
|
errors
|
|
366
346
|
)}
|
|
367
347
|
{...field}
|
|
368
|
-
|
|
348
|
+
>
|
|
349
|
+
<option value={null}>{t("Design:choose")}</option>
|
|
350
|
+
{zones.map((zone) => (
|
|
351
|
+
<option key={zone.id} value={zone.id}>
|
|
352
|
+
{zone.name}
|
|
353
|
+
</option>
|
|
354
|
+
))}
|
|
355
|
+
</Form.Control>
|
|
369
356
|
)}
|
|
370
357
|
rules={{
|
|
371
|
-
|
|
372
|
-
value:
|
|
373
|
-
message: t("Validation:
|
|
374
|
-
attribute: t("
|
|
375
|
-
|
|
376
|
-
}) as string,
|
|
358
|
+
required: {
|
|
359
|
+
value: providerHasBookingManagement,
|
|
360
|
+
message: t("Validation:fieldRequired", {
|
|
361
|
+
attribute: t("zone"),
|
|
362
|
+
}),
|
|
377
363
|
},
|
|
378
364
|
}}
|
|
379
365
|
/>
|
|
380
366
|
<Form.Control.Feedback type="invalid">
|
|
381
367
|
{HookFormService.getErrors<ProductSetFormValues>(
|
|
382
|
-
`${fieldNamePrefix}.
|
|
368
|
+
`${fieldNamePrefix}.zoneId`,
|
|
383
369
|
errors
|
|
384
370
|
)}
|
|
385
371
|
</Form.Control.Feedback>
|
|
386
|
-
</
|
|
387
|
-
</
|
|
388
|
-
</
|
|
389
|
-
</Row>
|
|
390
|
-
|
|
391
|
-
{isZoneCategory && (
|
|
392
|
-
<>
|
|
393
|
-
<Row>
|
|
394
|
-
<Col>
|
|
395
|
-
<Form.Group controlId={zoneId}>
|
|
396
|
-
<Form.Label>{t("Design:zone")}</Form.Label>
|
|
397
|
-
<Controller
|
|
398
|
-
control={control}
|
|
399
|
-
name={`${fieldNamePrefix}.zoneId`}
|
|
400
|
-
render={({ field }) => (
|
|
401
|
-
<Form.Control
|
|
402
|
-
as="select"
|
|
403
|
-
disabled={isOverride}
|
|
404
|
-
isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
|
|
405
|
-
`${fieldNamePrefix}.zoneId`,
|
|
406
|
-
errors
|
|
407
|
-
)}
|
|
408
|
-
{...field}
|
|
409
|
-
>
|
|
410
|
-
<option value={null}>{t("Design:choose")}</option>
|
|
411
|
-
{zones.map((zone) => (
|
|
412
|
-
<option key={zone.id} value={zone.id}>
|
|
413
|
-
{zone.name}
|
|
414
|
-
</option>
|
|
415
|
-
))}
|
|
416
|
-
</Form.Control>
|
|
417
|
-
)}
|
|
418
|
-
rules={{
|
|
419
|
-
required: {
|
|
420
|
-
value: providerHasBookingManagement,
|
|
421
|
-
message: t("Validation:fieldRequired", {
|
|
422
|
-
attribute: t("zone"),
|
|
423
|
-
}),
|
|
424
|
-
},
|
|
425
|
-
}}
|
|
426
|
-
/>
|
|
427
|
-
<Form.Control.Feedback type="invalid">
|
|
428
|
-
{HookFormService.getErrors<ProductSetFormValues>(
|
|
429
|
-
`${fieldNamePrefix}.zoneId`,
|
|
430
|
-
errors
|
|
431
|
-
)}
|
|
432
|
-
</Form.Control.Feedback>
|
|
433
|
-
</Form.Group>
|
|
434
|
-
</Col>
|
|
435
|
-
</Row>
|
|
436
|
-
</>
|
|
372
|
+
</Form.Group>
|
|
373
|
+
</Col>
|
|
374
|
+
</Row>
|
|
437
375
|
)}
|
|
438
376
|
</Col>
|
|
439
377
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { DateTime } from "luxon";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { Col, Row } from "react-bootstrap";
|
|
3
4
|
import { useFormContext } from "react-hook-form";
|
|
4
5
|
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { TIME_FORMAT } from "@licklist/core/dist/Config";
|
|
5
7
|
import { WorkingHoursInputValues } from ".";
|
|
6
8
|
import { useWeekdays } from "./utils";
|
|
7
9
|
|
|
@@ -23,10 +25,22 @@ export function WorkingHoursInputDescription() {
|
|
|
23
25
|
<Row key={i}>
|
|
24
26
|
<Col xs="auto">{weekdays[i]}:</Col>
|
|
25
27
|
<Col>
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
{weekday?.end
|
|
29
|
+
? weekday.start
|
|
30
|
+
? t("timeInterval", {
|
|
31
|
+
start: DateTime.fromISO(weekday.start).toFormat(
|
|
32
|
+
TIME_FORMAT
|
|
33
|
+
),
|
|
34
|
+
end: DateTime.fromISO(weekday.start).toFormat(
|
|
35
|
+
TIME_FORMAT
|
|
36
|
+
),
|
|
37
|
+
})
|
|
38
|
+
: t("timeFrom", {
|
|
39
|
+
start: DateTime.fromISO(weekday.start).toFormat(
|
|
40
|
+
TIME_FORMAT
|
|
41
|
+
),
|
|
42
|
+
})
|
|
43
|
+
: null}
|
|
30
44
|
</Col>
|
|
31
45
|
</Row>
|
|
32
46
|
);
|