@licklist/design 0.78.2 → 0.78.4-dev.0

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 (128) hide show
  1. package/dist/auth/Login/LoginComponent.js +2 -1
  2. package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
  3. package/dist/events/edit-event-modal/IntervalInput.js +5 -1
  4. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +3 -1
  5. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
  6. package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +16 -3
  7. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +2 -1
  8. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  9. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +0 -1
  10. package/dist/events/event-card/EventCard.d.ts +3 -1
  11. package/dist/events/event-card/EventCard.d.ts.map +1 -1
  12. package/dist/events/event-card/EventCard.js +27 -11
  13. package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +2 -1
  14. package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
  15. package/dist/events/event-statistic-modal/EventStatisticModal.js +2 -2
  16. package/dist/events/event-statistic-modal/hooks/useTableData.d.ts +1 -1
  17. package/dist/events/event-statistic-modal/hooks/useTableData.d.ts.map +1 -1
  18. package/dist/events/event-statistic-modal/hooks/useTableData.js +2 -1
  19. package/dist/events/event-statistic-modal/utils/index.js +3 -3
  20. package/dist/events/event-venue-map/EventVenueMap.d.ts.map +1 -1
  21. package/dist/events/event-venue-map/EventVenueMap.js +1 -0
  22. package/dist/events/event-venue-map/hooks/useCanvasSize.d.ts.map +1 -1
  23. package/dist/events/event-venue-map/hooks/useCanvasSize.js +11 -4
  24. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.js +2 -3
  25. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +1 -1
  26. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +4 -11
  27. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
  28. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
  29. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +14 -1
  30. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
  31. package/dist/iframe/ryft/utils/ryft-form.js +4 -5
  32. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  33. package/dist/notification/email-template/control/EmailTemplateControl.js +3 -0
  34. package/dist/product-set/form/ProductSetForm.d.ts +4 -1
  35. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  36. package/dist/product-set/form/ProductSetForm.js +1 -1
  37. package/dist/product-set/form/ProductsControl.js +1 -0
  38. package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
  39. package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +6 -0
  40. package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
  41. package/dist/product-set/product/deposit/ProductDepositControl.js +3 -0
  42. package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
  43. package/dist/product-set/product/duration/ProductDurationControl.js +6 -0
  44. package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
  45. package/dist/product-set/product/price/ProductPriceControl.js +3 -0
  46. package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
  47. package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +6 -0
  48. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  49. package/dist/product-set/product/quantity/ProductQuantityControl.js +6 -0
  50. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
  51. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +4 -1
  52. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  53. package/dist/product-set/product-category/ProductCategoryControl.js +12 -0
  54. package/dist/product-set/utils/index.d.ts +1 -1
  55. package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
  56. package/dist/recurrence-input/RecurrenceEndInput.js +3 -0
  57. package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
  58. package/dist/recurring-date-picker-input/utils.d.ts.map +1 -1
  59. package/dist/recurring-date-picker-input/utils.js +6 -2
  60. package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
  61. package/dist/resource/form/components/CapacityControl.js +3 -0
  62. package/dist/resource/form/components/SortControl.d.ts.map +1 -1
  63. package/dist/resource/form/components/SortControl.js +3 -0
  64. package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
  65. package/dist/sales/coupon/control/CouponFormControl.js +21 -0
  66. package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
  67. package/dist/setting/dashboard/DashboardSettingForm.js +4 -1
  68. package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
  69. package/dist/static/CurrencyNumberInput.js +3 -0
  70. package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
  71. package/dist/static/form-number-input/FormNumberInput.js +3 -0
  72. package/dist/static/number-input/NumberInput.d.ts.map +1 -1
  73. package/dist/static/number-input/NumberInput.js +3 -0
  74. package/dist/styles/events/EditEventModal.scss +7 -0
  75. package/dist/styles/iframe-events/Calendar.scss +1 -1
  76. package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  77. package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
  78. package/dist/styles/sales/BookingResults.scss +1 -1
  79. package/dist/zone/form/components/DescriptionControl.js +3 -6
  80. package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
  81. package/dist/zone/form/components/GameDurationControl.js +3 -0
  82. package/dist/zone/form/components/SortControl.d.ts.map +1 -1
  83. package/dist/zone/form/components/SortControl.js +3 -0
  84. package/package.json +9 -7
  85. package/src/auth/Login/LoginComponent.tsx +1 -1
  86. package/src/events/edit-event-modal/IntervalInput.tsx +4 -0
  87. package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +18 -5
  88. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
  89. package/src/events/event-card/EventCard.tsx +20 -0
  90. package/src/events/event-statistic-modal/EventStatisticModal.tsx +3 -1
  91. package/src/events/event-statistic-modal/hooks/useTableData.tsx +2 -1
  92. package/src/events/event-statistic-modal/utils/index.ts +4 -4
  93. package/src/events/event-venue-map/EventVenueMap.tsx +1 -0
  94. package/src/events/event-venue-map/hooks/useCanvasSize.ts +5 -1
  95. package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx +2 -2
  96. package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +5 -13
  97. package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +1 -0
  98. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +10 -1
  99. package/src/iframe/ryft/utils/ryft-form.ts +6 -5
  100. package/src/notification/email-template/control/EmailTemplateControl.tsx +1 -0
  101. package/src/product-set/form/ProductSetForm.tsx +6 -2
  102. package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +2 -0
  103. package/src/product-set/product/deposit/ProductDepositControl.tsx +1 -0
  104. package/src/product-set/product/duration/ProductDurationControl.tsx +2 -0
  105. package/src/product-set/product/price/ProductPriceControl.tsx +1 -0
  106. package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +2 -0
  107. package/src/product-set/product/quantity/ProductQuantityControl.tsx +2 -0
  108. package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +1 -0
  109. package/src/product-set/product-category/ProductCategoryControl.tsx +4 -0
  110. package/src/recurrence-input/RecurrenceEndInput.tsx +1 -0
  111. package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +1 -0
  112. package/src/recurring-date-picker-input/utils.ts +5 -2
  113. package/src/resource/form/components/CapacityControl.tsx +1 -0
  114. package/src/resource/form/components/SortControl.tsx +1 -0
  115. package/src/sales/coupon/control/CouponFormControl.tsx +7 -0
  116. package/src/setting/dashboard/DashboardSettingForm.tsx +1 -0
  117. package/src/static/CurrencyNumberInput.tsx +1 -0
  118. package/src/static/form-number-input/FormNumberInput.tsx +1 -0
  119. package/src/static/number-input/NumberInput.tsx +1 -0
  120. package/src/styles/events/EditEventModal.scss +7 -0
  121. package/src/styles/iframe-events/Calendar.scss +1 -1
  122. package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  123. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +1 -3
  124. package/src/styles/sales/BookingResults.scss +1 -1
  125. package/src/zone/form/components/DescriptionControl.tsx +2 -2
  126. package/src/zone/form/components/GameDurationControl.tsx +1 -0
  127. package/src/zone/form/components/SortControl.tsx +1 -0
  128. package/yarn.lock +486 -421
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.78.2",
3
+ "version": "0.78.4-dev.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -42,9 +42,10 @@
42
42
  ]
