@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.
Files changed (169) hide show
  1. package/bitbucket-pipelines.yml +0 -8
  2. package/dist/iframe/event/event-card/IframeEventCard.d.ts +2 -1
  3. package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
  4. package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
  5. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
  6. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
  7. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
  8. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/product-set/card/ProductSetCard.d.ts +2 -1
  11. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  12. package/dist/product-set/card/ProductSetCard.js +1 -1
  13. package/dist/product-set/control/DateInput.d.ts +17 -0
  14. package/dist/product-set/control/DateInput.d.ts.map +1 -0
  15. package/dist/product-set/control/DateInput.js +1 -0
  16. package/dist/product-set/control/ProductSetControl.d.ts +2 -1
  17. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  18. package/dist/product-set/control/ProductSetControl.js +1 -1
  19. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts +11 -0
  20. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts.map +1 -0
  21. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.js +1 -0
  22. package/dist/product-set/control/TutorialGifCard.d.ts +2 -1
  23. package/dist/product-set/control/TutorialGifCard.d.ts.map +1 -1
  24. package/dist/product-set/control/TutorialGifCard.js +1 -1
  25. package/dist/product-set/form/ProductCategoriesControl.d.ts +2 -1
  26. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  27. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  28. package/dist/product-set/form/ProductSetForm.d.ts +7 -2
  29. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  30. package/dist/product-set/form/ProductSetForm.js +1 -1
  31. package/dist/product-set/form/ProductsControl.d.ts +2 -1
  32. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  33. package/dist/product-set/form/ProductsControl.js +1 -1
  34. package/dist/product-set/form/StepsControl.d.ts +2 -1
  35. package/dist/product-set/form/StepsControl.d.ts.map +1 -1
  36. package/dist/product-set/form/StepsControl.js +1 -1
  37. package/dist/product-set/form/SubProductsControl.d.ts +2 -1
  38. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  39. package/dist/product-set/form/SubProductsControl.js +1 -1
  40. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts +2 -1
  41. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
  42. package/dist/product-set/hooks/useSortableTreeFunctions.js +1 -1
  43. package/dist/product-set/item/CreateProductSetItem.d.ts +2 -1
  44. package/dist/product-set/item/CreateProductSetItem.d.ts.map +1 -1
  45. package/dist/product-set/item/CreateProductSetItem.js +1 -1
  46. package/dist/product-set/product/ProductControl.d.ts +2 -1
  47. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  48. package/dist/product-set/product/ProductControl.js +1 -1
  49. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts +4 -2
  50. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
  51. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.js +1 -1
  52. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts +1 -0
  53. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  54. package/dist/product-set/product/quantity/ProductQuantityControl.js +1 -1
  55. package/dist/product-set/product-category/ProductCategoryControl.d.ts +2 -1
  56. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  57. package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
  58. package/dist/recurring-date-picker-input/DatePickerInput.d.ts +19 -0
  59. package/dist/recurring-date-picker-input/DatePickerInput.d.ts.map +1 -0
  60. package/dist/recurring-date-picker-input/DatePickerInput.js +1 -0
  61. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts +15 -0
  62. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +1 -0
  63. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.js +1 -0
  64. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +2 -0
  65. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  66. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  67. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  68. package/dist/sales/booking/results/components/ResultCard.js +1 -1
  69. package/dist/sortable-list/SortableList.d.ts +2 -1
  70. package/dist/sortable-list/SortableList.d.ts.map +1 -1
  71. package/dist/sortable-list/SortableList.js +1 -1
  72. package/dist/sortable-tree/SortableTreeItem.d.ts +3 -1
  73. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  74. package/dist/sortable-tree/SortableTreeItem.js +1 -1
  75. package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
  76. package/dist/static/manual-date-picker/constants/index.d.ts +4 -1
  77. package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
  78. package/dist/static/manual-date-picker/constants/index.js +1 -1
  79. package/dist/static/manual-date-picker/utils/index.d.ts +4 -0
  80. package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
  81. package/dist/static/manual-date-picker/utils/index.js +1 -1
  82. package/dist/styles/availability-indicator/AvailabilityIndicator.scss +10 -0
  83. package/dist/styles/iframe-events/Card.scss +24 -8
  84. package/dist/styles/iframe-events/PoweredBy.scss +2 -2
  85. package/dist/styles/iframe-order-process/IframeOrderProcess.scss +0 -2
  86. package/dist/styles/iframe-page/Page.scss +1 -0
  87. package/dist/styles/iframe-page/PageBody.scss +32 -11
  88. package/dist/styles/iframe-page/PageHeader.scss +41 -39
  89. package/dist/styles/product-set/EditVenueMapSetModal.scss +1 -1
  90. package/dist/styles/sales/BookingResults.scss +1 -1
  91. package/package.json +10 -33
  92. package/src/calendar/Calendar.stories.tsx +9 -2
  93. package/src/iframe/event/event-card/IframeEventCard.stories.tsx +1 -0
  94. package/src/iframe/event/event-card/IframeEventCard.tsx +7 -8
  95. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +1 -1
  96. package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +3 -1
  97. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -6
  98. package/src/product-set/card/ProductSetCard.tsx +10 -1
  99. package/src/product-set/control/DateInput.tsx +309 -0
  100. package/src/product-set/control/ProductSetControl.tsx +46 -24
  101. package/src/product-set/control/ProductSetRecurrenceOverridesControl.tsx +63 -0
  102. package/src/product-set/control/TutorialGifCard.tsx +11 -3
  103. package/src/product-set/form/ProductCategoriesControl.tsx +12 -1
  104. package/src/product-set/form/ProductSetForm.tsx +10 -1
  105. package/src/product-set/form/ProductsControl.tsx +10 -0
  106. package/src/product-set/form/StepsControl.tsx +8 -2
  107. package/src/product-set/form/SubProductsControl.tsx +3 -0
  108. package/src/product-set/hooks/useSortableTreeFunctions.ts +6 -0
  109. package/src/product-set/item/CreateProductSetItem.tsx +3 -0
  110. package/src/product-set/product/ProductControl.tsx +23 -12
  111. package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +8 -2
  112. package/src/product-set/product/quantity/ProductQuantityControl.tsx +4 -3
  113. package/src/product-set/product-category/ProductCategoryControl.tsx +12 -8
  114. package/src/recurring-date-picker-input/DatePickerInput.tsx +93 -0
  115. package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +136 -0
  116. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +4 -1
  117. package/src/sales/booking/results/BookingResults.stories.tsx +3 -2
  118. package/src/sales/booking/results/components/ResultCard.tsx +2 -5
  119. package/src/sortable-list/SortableList.tsx +3 -0
  120. package/src/sortable-tree/SortableTreeItem.tsx +6 -0
  121. package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
  122. package/src/static/manual-date-picker/constants/index.ts +6 -2
  123. package/src/static/manual-date-picker/utils/index.ts +11 -0
  124. package/src/static/switch/BooleanSwitch.tsx +1 -1
  125. package/src/styles/availability-indicator/AvailabilityIndicator.scss +10 -0
  126. package/src/styles/iframe-events/Card.scss +24 -8
  127. package/src/styles/iframe-events/PoweredBy.scss +2 -2
  128. package/src/styles/iframe-order-process/IframeOrderProcess.scss +0 -2
  129. package/src/styles/iframe-page/Page.scss +1 -0
  130. package/src/styles/iframe-page/PageBody.scss +32 -11
  131. package/src/styles/iframe-page/PageHeader.scss +41 -39
  132. package/src/styles/product-set/EditVenueMapSetModal.scss +1 -1
  133. package/src/styles/sales/BookingResults.scss +1 -1
  134. package/jest.config.js +0 -29
  135. package/tests/Auth/Authorizer.test.tsx +0 -194
  136. package/tests/Auth/Layout/UserNavDropDown.test.tsx +0 -43
  137. package/tests/Auth/Layout/UserNavDropDownToggle.test.tsx +0 -33
  138. package/tests/Auth/Login/LoginComponent.test.tsx +0 -246
  139. package/tests/Auth/Login/LoginFormComponent.test.tsx +0 -182
  140. package/tests/Auth/Register/RegisterComponent.test.tsx +0 -285
  141. package/tests/Auth/Register/RegisterFormComponent.test.tsx +0 -170
  142. package/tests/Auth/Settings/Dashboard/IpInput.test.tsx +0 -130
  143. package/tests/Auth/Social/SocialCallbackComponent.test.tsx +0 -133
  144. package/tests/Auth/Social/SocialFormComponent.test.tsx +0 -118
  145. package/tests/FileUpload/FileUpload.test.tsx +0 -42
  146. package/tests/Notification/EmailTemplate.test.tsx +0 -82
  147. package/tests/ProductSet/ProductSetPopover.test.tsx +0 -40
  148. package/tests/Report/Report.test.tsx +0 -48
  149. package/tests/Sales/Coupon.test.tsx +0 -51
  150. package/tests/Sales/SalesAndVIews.test.tsx +0 -63
  151. package/tests/SnippetTemplates/SnippetTemplates.test.tsx +0 -56
  152. package/tests/Table/FilterHelperComponent.test.tsx +0 -88
  153. package/tests/Table/PaginationHelperComponent.test.tsx +0 -109
  154. package/tests/Table/PerPageHelperComponent.test.tsx +0 -34
  155. package/tests/Table/TableHelperComponent.test.tsx +0 -295
  156. package/tests/TipTapEditor/TipTapEditor.test.tsx +0 -28
  157. package/tests/__mock__/hooks/useAuthApi.ts +0 -13
  158. package/tests/__mock__/hooks/useAuthMock.ts +0 -13
  159. package/tests/__mock__/hooks/useFormMock.ts +0 -27
  160. package/tests/__mock__/hooks/useNotificationMock.ts +0 -13
  161. package/tests/__mock__/hooks/useQueryMock.ts +0 -16
  162. package/tests/__mock__/hooks/useSocialApiMock.ts +0 -20
  163. package/tests/__mock__/hooks/useTranslationMock.ts +0 -17
  164. package/tests/__mock__/hooks/useUserApiMock.ts +0 -18
  165. package/tests/__mock__/hooks/useUserMock.ts +0 -13
  166. package/tests/__mock__/styleMock.js +0 -1
  167. package/tests/__mock__/windowMock.ts +0 -5
  168. package/tests/packages/react-query.tsx +0 -28
  169. 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 = (date: string, time: string): DateTime | string => {
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/src/DataMapper/Order/OrderDataMapper";
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(totalAmount, {
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((key) => (
65
- <option key={key} value={key}>
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 { generateDatesArray, generateYearsArray } from "../utils";
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 = generateDatesArray(1, 12, 1);
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 ?? t("yes") },
26
+ { id: 1, value: firstValueTitle ?? t("yes") },
27
27
  { id: 0, value: secondValueTitle ?? t("no") },
28
28
  ];
29
29
 
@@ -4,4 +4,14 @@
4
4
  align-items: center;
5
5
  gap: 0.5rem;
6
6
  font-weight: 300;
7
+
8
+ @include media-breakpoint-down(sm) {
9
+ div {
10
+ display: none;
11
+ }
12
+
13
+ svg {
14
+ scale: 2;
15
+ }
16
+ }
7
17
  }
@@ -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: 1.125rem;
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 $snippet-elements-button-background-color;
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.875rem;
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
  }
@@ -3,7 +3,7 @@
3
3
  display: flex;
4
4
  align-items: center;
5
5
  justify-content: space-between;
6
- padding: 0 0.75rem;
6
+ padding: 0 0.75rem 0 2rem;
7
7
  height: 2rem;
8
8
  width: 100%;
9
9
  font-size: 0.75rem;
@@ -27,4 +27,4 @@
27
27
  color: $blue;
28
28
  }
29
29
  }
30
- }
30
+ }
@@ -58,8 +58,6 @@
58
58
 
59
59
  .payment-booking-summary {
60
60
  transition: $color-transition;
61
- background-color: transparent;
62
- border: 1px solid transparent;
63
61
  border-radius: $iframe-border-radius;
64
62
  font-weight: 400;
65
63
  font-size: 0.875rem;
@@ -21,6 +21,7 @@
21
21
 
22
22
  @include media-breakpoint-down(sm) {
23
23
  height: 100svh;
24
+ min-width: auto;
24
25
  }
25
26
 
26
27
  .header-block {