@licklist/design 0.58.6-dev.9 → 0.58.6

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 (243) hide show
  1. package/bitbucket-pipelines.yml +8 -0
  2. package/dist/assets/iframe/calendar.svg +2 -2
  3. package/dist/assets/iframe/calendar.svg.js +1 -1
  4. package/dist/assets/iframe/ticket.svg +2 -2
  5. package/dist/assets/iframe/ticket.svg.js +1 -1
  6. package/dist/calendar/Calendar.d.ts +1 -1
  7. package/dist/calendar/Calendar.d.ts.map +1 -1
  8. package/dist/calendar/Calendar.js +1 -1
  9. package/dist/calendar/components/CalendarButtons/CalendarButtons.js +1 -1
  10. package/dist/calendar/components/CalendarDates/CalendarDates.d.ts +2 -2
  11. package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
  12. package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -1
  13. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -1
  14. package/dist/events/event-statistic-modal/EventStatisticModal.js +1 -1
  15. package/dist/iframe/event/event-card/IframeEventCard.d.ts +1 -2
  16. package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
  17. package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
  18. package/dist/iframe/event/event-venue-map/IframeEventVenueMap.js +1 -1
  19. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts +2 -2
  20. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
  21. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
  22. package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.d.ts +2 -4
  23. package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.d.ts.map +1 -1
  24. package/dist/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.js +1 -1
  25. package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.d.ts +1 -1
  26. package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.d.ts.map +1 -1
  27. package/dist/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js +1 -1
  28. package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.d.ts +2 -4
  29. package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.d.ts.map +1 -1
  30. package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.js +1 -1
  31. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +0 -4
  32. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
  33. package/dist/iframe/order-process/components/CalendarStepsForm/CalendarStepsForm.js +1 -1
  34. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
  35. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
  36. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
  37. package/dist/iframe/page/components/PageBody/constants.d.ts +0 -1
  38. package/dist/iframe/page/components/PageBody/constants.d.ts.map +1 -1
  39. package/dist/iframe/page/components/PageBody/constants.js +1 -1
  40. package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.d.ts.map +1 -1
  41. package/dist/iframe/page/components/PageBody/hooks/useResizePageBody.js +1 -1
  42. package/dist/iframe/payment/order-items-table/OrderItemsTable.js +1 -1
  43. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
  44. package/dist/iframe/payment/payment-form/PaymentForm.js +1 -1
  45. package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
  46. package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
  47. package/dist/iframe/payment/payment-page/PaymentTimer.js +1 -1
  48. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +1 -1
  49. package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
  50. package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/product-set/card/ProductSetCard.d.ts +1 -2
  53. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  54. package/dist/product-set/card/ProductSetCard.js +1 -1
  55. package/dist/product-set/control/ProductSetControl.d.ts +1 -2
  56. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  57. package/dist/product-set/control/ProductSetControl.js +1 -1
  58. package/dist/product-set/control/TutorialGifCard.d.ts +1 -2
  59. package/dist/product-set/control/TutorialGifCard.d.ts.map +1 -1
  60. package/dist/product-set/control/TutorialGifCard.js +1 -1
  61. package/dist/product-set/form/ProductCategoriesControl.d.ts +1 -2
  62. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  63. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  64. package/dist/product-set/form/ProductSetForm.d.ts +2 -7
  65. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  66. package/dist/product-set/form/ProductSetForm.js +1 -1
  67. package/dist/product-set/form/ProductsControl.d.ts +1 -2
  68. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  69. package/dist/product-set/form/ProductsControl.js +1 -1
  70. package/dist/product-set/form/StepsControl.d.ts +1 -2
  71. package/dist/product-set/form/StepsControl.d.ts.map +1 -1
  72. package/dist/product-set/form/StepsControl.js +1 -1
  73. package/dist/product-set/form/SubProductsControl.d.ts +1 -2
  74. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  75. package/dist/product-set/form/SubProductsControl.js +1 -1
  76. package/dist/product-set/form/VenueMapsControl.js +1 -1
  77. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts +1 -2
  78. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
  79. package/dist/product-set/hooks/useSortableTreeFunctions.js +1 -1
  80. package/dist/product-set/item/CreateProductSetItem.d.ts +1 -2
  81. package/dist/product-set/item/CreateProductSetItem.d.ts.map +1 -1
  82. package/dist/product-set/item/CreateProductSetItem.js +1 -1
  83. package/dist/product-set/product/ProductControl.d.ts +1 -3
  84. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  85. package/dist/product-set/product/ProductControl.js +1 -1
  86. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts +2 -4
  87. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
  88. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.js +1 -1
  89. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts +0 -1
  90. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  91. package/dist/product-set/product/quantity/ProductQuantityControl.js +1 -1
  92. package/dist/product-set/product-category/ProductCategoryControl.d.ts +1 -3
  93. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  94. package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
  95. package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
  96. package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
  97. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +0 -2
  98. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  99. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  100. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  101. package/dist/sales/booking/results/components/ResultCard.js +1 -1
  102. package/dist/sales/notes/NotesTableRow.js +1 -1
  103. package/dist/setting/dashboard/snippets/card/SnippetCard.js +1 -1
  104. package/dist/snippet/snippet-template/control/PropertyControl.d.ts +1 -3
  105. package/dist/snippet/snippet-template/control/PropertyControl.d.ts.map +1 -1
  106. package/dist/snippet/snippet-template/control/PropertyControl.js +1 -1
  107. package/dist/snippet/snippet-template/preview/Preview.js +1 -1
  108. package/dist/sortable-list/SortableList.d.ts +1 -2
  109. package/dist/sortable-list/SortableList.d.ts.map +1 -1
  110. package/dist/sortable-list/SortableList.js +1 -1
  111. package/dist/sortable-tree/SortableTreeItem.d.ts +1 -3
  112. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  113. package/dist/sortable-tree/SortableTreeItem.js +1 -1
  114. package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
  115. package/dist/static/manual-date-picker/constants/index.d.ts +1 -4
  116. package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
  117. package/dist/static/manual-date-picker/constants/index.js +1 -1
  118. package/dist/static/manual-date-picker/utils/index.d.ts +0 -4
  119. package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
  120. package/dist/static/manual-date-picker/utils/index.js +1 -1
  121. package/dist/striped-static-table/StripedStaticTable.js +1 -1
  122. package/dist/styles/iframe-events/Card.scss +8 -24
  123. package/dist/styles/iframe-events/PoweredBy.scss +2 -2
  124. package/dist/styles/iframe-order-process/IframeOrderProcess.scss +20 -57
  125. package/dist/styles/iframe-page/Page.scss +0 -1
  126. package/dist/styles/iframe-page/PageBody.scss +12 -34
  127. package/dist/styles/iframe-page/PageHeader.scss +39 -41
  128. package/dist/styles/product-set/EditVenueMapSetModal.scss +1 -1
  129. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +2 -125
  130. package/dist/styles/sales/BookingResults.scss +1 -1
  131. package/dist/venue-map-sets/form/components/VenueMapImageControl.js +1 -1
  132. package/jest.config.js +29 -0
  133. package/package.json +35 -10
  134. package/src/assets/iframe/calendar.svg +2 -2
  135. package/src/assets/iframe/ticket.svg +2 -2
  136. package/src/calendar/Calendar.stories.tsx +0 -23
  137. package/src/calendar/Calendar.tsx +5 -5
  138. package/src/calendar/components/CalendarDates/CalendarDates.tsx +5 -0
  139. package/src/iframe/event/event-card/IframeEventCard.stories.tsx +0 -1
  140. package/src/iframe/event/event-card/IframeEventCard.tsx +8 -7
  141. package/src/iframe/order-process/components/BookingSummary/BookingSummary.stories.tsx +0 -9
  142. package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +7 -58
  143. package/src/iframe/order-process/components/BookingSummary/components/BookingSummaryAccordion/BookingSummaryAccordion.tsx +0 -8
  144. package/src/iframe/order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.tsx +4 -4
  145. package/src/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.tsx +10 -63
  146. package/src/iframe/order-process/components/BookingSummary/types/index.ts +0 -4
  147. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +1 -1
  148. package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +1 -3
  149. package/src/iframe/page/components/PageBody/constants.ts +0 -2
  150. package/src/iframe/page/components/PageBody/hooks/useResizePageBody.ts +0 -10
  151. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -6
  152. package/src/iframe/payment/payment-page/PaymentPage.stories.tsx +6 -546
  153. package/src/iframe/payment/payment-page/PaymentPage.tsx +29 -38
  154. package/src/iframe/ryft/RyftPaymentForm.tsx +5 -11
  155. package/src/product-set/card/ProductSetCard.tsx +1 -12
  156. package/src/product-set/control/ProductSetControl.tsx +24 -46
  157. package/src/product-set/control/TutorialGifCard.tsx +3 -11
  158. package/src/product-set/form/ProductCategoriesControl.tsx +1 -12
  159. package/src/product-set/form/ProductSetForm.tsx +1 -10
  160. package/src/product-set/form/ProductsControl.tsx +0 -10
  161. package/src/product-set/form/StepsControl.tsx +2 -8
  162. package/src/product-set/form/SubProductsControl.tsx +0 -3
  163. package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -6
  164. package/src/product-set/item/CreateProductSetItem.tsx +0 -3
  165. package/src/product-set/product/ProductControl.tsx +15 -48
  166. package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +2 -8
  167. package/src/product-set/product/quantity/ProductQuantityControl.tsx +3 -4
  168. package/src/product-set/product-category/ProductCategoryControl.tsx +50 -116
  169. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +18 -4
  170. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -4
  171. package/src/sales/booking/results/BookingResults.stories.tsx +2 -3
  172. package/src/sales/booking/results/components/ResultCard.tsx +5 -2
  173. package/src/snippet/snippet-template/control/PropertyControl.tsx +2 -6
  174. package/src/sortable-list/SortableList.tsx +0 -3
  175. package/src/sortable-tree/SortableTreeItem.tsx +0 -6
  176. package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
  177. package/src/static/manual-date-picker/constants/index.ts +2 -6
  178. package/src/static/manual-date-picker/utils/index.ts +0 -11
  179. package/src/static/switch/BooleanSwitch.tsx +1 -1
  180. package/src/styles/iframe-events/Card.scss +8 -24
  181. package/src/styles/iframe-events/PoweredBy.scss +2 -2
  182. package/src/styles/iframe-order-process/IframeOrderProcess.scss +20 -57
  183. package/src/styles/iframe-page/Page.scss +0 -1
  184. package/src/styles/iframe-page/PageBody.scss +12 -34
  185. package/src/styles/iframe-page/PageHeader.scss +39 -41
  186. package/src/styles/product-set/EditVenueMapSetModal.scss +1 -1
  187. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +2 -125
  188. package/src/styles/sales/BookingResults.scss +1 -1
  189. package/tests/Auth/Authorizer.test.tsx +194 -0
  190. package/tests/Auth/Layout/UserNavDropDown.test.tsx +43 -0
  191. package/tests/Auth/Layout/UserNavDropDownToggle.test.tsx +33 -0
  192. package/tests/Auth/Login/LoginComponent.test.tsx +246 -0
  193. package/tests/Auth/Login/LoginFormComponent.test.tsx +182 -0
  194. package/tests/Auth/Register/RegisterComponent.test.tsx +285 -0
  195. package/tests/Auth/Register/RegisterFormComponent.test.tsx +170 -0
  196. package/tests/Auth/Settings/Dashboard/IpInput.test.tsx +130 -0
  197. package/tests/Auth/Social/SocialCallbackComponent.test.tsx +133 -0
  198. package/tests/Auth/Social/SocialFormComponent.test.tsx +118 -0
  199. package/tests/FileUpload/FileUpload.test.tsx +42 -0
  200. package/tests/Notification/EmailTemplate.test.tsx +82 -0
  201. package/tests/ProductSet/ProductSetPopover.test.tsx +40 -0
  202. package/tests/Report/Report.test.tsx +48 -0
  203. package/tests/Sales/Coupon.test.tsx +51 -0
  204. package/tests/Sales/SalesAndVIews.test.tsx +63 -0
  205. package/tests/SnippetTemplates/SnippetTemplates.test.tsx +56 -0
  206. package/tests/Table/FilterHelperComponent.test.tsx +88 -0
  207. package/tests/Table/PaginationHelperComponent.test.tsx +109 -0
  208. package/tests/Table/PerPageHelperComponent.test.tsx +34 -0
  209. package/tests/Table/TableHelperComponent.test.tsx +295 -0
  210. package/tests/TipTapEditor/TipTapEditor.test.tsx +28 -0
  211. package/tests/__mock__/hooks/useAuthApi.ts +13 -0
  212. package/tests/__mock__/hooks/useAuthMock.ts +13 -0
  213. package/tests/__mock__/hooks/useFormMock.ts +27 -0
  214. package/tests/__mock__/hooks/useNotificationMock.ts +13 -0
  215. package/tests/__mock__/hooks/useQueryMock.ts +16 -0
  216. package/tests/__mock__/hooks/useSocialApiMock.ts +20 -0
  217. package/tests/__mock__/hooks/useTranslationMock.ts +17 -0
  218. package/tests/__mock__/hooks/useUserApiMock.ts +18 -0
  219. package/tests/__mock__/hooks/useUserMock.ts +13 -0
  220. package/tests/__mock__/styleMock.js +1 -0
  221. package/tests/__mock__/windowMock.ts +5 -0
  222. package/tests/packages/react-query.tsx +28 -0
  223. package/tests/setupTests.ts +10 -0
  224. package/dist/iframe/ryft/utils/ryft-form.d.ts +0 -5
  225. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +0 -1
  226. package/dist/iframe/ryft/utils/ryft-form.js +0 -1
  227. package/dist/product-set/control/DateInput.d.ts +0 -17
  228. package/dist/product-set/control/DateInput.d.ts.map +0 -1
  229. package/dist/product-set/control/DateInput.js +0 -1
  230. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts +0 -11
  231. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts.map +0 -1
  232. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.js +0 -1
  233. package/dist/recurring-date-picker-input/DatePickerInput.d.ts +0 -19
  234. package/dist/recurring-date-picker-input/DatePickerInput.d.ts.map +0 -1
  235. package/dist/recurring-date-picker-input/DatePickerInput.js +0 -1
  236. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts +0 -15
  237. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +0 -1
  238. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.js +0 -1
  239. package/src/iframe/ryft/utils/ryft-form.ts +0 -47
  240. package/src/product-set/control/DateInput.tsx +0 -313
  241. package/src/product-set/control/ProductSetRecurrenceOverridesControl.tsx +0 -63
  242. package/src/recurring-date-picker-input/DatePickerInput.tsx +0 -93
  243. package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +0 -136
