@licklist/design 0.78.4 → 0.78.5-dev.1
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 +4 -3
- package/dist/events/event-card/EventCard.d.ts.map +1 -1
- package/dist/events/event-card/EventCard.js +30 -20
- 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 +45 -36
- 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 +332 -274
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import Dropdown from 'react-bootstrap/Dropdown'
|
|
2
2
|
import { useTranslation } from 'react-i18next'
|
|
3
|
-
import RouteService from '@licklist/plugins/dist/services/Route/RouteService'
|
|
4
3
|
import useUser from '@licklist/plugins/dist/context/user/hooks/useUser'
|
|
4
|
+
import { useNavigate } from 'react-router-dom'
|
|
5
5
|
|
|
6
6
|
function UserNavDropDown() {
|
|
7
7
|
const { t } = useTranslation('App')
|
|
8
8
|
const user = useUser()
|
|
9
|
+
const navigate = useNavigate()
|
|
9
10
|
|
|
10
11
|
const onLogoutHandler = () => {
|
|
11
12
|
user.logout()
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
navigate('/')
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
return (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
</Dropdown.Item>
|
|
21
|
-
</>
|
|
18
|
+
<Dropdown.Item eventKey='1' onClick={onLogoutHandler}>
|
|
19
|
+
{t('logout')}
|
|
20
|
+
</Dropdown.Item>
|
|
22
21
|
)
|
|
23
22
|
}
|
|
24
23
|
|
|
@@ -2,20 +2,18 @@ import { useContext, useEffect, useState } from 'react'
|
|
|
2
2
|
import Row from 'react-bootstrap/Row'
|
|
3
3
|
import Col from 'react-bootstrap/Col'
|
|
4
4
|
import { Trans, useTranslation } from 'react-i18next'
|
|
5
|
-
import { Link } from 'react-router-dom'
|
|
5
|
+
import { Link, useNavigate } from 'react-router-dom'
|
|
6
6
|
import RequestContext from '@licklist/plugins/dist/context/app/RequestContext'
|
|
7
7
|
import useUserApi from '@licklist/plugins/dist/hooks/Api/useUserApi'
|
|
8
8
|
import useNotification from '@licklist/plugins/dist/context/app/hooks/useNotification'
|
|
9
9
|
import useAuth from '@licklist/plugins/dist/context/user/hooks/useAuth'
|
|
10
10
|
import useUser from '@licklist/plugins/dist/context/user/hooks/useUser'
|
|
11
11
|
import useInvite from '@licklist/plugins/dist/context/user/hooks/useInvite'
|
|
12
|
-
import RouteService from '@licklist/plugins/dist/services/Route/RouteService'
|
|
13
12
|
import { IAuth } from '@licklist/plugins/dist/types/context/user/IAuth'
|
|
14
13
|
import { UserLoginRequest } from '@licklist/plugins/dist/types/Request/UserLoginRequest'
|
|
15
14
|
import { IUser } from '@licklist/plugins/dist/types/context/user/IUser'
|
|
16
15
|
import { SocialFormComponent } from '../Social/SocialFormComponent'
|
|
17
16
|
import { LoginFormComponent } from './LoginFormComponent'
|
|
18
|
-
import { Router } from '../Router'
|
|
19
17
|
import FormCard from '../../static/FormCard'
|
|
20
18
|
import { LoaderIndicator } from '../../static/loader/LoaderIndicator'
|
|
21
19
|
import Logo from '../../logo/Logo'
|
|
@@ -37,6 +35,8 @@ const LoginComponent = ({
|
|
|
37
35
|
const user = useUser()
|
|
38
36
|
const invite = useInvite()
|
|
39
37
|
|
|
38
|
+
const navigate = useNavigate()
|
|
39
|
+
|
|
40
40
|
const [isLoading, setIsLoading] = useState<boolean>(false)
|
|
41
41
|
|
|
42
42
|
const userApiService = useUserApi(request)
|
|
@@ -44,7 +44,7 @@ const LoginComponent = ({
|
|
|
44
44
|
const handleError = (error: any) => {
|
|
45
45
|
notification.danger({
|
|
46
46
|
title: 'Error',
|
|
47
|
-
message: error.message,
|
|
47
|
+
message: error?.response?.data?.message || error.message,
|
|
48
48
|
})
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -87,7 +87,7 @@ const LoginComponent = ({
|
|
|
87
87
|
message: t('Notification:loggedSuccessfully'),
|
|
88
88
|
})
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
navigate('/', { replace: true })
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
useEffect(() => {
|
|
@@ -95,55 +95,51 @@ const LoginComponent = ({
|
|
|
95
95
|
return
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
navigate('/')
|
|
99
99
|
}, [user.profile, auth.secrets])
|
|
100
100
|
|
|
101
101
|
return (
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
<>
|
|
125
|
-
<SocialFormComponent
|
|
126
|
-
isLoading={isLoading}
|
|
127
|
-
setIsLoading={setIsLoading}
|
|
128
|
-
/>
|
|
129
|
-
|
|
130
|
-
<hr className='mb-2' />
|
|
131
|
-
</>
|
|
132
|
-
)}
|
|
133
|
-
|
|
134
|
-
<LoginFormComponent
|
|
102
|
+
<Row className='justify-content-center'>
|
|
103
|
+
<Col xs sm={12} md={7} lg={6} xl={5} className='align-self-center'>
|
|
104
|
+
<h1 className='text-center'>{t('User:loginTitle')}</h1>
|
|
105
|
+
|
|
106
|
+
<div className='login d-flex pb-4 justify-content-center'>
|
|
107
|
+
<Logo logo={<BookeditLogoSvg />} />
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
{!hideSignUpLink && (
|
|
111
|
+
<h6 className='text-center'>
|
|
112
|
+
<Trans t={t} i18nKey='loginPromo'>
|
|
113
|
+
{/* TODO fix issue react router types
|
|
114
|
+
@ts-expect-error */}
|
|
115
|
+
Don't have account? <Link to='/register'>Sign up</Link>.
|
|
116
|
+
</Trans>
|
|
117
|
+
</h6>
|
|
118
|
+
)}
|
|
119
|
+
|
|
120
|
+
<FormCard>
|
|
121
|
+
{showSocialLinks && (
|
|
122
|
+
<>
|
|
123
|
+
<SocialFormComponent
|
|
135
124
|
isLoading={isLoading}
|
|
136
125
|
setIsLoading={setIsLoading}
|
|
137
|
-
onSubmit={handleOnSubmit}
|
|
138
|
-
invitation={invite.invitation}
|
|
139
126
|
/>
|
|
140
127
|
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
128
|
+
<hr className='mb-2' />
|
|
129
|
+
</>
|
|
130
|
+
)}
|
|
131
|
+
|
|
132
|
+
<LoginFormComponent
|
|
133
|
+
isLoading={isLoading}
|
|
134
|
+
setIsLoading={setIsLoading}
|
|
135
|
+
onSubmit={handleOnSubmit}
|
|
136
|
+
invitation={invite.invitation}
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
<LoaderIndicator isLoaded={!isLoading} />
|
|
140
|
+
</FormCard>
|
|
141
|
+
</Col>
|
|
142
|
+
</Row>
|
|
147
143
|
)
|
|
148
144
|
}
|
|
149
145
|
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import { useEffect } from 'react'
|
|
2
|
-
import { Route,
|
|
2
|
+
import { Route, MemoryRouter, useNavigate, Routes } from 'react-router-dom'
|
|
3
3
|
import { Meta, Story } from '@storybook/react'
|
|
4
4
|
import UserProvider from '@licklist/plugins/dist/context/user/providers/UserProvider'
|
|
5
5
|
import useUser from '@licklist/plugins/dist/context/user/hooks/useUser'
|
|
6
|
-
import RouteService from '@licklist/plugins/dist/services/Route/RouteService'
|
|
7
|
-
import { Logout } from './Logout'
|
|
8
6
|
import { Button } from 'react-bootstrap'
|
|
7
|
+
import { Logout } from './Logout'
|
|
9
8
|
|
|
10
9
|
export default {
|
|
11
10
|
title: 'Auth/Logout',
|
|
12
11
|
} as Meta
|
|
13
12
|
|
|
14
13
|
export const LogoutComponent: Story = () => (
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</UserProvider>
|
|
24
|
-
</>
|
|
14
|
+
<UserProvider>
|
|
15
|
+
<MemoryRouter initialIndex={0} initialEntries={['/', '/logout']}>
|
|
16
|
+
<Routes>
|
|
17
|
+
<Route path='/' element={LoggedPage} />
|
|
18
|
+
<Route path='/logout' element={LogoutWrapper} />
|
|
19
|
+
</Routes>
|
|
20
|
+
</MemoryRouter>
|
|
21
|
+
</UserProvider>
|
|
25
22
|
)
|
|
26
23
|
|
|
27
24
|
function LoggedPage() {
|
|
28
25
|
const user = useUser()
|
|
26
|
+
const navigate = useNavigate()
|
|
29
27
|
|
|
30
28
|
useEffect(() => {
|
|
31
29
|
user.login({
|
|
@@ -43,7 +41,7 @@ function LoggedPage() {
|
|
|
43
41
|
}, [])
|
|
44
42
|
|
|
45
43
|
const redirectToLogout = () => {
|
|
46
|
-
|
|
44
|
+
navigate('/logout')
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
return (
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { useEffect } from 'react'
|
|
2
2
|
import useUser from '@licklist/plugins/dist/context/user/hooks/useUser'
|
|
3
|
-
import
|
|
3
|
+
import { useNavigate } from 'react-router-dom'
|
|
4
4
|
import { BlockLoader } from '../../static'
|
|
5
5
|
|
|
6
6
|
export const Logout = () => {
|
|
7
7
|
const user = useUser()
|
|
8
|
+
const navigate = useNavigate()
|
|
8
9
|
|
|
9
10
|
useEffect(() => {
|
|
10
11
|
user.logout()
|
|
11
|
-
|
|
12
|
-
}, [user])
|
|
12
|
+
navigate('/')
|
|
13
|
+
}, [navigate, user])
|
|
13
14
|
|
|
14
15
|
return <BlockLoader />
|
|
15
16
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useContext, useState } from 'react'
|
|
2
2
|
import { Trans, useTranslation } from 'react-i18next'
|
|
3
|
-
import { Link } from 'react-router-dom'
|
|
3
|
+
import { Link, useNavigate } from 'react-router-dom'
|
|
4
4
|
import { Row, Col } from 'react-bootstrap'
|
|
5
5
|
import RequestContext from '@licklist/plugins/dist/context/app/RequestContext'
|
|
6
|
-
import RouteService from '@licklist/plugins/dist/services/Route/RouteService'
|
|
7
6
|
import useNotification from '@licklist/plugins/dist/context/app/hooks/useNotification'
|
|
8
7
|
import useUser from '@licklist/plugins/dist/context/user/hooks/useUser'
|
|
9
8
|
import useAuth from '@licklist/plugins/dist/context/user/hooks/useAuth'
|
|
@@ -13,10 +12,8 @@ import { IAuth } from '@licklist/plugins/dist/types/context/user/IAuth'
|
|
|
13
12
|
import { IUser } from '@licklist/plugins/dist/types/context/user/IUser'
|
|
14
13
|
import { UserRegisterRequest } from '@licklist/plugins/dist/types/Request/UserRegisterRequest'
|
|
15
14
|
import { ErrorHandlerFn } from '@licklist/core/dist/Api/ApiService'
|
|
16
|
-
|
|
17
15
|
import { RegisterFormComponent } from './RegisterFormComponent'
|
|
18
16
|
import { SocialFormComponent } from '../Social/SocialFormComponent'
|
|
19
|
-
import { Router } from '../Router'
|
|
20
17
|
import FormCard from '../../static/FormCard'
|
|
21
18
|
import { LoaderIndicator } from '../../static/loader/LoaderIndicator'
|
|
22
19
|
|
|
@@ -33,6 +30,7 @@ function RegisterComponent({
|
|
|
33
30
|
const auth = useAuth()
|
|
34
31
|
const user = useUser()
|
|
35
32
|
const invite = useInvite()
|
|
33
|
+
const navigate = useNavigate()
|
|
36
34
|
|
|
37
35
|
const [isLoading, setIsLoading] = useState<boolean>(false)
|
|
38
36
|
const [serverErrors, setServerErrors] = useState(null)
|
|
@@ -92,51 +90,47 @@ function RegisterComponent({
|
|
|
92
90
|
message: t('Notification:registeredSuccessfully'),
|
|
93
91
|
})
|
|
94
92
|
|
|
95
|
-
|
|
93
|
+
navigate('/')
|
|
96
94
|
}
|
|
97
95
|
|
|
98
96
|
return (
|
|
99
|
-
<
|
|
100
|
-
<
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
Fill out the form below to sign up for {{ name: t('bookedit') }}
|
|
108
|
-
{/* TODO fix issue react router types
|
|
97
|
+
<Row className='justify-content-center'>
|
|
98
|
+
<Col xs sm={12} md={7} lg={6} xl={5} className='align-self-center'>
|
|
99
|
+
<h1 className='text-center'>{t('registerTitle')}</h1>
|
|
100
|
+
|
|
101
|
+
<h6 className='text-center'>
|
|
102
|
+
<Trans t={t} i18nKey='registerPromo'>
|
|
103
|
+
Fill out the form below to sign up for {{ name: t('bookedit') }}
|
|
104
|
+
{/* TODO fix issue react router types
|
|
109
105
|
@ts-expect-error */}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
isLoading={isLoading}
|
|
119
|
-
setIsLoading={setIsLoading}
|
|
120
|
-
/>
|
|
121
|
-
|
|
122
|
-
<hr className='mb-2' />
|
|
123
|
-
</>
|
|
124
|
-
)}
|
|
125
|
-
|
|
126
|
-
<RegisterFormComponent
|
|
106
|
+
. Already signed up? Then just <Link to='/login'>Log in</Link>.
|
|
107
|
+
</Trans>
|
|
108
|
+
</h6>
|
|
109
|
+
|
|
110
|
+
<FormCard>
|
|
111
|
+
{showSocialLinks && (
|
|
112
|
+
<>
|
|
113
|
+
<SocialFormComponent
|
|
127
114
|
isLoading={isLoading}
|
|
128
115
|
setIsLoading={setIsLoading}
|
|
129
|
-
onSubmit={handleOnSubmit}
|
|
130
|
-
invitation={invite.invitation}
|
|
131
|
-
serverErrors={serverErrors}
|
|
132
116
|
/>
|
|
133
117
|
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
118
|
+
<hr className='mb-2' />
|
|
119
|
+
</>
|
|
120
|
+
)}
|
|
121
|
+
|
|
122
|
+
<RegisterFormComponent
|
|
123
|
+
isLoading={isLoading}
|
|
124
|
+
setIsLoading={setIsLoading}
|
|
125
|
+
onSubmit={handleOnSubmit}
|
|
126
|
+
invitation={invite.invitation}
|
|
127
|
+
serverErrors={serverErrors}
|
|
128
|
+
/>
|
|
129
|
+
|
|
130
|
+
<LoaderIndicator isLoaded={!isLoading} />
|
|
131
|
+
</FormCard>
|
|
132
|
+
</Col>
|
|
133
|
+
</Row>
|
|
140
134
|
)
|
|
141
135
|
}
|
|
142
136
|
|
|
@@ -6,11 +6,10 @@ import { ApiServiceError } from '@licklist/core/dist/Api/ApiService'
|
|
|
6
6
|
import RequestContext from '@licklist/plugins/dist/context/app/RequestContext'
|
|
7
7
|
import useUserApi from '@licklist/plugins/dist/hooks/Api/useUserApi'
|
|
8
8
|
import useNotification from '@licklist/plugins/dist/context/app/hooks/useNotification'
|
|
9
|
-
import RouteService from '@licklist/plugins/dist/services/Route/RouteService'
|
|
10
9
|
import { UserResetPasswordRequest } from '@licklist/plugins/dist/types/Request/UserResetPasswordRequest'
|
|
11
10
|
import { ROUTES } from '@licklist/core/dist/Config'
|
|
11
|
+
import { useNavigate } from 'react-router-dom'
|
|
12
12
|
import { ResetPasswordFormComponent } from './ResetPasswordFormComponent'
|
|
13
|
-
import { Router } from '../Router'
|
|
14
13
|
import FormCard from '../../static/FormCard'
|
|
15
14
|
import { LoaderIndicator } from '../../static/loader/LoaderIndicator'
|
|
16
15
|
|
|
@@ -18,6 +17,7 @@ function ResetPasswordComponent() {
|
|
|
18
17
|
const { t } = useTranslation(['Notification', 'User', 'App'])
|
|
19
18
|
const request = useContext(RequestContext)
|
|
20
19
|
const notification = useNotification()
|
|
20
|
+
const navigate = useNavigate()
|
|
21
21
|
|
|
22
22
|
const [isLoading, setIsLoading] = useState<boolean>(false)
|
|
23
23
|
|
|
@@ -45,29 +45,25 @@ function ResetPasswordComponent() {
|
|
|
45
45
|
message: t('Notification:passwordResetedSuccessfully'),
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
navigate(ROUTES.LOGIN_PAGE)
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
<>
|
|
56
|
-
<h1 className='text-center'>{t('User:resetPasswordTitle')}</h1>
|
|
52
|
+
<Row className='justify-content-center'>
|
|
53
|
+
<Col xs sm={12} md={7} lg={6} xl={5} className='align-self-center'>
|
|
54
|
+
<h1 className='text-center'>{t('User:resetPasswordTitle')}</h1>
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
<FormCard>
|
|
57
|
+
<ResetPasswordFormComponent
|
|
58
|
+
isLoading={isLoading}
|
|
59
|
+
setIsLoading={setIsLoading}
|
|
60
|
+
onSubmit={handleOnSubmit}
|
|
61
|
+
/>
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</Row>
|
|
70
|
-
</Router>
|
|
63
|
+
<LoaderIndicator isLoaded={!isLoading} />
|
|
64
|
+
</FormCard>
|
|
65
|
+
</Col>
|
|
66
|
+
</Row>
|
|
71
67
|
)
|
|
72
68
|
}
|
|
73
69
|
|
|
@@ -6,11 +6,10 @@ import useUser from '@licklist/plugins/dist/context/user/hooks/useUser'
|
|
|
6
6
|
import useQuery from '@licklist/plugins/dist/hooks/Query/useQuery'
|
|
7
7
|
import useSocialApi from '@licklist/plugins/dist/hooks/Api/useSocialApi'
|
|
8
8
|
import useUserApi from '@licklist/plugins/dist/hooks/Api/useUserApi'
|
|
9
|
-
import RouteService from '@licklist/plugins/dist/services/Route/RouteService'
|
|
10
9
|
import { IAuth } from '@licklist/plugins/dist/types/context/user/IAuth'
|
|
11
10
|
import { IUser } from '@licklist/plugins/dist/types/context/user/IUser'
|
|
12
11
|
import { useTranslation } from 'react-i18next'
|
|
13
|
-
import { useParams } from 'react-router-dom'
|
|
12
|
+
import { useNavigate, useParams } from 'react-router-dom'
|
|
14
13
|
import Row from 'react-bootstrap/Row'
|
|
15
14
|
import Col from 'react-bootstrap/Col'
|
|
16
15
|
import FormCard from '../../static/FormCard'
|
|
@@ -23,12 +22,13 @@ interface Params {
|
|
|
23
22
|
function SocialCallbackComponent() {
|
|
24
23
|
const { t } = useTranslation(['Notification'])
|
|
25
24
|
const [isProcessed, setIsProcessed] = useState<boolean>(false)
|
|
26
|
-
const { provider } = useParams<Params
|
|
25
|
+
const { provider } = useParams<Readonly<Params>>()
|
|
27
26
|
const query = useQuery()
|
|
28
27
|
const request = useContext(RequestContext)
|
|
29
28
|
const notification = useNotification()
|
|
30
29
|
const auth = useAuth()
|
|
31
30
|
const user = useUser()
|
|
31
|
+
const navigate = useNavigate()
|
|
32
32
|
|
|
33
33
|
const socialApiService = useSocialApi(request)
|
|
34
34
|
const userApiService = useUserApi(request)
|
|
@@ -78,7 +78,7 @@ function SocialCallbackComponent() {
|
|
|
78
78
|
})
|
|
79
79
|
|
|
80
80
|
// Redirect user in case of successful results
|
|
81
|
-
|
|
81
|
+
navigate('/')
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
const getSocialProvider = () => socialApiService.getSocialProvider(provider)
|
|
@@ -159,6 +159,10 @@ export function IntervalInput({
|
|
|
159
159
|
{formattedDuration && `lasts ${formattedDuration}`}
|
|
160
160
|
</Form.Text>
|
|
161
161
|
</Form.Group>
|
|
162
|
+
|
|
163
|
+
<Form.Control.Feedback type='invalid'>
|
|
164
|
+
{errors.end?.message}
|
|
165
|
+
</Form.Control.Feedback>
|
|
162
166
|
</Form.Row>
|
|
163
167
|
{start && (
|
|
164
168
|
<Form.Group controlId={recurrentId}>
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
Image,
|
|
8
8
|
} from '@licklist/core/dist/DataMapper/Media/ImageDataMapper'
|
|
9
9
|
import { useId } from '@react-aria/utils'
|
|
10
|
-
import { Accordion, Button, Form, Modal } from 'react-bootstrap'
|
|
10
|
+
import { Accordion, Badge, Button, Form, Modal } from 'react-bootstrap'
|
|
11
11
|
import { isEqual } from 'lodash'
|
|
12
12
|
import { FormProvider, useForm, Controller } from 'react-hook-form'
|
|
13
13
|
import { DateTime } from 'luxon'
|
|
@@ -50,6 +50,7 @@ export interface EditEventFormValues extends IntervalInputValues {
|
|
|
50
50
|
saleDeadline: number | null
|
|
51
51
|
integrationUrl: string | null
|
|
52
52
|
recurrenceEndAt?: string
|
|
53
|
+
duplicatedFromId?: number | null
|
|
53
54
|
editedProductSet?: ProductSetFormValues
|
|
54
55
|
}
|
|
55
56
|
|
|
@@ -71,6 +72,7 @@ export interface EditEventFormProps extends HasPermissionProp {
|
|
|
71
72
|
disabledRecurrent?: boolean
|
|
72
73
|
isCopyCreate?: boolean
|
|
73
74
|
isBooked?: boolean
|
|
75
|
+
duplicatedInfo?: string | null
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
const eventImageTypes = {
|
|
@@ -83,6 +85,7 @@ export const EditEventForm = ({
|
|
|
83
85
|
categories,
|
|
84
86
|
title,
|
|
85
87
|
hasPermission = true,
|
|
88
|
+
duplicatedInfo,
|
|
86
89
|
defaultEventValues,
|
|
87
90
|
serverErrors,
|
|
88
91
|
onSaveEvent,
|
|
@@ -218,9 +221,21 @@ export const EditEventForm = ({
|
|
|
218
221
|
onApprove={onApproveDialog}
|
|
219
222
|
onDecline={onDeclineDialog}
|
|
220
223
|
/>
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
+
{duplicatedInfo ? (
|
|
225
|
+
<div className='d-flex justify-content-between'>
|
|
226
|
+
<h5 className='edit-event-modal-title highlited-primary-title'>
|
|
227
|
+
{title}
|
|
228
|
+
</h5>
|
|
229
|
+
<Badge className='duplicate-badge' variant='success'>
|
|
230
|
+
{duplicatedInfo}
|
|
231
|
+
</Badge>
|
|
232
|
+
</div>
|
|
233
|
+
) : (
|
|
234
|
+
<h5 className='edit-event-modal-title highlited-primary-title'>
|
|
235
|
+
{title}
|
|
236
|
+
</h5>
|
|
237
|
+
)}
|
|
238
|
+
|
|
224
239
|
<FormProvider {...form}>
|
|
225
240
|
<Modal.Body
|
|
226
241
|
as='form'
|
|
@@ -69,16 +69,13 @@ export const Default: Story<EventCardProps> = () => {
|
|
|
69
69
|
console.log('onStatistic')
|
|
70
70
|
}}
|
|
71
71
|
titleId='titleId'
|
|
72
|
-
descriptionId='descriptionId'
|
|
73
72
|
/>
|
|
74
73
|
</div>
|
|
75
74
|
)
|
|
76
75
|
}
|
|
77
76
|
|
|
78
|
-
export const Skeleton: Story<EventCardProps> = () =>
|
|
79
|
-
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
)
|
|
84
|
-
}
|
|
77
|
+
export const Skeleton: Story<EventCardProps> = () => (
|
|
78
|
+
<div style={{ maxWidth: '34rem' }}>
|
|
79
|
+
<EventCardSkeleton />
|
|
80
|
+
</div>
|
|
81
|
+
)
|