@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
@@ -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 = 100
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,28 +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: {
188
- value: MAX_DESCRIPTION_LENGTH,
189
- message: t('Validation:fieldMaxLength', {
190
- attribute: t('description'),
191
- max: MAX_DESCRIPTION_LENGTH,
192
- }),
193
- },
194
- })}
195
- as='textarea'
196
- isInvalid={Boolean(errors.description)}
197
- />
198
- <Form.Control.Feedback type='invalid'>
199
- {errors.description?.message}
200
- </Form.Control.Feedback>
201
- </Form.Group>
202
-
203
- <ProductSetImageControl />
204
-
205
177
  {showDateSelector ? (
206
178
  <DateInput
207
179
  workHours={isZoneAdded ? workHours : undefined}
@@ -235,6 +207,27 @@ export function ProductSetControl({
235
207
  </Col>
236
208
  <Col md={6} sm={12}>
237
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
+
238
231
  <Form.Group>
239
232
  <Form.Label className='mb-0'>
240
233
  {t('Design:operationalCost')}
@@ -371,28 +364,35 @@ export function ProductSetControl({
371
364
  <Controller
372
365
  control={control}
373
366
  name='fieldSetId'
374
- render={({ field }) => (
375
- <>
376
- <Form.Label>{t('Design:customFields')}</Form.Label>
377
- <Form.Control
378
- onChange={field.onChange}
379
- value={Number(field.value)}
380
- as='select'
381
- disabled={isOverrides}
382
- isInvalid={HookFormService.isInvalid('fieldSetId', errors)}
383
- >
384
- <option value=''>{t('Design:choose')}</option>
385
- {fieldSets?.map((fieldSet) => (
386
- <option value={fieldSet.id} key={fieldSet.id}>
387
- {fieldSet.name}
388
- </option>
389
- ))}
390
- </Form.Control>
391
- <Form.Control.Feedback type='invalid'>
392
- {HookFormService.getErrors('fieldSetId', errors)}
393
- </Form.Control.Feedback>
394
- </>
395
- )}
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
+ }}
396
396
  />
397
397
  </Form.Group>
398
398
 
@@ -6,7 +6,9 @@ export function MobileFooter() {
6
6
 
7
7
  return (
8
8
  <div className='container product-set-mobile-footer'>
9
- <div className='d-block d-sm-none bg-white border-top fixed-bottom py-4 px-5 d-flex justify-content-between flex-row-reverse'>
9
+ <div
10
+ className={`d-block d-sm-none bg-white border-top fixed-bottom py-4 px-5 d-flex justify-content-between flex-row-reverse`}
11
+ >
10
12
  <Button type='submit'>{t('save')}</Button>
11
13
  </div>
12
14
  </div>
@@ -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}
@@ -50,7 +50,6 @@ export function ProductDepositControl<T extends FormValues>(
50
50
  <Form.Control
51
51
  ref={ref}
52
52
  type='number'
53
- onWheel={(event) => event.currentTarget.blur()}
54
53
  min={0}
55
54
  max={Number(totalPrice)}
56
55
  step='0.01'
@@ -91,7 +91,6 @@ export const ProductDurationControl = <T,>({
91
91
  <Form.Control
92
92
  type='number'
93
93
  min={0}
94
- onWheel={(event) => event.currentTarget.blur()}
95
94
  step={1}
96
95
  value={durationHours}
97
96
  disabled={disabled}
@@ -128,7 +127,6 @@ export const ProductDurationControl = <T,>({
128
127
  type='number'
129
128
  min={0}
130
129
  step={1}
131
- onWheel={(event) => event.currentTarget.blur()}
132
130
  disabled={disabled}
133
131
  value={durationMinutes}
134
132
  isInvalid={isInvalid}
@@ -59,7 +59,6 @@ export function ProductPriceControl<T extends FormValues>({
59
59
  ref={ref}
60
60
  type='number'
61
61
  min={0}
62
- onWheel={(event) => event.currentTarget.blur()}
63
62
  max={999999.99}
64
63
  step='0.01'
65
64
  value={value as string}
@@ -111,7 +111,6 @@ export function ProductQuantityConstantControl<T extends FormValues>(
111
111
  type='number'
112
112
  min={0}
113
113
  step={1}
114
- onWheel={(event) => event.currentTarget.blur()}
115
114
  value={value as string}
116
115
  isInvalid={HookFormService.isInvalid<T>(
117
116
  `${fieldNamePrefix}.totalQuantity` as Path<T>,
@@ -166,7 +165,6 @@ export function ProductQuantityConstantControl<T extends FormValues>(
166
165
  type='number'
167
166
  min={0}
168
167
  step={1}
169
- onWheel={(event) => event.currentTarget.blur()}
170
168
  value={value as string}
171
169
  onChange={onChange}
172
170
  onFocus={onFocus}
@@ -85,7 +85,6 @@ export function ProductQuantityControl<T extends FormValues>(
85
85
  type='number'
86
86
  min={0}
87
87
  step={1}
88
- onWheel={(event) => event.currentTarget.blur()}
89
88
  value={value as string}
90
89
  onChange={onChange}
91
90
  onFocus={onFocus}
@@ -144,7 +143,6 @@ export function ProductQuantityControl<T extends FormValues>(
144
143
  type='number'
145
144
  min={0}
146
145
  step={1}
147
- onWheel={(event) => event.currentTarget.blur()}
148
146
  value={value && (value as string)}
149
147
  onFocus={onFocus}
150
148
  onChange={onChange}
@@ -69,7 +69,6 @@ export function ProductQuantityRechargingControl<T extends FormValues>(
69
69
  type='number'
70
70
  min={0}
71
71
  step={1}
72
- onWheel={(event) => event.currentTarget.blur()}
73
72
  {...register(`${fieldNamePrefix}.totalQuantity` as Path<T>, {
74
73
  validate: (value) => {
75
74
  if (unlimited) return true
@@ -216,7 +216,6 @@ export function ProductCategoryControl({
216
216
  step={1}
217
217
  value={value === null ? '' : value}
218
218
  onChange={onChange}
219
- onWheel={(event) => event.currentTarget.blur()}
220
219
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
221
220
  `${fieldNamePrefix}.minSubItems` as const,
222
221
  errors,
@@ -289,7 +288,6 @@ export function ProductCategoryControl({
289
288
  name={name}
290
289
  value={value === null ? '' : value}
291
290
  onChange={onChange}
292
- onWheel={(event) => event.currentTarget.blur()}
293
291
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
294
292
  `${fieldNamePrefix}.maxSubItems` as const,
295
293
  errors,
@@ -350,7 +348,6 @@ export function ProductCategoryControl({
350
348
  min={0}
351
349
  step={1}
352
350
  type='number'
353
- onWheel={(event) => event.currentTarget.blur()}
354
351
  disabled={isOverride}
355
352
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
356
353
  `${fieldNamePrefix}.overallQuantity`,
@@ -533,7 +530,6 @@ export function ProductCategoryControl({
533
530
  step={1}
534
531
  value={value}
535
532
  onChange={onChange}
536
- onWheel={(event) => event.currentTarget.blur()}
537
533
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
538
534
  `${fieldNamePrefix}.remainderExpireAfter` as const,
539
535
  errors,
@@ -1,4 +1,4 @@
1
- import { useContext, useEffect, useMemo } from 'react'
1
+ import React, { useContext, useEffect, useMemo } from 'react'
2
2
  import { Col, Form, Row } from 'react-bootstrap'
3
3
  import {
4
4
  ArrayPath,
@@ -3,7 +3,6 @@ import { SmsTemplate } from '@licklist/core/dist/DataMapper/Notification/SmsTemp
3
3
  import { TFunction } from 'react-i18next'
4
4
  import { UseFormSetError } from 'react-hook-form'
5
5
  import { checkIfZoneCategory } from '@licklist/plugins'
6
- import { ProductSet } from '@licklist/core/dist/DataMapper/Product/ProductSetDataMapper'
7
6
  import { TemplateItem } from '../control/ProductSetControl'
8
7
  import { ProductSetFormValues } from '../form/ProductSetForm'
9
8
 
@@ -13,11 +12,6 @@ interface CheckAvailableTimesErrors {
13
12
  t: TFunction
14
13
  }
15
14
 
16
- export interface MenuTypeheadItem {
17
- id: number
18
- label: string
19
- value: number
20
- }
21
15
  export const moveArrayElements = <T>(
22
16
  array: T[],
23
17
  prevIndex: number,
@@ -89,8 +83,3 @@ export const checkAvailableTimesErrors = ({
89
83
  })
90
84
  return hasError
91
85
  }
92
-
93
- export const getTypeHeadItemsFromMenus = (
94
- menus?: (ProductSet | ProductSetFormValues)[],
95
- ): MenuTypeheadItem[] =>
96
- menus?.map((menu) => ({ id: menu.id, value: menu.id, label: menu.name }))
@@ -109,7 +109,6 @@ function RecurrenceEndInput({
109
109
  type='number'
110
110
  min={1}
111
111
  max={500}
112
- onWheel={(event) => event.currentTarget.blur()}
113
112
  disabled={disabled || !count || count === 500}
114
113
  aria-label='Occurrence count'
115
114
  value={count ?? defaultOccurrences[frequency]}
@@ -91,7 +91,6 @@ function RecurrenceEndInput({
91
91
  type='number'
92
92
  min={1}
93
93
  max={500}
94
- onWheel={(event) => event.currentTarget.blur()}
95
94
  disabled={disabled || !count || count === 500}
96
95
  aria-label='Occurrence count'
97
96
  value={count ?? defaultOccurrences[frequency]}
@@ -27,7 +27,6 @@ export const CapacityControl = ({ isLoading }: CapacityControlProps) => {
27
27
  required: true,
28
28
  min: 1,
29
29
  })}
30
- onWheel={(event) => event.currentTarget.blur()}
31
30
  placeholder={t('Design:capacity')}
32
31
  isInvalid={Boolean(errors.capacity)}
33
32
  disabled={isLoading}
@@ -27,7 +27,6 @@ export const SortControl = ({ isLoading }: SortControlProps) => {
27
27
  required: false,
28
28
  min: 1,
29
29
  })}
30
- onWheel={(event) => event.currentTarget.blur()}
31
30
  placeholder={t('Design:ordering')}
32
31
  isInvalid={Boolean(errors.sort)}
33
32
  disabled={isLoading}
@@ -20,6 +20,8 @@ export type ResultCardProps = {
20
20
  onCardClick?: (id: number) => void
21
21
  }
22
22
 
23
+ // @TODO integrate when API will be available
24
+ // activity and staff keys
23
25
  export const ResultCard = ({
24
26
  order,
25
27
  className,
@@ -179,7 +179,6 @@ export const CouponFormControl = ({
179
179
  <Form.Label>{t('Design:discount')}</Form.Label>
180
180
  <Form.Control
181
181
  type='number'
182
- onWheel={(event) => event.currentTarget.blur()}
183
182
  isInvalid={errors.discount !== undefined}
184
183
  {...register('discount', {
185
184
  required: t('Validation:fieldRequired', {
@@ -317,7 +316,6 @@ export const CouponFormControl = ({
317
316
  <Form.Control
318
317
  {...register('totalCoupons')}
319
318
  type='number'
320
- onWheel={(event) => event.currentTarget.blur()}
321
319
  isInvalid={errors.totalCoupons !== undefined}
322
320
  disabled={isLoading}
323
321
  />
@@ -332,7 +330,6 @@ export const CouponFormControl = ({
332
330
  <Form.Control
333
331
  type='number'
334
332
  {...register('usesPerUser')}
335
- onWheel={(event) => event.currentTarget.blur()}
336
333
  disabled={isLoading}
337
334
  />
338
335
  </Form.Group>
@@ -345,7 +342,6 @@ export const CouponFormControl = ({
345
342
  <Form.Control
346
343
  type='number'
347
344
  {...register('useAgain')}
348
- onWheel={(event) => event.currentTarget.blur()}
349
345
  disabled={isLoading}
350
346
  />
351
347
  <Form.Text className='text-muted'>
@@ -359,7 +355,6 @@ export const CouponFormControl = ({
359
355
  <Form.Control
360
356
  type='number'
361
357
  {...register('usesPerUserDay')}
362
- onWheel={(event) => event.currentTarget.blur()}
363
358
  disabled={isLoading}
364
359
  />
365
360
  <Form.Text className='text-muted'>
@@ -375,7 +370,6 @@ export const CouponFormControl = ({
375
370
  <Form.Control
376
371
  type='number'
377
372
  {...register('minAmount')}
378
- onWheel={(event) => event.currentTarget.blur()}
379
373
  disabled={isLoading}
380
374
  />
381
375
  <Form.Text className='text-muted'>
@@ -389,7 +383,6 @@ export const CouponFormControl = ({
389
383
  <Form.Control
390
384
  type='number'
391
385
  {...register('maxAmount')}
392
- onWheel={(event) => event.currentTarget.blur()}
393
386
  disabled={isLoading}
394
387
  />
395
388
  <Form.Text className='text-muted'>