@licklist/design 0.59.0-dev.9 → 0.60.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.
Files changed (192) hide show
  1. package/bitbucket-pipelines.yml +8 -0
  2. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +1 -3
  3. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
  4. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -1
  5. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +1 -3
  6. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  7. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +1 -1
  8. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +1 -3
  9. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
  10. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
  11. package/dist/iframe/activity-card/ActivityCard.d.ts +1 -2
  12. package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
  13. package/dist/iframe/activity-card/ActivityCard.js +1 -1
  14. package/dist/iframe/event/event-card/IframeEventCard.d.ts +1 -2
  15. package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
  16. package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
  17. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
  18. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
  19. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
  20. package/dist/iframe/page/components/PageBody/constants.d.ts +1 -1
  21. package/dist/iframe/page/components/PageBody/constants.d.ts.map +1 -1
  22. package/dist/iframe/page/components/PageBody/constants.js +1 -1
  23. package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.js +1 -1
  24. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
  25. package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
  26. package/dist/iframe/ryft/RyftPaymentForm.d.ts +1 -3
  27. package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
  28. package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
  29. package/dist/iframe/ryft/utils/ryft-form.d.ts +1 -2
  30. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
  31. package/dist/iframe/ryft/utils/ryft-form.js +1 -1
  32. package/dist/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
  33. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  34. package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
  35. package/dist/product-set/control/DateInput.d.ts.map +1 -1
  36. package/dist/product-set/control/DateInput.js +1 -1
  37. package/dist/product-set/control/ProductSetControl.d.ts +1 -1
  38. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  39. package/dist/product-set/form/ProductSetForm.d.ts +1 -4
  40. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  41. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
  42. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  43. package/dist/product-set/product/ProductControl.js +1 -1
  44. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
  45. package/dist/product-set/product-category/ProductCategoryControl.d.ts +0 -1
  46. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  47. package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
  48. package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
  49. package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
  50. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +1 -1
  51. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +1 -3
  52. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  53. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  54. package/dist/recurring-date-picker-input/utils.d.ts +0 -12
  55. package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
  56. package/dist/recurring-date-picker-input/utils.js +1 -1
  57. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  58. package/dist/sales/booking/results/components/ResultCard.js +1 -1
  59. package/dist/sales/coupon/control/CouponFormControl.d.ts +1 -2
  60. package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
  61. package/dist/sales/coupon/control/CouponFormControl.js +1 -1
  62. package/dist/sales/coupon/form/CouponFrom.d.ts +2 -2
  63. package/dist/sales/coupon/form/CouponFrom.d.ts.map +1 -1
  64. package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
  65. package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
  66. package/dist/setting/dashboard/DashboardSettingForm.d.ts +0 -1
  67. package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
  68. package/dist/setting/dashboard/DashboardSettingForm.js +1 -1
  69. package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
  70. package/dist/static/manual-date-picker/constants/index.d.ts +1 -4
  71. package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
  72. package/dist/static/manual-date-picker/constants/index.js +1 -1
  73. package/dist/static/manual-date-picker/utils/index.d.ts +0 -4
  74. package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
  75. package/dist/static/manual-date-picker/utils/index.js +1 -1
  76. package/dist/styles/activity-card/ListActivitiesCard.scss +1 -1
  77. package/dist/styles/iframe-events/Card.scss +8 -24
  78. package/dist/styles/iframe-events/PoweredBy.scss +2 -2
  79. package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -5
  80. package/dist/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
  81. package/dist/styles/iframe-page/Page.scss +0 -1
  82. package/dist/styles/iframe-page/PageBody.scss +9 -32
  83. package/dist/styles/iframe-page/PageHeader.scss +39 -41
  84. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +113 -99
  85. package/dist/styles/sales/BookingResults.scss +1 -1
  86. package/dist/typeahead/Typeahead.d.ts +1 -2
  87. package/dist/typeahead/Typeahead.d.ts.map +1 -1
  88. package/dist/typeahead/Typeahead.js +1 -1
  89. package/dist/zone/form/ZoneForm.d.ts +2 -2
  90. package/dist/zone/form/ZoneForm.d.ts.map +1 -1
  91. package/dist/zone/form/ZoneForm.js +1 -1
  92. package/dist/zone/form/components/ZoneControl.d.ts +2 -2
  93. package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
  94. package/dist/zone/form/components/ZoneControl.js +1 -1
  95. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
  96. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
  97. package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
  98. package/dist/zone/form/utils/dates.d.ts.map +1 -1
  99. package/jest.config.js +29 -0
  100. package/package.json +35 -10
  101. package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +0 -4
  102. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +8 -10
  103. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +0 -4
  104. package/src/iframe/activity-card/ActivityCard.tsx +2 -4
  105. package/src/iframe/event/event-card/IframeEventCard.stories.tsx +0 -1
  106. package/src/iframe/event/event-card/IframeEventCard.tsx +8 -7
  107. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +1 -1
  108. package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +1 -3
  109. package/src/iframe/page/components/PageBody/constants.ts +1 -1
  110. package/src/iframe/page/components/PageBody/hooks/useResizePageBody.ts +3 -3
  111. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -6
  112. package/src/iframe/payment/payment-page/PaymentPage.tsx +2 -2
  113. package/src/iframe/ryft/RyftPaymentForm.tsx +3 -20
  114. package/src/iframe/ryft/utils/ryft-form.ts +5 -11
  115. package/src/product-set/control/DateAndRecurrenceInput.tsx +2 -3
  116. package/src/product-set/control/DateInput.tsx +5 -4
  117. package/src/product-set/control/ProductSetControl.tsx +1 -1
  118. package/src/product-set/form/ProductCategoriesControl.tsx +1 -1
  119. package/src/product-set/form/ProductSetForm.tsx +1 -5
  120. package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -2
  121. package/src/product-set/product/ProductControl.tsx +38 -38
  122. package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +2 -0
  123. package/src/product-set/product-category/ProductCategoryControl.tsx +27 -89
  124. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +18 -4
  125. package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +1 -0
  126. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -11
  127. package/src/recurring-date-picker-input/utils.ts +0 -77
  128. package/src/sales/booking/results/BookingResults.stories.tsx +2 -3
  129. package/src/sales/booking/results/components/ResultCard.tsx +5 -2
  130. package/src/sales/coupon/control/CouponFormControl.tsx +50 -29
  131. package/src/sales/coupon/form/CouponFrom.tsx +15 -5
  132. package/src/setting/admin/AdminSettingForm.tsx +2 -2
  133. package/src/setting/dashboard/DashboardSettingForm.tsx +0 -13
  134. package/src/sortable-tree/SortableTreeItem.tsx +1 -1
  135. package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
  136. package/src/static/manual-date-picker/constants/index.ts +2 -6
  137. package/src/static/manual-date-picker/utils/index.ts +0 -11
  138. package/src/static/switch/BooleanSwitch.tsx +1 -1
  139. package/src/styles/activity-card/ListActivitiesCard.scss +1 -1
  140. package/src/styles/iframe-events/Card.scss +8 -24
  141. package/src/styles/iframe-events/PoweredBy.scss +2 -2
  142. package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -5
  143. package/src/styles/iframe-order-process/IframeOrderProcess.scss +2 -0
  144. package/src/styles/iframe-page/Page.scss +0 -1
  145. package/src/styles/iframe-page/PageBody.scss +9 -32
  146. package/src/styles/iframe-page/PageHeader.scss +39 -41
  147. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +113 -99
  148. package/src/styles/sales/BookingResults.scss +1 -1
  149. package/src/typeahead/Typeahead.tsx +3 -16
  150. package/src/zone/form/ZoneForm.tsx +2 -3
  151. package/src/zone/form/components/ZoneControl.tsx +3 -3
  152. package/src/zone/form/components/ZoneRecurrencesControl.tsx +5 -7
  153. package/src/zone/form/utils/dates.ts +10 -9
  154. package/tests/Auth/Authorizer.test.tsx +194 -0
  155. package/tests/Auth/Layout/UserNavDropDown.test.tsx +43 -0
  156. package/tests/Auth/Layout/UserNavDropDownToggle.test.tsx +33 -0
  157. package/tests/Auth/Login/LoginComponent.test.tsx +246 -0
  158. package/tests/Auth/Login/LoginFormComponent.test.tsx +182 -0
  159. package/tests/Auth/Register/RegisterComponent.test.tsx +285 -0
  160. package/tests/Auth/Register/RegisterFormComponent.test.tsx +170 -0
  161. package/tests/Auth/Settings/Dashboard/IpInput.test.tsx +130 -0
  162. package/tests/Auth/Social/SocialCallbackComponent.test.tsx +133 -0
  163. package/tests/Auth/Social/SocialFormComponent.test.tsx +118 -0
  164. package/tests/FileUpload/FileUpload.test.tsx +42 -0
  165. package/tests/Notification/EmailTemplate.test.tsx +82 -0
  166. package/tests/ProductSet/ProductSetPopover.test.tsx +40 -0
  167. package/tests/Report/Report.test.tsx +48 -0
  168. package/tests/Sales/Coupon.test.tsx +51 -0
  169. package/tests/Sales/SalesAndVIews.test.tsx +63 -0
  170. package/tests/SnippetTemplates/SnippetTemplates.test.tsx +56 -0
  171. package/tests/Table/FilterHelperComponent.test.tsx +88 -0
  172. package/tests/Table/PaginationHelperComponent.test.tsx +109 -0
  173. package/tests/Table/PerPageHelperComponent.test.tsx +34 -0
  174. package/tests/Table/TableHelperComponent.test.tsx +295 -0
  175. package/tests/TipTapEditor/TipTapEditor.test.tsx +28 -0
  176. package/tests/__mock__/hooks/useAuthApi.ts +13 -0
  177. package/tests/__mock__/hooks/useAuthMock.ts +13 -0
  178. package/tests/__mock__/hooks/useFormMock.ts +27 -0
  179. package/tests/__mock__/hooks/useNotificationMock.ts +13 -0
  180. package/tests/__mock__/hooks/useQueryMock.ts +16 -0
  181. package/tests/__mock__/hooks/useSocialApiMock.ts +20 -0
  182. package/tests/__mock__/hooks/useTranslationMock.ts +17 -0
  183. package/tests/__mock__/hooks/useUserApiMock.ts +18 -0
  184. package/tests/__mock__/hooks/useUserMock.ts +13 -0
  185. package/tests/__mock__/styleMock.js +1 -0
  186. package/tests/__mock__/windowMock.ts +5 -0
  187. package/tests/packages/react-query.tsx +28 -0
  188. package/tests/setupTests.ts +10 -0
  189. package/dist/sales/coupon/utils/index.d.ts +0 -7
  190. package/dist/sales/coupon/utils/index.d.ts.map +0 -1
  191. package/dist/sales/coupon/utils/index.js +0 -1
  192. package/src/sales/coupon/utils/index.ts +0 -13
