@licklist/design 0.62.3-dev.2 → 0.62.3

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 (141) hide show
  1. package/bitbucket-pipelines.yml +8 -0
  2. package/dist/date-time-button/DateTimeButton.js +1 -1
  3. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +1 -3
  4. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
  5. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +1 -1
  6. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +1 -3
  7. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts.map +1 -1
  8. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.js +1 -1
  9. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +1 -3
  10. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
  11. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -1
  12. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
  13. package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
  14. package/dist/iframe/ryft/RyftPaymentForm.js +1 -1
  15. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
  16. package/dist/iframe/ryft/utils/ryft-form.js +1 -1
  17. package/dist/product-set/control/DateAndRecurrenceInput.d.ts +1 -1
  18. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  19. package/dist/product-set/control/DateAndRecurrenceInput.js +1 -1
  20. package/dist/product-set/control/DateInput.d.ts.map +1 -1
  21. package/dist/product-set/control/DateInput.js +1 -1
  22. package/dist/product-set/control/ProductSetControl.d.ts +1 -1
  23. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  24. package/dist/product-set/form/ProductSetForm.d.ts +1 -4
  25. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  26. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
  27. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  28. package/dist/product-set/product/ProductControl.js +1 -1
  29. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
  30. package/dist/provider/working-hours-input/WorkingHoursInputDescription.d.ts.map +1 -1
  31. package/dist/provider/working-hours-input/WorkingHoursInputDescription.js +1 -1
  32. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +1 -1
  33. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +1 -3
  34. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  35. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  36. package/dist/recurring-date-picker-input/utils.d.ts +0 -12
  37. package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
  38. package/dist/recurring-date-picker-input/utils.js +1 -1
  39. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  40. package/dist/sales/booking/results/components/ResultCard.js +1 -1
  41. package/dist/sales/coupon/control/CouponFormControl.d.ts +1 -2
  42. package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
  43. package/dist/sales/coupon/control/CouponFormControl.js +1 -1
  44. package/dist/sales/coupon/form/CouponFrom.d.ts +2 -2
  45. package/dist/sales/coupon/form/CouponFrom.d.ts.map +1 -1
  46. package/dist/setting/admin/AdminSettingForm.d.ts +2 -2
  47. package/dist/setting/admin/AdminSettingForm.d.ts.map +1 -1
  48. package/dist/setting/dashboard/DashboardSettingForm.d.ts +0 -1
  49. package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
  50. package/dist/setting/dashboard/DashboardSettingForm.js +1 -1
  51. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +113 -99
  52. package/dist/styles/sales/BookingResults.scss +1 -1
  53. package/dist/typeahead/Typeahead.d.ts +1 -2
  54. package/dist/typeahead/Typeahead.d.ts.map +1 -1
  55. package/dist/typeahead/Typeahead.js +1 -1
  56. package/dist/zone/form/ZoneForm.d.ts +2 -2
  57. package/dist/zone/form/ZoneForm.d.ts.map +1 -1
  58. package/dist/zone/form/ZoneForm.js +1 -1
  59. package/dist/zone/form/components/ZoneControl.d.ts +2 -2
  60. package/dist/zone/form/components/ZoneControl.d.ts.map +1 -1
  61. package/dist/zone/form/components/ZoneControl.js +1 -1
  62. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts +4 -4
  63. package/dist/zone/form/components/ZoneRecurrencesControl.d.ts.map +1 -1
  64. package/dist/zone/form/components/ZoneRecurrencesControl.js +1 -1
  65. package/dist/zone/form/utils/dates.d.ts.map +1 -1
  66. package/jest.config.js +29 -0
  67. package/package.json +35 -10
  68. package/src/date-time-button/DateTimeButton.stories.tsx +1 -2
  69. package/src/date-time-button/DateTimeButton.tsx +5 -7
  70. package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +0 -4
  71. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +8 -10
  72. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +0 -4
  73. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -6
  74. package/src/iframe/ryft/RyftPaymentForm.tsx +4 -12
  75. package/src/iframe/ryft/utils/ryft-form.ts +4 -8
  76. package/src/product-set/control/DateAndRecurrenceInput.tsx +2 -3
  77. package/src/product-set/control/DateInput.tsx +4 -2
  78. package/src/product-set/control/ProductSetControl.tsx +1 -1
  79. package/src/product-set/form/ProductCategoriesControl.tsx +1 -1
  80. package/src/product-set/form/ProductSetForm.tsx +1 -5
  81. package/src/product-set/hooks/useSortableTreeFunctions.ts +0 -2
  82. package/src/product-set/product/ProductControl.tsx +38 -38
  83. package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +2 -0
  84. package/src/provider/working-hours-input/WorkingHoursInputDescription.tsx +18 -4
  85. package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +1 -0
  86. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +1 -11
  87. package/src/recurring-date-picker-input/utils.ts +0 -77
  88. package/src/sales/booking/results/BookingResults.stories.tsx +2 -3
  89. package/src/sales/booking/results/components/ResultCard.tsx +5 -2
  90. package/src/sales/coupon/control/CouponFormControl.tsx +51 -28
  91. package/src/sales/coupon/form/CouponFrom.tsx +15 -5
  92. package/src/setting/admin/AdminSettingForm.tsx +2 -2
  93. package/src/setting/dashboard/DashboardSettingForm.tsx +0 -13
  94. package/src/sortable-tree/SortableTreeItem.tsx +1 -1
  95. package/src/static/switch/BooleanSwitch.tsx +1 -1
  96. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +113 -99
  97. package/src/styles/sales/BookingResults.scss +1 -1
  98. package/src/typeahead/Typeahead.tsx +3 -16
  99. package/src/zone/form/ZoneForm.tsx +2 -3
  100. package/src/zone/form/components/ZoneControl.tsx +3 -3
  101. package/src/zone/form/components/ZoneRecurrencesControl.tsx +5 -7
  102. package/src/zone/form/utils/dates.ts +10 -9
  103. package/tests/Auth/Authorizer.test.tsx +194 -0
  104. package/tests/Auth/Layout/UserNavDropDown.test.tsx +43 -0
  105. package/tests/Auth/Layout/UserNavDropDownToggle.test.tsx +33 -0
  106. package/tests/Auth/Login/LoginComponent.test.tsx +246 -0
  107. package/tests/Auth/Login/LoginFormComponent.test.tsx +182 -0
  108. package/tests/Auth/Register/RegisterComponent.test.tsx +285 -0
  109. package/tests/Auth/Register/RegisterFormComponent.test.tsx +170 -0
  110. package/tests/Auth/Settings/Dashboard/IpInput.test.tsx +130 -0
  111. package/tests/Auth/Social/SocialCallbackComponent.test.tsx +133 -0
  112. package/tests/Auth/Social/SocialFormComponent.test.tsx +118 -0
  113. package/tests/FileUpload/FileUpload.test.tsx +42 -0
  114. package/tests/Notification/EmailTemplate.test.tsx +82 -0
  115. package/tests/ProductSet/ProductSetPopover.test.tsx +40 -0
  116. package/tests/Report/Report.test.tsx +48 -0
  117. package/tests/Sales/Coupon.test.tsx +51 -0
  118. package/tests/Sales/SalesAndVIews.test.tsx +63 -0
  119. package/tests/SnippetTemplates/SnippetTemplates.test.tsx +56 -0
  120. package/tests/Table/FilterHelperComponent.test.tsx +88 -0
  121. package/tests/Table/PaginationHelperComponent.test.tsx +109 -0
  122. package/tests/Table/PerPageHelperComponent.test.tsx +34 -0
  123. package/tests/Table/TableHelperComponent.test.tsx +295 -0
  124. package/tests/TipTapEditor/TipTapEditor.test.tsx +28 -0
  125. package/tests/__mock__/hooks/useAuthApi.ts +13 -0
  126. package/tests/__mock__/hooks/useAuthMock.ts +13 -0
  127. package/tests/__mock__/hooks/useFormMock.ts +27 -0
  128. package/tests/__mock__/hooks/useNotificationMock.ts +13 -0
  129. package/tests/__mock__/hooks/useQueryMock.ts +16 -0
  130. package/tests/__mock__/hooks/useSocialApiMock.ts +20 -0
  131. package/tests/__mock__/hooks/useTranslationMock.ts +17 -0
  132. package/tests/__mock__/hooks/useUserApiMock.ts +18 -0
  133. package/tests/__mock__/hooks/useUserMock.ts +13 -0
  134. package/tests/__mock__/styleMock.js +1 -0
  135. package/tests/__mock__/windowMock.ts +5 -0
  136. package/tests/packages/react-query.tsx +28 -0
  137. package/tests/setupTests.ts +10 -0
  138. package/dist/sales/coupon/utils/index.d.ts +0 -7
  139. package/dist/sales/coupon/utils/index.d.ts.map +0 -1
  140. package/dist/sales/coupon/utils/index.js +0 -1
  141. package/src/sales/coupon/utils/index.ts +0 -13
