@licklist/design 0.69.1-dev.4 → 0.69.2

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 (187) 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 +24 -50
  9. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +0 -1
  10. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  11. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +2 -3
  12. package/dist/iframe/activity-card/ActivityCard.d.ts +4 -5
  13. package/dist/iframe/activity-card/ActivityCard.d.ts.map +1 -1
  14. package/dist/iframe/activity-card/ActivityCard.js +40 -52
  15. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
  16. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +0 -13
  17. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  18. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +0 -2
  19. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  20. package/dist/iframe/ryft/RyftPaymentForm.d.ts +2 -2
  21. package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
  22. package/dist/iframe/ryft/RyftPaymentForm.js +2 -8
  23. package/dist/iframe/ryft/utils/ryft-form.d.ts +1 -2
  24. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
  25. package/dist/iframe/ryft/utils/ryft-form.js +1 -20
  26. package/dist/index.js +0 -1
  27. package/dist/layout/DropDown.d.ts +1 -2
  28. package/dist/layout/DropDown.d.ts.map +1 -1
  29. package/dist/modals/confirmation/ConfirmModal.d.ts +1 -3
  30. package/dist/modals/confirmation/ConfirmModal.d.ts.map +1 -1
  31. package/dist/modals/confirmation/ConfirmModal.js +8 -172
  32. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  33. package/dist/notification/email-template/control/EmailTemplateControl.js +0 -3
  34. package/dist/product-set/card/ProductSetCard.d.ts +2 -6
  35. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  36. package/dist/product-set/card/ProductSetCard.js +11 -30
  37. package/dist/product-set/control/DateInput.d.ts.map +1 -1
  38. package/dist/product-set/control/DateInput.js +2 -2
  39. package/dist/product-set/control/ProductSetControl.d.ts +0 -4
  40. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  41. package/dist/product-set/control/ProductSetControl.js +3 -24
  42. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  43. package/dist/product-set/form/ProductCategoriesControl.js +2 -48
  44. package/dist/product-set/form/ProductSetForm.d.ts +1 -4
  45. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  46. package/dist/product-set/form/ProductSetForm.js +1 -64
  47. package/dist/product-set/form/ProductZonesControl.d.ts.map +1 -1
  48. package/dist/product-set/form/ProductZonesControl.js +2 -0
  49. package/dist/product-set/form/ProductsControl.js +0 -1
  50. package/dist/product-set/form/SelectCategoryModal.d.ts +0 -12
  51. package/dist/product-set/form/SelectCategoryModal.d.ts.map +1 -1
  52. package/dist/product-set/form/SelectCategoryModal.js +1 -1
  53. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  54. package/dist/product-set/form/SubProductsControl.js +3 -0
  55. package/dist/product-set/form/VenueMapsControl.d.ts.map +1 -1
  56. package/dist/product-set/form/VenueMapsControl.js +3 -0
  57. package/dist/product-set/form/index.d.ts +0 -1
  58. package/dist/product-set/form/index.d.ts.map +1 -1
  59. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  60. package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
  61. package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +0 -6
  62. package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
  63. package/dist/product-set/product/deposit/ProductDepositControl.js +0 -3
  64. package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
  65. package/dist/product-set/product/duration/ProductDurationControl.js +0 -6
  66. package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
  67. package/dist/product-set/product/price/ProductPriceControl.js +0 -3
  68. package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
  69. package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +0 -6
  70. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  71. package/dist/product-set/product/quantity/ProductQuantityControl.js +0 -6
  72. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
  73. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +1 -4
  74. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  75. package/dist/product-set/product-category/ProductCategoryControl.js +0 -12
  76. package/dist/product-set/utils/index.d.ts +0 -7
  77. package/dist/product-set/utils/index.d.ts.map +1 -1
  78. package/dist/product-set/utils/index.js +1 -10
  79. package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
  80. package/dist/recurrence-input/RecurrenceEndInput.js +0 -3
  81. package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
  82. package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
  83. package/dist/resource/form/components/CapacityControl.js +0 -3
  84. package/dist/resource/form/components/SortControl.d.ts.map +1 -1
  85. package/dist/resource/form/components/SortControl.js +0 -3
  86. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  87. package/dist/sales/booking/results/components/ResultCard.js +2 -0
  88. package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
  89. package/dist/sales/coupon/control/CouponFormControl.js +0 -21
  90. package/dist/setting/admin/PaymentFeeForm.d.ts.map +1 -1
  91. package/dist/setting/admin/PaymentFeeForm.js +1 -16
  92. package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
  93. package/dist/setting/dashboard/DashboardSettingForm.js +1 -4
  94. package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
  95. package/dist/snippet/snippet-template/preview/Preview.js +0 -6
  96. package/dist/sortable-tree/SortableTreeItem.d.ts +1 -2
  97. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  98. package/dist/sortable-tree/SortableTreeItem.js +4 -10
  99. package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
  100. package/dist/static/CurrencyNumberInput.js +0 -3
  101. package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
  102. package/dist/static/form-number-input/FormNumberInput.js +0 -3
  103. package/dist/static/number-input/NumberInput.d.ts.map +1 -1
  104. package/dist/static/number-input/NumberInput.js +0 -3
  105. package/dist/styles/activity-card/{ActivitiesCard.scss → GridActivitiesCard.scss} +5 -19
  106. package/dist/styles/activity-card/ListActivitiesCard.scss +42 -12
  107. package/dist/styles/activity-card/_index.scss +1 -1
  108. package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  109. package/dist/styles/product-set/ProductSetForm.scss +0 -22
  110. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +1 -28
  111. package/dist/styles/sales/BookingResults.scss +1 -1
  112. package/dist/typeahead/Typeahead.d.ts +1 -5
  113. package/dist/typeahead/Typeahead.d.ts.map +1 -1
  114. package/dist/typeahead/Typeahead.js +2 -9
  115. package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
  116. package/dist/zone/form/components/GameDurationControl.js +0 -3
  117. package/dist/zone/form/components/SortControl.d.ts.map +1 -1
  118. package/dist/zone/form/components/SortControl.js +0 -3
  119. package/package.json +6 -8
  120. package/src/affiliate/form/AffiliateForm.tsx +0 -1
  121. package/src/auth/Login/LoginComponent.tsx +1 -1
  122. package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +2 -3
  123. package/src/events/edit-event-modal/component/SelectEventProductSet/SelectEventProductSet.tsx +86 -85
  124. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -2
  125. package/src/iframe/activity-card/ActivityCard.tsx +24 -35
  126. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +0 -9
  127. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +0 -1
  128. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +0 -1
  129. package/src/iframe/ryft/RyftPaymentForm.tsx +5 -13
  130. package/src/iframe/ryft/utils/ryft-form.ts +2 -26
  131. package/src/layout/DropDown.tsx +1 -1
  132. package/src/modals/confirmation/ConfirmModal.tsx +3 -19
  133. package/src/notification/email-template/control/EmailTemplateControl.tsx +0 -1
  134. package/src/product-set/card/ProductSetCard.tsx +8 -47
  135. package/src/product-set/control/DateInput.tsx +1 -2
  136. package/src/product-set/control/ProductSetControl.tsx +52 -46
  137. package/src/product-set/form/ProductCategoriesControl.tsx +1 -37
  138. package/src/product-set/form/ProductSetForm.tsx +2 -24
  139. package/src/product-set/form/ProductZonesControl.tsx +4 -1
  140. package/src/product-set/form/SelectCategoryModal.tsx +2 -2
  141. package/src/product-set/form/SubProductsControl.tsx +3 -0
  142. package/src/product-set/form/VenueMapsControl.tsx +3 -0
  143. package/src/product-set/form/index.ts +0 -1
  144. package/src/product-set/product/ProductControl.tsx +1 -0
  145. package/src/product-set/product/advanced-options/AdvancedOptions.tsx +1 -1
  146. package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +0 -2
  147. package/src/product-set/product/deposit/ProductDepositControl.tsx +0 -1
  148. package/src/product-set/product/duration/ProductDurationControl.tsx +0 -2
  149. package/src/product-set/product/price/ProductPriceControl.tsx +0 -1
  150. package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +0 -2
  151. package/src/product-set/product/quantity/ProductQuantityControl.tsx +0 -2
  152. package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +0 -1
  153. package/src/product-set/product-category/ProductCategoryControl.tsx +0 -4
  154. package/src/product-set/product-zone/ProductZoneControl.tsx +1 -1
  155. package/src/product-set/utils/index.ts +0 -11
  156. package/src/recurrence-input/RecurrenceEndInput.tsx +0 -1
  157. package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +0 -1
  158. package/src/resource/form/components/CapacityControl.tsx +0 -1
  159. package/src/resource/form/components/SortControl.tsx +0 -1
  160. package/src/sales/booking/results/components/ResultCard.tsx +2 -0
  161. package/src/sales/coupon/control/CouponFormControl.tsx +0 -7
  162. package/src/setting/admin/PaymentFeeForm.tsx +0 -5
  163. package/src/setting/dashboard/DashboardSettingForm.tsx +0 -1
  164. package/src/snippet/snippet-template/preview/Preview.tsx +0 -6
  165. package/src/sortable-tree/SortableTreeItem.tsx +0 -6
  166. package/src/static/CurrencyNumberInput.tsx +0 -1
  167. package/src/static/form-number-input/FormNumberInput.tsx +0 -1
  168. package/src/static/number-input/NumberInput.tsx +0 -1
  169. package/src/styles/activity-card/{ActivitiesCard.scss → GridActivitiesCard.scss} +5 -19
  170. package/src/styles/activity-card/ListActivitiesCard.scss +42 -12
  171. package/src/styles/activity-card/_index.scss +1 -1
  172. package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  173. package/src/styles/product-set/ProductSetForm.scss +0 -22
  174. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +1 -28
  175. package/src/styles/sales/BookingResults.scss +1 -1
  176. package/src/typeahead/Typeahead.tsx +1 -15
  177. package/src/zone/form/components/GameDurationControl.tsx +0 -1
  178. package/src/zone/form/components/SortControl.tsx +0 -1
  179. package/yarn.lock +32 -58
  180. package/dist/product-set/control/ProductSetImageControl.d.ts +0 -2
  181. package/dist/product-set/control/ProductSetImageControl.d.ts.map +0 -1
  182. package/dist/product-set/control/ProductSetImageControl.js +0 -279
  183. package/dist/product-set/form/ProductSetNameControl.d.ts +0 -6
  184. package/dist/product-set/form/ProductSetNameControl.d.ts.map +0 -1
  185. package/dist/product-set/form/ProductSetNameControl.js +0 -35
  186. package/src/product-set/control/ProductSetImageControl.tsx +0 -97
  187. package/src/product-set/form/ProductSetNameControl.tsx +0 -27
