@licklist/design 0.78.5-dev.13 → 0.78.5-dev.19

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 (126) hide show
  1. package/dist/auth/Login/LoginComponent.js +1 -2
  2. package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
  3. package/dist/events/edit-event-modal/IntervalInput.js +1 -5
  4. package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.d.ts +1 -2
  5. package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.d.ts.map +1 -1
  6. package/dist/events/edit-event-modal/component/SaleDeadline/SaleDeadline.js +2 -3
  7. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -2
  8. package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
  9. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -0
  10. package/dist/events/event-card/EventCard.d.ts +1 -1
  11. package/dist/events/event-card/EventCard.d.ts.map +1 -1
  12. package/dist/events/event-card/EventCard.js +1 -1
  13. package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +1 -2
  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 +1 -2
  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 +0 -1
  22. package/dist/events/event-venue-map/hooks/useCanvasSize.d.ts.map +1 -1
  23. package/dist/events/event-venue-map/hooks/useCanvasSize.js +4 -11
  24. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +1 -1
  25. package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +11 -4
  26. package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
  27. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
  28. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +0 -13
  29. package/dist/iframe/payment/payment-page/PaymentPage.js +4 -8
  30. package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
  31. package/dist/iframe/ryft/RyftPaymentForm.js +45 -19
  32. package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
  33. package/dist/iframe/ryft/utils/ryft-form.js +5 -4
  34. package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
  35. package/dist/notification/email-template/control/EmailTemplateControl.js +3 -6
  36. package/dist/product-set/control/ProductSetControl.js +1 -2
  37. package/dist/product-set/form/ProductSetForm.d.ts +1 -4
  38. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  39. package/dist/product-set/form/ProductSetForm.js +1 -1
  40. package/dist/product-set/form/ProductsControl.js +0 -1
  41. package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
  42. package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +0 -6
  43. package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
  44. package/dist/product-set/product/deposit/ProductDepositControl.js +0 -3
  45. package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
  46. package/dist/product-set/product/duration/ProductDurationControl.js +0 -6
  47. package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
  48. package/dist/product-set/product/price/ProductPriceControl.js +0 -3
  49. package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
  50. package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +0 -6
  51. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  52. package/dist/product-set/product/quantity/ProductQuantityControl.js +0 -6
  53. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
  54. package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +1 -4
  55. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  56. package/dist/product-set/product-category/ProductCategoryControl.js +0 -12
  57. package/dist/product-set/utils/index.d.ts +1 -1
  58. package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
  59. package/dist/recurrence-input/RecurrenceEndInput.js +0 -3
  60. package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
  61. package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
  62. package/dist/resource/form/components/CapacityControl.js +0 -3
  63. package/dist/resource/form/components/SortControl.d.ts.map +1 -1
  64. package/dist/resource/form/components/SortControl.js +0 -3
  65. package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
  66. package/dist/sales/coupon/control/CouponFormControl.js +0 -21
  67. package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
  68. package/dist/setting/dashboard/DashboardSettingForm.js +1 -4
  69. package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
  70. package/dist/static/CurrencyNumberInput.js +0 -3
  71. package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
  72. package/dist/static/form-number-input/FormNumberInput.js +0 -3
  73. package/dist/static/number-input/NumberInput.d.ts.map +1 -1
  74. package/dist/static/number-input/NumberInput.js +0 -3
  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 +3 -1
  78. package/dist/styles/sales/BookingResults.scss +1 -1
  79. package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
  80. package/dist/zone/form/components/GameDurationControl.js +0 -3
  81. package/dist/zone/form/components/SortControl.d.ts.map +1 -1
  82. package/dist/zone/form/components/SortControl.js +0 -3
  83. package/package.json +7 -7
  84. package/src/auth/Login/LoginComponent.tsx +1 -1
  85. package/src/events/edit-event-modal/IntervalInput.tsx +0 -4
  86. package/src/events/edit-event-modal/component/SaleDeadline/SaleDeadline.tsx +4 -12
  87. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
  88. package/src/events/event-card/EventCard.tsx +8 -10
  89. package/src/events/event-statistic-modal/EventStatisticModal.tsx +1 -3
  90. package/src/events/event-statistic-modal/hooks/useTableData.tsx +1 -2
  91. package/src/events/event-statistic-modal/utils/index.ts +4 -4
  92. package/src/events/event-venue-map/EventVenueMap.tsx +0 -1
  93. package/src/events/event-venue-map/hooks/useCanvasSize.ts +1 -5
  94. package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +5 -1
  95. package/src/iframe/order-process/components/BookingSummary/utils/index.ts +2 -2
  96. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +0 -9
  97. package/src/iframe/payment/payment-page/PaymentPage.tsx +6 -6
  98. package/src/iframe/ryft/RyftPaymentForm.tsx +58 -25
  99. package/src/iframe/ryft/utils/ryft-form.ts +5 -6
  100. package/src/notification/email-template/control/EmailTemplateControl.tsx +6 -7
  101. package/src/product-set/control/ProductSetControl.tsx +1 -1
  102. package/src/product-set/form/ProductSetForm.tsx +2 -6
  103. package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +0 -2
  104. package/src/product-set/product/deposit/ProductDepositControl.tsx +0 -1
  105. package/src/product-set/product/duration/ProductDurationControl.tsx +0 -2
  106. package/src/product-set/product/price/ProductPriceControl.tsx +0 -1
  107. package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +0 -2
  108. package/src/product-set/product/quantity/ProductQuantityControl.tsx +0 -2
  109. package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +0 -1
  110. package/src/product-set/product-category/ProductCategoryControl.tsx +0 -4
  111. package/src/recurrence-input/RecurrenceEndInput.tsx +0 -1
  112. package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +0 -1
  113. package/src/resource/form/components/CapacityControl.tsx +0 -1
  114. package/src/resource/form/components/SortControl.tsx +0 -1
  115. package/src/sales/coupon/control/CouponFormControl.tsx +0 -7
  116. package/src/setting/dashboard/DashboardSettingForm.tsx +0 -1
  117. package/src/static/CurrencyNumberInput.tsx +0 -1
  118. package/src/static/form-number-input/FormNumberInput.tsx +0 -1
  119. package/src/static/number-input/NumberInput.tsx +0 -1
  120. package/src/styles/iframe-events/Calendar.scss +1 -1
  121. package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
  122. package/src/styles/ryft-payment-form/RyftPaymentForm.scss +3 -1
  123. package/src/styles/sales/BookingResults.scss +1 -1
  124. package/src/zone/form/components/GameDurationControl.tsx +0 -1
  125. package/src/zone/form/components/SortControl.tsx +0 -1
  126. package/yarn.lock +171 -250
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.78.5-dev.13",
3
+ "version": "0.78.5-dev.19",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -42,9 +42,9 @@
42
42
  ]
