@licklist/design 0.69.3-dev.6 → 0.69.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 (197) hide show
  1. package/dist/affiliate/form/AffiliateForm.d.ts.map +1 -1
  2. package/dist/auth/Login/LoginComponent.js +1 -2
  3. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +1 -2
  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 +2 -3
  6. package/dist/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.d.ts +1 -2
  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 +28 -31
  9. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts +1 -2
  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 +2 -14
  12. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  13. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +2 -3
  14. package/dist/iframe/activity-card/ActivityCard.d.ts +4 -7
  15. package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
  16. package/dist/iframe/activity-card/ActivityCard.js +40 -59
  17. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
  18. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +0 -13
  19. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  20. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +0 -2
  21. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  22. package/dist/iframe/ryft/RyftPaymentForm.d.ts +2 -2
  23. package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
  24. package/dist/iframe/ryft/RyftPaymentForm.js +2 -8
  25. package/dist/iframe/ryft/utils/ryft-form.d.ts +1 -2
  26. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
  27. package/dist/iframe/ryft/utils/ryft-form.js +1 -20
  28. package/dist/index.js +0 -1
  29. package/dist/layout/DropDown.d.ts +1 -2
  30. package/dist/layout/DropDown.d.ts.map +1 -1
  31. package/dist/modals/confirmation/ConfirmModal.d.ts +1 -3
  32. package/dist/modals/confirmation/ConfirmModal.d.ts.map +1 -1
  33. package/dist/modals/confirmation/ConfirmModal.js +8 -172
  34. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  35. package/dist/notification/email-template/control/EmailTemplateControl.js +0 -3
  36. package/dist/product-set/card/ProductSetCard.d.ts +2 -6
  37. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  38. package/dist/product-set/card/ProductSetCard.js +11 -30
  39. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  40. package/dist/product-set/control/DateAndRecurrenceInput.js +3 -4
  41. package/dist/product-set/control/DateInput.d.ts.map +1 -1
  42. package/dist/product-set/control/DateInput.js +2 -2
  43. package/dist/product-set/control/ProductSetControl.d.ts +0 -4
  44. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  45. package/dist/product-set/control/ProductSetControl.js +3 -30
  46. package/dist/product-set/form/MobileFooter.d.ts.map +1 -1
  47. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  48. package/dist/product-set/form/ProductCategoriesControl.js +2 -48
  49. package/dist/product-set/form/ProductSetForm.d.ts +1 -4
  50. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  51. package/dist/product-set/form/ProductSetForm.js +1 -64
  52. package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
  53. package/dist/product-set/form/ProductZonesControl.js +2 -0
  54. package/dist/product-set/form/ProductsControl.js +0 -1
  55. package/dist/product-set/form/SelectCategoryModal.d.ts +0 -12
  56. package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
  57. package/dist/product-set/form/SelectCategoryModal.js +1 -1
  58. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  59. package/dist/product-set/form/SubProductsControl.js +3 -0
  60. package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
  61. package/dist/product-set/form/VenueMapsControl.js +3 -0
  62. package/dist/product-set/form/index.d.ts +0 -1
  63. package/dist/product-set/form/index.d.ts.map +1 -1
  64. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  65. package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
  66. package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +0 -6
  67. package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
  68. package/dist/product-set/product/deposit/ProductDepositControl.js +0 -3
  69. package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
  70. package/dist/product-set/product/duration/ProductDurationControl.js +0 -6
  71. package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
  72. package/dist/product-set/product/price/ProductPriceControl.js +0 -3
  73. package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
  74. package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +0 -6
  75. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  76. package/dist/product-set/product/quantity/ProductQuantityControl.js +0 -6
  77. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
  78. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +1 -4
  79. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  80. package/dist/product-set/product-category/ProductCategoryControl.js +0 -12
  81. package/dist/product-set/utils/index.d.ts +0 -7
  82. package/dist/product-set/utils/index.d.ts.map +1 -1
  83. package/dist/product-set/utils/index.js +1 -10
  84. package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
  85. package/dist/recurrence-input/RecurrenceEndInput.js +0 -3
  86. package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
  87. package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
  88. package/dist/resource/form/components/CapacityControl.js +0 -3
  89. package/dist/resource/form/components/SortControl.d.ts.map +1 -1
  90. package/dist/resource/form/components/SortControl.js +0 -3
  91. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  92. package/dist/sales/booking/results/components/ResultCard.js +2 -0
  93. package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
  94. package/dist/sales/coupon/control/CouponFormControl.js +0 -21
  95. package/dist/setting/admin/PaymentFeeForm.d.ts.map +1 -1
  96. package/dist/setting/admin/PaymentFeeForm.js +1 -16
  97. package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
  98. package/dist/setting/dashboard/DashboardSettingForm.js +1 -4
  99. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  100. package/dist/snippet/snippet-template/preview/Preview.js +0 -6
  101. package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
  102. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  103. package/dist/sortable-tree/SortableTreeItem.js +4 -10
  104. package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
  105. package/dist/static/CurrencyNumberInput.js +0 -3
  106. package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
  107. package/dist/static/form-number-input/FormNumberInput.js +0 -3
  108. package/dist/static/number-input/NumberInput.d.ts.map +1 -1
  109. package/dist/static/number-input/NumberInput.js +0 -3
  110. package/dist/styles/activity-card/{ActivitiesCard.scss → GridActivitiesCard.scss} +5 -19
  111. package/dist/styles/activity-card/ListActivitiesCard.scss +42 -12
  112. package/dist/styles/activity-card/_index.scss +1 -1
  113. package/dist/styles/availability-indicator/AvailabilityIndicator.scss +0 -9
  114. package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  115. package/dist/styles/product-set/ProductSetForm.scss +0 -22
  116. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +0 -25
  117. package/dist/styles/sales/BookingResults.scss +1 -1
  118. package/dist/typeahead/Typeahead.d.ts +1 -5
  119. package/dist/typeahead/Typeahead.d.ts.map +1 -1
  120. package/dist/typeahead/Typeahead.js +2 -9
  121. package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
  122. package/dist/zone/form/components/GameDurationControl.js +0 -3
  123. package/dist/zone/form/components/SortControl.d.ts.map +1 -1
  124. package/dist/zone/form/components/SortControl.js +0 -3
  125. package/package.json +7 -9
  126. package/src/affiliate/form/AffiliateForm.tsx +0 -1
  127. package/src/auth/Login/LoginComponent.tsx +1 -1
  128. package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +0 -3
  129. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +85 -88
  130. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +1 -11
  131. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -2
  132. package/src/iframe/activity-card/ActivityCard.tsx +24 -41
  133. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +0 -9
  134. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +0 -1
  135. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +0 -1
  136. package/src/iframe/ryft/RyftPaymentForm.tsx +4 -9
  137. package/src/iframe/ryft/utils/ryft-form.ts +2 -28
  138. package/src/layout/DropDown.tsx +1 -1
  139. package/src/modals/confirmation/ConfirmModal.tsx +3 -19
  140. package/src/notification/email-template/control/EmailTemplateControl.tsx +0 -1
  141. package/src/product-set/card/ProductSetCard.tsx +8 -47
  142. package/src/product-set/control/DateAndRecurrenceInput.tsx +1 -3
  143. package/src/product-set/control/DateInput.tsx +1 -2
  144. package/src/product-set/control/ProductSetControl.tsx +52 -52
  145. package/src/product-set/form/MobileFooter.tsx +3 -1
  146. package/src/product-set/form/ProductCategoriesControl.tsx +1 -37
  147. package/src/product-set/form/ProductSetForm.tsx +2 -24
  148. package/src/product-set/form/ProductZonesControl.tsx +4 -1
  149. package/src/product-set/form/SelectCategoryModal.tsx +2 -2
  150. package/src/product-set/form/SubProductsControl.tsx +3 -0
  151. package/src/product-set/form/VenueMapsControl.tsx +3 -0
  152. package/src/product-set/form/index.ts +0 -1
  153. package/src/product-set/product/ProductControl.tsx +1 -0
  154. package/src/product-set/product/advanced-options/AdvancedOptions.tsx +1 -1
  155. package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +0 -2
  156. package/src/product-set/product/deposit/ProductDepositControl.tsx +0 -1
  157. package/src/product-set/product/duration/ProductDurationControl.tsx +0 -2
  158. package/src/product-set/product/price/ProductPriceControl.tsx +0 -1
  159. package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +0 -2
  160. package/src/product-set/product/quantity/ProductQuantityControl.tsx +0 -2
  161. package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +0 -1
  162. package/src/product-set/product-category/ProductCategoryControl.tsx +0 -4
  163. package/src/product-set/product-zone/ProductZoneControl.tsx +1 -1
  164. package/src/product-set/utils/index.ts +0 -11
  165. package/src/recurrence-input/RecurrenceEndInput.tsx +0 -1
  166. package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +0 -1
  167. package/src/resource/form/components/CapacityControl.tsx +0 -1
  168. package/src/resource/form/components/SortControl.tsx +0 -1
  169. package/src/sales/booking/results/components/ResultCard.tsx +2 -0
  170. package/src/sales/coupon/control/CouponFormControl.tsx +0 -7
  171. package/src/setting/admin/PaymentFeeForm.tsx +0 -5
  172. package/src/setting/dashboard/DashboardSettingForm.tsx +0 -1
  173. package/src/snippet/snippet-template/preview/Preview.tsx +0 -6
  174. package/src/sortable-tree/SortableTreeItem.tsx +0 -6
  175. package/src/static/CurrencyNumberInput.tsx +0 -1
  176. package/src/static/form-number-input/FormNumberInput.tsx +0 -1
  177. package/src/static/number-input/NumberInput.tsx +0 -1
  178. package/src/styles/activity-card/{ActivitiesCard.scss → GridActivitiesCard.scss} +5 -19
  179. package/src/styles/activity-card/ListActivitiesCard.scss +42 -12
  180. package/src/styles/activity-card/_index.scss +1 -1
  181. package/src/styles/availability-indicator/AvailabilityIndicator.scss +0 -9
  182. package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  183. package/src/styles/product-set/ProductSetForm.scss +0 -22
  184. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +0 -25
  185. package/src/styles/sales/BookingResults.scss +1 -1
  186. package/src/typeahead/Typeahead.tsx +1 -15
  187. package/src/zone/form/components/GameDurationControl.tsx +0 -1
  188. package/src/zone/form/components/SortControl.tsx +0 -1
  189. package/yarn.lock +47 -73
  190. package/dist/product-set/control/ProductSetImageControl.d.ts +0 -2
  191. package/dist/product-set/control/ProductSetImageControl.d.ts.map +0 -1
  192. package/dist/product-set/control/ProductSetImageControl.js +0 -279
  193. package/dist/product-set/form/ProductSetNameControl.d.ts +0 -6
  194. package/dist/product-set/form/ProductSetNameControl.d.ts.map +0 -1
  195. package/dist/product-set/form/ProductSetNameControl.js +0 -35
  196. package/src/product-set/control/ProductSetImageControl.tsx +0 -97
  197. package/src/product-set/form/ProductSetNameControl.tsx +0 -27