@@ -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,27 +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("ryft-pay-apple-pay-button") as HTMLButtonElement
75
- if (googleButton) {
76
- googleButton.disabled = isDisableButton
77
- googleButton.style.opacity = isDisableButton ? '1' : '0.6'
78
- }
79
- if (appleButton) {
80
- appleButton.disabled = isDisableButton
81
- appleButton.style.opacity = isDisableButton ? '1' : '0.6'
82
- }
83
- }
84
-
85
61
  if (isAppUsingInIframe) {
86
62
  const applePayButton = document.createElement('button')
87
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) => (
@@ -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
  ))}
@@ -22,11 +22,12 @@ import HookFormService from '@licklist/plugins/dist/services/Form/HookFormServic
22
22
  import { ruleForUrlWithProtocol } from '@licklist/plugins/dist/validation/Rules/urlRule'
23
23
  import { WorkHour } from '@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper'
24
24
  import { checkIfZoneCategory } from '@licklist/plugins'
25
- import { Image } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
26
25
  import { WarningMessage } from '../../static'
27
26
  import { SelectItem } from '../../types/generic/SelectItem'
28
27
  import {
29
28
  DateAndRecurrenceInput,
29
+ // TODO: Show Date Component, when reccurent date bugs are fixed
30
+ // DateAndRecurrenceInput,
30
31
  DateAndRecurrenceInputValues,
31
32
  } from './DateAndRecurrenceInput'