@@ -2,7 +2,7 @@
2
2
  import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
3
3
  export type ZoneControlProps = {
4
4
  isLoading: boolean;
5
- workHours: WorkHour[] | undefined;
5
+ workHours?: WorkHour[];
6
6
  };
7
- export declare const ZoneControl: ({ isLoading, workHours }: ZoneControlProps) => JSX.Element;
7
+ export declare const ZoneControl: ({ isLoading }: ZoneControlProps) => JSX.Element;
8
8
  //# sourceMappingURL=ZoneControl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ZoneControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAStF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,WAAW,6BAA8B,gBAAgB,gBA0BrE,CAAC"}
1
+ {"version":3,"file":"ZoneControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAStF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,WAAW,kBAAmB,gBAAgB,gBA0B1D,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),o=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,t=require("react-bootstrap"),n=require("./NameControl.js"),l=require("./ZoneTypeControl.js"),a=require("./SortControl.js"),i=require("./ZoneRecurrencesControl.js"),s=require("./DescriptionControl.js"),m=require("./ZoneImageControl.js"),c=require("./GameDurationControl.js");exports.ZoneControl=function(e){var r=e.isLoading,u=e.workHours;return o.createElement(t.Row,null,o.createElement(t.Col,{md:6,sm:12,className:"pr-5"},o.createElement(n.NameControl,{isLoading:r}),o.createElement(i.ZoneRecurrencesControl,{workHours:u}),o.createElement("hr",null),o.createElement(t.Row,null,o.createElement(t.Col,{md:6,sm:6},o.createElement(l.ZoneTypeControl,{isLoading:r}),o.createElement(a.SortControl,{isLoading:r}),o.createElement(c.GameDurationControl,{isLoading:r})),o.createElement(t.Col,{md:6,sm:6},o.createElement(m.ZoneImageControl,{isLoading:r}))),o.createElement("hr",null),o.createElement(t.Row,null,o.createElement(t.Col,{md:12,sm:12},o.createElement(s.DescriptionControl,{isLoading:r})))))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,o=require("react-bootstrap"),n=require("./NameControl.js"),l=require("./ZoneTypeControl.js"),a=require("./SortControl.js"),i=require("./ZoneRecurrencesControl.js"),m=require("./DescriptionControl.js"),s=require("./ZoneImageControl.js"),c=require("./GameDurationControl.js");exports.ZoneControl=function(e){var r=e.isLoading;return t.createElement(o.Row,null,t.createElement(o.Col,{md:6,sm:12,className:"pr-5"},t.createElement(n.NameControl,{isLoading:r}),t.createElement(i.ZoneRecurrencesControl,null),t.createElement("hr",null),t.createElement(o.Row,null,t.createElement(o.Col,{md:6,sm:6},t.createElement(l.ZoneTypeControl,{isLoading:r}),t.createElement(a.SortControl,{isLoading:r}),t.createElement(c.GameDurationControl,{isLoading:r})),t.createElement(o.Col,{md:6,sm:6},t.createElement(s.ZoneImageControl,{isLoading:r}))),t.createElement("hr",null),t.createElement(o.Row,null,t.createElement(o.Col,{md:12,sm:12},t.createElement(m.DescriptionControl,{isLoading:r})))))};
@@ -4,9 +4,9 @@ import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMa
4
4
  export interface DateAndRecurrenceInputValues {
5
5
  zoneRecurrences?: Partial<ZoneRecurrence>[];
6
6
  }
7
- type ZoneRecurrenceControlProps = {
8
- workHours: WorkHour[] | undefined;
7
+ export type ZoneRecurrenceControlProps = {
8
+ workHours?: WorkHour[];
9
+ isLoading?: boolean;
9
10
  };
10
- export declare const ZoneRecurrencesControl: ({ workHours, }: ZoneRecurrenceControlProps) => JSX.Element;
11
- export {};
11
+ export declare const ZoneRecurrencesControl: () => JSX.Element;
12
12
  //# sourceMappingURL=ZoneRecurrencesControl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ZoneRecurrencesControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneRecurrencesControl.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAMlG,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAWtF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;CAC7C;AAED,KAAK,0BAA0B,GAAG;IAChC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,mBAEhC,0BAA0B,gBAuM5B,CAAC"}
1
+ {"version":3,"file":"ZoneRecurrencesControl.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/components/ZoneRecurrencesControl.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kEAAkE,CAAC;AAMlG,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAWtF,MAAM,WAAW,4BAA4B;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;CAC7C;AAED,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,sBAAsB,mBAsMlC,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-bootstrap"),a=require("../../../static/Icon.js"),u=require("react-hook-form"),l=require("@react-aria/utils"),c=require("react-use");require("../../../static/index.js");var d=require("@dnd-kit/core"),s=require("@dnd-kit/sortable"),m=require("../../../modals/confirmation/ConfirmModal.js"),v=require("../../../recurring-date-picker-input/RecurringDatePickerInput.js"),f=require("../../../product-set/control/DateAndRecurrenceInput.js"),p=require("./ZoneRecurrenceControl.js");exports.ZoneRecurrencesControl=function(e){var g,_,E=e.workHours,q=u.useFormContext(),x=q.control,C=q.register,D=q.formState.errors,R=q.getValues,b=q.setValue,k=q.clearErrors,y=u.useFieldArray({name:"zoneRecurrences",control:x,keyName:"_id"}),I=y.fields,S=y.append,z=y.update,N=y.move,h=r.__read(t.useState(!1),2),j=h[0],w=h[1],T=r.__read(t.useState({index:null,values:null}),2),A=T[0],F=T[1],M=function(){return F({index:null,values:null})},P=t.useRef();c.useClickAway(P,(function(e){var r,t,n;m.CONFIRM_MODAL_ACTIONS.includes(null===(n=null===(t=null===(r=e.target)||void 0===r?void 0:r.attributes)||void 0===t?void 0:t.getNamedItem("data-id"))||void 0===n?void 0:n.value)||(w(!1),M())}));var O=l.useId(),V=i.useTranslation(["Design","Validation"]).t,L=function(){M(),w((function(e){return!e}))};return t.useEffect((function(){I.length&&k("zoneRecurrences")}),[I,k]),n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,V("zoneAvailable")),n.createElement(o.OverlayTrigger,{show:j,overlay:n.createElement(o.Popover,{id:O,className:"rounded"},n.createElement(o.Popover.Content,{className:"shadow-lg rounded",ref:P},n.createElement(v.RecurringDatePickerInput,{defaultValues:A.values,onChange:function(e){return r.__awaiter(void 0,void 0,void 0,(function(){var t,n,i;return r.__generator(this,(function(r){return t={rrule:e.rrule,startDate:e.startDate,endDate:e.endDate,startTime:e.startTime,endTime:e.endTime},(null===(n=A.values)||void 0===n?void 0:n.id)&&(t.id=null===(i=A.values)||void 0===i?void 0:i.id),null!==A.index?z(A.index,t):S(t),w((function(){return!1})),M(),[2]}))}))},onDelete:function(){var e=A.index;w(!1),M(),setTimeout((function(){var r=R().zoneRecurrences;b("zoneRecurrences",(void 0===r?[]:r).filter((function(r,t){return t!==e})))}),100)},setInitialStartDateAfterSelect:!0,workHours:E}))),trigger:"click",placement:"bottom",popperConfig:{modifiers:[f.sameWidthPopperModifier]}},n.createElement("div",{className:"zone-recurrences"},n.createElement(d.DndContext,{onDragEnd:function(e){var r=e.over,t=e.active;if(r.id!==t.id){var n=I.findIndex((function(e){return String(e._id)===t.id})),i=I.findIndex((function(e){return String(e._id)===r.id}));N(n,i)}}},n.createElement(s.SortableContext,{items:null!==(g=null==I?void 0:I.map((function(e){return String(e._id)})))&&void 0!==g?g:[],strategy:s.verticalListSortingStrategy},null==I?void 0:I.map((function(e,r){return n.createElement(p.ZoneRecurrenceControl,{key:e._id,zoneRecurrence:e,onEdit:function(){return function(e,r){M(),F({index:r,values:e}),w((function(){return!0}))}(e,r)}})})))),n.createElement("div",{className:"zone-recurrence-icon-wrapper",role:"button",tabIndex:0,onClick:L,onKeyDown:L},n.createElement(a.default,{type:"plus-circle",height:"1rem",className:"zone-recurrence-icon-add mr-2"}),V("addDates")),n.createElement(o.Form.Control,r.__assign({type:"hidden"},C("zoneRecurrences",{required:{value:!0,message:V("Validation:fieldMinNumber",{attribute:V("dates"),min:1})}}))),n.createElement("div",{className:"manual-form-error"},null===(_=D.zoneRecurrences)||void 0===_?void 0:_.message))))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("tslib"),t=require("react"),n=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-bootstrap"),a=require("../../../static/Icon.js"),u=require("react-hook-form"),l=require("@react-aria/utils"),c=require("react-use");require("../../../static/index.js");var d=require("@dnd-kit/core"),s=require("@dnd-kit/sortable"),m=require("../../../modals/confirmation/ConfirmModal.js"),v=require("../../../recurring-date-picker-input/RecurringDatePickerInput.js"),f=require("../../../product-set/control/DateAndRecurrenceInput.js"),p=require("./ZoneRecurrenceControl.js");exports.ZoneRecurrencesControl=function(){var e,g,_=u.useFormContext(),E=_.control,q=_.register,x=_.formState.errors,C=_.getValues,D=_.setValue,R=_.clearErrors,b=u.useFieldArray({name:"zoneRecurrences",control:E,keyName:"_id"}),y=b.fields,I=b.append,S=b.update,k=b.move,z=r.__read(t.useState(!1),2),N=z[0],h=z[1],j=r.__read(t.useState({index:null,values:null}),2),T=j[0],A=j[1],w=function(){return A({index:null,values:null})},F=t.useRef();c.useClickAway(F,(function(e){var r,t,n;m.CONFIRM_MODAL_ACTIONS.includes(null===(n=null===(t=null===(r=e.target)||void 0===r?void 0:r.attributes)||void 0===t?void 0:t.getNamedItem("data-id"))||void 0===n?void 0:n.value)||(h(!1),w())}));var M=l.useId(),P=i.useTranslation(["Design","Validation"]).t,O=function(){w(),h((function(e){return!e}))};return t.useEffect((function(){y.length&&R("zoneRecurrences")}),[y,R]),n.createElement(o.Form.Group,null,n.createElement(o.Form.Label,null,P("zoneAvailable")),n.createElement(o.OverlayTrigger,{show:N,overlay:n.createElement(o.Popover,{id:M,className:"rounded"},n.createElement(o.Popover.Content,{className:"shadow-lg rounded",ref:F},n.createElement(v.RecurringDatePickerInput,{defaultValues:T.values,onChange:function(e){return r.__awaiter(void 0,void 0,void 0,(function(){var t,n,i;return r.__generator(this,(function(r){return t={rrule:e.rrule,startDate:e.startDate,endDate:e.endDate,startTime:e.startTime,endTime:e.endTime},(null===(n=T.values)||void 0===n?void 0:n.id)&&(t.id=null===(i=T.values)||void 0===i?void 0:i.id),null!==T.index?S(T.index,t):I(t),h((function(){return!1})),w(),[2]}))}))},onDelete:function(){var e=T.index;h(!1),w(),setTimeout((function(){var r=C().zoneRecurrences;D("zoneRecurrences",(void 0===r?[]:r).filter((function(r,t){return t!==e})))}),100)},setInitialStartDateAfterSelect:!0}))),trigger:"click",placement:"bottom",popperConfig:{modifiers:[f.sameWidthPopperModifier]}},n.createElement("div",{className:"zone-recurrences"},n.createElement(d.DndContext,{onDragEnd:function(e){var r=e.over,t=e.active;if(r.id!==t.id){var n=y.findIndex((function(e){return String(e._id)===t.id})),i=y.findIndex((function(e){return String(e._id)===r.id}));k(n,i)}}},n.createElement(s.SortableContext,{items:null!==(e=null==y?void 0:y.map((function(e){return String(e._id)})))&&void 0!==e?e:[],strategy:s.verticalListSortingStrategy},null==y?void 0:y.map((function(e,r){return n.createElement(p.ZoneRecurrenceControl,{key:e._id,zoneRecurrence:e,onEdit:function(){return function(e,r){w(),A({index:r,values:e}),h((function(){return!0}))}(e,r)}})})))),n.createElement("div",{className:"zone-recurrence-icon-wrapper",role:"button",tabIndex:0,onClick:O,onKeyDown:O},n.createElement(a.default,{type:"plus-circle",height:"1rem",className:"zone-recurrence-icon-add mr-2"}),P("addDates")),n.createElement(o.Form.Control,r.__assign({type:"hidden"},q("zoneRecurrences",{required:{value:!0,message:P("Validation:fieldMinNumber",{attribute:P("dates"),min:1})}}))),n.createElement("div",{className:"manual-form-error"},null===(g=x.zoneRecurrences)||void 0===g?void 0:g.message))))};
@@ -1 +1 @@
1
- {"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/utils/dates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAOtF,eAAO,MAAM,qBAAqB,cACrB,MAAM,WACR,MAAM,6BAuChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,QAAQ,EAAE,aAyC9D,CAAC"}
1
+ {"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/zone/form/utils/dates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4DAA4D,CAAC;AAOtF,eAAO,MAAM,qBAAqB,cACrB,MAAM,WACR,MAAM,6BAuChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAgB,QAAQ,EAAE,aA0C9D,CAAC"}
package/jest.config.js ADDED
@@ -0,0 +1,29 @@
1
+ // For a detailed explanation regarding each configuration property, visit:
2
+ // https://jestjs.io/docs/en/configuration.html
3
+
4
+ module.exports = {
5
+ modulePathIgnorePatterns: ["/dist/"],
6
+ roots: ["<rootDir>/src", "<rootDir>/tests"],
7
+ globals: {
8
+ "ts-jest": {
9
+ isolatedModules: true,
10
+ babelConfig: {
11
+ presets: ["@babel/preset-env", "@babel/preset-react"],
12
+ },
13
+ },
14
+ },
15
+ transform: {
16
+ "^.+\\.(t|j)sx?$": "ts-jest",
17
+ },
18
+ transformIgnorePatterns: [
19
+ "node_modules/(?!(redux-persist)/)",
20
+ "node_modules/(?!(@licklist)/)",
21
+ ],
22
+ testRegex: ["(\\/tests\\/.*.(test|spec))\\.tsx?$"],
23
+ moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
24
+ setupFilesAfterEnv: ["<rootDir>/tests/setupTests.ts"],
25
+ moduleNameMapper: {
26
+ "^.+\\.(css|scss|sass|less)$": "<rootDir>/tests/__mock__/styleMock.js",
27
+ ".+\\.(svg|png|jpg)$": "identity-obj-proxy",
28
+ },
29
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.62.3-dev.2",
3
+ "version": "0.62.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -16,11 +16,14 @@
16
16
  "type-check:watch": "yarn type-check -- --watch",
17
17
  "build": "rollup -c",
18
18
  "watch": "yarn build -- -w",
19
+ "test": "jest --verbose --coverage --watchAll=false",
20
+ "run-test": "jest --verbose --watchAll=false",
19
21
  "lint": "eslint --ext .ts,.tsx .",
20
22
  "lint:fix": "yarn run lint -- --fix",
21
23
  "lint:format": "prettier \"**/*.{md,json,yml,scss}\" --check",
22
24
  "lint:format:fix": "prettier \"**/*.{md,json,yml,scss}\" --write",
23
25
  "prepare": "husky install",
26
+ "test-staged": "CI=true jest --passWithNoTests --findRelatedTests",
24
27
  "tests": "yarn tests-staged",
25
28
  "prettier-write": "prettier --write",
26
29
  "tsc": "bash -c tsc -p tsconfig.json -b"
@@ -50,9 +53,9 @@
50
53
  "@fortawesome/free-brands-svg-icons": "5.15.2",
51
54
  "@fortawesome/free-solid-svg-icons": "5.15.2",
52
55
  "@fortawesome/react-fontawesome": "0.1.9",
53
- "@licklist/core": ">=0.25.0-dev.0 < 0.25.0",
54
- "@licklist/eslint-config": "0.4.5",
55
- "@licklist/plugins": ">=0.28.0-dev.0 < 0.28.0",
56
+ "@licklist/core": "^0.23.1",
57
+ "@licklist/eslint-config": "0.3.4",
58
+ "@licklist/plugins": "^0.27.2",
56
59
  "@mdx-js/react": "1.6.22",
57
60
  "@popperjs/core": "2.11.8",
58
61
  "@react-aria/utils": "3.9.0",
@@ -70,6 +73,10 @@
70
73
  "@svgr/rollup": "5.5.0",
71
74
  "@svgr/webpack": "5.5.0",
72
75
  "@tanstack/react-table": "8.10.6",
76
+ "@testing-library/jest-dom": "5.16.1",
77
+ "@testing-library/react": "11.2.5",
78
+ "@testing-library/react-hooks": "5.1.0",
79
+ "@testing-library/user-event": "13.5.0",
73
80
  "@tiptap/core": "2.0.0-beta.176",
74
81
  "@tiptap/extension-blockquote": "2.0.0-beta.29",
75
82
  "@tiptap/extension-bold": "2.0.0-beta.28",
@@ -92,10 +99,14 @@
92
99
  "@tiptap/react": "2.0.0-beta.109",
93
100
  "@tiptap/suggestion": "2.0.0-beta.92",
94
101
  "@types/babel__core": "7.1.12",
102
+ "@types/enzyme-adapter-react-16": "1.0.6",
103
+ "@types/jest": "26.0.20",
95
104
  "@types/luxon": "1.26.2",
96
105
  "@types/mdx-js__react": "1.5.3",
106
+ "@types/react": "17.0.2",
97
107
  "@types/react-bootstrap": "1.0.1",
98
108
  "@types/react-date-range": "^1.4.4",
109
+ "@types/react-dom": "17.0.1",
99
110
  "@types/react-email-editor": "1.1.7",
100
111
  "@types/react-loader": "2.4.4",
101
112
  "@types/react-phone-number-input": "3.0.6",
@@ -105,6 +116,7 @@
105
116
  "@typescript-eslint/eslint-plugin": "5.8.1",
106
117
  "@typescript-eslint/parser": "5.8.1",
107
118
  "@wojtekmaj/react-daterange-picker": "^4.1.0",
119
+ "babel-jest": "26.6.3",
108
120
  "babel-loader": "8.2.2",
109
121
  "babel-plugin-inline-react-svg": "2.0.1",
110
122
  "bootstrap": "4.6.0",
@@ -116,16 +128,21 @@
116
128
  "emojibase": "6.1.0",
117
129
  "emojibase-data": "7.0.1",
118
130
  "emojibase-regex": "6.0.1",
131
+ "enzyme": "3.11.0",
132
+ "enzyme-adapter-react-16": "1.15.6",
119
133
  "eslint": "7.32.0",
120
134
  "eslint-config-airbnb": "18.2.1",
121
135
  "eslint-config-prettier": "8.3.0",
136
+ "eslint-plugin-jest": "25.3.2",
122
137
  "eslint-plugin-jsx-a11y": "6.5.1",
123
138
  "eslint-plugin-prettier": "4.0.0",
124
139
  "eslint-plugin-react-hooks": "4.2.0",
140
+ "eslint-plugin-testing-library": "5.0.1",
125
141
  "framer-motion": "4.1.17",
126
142
  "history": "5.3.0",
127
143
  "husky": "7.0.4",
128
144
  "i18next": "19.4.5",
145
+ "jest": "26.6.0",
129
146
  "klona": "2.0.4",
130
147
  "konva": "6.0.0",
131
148
  "lint-staged": "11.1.2",
@@ -133,18 +150,18 @@
133
150
  "luxon": "1.26.0",
134
151
  "moment": "2.29.1",
135
152
  "prettier": "2.5.1",
136
- "react": "17.0.2",
153
+ "react": "16.14.0",
137
154
  "react-bootstrap": "1.6.1",
138
155
  "react-color": "2.19.3",
139
156
  "react-copy-to-clipboard": "5.0.3",
140
157
  "react-date-range": "^1.4.0",
141
- "react-dom": "17.0.2",
158
+ "react-dom": "16.14.0",
142
159
  "react-email-editor": "1.6.1",
143
160
  "react-highlighter": "0.4.3",
144
161
  "react-hook-form": "7.13.0",
145
162
  "react-i18next": "11.8.8",
146
163
  "react-intl": "5.15.8",
147
- "react-konva": "^17.0.2-6",
164
+ "react-konva": "16.13.0-6",
148
165
  "react-loader": "2.4.7",
149
166
  "react-loading-skeleton": "^3.3.1",
150
167
  "react-overlays": "4.1.1",
@@ -169,6 +186,7 @@
169
186
  "sass": "1.32.8",
170
187
  "sass-loader": "10.1.1",
171
188
  "style-loader": "2.0.0",
189
+ "ts-jest": "26.5.2",
172
190
  "twemoji-parser": "14.0.0",
173
191
  "typescript": "4.9.5",
174
192
  "url-loader": "4.1.1",
@@ -176,17 +194,24 @@
176
194
  },
177
195
  "resolutions": {
178
196
  "@types/react": "17.0.2",
179
- "@types/react-dom": "17.0.2"
197
+ "@types/react-dom": "17.0.1"
198
+ },
199
+ "jest": {
200
+ "setupFilesAfterEnv": [
201
+ "./jest.config.js"
202
+ ],
203
+ "snapshotSerializers": [
204
+ "enzyme-to-json/serializer"
205
+ ]
180
206
  },
181
207
  "lint-staged": {
182
208
  "*.{ts,tsx}": [
209
+ "yarn test-staged",
183
210
  "yarn prettier-write",
184
211
  "yarn lint:fix"
185
212
  ]
186
213
  },
187
214
  "devDependencies": {
188
- "@types/react": "17.0.2",
189
- "@types/react-dom": "17.0.2",
190
215
  "identity-obj-proxy": "^3.0.0"
191
216
  },
192
217
  "volta": {
@@ -8,7 +8,7 @@ export default {
8
8
  component: DateTimeButton,
9
9
  } as Meta;
10
10
 
11
- const date = DateTime.now().plus({ hour: 1 });
11
+ const date = DateTime.now();
12
12
 
13
13
  export const Default: Story<DateTimeButtonProps> = (args) => {
14
14
  return <DateTimeButton {...args} />;
@@ -19,7 +19,6 @@ Default.args = {
19
19
  isSelected: false,
20
20
  isDisabled: false,
21
21
  onSelect: () => null,
22
- shouldCalculateResources: false,
23
22
  };
24
23
 
25
24
  export const Selected: Story<DateTimeButtonProps> = (args) => {
@@ -46,7 +46,7 @@ export const DateTimeButton = ({
46
46
 
47
47
  const isTimeVariant = variant === Variant.time;
48
48
 
49
- const isPast = variant === Variant.time ? isPastTime(date) : isPastDate(date);
49
+ const isTimeInPast = isTimeVariant && isDateInPast(date);
50
50
 
51
51
  const noResources =
52
52
  shouldCalculateResources &&
@@ -55,7 +55,7 @@ export const DateTimeButton = ({
55
55
  !has(resources, "bookedResources") ||
56
56
  !has(resources, "totalResources"));
57
57
 
58
- const isDisabled = _isDisabled || isSoldOut || isPast || noResources;
58
+ const isDisabled = _isDisabled || isSoldOut || isTimeInPast || noResources;
59
59
 
60
60
  return (
61
61
  <button
@@ -85,7 +85,7 @@ export const DateTimeButton = ({
85
85
  {showResources && resources && (
86
86
  <AvailabilityIndicator
87
87
  resources={resources}
88
- isUnavailable={_isDisabled || isPast}
88
+ isUnavailable={_isDisabled || isTimeInPast}
89
89
  isSoldOut={isSoldOut}
90
90
  />
91
91
  )}
@@ -93,7 +93,5 @@ export const DateTimeButton = ({
93
93
  );
94
94
  };
95
95
 
96
- const isPastTime = (date: DateTime): boolean => DateTime.now() > date;
97
-
98
- const isPastDate = (date: DateTime): boolean =>
99
- DateTime.now() > date.set({ hour: 23, minute: 59, second: 59 });
96
+ const isDateInPast = (date: DateTime): boolean =>
97
+ date.toUTC() <= DateTime.now().toUTC();
@@ -19,7 +19,6 @@ import { scrollToError } from "@licklist/plugins/dist/utils/ScrollUtils";
19
19
  import { getFirstErrorKey } from "@licklist/plugins/dist/utils/FormValues";
20
20
 
21
21
  import { ProductSet } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
22
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
23
22
  import { CategoryGroup } from "../../../../types/categories";
24
23
  import { SaleDeadline } from "../SaleDeadline/SaleDeadline";
25
24
  import {
@@ -65,7 +64,6 @@ export interface EditEventFormProps extends HasPermissionProp {
65
64
  createProductSet: (props: EditEventFormValues) => void;
66
65
  setEditProductSetId: (value: string) => void;
67
66
  isExternalPaymentLinkEnabled?: boolean;
68
- workHours: WorkHour[] | undefined;
69
67
  }
70
68
 
71
69
  const eventImageTypes = {
@@ -85,7 +83,6 @@ export const EditEventForm = ({
85
83
  createProductSet,
86
84
  setEditProductSetId,
87
85
  isExternalPaymentLinkEnabled,
88
- workHours,
89
86
  }: EditEventFormProps) => {
90
87
  const { t } = useTranslation(["Design", "Validation"]);
91
88
 
@@ -406,7 +403,6 @@ export const EditEventForm = ({
406
403
  setEditProductSetId={setEditProductSetId}
407
404
  setShowEditProductSet={setShowEditProductSet}
408
405
  showEditProductSet={showEditProductSet}
409
- workHours={workHours}
410
406
  />
411
407
 
412
408
  {hasPermission && !showEditProductSet && (
@@ -5,7 +5,6 @@ import { useId } from "@react-aria/utils";
5
5
  import { Controller, useFormContext } from "react-hook-form";
6
6
  import { HasPermissionProp } from "@licklist/plugins/dist/types/permission/Permission";
7
7
  import { ProductSet } from "@licklist/core/dist/DataMapper/Product/ProductSetDataMapper";
8
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
9
8
  import { ConfirmModal } from "../../../../modals/confirmation/ConfirmModal";
10
9
  import { EditEventFormValues } from "../EditEventForm/EditEventForm";
11
10
  import { EditEventProductSet } from "./component/EditEventProductSet";
@@ -16,7 +15,6 @@ interface SelectEventProductSetProps extends HasPermissionProp {
16
15
  setShowEditProductSet: (value: boolean) => void;
17
16
  createProductSet: (props: EditEventFormValues) => void;
18
17
  setEditProductSetId: (value: string) => void;
19
- workHours: WorkHour[] | undefined;
20
18
  }
21
19
 
22
20
  export const SelectEventProductSet = ({
@@ -25,7 +23,6 @@ export const SelectEventProductSet = ({
25
23
  setEditProductSetId,
26
24
  showEditProductSet,
27
25
  setShowEditProductSet,
28
- workHours,
29
26
  }: SelectEventProductSetProps) => {
30
27
  const { t } = useTranslation(["Design"]);
31
28
  const form = useFormContext<EditEventFormValues>();
@@ -202,13 +199,14 @@ export const SelectEventProductSet = ({
202
199
  </Form.Group>
203
200
  </div>
204
201
  {showEditProductSet && productSetId && (
205
- <EditEventProductSet
206
- onSubmit={onSubmit}
207
- defaultValues={
208
- productSetId === editedProductSet?.id && editedProductSet
209
- }
210
- workHours={workHours}
211
- />
202
+ <>
203
+ <EditEventProductSet
204
+ onSubmit={onSubmit}
205
+ defaultValues={
206
+ productSetId === editedProductSet?.id && editedProductSet
207
+ }
208
+ />
209
+ </>
212
210
  )}
213
211
  </>
214
212
  );
@@ -5,7 +5,6 @@ import { isEqual } from "lodash";
5
5
  import { useParams } from "react-router-dom";
6
6
  import { useEventEditProductSetContext } from "@licklist/plugins/dist/context/event/EventEditProductSetContext";
7
7
  import { useTranslation } from "react-i18next";
8
- import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
9
8
  import { BlockLoader } from "../../../../../static/loader/BlockLoader";
10
9
  import { ProductSetControl } from "../../../../../product-set";
11
10
  import { ProductSetContextProvider } from "../../../../../product-set/form/context";
@@ -23,13 +22,11 @@ export interface EventDates {
23
22
  interface EditEventProductSetProps {
24
23
  onSubmit: (value: EditEventFormValues["editedProductSet"]) => void;
25
24
  defaultValues?: EditEventFormValues["editedProductSet"];
26
- workHours: WorkHour[] | undefined;
27
25
  }
28
26
 
29
27
  export const EditEventProductSet = ({
30
28
  onSubmit,
31
29
  defaultValues,
32
- workHours,
33
30
  }: EditEventProductSetProps) => {
34
31
  const { companyId } = useParams<{
35
32
  companyId: string;
@@ -127,7 +124,6 @@ export const EditEventProductSet = ({
127
124
  companyName={selectedCompany?.title}
128
125
  fee={feeInPercent}
129
126
  isEventEditProductSet
130
- workHours={workHours}
131
127
  />
132
128
  <Button
133
129
  disabled={isLoading}
@@ -63,7 +63,7 @@ const processedPaymentSummary = ({
63
63
  const total = calculateTotalPrice(order, externalPaymentDetail);
64
64
 
65
65
  const totalDiscount = calculateTotalDiscount(order.payments);
66
-
66
+ const totalWithDiscount = total - Number(totalDiscount);
67
67
  let summaryItems: SummaryItem[] = [
68
68
  {
69
69
  translateKey: AMOUNT_TOTAL,
@@ -74,7 +74,7 @@ const processedPaymentSummary = ({
74
74
  if (totalDiscount) {
75
75
  summaryItems.push({
76
76
  translateKey: AMOUNT_WITH_DISCOUNT,
77
- price: order.totalToPayAmount,
77
+ price: totalWithDiscount < 0 ? 0 : totalWithDiscount,
78
78
  });
79
79
  }
80
80
 
@@ -84,17 +84,17 @@ const processedPaymentSummary = ({
84
84
 
85
85
  summaryItems.push({
86
86
  translateKey: TOTAL_PAID,
87
- price: order.paidAmount,
87
+ price: totalWithDiscount <= 0 ? 0 : order.totalAmount,
88
88
  });
89
- if (order.totalToPayAmount <= 0) {
89
+ if (totalWithDiscount <= 0) {
90
90
  return summaryItems;
91
91
  }
92
92
  summaryItems = [...summaryItems, ...externalPaymentDetail];
93
93
 
94
- if (order.remainingToPay) {
94
+ if (totalWithDiscount > order.totalAmount) {
95
95
  summaryItems.push({
96
96
  translateKey: REMAINING_TO_PAY,
97
- price: order.remainingToPay,
97
+ price: totalWithDiscount - order.totalAmount,
98
98
  });
99
99
  }
100
100
  return summaryItems;
@@ -123,26 +123,18 @@ export const RyftPaymentForm = ({
123
123
  };
124
124
 
125
125
  useEffect(
126
- () => {
127
- if (
128
- !formRef.current?.childNodes?.length ||
129
- formRef.current?.childNodes?.length < 3 ||
130
- !accountId.data?.account_id
131
- ) {
132
- return;
133
- }
126
+ () =>
134
127
  injectComponentsInRyftForm({
135
128
  t,
136
129
  additionalPaymentMethodsEnabled:
137
130
  providerPaymentSettings?.additionalPaymentMethodsEnabled,
138
- });
139
- },
131
+ }),
140
132
  // eslint-disable-next-line react-hooks/exhaustive-deps
141
133
  [formRef.current?.childNodes?.length]
142
134
  );
143
135
 
144
136
  useEffect(() => {
145
- if (!accountId.data?.account_id || accountId.isError) return;
137
+ if (!accountId.data || accountId.isError) return;
146
138
 
147
139
  initRyft(
148
140
  () => {
@@ -156,7 +148,7 @@ export const RyftPaymentForm = ({
156
148
  );
157
149
 
158
150
  // eslint-disable-next-line react-hooks/exhaustive-deps
159
- }, [accountId.data?.account_id]);
151
+ }, [accountId.data]);
160
152
 
161
153
  if (accountId.isLoading || accountId.isFetching || isCreateLoading)
162
154
  return (
@@ -8,12 +8,13 @@ export const injectComponentsInRyftForm = ({
8
8
  additionalPaymentMethodsEnabled?: boolean;
9
9
  }) => {
10
10
  const cardContainer = document.getElementById("ryft-pay-iframe");
11
+ const oldCardDividerContainer = document.getElementById(
12
+ "card-title-container"
13
+ );
11
14
 
12
- if (!cardContainer) {
15
+ if (!cardContainer || oldCardDividerContainer) {
13
16
  return;
14
17
  }
15
- // Removing of the old title container
16
- document.getElementById("card-title-container")?.remove();
17
18
 
18
19
  const cardTitle = document.createElement("div");
19
20
  const cardText = document.createElement("div");
@@ -31,10 +32,6 @@ export const injectComponentsInRyftForm = ({
31
32
  return;
32
33
  }
33
34
 
34
- // Removing of the old mobile title container and divider container
35
- document.getElementById("mobile-pay-title")?.remove();
36
- document.getElementById("mobile-pay-divider-container")?.remove();
37
-
38
35
  // Adding title and divider for apple and google pay button
39
36
  const mobilePayTitle = document.createElement("div");
40
37
  const dividerText = document.createElement("div");
@@ -42,7 +39,6 @@ export const injectComponentsInRyftForm = ({
42
39
  const container = document.createElement("div");
43
40
  mobilePayTitle.className = "mobile-pay-title";
44
41
  mobilePayTitle.innerText = t("Design:expressCheckoutWith");
45
- mobilePayTitle.id = "mobile-pay-title";
46
42
  dividerText.id = "mobile-pay-divider-text";
47
43
  dividerText.innerText = "or";
48
44
  divider.id = "mobile-pay-divider";
@@ -36,7 +36,7 @@ export interface DateAndRecurrenceInputValues {
36
36
 
37
37
  interface DateAndRecurrenceInputProps {
38
38
  isEventEditProductSet?: boolean;
39
- workHours: WorkHour[] | undefined;
39
+ workHours?: WorkHour[];
40
40
  providerHasBookingManagement: boolean;
41
41
  isLoading?: boolean;
42
42
  }
@@ -90,7 +90,7 @@ export const DateAndRecurrenceInput = ({
90
90
  clearEditState();
91
91
  });
92
92
 
93
- const popoverId = useId();
93
+ const popoverId = useId()!;
94
94
 
95
95
  const { t } = useTranslation("Design");
96
96
 
@@ -228,7 +228,6 @@ export const DateAndRecurrenceInput = ({
228
228
  defaultValues={editState.values}
229
229
  onChange={handleRecurringDateChange}
230
230
  onDelete={handleDelete}
231
- workHours={workHours}
232
231
  >
233
232
  {providerHasBookingManagement && (
234
233
  <AvailableTimesControl
@@ -5,8 +5,9 @@ import { Form, OverlayTrigger, Popover } from "react-bootstrap";
5
5
  import { useFieldArray, useFormContext } from "react-hook-form";
6
6
  import { useTranslation } from "react-i18next";
7
7
  import { useClickAway } from "react-use";
8
- import { UTC_TIMEZONE, TIME_FORMAT } from "@licklist/core/dist/Config/Date";
8
+ import { TIMEZONE } from "@licklist/core/dist/Config/Date";
9
9
  import { ProductSetRecurrence } from "@licklist/core/dist/DataMapper/Product/ProductSetRecurrenceDataMapper";
10
+ import { TIME_FORMAT } from "@licklist/core/dist/Config/Date";
10
11
  import { DateTime } from "luxon";
11
12
  import RRule, { Frequency } from "rrule";
12
13
  import { WorkHour } from "@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper";
@@ -26,6 +27,7 @@ import {
26
27
  import { ProductSetRecurrenceOverridesControl } from "./ProductSetRecurrenceOverridesControl";
27
28
  import { MAX_QUANTITY_RECURRENCE_DATE_IN_OVERRIDE } from "../product/constants";
28
29
 
30
+
29
31
  export interface DateAndRecurrenceInputValues {
30
32
  menuRecurrences?: Partial<ProductSetRecurrence>[];
31
33
  }
@@ -136,7 +138,7 @@ export const DateInput = ({
136
138
  until: (start as DateTime).toJSDate(),
137
139
  byweekday: [],
138
140
  freq: Frequency.DAILY,
139
- tzid: UTC_TIMEZONE,
141
+ tzid: TIMEZONE,
140
142
  interval: 1,
141
143
  }).replace("RRULE:", "");
142
144
 
@@ -85,7 +85,7 @@ export interface ProductSetControlProps {
85
85
  fieldSets?: FieldSet[];
86
86
  showEmailTemplate?: boolean;
87
87
  showSmsTemplate?: boolean;
88
- workHours: WorkHour[] | undefined;
88
+ workHours?: WorkHour[];
89
89
  providerHasBookingManagement?: boolean;
90
90
  isOverrides?: boolean;
91
91
  }
@@ -307,7 +307,7 @@ export function ProductCategoriesControl({
307
307
  title={t("addCategory")}
308
308
  isOverride={isOverrides}
309
309
  onClick={() => {
310
- if (isOverrides) return;
310
+ if (isOverrides) return;
311
311
  setIsSelectCategoryVisible(true);
312
312
  }}
313
313
  />
@@ -26,16 +26,12 @@ import { checkAvailableTimesErrors, getFilteredTemplates } from "../utils";
26
26
  export interface WithIsLoading {
27
27
  isLoading: boolean;
28
28
  }
29
- export interface WithIdOptional {
30
- id?: number;
31
- }
32
-
33
29
  export interface WithId {
34
30
  id: number;
35
31
  }
36
32
  export interface ProductSetFormValues
37
33
  extends FormValues,
38
- WithIdOptional,
34
+ WithId,
39
35
  ProductSetControlValues {
40
36
  steps: Step[];
41
37
  isOverrides?: boolean;
@@ -24,10 +24,8 @@ export const useSortableTreeFunctions = ({
24
24
  const cancelChanges = (index: number) => {
25
25
  if (isOverrides) return;
26
26
  if (!previousValue) {
27
- // eslint-disable-next-line consistent-return
28
27
  return remove(index);
29
28
  }
30
- // eslint-disable-next-line consistent-return
31
29
  return setValue(`${fieldName}.${index}` as const, previousValue);
32
30
  };
33
31