@licklist/design 0.78.4-dev.2 → 0.78.4
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.
- package/dist/auth/Login/LoginComponent.js +1 -2
- package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
- package/dist/events/edit-event-modal/IntervalInput.js +1 -5
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +1 -3
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +3 -16
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +1 -2
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -0
- package/dist/events/event-card/EventCard.d.ts +2 -3
- package/dist/events/event-card/EventCard.d.ts.map +1 -1
- package/dist/events/event-card/EventCard.js +19 -29
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +1 -2
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.js +2 -2
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/hooks/useTableData.js +1 -2
- package/dist/events/event-statistic-modal/utils/index.js +3 -3
- package/dist/events/event-venue-map/EventVenueMap.d.ts.map +1 -1
- package/dist/events/event-venue-map/EventVenueMap.js +0 -1
- package/dist/events/event-venue-map/hooks/useCanvasSize.d.ts.map +1 -1
- package/dist/events/event-venue-map/hooks/useCanvasSize.js +4 -11
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.js +3 -2
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +1 -1
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +11 -4
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +0 -13
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.js +5 -4
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +0 -3
- package/dist/product-set/form/ProductSetForm.d.ts +1 -4
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.js +1 -1
- package/dist/product-set/form/ProductsControl.js +0 -1
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.d.ts.map +1 -1
- package/dist/product-set/product/booking-management/ProductBookingManagementControl.js +0 -6
- package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
- package/dist/product-set/product/deposit/ProductDepositControl.js +0 -3
- package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.js +0 -6
- package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
- package/dist/product-set/product/price/ProductPriceControl.js +0 -3
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +0 -6
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.js +0 -6
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +1 -4
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +0 -12
- package/dist/product-set/utils/index.d.ts +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/recurrence-input/RecurrenceEndInput.js +0 -3
- package/dist/recurring-date-picker-input/RecurrenceEndInput.d.ts.map +1 -1
- package/dist/resource/form/components/CapacityControl.d.ts.map +1 -1
- package/dist/resource/form/components/CapacityControl.js +0 -3
- package/dist/resource/form/components/SortControl.d.ts.map +1 -1
- package/dist/resource/form/components/SortControl.js +0 -3
- package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
- package/dist/sales/coupon/control/CouponFormControl.js +0 -21
- package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
- package/dist/setting/dashboard/DashboardSettingForm.js +1 -4
- package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
- package/dist/static/CurrencyNumberInput.js +0 -3
- package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
- package/dist/static/form-number-input/FormNumberInput.js +0 -3
- package/dist/static/number-input/NumberInput.d.ts.map +1 -1
- package/dist/static/number-input/NumberInput.js +0 -3
- package/dist/styles/events/EditEventModal.scss +0 -7
- package/dist/styles/iframe-events/Calendar.scss +1 -1
- package/dist/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/dist/styles/ryft-payment-form/RyftPaymentForm.scss +3 -1
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
- package/dist/zone/form/components/GameDurationControl.js +0 -3
- package/dist/zone/form/components/SortControl.d.ts.map +1 -1
- package/dist/zone/form/components/SortControl.js +0 -3
- package/package.json +7 -9
- package/src/auth/Login/LoginComponent.tsx +1 -1
- package/src/events/edit-event-modal/IntervalInput.tsx +0 -4
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +4 -19
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +1 -0
- package/src/events/event-card/EventCard.stories.tsx +8 -5
- package/src/events/event-card/EventCard.tsx +28 -35
- package/src/events/event-statistic-modal/EventStatisticModal.tsx +1 -3
- package/src/events/event-statistic-modal/hooks/useTableData.tsx +1 -2
- package/src/events/event-statistic-modal/utils/index.ts +4 -4
- package/src/events/event-venue-map/EventVenueMap.tsx +0 -1
- package/src/events/event-venue-map/hooks/useCanvasSize.ts +1 -5
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx +2 -2
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +13 -5
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +0 -1
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +0 -9
- package/src/iframe/ryft/utils/ryft-form.ts +5 -6
- package/src/notification/email-template/control/EmailTemplateControl.tsx +0 -1
- package/src/product-set/form/ProductSetForm.tsx +2 -6
- package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +0 -2
- package/src/product-set/product/deposit/ProductDepositControl.tsx +0 -1
- package/src/product-set/product/duration/ProductDurationControl.tsx +0 -2
- package/src/product-set/product/price/ProductPriceControl.tsx +0 -1
- package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +0 -2
- package/src/product-set/product/quantity/ProductQuantityControl.tsx +0 -2
- package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +0 -1
- package/src/product-set/product-category/ProductCategoryControl.tsx +0 -4
- package/src/recurrence-input/RecurrenceEndInput.tsx +0 -1
- package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +0 -1
- package/src/resource/form/components/CapacityControl.tsx +0 -1
- package/src/resource/form/components/SortControl.tsx +0 -1
- package/src/sales/coupon/control/CouponFormControl.tsx +0 -7
- package/src/setting/dashboard/DashboardSettingForm.tsx +0 -1
- package/src/static/CurrencyNumberInput.tsx +0 -1
- package/src/static/form-number-input/FormNumberInput.tsx +0 -1
- package/src/static/number-input/NumberInput.tsx +0 -1
- package/src/styles/events/EditEventModal.scss +0 -7
- package/src/styles/iframe-events/Calendar.scss +1 -1
- package/src/styles/iframe-external-modal/IframeExternalModal.scss +2 -2
- package/src/styles/ryft-payment-form/RyftPaymentForm.scss +3 -1
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/zone/form/components/GameDurationControl.tsx +0 -1
- package/src/zone/form/components/SortControl.tsx +0 -1
- package/yarn.lock +180 -237
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.78.4
|
|
3
|
+
"version": "0.78.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -42,10 +42,9 @@
|
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@licklist/core": "0.
|
|
45
|
+
"@licklist/core": "0.35.2",
|
|
46
46
|
"@licklist/eslint-config": "0.5.6",
|
|
47
|
-
"@licklist/plugins": "0.
|
|
48
|
-
"clsx": "2.1.1",
|
|
47
|
+
"@licklist/plugins": "0.35.10",
|
|
49
48
|
"lodash": "4.17.21",
|
|
50
49
|
"luxon": "3.5.0",
|
|
51
50
|
"react": "17.0.2",
|
|
@@ -62,9 +61,9 @@
|
|
|
62
61
|
"@dnd-kit/utilities": "2.0.0",
|
|
63
62
|
"@fortawesome/fontawesome-svg-core": "1.2.34",
|
|
64
63
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
65
|
-
"@licklist/core": "0.
|
|
64
|
+
"@licklist/core": "0.35.2",
|
|
66
65
|
"@licklist/eslint-config": "0.5.6",
|
|
67
|
-
"@licklist/plugins": "0.
|
|
66
|
+
"@licklist/plugins": "0.35.10",
|
|
68
67
|
"@mantine/core": "6.0.22",
|
|
69
68
|
"@mantine/hooks": "6.0.22",
|
|
70
69
|
"@mdx-js/react": "1.6.22",
|
|
@@ -95,6 +94,7 @@
|
|
|
95
94
|
"@wojtekmaj/react-daterange-picker": "4.1.0",
|
|
96
95
|
"bootstrap": "4.6.0",
|
|
97
96
|
"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,10 +206,8 @@
|
|
|
206
206
|
"yarn tsc"
|
|
207
207
|
]
|
|
208
208
|
},
|
|
209
|
-
"packageManager": "yarn@4.4.0",
|
|
210
209
|
"volta": {
|
|
211
210
|
"node": "20.9.0",
|
|
212
211
|
"yarn": "4.4.0"
|
|
213
|
-
}
|
|
214
|
-
"stableVersion": "0.71.4-dev.1"
|
|
212
|
+
}
|
|
215
213
|
}
|
|
@@ -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}>
|
|
@@ -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,
|
|
10
|
+
import { Accordion, 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,7 +50,6 @@ export interface EditEventFormValues extends IntervalInputValues {
|
|
|
50
50
|
saleDeadline: number | null
|
|
51
51
|
integrationUrl: string | null
|
|
52
52
|
recurrenceEndAt?: string
|
|
53
|
-
duplicatedFromId?: number | null
|
|
54
53
|
editedProductSet?: ProductSetFormValues
|
|
55
54
|
}
|
|
56
55
|
|
|
@@ -72,7 +71,6 @@ export interface EditEventFormProps extends HasPermissionProp {
|
|
|
72
71
|
disabledRecurrent?: boolean
|
|
73
72
|
isCopyCreate?: boolean
|
|
74
73
|
isBooked?: boolean
|
|
75
|
-
duplicatedInfo?: string | null
|
|
76
74
|
}
|
|
77
75
|
|
|
78
76
|
const eventImageTypes = {
|
|
@@ -85,7 +83,6 @@ export const EditEventForm = ({
|
|
|
85
83
|
categories,
|
|
86
84
|
title,
|
|
87
85
|
hasPermission = true,
|
|
88
|
-
duplicatedInfo,
|
|
89
86
|
defaultEventValues,
|
|
90
87
|
serverErrors,
|
|
91
88
|
onSaveEvent,
|
|
@@ -221,21 +218,9 @@ export const EditEventForm = ({
|
|
|
221
218
|
onApprove={onApproveDialog}
|
|
222
219
|
onDecline={onDeclineDialog}
|
|
223
220
|
/>
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
{title}
|
|
228
|
-
</h5>
|
|
229
|
-
<Badge className='duplicate-badge' variant='success'>
|
|
230
|
-
{duplicatedInfo}
|
|
231
|
-
</Badge>
|
|
232
|
-
</div>
|
|
233
|
-
) : (
|
|
234
|
-
<h5 className='edit-event-modal-title highlited-primary-title'>
|
|
235
|
-
{title}
|
|
236
|
-
</h5>
|
|
237
|
-
)}
|
|
238
|
-
|
|
221
|
+
<h5 className='edit-event-modal-title highlited-primary-title'>
|
|
222
|
+
{title}
|
|
223
|
+
</h5>
|
|
239
224
|
<FormProvider {...form}>
|
|
240
225
|
<Modal.Body
|
|
241
226
|
as='form'
|
|
@@ -69,13 +69,16 @@ export const Default: Story<EventCardProps> = () => {
|
|
|
69
69
|
console.log('onStatistic')
|
|
70
70
|
}}
|
|
71
71
|
titleId='titleId'
|
|
72
|
+
descriptionId='descriptionId'
|
|
72
73
|
/>
|
|
73
74
|
</div>
|
|
74
75
|
)
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
export const Skeleton: Story<EventCardProps> = () =>
|
|
78
|
-
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
export const Skeleton: Story<EventCardProps> = () => {
|
|
79
|
+
return (
|
|
80
|
+
<div style={{ maxWidth: '34rem' }}>
|
|
81
|
+
<EventCardSkeleton />
|
|
82
|
+
</div>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useMemo } from 'react'
|
|
1
2
|
import {
|
|
2
3
|
Badge,
|
|
3
4
|
Card,
|
|
@@ -11,7 +12,6 @@ import { useTranslation } from 'react-i18next'
|
|
|
11
12
|
import * as Config from '@licklist/core/dist/Config'
|
|
12
13
|
import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission'
|
|
13
14
|
import { EventStatistic } from '@licklist/core/dist/DataMapper/Provider/EventStatisticDataMapper'
|
|
14
|
-
import { EventMetadata } from '@licklist/core/dist/DataMapper/Provider/EventMetadatMapper'
|
|
15
15
|
import {
|
|
16
16
|
FaEye,
|
|
17
17
|
FaExternalLinkAlt,
|
|
@@ -21,7 +21,11 @@ import {
|
|
|
21
21
|
FaQrcode,
|
|
22
22
|
} from 'react-icons/fa'
|
|
23
23
|
import { Sale } from '../../types/bookings'
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
EVENT_DESCRIPTION_SIZE,
|
|
26
|
+
formatContent,
|
|
27
|
+
getStatisticInfo,
|
|
28
|
+
} from './utils'
|
|
25
29
|
import { ReactComponent as ChartBarIcon } from '../../assets/dashboard/chartBar.svg'
|
|
26
30
|
|
|
27
31
|
export interface EventCardProps extends HasPermissionProp {
|
|
@@ -36,22 +40,22 @@ export interface EventCardProps extends HasPermissionProp {
|
|
|
36
40
|
onRemove: () => void
|
|
37
41
|
onOpenQrCode: () => void
|
|
38
42
|
eventStatistic?: EventStatistic | null
|
|
39
|
-
eventMetadata?: EventMetadata | null
|
|
40
43
|
onStatistic: () => void
|
|
41
44
|
titleId?: string
|
|
45
|
+
descriptionId?: string
|
|
42
46
|
productSetName?: string
|
|
43
47
|
eventID?: string
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
export function EventCard({
|
|
47
51
|
name,
|
|
52
|
+
description,
|
|
48
53
|
date,
|
|
49
54
|
imageUrl,
|
|
50
55
|
sales,
|
|
51
56
|
onPreview,
|
|
52
57
|
onEdit,
|
|
53
58
|
onCopy,
|
|
54
|
-
eventMetadata,
|
|
55
59
|
onRemove,
|
|
56
60
|
onOpenQrCode,
|
|
57
61
|
hasPermission = true,
|
|
@@ -59,18 +63,16 @@ export function EventCard({
|
|
|
59
63
|
onStatistic,
|
|
60
64
|
eventStatistic,
|
|
61
65
|
titleId,
|
|
66
|
+
descriptionId,
|
|
62
67
|
eventID,
|
|
63
68
|
}: EventCardProps) {
|
|
64
69
|
const { t } = useTranslation('Design')
|
|
65
70
|
const { formatNumber, formatDate } = useIntl()
|
|
66
71
|
const { totalViews, ...statistics } = getStatisticInfo(eventStatistic, date)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
name: eventMetadata?.editorName,
|
|
72
|
-
})
|
|
73
|
-
: null
|
|
72
|
+
const memoedContent = useMemo(
|
|
73
|
+
() => formatContent(description, EVENT_DESCRIPTION_SIZE),
|
|
74
|
+
[description],
|
|
75
|
+
)
|
|
74
76
|
|
|
75
77
|
return (
|
|
76
78
|
<Card className='d-flex flex-column event-card h-100'>
|
|
@@ -104,15 +106,6 @@ export function EventCard({
|
|
|
104
106
|
) : (
|
|
105
107
|
name
|
|
106
108
|
)}
|
|
107
|
-
{duplicatedInfo && (
|
|
108
|
-
<div className='mt-2 ml-2'>
|
|
109
|
-
<div className='event-card-sale'>
|
|
110
|
-
<span className='event-card-sale-name text-success'>
|
|
111
|
-
{duplicatedInfo}
|
|
112
|
-
</span>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
)}
|
|
116
109
|
</Card.Title>
|
|
117
110
|
<div className='flex-grow-1'>
|
|
118
111
|
<div className='mt-2 ml-2'>
|
|
@@ -131,23 +124,23 @@ export function EventCard({
|
|
|
131
124
|
))}
|
|
132
125
|
</div>
|
|
133
126
|
|
|
134
|
-
{sales
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
.
|
|
142
|
-
|
|
143
|
-
|
|
127
|
+
{sales &&
|
|
128
|
+
sales.map((sale) => (
|
|
129
|
+
<div className='event-card-sale' key={sale.id}>
|
|
130
|
+
{/* TODO: make it an i18n message instead */}
|
|
131
|
+
<div className='event-card-sale-text'>
|
|
132
|
+
<span className='event-card-sale-name'>{sale.name}</span>{' '}
|
|
133
|
+
<span className='event-card-sale-quantity'>
|
|
134
|
+
{[sale.current, sale.max]
|
|
135
|
+
.map((value) => formatNumber(value))
|
|
136
|
+
.join(' / ')}
|
|
137
|
+
</span>
|
|
138
|
+
</div>
|
|
139
|
+
<ProgressBar now={sale.current} max={sale.max} />
|
|
144
140
|
</div>
|
|
145
|
-
|
|
146
|
-
</div>
|
|
147
|
-
))}
|
|
141
|
+
))}
|
|
148
142
|
</div>
|
|
149
143
|
</Card.Body>
|
|
150
|
-
|
|
151
144
|
<Card.Footer className='flex-column'>
|
|
152
145
|
{productSetName && (
|
|
153
146
|
<OverlayTrigger
|
|
@@ -177,6 +170,7 @@ export function EventCard({
|
|
|
177
170
|
</button>
|
|
178
171
|
<div className='event-card-views'>
|
|
179
172
|
<FaEye />
|
|
173
|
+
|
|
180
174
|
<span>{formatNumber(totalViews)}</span>
|
|
181
175
|
</div>
|
|
182
176
|
</div>
|
|
@@ -195,7 +189,6 @@ export function EventCard({
|
|
|
195
189
|
>
|
|
196
190
|
<FaExternalLinkAlt />
|
|
197
191
|
</button>
|
|
198
|
-
|
|
199
192
|
{hasPermission && (
|
|
200
193
|
<>
|
|
201
194
|
<button
|
|
@@ -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
|
|
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,
|
|
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)
|
|
37
|
-
|
|
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
|
-
|
|
44
|
+
DATE_FORMAT,
|
|
45
45
|
) === summaryFormattedDate,
|
|
46
46
|
) ?? []
|
|
47
47
|
|
|
@@ -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 ||
|
|
21
|
+
return memoedComponentParameters || { width, height }
|
|
26
22
|
}
|
package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx
CHANGED
|
@@ -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
|
|
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
|
|
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}
|
package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx
CHANGED
|
@@ -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
|
-
|
|
66
|
+
filteredOrderModifiersSets?.find(
|
|
63
67
|
(modifier) => modifier?.modifierId === selectedModifier?.id,
|
|
64
68
|
)?.quantity === 1
|
|
65
69
|
|
|
@@ -125,9 +129,11 @@ export const ModifiersSetControl = ({
|
|
|
125
129
|
)
|
|
126
130
|
}, [isEditMode])
|
|
127
131
|
|
|
128
|
-
const radioButtonDefaultModifier = currentOrderModifiersSets
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
const radioButtonDefaultModifier = currentOrderModifiersSets
|
|
133
|
+
.find((modifier) =>
|
|
134
|
+
modifierSet.modifiers.some((rl) => rl.id === modifier.modifierId),
|
|
135
|
+
)
|
|
136
|
+
?.modifierId.toString()
|
|
131
137
|
|
|
132
138
|
return (
|
|
133
139
|
<>
|
|
@@ -167,7 +173,9 @@ export const ModifiersSetControl = ({
|
|
|
167
173
|
inline
|
|
168
174
|
id={modifier.id.toString()}
|
|
169
175
|
defaultChecked={!!selectedOrderModifierId}
|
|
170
|
-
defaultValue={
|
|
176
|
+
defaultValue={
|
|
177
|
+
selectedOrderModifierId || modifier.id.toString()
|
|
178
|
+
}
|
|
171
179
|
checked={field.value === modifier.id.toString()}
|
|
172
180
|
onChange={onChange}
|
|
173
181
|
type='radio'
|
|
@@ -3,7 +3,6 @@ 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'
|
|
7
6
|
import { ProductWithModifier } from '../../../CategoryProduct/components/ProductWithModifier/ProductWithModifier'
|
|
8
7
|
|
|
9
8
|
|
package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx
CHANGED
|
@@ -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
|
}`}
|
|
@@ -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(
|
|
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 ?
|
|
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 =
|
|
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 =
|
|
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
|
|
@@ -434,7 +434,6 @@ export const EmailTemplateControl = forwardRef(
|
|
|
434
434
|
`templateOptionValues.${option?.id}.value`,
|
|
435
435
|
)}
|
|
436
436
|
type='number'
|
|
437
|
-
onWheel={(event) => event.currentTarget.blur()}
|
|
438
437
|
placeholder={t(`Design:${option.name}`)}
|
|
439
438
|
id={option.name + option.id}
|
|
440
439
|
defaultValue={option.selectedValue || ''}
|
|
@@ -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'
|
|
14
14
|
import { Dialog, useDialogContext } from '../../modals/dialog'
|
|
15
15
|
import {
|
|
16
16
|
ProductSetControl,
|
|
@@ -30,16 +30,12 @@ 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
|
-
|
|
37
33
|
export interface WithId {
|
|
38
34
|
id: number
|
|
39
35
|
}
|
|
40
36
|
export interface ProductSetFormValues
|
|
41
37
|
extends FormValues,
|
|
42
|
-
|
|
38
|
+
WithId,
|
|
43
39
|
ProductSetControlValues {
|
|
44
40
|
steps: Step[]
|
|
45
41
|
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}
|
|
@@ -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}
|
|
@@ -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
|