43
43
  },
44
44
  "peerDependencies": {
45
- "@licklist/core": "0.35.2",
45
+ "@licklist/core": "0.34.3-dev.0",
46
46
  "@licklist/eslint-config": "0.5.6",
47
- "@licklist/plugins": "0.35.10",
47
+ "@licklist/plugins": "0.36.1-dev.0",
48
+ "clsx": "2.1.1",
48
49
  "lodash": "4.17.21",
49
50
  "luxon": "3.5.0",
50
51
  "react": "17.0.2",
@@ -61,9 +62,9 @@
61
62
  "@dnd-kit/utilities": "2.0.0",
62
63
  "@fortawesome/fontawesome-svg-core": "1.2.34",
63
64
  "@fortawesome/free-solid-svg-icons": "5.15.2",
64
- "@licklist/core": "0.35.2",
65
+ "@licklist/core": "0.34.3-dev.0",
65
66
  "@licklist/eslint-config": "0.5.6",
66
- "@licklist/plugins": "0.35.10",
67
+ "@licklist/plugins": "0.36.1-dev.0",
67
68
  "@mantine/core": "6.0.22",
68
69
  "@mantine/hooks": "6.0.22",
69
70
  "@mdx-js/react": "1.6.22",
@@ -94,7 +95,6 @@
94
95
  "@wojtekmaj/react-daterange-picker": "4.1.0",
95
96
  "bootstrap": "4.6.0",
96
97
  "bootstrap-social": "5.1.1",
97
- "clsx": "2.1.1",
98
98
  "date-fns": "2.29.3",
99
99
  "emojibase": "6.1.0",
100
100
  "emojibase-data": "7.0.1",
@@ -206,8 +206,10 @@
206
206
  "yarn tsc"
207
207
  ]
