@licklist/design 0.78.4 → 0.78.5-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.
- package/dist/affiliate/form/AffiliateForm.d.ts.map +1 -1
- package/dist/affiliate/form/AffiliateForm.js +6 -2
- package/dist/auth/AccessDenied/AccessDenied.d.ts.map +1 -1
- package/dist/auth/AccessDenied/AccessDenied.js +4 -3
- package/dist/auth/Authorizer.d.ts.map +1 -1
- package/dist/auth/Authorizer.js +10 -6
- package/dist/auth/ChangePassword/ChangePasswordComponent.d.ts.map +1 -1
- package/dist/auth/ChangePassword/ChangePasswordComponent.js +36 -41
- package/dist/auth/Layout/AuthNavComponent.d.ts.map +1 -1
- package/dist/auth/Layout/AuthNavComponent.js +2 -3
- package/dist/auth/Layout/UserNavDropDown.d.ts.map +1 -1
- package/dist/auth/Layout/UserNavDropDown.js +8 -9
- package/dist/auth/Login/LoginComponent.d.ts.map +1 -1
- package/dist/auth/Login/LoginComponent.js +59 -61
- package/dist/auth/Logout/Logout.d.ts.map +1 -1
- package/dist/auth/Logout/Logout.js +4 -2
- package/dist/auth/Register/RegisterComponent.d.ts.map +1 -1
- package/dist/auth/Register/RegisterComponent.js +53 -58
- package/dist/auth/ResetPassword/ResetPasswordComponent.d.ts.map +1 -1
- package/dist/auth/ResetPassword/ResetPasswordComponent.js +26 -30
- package/dist/auth/Social/SocialCallbackComponent.d.ts.map +1 -1
- package/dist/auth/Social/SocialCallbackComponent.js +3 -3
- package/dist/events/edit-event-modal/IntervalInput.d.ts.map +1 -1
- package/dist/events/edit-event-modal/IntervalInput.js +5 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts +3 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.d.ts.map +1 -1
- package/dist/events/edit-event-modal/component/EditEventForm/EditEventForm.js +16 -3
- package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.js +2 -2
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +0 -1
- package/dist/events/event-card/EventCard.d.ts +3 -2
- package/dist/events/event-card/EventCard.d.ts.map +1 -1
- package/dist/events/event-card/EventCard.js +29 -19
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts +2 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.d.ts.map +1 -1
- package/dist/events/event-statistic-modal/EventStatisticModal.js +2 -3
- 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 +2 -1
- 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 +1 -0
- package/dist/events/event-venue-map/hooks/useCanvasSize.d.ts.map +1 -1
- package/dist/events/event-venue-map/hooks/useCanvasSize.js +11 -4
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetForm.js +1 -2
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.js +3 -4
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.d.ts.map +1 -1
- package/dist/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.js +5 -13
- package/dist/iframe/event/event-navigation-footer/EventNavigationFooter.d.ts.map +1 -1
- package/dist/iframe/event/event-navigation-footer/EventNavigationFooter.js +3 -2
- 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 +13 -0
- package/dist/iframe/order-process/components/NavigationSteps/NavigationSteps.js +3 -3
- package/dist/iframe/payment/order-items-table/OrderItemsTable.js +0 -1
- package/dist/iframe/payment/payment-form/PaymentForm.js +0 -1
- package/dist/iframe/ryft/RyftPaymentForm.d.ts.map +1 -1
- package/dist/iframe/ryft/RyftPaymentForm.js +1 -3
- package/dist/iframe/ryft/utils/ryft-form.d.ts.map +1 -1
- package/dist/iframe/ryft/utils/ryft-form.js +4 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +3 -0
- package/dist/pages/PrivacyComponent.d.ts +3 -0
- package/dist/pages/PrivacyComponent.d.ts.map +1 -0
- package/dist/pages/PrivacyComponent.js +536 -0
- package/dist/pages/TermsComponent.d.ts +3 -0
- package/dist/pages/TermsComponent.d.ts.map +1 -0
- package/dist/pages/TermsComponent.js +682 -0
- package/dist/pages/index.d.ts +3 -0
- package/dist/pages/index.d.ts.map +1 -0
- package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
- package/dist/product-set/card/ProductSetCard.js +3 -2
- package/dist/product-set/form/ProductSetForm.d.ts +4 -1
- 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 +2 -1
- package/dist/product-set/product/advanced-options/AdvancedOptions.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 +6 -0
- package/dist/product-set/product/deposit/ProductDepositControl.d.ts.map +1 -1
- package/dist/product-set/product/deposit/ProductDepositControl.js +3 -0
- package/dist/product-set/product/duration/ProductDurationControl.d.ts.map +1 -1
- package/dist/product-set/product/duration/ProductDurationControl.js +6 -0
- package/dist/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
- package/dist/product-set/product/price/ProductPriceControl.js +3 -0
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityConstantControl.js +6 -0
- package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityControl.js +6 -0
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.d.ts.map +1 -1
- package/dist/product-set/product/quantity/ProductQuantityRechargingControl.js +4 -1
- package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
- package/dist/product-set/product-category/ProductCategoryControl.js +12 -0
- 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 +3 -0
- 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 +3 -0
- package/dist/resource/form/components/SortControl.d.ts.map +1 -1
- package/dist/resource/form/components/SortControl.js +3 -0
- package/dist/sales/coupon/control/CouponFormControl.d.ts.map +1 -1
- package/dist/sales/coupon/control/CouponFormControl.js +21 -0
- package/dist/sales/notes/NotesTableRow.js +0 -1
- package/dist/sales/payment-form/components/RyftPayment/RyftPayment.d.ts.map +1 -1
- package/dist/sales/payment-form/components/RyftPayment/RyftPayment.js +1 -3
- package/dist/setting/dashboard/DashboardSettingForm.d.ts.map +1 -1
- package/dist/setting/dashboard/DashboardSettingForm.js +4 -1
- package/dist/setting/dashboard/snippets/card/SnippetCard.d.ts.map +1 -1
- package/dist/setting/dashboard/snippets/card/SnippetCard.js +4 -4
- package/dist/snippet/snippet-template/preview/Preview.js +0 -1
- package/dist/static/CurrencyNumberInput.d.ts.map +1 -1
- package/dist/static/CurrencyNumberInput.js +3 -0
- package/dist/static/RestrictedAccess.d.ts.map +1 -1
- package/dist/static/RestrictedAccess.js +3 -2
- package/dist/static/form-number-input/FormNumberInput.d.ts.map +1 -1
- package/dist/static/form-number-input/FormNumberInput.js +3 -0
- package/dist/static/index.js +1 -1
- package/dist/static/number-input/NumberInput.d.ts.map +1 -1
- package/dist/static/number-input/NumberInput.js +3 -0
- package/dist/striped-static-table/StripedStaticTable.js +0 -1
- package/dist/styles/events/EditEventModal.scss +7 -0
- 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 +1 -3
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/table/ReactTableHelperComponent.d.ts.map +1 -1
- package/dist/table/ReactTableHelperComponent.js +3 -3
- package/dist/table/TableHelperComponent.d.ts.map +1 -1
- package/dist/table/TableHelperComponent.js +3 -3
- package/dist/venue-map-sets/card/VenueMapSetCard.d.ts.map +1 -1
- package/dist/venue-map-sets/card/VenueMapSetCard.js +4 -3
- package/dist/zone/card/ZoneCard.d.ts.map +1 -1
- package/dist/zone/card/ZoneCard.js +4 -3
- package/dist/zone/form/components/GameDurationControl.d.ts.map +1 -1
- package/dist/zone/form/components/GameDurationControl.js +3 -0
- package/dist/zone/form/components/SortControl.d.ts.map +1 -1
- package/dist/zone/form/components/SortControl.js +3 -0
- package/package.json +11 -9
- package/src/affiliate/form/AffiliateForm.tsx +4 -2
- package/src/auth/AccessDenied/AccessDenied.tsx +4 -3
- package/src/auth/Authorizer.tsx +11 -6
- package/src/auth/ChangePassword/ChangePasswordComponent.tsx +21 -26
- package/src/auth/Layout/AuthNavComponent.tsx +2 -3
- package/src/auth/Layout/UserNavDropDown.tsx +6 -7
- package/src/auth/Login/LoginComponent.tsx +43 -47
- package/src/auth/Logout/Logout.stories.tsx +12 -14
- package/src/auth/Logout/Logout.tsx +4 -3
- package/src/auth/Register/RegisterComponent.tsx +35 -41
- package/src/auth/ResetPassword/ResetPasswordComponent.tsx +16 -20
- package/src/auth/Social/SocialCallbackComponent.tsx +4 -4
- package/src/events/edit-event-modal/IntervalInput.tsx +4 -0
- package/src/events/edit-event-modal/component/EditEventForm/EditEventForm.tsx +19 -4
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +0 -1
- package/src/events/event-card/EventCard.stories.tsx +5 -8
- package/src/events/event-card/EventCard.tsx +35 -28
- package/src/events/event-statistic-modal/EventStatisticModal.tsx +3 -1
- package/src/events/event-statistic-modal/hooks/useTableData.tsx +2 -1
- package/src/events/event-statistic-modal/utils/index.ts +4 -4
- package/src/events/event-venue-map/EventVenueMap.tsx +1 -0
- package/src/events/event-venue-map/hooks/useCanvasSize.ts +5 -1
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/ProductWithModifierSetModal.tsx +2 -2
- package/src/iframe/ProductWithModifierModal/ModifierSetModal/controll/ModifierSetControll.tsx +5 -13
- package/src/iframe/event/event-navigation-footer/EventNavigationFooter.tsx +3 -2
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +1 -0
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +9 -0
- package/src/iframe/order-process/components/NavigationSteps/NavigationSteps.tsx +3 -3
- package/src/iframe/order-process/components/utils/useOnWindowUnmount.ts +1 -1
- package/src/iframe/ryft/RyftPaymentForm.tsx +2 -5
- package/src/iframe/ryft/utils/ryft-form.ts +6 -5
- package/src/index.ts +1 -0
- package/src/notification/email-template/control/EmailTemplateControl.tsx +1 -0
- package/src/pages/PrivacyComponent.tsx +318 -0
- package/src/pages/TermsComponent.tsx +306 -0
- package/src/pages/index.ts +2 -0
- package/src/product-set/card/ProductSetCard.tsx +3 -2
- package/src/product-set/form/ProductSetForm.tsx +6 -2
- package/src/product-set/product/booking-management/ProductBookingManagementControl.tsx +2 -0
- package/src/product-set/product/deposit/ProductDepositControl.tsx +1 -0
- package/src/product-set/product/duration/ProductDurationControl.tsx +2 -0
- package/src/product-set/product/price/ProductPriceControl.tsx +1 -0
- package/src/product-set/product/quantity/ProductQuantityConstantControl.tsx +2 -0
- package/src/product-set/product/quantity/ProductQuantityControl.tsx +2 -0
- package/src/product-set/product/quantity/ProductQuantityRechargingControl.tsx +1 -0
- package/src/product-set/product-category/ProductCategoryControl.tsx +4 -0
- package/src/recurrence-input/RecurrenceEndInput.tsx +1 -0
- package/src/recurring-date-picker-input/RecurrenceEndInput.tsx +1 -0
- package/src/resource/form/components/CapacityControl.tsx +1 -0
- package/src/resource/form/components/SortControl.tsx +1 -0
- package/src/sales/coupon/control/CouponFormControl.tsx +7 -0
- package/src/sales/payment-form/components/RyftPayment/RyftPayment.tsx +1 -3
- package/src/setting/dashboard/DashboardSettingForm.tsx +1 -0
- package/src/setting/dashboard/snippets/card/SnippetCard.tsx +4 -3
- package/src/static/CurrencyNumberInput.tsx +1 -0
- package/src/static/RestrictedAccess.tsx +3 -6
- package/src/static/form-number-input/FormNumberInput.tsx +1 -0
- package/src/static/number-input/NumberInput.tsx +1 -0
- package/src/styles/events/EditEventModal.scss +7 -0
- 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 +1 -3
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/table/ReactTableHelperComponent.tsx +3 -5
- package/src/table/TableHelperComponent.tsx +3 -3
- package/src/venue-map-sets/card/VenueMapSetCard.tsx +4 -3
- package/src/zone/card/ZoneCard.tsx +4 -3
- package/src/zone/form/components/GameDurationControl.tsx +1 -0
- package/src/zone/form/components/SortControl.tsx +1 -0
- package/yarn.lock +329 -271
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useMemo } from 'react'
|
|
2
1
|
import {
|
|
3
2
|
Badge,
|
|
4
3
|
Card,
|
|
@@ -12,6 +11,7 @@ import { useTranslation } from 'react-i18next'
|
|
|
12
11
|
import * as Config from '@licklist/core/dist/Config'
|
|
13
12
|
import { HasPermissionProp } from '@licklist/plugins/dist/types/permission/Permission'
|
|
14
13
|
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,11 +21,7 @@ import {
|
|
|
21
21
|
FaQrcode,
|
|
22
22
|
} from 'react-icons/fa'
|
|
23
23
|
import { Sale } from '../../types/bookings'
|
|
24
|
-
import {
|
|
25
|
-
EVENT_DESCRIPTION_SIZE,
|
|
26
|
-
formatContent,
|
|
27
|
-
getStatisticInfo,
|
|
28
|
-
} from './utils'
|
|
24
|
+
import { getStatisticInfo } from './utils'
|
|
29
25
|
import { ReactComponent as ChartBarIcon } from '../../assets/dashboard/chartBar.svg'
|
|
30
26
|
|
|
31
27
|
export interface EventCardProps extends HasPermissionProp {
|
|
@@ -40,22 +36,22 @@ export interface EventCardProps extends HasPermissionProp {
|
|
|
40
36
|
onRemove: () => void
|
|
41
37
|
onOpenQrCode: () => void
|
|
42
38
|
eventStatistic?: EventStatistic | null
|
|
39
|
+
eventMetadata?: EventMetadata | null
|
|
43
40
|
onStatistic: () => void
|
|
44
41
|
titleId?: string
|
|
45
|
-
descriptionId?: string
|
|
46
42
|
productSetName?: string
|
|
47
43
|
eventID?: string
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
export function EventCard({
|
|
51
47
|
name,
|
|
52
|
-
description,
|
|
53
48
|
date,
|
|
54
49
|
imageUrl,
|
|
55
50
|
sales,
|
|
56
51
|
onPreview,
|
|
57
52
|
onEdit,
|
|
58
53
|
onCopy,
|
|
54
|
+
eventMetadata,
|
|
59
55
|
onRemove,
|
|
60
56
|
onOpenQrCode,
|
|
61
57
|
hasPermission = true,
|
|
@@ -63,16 +59,18 @@ export function EventCard({
|
|
|
63
59
|
onStatistic,
|
|
64
60
|
eventStatistic,
|
|
65
61
|
titleId,
|
|
66
|
-
descriptionId,
|
|
67
62
|
eventID,
|
|
68
63
|
}: EventCardProps) {
|
|
69
64
|
const { t } = useTranslation('Design')
|
|
70
65
|
const { formatNumber, formatDate } = useIntl()
|
|
71
66
|
const { totalViews, ...statistics } = getStatisticInfo(eventStatistic, date)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
|
|
68
|
+
const duplicatedInfo = eventMetadata?.duplicatedFromId
|
|
69
|
+
? t('Design:duplicatedInfo', {
|
|
70
|
+
ID: eventMetadata?.duplicatedFromId,
|
|
71
|
+
name: eventMetadata?.editorName,
|
|
72
|
+
})
|
|
73
|
+
: null
|
|
76
74
|
|
|
77
75
|
return (
|
|
78
76
|
<Card className='d-flex flex-column event-card h-100'>
|
|
@@ -106,6 +104,15 @@ export function EventCard({
|
|
|
106
104
|
) : (
|
|
107
105
|
name
|
|
108
106
|
)}
|
|
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
|
+
)}
|
|
109
116
|
</Card.Title>
|
|
110
117
|
<div className='flex-grow-1'>
|
|
111
118
|
<div className='mt-2 ml-2'>
|
|
@@ -124,23 +131,23 @@ export function EventCard({
|
|
|
124
131
|
))}
|
|
125
132
|
</div>
|
|
126
133
|
|
|
127
|
-
{sales
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
</span>
|
|
138
|
-
</div>
|
|
139
|
-
<ProgressBar now={sale.current} max={sale.max} />
|
|
134
|
+
{sales?.map((sale) => (
|
|
135
|
+
<div className='event-card-sale' key={sale.id}>
|
|
136
|
+
{/* TODO: make it an i18n message instead */}
|
|
137
|
+
<div className='event-card-sale-text'>
|
|
138
|
+
<span className='event-card-sale-name'>{sale.name}</span>{' '}
|
|
139
|
+
<span className='event-card-sale-quantity'>
|
|
140
|
+
{[sale.current, sale.max]
|
|
141
|
+
.map((value) => formatNumber(value))
|
|
142
|
+
.join(' / ')}
|
|
143
|
+
</span>
|
|
140
144
|
</div>
|
|
141
|
-
|
|
145
|
+
<ProgressBar now={sale.current} max={sale.max} />
|
|
146
|
+
</div>
|
|
147
|
+
))}
|
|
142
148
|
</div>
|
|
143
149
|
</Card.Body>
|
|
150
|
+
|
|
144
151
|
<Card.Footer className='flex-column'>
|
|
145
152
|
{productSetName && (
|
|
146
153
|
<OverlayTrigger
|
|
@@ -170,7 +177,6 @@ export function EventCard({
|
|
|
170
177
|
</button>
|
|
171
178
|
<div className='event-card-views'>
|
|
172
179
|
<FaEye />
|
|
173
|
-
|
|
174
180
|
<span>{formatNumber(totalViews)}</span>
|
|
175
181
|
</div>
|
|
176
182
|
</div>
|
|
@@ -189,6 +195,7 @@ export function EventCard({
|
|
|
189
195
|
>
|
|
190
196
|
<FaExternalLinkAlt />
|
|
191
197
|
</button>
|
|
198
|
+
|
|
192
199
|
{hasPermission && (
|
|
193
200
|
<>
|
|
194
201
|
<button
|
|
@@ -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
|
-
|
|
38
|
-
|
|
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
|
-
|
|
44
|
+
DATE_TIME_FULL_FORMAT,
|
|
45
45
|
) === summaryFormattedDate,
|
|
46
46
|
) ?? []
|
|
47
47
|
|
|
@@ -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 ||
|
|
25
|
+
return memoedComponentParameters || memoizedDimensions
|
|
22
26
|
}
|
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,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
|
-
|
|
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
|
-
.
|
|
134
|
-
|
|
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'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTranslation } from 'react-i18next'
|
|
2
2
|
import Button from 'react-bootstrap/Button'
|
|
3
|
-
import RouteService from '@licklist/plugins/dist/services/Route/RouteService'
|
|
4
3
|
import { FaArrowLeft, FaArrowRight } from 'react-icons/fa'
|
|
4
|
+
import { useNavigate } from 'react-router-dom'
|
|
5
5
|
|
|
6
6
|
interface PaginationDotsProps {
|
|
7
7
|
amount: number
|
|
@@ -33,13 +33,14 @@ export function EventNavigationFooter({
|
|
|
33
33
|
// @TODO remove and adjust components that uses old interface
|
|
34
34
|
// used onSubmit for old cases
|
|
35
35
|
const submitButtonProps = onSubmit ? { onSubmit } : { type: 'submit' }
|
|
36
|
+
const navigate = useNavigate()
|
|
36
37
|
|
|
37
38
|
const onPrevButtonClick = () => {
|
|
38
39
|
if (activeElement === 1) {
|
|
39
40
|
if (onPrevStep) {
|
|
40
41
|
onPrevStep()
|
|
41
42
|
} else {
|
|
42
|
-
|
|
43
|
+
navigate(-1)
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
return
|
|
@@ -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
|
|
package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx
CHANGED
|
@@ -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
|
}`}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRef, useMemo, useEffect, useState, useCallback } from 'react'
|
|
2
|
-
import { useLocation,
|
|
2
|
+
import { useLocation, useNavigate } from 'react-router-dom'
|
|
3
3
|
import clsx from 'clsx'
|
|
4
4
|
import { useTranslation } from 'react-i18next'
|
|
5
5
|
import { SnippetLoader } from '../../../../static'
|
|
@@ -22,7 +22,7 @@ export const NavigationSteps = ({
|
|
|
22
22
|
}: NavigationStepsProps) => {
|
|
23
23
|
const { t } = useTranslation('Design')
|
|
24
24
|
const location = useLocation()
|
|
25
|
-
const
|
|
25
|
+
const navigate = useNavigate()
|
|
26
26
|
|
|
27
27
|
const containerRef = useRef<HTMLDivElement>(null)
|
|
28
28
|
const containerWrapperRef = useRef<HTMLDivElement>(null)
|
|
@@ -45,7 +45,7 @@ export const NavigationSteps = ({
|
|
|
45
45
|
pathname: string,
|
|
46
46
|
queryParams?: Record<string, string>,
|
|
47
47
|
) => {
|
|
48
|
-
|
|
48
|
+
navigate({
|
|
49
49
|
pathname,
|
|
50
50
|
search: new URLSearchParams(queryParams).toString(),
|
|
51
51
|
})
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react'
|
|
2
2
|
import { useTranslation } from 'react-i18next'
|
|
3
3
|
import { useForm } from 'react-hook-form'
|
|
4
|
-
|
|
5
4
|
import Button from 'react-bootstrap/Button'
|
|
6
|
-
import { useHistory } from 'react-router-dom'
|
|
7
5
|
import Alert from 'react-bootstrap/Alert'
|
|
8
6
|
import {
|
|
9
7
|
STATUS_APPROVED,
|
|
@@ -16,7 +14,6 @@ import {
|
|
|
16
14
|
AttemptPaymentResponse,
|
|
17
15
|
} from '@licklist/plugins/dist/hooks/Ryft/useRyftPayment'
|
|
18
16
|
import { ProviderPaymentSettings } from '@licklist/core/dist/DataMapper/Setting/ProviderPaymentSettingsDataMapper'
|
|
19
|
-
|
|
20
17
|
import { BlockLoader, ButtonLoader } from '../../static'
|
|
21
18
|
import { injectComponentsInRyftForm } from './utils/ryft-form'
|
|
22
19
|
|
|
@@ -72,7 +69,7 @@ export const RyftPaymentForm = ({
|
|
|
72
69
|
const showApplePayButton =
|
|
73
70
|
isAppUsingInIframe &&
|
|
74
71
|
providerPaymentSettings?.additionalPaymentMethodsEnabled
|
|
75
|
-
|
|
72
|
+
|
|
76
73
|
const [isValid, setIsValid] = useState(false)
|
|
77
74
|
const [isBtnDisabled, setIsBtnDisabled] = useState(false)
|
|
78
75
|
const [ryftInitFailure, setRyftInitFailure] = useState<boolean>(false)
|
|
@@ -214,7 +211,7 @@ export const RyftPaymentForm = ({
|
|
|
214
211
|
<Button
|
|
215
212
|
variant='primary'
|
|
216
213
|
onClick={() => {
|
|
217
|
-
|
|
214
|
+
window.location.reload()
|
|
218
215
|
}}
|
|
219
216
|
>
|
|
220
217
|
{t('Ryft:refresh')}
|
|
@@ -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(
|
|
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 =document.getElementById(
|
|
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
|
package/src/index.ts
CHANGED
|
@@ -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 || ''}
|