@@ -1,8 +1,4 @@
1
- import { TIME_FORMAT } from "@licklist/core/dist/Config";
2
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
3
- import { dateTimesSortFn } from "@licklist/plugins/dist/utils/dateTime";
4
1
  import { DateTime } from "luxon";
5
- import { useTranslation } from "react-i18next";
6
2
  import RRule, { Frequency, Weekday } from "rrule";
7
3
 
8
4
  export const getWeekdayForFrequency = ({
@@ -15,7 +11,6 @@ export const getWeekdayForFrequency = ({
15
11
  const parsedDate = DateTime.fromISO(date);
16
12
  return new Weekday(
17
13
  parsedDate.weekday - 1,
18
- // eslint-disable-next-line no-nested-ternary
19
14
  frequency !== Frequency.MONTHLY
20
15
  ? undefined
21
16
  : parsedDate.day + 7 > parsedDate.daysInMonth
@@ -114,75 +109,3 @@ export const parseAndValidateRRule = ({
114
109
  until: options.until,
115
110
  } as ParsedRRuleOptions;
116
111
  };
117
-
118
- export const useWorkHoursValidationRules = (
119
- byWeekDay: Weekday[] = [],
120
- workHours: WorkHour[] | undefined
121
- ) => {
122
- const { t } = useTranslation("Validation");
123
- if (!workHours) return {};
124
-
125
- // workhours of selected days, all if no days selected
126
- const selectedWorkHours = byWeekDay.length
127
- ? byWeekDay.map(({ weekday }) =>
128
- workHours.find(({ day }) => day === weekday)
129
- )
130
- : workHours;
131
-
132
- /**
133
- * start time
134
- */
135
- const startTimes = selectedWorkHours
136
- .map((workhour) => DateTime.fromFormat(workhour.start, TIME_FORMAT))
137
- .sort(dateTimesSortFn("desc"));
138
-
139
- const latestStartTime = startTimes[0];
140
-
141
- const startTimeRules = {
142
- validate: (date: string) => {
143
- const selectedDate = DateTime.fromFormat(date, TIME_FORMAT);
144
- if (selectedDate >= latestStartTime) return true;
145
-
146
- return t("fieldTimeAfter", {
147
- attribute: t("Design:startTimeSmall"),
148
- time: latestStartTime.toFormat(TIME_FORMAT),
149
- });
150
- },
151
- };
152
-
153
- /**
154
- * end time
155
- */
156
- const endTimes = selectedWorkHours
157
- .map<string>(({ start, end }) => {
158
- const startDateTime = DateTime.fromFormat(start, TIME_FORMAT);
159
- const endDateTime = DateTime.fromFormat(end, TIME_FORMAT);
160
-
161
- if (startDateTime <= endDateTime) return end;
162
-
163
- // if end is before start, then it means that end is on the next day
164
- // so count only to the end of current day
165
- return "23:59";
166
- })
167
- .map((workhour) => DateTime.fromFormat(workhour, TIME_FORMAT))
168
- .sort(dateTimesSortFn("asc"));
169
-
170
- const earliestEndTime = endTimes[0];
171
-
172
- const endTimeRules = {
173
- validate: (date: string) => {
174
- const selectedDate = DateTime.fromFormat(date, TIME_FORMAT);
175
- if (selectedDate <= earliestEndTime) return true;
176
-
177
- return t("fieldTimeBefore", {
178
- attribute: t("Design:endTimeSmall"),
179
- time: earliestEndTime.toFormat(TIME_FORMAT),
180
- });
181
- },
182
- };
183
-
184
- return {
185
- startTimeRules,
186
- endTimeRules,
187
- };
188
- };
@@ -3,12 +3,11 @@ 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";
6
7
  import {
7
- Order,
8
8
  ORDER_SOURCE_IFRAME,
9
9
  ORDER_SOURCE_MANUAL,
10
- } from "@licklist/core/dist/DataMapper/Order/OrderDataMapper";
11
-
10
+ } from "@licklist/core/src/DataMapper/Order/OrderDataMapper";
12
11
  import { BookingResults } from "./BookingResults";
13
12
 
14
13
  export default {
@@ -12,6 +12,7 @@ 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
+
15
16
  import Icon from "../../../../static/Icon";
16
17
 
17
18
  export type ResultCardProps = {
@@ -21,6 +22,8 @@ export type ResultCardProps = {
21
22
  onCardClick?: (id: number) => void;
22
23
  };
23
24
 
25
+ // @TODO integrate when API will be available
26
+ // activity and staff keys
24
27
  export const ResultCard = ({
25
28
  order,
26
29
  className,
@@ -38,10 +41,10 @@ export const ResultCard = ({
38
41
  startDate,
39
42
  products,
40
43
  source,
44
+ totalAmount,
41
45
  event,
42
46
  menu,
43
47
  remainingToPay,
44
- paidAmount,
45
48
  } = order;
46
49
 
47
50
  const productList = products.map((product) => product.name)?.join(", ") || "";
@@ -105,7 +108,7 @@ export const ResultCard = ({
105
108
  )}
106
109
  <p>
107
110
  {t("paidAmount")}:{" "}
108
- {formatNumber(paidAmount, {
111
+ {formatNumber(totalAmount, {
109
112
  style: "currency",
110
113
  currency: Config.Currency.GBP,
111
114
  })}
@@ -21,14 +21,12 @@ import couponCodeRules from "@licklist/plugins/dist/validation/Rules/couponCodeR
21
21
  // import { useId } from "@react-aria/utils";
22
22
 
23
23
  import HTMLInputDateElement from "../../../types/static/HTMLInputDateElement";
24
- import { Typeahead, TypeaheadOptions } from "../../../typeahead";
25
- import { convertToTypeaheadOptions } from "../utils";
26
24
 
27
25
  export interface CouponFormValues {
28
26
  name?: string;
29
27
  code: string;
30
28
  discountType: CouponType;
31
- productGroupIds: Array<TypeaheadOptions | ProductGroup>;
29
+ productGroupIds: string[];
32
30
  discount: number;
33
31
  totalType: CouponTotalType;
34
32
  startFrom: string;
@@ -60,9 +58,9 @@ export const CouponFormControl = ({
60
58
  watch,
61
59
  } = useFormContext<CouponFormValues>();
62
60
  const { t } = useTranslation(["Design", "Notification", "App"]);
63
- const [selectedProductGroups, setSelectedProductGroups] = useState<
64
- TypeaheadOptions[]
65
- >([]);
61
+ const [selectedProductGroups, setSelectedProductGroups] = useState<string[]>(
62
+ []
63
+ );
66
64
  /* TODO: Show Recurrent date, when reccurent date bugs are fixed */
67
65
  // const rrule = watch("rrule");
68
66
  // const [recurrent, setRecurrent] = useState(Boolean(rrule));
@@ -87,20 +85,15 @@ export const CouponFormControl = ({
87
85
  [COUPON_TOTAL_TYPE_TOTAL]: t("Design:depositTotal"),
88
86
  };
89
87
 
88
+ // Set pre-selected Product Groups
90
89
  useEffect(() => {
91
- const defaultProductGroup = getValues("productGroupIds");
92
-
93
- setSelectedProductGroups(
94
- convertToTypeaheadOptions(defaultProductGroup as ProductGroup[])
95
- );
90
+ setSelectedProductGroups(getValues("productGroupIds"));
96
91
  }, [getValues]);
97
92
 
98
93
  useEffect(() => {
99
94
  setValue("productGroupIds", selectedProductGroups);
100
95
  }, [getValues, setValue, selectedProductGroups]);
101
96
 
102
- const productGroupList = convertToTypeaheadOptions(productGroups);
103
-
104
97
  /* TODO: Show Recurrent date, when reccurent date bugs are fixed */
105
98
  // useEffect(() => {
106
99
  // if (!recurrent && rrule) {
@@ -258,23 +251,51 @@ export const CouponFormControl = ({
258
251
  </Form.Group>
259
252
  </Col>
260
253
  </Row>
261
- <Row>
262
- <Col>
263
- <Form.Group className="mb-3">
264
- <Form.Label>{t("Design:productGroups")}</Form.Label>
265
- <Typeahead
266
- name="productGroupIds"
267
- options={productGroupList}
268
- isMultipleChoise
269
- isCouponForm
270
- placeholder={t("Design:choose")}
271
- noOptionsMessage={t("Design:noActiveTemplates", {
272
- notification: t("Design:email"),
254
+ {productGroups && productGroups?.length > 0 && (
255
+ <Row>
256
+ <Col md={12}>
257
+ <h5 className="mt-4">{t("Design:productGroups")}</h5>
258
+ <Form.Group className="d-flex flex-wrap justify-content-between mt-4 mb-5">
259
+ {productGroups?.map((productGroup) => {
260
+ const isGroupSelected =
261
+ getValues("productGroupIds")?.includes(
262
+ String(productGroup.id)
263
+ ) ?? false;
264
+
265
+ return (
266
+ <Form.Check
267
+ key={productGroup.id}
268
+ label={productGroup.name}
269
+ defaultChecked={isGroupSelected}
270
+ disabled={isLoading}
271
+ onChange={(e) => {
272
+ if (e.target.checked) {
273
+ setSelectedProductGroups((prevGroups) =>
274
+ Array.from(
275
+ new Set([...prevGroups, String(productGroup.id)])
276
+ )
277
+ );
278
+ } else {
279
+ setSelectedProductGroups((prevGroups) => {
280
+ return prevGroups.filter(
281
+ (id) => String(productGroup.id) !== id
282
+ );
283
+ });
284
+ }
285
+ }}
286
+ />
287
+ );
273
288
  })}
274
- />
275
- </Form.Group>
276
- </Col>
277
- </Row>
289
+ <Form.Control
290
+ {...register("productGroupIds")}
291
+ hidden
292
+ value={selectedProductGroups}
293
+ disabled={isLoading}
294
+ />
295
+ </Form.Group>
296
+ </Col>
297
+ </Row>
298
+ )}
278
299
 
279
300
  {/* TODO: Show Recurrent date, when reccurent date bugs are fixed */}
280
301
  {/* {startFromValue && (
@@ -1,8 +1,5 @@
1
1
  import React, { useEffect } from "react";
2
- import {
3
- ProductGroup,
4
- ProductGroupDTO,
5
- } from "@licklist/core/dist/DataMapper/Product/ProductGroupDataMapper";
2
+ import { ProductGroup } from "@licklist/core/dist/DataMapper/Product/ProductGroupDataMapper";
6
3
  import {
7
4
  CouponTotalType,
8
5
  CouponType,
@@ -19,7 +16,7 @@ export interface CouponFormValues {
19
16
  name?: string;
20
17
  code: string;
21
18
  discountType: CouponType;
22
- productGroupIds: ProductGroupDTO[];
19
+ productGroupIds: string[];
23
20
  discount: number;
24
21
  totalType: CouponTotalType;
25
22
  startFrom: string;
@@ -57,6 +54,19 @@ export const CouponForm = ({
57
54
  const { setError } = form;
58
55
  const { t } = useTranslation(["Design", "Notification", "App"]);
59
56
 
57
+ // @TODO: dont need for v1 release
58
+ // const [selectedProductGroups, setSelectedProductGroups] = useState<string[]>(
59
+ // []
60
+ // );
61
+ // Set pre-selected Product Groups
62
+ // useEffect(() => {
63
+ // setSelectedProductGroups(getValues("productGroupIds"));
64
+ // }, [getValues]);
65
+
66
+ // useEffect(() => {
67
+ // setValue("productGroupIds", selectedProductGroups);
68
+ // }, [getValues, setValue, selectedProductGroups]);
69
+
60
70
  useEffect(() => {
61
71
  FormErrorService.handleServerErrors(serverErrors, setError);
62
72
  }, [serverErrors, setError]);
@@ -11,7 +11,7 @@ import Row from "react-bootstrap/Row";
11
11
  import Col from "react-bootstrap/Col";
12
12
  import { Link } from "react-router-dom";
13
13
  import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
14
- import { ProvidableType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
14
+ import { ProviderType } from "@licklist/core/dist/DataMapper/Provider/ProvidableDataMapper";
15
15
  import Icon from "../../static/Icon";
16
16
  import { PaymentFeeForm, PaymentFeeFormFieldValues } from "./PaymentFeeForm";
17
17
  import { Currency } from "../../types/currency";
@@ -33,7 +33,7 @@ export interface AdminSettingFormProps extends HasPermissionProp {
33
33
  providerMetadata: {
34
34
  country?: string;
35
35
  providableId?: number;
36
- providerType?: ProvidableType;
36
+ providerType?: ProviderType;
37
37
  };
38
38
  }
39
39
 
@@ -31,7 +31,6 @@ export type DashboardSettingFormFieldValues = {
31
31
  isEnquiryOnly: boolean;
32
32
  hasUserVerification: boolean;
33
33
  metaPixelId?: number;
34
- eventDeadlineErrorMessage?: string;
35
34
  } & EventSettingFormFieldValues &
36
35
  ProviderSettingFormFieldValues;
37
36
 
@@ -82,7 +81,6 @@ export const DashboardSettingForm = ({
82
81
  const orderReportFormatId = useId();
83
82
  const userVerificationId = useId();
84
83
  const metaPixelId = useId();
85
- const eventDeadlineErrorMessageId = useId();
86
84
 
87
85
  const orderReportFormatList: SelectItem[] = [
88
86
  { id: 1, value: t("groupItemsByOrder") },
@@ -236,17 +234,6 @@ export const DashboardSettingForm = ({
236
234
  <EventSettingForm isLoading={isLoading} />
237
235
 
238
236
  <ProviderSettingForm isLoading={isLoading} />
239
- <Form.Group controlId={eventDeadlineErrorMessageId}>
240
- <Form.Label>{t("eventDeadlineErrorMessage")}</Form.Label>
241
- <Form.Control
242
- {...register("eventDeadlineErrorMessage")}
243
- isInvalid={Boolean(errors.eventDeadlineErrorMessage)}
244
- disabled={isLoading}
245
- />
246
- <Form.Control.Feedback type="invalid">
247
- {errors.eventDeadlineErrorMessage?.message}
248
- </Form.Control.Feedback>
249
- </Form.Group>
250
237
  </FormProvider>
251
238
  {hasPermission && (
252
239
  <Button
@@ -374,7 +374,7 @@ export function SortableTreeItem({
374
374
  items={sortableItems}
375
375
  strategy={verticalListSortingStrategy}
376
376
  >
377
- <Collapse in={expanded}>
377
+ <Collapse in={expanded}>
378
378
  <div className="ml-0">{children}</div>
379
379
  </Collapse>
380
380
  </SortableContext>
@@ -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((object) => (
65
- <option key={object.key} value={object.value}>
66
- {object.key}
64
+ {MONTHS_ARRAY.map((key) => (
65
+ <option key={key} value={key}>
66
+ {key}
67
67
  </option>
68
68
  ))}
69
69
  </Form.Control>
@@ -1,9 +1,5 @@
1
- import {
2
- generateDatesArray,
3
- generateMonthsOptionsArray,
4
- generateYearsArray,
5
- } from "../utils";
1
+ import { generateDatesArray, generateYearsArray } from "../utils";
6
2
 
7
3
  export const DAYS_ARRAY = generateDatesArray(1, 31, 1);
8
- export const MONTHS_ARRAY = generateMonthsOptionsArray();
4
+ export const MONTHS_ARRAY = generateDatesArray(1, 12, 1);
9
5
  export const YEARS_ARRAY = generateYearsArray();
@@ -4,17 +4,6 @@ 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
-
18
7
  export const generateYearsArray = () => {
19
8
  const currentYear = new Date().getFullYear();
20
9
  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
 
@@ -5,7 +5,7 @@
5
5
  justify-content: space-between;
6
6
  align-items: center;
7
7
  cursor: pointer;
8
- height: 6rem;
8
+ height: 5rem;
9
9
  padding: 0.375rem;
10
10
  border: 2px solid transparent;
11
11
  border-radius: 0.5rem;
@@ -1,5 +1,4 @@
1
1
  @import "../snippet-templates/snippetVariables";
2
- @import "../themes//bookedit/variables";
3
2
 
4
3
  .iframe-event-card {
5
4
  position: relative;
@@ -19,27 +18,12 @@
19
18
  background-size: cover;
20
19
  background-position: center;
21
20
  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 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;
26
+ padding: 0.5rem 0 0.875rem;
43
27
  }
44
28
 
45
29
  &__title {
@@ -49,7 +33,7 @@
49
33
  line-height: 1.25rem;
50
34
  cursor: pointer;
51
35
  margin-bottom: 0.5rem;
52
- font-size: 0.95rem;
36
+ font-size: 1.125rem;
53
37
  }
54
38
 
55
39
  &__label {
@@ -98,8 +82,7 @@
98
82
  color: $snippet-elements-button-color;
99
83
  border: none;
100
84
  background-color: $snippet-elements-button-background-color;
101
- box-shadow: 0 0 0 $input-btn-focus-width
102
- $snippet-elements-button-background-color;
85
+ box-shadow: 0 0 0 $input-btn-focus-width $snippet-elements-button-background-color;
103
86
  }
104
87
 
105
88
  &:disabled {
@@ -112,14 +95,14 @@
112
95
  &:focus,
113
96
  &.focus {
114
97
  &:not(:disabled) {
115
- opacity: 0.7;
98
+ opacity: .7;
116
99
  }
117
100
  }
118
101
 
119
102
  &:active,
120
103
  &.active {
121
104
  &:not(:disabled) {
122
- opacity: 0.8;
105
+ opacity: .8;
123
106
  }
124
107
  }
125
108
  }
@@ -140,7 +123,7 @@
140
123
  }
141
124
 
142
125
  .card-text {
143
- font-size: 0.82rem;
126
+ font-size: 0.875rem;
144
127
  }
145
128
 
146
129
  &.event-info {
@@ -219,6 +202,7 @@
219
202
 
220
203
  @media (max-width: 576px) {
221
204
  &.list-view {
205
+
222
206
  .card-image {
223
207
  margin-right: 0.5rem;
224
208
  }
@@ -3,7 +3,7 @@
3
3
  display: flex;
4
4
  align-items: center;
5
5
  justify-content: space-between;
6
- padding: 0 0.75rem 0 2rem;
6
+ padding: 0 0.75rem;
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
+ }
@@ -4,8 +4,7 @@ html[bkdt-scrollable="false"] {
4
4
  overflow: hidden !important;
5
5
  }
6
6
 
7
- body[bkdt-scrollable="false"] .bkdt-modal,
8
- body[bkdt-scrollable="false"] .bkdt-mask {
7
+ body[bkdt-scrollable="false"] .bkdt-modal, body[bkdt-scrollable="false"] .bkdt-mask {
9
8
  display: block;
10
9
  }
11
10
 
@@ -16,7 +15,7 @@ body[bkdt-scrollable="false"] .bkdt-mask {
16
15
  width: 100%;
17
16
  height: 100%;
18
17
  z-index: 1000000;
19
- background-color: rgba(0, 0, 0, 0.5);
18
+ background-color: rgba(0,0,0,0.5);
20
19
  display: none;
21
20
  }
22
21
 
@@ -83,7 +82,6 @@ body[bkdt-scrollable="false"] .bkdt-mask {
83
82
  width: 100%;
84
83
  height: 100%;
85
84
  max-width: 800px;
86
- min-height: unset;
87
85
  }
88
86
  }
89
87
  }
@@ -100,7 +98,6 @@ body[bkdt-scrollable="false"] .bkdt-mask {
100
98
  .bkdt-modal-content {
101
99
  .bkdt-modal-body {
102
100
  height: 35rem;
103
- max-height: 85vh;
104
101
  }
105
102
  }
106
103
  }
@@ -57,6 +57,8 @@
57
57
 
58
58
  .payment-booking-summary {
59
59
  transition: $color-transition;
60
+ background-color: transparent;
61
+ border: 1px solid transparent;
60
62
  border-radius: $iframe-border-radius;
61
63
  font-weight: 400;
62
64
  font-size: 0.875rem;
@@ -21,7 +21,6 @@
21
21
 
22
22
  @include media-breakpoint-down(sm) {
23
23
  height: 100svh;
24
- min-width: auto;
25
24
  }
26
25
 
27
26
  .header-block {
@@ -13,6 +13,9 @@
13
13
  .left-block {
14
14
  flex: 1;
15
15
  align-items: stretch;
16
+ border-radius: 0.5rem;
17
+ border-bottom-left-radius: 0;
18
+ border-bottom-right-radius: 0;
16
19
  padding: 1rem;
17
20
  background-color: $snippet-page-body-left-block-background-color;
18
21
  border: 0;
@@ -31,6 +34,7 @@
31
34
  display: flex;
32
35
  align-items: flex-start;
33
36
  justify-content: space-between;
37
+
34
38
  .title {
35
39
  color: $snippet-elements-body-color;
36
40
  margin: 0;
@@ -61,7 +65,7 @@
61
65
  overflow-x: hidden;
62
66
  scrollbar-width: thin;
63
67
  .iframe-event-card {
64
- border-bottom: 1px solid $separator-color;
68
+ border-bottom: 2px solid $separator-color;
65
69
  }
66
70
 
67
71
  @include media-breakpoint-down(sm) {
@@ -110,7 +114,7 @@
110
114
  }
111
115
 
112
116
  .collapse {
113
- max-height: calc(100vh - 15rem);
117
+ max-height: calc(100vh - 19rem);
114
118
  transition: none 0s ease 0s;
115
119
 
116
120
  &.show {
@@ -120,7 +124,7 @@
120
124
  }
121
125
 
122
126
  @include media-breakpoint-down(sm) {
123
- max-height: 100%;
127
+ max-height: 7.5rem;
124
128
  }
125
129
  }
126
130
  .collapse-with-people-input {
@@ -146,14 +150,8 @@
146
150
  }
147
151
 
148
152
  .iframe-event-card {
149
- border: none;
150
-
151
- .card-image {
152
- border-radius: 0;
153
- }
154
- .card-body {
155
- padding-left: 1rem;
156
- }
153
+ background-color: transparent;
154
+ border-color: transparent;
157
155
  }
158
156
 
159
157
  .price {
@@ -263,24 +261,3 @@
263
261
  }
264
262
  }
265
263
  }
266
-
267
- .event-list-page-body {
268
- overflow: auto;
269
- .left-block {
270
- .navigation {
271
- font-size: 1.125rem;
272
- font-weight: 500;
273
- padding-bottom: 2.625rem;
274
- display: flex;
275
- align-items: flex-start;
276
- justify-content: space-between;
277
- margin-top: 0.125rem;
278
-
279
- .title {
280
- position: absolute;
281
- color: $snippet-elements-body-color;
282
- margin: 0;
283
- }
284
- }
285
- }
286
- }