43
43
  },
44
44
  "peerDependencies": {
45
- "@licklist/core": "0.36.1-dev.6",
45
+ "@licklist/core": "0.36.3-stage.0",
46
46
  "@licklist/eslint-config": "0.5.6",
47
- "@licklist/plugins": "0.36.4-dev.2",
47
+ "@licklist/plugins": "0.36.4-stage.4",
48
48
  "clsx": "2.1.1",
49
49
  "i18next": "25.3.2",
50
50
  "lodash": "4.17.21",
@@ -64,9 +64,9 @@
64
64
  "@dnd-kit/utilities": "2.0.0",
65
65
  "@fortawesome/fontawesome-svg-core": "1.2.34",
66
66
  "@fortawesome/free-solid-svg-icons": "5.15.2",
67
- "@licklist/core": "0.36.1-dev.6",
67
+ "@licklist/core": "0.36.3-stage.0",
68
68
  "@licklist/eslint-config": "0.5.6",
69
- "@licklist/plugins": "0.36.4-dev.2",
69
+ "@licklist/plugins": "0.36.4-stage.5",
70
70
  "@mantine/core": "6.0.22",
71
71
  "@mantine/hooks": "6.0.22",
72
72
  "@mdx-js/react": "1.6.22",
@@ -97,6 +97,7 @@
97
97
  "@wojtekmaj/react-daterange-picker": "4.1.0",
98
98
  "bootstrap": "4.6.0",
99
99
  "bootstrap-social": "5.1.1",
100
+ "clsx": "2.1.1",
100
101
  "date-fns": "2.29.3",
101
102
  "emojibase": "6.1.0",
102
103
  "emojibase-data": "7.0.1",
@@ -208,10 +209,9 @@
208
209
  "yarn tsc"
209
210
  ]