@@ -12,8 +12,6 @@ export const getDefaultValues = (
12
12
  ): ProductSetFormValues => ({
13
13
  id: productSet?.id ?? 0,
14
14
  name: productSet?.name ?? '',
15
- description: productSet?.description ?? '',
16
- image: productSet?.image,
17
15
  type: productSet?.type ?? DEFAULT_PRODUCT_SET_TYPE,
18
16
  termsAndConditions: productSet?.termsAndConditions ?? '',
19
17
  operationalCost: productSet?.operationalCost ?? DEFAULT_OPERATIONAL_COST_TYPE,
@@ -39,6 +37,7 @@ export const getDefaultValues = (
39
37
  ...product,
40
38
  subProducts: subProducts?.map(({ ...subProducts }) => ({
41
39
  ...subProducts,
40
+ originalProductId: null,
42
41
  productCategoryId: undefined,
43
42
  })),
44
43
  productCategoryId: undefined,
@@ -1,85 +1,68 @@
1
1
  import { ReactNode } from 'react'
2
2
  import clsx from 'clsx'
3
- import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
4
- import { ZoneResourcesAvailability } from '@licklist/core/dist/DataMapper/Order/ZoneResourcesAvailabilityDataMapper'
5
- import { AvailabilityIndicator } from '../../availability-indicator'
6
3
 
7
4
  export const LAYOUT_GRID = 'grid'
8
5
  export const LAYOUT_LIST = 'list'
9
6
 
7
+ type Layout = typeof LAYOUT_GRID | typeof LAYOUT_LIST
8
+
10
9
  export type ActivityCardProps = {
11
10
  title: ReactNode
12
11
  duration: ReactNode
13
12
  price: ReactNode
14
- description?: ReactNode
15
13
  onSelect: () => void
16
14
  isSelected: boolean
17
- layout?: typeof LAYOUT_GRID | typeof LAYOUT_LIST
15
+ layout?: Layout
18
16
  availableTimes?: string | null
19
- image?: Image | null
20
- resources?: ZoneResourcesAvailability
21
17
  }
22
18
 
23
19
  export const ActivityCard = ({
24
20
  title,
25
21
  duration,
26
22
  price,
27
- description,
28
23
  availableTimes,
29
- image,
24
+ // image,
30
25
  onSelect,
31
26
  isSelected,
32
27
  layout = LAYOUT_GRID,
33
- resources,
34
28
  }: ActivityCardProps) => {
35
29
  if (layout === LAYOUT_GRID) {
36
30
  return (
37
31
  <button
38
32
  type='button'
39
- className={clsx('activity-card', { active: isSelected })}
33
+ className={clsx('activity-card', isSelected && 'active')}
40
34
  onClick={onSelect}
41
35
  >
42
- {image && (
43
- <img src={image.url} alt={typeof title === 'string' ? title : ''} />
44
- )}
45
-
46
- <div>
36
+ <div className={clsx('d-flex', 'flex-column')}>
47
37
  <div className='activity-card-title'>{title}</div>
48
38
  {duration && <div>{duration}</div>}
39
+
49
40
  {price && <div>{price}</div>}
50
- {description && (
51
- <div className='mt-2 activity-card-description'>{description}</div>
52
- )}
53
- {resources && <AvailabilityIndicator resources={resources} />}
54
41
  </div>
55
42
  </button>
56
43
  )
57
44
  }
58
45
 
59
46
  return (
60
- <button
61
- type='button'
62
- onClick={onSelect}
63
- className={clsx('activity-card list-activity-card', {
64
- active: isSelected,
65
- })}
66
- >
67
- {image && (
68
- <img src={image.url} alt={typeof title === 'string' ? title : ''} />
69
- )}
47
+ <div role='button' onClick={onSelect} onKeyPress={onSelect} tabIndex={0}>
48
+ <div
49
+ className={clsx('list-activity-card', {
50
+ active: isSelected,
51
+ })}
52
+ >
53
+ <div className='description'>
54
+ <div className='title mb-2'>{title}</div>
55
+ {availableTimes && <div>{availableTimes}</div>}
56
+ {duration && (
57
+ <div>
58
+ <p>{duration}</p>
59
+ </div>
60
+ )}
70
61
 
71
- <div className='activity-card-info'>
72
- <div className='activity-card-title mb-2'>{title}</div>
73
- {availableTimes && <div>{availableTimes}</div>}
74
- {duration && <div>{duration}</div>}
75
- {price && <div>{price}</div>}
76
- {description && (
77
- <div className='mt-2 activity-card-description'>{description}</div>
78
- )}
79
- {resources && <AvailabilityIndicator resources={resources} />}
62
+ {price && <div>{price}</div>}
63
+ </div>
80
64
  </div>
81
-
82
65
  <hr className='list-activity-card-hr' />
83
- </button>
66
+ </div>
84
67
  )
85
68
  }
@@ -89,7 +89,6 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
89
89
  <FormControl
90
90
  type='number'
91
91
  onChange={(e) => handleChangeValue(Number(e.target.value))}
92
- onWheel={(event) => event.currentTarget.blur()}
93
92
  value={value}
94
93
  min={0}
95
94
  max={max}
@@ -102,14 +101,6 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
102
101
  <button
103
102
  type='button'
104
103
  onClick={handleArrowUpClick}
105
- onWheel={(event) => event.currentTarget.blur()}
106
- onFocus={(event) =>
107
- event.target.addEventListener(
108
- 'wheel',
109
- (event) => event.preventDefault(),
110
- { passive: false },
111
- )
112
- }
113
104
  className={`payment-number-input__btn-up ${
114
105
  plusButtonGreyedOut && 'disabled-number-input-button'
115
106
  }`}
@@ -51,7 +51,6 @@ export const ProductQuantityInput = ({
51
51
  hasDeposit: category.allowDeposits && product?.deposit < product.price,
52
52
  price: product.price,
53
53
  productCategoryId: category.id,
54
- zoneId: category.zone?.id,
55
54
  quantity,
56
55
  capacity: product?.capacity,
57
56
  })
@@ -61,7 +61,6 @@ const processedPaymentSummary = ({
61
61
  const total = calculateTotalPrice(order, externalPaymentDetail)
62
62
 
63
63
  const totalDiscount = calculateTotalDiscount(order.payments)
64
-
65
64
  let summaryItems: SummaryItem[] = [
66
65
  {
67
66
  translateKey: AMOUNT_TOTAL,
@@ -38,7 +38,7 @@ export interface RyftPaymentFormProps {
38
38
  isCreateLoading: boolean
39
39
  isAppUsingInIframe?: boolean
40
40
  onApplePayButtonClick?: () => void
41
- payButtonDisabled?: boolean
41
+ applePayButtonDisabled?: boolean
42
42
  initRyft: (
43
43
  onSuccess: () => void,
44
44
  onFailure: (error?: string) => void,
@@ -57,7 +57,6 @@ export const RyftPaymentForm = ({
57
57
  initRyft,
58
58
  resetReferrer,
59
59
  onSubmit,
60
- payButtonDisabled,
61
60
  }: RyftPaymentFormProps) => {
62
61
  const { t } = useTranslation(['Design', 'Validation', 'Ryft'])
63
62
  const formRef = useRef<HTMLFormElement | null>(null)
@@ -90,6 +89,7 @@ export const RyftPaymentForm = ({
90
89
 
91
90
  const handleSubmit = async () => {
92
91
  setIsBtnDisabled(true)
92
+
93
93
  try {
94
94
  const paymentSession = await onSubmit()
95
95
 
@@ -142,21 +142,17 @@ export const RyftPaymentForm = ({
142
142
  t,
143
143
  isAppUsingInIframe,
144
144
  onApplePayButtonClick,
145
- isDisableButton: !payButtonDisabled,
146
145
  additionalPaymentMethodsEnabled:
147
146
  providerPaymentSettings?.additionalPaymentMethodsEnabled,
148
147
  })
149
148
  },
150
149
  // eslint-disable-next-line react-hooks/exhaustive-deps
151
- [
152
- formRef.current?.childNodes?.length,
153
- showApplePayButton,
154
- payButtonDisabled,
155
- ],
150
+ [formRef.current?.childNodes?.length, showApplePayButton],
156
151
  )
157
152
 
158
153
  useEffect(() => {
159
154
  if (!accountId.data?.account_id || accountId.isError) return
155
+
160
156
  initRyft(
161
157
  () => {
162
158
  addEventHandler('cardValidationChanged', (e: MessageEvent['data']) => {
@@ -219,7 +215,6 @@ export const RyftPaymentForm = ({
219
215
  onSubmit={methods.handleSubmit(handleSubmit)}
220
216
  className='ryft-payment-form'
221
217
  >
222
- <div className='form-disable-box' id='form-disable-box' />
223
218
  <div className='submit-button-wrapper mt-4 p-1'>
224
219
  <Button type='submit' disabled={isBtnDisabled || !isValid}>
225
220
  {isBtnDisabled && <ButtonLoader />}
@@ -7,7 +7,6 @@ interface InjectComponentsInRyftForm
7
7
  'onApplePayButtonClick' | 'isAppUsingInIframe'
8
8
  > {
9
9
  t: TFunction<string[]>
10
- isDisableButton?: boolean
11
10
  additionalPaymentMethodsEnabled?: boolean
12
11
  }
13
12
 
@@ -15,19 +14,16 @@ export const injectComponentsInRyftForm = ({
15
14
  t,
16
15
  additionalPaymentMethodsEnabled,
17
16
  isAppUsingInIframe,
18
- isDisableButton,
19
17
  onApplePayButtonClick,
20
18
  }: InjectComponentsInRyftForm) => {
21
19
  const cardContainer = document.getElementById('ryft-pay-iframe')
20
+
22
21
  if (!cardContainer) {
23
22
  return
24
23
  }
25
24
  // Removing of the old title container
26
25
  document.getElementById('card-title-container')?.remove()
27
26
 
28
- cardContainer.style.opacity = isDisableButton ? '0.6' : '1'
29
- cardContainer.ariaDisabled = isDisableButton?.toString()
30
-
31
27
  const cardTitle = document.createElement('div')
32
28
  const cardText = document.createElement('div')
33
29
  const cardTitleContainer = document.createElement('div')
@@ -39,6 +35,7 @@ export const injectComponentsInRyftForm = ({
39
35
  cardContainer?.before(cardTitleContainer)
40
36
 
41
37
  const payGrid = document.getElementById('ryft-pay-grid')
38
+
42
39
  if (!payGrid || !additionalPaymentMethodsEnabled) {
43
40
  return
44
41
  }
@@ -61,29 +58,6 @@ export const injectComponentsInRyftForm = ({
61
58
  divider.id = 'mobile-pay-divider'
62
59
  container.id = 'mobile-pay-divider-container'
63
60
  container.append(dividerText, divider)
64
- const payIframe = document.getElementById('ryft-pay-iframe')
65
- if (payIframe) {
66
- const formBox = document.getElementById('form-disable-box')
67
- if (formBox) {
68
- formBox.style.display = isDisableButton ? 'block' : 'none'
69
- }
70
-
71
- const googleButton = document.getElementById(
72
- 'gpay-button-online-api-id',
73
- ) as HTMLButtonElement
74
- const appleButton = document.getElementById(
75
- 'ryft-pay-apple-pay-button',
76
- ) as HTMLButtonElement
77
- if (googleButton) {
78
- googleButton.disabled = isDisableButton
79
- googleButton.style.opacity = isDisableButton ? '1' : '0.6'
80
- }
81
- if (appleButton) {
82
- appleButton.disabled = isDisableButton
83
- appleButton.style.opacity = isDisableButton ? '1' : '0.6'
84
- }
85
- }
86
-
87
61
  if (isAppUsingInIframe) {
88
62
  const applePayButton = document.createElement('button')
89
63
  applePayButton.id = 'apple-pay'
@@ -1,4 +1,4 @@
1
- import React, { forwardRef } from 'react'
1
+ import { forwardRef } from 'react'
2
2
 
3
3
  interface Props {
4
4
  children?: React.ReactNode | React.ReactNode[]
@@ -20,9 +20,6 @@ export type ConfirmModalTypes =
20
20
  export interface ConfirmModalProps {
21
21
  type?: ConfirmModalTypes
22
22
  children?: (confirm: (action: ConfirmAction) => void) => ReactNode
23
- // confirm function memoize the callback function. It's an alternative function
24
- confirmationHandler?: () => Promise<boolean | undefined>
25
- disabledButtons?: boolean
26
23
  title?: string
27
24
  content?: string | ReactNode
28
25
  onClose?: () => void
@@ -40,9 +37,7 @@ export function ConfirmModal({
40
37
  type = 'default',
41
38
  children,
42
39
  onClose,
43
- confirmationHandler,
44
40
  title,
45
- disabledButtons,
46
41
  content,
47
42
  hideButtons = false,
48
43
  }: ConfirmModalProps) {
@@ -57,16 +52,10 @@ export function ConfirmModal({
57
52
  setIsOpen(() => true)
58
53
  }
59
54
 
60
- const handleConfirmation = async (e) => {
55
+ const handleConfirmation = (e) => {
61
56
  e.stopPropagation()
62
- if (!actionRef.current && !confirmationHandler) return
63
- if (confirmationHandler) {
64
- const res = await confirmationHandler()
65
- if (res) {
66
- setIsOpen(() => false)
67
- }
68
- return
69
- }
57
+ if (!actionRef.current) return
58
+
70
59
  actionRef.current()
71
60
  setIsOpen(() => false)
72
61
  }
@@ -99,7 +88,6 @@ export function ConfirmModal({
99
88
  <Button
100
89
  variant='danger'
101
90
  className='btn-sm rounded'
102
- disabled={disabledButtons}
103
91
  onClick={handleClose}
104
92
  data-id={CONFIRM_MODAL_ACTION_DECLINE}
105
93
  >
@@ -117,14 +105,12 @@ export function ConfirmModal({
117
105
  variant='outline'
118
106
  className='cancel-button'
119
107
  onClick={handleClose}
120
- disabled={disabledButtons}
121
108
  data-id={CONFIRM_MODAL_ACTION_DECLINE}
122
109
  >
123
110
  {t('cancel')}
124
111
  </Button>
125
112
  <Button
126
113
  variant='danger'
127
- disabled={disabledButtons}
128
114
  onClick={handleConfirmation}
129
115
  data-id={CONFIRM_MODAL_ACTION_CONFIRM}
130
116
  >
@@ -135,7 +121,6 @@ export function ConfirmModal({
135
121
  <>
136
122
  <Button
137
123
  variant='danger'
138
- disabled={disabledButtons}
139
124
  onClick={handleClose}
140
125
  data-id={CONFIRM_MODAL_ACTION_DECLINE}
141
126
  >
@@ -143,7 +128,6 @@ export function ConfirmModal({
143
128
  </Button>
144
129
  <Button
145
130
  variant='success'
146
- disabled={disabledButtons}
147
131
  onClick={handleConfirmation}
148
132
  data-id={CONFIRM_MODAL_ACTION_CONFIRM}
149
133
  >
@@ -434,7 +434,6 @@ export const EmailTemplateControl = forwardRef(
434
434
  `templateOptionValues.${option?.id}.value`,
435
435
  )}
436
436
  type='number'
437
- onWheel={(event) => event.currentTarget.blur()}
438
437
  placeholder={t(`Design:${option.name}`)}
439
438
  id={option.name + option.id}
440
439
  defaultValue={option.selectedValue || ''}
@@ -9,20 +9,15 @@ import RouteService from '@licklist/plugins/dist/services/Route/RouteService'
9
9
  import { FaEllipsisH, FaEye, FaTrashAlt } from 'react-icons/fa'
10
10
  import { ConfirmModal } from '../../modals'
11
11
  import { MenuButton } from '../../table/MenuButton'
12
- import { ProductSetNameControl } from '../form/ProductSetNameControl'
13
12
 
14
13
  export interface ProductSetCardProps extends HasPermissionProp {
15
14
  name: string
16
15
  rrule?: string
17
16
  href: string
18
- duplicateProductSetName: string
19
- onChangeDuplicateProductSetName: (value: string) => void
20
- onCopy: () => Promise<boolean | undefined>
17
+ onCopy: () => void
21
18
  onRemove: () => void
22
- isLoading?: boolean
23
19
  className?: string
24
20
  override?: number
25
- duplicateProductSetError?: string
26
21
  }
27
22
 
28
23
  export function ProductSetCard({
@@ -31,10 +26,6 @@ export function ProductSetCard({
31
26
  href,
32
27
  onCopy,
33
28
  onRemove,
34
- onChangeDuplicateProductSetName,
35
- duplicateProductSetName,
36
- duplicateProductSetError,
37
- isLoading,
38
29
  className = '',
39
30
  hasPermission = true,
40
31
  override = 0,
@@ -44,23 +35,19 @@ export function ProductSetCard({
44
35
  const productSetCardClasses = `product-set-card ${className}`
45
36
  const [isOverlayVisibile, setIsOverlayVisible] = useState(false)
46
37
 
47
- const onCardClick = () => {
48
- RouteService.redirectTo(href)
49
- }
50
38
  return (
51
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events
52
39
  <div
53
40
  role='button'
54
41
  tabIndex={0}
55
42
  className='border-0 product-set-card-wrapper w-100 pb-0'
56
- onClick={onCardClick}
43
+ onClick={() => RouteService.redirectTo(href)}
44
+ onKeyUp={() => RouteService.redirectTo(href)}
57
45
  >
58
46
  <div className={productSetCardClasses}>
59
47
  <div className='product-set-card-link'>
60
48
  <div className='d-flex flex-column'>
61
49
  <div>
62
- {name}
63
- {rrule && `(${RRule.fromString(rrule).toText()})`}
50
+ {name} {rrule && `(${RRule.fromString(rrule).toText()})`}
64
51
  </div>
65
52
  {!!override && (
66
53
  <div className='h6 bold ml-1'>
@@ -92,33 +79,14 @@ export function ProductSetCard({
92
79
  >
93
80
  {hasPermission && (
94
81
  <>
95
- <ListGroup.Item
96
- action
97
- as='div'
98
- role='button'
99
- tabIndex={0}
100
- onClick={(e) => e.stopPropagation()}
101
- >
82
+ <ListGroup.Item action as='div'>
102
83
  {Boolean(onCopy) && (
103
- <ConfirmModal
104
- // confirm function memoize the callback function and it leads to bugs
105
- confirmationHandler={onCopy}
106
- disabledButtons={isLoading}
107
- content={
108
- <ProductSetNameControl
109
- value={duplicateProductSetName}
110
- onChange={onChangeDuplicateProductSetName}
111
- error={duplicateProductSetError}
112
- />
113
- }
114
- >
84
+ <ConfirmModal>
115
85
  {(confirm) => (
116
86
  <MenuButton
117
87
  onClick={() => {
118
88
  setIsOverlayVisible(false)
119
- onChangeDuplicateProductSetName(name)
120
- // confirm function memoize the callback function and it leads to bugs
121
- confirm(() => {})
89
+ confirm(onCopy)
122
90
  }}
123
91
  name={t('duplicate')}
124
92
  className='product-set-card-menu-item-text'
@@ -127,14 +95,7 @@ export function ProductSetCard({
127
95
  </ConfirmModal>
128
96
  )}
129
97
  </ListGroup.Item>
130
- <ListGroup.Item
131
- action
132
- className='text-danger'
133
- as='div'
134
- role='button'
135
- tabIndex={0}
136
- onClick={(e) => e.stopPropagation()}
137
- >
98
+ <ListGroup.Item action className='text-danger' as='div'>
138
99
  {Boolean(onRemove) && (
139
100
  <ConfirmModal>
140
101
  {(confirm) => (
@@ -198,8 +198,6 @@ export const DateAndRecurrenceInput = ({
198
198
  move(prevIndex, nextIndex)
199
199
  }
200
200
 
201
- const errorMessage = errors.menuRecurrences?.message || errors.menuRecurrences?.root?.message
202
-
203
201
  useEffect(() => {
204
202
  if (fields.length) {
205
203
  clearErrors('menuRecurrences')
@@ -309,7 +307,7 @@ export const DateAndRecurrenceInput = ({
309
307
  />
310
308
 
311
309
  <div className='manual-form-error'>
312
- {errorMessage}
310
+ {errors.menuRecurrences?.message}
313
311
  </div>
314
312
  </div>
315
313
  </OverlayTrigger>
@@ -247,8 +247,7 @@ export const DateInput = ({
247
247
  menuRecurrence={menuRecurrence}
248
248
  onEdit={() => handleOnEdit(menuRecurrence, index)}
249
249
  errorMessage={
250
- errors?.menuRecurrences?.[`${index}`]?.availableTimes
251
- ?.message || errors?.menuRecurrences?.[`${index}`]?.message
250
+ errors?.menuRecurrences?.[`${index}`]?.availableTimes?.message
252
251
  }
253
252
  />
254
253
  ))}