32
33
  import TutorialGifCard from './TutorialGifCard'
@@ -34,7 +35,6 @@ import { Step } from '../types'
34
35
  import { StepsControl } from '../form/StepsControl'
35
36
  import { Typeahead } from '../../typeahead'
36
37
  import { DateInput } from './DateInput'
37
- import { ProductSetImageControl } from './ProductSetImageControl'
38
38
 
39
39
  const OPERATIONAL_COST_TITLES = {
40
40
  [OPERATIONAL_COST_PROVIDER]: 'operationalCostProvider',
@@ -47,8 +47,6 @@ const RELY_ON_PEOPLE_TYPE_TITLES = {
47
47
  [RELY_ON_PEOPLE_QUANTITY]: 'peopleQuantity',
48
48
  }
49
49
 
50
- const MAX_DESCRIPTION_LENGTH = 500
51
-
52
50
  export interface TemplateItem {
53
51
  id: string
54
52
  value: EmailTemplate | SmsTemplate
@@ -57,8 +55,6 @@ export interface TemplateItem {
57
55
 
58
56
  export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
59
57
  name: string
60
- description?: string
61
- image?: Image
62
58
  type: ProductSetType
63
59
  termsAndConditions: string
64
60
  thankYouPageUrl: string
@@ -69,7 +65,6 @@ export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
69
65
  steps: Step[]
70
66
  emailTemplates?: TemplateItem[]
71
67
  smsTemplates?: TemplateItem[]
72
- localImageBlobURL?: string
73
68
  }
74
69
 
75
70
  export interface ProductSetControlShared {
@@ -127,7 +122,6 @@ export function ProductSetControl({
127
122
  const steps = watch('steps')
128
123
 
129
124
  const nameId = useId()
130
- const descriptionId = useId()
131
125
  const termsAndConditionsId = useId()
132
126
  const relyOnPeopleTypeId = useId()
133
127
 
@@ -180,22 +174,6 @@ export function ProductSetControl({
180
174
  </Form.Control.Feedback>
181
175
  </Form.Group>
182
176
 
183
- <Form.Group controlId={descriptionId}>
184
- <Form.Label>{t('Design:description')}</Form.Label>
185
- <Form.Control
186
- {...register('description', {
187
- maxLength: MAX_DESCRIPTION_LENGTH,
188
- })}
189
- as='textarea'
190
- isInvalid={Boolean(errors.description)}
191
- />
192
- <Form.Control.Feedback type='invalid'>
193
- {errors.description?.message}
194
- </Form.Control.Feedback>
195
- </Form.Group>
196
-
197
- <ProductSetImageControl />
198
-
199
177
  {showDateSelector ? (
200
178
  <DateInput
201
179
  workHours={isZoneAdded ? workHours : undefined}
@@ -229,6 +207,27 @@ export function ProductSetControl({
229
207
  </Col>
230
208
  <Col md={6} sm={12}>
231
209
  <div className='second-column'>
210
+ {/* <Controller
211
+ control={control}
212
+ name="type"
213
+ render={({ field }) => (
214
+ <Form.Group className="d-flex flex-column flex-grow-1 align-items-start">
215
+ <Form.Label>{t("Design:checkoutType")}</Form.Label>
216
+ <Switch
217
+ name={field.name}
218
+ options={PRODUCT_SET_TYPES.map((type) => ({
219
+ key: type,
220
+ id: type,
221
+ value: t(type),
222
+ }))}
223
+ value={field.value}
224
+ onChange={field.onChange}
225
+ disabled={isLoading}
226
+ />
227
+ </Form.Group>
228
+ )}
229
+ /> */}
230
+
232
231
  <Form.Group>
233
232
  <Form.Label className='mb-0'>
234
233
  {t('Design:operationalCost')}
@@ -365,28 +364,35 @@ export function ProductSetControl({
365
364
  <Controller
366
365
  control={control}
367
366
  name='fieldSetId'
368
- render={({ field }) => (
369
- <>
370
- <Form.Label>{t('Design:customFields')}</Form.Label>
371
- <Form.Control
372
- onChange={field.onChange}
373
- value={Number(field.value)}
374
- as='select'
375
- disabled={isOverrides}
376
- isInvalid={HookFormService.isInvalid('fieldSetId', errors)}
377
- >
378
- <option value=''>{t('Design:choose')}</option>
379
- {fieldSets?.map((fieldSet) => (
380
- <option value={fieldSet.id} key={fieldSet.id}>
381
- {fieldSet.name}
382
- </option>
383
- ))}
384
- </Form.Control>
385
- <Form.Control.Feedback type='invalid'>
386
- {HookFormService.getErrors('fieldSetId', errors)}
387
- </Form.Control.Feedback>
388
- </>
389
- )}
367
+ render={({ field }) => {
368
+ const fieldValue = Number(field.value)
369
+
370
+ return (
371
+ <>
372
+ <Form.Label>{t('Design:customFields')}</Form.Label>
373
+ <Form.Control
374
+ onChange={field.onChange}
375
+ value={fieldValue}
376
+ as='select'
377
+ disabled={isOverrides}
378
+ isInvalid={HookFormService.isInvalid(
379
+ 'fieldSetId',
380
+ errors,
381
+ )}
382
+ >
383
+ <option value=''>{t('Design:choose')}</option>
384
+ {fieldSets?.map((fieldSet) => (
385
+ <option value={fieldSet.id} key={fieldSet.id}>
386
+ {fieldSet.name}
387
+ </option>
388
+ ))}
389
+ </Form.Control>
390
+ <Form.Control.Feedback type='invalid'>
391
+ {HookFormService.getErrors('fieldSetId', errors)}
392
+ </Form.Control.Feedback>
393
+ </>
394
+ )
395
+ }}
390
396
  />
391
397
  </Form.Group>
392
398
 
@@ -8,7 +8,6 @@ import {
8
8
  useFormContext,
9
9
  useWatch,
10
10
  } from 'react-hook-form'
11
- import { FaBars, FaBowlingBall, FaCalendar, FaTicketAlt } from 'react-icons/fa'
12
11
  import { useTranslation } from 'react-i18next'
13
12
  import { useSensor, MouseSensor } from '@dnd-kit/core'
14
13
  import {
@@ -26,11 +25,7 @@ import { ProductCategoryControl } from '../product-category'
26
25
  import { ProductCategory } from '../types'
27
26
  import { ProductsControl } from './ProductsControl'
28
27
  import { ProductSetFormValues, WithIsLoading } from './ProductSetForm'
29
- import {
30
- SelectCategoryModal,
31
- CATEGORY_TYPES_NAMES,
32
- CategoryConfig,
33
- } from './SelectCategoryModal'
28
+ import { SelectCategoryModal } from './SelectCategoryModal'
34
29
  import { ProductSetLoadingContext } from './context'
35
30
  import { VenueMapSetModal } from './VenueMapSetModal'
36
31
  import { moveArrayElements, sortArrayByIndex } from '../utils'
@@ -38,29 +33,6 @@ import { useSortableTreeFunctions } from '../hooks/useSortableTreeFunctions'
38
33
  // @TODO not for first release
39
34
  // import Popover from "./ProductSetFormPopover";
40
35
 
41
- const CATEGORIES_TYPE: Partial<Record<CategoryType, CategoryConfig>> = {
42
- [CATEGORY_TYPES_NAMES.tickets]: {
43
- label: 'tickets',
44
- icon: <FaTicketAlt color='#0e8ce2' size={10} />,
45
- },
46
- [CATEGORY_TYPES_NAMES.bookings]: {
47
- label: 'bookings',
48
- icon: <FaCalendar color='#0e8ce2' size={10} />,
49
- },
50
- [CATEGORY_TYPES_NAMES.menuItems]: {
51
- label: 'menuItems',
52
- icon: <FaBars color='#0e8ce2' size={10} />,
53
- },
54
- [CATEGORY_TYPES_NAMES.game]: {
55
- label: 'game',
56
- icon: <FaBowlingBall color='#0e8ce2' size={10} />,
57
- },
58
- [CATEGORY_TYPES_NAMES.fixedDuration]: {
59
- label: 'fixedDuration',
60
- icon: <FaCalendar color='#0e8ce2' size={10} />,
61
- },
62
- }
63
-
64
36
  interface ProductCategoriesControlProps extends WithIsLoading {
65
37
  stepIndex: number
66
38
  isOverrides?: boolean
@@ -256,8 +228,6 @@ export function ProductCategoriesControl({
256
228
  setIsExpanded(productCategoryId)
257
229
  }
258
230
 
259
- const categoryType = CATEGORIES_TYPE[productCategory.type]
260
-
261
231
  return (
262
232
  <Controller
263
233
  key={`product-category-${productCategory._id}`}
@@ -302,12 +272,6 @@ export function ProductCategoriesControl({
302
272
  )}
303
273
  modalClass={ProductSetModalClasses.category}
304
274
  isNewAdded={showCategoryModal}
305
- itemButton={
306
- <div className='btn-outline-primary item-icon sm border border-primary rounded-sm'>
307
- {categoryType.icon}
308
- <span className='ml-2'>{t(categoryType.label)}</span>
309
- </div>
310
- }
311
275
  body={
312
276
  <ProductCategoryControl
313
277
  isLoading={isLoading}
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from 'react'
1
+ import { useEffect } from 'react'
2
2
  import { FormValues } from '@licklist/plugins/dist/types/services/Form/hook-form-service'
3
3
  import { Button, Form, Col, Row } from 'react-bootstrap'
4
4
  import { FormProvider, useForm } from 'react-hook-form'
@@ -12,7 +12,6 @@ import { isEqual } from 'lodash'
12
12
  import { ProviderBookingManagementSetting } from '@licklist/core/dist/DataMapper/Provider/ProviderBookingManagementSettingDataMapper'
13
13
  import { Zone } from '@licklist/core/dist/DataMapper/Provider/ZoneDataMapper'
14
14
  import { WorkHour } from '@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper'
15
- import { transformErrorToMessage } from '@licklist/plugins/dist/utils/error'
16
15
  import { Dialog, useDialogContext } from '../../modals/dialog'
17
16
  import {
18
17
  ProductSetControl,
@@ -23,21 +22,16 @@ import { Step } from '../types'
23
22
  import { ProductSetContextProvider, ProductSetLoadingContext } from './context'
24
23
  import { SelectItem } from '../../types/generic/SelectItem'
25
24
  import { checkAvailableTimesErrors, getFilteredTemplates } from '../utils'
26
- import { ErrorModal } from '../../iframe/order-process/components/ErrorModal'
27
25
 
28
26
  export interface WithIsLoading {
29
27
  isLoading: boolean
30
28
  }
31
- export interface WithIdOptional {
32
- id?: number
33
- }
34
-
35
29
  export interface WithId {
36
30
  id: number
37
31
  }
38
32
  export interface ProductSetFormValues
39
33
  extends FormValues,
40
- WithIdOptional,
34
+ WithId,
41
35
  ProductSetControlValues {
42
36
  steps: Step[]
43
37
  isOverrides?: boolean
@@ -90,7 +84,6 @@ export function ProductSetForm({
90
84
  onApproveDialog,
91
85
  onDeclineDialog,
92
86
  } = useDialogContext()
93
- const [errorMessage, setErrorMessage] = useState('')
94
87
 
95
88
  const form = useForm<ProductSetFormValues>({
96
89
  defaultValues,
@@ -128,15 +121,6 @@ export function ProductSetForm({
128
121
  if (!serverErrors) {
129
122
  return
130
123
  }
131
- if (!Array.isArray(serverErrors)) {
132
- setErrorMessage(transformErrorToMessage(serverErrors))
133
- return
134
- }
135
-
136
- if (Array.isArray(serverErrors) && serverErrors[0]) {
137
- setErrorMessage(serverErrors[0])
138
- }
139
-
140
124
  FormErrorService.handleServerErrors(serverErrors, setError)
141
125
  }, [serverErrors, setError])
142
126
 
@@ -172,12 +156,6 @@ export function ProductSetForm({
172
156
  onDecline={onDeclineDialog}
173
157
  />
174
158
 
175
- <ErrorModal
176
- message={errorMessage}
177
- isOpen={!!errorMessage}
178
- onClose={() => setErrorMessage('')}
179
- />
180
-
181
159
  <FormProvider {...form}>
182
160
  <Form onSubmit={form.handleSubmit(submitHandler(onSubmitAndRedirect))}>
183
161
  <ProductSetLoadingContext.Consumer>
@@ -1,4 +1,7 @@
1
- import { useContext, useState } from 'react'
1
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
+ // @ts-nocheck
3
+ import React, { useContext, useState } from 'react'
4
+
2
5
  import {
3
6
  ArrayPath,
4
7
  Controller,
@@ -25,7 +25,7 @@ import {
25
25
  } from 'react-icons/fa'
26
26
  import { ProductSetLoadingContext } from './context'
27
27
 
28
- export const CATEGORY_TYPES_NAMES = {
28
+ const CATEGORY_TYPES_NAMES = {
29
29
  menuItems: CATEGORY_TYPE_MENU_ITEMS,
30
30
  tickets: CATEGORY_TYPE_TICKETS,
31
31
  bookings: CATEGORY_TYPE_BOOKINGS,
@@ -33,7 +33,7 @@ export const CATEGORY_TYPES_NAMES = {
33
33
  fixedDuration: CATEGORY_TYPE_FIXED_DURATION,
34
34
  } as const
35
35
 
36
- export type CategoryConfig = { label: string; icon: ReactElement }
36
+ type CategoryConfig = { label: string; icon: ReactElement }
37
37
 
38
38
  const MAIN_CATEGORIES: Partial<Record<CategoryType, CategoryConfig>> = {
39
39
  [CATEGORY_TYPES_NAMES.tickets]: {
@@ -70,6 +70,9 @@ export function SubProductsControl({
70
70
  images: subProducts[index]?.images as Image[],
71
71
  }
72
72
  // @ts-expect-error TS2345
73
+ // @TODO fix prod type error
74
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
75
+ // @ts-ignore
73
76
  append(subProductCopy)
74
77
  }}
75
78
  />
@@ -46,6 +46,9 @@ export const VenueMapsControl = ({
46
46
  url={image.url}
47
47
  name={name}
48
48
  points={points}
49
+ // @TODO fix prod type error
50
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
51
+ // @ts-ignore
49
52
  products={products}
50
53
  pointProducts={pointProducts}
51
54
  onPointProductsChange={onPointProductsChange}
@@ -1,2 +1 @@
1
1
  export * from './ProductSetForm'
2
- export * from './ProductSetNameControl'
@@ -34,6 +34,7 @@ import {
34
34
  } from 'react-hook-form'
35
35
  import { useTranslation } from 'react-i18next'
36
36
  import { useImages } from '@licklist/plugins/dist/hooks/Media/useImages'
37
+
37
38
  import {
38
39
  Image,
39
40
  IMAGE_TYPE_IMAGE,
@@ -1,4 +1,4 @@
1
- import { useContext } from 'react'
1
+ import React, { useContext } from 'react'
2
2
  import { Col, Form } from 'react-bootstrap'
3
3
  import { Controller, Path, useFormContext } from 'react-hook-form'
4
4
  import { HookFormService } from '@licklist/plugins'
@@ -86,7 +86,6 @@ export function ProductBookingManagementControl<T extends FormValues>(
86
86
  <Form.Control
87
87
  ref={ref}
88
88
  type='number'
89
- onWheel={(event) => event.currentTarget.blur()}
90
89
  min={0}
91
90
  step={1}
92
91
  value={value as string}
@@ -130,7 +129,6 @@ export function ProductBookingManagementControl<T extends FormValues>(
130
129
  <Form.Control
131
130
  ref={ref}
132
131
  type='number'
133
- onWheel={(event) => event.currentTarget.blur()}
134
132
  min='0'
135
133
  step='1'
136
134
  value={value as string}