210
211
  },
211
- "packageManager": "yarn@4.4.0",
212
212
  "volta": {
213
213
  "node": "20.9.0",
214
214
  "yarn": "4.4.0"
215
215
  },
216
- "stableVersion": "0.71.4-dev.1"
216
+ "stableVersion": "0.71.19-stage.1"
217
217
  }
@@ -44,7 +44,7 @@ const LoginComponent = ({
44
44
  const handleError = (error: any) => {
45
45
  notification.danger({
46
46
  title: 'Error',
47
- message: error?.response?.data?.message || error.message,
47
+ message: error.message,
48
48
  })
49
49
  }
50
50
 
@@ -159,10 +159,6 @@ 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>
166
162
  </Form.Row>
167
163
  {start && (
168
164
  <Form.Group controlId={recurrentId}>
@@ -39,12 +39,10 @@ type SaleDeadlineType =
39
39
  export const SaleDeadline = ({
40
40
  disabled = false,
41
41
  onlyBefore = false,
42
- isProductSet = false,
43
42
  deadLineCategory,
44
43
  }: {
45
44
  disabled?: boolean
46
45
  onlyBefore?: boolean
47
- isProductSet?: boolean
48
46
  deadLineCategory?: string
49
47
  }) => {
50
48
  const { t } = useTranslation(['Design'])
@@ -142,16 +140,10 @@ export const SaleDeadline = ({
142
140
  <Switch
143
141
  name='sale-deadline'
144
142
  options={SALE_DEADLINES_EVENT_START_TYPES.map(
145
- ({ type }) => {
146
- const salesDeadlineTitle =
147
- type === SALE_DEADLINE_BEFORE_TYPE && isProductSet
148
- ? 'beforeProductSet'
149
- : type
150
- return {
151
- id: type,
152
- value: t(`Design:${salesDeadlineTitle}`),
153
- }
154
- },
143
+ ({ type }) => ({
144
+ id: type,
145
+ value: t(`Design:${type}`),
146
+ }),
155
147
  )}
156
148
  value={deadlineType}
157
149
  onChange={changeValueByType}
@@ -41,6 +41,7 @@ export const getDefaultValues = (
41
41
  ...product,
42
42
  subProducts: subProducts?.map(({ ...subProducts }) => ({
43
43
  ...subProducts,
44
+ originalProductId: null,
44
45
  productCategoryId: undefined,
45
46
  })),
46
47
  productCategoryId: undefined,
@@ -33,7 +33,7 @@ export interface EventCardProps extends HasPermissionProp {
33
33
  onPreview: () => void
34
34
  onEdit: () => void
35
35
  onCopy: () => void
36
- onRemove?: () => void
36
+ onRemove: () => void
37
37
  onOpenQrCode: () => void
38
38
  eventStatistic?: EventStatistic | null
39
39
  eventMetadata?: EventMetadata | null
@@ -212,15 +212,13 @@ export function EventCard({
212
212
  >
213
213
  <FaCopy />
214
214
  </button>
215
- {onRemove && (
216
- <button
217
- type='button'
218
- className='event-card-link-button'
219
- onClick={onRemove}
220
- >
221
- <FaTrashAlt />
222
- </button>
223
- )}
215
+ <button
216
+ type='button'
217
+ className='event-card-link-button'
218
+ onClick={onRemove}
219
+ >
220
+ <FaTrashAlt />
221
+ </button>
224
222
  </>
225
223
  )}
226
224
  </div>
@@ -12,7 +12,6 @@ export type EventStatisticModalProps = {
12
12
  date?: Event['startAt'] | null
13
13
  eventStatistic?: EventStatistic | null
14
14
  title?: string
15
- eventId?: string
16
15
  }
17
16
 
18
17
  export const EventStatisticModal = ({
@@ -21,11 +20,10 @@ export const EventStatisticModal = ({
21
20
  date,
22
21
  eventStatistic,
23
22
  title,
24
- eventId,
25
23
  }: EventStatisticModalProps) => {
26
24
  const { t } = useTranslation('Design')
27
25
 
28
- const data = useTableData(date, eventStatistic, eventId)
26
+ const data = useTableData(date, eventStatistic)
29
27
  const handleClose = () => {
30
28
  setIsOpen(false)
31
29
  }
@@ -11,7 +11,6 @@ import { StaticTableData } from '../../../table'
11
11
  export const useTableData = (
12
12
  date: Event['startAt'] | null,
13
13
  eventStatistic: EventStatistic | null,
14
- eventId: string,
15
14
  ) => {
16
15
  const { t } = useTranslation('Design')
17
16
  const { formatNumber } = useIntl()
@@ -85,7 +84,7 @@ export const useTableData = (
85
84
  useEffect(() => {
86
85
  setTableRows(transformStatisticToTableRows(date, eventStatistic))
87
86
  // eslint-disable-next-line react-hooks/exhaustive-deps
88
- }, [date, eventId, eventStatistic])
87
+ }, [date, eventStatistic])
89
88
 
90
89
  return tableRows
91
90
  }
@@ -33,15 +33,15 @@ export const convertEventStatisticToTableData = (
33
33
  return []
34
34
  }
35
35
 
36
- const summaryFormattedDate = DateTime.fromISO(date).toFormat(
37
- DATE_TIME_FULL_FORMAT,
38
- )
36
+ const summaryFormattedDate = DateTime.fromISO(date)
37
+ .toUTC()
38
+ .toFormat(DATE_FORMAT)
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_TIME_FULL_FORMAT,
44
+ DATE_FORMAT,
45
45
  ) === summaryFormattedDate,
46
46
  ) ?? []
47
47
 
@@ -49,7 +49,6 @@ 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
53
52
  const canvasSizes = useCanvasSize({ width, height })
54
53
 
55
54
  return (
@@ -10,17 +10,13 @@ export const useCanvasSize = ({
10
10
  width: componentWidth,
11
11
  height: componentHeight,
12
12
  }: CanvasSizeProps) => {
13
- // TODO Fix often updating of width and height
14
13
  const { width, height } = useWindowDimensions()
15
14
 
16
- // eslint-disable-next-line react-hooks/exhaustive-deps
17
- const memoizedDimensions = useMemo(() => ({ width, height }), [width])
18
-
19
15
  const memoedComponentParameters = useMemo(() => {
20
16
  if (!componentWidth && !componentHeight) return null
21
17
 
22
18
  return { width: componentWidth, height: componentHeight }
23
19
  }, [componentWidth, componentHeight])
24
20
 
25
- return memoedComponentParameters || memoizedDimensions
21
+ return memoedComponentParameters || { width, height }
26
22
  }
@@ -35,6 +35,9 @@ 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')
38
41
 
39
42
  const { formatNumber } = useIntl()
40
43
  const formatToCurrency = (value: number) =>
@@ -58,8 +61,9 @@ export const ModifiersSetControl = ({
58
61
  const selectedModifier = modifiers?.find(
59
62
  (item) => item.id === Number(e.target.defaultValue || e.target.id),
60
63
  )
64
+
61
65
  const checkSelectedModifier =
62
- orderModifiersSets?.find(
66
+ filteredOrderModifiersSets?.find(
63
67
  (modifier) => modifier?.modifierId === selectedModifier?.id,
64
68
  )?.quantity === 1
65
69
 
@@ -19,8 +19,8 @@ export const cartSumByOrderProducts = ({
19
19
  if (!product) return 0
20
20
  const modifiersPrice = calculateTotalModifiersPrice(
21
21
  product?.orderModifiersSets,
22
- )
23
-
22
+ ) || 0
23
+
24
24
  const price = isTotalSum
25
25
  ? product?.price
26
26
  : product.hasDeposit
@@ -89,7 +89,6 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
89
89
  <FormControl
90
90
  type='number'
91
91
  onChange={(e) => handleChangeValue(Number(e.target.value))}
92
- onWheel={(event) => event.currentTarget.blur()}
93
92
  value={value}
94
93
  min={0}
95
94
  max={max}
@@ -102,14 +101,6 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
102
101
  <button
103
102
  type='button'
104
103
  onClick={handleArrowUpClick}
105
- onWheel={(event) => event.currentTarget.blur()}
106
- onFocus={(event) =>
107
- event.target.addEventListener(
108
- 'wheel',
109
- (event) => event.preventDefault(),
110
- { passive: false },
111
- )
112
- }
113
104
  className={`payment-number-input__btn-up ${
114
105
  plusButtonGreyedOut && 'disabled-number-input-button'
115
106
  }`}
@@ -166,12 +166,12 @@ export const PaymentPage = ({
166
166
  headerComponent={<SummaryTotalBlock amount={totalBooked} />}
167
167
  footer={
168
168
  <div className='d-flex flex-column justify-content-between'>
169
- {paymentMetadata ? (
169
+ {paymentMetadata?.total ? (
170
170
  <>
171
- <SummaryTotalBlock
171
+ {/* <SummaryTotalBlock
172
172
  label={t('total')}
173
173
  amount={paymentMetadata.total || 0}
174
- />
174
+ /> */}
175
175
  <SummaryTotalBlock
176
176
  label={t('paidSum')}
177
177
  amount={paymentMetadata.paid || 0}
@@ -185,7 +185,7 @@ export const PaymentPage = ({
185
185
  </>
186
186
  ) : (
187
187
  <>
188
- {isCalculatedAmountGreaterThanOrderAmount && (
188
+ {!!isCalculatedAmountGreaterThanOrderAmount && (
189
189
  <SummaryTotalBlock
190
190
  label={t(hasRemaingToPay ? 'payNow' : 'total')}
191
191
  amount={
@@ -195,7 +195,7 @@ export const PaymentPage = ({
195
195
  />
196
196
  )}
197
197
 
198
- {hasRemaingToPay && (
198
+ {!!hasRemaingToPay && (
199
199
  <SummaryTotalBlock
200
200
  label={t('remaining')}
201
201
  amount={
@@ -205,7 +205,7 @@ export const PaymentPage = ({
205
205
  />
206
206
  )}
207
207
 
208
- {isPaymentLinkWithRemainingToPay && (
208
+ {!!isPaymentLinkWithRemainingToPay && (
209
209
  <SummaryTotalBlock
210
210
  label={t('remaningToPay')}
211
211
  amount={Number(data?.remaining_to_pay)}
@@ -134,33 +134,43 @@ export const RyftPaymentForm = ({
134
134
  setIsBtnDisabled(false)
135
135
  }
136
136
  }
137
-
138
- useEffect(
139
- () => {
140
- if (
141
- !formRef.current?.childNodes?.length ||
142
- formRef.current?.childNodes?.length < 3 ||
143
- !accountId.data?.account_id
144
- ) {
145
- return
146
- }
147
- injectComponentsInRyftForm({
148
- t,
149
- isAppUsingInIframe,
150
- onApplePayButtonClick,
151
- isDisableButton: !payButtonDisabled,
152
- additionalPaymentMethodsEnabled:
153
- providerPaymentSettings?.additionalPaymentMethodsEnabled,
154
- })
155
- },
156
- // eslint-disable-next-line react-hooks/exhaustive-deps
157
- [
158
- formRef.current?.childNodes?.length,
159
- showApplePayButton,
160
- payButtonDisabled,
161
- ],
137
+ console.log(
138
+ formRef.current?.childNodes?.length,
139
+ 'formRef.current?.childNodes?.length ',
162
140
  )
163
141
 
142
+ // useEffect(() => {
143
+ // const formBox = document.getElementById('form-disable-box')
144
+ // const cardContainer = document.getElementById('ryft-pay-iframe')
145
+
146
+ // const googleButton = document.getElementById(
147
+ // 'gpay-button-online-api-id',
148
+ // ) as HTMLButtonElement | null
149
+
150
+ // const appleButton = document.getElementById(
151
+ // 'ryft-pay-apple-pay-button',
152
+ // ) as HTMLButtonElement | null
153
+
154
+ // if (cardContainer) {
155
+ // cardContainer.style.opacity = payButtonDisabled ? '0.6' : '1'
156
+ // cardContainer.setAttribute('aria-disabled', payButtonDisabled.toString())
157
+ // }
158
+
159
+ // if (googleButton) {
160
+ // googleButton.disabled = payButtonDisabled
161
+ // googleButton.style.opacity = payButtonDisabled ? '0.6' : '1'
162
+ // }
163
+
164
+ // if (appleButton) {
165
+ // appleButton.disabled = payButtonDisabled
166
+ // appleButton.style.opacity = payButtonDisabled ? '0.6' : '1'
167
+ // }
168
+
169
+ // if (formBox) {
170
+ // formBox.style.display = payButtonDisabled ? 'block' : 'none'
171
+ // }
172
+ // }, [payButtonDisabled])
173
+
164
174
  useEffect(() => {
165
175
  if (!accountId.data?.account_id || accountId.isError) return
166
176
  initRyft(
@@ -183,6 +193,29 @@ export const RyftPaymentForm = ({
183
193
  // eslint-disable-next-line react-hooks/exhaustive-deps
184
194
  }, [accountId.data?.account_id])
185
195
 
196
+
197
+ useEffect(
198
+ () => {
199
+ if (
200
+ !formRef.current?.childNodes?.length ||
201
+ formRef.current?.childNodes?.length < 3 ||
202
+ !accountId.data?.account_id
203
+ ) {
204
+ return
205
+ }
206
+ injectComponentsInRyftForm({
207
+ t,
208
+ isAppUsingInIframe,
209
+ onApplePayButtonClick,
210
+ isDisableButton: !payButtonDisabled,
211
+ additionalPaymentMethodsEnabled:
212
+ providerPaymentSettings?.additionalPaymentMethodsEnabled,
213
+ })
214
+ },
215
+ // eslint-disable-next-line react-hooks/exhaustive-deps
216
+ [formRef.current?.childNodes?.length, showApplePayButton, payButtonDisabled],
217
+ )
218
+
186
219
  if (accountId.isLoading || accountId.isFetching || isCreateLoading)
187
220
  return (
188
221
  <div className='mt-5 pt-5'>
@@ -61,22 +61,20 @@ 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(
75
- 'ryft-pay-apple-pay-button',
76
- ) as HTMLButtonElement
74
+ const appleButton =document.getElementById("ryft-pay-apple-pay-button") as HTMLButtonElement
77
75
  if (googleButton) {
78
76
  googleButton.disabled = isDisableButton
79
- googleButton.style.opacity = !isDisableButton ? '1' : '0.6'
77
+ googleButton.style.opacity = isDisableButton ? '1' : '0.6'
80
78
  }
81
79
  if (appleButton) {
82
80
  appleButton.disabled = isDisableButton
@@ -88,6 +86,7 @@ export const injectComponentsInRyftForm = ({
88
86
  const applePayButton = document.createElement('button')
89
87
  applePayButton.id = 'apple-pay'
90
88
  applePayButton.type = 'button'
89
+ applePayButton.style.opacity = !isDisableButton ? '1' : '0.6'
91
90
  applePayButton.className = 'bg-dark btn btn-primary apple-pay-button'
92
91
  applePayButton.textContent = t('Events:payWithApple')
93
92
  applePayButton.onclick = onApplePayButtonClick
@@ -286,15 +286,15 @@ export const EmailTemplateControl = forwardRef(
286
286
  </Form.Group>
287
287
  </Row>
288
288
 
289
- { !waiverType && (<Row>
289
+ <Row>
290
290
  <Form.Group as={Col}>
291
- <Form.Check
291
+ {!waiverType && (<Form.Check
292
292
  {...register('isActive')}
293
293
  name='isActive'
294
294
  label={t('Design:active')}
295
295
  id='formGroupIsActive'
296
296
  custom
297
- />
297
+ />)}
298
298
  <Form.Check
299
299
  {...register('isDefault')}
300
300
  name='isDefault'
@@ -303,7 +303,7 @@ export const EmailTemplateControl = forwardRef(
303
303
  custom
304
304
  />
305
305
  </Form.Group>
306
- </Row>)}
306
+ </Row>
307
307
  <Row className='mb-4'>
308
308
  <Form.Group as={Col}>
309
309
  <Form.Label>{t('Design:emailBody')}</Form.Label>
@@ -375,9 +375,9 @@ export const EmailTemplateControl = forwardRef(
375
375
  )
376
376
  }
377
377
  // should show dropdown only if user want to include PDF file
378
- if (option.type === OPTION_TYPE.files_selector) {
378
+ if (option.type === OPTION_TYPE.files_selector && !waiverType) {
379
379
  const fileSelectors = option?.defaultValue ? JSON.parse(option.defaultValue) : ''
380
- const fileNames = Object.values(fileSelectors)
380
+ const fileNames = Object.values(fileSelectors) : []
381
381
  const fileKeys = Object.keys(fileSelectors)
382
382
 
383
383
  return (
@@ -436,7 +436,6 @@ export const EmailTemplateControl = forwardRef(
436
436
  `templateOptionValues.${option?.id}.value`,
437
437
  )}
438
438
  type='number'
439
- onWheel={(event) => event.currentTarget.blur()}
440
439
  placeholder={t(`Design:${option.name}`)}
441
440
  id={option.name + option.id}
442
441
  defaultValue={option.selectedValue || ''}
@@ -227,7 +227,7 @@ export function ProductSetControl({
227
227
  </>
228
228
  )}
229
229
 
230
- <SaleDeadline disabled={false} isProductSet />
230
+ <SaleDeadline disabled={false} />
231
231
 
232
232
  <div className='divider' />
233
233
 
@@ -11,7 +11,7 @@ import { ModifierSet } from '@licklist/core/dist/DataMapper/Product/ModifierSetD
11
11
  import { isEqual } from 'lodash'
12
12
  import { Zone } from '@licklist/core/dist/DataMapper/Provider/ZoneDataMapper'
13
13
  import { WorkHour } from '@licklist/core/dist/DataMapper/Provider/WorkHourDataMapper'
14
- import { transformErrorToMessage } from '@licklist/plugins/dist/utils/error'
14
+ import { transformErrorToMessage } from '@licklist/plugins'
15
15
  import { Dialog, useDialogContext } from '../../modals/dialog'
16
16
  import {
17
17
  ProductSetControl,
@@ -31,16 +31,12 @@ import { ErrorModal } from '../../iframe/order-process/components/ErrorModal'
31
31
  export interface WithIsLoading {
32
32
  isLoading: boolean
33
33
  }
34
- export interface WithIdOptional {
35
- id?: number
36
- }
37
-
38
34
  export interface WithId {
39
35
  id: number
40
36
  }
41
37
  export interface ProductSetFormValues
42
38
  extends FormValues,
43
- WithIdOptional,
39
+ WithId,
44
40
  ProductSetControlValues {
45
41
  steps: Step[]
46
42
  isOverrides?: boolean
@@ -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