@licklist/design 0.58.5 → 0.58.6-dev.1
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 +0 -8
- package/dist/iframe/event/event-card/IframeEventCard.d.ts +2 -1
- 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/payment/order-items-table/utils/paymentSummary.js +1 -1
- package/dist/index.js +1 -1
- package/dist/product-set/card/ProductSetCard.d.ts +2 -1
- package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
- package/dist/product-set/card/ProductSetCard.js +1 -1
- package/dist/product-set/control/DateInput.d.ts +17 -0
- package/dist/product-set/control/DateInput.d.ts.map +1 -0
- package/dist/product-set/control/DateInput.js +1 -0
- package/dist/product-set/control/ProductSetControl.d.ts +2 -1
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/control/ProductSetControl.js +1 -1
- package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts +11 -0
- package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts.map +1 -0
- package/dist/product-set/control/ProductSetRecurrenceOverridesControl.js +1 -0
- package/dist/product-set/control/TutorialGifCard.d.ts +2 -1
- package/dist/product-set/control/TutorialGifCard.d.ts.map +1 -1
- package/dist/product-set/control/TutorialGifCard.js +1 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts +2 -1
- package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductCategoriesControl.js +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +7 -2
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +1 -1
- package/dist/product-set/form/ProductsControl.d.ts +2 -1
- package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductsControl.js +1 -1
- package/dist/product-set/form/StepsControl.d.ts +2 -1
- package/dist/product-set/form/StepsControl.d.ts.map +1 -1
- package/dist/product-set/form/StepsControl.js +1 -1
- package/dist/product-set/form/SubProductsControl.d.ts +2 -1
- package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
- package/dist/product-set/form/SubProductsControl.js +1 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.d.ts +2 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
- package/dist/product-set/hooks/useSortableTreeFunctions.js +1 -1
- package/dist/product-set/item/CreateProductSetItem.d.ts +2 -1
- package/dist/product-set/item/CreateProductSetItem.d.ts.map +1 -1
- package/dist/product-set/item/CreateProductSetItem.js +1 -1
- package/dist/product-set/product/ProductControl.d.ts +2 -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 +4 -2
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
- package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.js +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts +1 -0
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.js +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts +2 -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/recurring-date-picker-input/DatePickerInput.d.ts +19 -0
- package/dist/recurring-date-picker-input/DatePickerInput.d.ts.map +1 -0
- package/dist/recurring-date-picker-input/DatePickerInput.js +1 -0
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts +15 -0
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +1 -0
- package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.js +1 -0
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +2 -0
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
- package/dist/recurring-date-picker-input/RecurringDatePickerInput.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/sortable-list/SortableList.d.ts +2 -1
- package/dist/sortable-list/SortableList.d.ts.map +1 -1
- package/dist/sortable-list/SortableList.js +1 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts +3 -1
- package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
- package/dist/sortable-tree/SortableTreeItem.js +1 -1
- package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
- package/dist/static/manual-date-picker/constants/index.d.ts +4 -1
- 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 +4 -0
- 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/availability-indicator/AvailabilityIndicator.scss +10 -0
- package/dist/styles/iframe-events/Card.scss +24 -8
- package/dist/styles/iframe-events/PoweredBy.scss +2 -2
- package/dist/styles/iframe-order-process/IframeOrderProcess.scss +0 -2
- package/dist/styles/iframe-page/Page.scss +1 -0
- package/dist/styles/iframe-page/PageBody.scss +32 -11
- package/dist/styles/iframe-page/PageHeader.scss +41 -39
- package/dist/styles/product-set/EditVenueMapSetModal.scss +1 -1
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/package.json +10 -33
- package/src/calendar/Calendar.stories.tsx +9 -2
- package/src/iframe/event/event-card/IframeEventCard.stories.tsx +1 -0
- package/src/iframe/event/event-card/IframeEventCard.tsx +7 -8
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +1 -1
- package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +3 -1
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -6
- package/src/product-set/card/ProductSetCard.tsx +10 -1
- package/src/product-set/control/DateInput.tsx +309 -0
- package/src/product-set/control/ProductSetControl.tsx +46 -24
- package/src/product-set/control/ProductSetRecurrenceOverridesControl.tsx +63 -0
- package/src/product-set/control/TutorialGifCard.tsx +11 -3
- package/src/product-set/form/ProductCategoriesControl.tsx +12 -1
- package/src/product-set/form/ProductSetForm.tsx +10 -1
- package/src/product-set/form/ProductsControl.tsx +10 -0
- package/src/product-set/form/StepsControl.tsx +8 -2
- package/src/product-set/form/SubProductsControl.tsx +3 -0
- package/src/product-set/hooks/useSortableTreeFunctions.ts +6 -0
- package/src/product-set/item/CreateProductSetItem.tsx +3 -0
- package/src/product-set/product/ProductControl.tsx +23 -12
- package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +8 -2
- package/src/product-set/product/quantity/ProductQuantityControl.tsx +4 -3
- package/src/product-set/product-category/ProductCategoryControl.tsx +12 -8
- package/src/recurring-date-picker-input/DatePickerInput.tsx +93 -0
- package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +136 -0
- package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +4 -1
- package/src/sales/booking/results/BookingResults.stories.tsx +3 -2
- package/src/sales/booking/results/components/ResultCard.tsx +2 -5
- package/src/sortable-list/SortableList.tsx +3 -0
- package/src/sortable-tree/SortableTreeItem.tsx +6 -0
- package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
- package/src/static/manual-date-picker/constants/index.ts +6 -2
- package/src/static/manual-date-picker/utils/index.ts +11 -0
- package/src/static/switch/BooleanSwitch.tsx +1 -1
- package/src/styles/availability-indicator/AvailabilityIndicator.scss +10 -0
- package/src/styles/iframe-events/Card.scss +24 -8
- package/src/styles/iframe-events/PoweredBy.scss +2 -2
- package/src/styles/iframe-order-process/IframeOrderProcess.scss +0 -2
- package/src/styles/iframe-page/Page.scss +1 -0
- package/src/styles/iframe-page/PageBody.scss +32 -11
- package/src/styles/iframe-page/PageHeader.scss +41 -39
- package/src/styles/product-set/EditVenueMapSetModal.scss +1 -1
- package/src/styles/sales/BookingResults.scss +1 -1
- package/jest.config.js +0 -29
- package/tests/Auth/Authorizer.test.tsx +0 -194
- package/tests/Auth/Layout/UserNavDropDown.test.tsx +0 -43
- package/tests/Auth/Layout/UserNavDropDownToggle.test.tsx +0 -33
- package/tests/Auth/Login/LoginComponent.test.tsx +0 -246
- package/tests/Auth/Login/LoginFormComponent.test.tsx +0 -182
- package/tests/Auth/Register/RegisterComponent.test.tsx +0 -285
- package/tests/Auth/Register/RegisterFormComponent.test.tsx +0 -170
- package/tests/Auth/Settings/Dashboard/IpInput.test.tsx +0 -130
- package/tests/Auth/Social/SocialCallbackComponent.test.tsx +0 -133
- package/tests/Auth/Social/SocialFormComponent.test.tsx +0 -118
- package/tests/FileUpload/FileUpload.test.tsx +0 -42
- package/tests/Notification/EmailTemplate.test.tsx +0 -82
- package/tests/ProductSet/ProductSetPopover.test.tsx +0 -40
- package/tests/Report/Report.test.tsx +0 -48
- package/tests/Sales/Coupon.test.tsx +0 -51
- package/tests/Sales/SalesAndVIews.test.tsx +0 -63
- package/tests/SnippetTemplates/SnippetTemplates.test.tsx +0 -56
- package/tests/Table/FilterHelperComponent.test.tsx +0 -88
- package/tests/Table/PaginationHelperComponent.test.tsx +0 -109
- package/tests/Table/PerPageHelperComponent.test.tsx +0 -34
- package/tests/Table/TableHelperComponent.test.tsx +0 -295
- package/tests/TipTapEditor/TipTapEditor.test.tsx +0 -28
- package/tests/__mock__/hooks/useAuthApi.ts +0 -13
- package/tests/__mock__/hooks/useAuthMock.ts +0 -13
- package/tests/__mock__/hooks/useFormMock.ts +0 -27
- package/tests/__mock__/hooks/useNotificationMock.ts +0 -13
- package/tests/__mock__/hooks/useQueryMock.ts +0 -16
- package/tests/__mock__/hooks/useSocialApiMock.ts +0 -20
- package/tests/__mock__/hooks/useTranslationMock.ts +0 -17
- package/tests/__mock__/hooks/useUserApiMock.ts +0 -18
- package/tests/__mock__/hooks/useUserMock.ts +0 -13
- package/tests/__mock__/styleMock.js +0 -1
- package/tests/__mock__/windowMock.ts +0 -5
- package/tests/packages/react-query.tsx +0 -28
- package/tests/setupTests.ts +0 -10
|
@@ -49,6 +49,7 @@ export interface ProductCategoryControlProps extends IsDeletableEvent {
|
|
|
49
49
|
onCategoryNameChange: (args: any) => void;
|
|
50
50
|
stepIndex: number;
|
|
51
51
|
productCategoryIndex: number;
|
|
52
|
+
isOverride?: boolean;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
const categoriesWithTickets = [
|
|
@@ -63,6 +64,7 @@ export function ProductCategoryControl({
|
|
|
63
64
|
onCategoryNameChange,
|
|
64
65
|
productCategoryIndex,
|
|
65
66
|
stepIndex,
|
|
67
|
+
isOverride = false,
|
|
66
68
|
}: ProductCategoryControlProps) {
|
|
67
69
|
const {
|
|
68
70
|
control,
|
|
@@ -157,7 +159,7 @@ export function ProductCategoryControl({
|
|
|
157
159
|
errors
|
|
158
160
|
)}
|
|
159
161
|
placeholder={t("name")}
|
|
160
|
-
disabled={isLoading}
|
|
162
|
+
disabled={isLoading || isOverride}
|
|
161
163
|
/>
|
|
162
164
|
<Form.Control.Feedback type="invalid">
|
|
163
165
|
{HookFormService.getErrors<ProductSetFormValues>(
|
|
@@ -183,7 +185,7 @@ export function ProductCategoryControl({
|
|
|
183
185
|
}))}
|
|
184
186
|
value={field.value}
|
|
185
187
|
onChange={field.onChange}
|
|
186
|
-
disabled={isLoading}
|
|
188
|
+
disabled={isLoading || isOverride}
|
|
187
189
|
/>
|
|
188
190
|
</Form.Group>
|
|
189
191
|
)}
|
|
@@ -227,7 +229,7 @@ export function ProductCategoryControl({
|
|
|
227
229
|
`${fieldNamePrefix}.minSubItems` as const,
|
|
228
230
|
errors
|
|
229
231
|
)}
|
|
230
|
-
disabled={isLoading}
|
|
232
|
+
disabled={isLoading || isOverride}
|
|
231
233
|
name={name}
|
|
232
234
|
/>
|
|
233
235
|
)}
|
|
@@ -299,7 +301,7 @@ export function ProductCategoryControl({
|
|
|
299
301
|
`${fieldNamePrefix}.maxSubItems` as const,
|
|
300
302
|
errors
|
|
301
303
|
)}
|
|
302
|
-
disabled={isLoading}
|
|
304
|
+
disabled={isLoading || isOverride}
|
|
303
305
|
/>
|
|
304
306
|
)}
|
|
305
307
|
control={control}
|
|
@@ -337,6 +339,7 @@ export function ProductCategoryControl({
|
|
|
337
339
|
render={({ field }) => (
|
|
338
340
|
<Form.Control
|
|
339
341
|
as="select"
|
|
342
|
+
disabled={isOverride}
|
|
340
343
|
isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
|
|
341
344
|
`${fieldNamePrefix}.zoneId`,
|
|
342
345
|
errors
|
|
@@ -384,6 +387,7 @@ export function ProductCategoryControl({
|
|
|
384
387
|
<Form.Check.Input
|
|
385
388
|
checked={expanded}
|
|
386
389
|
onChange={handleExpand}
|
|
390
|
+
disabled={isOverride}
|
|
387
391
|
type="checkbox"
|
|
388
392
|
/>
|
|
389
393
|
<Form.Check.Label>{t("showAdvancedOptions")}</Form.Check.Label>
|
|
@@ -452,7 +456,7 @@ export function ProductCategoryControl({
|
|
|
452
456
|
name={name}
|
|
453
457
|
value={Boolean(value)}
|
|
454
458
|
onChange={onChange}
|
|
455
|
-
disabled={isLoading}
|
|
459
|
+
disabled={isLoading || isOverride}
|
|
456
460
|
/>
|
|
457
461
|
)}
|
|
458
462
|
control={control}
|
|
@@ -476,7 +480,7 @@ export function ProductCategoryControl({
|
|
|
476
480
|
name={name}
|
|
477
481
|
value={Boolean(value)}
|
|
478
482
|
onChange={onChange}
|
|
479
|
-
disabled={isLoading}
|
|
483
|
+
disabled={isLoading || isOverride}
|
|
480
484
|
/>
|
|
481
485
|
)}
|
|
482
486
|
control={control}
|
|
@@ -499,7 +503,7 @@ export function ProductCategoryControl({
|
|
|
499
503
|
name={name}
|
|
500
504
|
value={Boolean(value)}
|
|
501
505
|
onChange={onChange}
|
|
502
|
-
disabled={isLoading}
|
|
506
|
+
disabled={isLoading || isOverride}
|
|
503
507
|
/>
|
|
504
508
|
)}
|
|
505
509
|
control={control}
|
|
@@ -527,7 +531,7 @@ export function ProductCategoryControl({
|
|
|
527
531
|
`${fieldNamePrefix}.remainderExpireAfter` as const,
|
|
528
532
|
errors
|
|
529
533
|
)}
|
|
530
|
-
disabled={isLoading}
|
|
534
|
+
disabled={isLoading || isOverride}
|
|
531
535
|
name={name}
|
|
532
536
|
/>
|
|
533
537
|
)}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { Frequency } from "rrule";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import Button from "react-bootstrap/Button";
|
|
5
|
+
import { DateTime } from "luxon";
|
|
6
|
+
import { TIME_FULL_FORMAT } from "@licklist/core/dist/Config/Date";
|
|
7
|
+
import { FormProvider, useForm } from "react-hook-form";
|
|
8
|
+
import { Form } from "react-bootstrap";
|
|
9
|
+
import { ConfirmModal } from "../modals";
|
|
10
|
+
import { DeleteFieldButton } from "../product-set/elements";
|
|
11
|
+
import { RecurringDatePickerInputValues } from "./RecurringDatePickerInput";
|
|
12
|
+
import RecurrenceAndFrequencyInput from "./RecurrenceAndFrequencyInput";
|
|
13
|
+
|
|
14
|
+
export interface RecurringDatePickerInputProps {
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
defaultValues?: Partial<RecurringDatePickerInputValues>;
|
|
17
|
+
onChange: (state: RecurringDatePickerInputValues) => void;
|
|
18
|
+
onDelete: () => void;
|
|
19
|
+
initialFrequency?: Frequency;
|
|
20
|
+
setInitialStartDateAfterSelect?: boolean;
|
|
21
|
+
minDate?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface DatePickerInputValues {
|
|
25
|
+
startDate: string;
|
|
26
|
+
startTime: string;
|
|
27
|
+
endTime: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function DatePickerInput({
|
|
31
|
+
disabled = false,
|
|
32
|
+
onChange,
|
|
33
|
+
onDelete,
|
|
34
|
+
defaultValues,
|
|
35
|
+
children,
|
|
36
|
+
minDate,
|
|
37
|
+
}: PropsWithChildren<RecurringDatePickerInputProps>) {
|
|
38
|
+
const { t } = useTranslation(["Design"]);
|
|
39
|
+
|
|
40
|
+
const form = useForm<DatePickerInputValues>({
|
|
41
|
+
defaultValues: {
|
|
42
|
+
startDate: defaultValues?.startDate ?? "",
|
|
43
|
+
startTime: defaultValues?.startTime ?? "",
|
|
44
|
+
endTime: defaultValues?.endTime ?? "",
|
|
45
|
+
},
|
|
46
|
+
mode: "onChange",
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const { handleSubmit } = form;
|
|
50
|
+
|
|
51
|
+
const onSubmit = (nextState: RecurringDatePickerInputValues) => {
|
|
52
|
+
const endTimeNextState = nextState?.endTime
|
|
53
|
+
? DateTime.fromISO(nextState?.endTime).toFormat(TIME_FULL_FORMAT)
|
|
54
|
+
: "";
|
|
55
|
+
|
|
56
|
+
onChange({
|
|
57
|
+
...nextState,
|
|
58
|
+
endTime: endTimeNextState,
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<FormProvider {...form}>
|
|
64
|
+
<Form
|
|
65
|
+
noValidate
|
|
66
|
+
onSubmit={(event) => {
|
|
67
|
+
// prevents parent form submitting
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
event.stopPropagation();
|
|
70
|
+
return handleSubmit(onSubmit)(event);
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
<RecurrenceAndFrequencyInput disabled={disabled} minDate={minDate} />
|
|
74
|
+
|
|
75
|
+
{children}
|
|
76
|
+
|
|
77
|
+
<div className="d-inline-flex align-items-center w-100">
|
|
78
|
+
<Button type="submit">{t("Design:apply")}</Button>
|
|
79
|
+
|
|
80
|
+
{defaultValues && (
|
|
81
|
+
<div className="d-flex justify-content-end delete-btn">
|
|
82
|
+
<ConfirmModal>
|
|
83
|
+
{(confirm) => (
|
|
84
|
+
<DeleteFieldButton onDelete={() => confirm(onDelete)} />
|
|
85
|
+
)}
|
|
86
|
+
</ConfirmModal>
|
|
87
|
+
</div>
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
90
|
+
</Form>
|
|
91
|
+
</FormProvider>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
import { DateTime } from "luxon";
|
|
3
|
+
import { Col, Form, Row } from "react-bootstrap";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { RegisterOptions, useFormContext } from "react-hook-form";
|
|
6
|
+
import { RecurringDatePickerInputValues } from "./RecurringDatePickerInput";
|
|
7
|
+
|
|
8
|
+
interface RecurrenceIntervalAndFrequencyInputProps {
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
minDate?: string;
|
|
11
|
+
startDateLabel?: string;
|
|
12
|
+
startTimeLabel?: string;
|
|
13
|
+
endDateLabel?: string;
|
|
14
|
+
endTimeLabel?: string;
|
|
15
|
+
startTimeRules?: Pick<
|
|
16
|
+
RegisterOptions,
|
|
17
|
+
"max" | "min" | "validate" | "required" | "pattern"
|
|
18
|
+
>;
|
|
19
|
+
endTimeRules?: Pick<
|
|
20
|
+
RegisterOptions,
|
|
21
|
+
"max" | "min" | "validate" | "required" | "pattern"
|
|
22
|
+
>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function RecurrenceAndFrequencyInput({
|
|
26
|
+
disabled = false,
|
|
27
|
+
minDate,
|
|
28
|
+
startDateLabel,
|
|
29
|
+
startTimeLabel,
|
|
30
|
+
endTimeLabel,
|
|
31
|
+
startTimeRules,
|
|
32
|
+
endTimeRules,
|
|
33
|
+
}: RecurrenceIntervalAndFrequencyInputProps) {
|
|
34
|
+
const { t } = useTranslation(["Design", "Notification", "App"]);
|
|
35
|
+
|
|
36
|
+
const {
|
|
37
|
+
getValues,
|
|
38
|
+
formState: { errors },
|
|
39
|
+
register,
|
|
40
|
+
trigger,
|
|
41
|
+
} = useFormContext<RecurringDatePickerInputValues>();
|
|
42
|
+
|
|
43
|
+
const startDate = getValues("startDate");
|
|
44
|
+
const startTime = getValues("startTime");
|
|
45
|
+
const endTime = getValues("endTime");
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!startTime || !endTime) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
trigger("endTime");
|
|
52
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
|
+
}, [startTime]);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<Row>
|
|
58
|
+
<Col xs={12} sm={6}>
|
|
59
|
+
<Form.Group>
|
|
60
|
+
<Form.Label>{startDateLabel ?? t("Design:fromDate")}</Form.Label>
|
|
61
|
+
<Form.Control
|
|
62
|
+
type="date"
|
|
63
|
+
{...register("startDate", { required: true })}
|
|
64
|
+
defaultValue={startDate}
|
|
65
|
+
className={startDate && "date-input-with-value"}
|
|
66
|
+
disabled={disabled}
|
|
67
|
+
min={minDate}
|
|
68
|
+
isInvalid={Boolean(errors.startDate)}
|
|
69
|
+
/>
|
|
70
|
+
<Form.Control.Feedback type="invalid">
|
|
71
|
+
{errors.startDate?.message}
|
|
72
|
+
</Form.Control.Feedback>
|
|
73
|
+
</Form.Group>
|
|
74
|
+
</Col>
|
|
75
|
+
</Row>
|
|
76
|
+
|
|
77
|
+
<Row>
|
|
78
|
+
<Col xs={12} sm={6}>
|
|
79
|
+
<Form.Group>
|
|
80
|
+
<Form.Label>
|
|
81
|
+
{startTimeLabel ?? t("Design:availableFrom")}
|
|
82
|
+
</Form.Label>
|
|
83
|
+
<Form.Control
|
|
84
|
+
type="time"
|
|
85
|
+
{...register("startTime", { required: false, ...startTimeRules })}
|
|
86
|
+
placeholder="hh:mm"
|
|
87
|
+
defaultValue={startTime}
|
|
88
|
+
disabled={disabled}
|
|
89
|
+
isInvalid={Boolean(errors.startTime)}
|
|
90
|
+
/>
|
|
91
|
+
<Form.Control.Feedback type="invalid">
|
|
92
|
+
{errors.startTime?.message}
|
|
93
|
+
</Form.Control.Feedback>
|
|
94
|
+
</Form.Group>
|
|
95
|
+
</Col>
|
|
96
|
+
|
|
97
|
+
<Col xs={12} sm={6}>
|
|
98
|
+
<Form.Group>
|
|
99
|
+
<Form.Label>{endTimeLabel ?? t("Design:availableTo")}</Form.Label>
|
|
100
|
+
<Form.Control
|
|
101
|
+
type="time"
|
|
102
|
+
{...register("endTime", {
|
|
103
|
+
required: false,
|
|
104
|
+
validate: (time) => {
|
|
105
|
+
if (!startTime || !time) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
const currentStartTime = DateTime.fromISO(startTime);
|
|
109
|
+
const currentEndTime = DateTime.fromISO(time);
|
|
110
|
+
|
|
111
|
+
return currentEndTime?.diff(currentStartTime, ["minutes"])
|
|
112
|
+
?.minutes >= 0
|
|
113
|
+
? true
|
|
114
|
+
: `${t(`Validation:fieldLaterDate`, {
|
|
115
|
+
attribute: t("Design:endTimeSmall"),
|
|
116
|
+
min: t("Design:startTimeSmall"),
|
|
117
|
+
})}`;
|
|
118
|
+
},
|
|
119
|
+
...endTimeRules,
|
|
120
|
+
})}
|
|
121
|
+
placeholder="hh:mm"
|
|
122
|
+
defaultValue={endTime}
|
|
123
|
+
disabled={disabled}
|
|
124
|
+
isInvalid={Boolean(errors.endTime)}
|
|
125
|
+
/>
|
|
126
|
+
<Form.Control.Feedback type="invalid">
|
|
127
|
+
{errors.endTime?.message}
|
|
128
|
+
</Form.Control.Feedback>
|
|
129
|
+
</Form.Group>
|
|
130
|
+
</Col>
|
|
131
|
+
</Row>
|
|
132
|
+
</>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export default RecurrenceAndFrequencyInput;
|
|
@@ -336,7 +336,10 @@ const useFormattedDuration = ({
|
|
|
336
336
|
}, [start, end, byWeekDay, formatList, formatNumber]);
|
|
337
337
|
};
|
|
338
338
|
|
|
339
|
-
const getDateTimeObject = (
|
|
339
|
+
export const getDateTimeObject = (
|
|
340
|
+
date: string,
|
|
341
|
+
time: string
|
|
342
|
+
): DateTime | string => {
|
|
340
343
|
const dateTime = DateTime.fromFormat(`${date} ${time}`, DATE_TIME_FORMAT);
|
|
341
344
|
|
|
342
345
|
if (dateTime.isValid) {
|
|
@@ -3,11 +3,12 @@ import { Meta } from "@storybook/react";
|
|
|
3
3
|
import { Event } from "@licklist/core/dist/DataMapper/Provider/EventDataMapper";
|
|
4
4
|
import { User } from "@licklist/core/dist/DataMapper/User/UserDataMapper";
|
|
5
5
|
import { Product } from "@licklist/core/dist/DataMapper/Product/ProductDataMapper";
|
|
6
|
-
import { Order } from "@licklist/core/dist/DataMapper/Order/OrderDataMapper";
|
|
7
6
|
import {
|
|
7
|
+
Order,
|
|
8
8
|
ORDER_SOURCE_IFRAME,
|
|
9
9
|
ORDER_SOURCE_MANUAL,
|
|
10
|
-
} from "@licklist/core/
|
|
10
|
+
} from "@licklist/core/dist/DataMapper/Order/OrderDataMapper";
|
|
11
|
+
|
|
11
12
|
import { BookingResults } from "./BookingResults";
|
|
12
13
|
|
|
13
14
|
export default {
|
|
@@ -12,7 +12,6 @@ import { TIME_FORMAT } from "@licklist/core/dist/Config";
|
|
|
12
12
|
import * as Config from "@licklist/core/dist/Config";
|
|
13
13
|
import { formatDateStringForEvent } from "@licklist/plugins/dist/utils/formatDate";
|
|
14
14
|
import { getOrderSourceTitle } from "@licklist/plugins/dist/utils/sourceTitle";
|
|
15
|
-
|
|
16
15
|
import Icon from "../../../../static/Icon";
|
|
17
16
|
|
|
18
17
|
export type ResultCardProps = {
|
|
@@ -22,8 +21,6 @@ export type ResultCardProps = {
|
|
|
22
21
|
onCardClick?: (id: number) => void;
|
|
23
22
|
};
|
|
24
23
|
|
|
25
|
-
// @TODO integrate when API will be available
|
|
26
|
-
// activity and staff keys
|
|
27
24
|
export const ResultCard = ({
|
|
28
25
|
order,
|
|
29
26
|
className,
|
|
@@ -41,10 +38,10 @@ export const ResultCard = ({
|
|
|
41
38
|
startDate,
|
|
42
39
|
products,
|
|
43
40
|
source,
|
|
44
|
-
totalAmount,
|
|
45
41
|
event,
|
|
46
42
|
menu,
|
|
47
43
|
remainingToPay,
|
|
44
|
+
paidAmount,
|
|
48
45
|
} = order;
|
|
49
46
|
|
|
50
47
|
const productList = products.map((product) => product.name)?.join(", ") || "";
|
|
@@ -108,7 +105,7 @@ export const ResultCard = ({
|
|
|
108
105
|
)}
|
|
109
106
|
<p>
|
|
110
107
|
{t("paidAmount")}:{" "}
|
|
111
|
-
{formatNumber(
|
|
108
|
+
{formatNumber(paidAmount, {
|
|
112
109
|
style: "currency",
|
|
113
110
|
currency: Config.Currency.GBP,
|
|
114
111
|
})}
|
|
@@ -33,6 +33,7 @@ type SortableListProps<T> = {
|
|
|
33
33
|
renderItemContent: (args: RenderItemContentArgs<T>) => ReactNode;
|
|
34
34
|
setItems?: Dispatch<SetStateAction<SortableItem<T>[]>>;
|
|
35
35
|
isExpandNewItem?: boolean;
|
|
36
|
+
isOverrides?: boolean;
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
export const SORTABLE_ID_KEY = "_sortableId";
|
|
@@ -44,6 +45,7 @@ export function SortableList<T>({
|
|
|
44
45
|
renderItemContent,
|
|
45
46
|
setItems,
|
|
46
47
|
isExpandNewItem = false,
|
|
48
|
+
isOverrides = false,
|
|
47
49
|
}: SortableListProps<T>) {
|
|
48
50
|
const [sortedItems, setSortedItems] = useState(items);
|
|
49
51
|
|
|
@@ -97,6 +99,7 @@ export function SortableList<T>({
|
|
|
97
99
|
);
|
|
98
100
|
|
|
99
101
|
function handleDragEnd(event) {
|
|
102
|
+
if (isOverrides) return;
|
|
100
103
|
const { active, over } = event;
|
|
101
104
|
|
|
102
105
|
if (active.id !== over.id) {
|
|
@@ -52,6 +52,8 @@ export interface SortableTreeItemProps {
|
|
|
52
52
|
className: string;
|
|
53
53
|
};
|
|
54
54
|
setIsExpanded?: () => void;
|
|
55
|
+
isOverride?: boolean;
|
|
56
|
+
isProduct?: boolean;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
export function SortableTreeItem({
|
|
@@ -78,6 +80,8 @@ export function SortableTreeItem({
|
|
|
78
80
|
edit,
|
|
79
81
|
secondaryBadge,
|
|
80
82
|
setIsExpanded,
|
|
83
|
+
isOverride,
|
|
84
|
+
isProduct = false,
|
|
81
85
|
}: SortableTreeItemProps) {
|
|
82
86
|
const [expanded, setExpanded] = useState(isExpanded);
|
|
83
87
|
const [isModalVisible, setIsModalVisible] = useState(isNewAdded);
|
|
@@ -98,6 +102,7 @@ export function SortableTreeItem({
|
|
|
98
102
|
transform: dragTransform,
|
|
99
103
|
} = useDraggable({
|
|
100
104
|
id,
|
|
105
|
+
disabled: isOverride,
|
|
101
106
|
});
|
|
102
107
|
|
|
103
108
|
const onHandleExpand = useCallback(
|
|
@@ -145,6 +150,7 @@ export function SortableTreeItem({
|
|
|
145
150
|
};
|
|
146
151
|
|
|
147
152
|
const onEdit = (e) => {
|
|
153
|
+
if (isOverride && !isProduct) return;
|
|
148
154
|
e.stopPropagation();
|
|
149
155
|
if (edit && !isModalVisible) edit();
|
|
150
156
|
setIsModalVisible(true);
|
|
@@ -61,9 +61,9 @@ export const ManualDatePicker = ({
|
|
|
61
61
|
disabled={isDisabled}
|
|
62
62
|
>
|
|
63
63
|
<option value="">{t("Design:monthShort")}</option>
|
|
64
|
-
{MONTHS_ARRAY.map((
|
|
65
|
-
<option key={key} value={
|
|
66
|
-
{key}
|
|
64
|
+
{MONTHS_ARRAY.map((object) => (
|
|
65
|
+
<option key={object.key} value={object.value}>
|
|
66
|
+
{object.key}
|
|
67
67
|
</option>
|
|
68
68
|
))}
|
|
69
69
|
</Form.Control>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
generateDatesArray,
|
|
3
|
+
generateMonthsOptionsArray,
|
|
4
|
+
generateYearsArray,
|
|
5
|
+
} from "../utils";
|
|
2
6
|
|
|
3
7
|
export const DAYS_ARRAY = generateDatesArray(1, 31, 1);
|
|
4
|
-
export const MONTHS_ARRAY =
|
|
8
|
+
export const MONTHS_ARRAY = generateMonthsOptionsArray();
|
|
5
9
|
export const YEARS_ARRAY = generateYearsArray();
|
|
@@ -4,6 +4,17 @@ export const generateDatesArray = (start: number, end: number, step: number) =>
|
|
|
4
4
|
(_, index) => 1 + index * step
|
|
5
5
|
);
|
|
6
6
|
|
|
7
|
+
export const generateMonthsOptionsArray = () =>
|
|
8
|
+
Array.from({ length: 12 }, (_, index) => {
|
|
9
|
+
const value = index + 1;
|
|
10
|
+
let key = String(value);
|
|
11
|
+
if (value < 10) {
|
|
12
|
+
key = `0${key}`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return { key, value };
|
|
16
|
+
});
|
|
17
|
+
|
|
7
18
|
export const generateYearsArray = () => {
|
|
8
19
|
const currentYear = new Date().getFullYear();
|
|
9
20
|
const ageBackYear = currentYear - 100;
|
|
@@ -23,7 +23,7 @@ export function BooleanSwitch({
|
|
|
23
23
|
const { t } = useTranslation("Design");
|
|
24
24
|
|
|
25
25
|
const options: SelectItem[] = [
|
|
26
|
-
{ id: 1, value: firstValueTitle ??
|
|
26
|
+
{ id: 1, value: firstValueTitle ?? t("yes") },
|
|
27
27
|
{ id: 0, value: secondValueTitle ?? t("no") },
|
|
28
28
|
];
|
|
29
29
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@import "../snippet-templates/snippetVariables";
|
|
2
|
+
@import "../themes//bookedit/variables";
|
|
2
3
|
|
|
3
4
|
.iframe-event-card {
|
|
4
5
|
position: relative;
|
|
@@ -18,12 +19,27 @@
|
|
|
18
19
|
background-size: cover;
|
|
19
20
|
background-position: center;
|
|
20
21
|
cursor: pointer;
|
|
21
|
-
border: 1px solid transparent;
|
|
22
22
|
border-radius: 0.5rem;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.card-body {
|
|
26
|
-
padding: 0.5rem 0 0.875rem;
|
|
26
|
+
padding: 0.5rem 0 0.875rem 0;
|
|
27
|
+
|
|
28
|
+
@include media-breakpoint-down(sm) {
|
|
29
|
+
padding: 1rem 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__info-icon {
|
|
34
|
+
position: absolute;
|
|
35
|
+
right: 1rem;
|
|
36
|
+
top: 1rem;
|
|
37
|
+
background-color: "#ffffff";
|
|
38
|
+
border-radius: 1.5rem;
|
|
39
|
+
padding: 0 0.5rem;
|
|
40
|
+
font-size: 0.75rem;
|
|
41
|
+
font-weight: $white;
|
|
42
|
+
border: 1px solid $black;
|
|
27
43
|
}
|
|
28
44
|
|
|
29
45
|
&__title {
|
|
@@ -33,7 +49,7 @@
|
|
|
33
49
|
line-height: 1.25rem;
|
|
34
50
|
cursor: pointer;
|
|
35
51
|
margin-bottom: 0.5rem;
|
|
36
|
-
font-size:
|
|
52
|
+
font-size: 0.95rem;
|
|
37
53
|
}
|
|
38
54
|
|
|
39
55
|
&__label {
|
|
@@ -82,7 +98,8 @@
|
|
|
82
98
|
color: $snippet-elements-button-color;
|
|
83
99
|
border: none;
|
|
84
100
|
background-color: $snippet-elements-button-background-color;
|
|
85
|
-
box-shadow: 0 0 0 $input-btn-focus-width
|
|
101
|
+
box-shadow: 0 0 0 $input-btn-focus-width
|
|
102
|
+
$snippet-elements-button-background-color;
|
|
86
103
|
}
|
|
87
104
|
|
|
88
105
|
&:disabled {
|
|
@@ -95,14 +112,14 @@
|
|
|
95
112
|
&:focus,
|
|
96
113
|
&.focus {
|
|
97
114
|
&:not(:disabled) {
|
|
98
|
-
opacity: .7;
|
|
115
|
+
opacity: 0.7;
|
|
99
116
|
}
|
|
100
117
|
}
|
|
101
118
|
|
|
102
119
|
&:active,
|
|
103
120
|
&.active {
|
|
104
121
|
&:not(:disabled) {
|
|
105
|
-
opacity: .8;
|
|
122
|
+
opacity: 0.8;
|
|
106
123
|
}
|
|
107
124
|
}
|
|
108
125
|
}
|
|
@@ -123,7 +140,7 @@
|
|
|
123
140
|
}
|
|
124
141
|
|
|
125
142
|
.card-text {
|
|
126
|
-
font-size: 0.
|
|
143
|
+
font-size: 0.82rem;
|
|
127
144
|
}
|
|
128
145
|
|
|
129
146
|
&.event-info {
|
|
@@ -202,7 +219,6 @@
|
|
|
202
219
|
|
|
203
220
|
@media (max-width: 576px) {
|
|
204
221
|
&.list-view {
|
|
205
|
-
|
|
206
222
|
.card-image {
|
|
207
223
|
margin-right: 0.5rem;
|
|
208
224
|
}
|