@@ -1,6 +1,7 @@
1
- import React, { useEffect, useRef, useState } from "react";
1
+ import React, { useEffect, useState } from "react";
2
2
  import { useTranslation } from "react-i18next";
3
3
  import { useForm } from "react-hook-form";
4
+ import Form from "react-bootstrap/Form";
4
5
 
5
6
  import Button from "react-bootstrap/Button";
6
7
  import { useHistory } from "react-router-dom";
@@ -13,7 +14,6 @@ import {
13
14
  AttemptPaymentResponse,
14
15
  } from "@licklist/plugins/dist/hooks/Ryft/useRyftPayment";
15
16
  import { BlockLoader, ButtonLoader } from "../../static";
16
- import { injectComponentsInRyftForm } from "./utils/ryft-form";
17
17
 
18
18
  export const ryftErrorMap: Record<string, string> = {
19
19
  insufficient_funds: "insufficientFunds",
@@ -50,7 +50,6 @@ export const RyftPaymentForm = ({
50
50
  onSubmit,
51
51
  }: RyftPaymentFormProps) => {
52
52
  const { t } = useTranslation(["Design", "Validation", "Ryft"]);
53
- const formRef = useRef<HTMLFormElement | null>(null);
54
53
  const history = useHistory();
55
54
 
56
55
  const [isValid, setIsValid] = useState(false);
@@ -118,12 +117,6 @@ export const RyftPaymentForm = ({
118
117
  }
119
118
  };
120
119
 
121
- useEffect(
122
- () => injectComponentsInRyftForm({ t }),
123
- // eslint-disable-next-line react-hooks/exhaustive-deps
124
- [formRef.current?.childNodes?.length]
125
- );
126
-
127
120
  useEffect(() => {
128
121
  if (!accountId.data || accountId.isError) return;
129
122
 
@@ -182,14 +175,15 @@ export const RyftPaymentForm = ({
182
175
 
183
176
  return (
184
177
  <>
178
+ <Form.Label>{t("Design:paymentDetails")}</Form.Label>
179
+ {/* For unknown reasons ryft doesn't work with bootstrap form */}
185
180
  <form
186
- ref={formRef}
187
181
  id="ryft-pay-form"
188
182
  noValidate
189
183
  onSubmit={methods.handleSubmit(handleSubmit)}
190
184
  className="ryft-payment-form"
191
185
  >
192
- <div className="submit-button-wrapper mt-4 p-1">
186
+ <div className="submit-button-wrapper mt-3 p-1">
193
187
  <Button type="submit" disabled={isBtnDisabled || !isValid}>
194
188
  {isBtnDisabled && <ButtonLoader />}
195
189
  {t("Design:buyNow")}
@@ -18,7 +18,6 @@ export interface ProductSetCardProps extends HasPermissionProp {
18
18
  onCopy: () => void;
19
19
  onRemove: () => void;
20
20
  className?: string;
21
- override?: number;
22
21
  }
23
22
 
24
23
  export function ProductSetCard({
@@ -29,7 +28,6 @@ export function ProductSetCard({
29
28
  onRemove,
30
29
  className = "",
31
30
  hasPermission = true,
32
- override = 0,
33
31
  }: ProductSetCardProps) {
34
32
  const { t } = useTranslation("Design");
35
33
  const popoverId = useId();
@@ -46,16 +44,7 @@ export function ProductSetCard({
46
44
  >
47
45
  <div className={productSetCardClasses}>
48
46
  <div className="product-set-card-link">
49
- <div className="d-flex flex-column">
50
- <div>
51
- {name} {rrule && `(${RRule.fromString(rrule).toText()})`}
52
- </div>
53
- {!!override && (
54
- <div className="h6 bold ml-1">
55
- {`${override} ${t(override > 1 ? "overrides" : "override")}`}
56
- </div>
57
- )}
58
- </div>
47
+ {name} {rrule && `(${RRule.fromString(rrule).toText()})`}
59
48
  </div>
60
49
  <div className="d-flex">
61
50
  <div className="product-set-card-menu-eye-container">
@@ -34,7 +34,6 @@ import TutorialGifCard from "./TutorialGifCard";
34
34
  import { Step } from "../types";
35
35
  import { StepsControl } from "../form/StepsControl";
36
36
  import { Typeahead } from "../../typeahead";
37
- import { DateInput } from "./DateInput";
38
37
 
39
38
  const OPERATIONAL_COST_TITLES = {
40
39
  [OPERATIONAL_COST_PROVIDER]: "operationalCostProvider",
@@ -87,7 +86,6 @@ export interface ProductSetControlProps {
87
86
  showSmsTemplate?: boolean;
88
87
  workHours?: WorkHour[];
89
88
  providerHasBookingManagement?: boolean;
90
- isOverrides?: boolean;
91
89
  }
92
90
 
93
91
  export function ProductSetControl({
@@ -103,7 +101,6 @@ export function ProductSetControl({
103
101
  showSmsTemplate,
104
102
  workHours,
105
103
  providerHasBookingManagement = false,
106
- isOverrides = false,
107
104
  }: ProductSetControlProps) {
108
105
  const { t } = useTranslation(["Design", "Validation", "Notification"]);
109
106
  const {
@@ -121,9 +118,6 @@ export function ProductSetControl({
121
118
  const termsAndConditionsId = useId();
122
119
  const relyOnPeopleTypeId = useId();
123
120
 
124
- const showSmsTemplateSelector = showSmsTemplate && !isOverrides;
125
- const showEmailTemplateSelector = showEmailTemplate && !isOverrides;
126
-
127
121
  return (
128
122
  <Row
129
123
  className={`product-set-form ${
@@ -165,30 +159,20 @@ export function ProductSetControl({
165
159
  </Form.Control.Feedback>
166
160
  </Form.Group>
167
161
 
168
- {isOverrides ? (
169
- <DateInput
162
+ {isCreateAction && (
163
+ <DateAndRecurrenceInput
164
+ isEventEditProductSet={isEventEditProductSet}
170
165
  workHours={workHours}
171
166
  isLoading={isLoading}
172
167
  providerHasBookingManagement={providerHasBookingManagement}
173
168
  />
174
- ) : (
175
- <>
176
- {isCreateAction && (
177
- <DateAndRecurrenceInput
178
- isEventEditProductSet={isEventEditProductSet}
179
- workHours={workHours}
180
- isLoading={isLoading}
181
- providerHasBookingManagement={providerHasBookingManagement}
182
- />
183
- )}
184
- </>
185
169
  )}
186
170
 
187
171
  <div className="divider" />
188
172
 
189
- <TutorialGifCard isOverrides={isOverrides} />
173
+ <TutorialGifCard />
190
174
 
191
- <StepsControl isLoading={isLoading} isOverrides={isOverrides} />
175
+ <StepsControl isLoading={isLoading} />
192
176
  </Col>
193
177
  <Col md={6} sm={12}>
194
178
  <div className="second-column">
@@ -228,7 +212,6 @@ export function ProductSetControl({
228
212
  {...register("operationalCost", { required: true })}
229
213
  as="select"
230
214
  defaultValue={OPERATIONAL_COST_PROVIDER}
231
- disabled={isOverrides}
232
215
  isInvalid={HookFormService.isInvalid("operationalCost", errors)}
233
216
  >
234
217
  {Object.keys(OPERATIONAL_COST_TYPES).map((operationalCost) => (
@@ -258,7 +241,6 @@ export function ProductSetControl({
258
241
  {...register("relyOnPeopleType")}
259
242
  as="select"
260
243
  defaultValue={null}
261
- disabled={isOverrides}
262
244
  isInvalid={HookFormService.isInvalid("relyOnPeopleType", errors)}
263
245
  >
264
246
  <option value="">{t("notRequired")} </option>
@@ -286,7 +268,7 @@ export function ProductSetControl({
286
268
  {...register("termsAndConditions")}
287
269
  as="textarea"
288
270
  rows={2}
289
- disabled={isLoading || isOverrides}
271
+ disabled={isLoading}
290
272
  isInvalid={HookFormService.isInvalid(
291
273
  "termsAndConditions",
292
274
  errors
@@ -301,32 +283,30 @@ export function ProductSetControl({
301
283
  <Form.Label className="mt-4">
302
284
  {t("Design:emailTemplate")}
303
285
  </Form.Label>
304
- <>
305
- {showEmailTemplateSelector ? (
306
- <Typeahead
307
- name="emailTemplates"
308
- options={emailTemplates}
309
- isMultipleChoise
310
- placeholder={t("Design:choose")}
311
- noOptionsMessage={t("Design:noActiveTemplates", {
312
- notification: t("Design:email"),
313
- })}
314
- />
315
- ) : (
316
- <WarningMessage
317
- message={t("Design:noActiveTemplates", {
318
- notification: t("Design:email"),
319
- })}
320
- />
321
- )}
322
- </>
286
+ {showEmailTemplate ? (
287
+ <Typeahead
288
+ name="emailTemplates"
289
+ options={emailTemplates}
290
+ isMultipleChoise
291
+ placeholder={t("Design:choose")}
292
+ noOptionsMessage={t("Design:noActiveTemplates", {
293
+ notification: t("Design:email"),
294
+ })}
295
+ />
296
+ ) : (
297
+ <WarningMessage
298
+ message={t("Design:noActiveTemplates", {
299
+ notification: t("Design:email"),
300
+ })}
301
+ />
302
+ )}
323
303
 
324
304
  <Form.Label
325
305
  className={clsx(emailTemplates.length > 0 ? "mt-4" : "mt-1")}
326
306
  >
327
307
  {t("Design:smsTemplate")}
328
308
  </Form.Label>
329
- {showSmsTemplateSelector ? (
309
+ {showSmsTemplate ? (
330
310
  <Typeahead
331
311
  name="smsTemplates"
332
312
  options={smsTemplates}
@@ -359,7 +339,6 @@ export function ProductSetControl({
359
339
  onChange={field.onChange}
360
340
  value={fieldValue}
361
341
  as="select"
362
- disabled={isOverrides}
363
342
  isInvalid={HookFormService.isInvalid(
364
343
  "fieldSetId",
365
344
  errors
@@ -396,7 +375,6 @@ export function ProductSetControl({
396
375
  }) as string;
397
376
  },
398
377
  })}
399
- disabled={isOverrides}
400
378
  isInvalid={HookFormService.isInvalid("thankYouPageUrl", errors)}
401
379
  />
402
380
 
@@ -9,14 +9,10 @@ import { Icon, Image } from "../../static";
9
9
 
10
10
  export interface TutorialGifCardProps {
11
11
  tutorialAsset?: string;
12
- isOverrides?: boolean;
13
12
  }
14
13
 
15
14
  // @TODO: Tutorial GIF asset should be passed as context, which is better
16
- const TutorialGifCard = ({
17
- tutorialAsset,
18
- isOverrides,
19
- }: TutorialGifCardProps) => {
15
+ const TutorialGifCard = ({ tutorialAsset }: TutorialGifCardProps) => {
20
16
  const { pathname } = useLocation();
21
17
  const [isVisible, setIsVisible] = useState(pathname?.includes("/create"));
22
18
  const { t } = useTranslation(["Design"]);
@@ -50,12 +46,8 @@ const TutorialGifCard = ({
50
46
  </button>
51
47
  </Card.Header>
52
48
  <Card.Body className="tutorial-card-body">
53
- <p>
54
- {t(isOverrides ? "buildOverrideProductSet" : "buildProductSet")}
55
- </p>
56
- <span>
57
- {t(isOverrides ? "buildOverrideRules" : "buildProductSetDesc")}
58
- </span>
49
+ <p>{t("buildProductSet")}</p>
50
+ <span>{t("buildProductSetDesc")}</span>
59
51
  {tutorialAsset && <Image src={tutorialAsset} alt="Tutorial Gif" />}
60
52
  </Card.Body>
61
53
  </Card>
@@ -35,7 +35,6 @@ import { useSortableTreeFunctions } from "../hooks/useSortableTreeFunctions";
35
35
 
36
36
  interface ProductCategoriesControlProps extends WithIsLoading {
37
37
  stepIndex: number;
38
- isOverrides?: boolean;
39
38
  }
40
39
 
41
40
  const getCategoryDefaultValue = (
@@ -66,7 +65,6 @@ const getCategoryDefaultValue = (
66
65
  export function ProductCategoriesControl({
67
66
  isLoading,
68
67
  stepIndex,
69
- isOverrides,
70
68
  }: ProductCategoriesControlProps) {
71
69
  const { t } = useTranslation("Design");
72
70
  const {
@@ -107,7 +105,6 @@ export function ProductCategoriesControl({
107
105
  const { edit, saveValidField, cancelChanges } = useSortableTreeFunctions({
108
106
  fieldName: productCategoriesFieldName,
109
107
  remove,
110
- isOverrides,
111
108
  });
112
109
 
113
110
  const productCategories: ProductCategory[] = useWatch({
@@ -132,7 +129,7 @@ export function ProductCategoriesControl({
132
129
  });
133
130
 
134
131
  const handleDragEnd = (event) => {
135
- if (isOverrides) return;
132
+ // @TODO uncomment when will be fix for change sort index
136
133
  const { active, over } = event;
137
134
 
138
135
  if (!active || !over || !active?.id || !over?.id) return;
@@ -269,10 +266,8 @@ export function ProductCategoriesControl({
269
266
  categoryName={value}
270
267
  stepIndex={stepIndex}
271
268
  productCategoryIndex={index}
272
- isOverride={isOverrides}
273
269
  />
274
270
  }
275
- isOverride={isOverrides}
276
271
  onDelete={() => remove(index)}
277
272
  validate={() =>
278
273
  trigger(`steps.${stepIndex}.productCategories.${index}`)
@@ -295,7 +290,6 @@ export function ProductCategoriesControl({
295
290
  zones={zones}
296
291
  productCategoryIndex={index}
297
292
  categoryType={productCategory.type}
298
- isOverrides={isOverrides}
299
293
  />
300
294
  </SortableTree.Item>
301
295
  )}
@@ -305,9 +299,7 @@ export function ProductCategoriesControl({
305
299
  </SortableTree>
306
300
  <CreateProductSetItem
307
301
  title={t("addCategory")}
308
- isOverride={isOverrides}
309
302
  onClick={() => {
310
- if (isOverrides) return;
311
303
  setIsSelectCategoryVisible(true);
312
304
  }}
313
305
  />
@@ -316,7 +308,6 @@ export function ProductCategoriesControl({
316
308
  isVisible={isSelectCategoryVisible}
317
309
  onHide={() => setIsSelectCategoryVisible(false)}
318
310
  onCategorySelect={(categoryType) => {
319
- if (isOverrides) return;
320
311
  append(getCategoryDefaultValue(categoryType, fields.length));
321
312
  setShowCategoryModal(true);
322
313
  if (
@@ -330,9 +321,7 @@ export function ProductCategoriesControl({
330
321
  <>
331
322
  <CreateProductSetItem
332
323
  title={t("editMap")}
333
- isOverride={isOverrides}
334
324
  onClick={() => {
335
- if (isOverrides) return;
336
325
  setIsVenueMapSetModalVisible(true);
337
326
  }}
338
327
  className={clsx(
@@ -26,19 +26,14 @@ import { checkAvailableTimesErrors, getFilteredTemplates } from "../utils";
26
26
  export interface WithIsLoading {
27
27
  isLoading: boolean;
28
28
  }
29
- export interface WithIdOptional {
30
- id?: number;
31
- }
32
-
33
29
  export interface WithId {
34
30
  id: number;
35
31
  }
36
32
  export interface ProductSetFormValues
37
33
  extends FormValues,
38
- WithIdOptional,
34
+ WithId,
39
35
  ProductSetControlValues {
40
36
  steps: Step[];
41
- isOverrides?: boolean;
42
37
  }
43
38
 
44
39
  export interface ProductSetFormProps
@@ -55,7 +50,6 @@ export interface ProductSetFormProps
55
50
  providerHasBookingManagement?: ProviderBookingManagementSetting["hasBookingManagement"];
56
51
  zones?: Zone[] | null;
57
52
  isCreateAction?: boolean;
58
- isOverrides?: boolean;
59
53
  workHours?: WorkHour[];
60
54
  }
61
55
 
@@ -73,7 +67,6 @@ export function ProductSetForm({
73
67
  zones,
74
68
  isCreateAction,
75
69
  workHours,
76
- isOverrides,
77
70
  ...shared
78
71
  }: ProductSetFormProps) {
79
72
  const { t } = useTranslation("Design");
@@ -91,7 +84,6 @@ export function ProductSetForm({
91
84
  });
92
85
 
93
86
  const { setError, reset } = form;
94
-
95
87
  const formValues = form.watch();
96
88
 
97
89
  const submitHandler = (onSubmit: (values: ProductSetFormValues) => void) => {
@@ -169,7 +161,6 @@ export function ProductSetForm({
169
161
  companyName={companyName}
170
162
  workHours={workHours}
171
163
  providerHasBookingManagement={providerHasBookingManagement}
172
- isOverrides={isOverrides}
173
164
  />
174
165
  <Row>
175
166
  <Col md={6} sm={12} />
@@ -34,7 +34,6 @@ interface ProductsControlProps extends WithIsLoading {
34
34
  hasTicket?: boolean;
35
35
  categoryType: CategoryType;
36
36
  zones?: Zone[];
37
- isOverrides?: boolean;
38
37
  }
39
38
 
40
39
  const getDefaultProductValue = (sort: number): Product => ({
@@ -78,7 +77,6 @@ export function ProductsControl({
78
77
  hasTicket,
79
78
  categoryType,
80
79
  zones,
81
- isOverrides,
82
80
  }: ProductsControlProps) {
83
81
  const { t } = useTranslation("Design");
84
82
  const form = useFormContext<ProductSetFormValues>();
@@ -114,7 +112,6 @@ export function ProductsControl({
114
112
  const { edit, saveValidField, cancelChanges } = useSortableTreeFunctions({
115
113
  fieldName: productControlFieldName,
116
114
  remove,
117
- isOverrides,
118
115
  });
119
116
 
120
117
  const allowDeposits = watch(
@@ -162,7 +159,6 @@ export function ProductsControl({
162
159
  });
163
160
 
164
161
  const handleDragEnd = (_event) => {
165
- if (isOverrides) return;
166
162
  const { active, over } = _event;
167
163
 
168
164
  if (!active || !over || !active?.id || !over?.id) return;
@@ -180,7 +176,6 @@ export function ProductsControl({
180
176
  };
181
177
 
182
178
  const onProductRemove = (index: number) => {
183
- if (isOverrides) return;
184
179
  const currentProduct = getValues(
185
180
  `${productControlFieldName}.${index}` as const
186
181
  );
@@ -220,12 +215,10 @@ export function ProductsControl({
220
215
  isExpanded={isFirstProductAdded}
221
216
  isInvalid={!!categoryProductErrors}
222
217
  title={value}
223
- isOverride={isOverrides}
224
218
  badge={<Badge className="product-badge">{t("product")}</Badge>}
225
219
  isIconInHeader={false}
226
220
  cancelChanges={() => cancelChanges(index)}
227
221
  edit={() => edit(index)}
228
- isProduct
229
222
  secondaryBadge={getBadgeConfig(categoryType, t(categoryType))}
230
223
  subTitle={
231
224
  <div className="product-set-badges-container">
@@ -262,7 +255,6 @@ export function ProductsControl({
262
255
  hasTicket={hasTicket}
263
256
  categoryType={categoryType}
264
257
  zoneDuration={catergoryZone?.defaultDuration}
265
- isOverrides={isOverrides}
266
258
  />
267
259
  }
268
260
  onDelete={() => onProductRemove(index)}
@@ -284,9 +276,7 @@ export function ProductsControl({
284
276
  </SortableTree>
285
277
  <CreateProductSetItem
286
278
  title={t("addProduct")}
287
- isOverride={isOverrides}
288
279
  onClick={() => {
289
- if (isOverrides) return;
290
280
  append(getDefaultProductValue(fields.length));
291
281
  setShowProductModal(true);
292
282
 
@@ -18,10 +18,9 @@ import { ProductSetFormValues } from "./ProductSetForm";
18
18
 
19
19
  interface StepsControlProps {
20
20
  isLoading: boolean;
21
- isOverrides?: boolean;
22
21
  }
23
22
 
24
- export function StepsControl({ isLoading, isOverrides }: StepsControlProps) {
23
+ export function StepsControl({ isLoading }: StepsControlProps) {
25
24
  const form = useFormContext<ProductSetFormValues>();
26
25
  const { t } = useTranslation("Design");
27
26
  const [showStepModal, setShowStepModal] = useState(false);
@@ -43,7 +42,6 @@ export function StepsControl({ isLoading, isOverrides }: StepsControlProps) {
43
42
  const { edit, saveValidField, cancelChanges } = useSortableTreeFunctions({
44
43
  fieldName: "steps",
45
44
  remove,
46
- isOverrides,
47
45
  });
48
46
 
49
47
  useEffect(() => {
@@ -92,9 +90,8 @@ export function StepsControl({ isLoading, isOverrides }: StepsControlProps) {
92
90
  modalLabel={t("addNewStep")}
93
91
  modalClass={ProductSetModalClasses.step}
94
92
  isNewAdded={showStepModal}
95
- edit={() => !isOverrides && edit(index)}
93
+ edit={() => edit(index)}
96
94
  cancelChanges={() => cancelChanges(index)}
97
- isOverride={isOverrides}
98
95
  subTitle={
99
96
  <div className="product-set-badges-container">
100
97
  <div className="product-set-subtitle-dot product-set-subtitle-step-dot" />
@@ -139,7 +136,6 @@ export function StepsControl({ isLoading, isOverrides }: StepsControlProps) {
139
136
  <ProductCategoriesControl
140
137
  isLoading={isLoading}
141
138
  stepIndex={index}
142
- isOverrides={isOverrides}
143
139
  />
144
140
  </SortableTree.Item>
145
141
  )}
@@ -149,9 +145,7 @@ export function StepsControl({ isLoading, isOverrides }: StepsControlProps) {
149
145
 
150
146
  <CreateProductSetItem
151
147
  title={t("addStep")}
152
- isOverride={isOverrides}
153
148
  onClick={() => {
154
- if (isOverrides) return;
155
149
  append(getDefaultStepsValues());
156
150
  setShowStepModal(true);
157
151
  if (errors.steps?.type === HookFormService.manualErrorType) {
@@ -15,7 +15,6 @@ interface SubProductsControlProps {
15
15
  productCategoryIndex: number;
16
16
  productIndex: number;
17
17
  isLoading: boolean;
18
- isOverrides?: boolean;
19
18
  }
20
19
 
21
20
  export function SubProductsControl({
@@ -24,7 +23,6 @@ export function SubProductsControl({
24
23
  stepIndex,
25
24
  productCategoryIndex,
26
25
  productIndex,
27
- isOverrides,
28
26
  }: SubProductsControlProps) {
29
27
  const form = useFormContext<ProductSetFormValues>();
30
28
  const { fields, append } = useFieldArray({
@@ -51,7 +49,6 @@ export function SubProductsControl({
51
49
  key={`sub-product-${subProduct.id}-${index}`}
52
50
  id={subProduct.id}
53
51
  title={subProduct.name}
54
- isOverride={isOverrides}
55
52
  body={
56
53
  <ProductControl<ProductSetFormValues>
57
54
  isLoading={isLoading}
@@ -4,30 +4,24 @@ import { useFormContext } from "react-hook-form";
4
4
  interface useSortableTreeFunctionsProps {
5
5
  fieldName: string;
6
6
  remove: (index?: number | number[]) => void;
7
- isOverrides?: boolean;
8
7
  }
9
8
  export const useSortableTreeFunctions = ({
10
9
  fieldName,
11
10
  remove,
12
- isOverrides,
13
11
  }: useSortableTreeFunctionsProps) => {
14
12
  const { getValues, setValue } = useFormContext();
15
13
  const [previousValue, setEditValue] = useState(null);
16
14
 
17
15
  const edit = (index: number) => {
18
- if (isOverrides) return;
19
16
  const currentCategoryProduct = getValues(`${fieldName}.${index}` as const);
20
17
  const cloneCategoryProduct = structuredClone(currentCategoryProduct);
21
18
  setEditValue(cloneCategoryProduct);
22
19
  };
23
20
 
24
21
  const cancelChanges = (index: number) => {
25
- if (isOverrides) return;
26
22
  if (!previousValue) {
27
- // eslint-disable-next-line consistent-return
28
23
  return remove(index);
29
24
  }
30
- // eslint-disable-next-line consistent-return
31
25
  return setValue(`${fieldName}.${index}` as const, previousValue);
32
26
  };
33
27
 
@@ -6,21 +6,18 @@ interface CreateProductSetItemProps {
6
6
  onClick: () => void;
7
7
  title: string;
8
8
  className?: string;
9
- isOverride?: boolean;
10
9
  }
11
10
 
12
11
  export function CreateProductSetItem({
13
12
  onClick,
14
13
  title,
15
14
  className,
16
- isOverride,
17
15
  }: CreateProductSetItemProps) {
18
16
  return (
19
17
  <button
20
18
  className={clsx(
21
19
  "product-set-item-wrapper w-100",
22
20
  `product-set-item-wrapper-${title.toLowerCase().split(" ")[1]}`,
23
- isOverride && "bg-light",
24
21
  className
25
22
  )}
26
23
  onClick={onClick}