208
208
  },
209
+ "packageManager": "yarn@4.4.0",
209
210
  "volta": {
210
211
  "node": "20.9.0",
211
212
  "yarn": "4.4.0"
212
- }
213
+ },
214
+ "stableVersion": "0.71.4-dev.1"
213
215
  }
@@ -44,7 +44,7 @@ const LoginComponent = ({
44
44
  const handleError = (error: any) => {
45
45
  notification.danger({
46
46
  title: 'Error',
47
- message: error.message,
47
+ message: error?.response?.data?.message || error.message,
48
48
  })
49
49
  }
50
50
 
@@ -159,6 +159,10 @@ export function IntervalInput({
159
159
  {formattedDuration && `lasts ${formattedDuration}`}
160
160
  </Form.Text>
161
161
  </Form.Group>
162
+
163
+ <Form.Control.Feedback type='invalid'>
164
+ {errors.end?.message}
165
+ </Form.Control.Feedback>
162
166
  </Form.Row>
163
167
  {start && (
164
168
  <Form.Group controlId={recurrentId}>
@@ -7,7 +7,7 @@ import {
7
7
  Image,
8
8
  } from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
9
9
  import { useId } from '@react-aria/utils'
10
- import { Accordion, Button, Form, Modal } from 'react-bootstrap'
10
+ import { Accordion, Badge, Button, Form, Modal } from 'react-bootstrap'
11
11
  import { isEqual } from 'lodash'
12
12
  import { FormProvider, useForm, Controller } from 'react-hook-form'
13
13
  import { DateTime } from 'luxon'
@@ -50,6 +50,7 @@ export interface EditEventFormValues extends IntervalInputValues {
50
50
  saleDeadline: number | null
51
51
  integrationUrl: string | null
52
52
  recurrenceEndAt?: string
53
+ duplicatedFromId?: number
53
54
  editedProductSet?: ProductSetFormValues
54
55
  }
55
56
 
@@ -71,6 +72,7 @@ export interface EditEventFormProps extends HasPermissionProp {
71
72
  disabledRecurrent?: boolean
72
73
  isCopyCreate?: boolean
73
74
  isBooked?: boolean
75
+ duplicatedInfo?: string | null
74
76
  }
75
77
 
76
78
  const eventImageTypes = {
@@ -83,6 +85,7 @@ export const EditEventForm = ({
83
85
  categories,
84
86
  title,
85
87
  hasPermission = true,
88
+ duplicatedInfo,
86
89
  defaultEventValues,
87
90
  serverErrors,
88
91
  onSaveEvent,
@@ -205,7 +208,7 @@ export const EditEventForm = ({
205
208
  )
206
209
  const isChangedTime =
207
210
  watchedValues?.start !==
208
- toSimpleDateTime(defaultEventValues?.startAt || '') ||
211
+ toSimpleDateTime(defaultEventValues?.startAt || '') ||
209
212
  watchedValues?.end !== toSimpleDateTime(defaultEventValues?.endAt || '')
210
213
  const isSinglEventWithBooked = !rrule && isBooked && isChangedTime
211
214
 
@@ -218,9 +221,19 @@ export const EditEventForm = ({
218
221
  onApprove={onApproveDialog}
219
222
  onDecline={onDeclineDialog}
220
223
  />
221
- <h5 className='edit-event-modal-title highlited-primary-title'>
222
- {title}
223
- </h5>
224
+ {
225
+ duplicatedInfo ? (<div className='d-flex justify-content-between'>
226
+ <h5 className='edit-event-modal-title highlited-primary-title'>
227
+ {title}
228
+ </h5>
229
+ <Badge className='duplicate-badge' variant='success'>{duplicatedInfo}</Badge>
230
+ </div>) : (
231
+ <h5 className='edit-event-modal-title highlited-primary-title'>
232
+ {title}
233
+ </h5>
234
+ )
235
+ }
236
+
224
237
  <FormProvider {...form}>
225
238
  <Modal.Body
226
239
  as='form'
@@ -41,7 +41,6 @@ export const getDefaultValues = (
41
41
  ...product,
42
42
  subProducts: subProducts?.map(({ ...subProducts }) => ({
43
43
  ...subProducts,
44
- originalProductId: null,
45
44
  productCategoryId: undefined,
46
45
  })),
47
46
  productCategoryId: undefined,
@@ -12,6 +12,7 @@ import { useTranslation } from 'react-i18next'
12
12
  import * as Config from '@licklist/core/dist/Config'
13
13
  import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission'
14
14
  import { EventStatistic } from '@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper'
15
+ import { EventMetadata } from '@licklist/core/dist/DataMapper/Provider/EventMetadatMapper'
15
16
  import {
16
17
  FaEye,
17
18
  FaExternalLinkAlt,
@@ -21,6 +22,7 @@ import {
21
22
  FaQrcode,
22
23
  } from 'react-icons/fa'
23
24
  import { Sale } from '../../types/bookings'
25
+ import { TipTapEditor } from '../../tiptap-editor/TipTapEditor'
24
26
  import {
25
27
  EVENT_DESCRIPTION_SIZE,
26
28
  formatContent,
@@ -40,6 +42,7 @@ export interface EventCardProps extends HasPermissionProp {
40
42
  onRemove: () => void
41
43
  onOpenQrCode: () => void
42
44
  eventStatistic?: EventStatistic | null
45
+ eventMetadata?: EventMetadata | null
43
46
  onStatistic: () => void
44
47
  titleId?: string
45
48
  descriptionId?: string
@@ -56,6 +59,7 @@ export function EventCard({
56
59
  onPreview,
57
60
  onEdit,
58
61
  onCopy,
62
+ eventMetadata,
59
63
  onRemove,
60
64
  onOpenQrCode,
61
65
  hasPermission = true,
@@ -69,6 +73,15 @@ export function EventCard({
69
73
  const { t } = useTranslation('Design')
70
74
  const { formatNumber, formatDate } = useIntl()
71
75
  const { totalViews, ...statistics } = getStatisticInfo(eventStatistic, date)
76
+
77
+ const duplicatedInfo =
78
+ eventMetadata?.editorName && eventMetadata?.duplicatedFromId
79
+ ? t('Design:duplicatedInfo', {
80
+ ID: eventMetadata?.duplicatedFromId,
81
+ name: eventMetadata?.editorName,
82
+ })
83
+ : null
84
+
72
85
  const memoedContent = useMemo(
73
86
  () => formatContent(description, EVENT_DESCRIPTION_SIZE),
74
87
  [description],
@@ -106,6 +119,13 @@ export function EventCard({
106
119
  ) : (
107
120
  name
108
121
  )}
122
+ {duplicatedInfo && <div className='mt-2 ml-2'>
123
+ <div className='event-card-sale'>
124
+ <span className='event-card-sale-name text-success'>
125
+ {duplicatedInfo}
126
+ </span>
127
+ </div>
128
+ </div>}
109
129
  </Card.Title>
110
130
  <div className='flex-grow-1'>
111
131
  <div className='mt-2 ml-2'>
@@ -12,6 +12,7 @@ export type EventStatisticModalProps = {
12
12
  date?: Event['startAt'] | null
13
13
  eventStatistic?: EventStatistic | null
14
14
  title?: string
15
+ eventId?: string
15
16
  }
16
17
 
17
18
  export const EventStatisticModal = ({
@@ -20,10 +21,11 @@ export const EventStatisticModal = ({
20
21
  date,
21
22
  eventStatistic,
22
23
  title,
24
+ eventId,
23
25
  }: EventStatisticModalProps) => {
24
26
  const { t } = useTranslation('Design')
25
27
 
26
- const data = useTableData(date, eventStatistic)
28
+ const data = useTableData(date, eventStatistic, eventId)
27
29
  const handleClose = () => {
28
30
  setIsOpen(false)
29
31
  }
@@ -11,6 +11,7 @@ import { StaticTableData } from '../../../table'
11
11
  export const useTableData = (
12
12
  date: Event['startAt'] | null,
13
13
  eventStatistic: EventStatistic | null,
14
+ eventId: string,
14
15
  ) => {
15
16
  const { t } = useTranslation('Design')
16
17
  const { formatNumber } = useIntl()
@@ -84,7 +85,7 @@ export const useTableData = (
84
85
  useEffect(() => {
85
86
  setTableRows(transformStatisticToTableRows(date, eventStatistic))
86
87
  // eslint-disable-next-line react-hooks/exhaustive-deps
87
- }, [date, eventStatistic])
88
+ }, [date, eventId, eventStatistic])
88
89
 
89
90
  return tableRows
90
91
  }
@@ -33,15 +33,15 @@ export const convertEventStatisticToTableData = (
33
33
  return []
34
34
  }
35
35
 
36
- const summaryFormattedDate = DateTime.fromISO(date)
37
- .toUTC()
38
- .toFormat(DATE_FORMAT)
36
+ const summaryFormattedDate = DateTime.fromISO(date).toFormat(
37
+ DATE_TIME_FULL_FORMAT,
38
+ )
39
39
 
40
40
  const summaryDays =
41
41
  Object.keys(eventStatistic?.productCategorySummary)?.filter(
42
42
  (date) =>
43
43
  DateTime.fromFormat(date, DATE_TIME_FULL_FORMAT).toFormat(
44
- DATE_FORMAT,
44
+ DATE_TIME_FULL_FORMAT,
45
45
  ) === summaryFormattedDate,
46
46
  ) ?? []
47
47
 
@@ -49,6 +49,7 @@ export const EventVenueMap = forwardRef<VenueMapRef, EventVenueMapProps>(
49
49
  },
50
50
  ref,
51
51
  ) => {
52
+ // TODO fix often updating of canvasSizes, which leads to flashing poingts
52
53
  const canvasSizes = useCanvasSize({ width, height })
53
54
 
54
55
  return (
@@ -10,13 +10,17 @@ export const useCanvasSize = ({
10
10
  width: componentWidth,
11
11
  height: componentHeight,
12
12
  }: CanvasSizeProps) => {
13
+ // TODO Fix often updating of width and height
13
14
  const { width, height } = useWindowDimensions()
14
15
 
16
+ // eslint-disable-next-line react-hooks/exhaustive-deps
17
+ const memoizedDimensions = useMemo(() => ({ width, height }), [width])
18
+
15
19
  const memoedComponentParameters = useMemo(() => {
16
20
  if (!componentWidth && !componentHeight) return null
17
21
 
18
22
  return { width: componentWidth, height: componentHeight }
19
23
  }, [componentWidth, componentHeight])
20
24
 
21
- return memoedComponentParameters || { width, height }
25
+ return memoedComponentParameters || memoizedDimensions
22
26
  }
@@ -48,12 +48,12 @@ export const ProductWithModifierSetModal = ({
48
48
  </button>
49
49
  </div>
50
50
  <div className='right-block' id='select-event-container'>
51
- <div className={clsx('manual-booking-container', !product?.images?.length && 'tw-mt-8')}>
51
+ <div className={clsx('manual-booking-container', !product.images.length && 'tw-mt-8')}>
52
52
  <div className='manual-booking-header'>
53
53
  <TicketDescription
54
54
  title={product.name}
55
55
  description={product.description}
56
- className={clsx('iframe-event__product-description', !product?.images?.length && 'mt-6')}
56
+ className={clsx('iframe-event__product-description', !product.images.length && 'mt-6')}
57
57
  classNameProductModal='d-block'
58
58
  images={product.images}
59
59
  isRequired={product.isRequired}
@@ -35,9 +35,6 @@ export const ModifiersSetControl = ({
35
35
  const { t } = useTranslation('App')
36
36
 
37
37
  const orderModifiersSets = watch(`${productId}.orderProductModifiers`)
38
- const filteredOrderModifiersSets = orderModifiersSets
39
- ?.flat(Infinity)
40
- ?.filter((item) => item && typeof item === 'object')
41
38
 
42
39
  const { formatNumber } = useIntl()
43
40
  const formatToCurrency = (value: number) =>
@@ -61,9 +58,8 @@ export const ModifiersSetControl = ({
61
58
  const selectedModifier = modifiers?.find(
62
59
  (item) => item.id === Number(e.target.defaultValue || e.target.id),
63
60
  )
64
-
65
61
  const checkSelectedModifier =
66
- filteredOrderModifiersSets?.find(
62
+ orderModifiersSets?.find(
67
63
  (modifier) => modifier?.modifierId === selectedModifier?.id,
68
64
  )?.quantity === 1
69
65
 
@@ -129,11 +125,9 @@ export const ModifiersSetControl = ({
129
125
  )
130
126
  }, [isEditMode])
131
127
 
132
- const radioButtonDefaultModifier = currentOrderModifiersSets
133
- .find((modifier) =>
134
- modifierSet.modifiers.some((rl) => rl.id === modifier.modifierId),
135
- )
136
- ?.modifierId.toString()
128
+ const radioButtonDefaultModifier = currentOrderModifiersSets.find((modifier) =>
129
+ modifierSet.modifiers.some((rl) => rl.id === modifier.modifierId)
130
+ )?.modifierId.toString();
137
131
 
138
132
  return (
139
133
  <>
@@ -173,9 +167,7 @@ export const ModifiersSetControl = ({
173
167
  inline
174
168
  id={modifier.id.toString()}
175
169
  defaultChecked={!!selectedOrderModifierId}
176
- defaultValue={
177
- selectedOrderModifierId || modifier.id.toString()
178
- }
170
+ defaultValue={selectedOrderModifierId || modifier.id.toString()}
179
171
  checked={field.value === modifier.id.toString()}
180
172
  onChange={onChange}
181
173
  type='radio'
@@ -3,6 +3,7 @@ import { useIntl } from 'react-intl'
3
3
  import * as Config from '@licklist/core/dist/Config'
4
4
  import { OrderItem } from '@licklist/plugins/dist/types/context/Iframe/orderItems'
5
5
  import { OrderModifierByProduct } from '@licklist/core/dist/DataMapper/Order/OrderModifiierByProduct'
6
+ import { calculateTotalModifiersPrice } from '../../utils'
6
7
  import { ProductWithModifier } from '../../../CategoryProduct/components/ProductWithModifier/ProductWithModifier'
7
8
 
8
9
 
@@ -69,7 +69,7 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
69
69
  return
70
70
  }
71
71
 
72
- onArrowUp(value - 1)
72
+ onArrowDown(value - 1)
73
73
  }
74
74
 
75
75
  const inputWrapperClasses = clsx('payment-number-input', className)
@@ -89,6 +89,7 @@ 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()}
92
93
  value={value}
93
94
  min={0}
94
95
  max={max}
@@ -101,6 +102,14 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
101
102
  <button
102
103
  type='button'
103
104
  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
+ }
104
113
  className={`payment-number-input__btn-up ${
105
114
  plusButtonGreyedOut && 'disabled-number-input-button'
106
115
  }`}
@@ -61,20 +61,22 @@ export const injectComponentsInRyftForm = ({
61
61
  divider.id = 'mobile-pay-divider'
62
62
  container.id = 'mobile-pay-divider-container'
63
63
  container.append(dividerText, divider)
64
- const payIframe = document.getElementById("ryft-pay-iframe");
64
+ const payIframe = document.getElementById('ryft-pay-iframe')
65
65
  if (payIframe) {
66
66
  const formBox = document.getElementById('form-disable-box')
67
67
  if (formBox) {
68
- formBox.style.display = isDisableButton ? "block" : "none"
68
+ formBox.style.display = isDisableButton ? 'block' : 'none'
69
69
  }
70
70
 
71
71
  const googleButton = document.getElementById(
72
72
  'gpay-button-online-api-id',
73
73
  ) as HTMLButtonElement
74
- const appleButton =document.getElementById("ryft-pay-apple-pay-button") as HTMLButtonElement
74
+ const appleButton = document.getElementById(
75
+ 'ryft-pay-apple-pay-button',
76
+ ) as HTMLButtonElement
75
77
  if (googleButton) {
76
78
  googleButton.disabled = isDisableButton
77
- googleButton.style.opacity = isDisableButton ? '1' : '0.6'
79
+ googleButton.style.opacity = !isDisableButton ? '1' : '0.6'
78
80
  }
79
81
  if (appleButton) {
80
82
  appleButton.disabled = isDisableButton
@@ -86,7 +88,6 @@ export const injectComponentsInRyftForm = ({
86
88
  const applePayButton = document.createElement('button')
87
89
  applePayButton.id = 'apple-pay'
88
90
  applePayButton.type = 'button'
89
- applePayButton.style.opacity = !isDisableButton ? '1' : '0.6'
90
91
  applePayButton.className = 'bg-dark btn btn-primary apple-pay-button'
91
92
  applePayButton.textContent = t('Events:payWithApple')
92
93
  applePayButton.onclick = onApplePayButtonClick
@@ -434,6 +434,7 @@ export const EmailTemplateControl = forwardRef(
434
434
  `templateOptionValues.${option?.id}.value`,
435
435
  )}
436
436
  type='number'
437
+ onWheel={(event) => event.currentTarget.blur()}
437
438
  placeholder={t(`Design:${option.name}`)}
438
439
  id={option.name + option.id}
439
440
  defaultValue={option.selectedValue || ''}
@@ -10,7 +10,7 @@ import { ModifierSet } from '@licklist/core/dist/DataMapper/Product/ModifierSetD
10
10
  import { isEqual } from 'lodash'
11
11
  import { Zone } from '@licklist/core/dist/DataMapper/Provider/ZoneDataMapper'
12
12
  import { WorkHour } from '@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper'
13
- import { transformErrorToMessage } from '@licklist/plugins'
13
+ import { transformErrorToMessage } from '@licklist/plugins/dist/utils/error'
14
14
  import { Dialog, useDialogContext } from '../../modals/dialog'
15
15
  import {
16
16
  ProductSetControl,
@@ -30,12 +30,16 @@ import { ErrorModal } from '../../iframe/order-process/components/ErrorModal'
30
30
  export interface WithIsLoading {
31
31
  isLoading: boolean
32
32
  }
33
+ export interface WithIdOptional {
34
+ id?: number
35
+ }
36
+
33
37
  export interface WithId {
34
38
  id: number
35
39
  }
36
40
  export interface ProductSetFormValues
37
41
  extends FormValues,
38
- WithId,
42
+ WithIdOptional,
39
43
  ProductSetControlValues {
40
44
  steps: Step[]
41
45
  isOverrides?: boolean
@@ -86,6 +86,7 @@ export function ProductBookingManagementControl<T extends FormValues>(
86
86
  <Form.Control
87
87
  ref={ref}
88
88
  type='number'
89
+ onWheel={(event) => event.currentTarget.blur()}
89
90
  min={0}
90
91
  step={1}
91
92
  value={value as string}
@@ -129,6 +130,7 @@ export function ProductBookingManagementControl<T extends FormValues>(
129
130
  <Form.Control
130
131
  ref={ref}
131
132
  type='number'
133
+ onWheel={(event) => event.currentTarget.blur()}
132
134
  min='0'
133
135
  step='1'
134
136
  value={value as string}
@@ -50,6 +50,7 @@ export function ProductDepositControl<T extends FormValues>(
50
50
  <Form.Control
51
51
  ref={ref}
52
52
  type='number'
53
+ onWheel={(event) => event.currentTarget.blur()}
53
54
  min={0}
54
55
  max={Number(totalPrice)}
55
56
  step='0.01'
@@ -91,6 +91,7 @@ export const ProductDurationControl = <T,>({
91
91
  <Form.Control
92
92
  type='number'
93
93
  min={0}
94
+ onWheel={(event) => event.currentTarget.blur()}
94
95
  step={1}
95
96
  value={durationHours}
96
97
  disabled={disabled}
@@ -127,6 +128,7 @@ export const ProductDurationControl = <T,>({
127
128
  type='number'
128
129
  min={0}
129
130
  step={1}
131
+ onWheel={(event) => event.currentTarget.blur()}
130
132
  disabled={disabled}
131
133
  value={durationMinutes}
132
134
  isInvalid={isInvalid}
@@ -59,6 +59,7 @@ export function ProductPriceControl<T extends FormValues>({
59
59
  ref={ref}
60
60
  type='number'
61
61
  min={0}
62
+ onWheel={(event) => event.currentTarget.blur()}
62
63
  max={999999.99}
63
64
  step='0.01'
64
65
  value={value as string}
@@ -111,6 +111,7 @@ export function ProductQuantityConstantControl<T extends FormValues>(
111
111
  type='number'
112
112
  min={0}
113
113
  step={1}
114
+ onWheel={(event) => event.currentTarget.blur()}
114
115
  value={value as string}
115
116
  isInvalid={HookFormService.isInvalid<T>(
116
117
  `${fieldNamePrefix}.totalQuantity` as Path<T>,
@@ -165,6 +166,7 @@ export function ProductQuantityConstantControl<T extends FormValues>(
165
166
  type='number'
166
167
  min={0}
167
168
  step={1}
169
+ onWheel={(event) => event.currentTarget.blur()}
168
170
  value={value as string}
169
171
  onChange={onChange}
170
172
  onFocus={onFocus}
@@ -85,6 +85,7 @@ export function ProductQuantityControl<T extends FormValues>(
85
85
  type='number'
86
86
  min={0}
87
87
  step={1}
88
+ onWheel={(event) => event.currentTarget.blur()}
88
89
  value={value as string}
89
90
  onChange={onChange}
90
91
  onFocus={onFocus}
@@ -143,6 +144,7 @@ export function ProductQuantityControl<T extends FormValues>(
143
144
  type='number'
144
145
  min={0}
145
146
  step={1}
147
+ onWheel={(event) => event.currentTarget.blur()}
146
148
  value={value && (value as string)}
147
149
  onFocus={onFocus}
148
150
  onChange={onChange}
@@ -69,6 +69,7 @@ export function ProductQuantityRechargingControl<T extends FormValues>(
69
69
  type='number'
70
70
  min={0}
71
71
  step={1}
72
+ onWheel={(event) => event.currentTarget.blur()}
72
73
  {...register(`${fieldNamePrefix}.totalQuantity` as Path<T>, {
73
74
  validate: (value) => {
74
75
  if (unlimited) return true
@@ -221,6 +221,7 @@ export function ProductCategoryControl({
221
221
  step={1}
222
222
  value={value === null ? '' : value}
223
223
  onChange={onChange}
224
+ onWheel={(event) => event.currentTarget.blur()}
224
225
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
225
226
  `${fieldNamePrefix}.minSubItems` as const,
226
227
  errors,
@@ -293,6 +294,7 @@ export function ProductCategoryControl({
293
294
  name={name}
294
295
  value={value === null ? '' : value}
295
296
  onChange={onChange}
297
+ onWheel={(event) => event.currentTarget.blur()}
296
298
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
297
299
  `${fieldNamePrefix}.maxSubItems` as const,
298
300
  errors,
@@ -353,6 +355,7 @@ export function ProductCategoryControl({
353
355
  min={0}
354
356
  step={1}
355
357
  type='number'
358
+ onWheel={(event) => event.currentTarget.blur()}
356
359
  disabled={isOverride}
357
360
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
358
361
  `${fieldNamePrefix}.overallQuantity`,
@@ -543,6 +546,7 @@ export function ProductCategoryControl({
543
546
  step={1}
544
547
  value={value}
545
548
  onChange={onChange}
549
+ onWheel={(event) => event.currentTarget.blur()}
546
550
  isInvalid={HookFormService.isInvalid<ProductSetFormValues>(
547
551
  `${fieldNamePrefix}.remainderExpireAfter` as const,
548
552
  errors,
@@ -109,6 +109,7 @@ function RecurrenceEndInput({
109
109
  type='number'
110
110
  min={1}
111
111
  max={500}
112
+ onWheel={(event) => event.currentTarget.blur()}
112
113
  disabled={disabled || !count || count === 500}
113
114
  aria-label='Occurrence count'
114
115
  value={count ?? defaultOccurrences[frequency]}
@@ -91,6 +91,7 @@ function RecurrenceEndInput({
91
91
  type='number'
92
92
  min={1}
93
93
  max={500}
94
+ onWheel={(event) => event.currentTarget.blur()}
94
95
  disabled={disabled || !count || count === 500}
95
96
  aria-label='Occurrence count'
96
97
  value={count ?? defaultOccurrences[frequency]}
@@ -144,7 +144,7 @@ export const useWorkHoursValidation = (
144
144
  const res: Interval[] = []
145
145
 
146
146
  const startTime = fromIso(workhour.start, timeZone)
147
- const endTime = fromIso(workhour.end, timeZone)
147
+ const endTime = fromIso(workhour.end, timeZone).plus({ minute: 1 })
148
148
 
149
149
  if (endTime > startTime) {
150
150
  res.push(Interval.fromDateTimes(startTime, endTime))
@@ -194,7 +194,10 @@ export const useWorkHoursValidation = (
194
194
  .filter((interval) => !interval.contains(time))
195
195
 
196
196
  const attribute = notFittingIntervals
197
- .map((interval) => interval.toFormat('HH:mm'))
197
+ .map(
198
+ (interval) =>
199
+ `${interval.start.toFormat('HH:mm')} - ${interval.end.minus({ minutes: 1 }).toFormat('HH:mm')}`,
200
+ )
198
201
  .join(', ')
199
202
 
200
203
  if (notFittingIntervalsByDay.length !== 0) {
@@ -27,6 +27,7 @@ export const CapacityControl = ({ isLoading }: CapacityControlProps) => {
27
27
  required: true,
28
28
  min: 1,
29
29
  })}
30
+ onWheel={(event) => event.currentTarget.blur()}
30
31
  placeholder={t('Design:capacity')}
31
32
  isInvalid={Boolean(errors.capacity)}
32
33
  disabled={isLoading}