ordering-ui-admin-external 1.5.1 → 1.6.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/_bundles/{ordering-ui-admin.743f7975ef6f607887b2.js → ordering-ui-admin.0fd83f227d29409cb170.js} +2 -2
- package/_bundles/{ordering-ui-admin.743f7975ef6f607887b2.js.LICENSE.txt → ordering-ui-admin.0fd83f227d29409cb170.js.LICENSE.txt} +1 -1
- package/_modules/components/Delivery/UserFormDetails/index.js +10 -3
- package/_modules/components/Login/LoginForm/index.js +4 -3
- package/_modules/components/Login/ResetPassword/index.js +251 -0
- package/_modules/components/Login/ResetPassword/styles.js +64 -0
- package/_modules/components/Login/index.js +8 -1
- package/_modules/components/Marketing/CampaignDetailContent/index.js +41 -5
- package/_modules/components/Marketing/CampaignDetailGeneral/index.js +2 -2
- package/_modules/components/Marketing/CampaignEmail/index.js +155 -12
- package/_modules/components/Marketing/CampaignEmail/styles.js +18 -4
- package/_modules/components/Marketing/CampaignHeader/index.js +11 -1
- package/_modules/components/Marketing/CampaignHeader/styles.js +25 -6
- package/_modules/components/Marketing/CampaignList/index.js +41 -25
- package/_modules/components/Marketing/CampaignNotification/index.js +14 -1
- package/_modules/components/Marketing/CampaignNotification/styles.js +7 -3
- package/_modules/components/Marketing/CampaignSMS/index.js +14 -1
- package/_modules/components/Marketing/CampaignSMS/styles.js +7 -3
- package/_modules/components/Marketing/CampaignWebHook/index.js +13 -1
- package/_modules/components/Marketing/CampaignWebHook/styles.js +7 -3
- package/_modules/components/MyProducts/BoxLayout/index.js +20 -0
- package/_modules/components/MyProducts/BoxLayout/styles.js +22 -0
- package/_modules/components/MyProducts/CustomerApp/index.js +48 -0
- package/_modules/components/MyProducts/CustomerApp/styles.js +25 -0
- package/_modules/components/MyProducts/DriverApp/index.js +69 -0
- package/_modules/components/MyProducts/DriverApp/styles.js +29 -0
- package/_modules/components/MyProducts/OrderingWebsite/index.js +40 -0
- package/_modules/components/MyProducts/OrderingWebsite/styles.js +29 -0
- package/_modules/components/MyProducts/StoreApp/index.js +69 -0
- package/_modules/components/MyProducts/StoreApp/styles.js +29 -0
- package/_modules/components/MyProducts/index.js +33 -0
- package/_modules/components/OrderingProducts/OrderingProductDetails/index.js +4 -4
- package/_modules/components/Orders/OrdersTable/index.js +8 -9
- package/_modules/components/Profile/ProfilePage/index.js +70 -0
- package/_modules/components/Profile/ProfilePage/styles.js +22 -0
- package/_modules/components/Profile/index.js +12 -0
- package/_modules/components/Settings/InsertLink/index.js +3 -2
- package/_modules/components/Settings/PluginList/index.js +31 -1
- package/_modules/components/Shared/ColumnAllowSettingPopover/index.js +4 -3
- package/_modules/components/SidebarMenu/index.js +82 -55
- package/_modules/components/SidebarMenu/styles.js +3 -1
- package/_modules/components/Stores/BusinessLocation/index.js +1 -1
- package/_modules/components/Stores/BusinessProductAddForm/index.js +4 -4
- package/_modules/components/Stores/BusinessProductsListing/index.js +7 -0
- package/_modules/components/Stores/BusinessWebhooks/index.js +2 -2
- package/_modules/components/Stores/PaymentOption/index.js +23 -4
- package/_modules/components/Stores/PaymentOptionMethods/index.js +23 -4
- package/_modules/components/Stores/PaymentOptionPaypal/index.js +23 -4
- package/_modules/components/Stores/PaymentOptionStripeDirect/index.js +23 -4
- package/_modules/components/Stores/PaymethodOptionPaypalExpress/index.js +23 -4
- package/_modules/components/Stores/PaymethodOptionStripeConnect/index.js +23 -4
- package/_modules/components/Stores/PaymethodOptionStripeRedirect/index.js +23 -4
- package/_modules/components/Users/CustomerDetails/index.js +8 -10
- package/_modules/components/Users/CustomersListing/index.js +4 -2
- package/_modules/components/Users/OccupationSelector/index.js +48 -0
- package/_modules/components/Users/OccupationSelector/styles.js +16 -0
- package/_modules/components/Users/OccupationsFilter/index.js +49 -0
- package/_modules/components/Users/OccupationsFilter/styles.js +22 -0
- package/_modules/components/Users/ProfessionalDetail/index.js +47 -8
- package/_modules/components/Users/ProfessionalDetail/styles.js +10 -5
- package/_modules/components/Users/ProfessionalList/index.js +43 -6
- package/_modules/components/Users/ProfessionalList/styles.js +5 -3
- package/_modules/components/Users/ProfessionalListing/index.js +14 -3
- package/_modules/components/Users/ProfessionalSchedule/styles.js +1 -1
- package/_modules/components/Users/UserDetails/index.js +11 -13
- package/_modules/components/Users/UserFormDetails/index.js +8 -1
- package/_modules/components/Users/UserTypeSelector/index.js +7 -0
- package/_modules/components/Users/UsersList/index.js +40 -5
- package/_modules/components/Users/UsersList/styles.js +7 -5
- package/_modules/components/Users/UsersListing/index.js +4 -2
- package/_modules/contexts/ThemeContext/index.js +1 -1
- package/_modules/index.js +38 -0
- package/index-template.js +22 -4
- package/package.json +2 -2
- package/src/components/Delivery/UserFormDetails/index.js +8 -10
- package/src/components/Login/LoginForm/index.js +23 -20
- package/src/components/Login/ResetPassword/index.js +283 -0
- package/src/components/Login/ResetPassword/styles.js +215 -0
- package/src/components/Login/index.js +3 -1
- package/src/components/Marketing/CampaignDetail/index.js +0 -1
- package/src/components/Marketing/CampaignDetailContent/index.js +54 -24
- package/src/components/Marketing/CampaignDetailGeneral/index.js +1 -1
- package/src/components/Marketing/CampaignEmail/index.js +152 -15
- package/src/components/Marketing/CampaignEmail/styles.js +64 -3
- package/src/components/Marketing/CampaignHeader/index.js +19 -3
- package/src/components/Marketing/CampaignHeader/styles.js +77 -0
- package/src/components/Marketing/CampaignList/index.js +75 -65
- package/src/components/Marketing/CampaignNotification/index.js +11 -3
- package/src/components/Marketing/CampaignNotification/styles.js +13 -0
- package/src/components/Marketing/CampaignSMS/index.js +11 -2
- package/src/components/Marketing/CampaignSMS/styles.js +13 -0
- package/src/components/Marketing/CampaignWebHook/index.js +11 -2
- package/src/components/Marketing/CampaignWebHook/styles.js +13 -0
- package/src/components/MyProducts/BoxLayout/index.js +25 -0
- package/src/components/MyProducts/BoxLayout/styles.js +78 -0
- package/src/components/MyProducts/CustomerApp/index.js +52 -0
- package/src/components/MyProducts/CustomerApp/styles.js +59 -0
- package/src/components/MyProducts/DriverApp/index.js +83 -0
- package/src/components/MyProducts/DriverApp/styles.js +104 -0
- package/src/components/MyProducts/OrderingWebsite/index.js +41 -0
- package/src/components/MyProducts/OrderingWebsite/styles.js +104 -0
- package/src/components/MyProducts/StoreApp/index.js +83 -0
- package/src/components/MyProducts/StoreApp/styles.js +104 -0
- package/src/components/MyProducts/index.js +11 -0
- package/src/components/OrderingProducts/OrderingProductDetails/index.js +1 -1
- package/src/components/Orders/OrdersTable/index.js +3 -6
- package/src/components/Profile/ProfilePage/index.js +81 -0
- package/src/components/Profile/ProfilePage/styles.js +64 -0
- package/src/components/Profile/index.js +5 -0
- package/src/components/Settings/InsertLink/index.js +6 -2
- package/src/components/Settings/PluginList/index.js +2 -2
- package/src/components/Shared/ColumnAllowSettingPopover/index.js +11 -7
- package/src/components/SidebarMenu/index.js +120 -58
- package/src/components/SidebarMenu/styles.js +7 -0
- package/src/components/Stores/BusinessLocation/index.js +1 -1
- package/src/components/Stores/BusinessProductAddForm/index.js +2 -2
- package/src/components/Stores/BusinessProductsListing/index.js +8 -0
- package/src/components/Stores/BusinessWebhooks/index.js +2 -2
- package/src/components/Stores/PaymentOption/index.js +12 -2
- package/src/components/Stores/PaymentOptionMethods/index.js +12 -2
- package/src/components/Stores/PaymentOptionPaypal/index.js +12 -2
- package/src/components/Stores/PaymentOptionStripeDirect/index.js +12 -2
- package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +12 -2
- package/src/components/Stores/PaymethodOptionStripeConnect/index.js +12 -2
- package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +12 -2
- package/src/components/Users/CustomerDetails/index.js +1 -1
- package/src/components/Users/CustomersListing/index.js +3 -1
- package/src/components/Users/OccupationSelector/index.js +37 -0
- package/src/components/Users/OccupationSelector/styles.js +18 -0
- package/src/components/Users/OccupationsFilter/index.js +50 -0
- package/src/components/Users/OccupationsFilter/styles.js +32 -0
- package/src/components/Users/ProfessionalDetail/index.js +42 -7
- package/src/components/Users/ProfessionalDetail/styles.js +16 -2
- package/src/components/Users/ProfessionalList/index.js +41 -3
- package/src/components/Users/ProfessionalList/styles.js +5 -0
- package/src/components/Users/ProfessionalListing/index.js +14 -1
- package/src/components/Users/ProfessionalSchedule/styles.js +1 -0
- package/src/components/Users/UserDetails/index.js +1 -1
- package/src/components/Users/UserFormDetails/index.js +11 -2
- package/src/components/Users/UserTypeSelector/index.js +6 -0
- package/src/components/Users/UsersList/index.js +44 -8
- package/src/components/Users/UsersList/styles.js +7 -2
- package/src/components/Users/UsersListing/index.js +4 -2
- package/src/contexts/ThemeContext/index.js +4 -0
- package/src/index.js +17 -1
- package/template/app.js +55 -3
- package/template/assets/images/myProducts/customer-app.png +0 -0
- package/template/assets/images/myProducts/driver-app.png +0 -0
- package/template/assets/images/myProducts/ordering-website.png +0 -0
- package/template/assets/images/myProducts/store-app.png +0 -0
- package/template/components/ListenPageChanges/index.js +7 -1
- package/template/config.json +2 -1
- package/template/helmetdata.json +49 -0
- package/template/pages/CustomerApp/index.js +12 -0
- package/template/pages/DriverApp/index.js +12 -0
- package/template/pages/Login/index.js +7 -1
- package/template/pages/OrderingWebsite/index.js +12 -0
- package/template/pages/Professionals/index.js +2 -1
- package/template/pages/Profile/index.js +12 -0
- package/template/pages/ResetPassword/index.js +42 -0
- package/template/pages/StoreApp/index.js +12 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import React, { useRef, useEffect, useState, useContext } from 'react'
|
|
2
|
+
import { ConfigFileContext } from '../../../contexts/ConfigFileContext'
|
|
3
|
+
|
|
4
|
+
import { useForm } from 'react-hook-form'
|
|
5
|
+
import RiLockPasswordLine from '@meronex/icons/ri/RiLockPasswordLine'
|
|
6
|
+
import MdExitToApp from '@meronex/icons/md/MdExitToApp'
|
|
7
|
+
|
|
8
|
+
import { Alert } from '../../Shared'
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
useLanguage,
|
|
12
|
+
ResetPassword as ResetPasswordController
|
|
13
|
+
} from 'ordering-components-admin-external'
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
ResetPasswordContainer,
|
|
17
|
+
FormSide,
|
|
18
|
+
FormInput,
|
|
19
|
+
TitleFormSide,
|
|
20
|
+
HeroContainer,
|
|
21
|
+
InputWithIcon,
|
|
22
|
+
RedirectLink
|
|
23
|
+
} from './styles'
|
|
24
|
+
|
|
25
|
+
import { Input } from '../../../styles/Inputs'
|
|
26
|
+
import { Button } from '../../../styles/Buttons'
|
|
27
|
+
import { useTheme } from 'styled-components'
|
|
28
|
+
|
|
29
|
+
const ResetPasswordUI = (props) => {
|
|
30
|
+
const {
|
|
31
|
+
code,
|
|
32
|
+
random,
|
|
33
|
+
project,
|
|
34
|
+
formState,
|
|
35
|
+
resetPasswordData,
|
|
36
|
+
handleResetPassword,
|
|
37
|
+
handleChangeInput,
|
|
38
|
+
redirectResetPassword,
|
|
39
|
+
onPasswordReset,
|
|
40
|
+
isSuccessfulReset,
|
|
41
|
+
elementLinkToLogin
|
|
42
|
+
} = props
|
|
43
|
+
|
|
44
|
+
const { handleSubmit, register, errors, watch, reset } = useForm()
|
|
45
|
+
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
46
|
+
const [configFile, setConfigFile] = useContext(ConfigFileContext)
|
|
47
|
+
|
|
48
|
+
const [, t] = useLanguage()
|
|
49
|
+
const theme = useTheme()
|
|
50
|
+
|
|
51
|
+
const password = useRef({})
|
|
52
|
+
|
|
53
|
+
password.current = watch('password', '')
|
|
54
|
+
|
|
55
|
+
const onSubmit = () => {
|
|
56
|
+
if (code && random) {
|
|
57
|
+
handleResetPassword()
|
|
58
|
+
} else {
|
|
59
|
+
redirectResetPassword && redirectResetPassword(resetPasswordData)
|
|
60
|
+
reset({ project: '', password: '' });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const closeAlert = () => {
|
|
65
|
+
setAlertState({
|
|
66
|
+
open: false,
|
|
67
|
+
content: []
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let timeout = null
|
|
72
|
+
const handleChangeProject = (e) => {
|
|
73
|
+
e.persist()
|
|
74
|
+
clearTimeout(timeout)
|
|
75
|
+
timeout = setTimeout(function () {
|
|
76
|
+
setConfigFile({ ...configFile, project: e.target.value })
|
|
77
|
+
}, 750)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (!formState.loading && formState.result?.error) {
|
|
82
|
+
setAlertState({
|
|
83
|
+
open: true,
|
|
84
|
+
content: formState.result?.result || [t('ERROR', 'Error')]
|
|
85
|
+
})
|
|
86
|
+
} else if (!formState.loading && formState.result?.result?.length) {
|
|
87
|
+
setAlertState({
|
|
88
|
+
open: true,
|
|
89
|
+
content: formState.result?.result === 'OK' ? t('PASSWORD_RESET_SUCCESS', 'Password changed successfully') : t(formState.result?.result, 'Password changed successfully')
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
}, [formState])
|
|
93
|
+
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (Object.keys(errors).length > 0) {
|
|
96
|
+
setAlertState({
|
|
97
|
+
open: true,
|
|
98
|
+
content: Object.values(errors).map(error => error.message)
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
}, [errors])
|
|
102
|
+
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
if (project) {
|
|
105
|
+
setConfigFile({ ...configFile, project: project })
|
|
106
|
+
}
|
|
107
|
+
return () => closeAlert()
|
|
108
|
+
}, [])
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<>
|
|
112
|
+
{props.beforeElements?.map((BeforeElement, i) => (
|
|
113
|
+
<React.Fragment key={i}>
|
|
114
|
+
{BeforeElement}
|
|
115
|
+
</React.Fragment>))}
|
|
116
|
+
{props.beforeComponents?.map((BeforeComponent, i) => (
|
|
117
|
+
<BeforeComponent key={i} {...props} />))}
|
|
118
|
+
<ResetPasswordContainer>
|
|
119
|
+
<HeroContainer bgimage={theme.images?.general?.loginHero}>
|
|
120
|
+
<img src={theme?.images?.logos?.logotypeInvert} alt='Logo login' />
|
|
121
|
+
</HeroContainer>
|
|
122
|
+
{code && random ? (
|
|
123
|
+
<FormSide>
|
|
124
|
+
<TitleFormSide>
|
|
125
|
+
<h1>{t('TITLE_RESET_PASSWORD', 'Reset password')}</h1>
|
|
126
|
+
<p>{t('SUBTITLE_RESET_PASSWORD', 'Reset your password')}</p>
|
|
127
|
+
</TitleFormSide>
|
|
128
|
+
<FormInput
|
|
129
|
+
noValidate
|
|
130
|
+
onSubmit={handleSubmit(onSubmit)}
|
|
131
|
+
>
|
|
132
|
+
{ !project && (
|
|
133
|
+
<InputWithIcon>
|
|
134
|
+
<Input
|
|
135
|
+
type='text'
|
|
136
|
+
name='project'
|
|
137
|
+
aria-label='project'
|
|
138
|
+
spellcheck='false'
|
|
139
|
+
ref={register({
|
|
140
|
+
required: t(
|
|
141
|
+
'VALIDATION_ERROR_REQUIRED',
|
|
142
|
+
'Project is required'
|
|
143
|
+
).replace('_attribute_', t('PROJECT', 'Project')),
|
|
144
|
+
minLength: {
|
|
145
|
+
message: t('VALIDATION_ERROR_PASSWORD_MIN_STRING', 'The Password must be at least 8 characters.').replace('_attribute_', t('PASSWORD', 'Password')).replace('_min_', 8)
|
|
146
|
+
}
|
|
147
|
+
})}
|
|
148
|
+
placeholder={t('PROJECT', 'Project')}
|
|
149
|
+
onChange={(e) => handleChangeProject(e)}
|
|
150
|
+
autoComplete="new-password"
|
|
151
|
+
autoCapitalize='off'
|
|
152
|
+
/>
|
|
153
|
+
<MdExitToApp />
|
|
154
|
+
</InputWithIcon>
|
|
155
|
+
)}
|
|
156
|
+
<InputWithIcon>
|
|
157
|
+
<Input
|
|
158
|
+
type='password'
|
|
159
|
+
name='password'
|
|
160
|
+
aria-label='password'
|
|
161
|
+
spellcheck='false'
|
|
162
|
+
ref={register({
|
|
163
|
+
required: t('VALIDATION_ERROR_PASSWORD_REQUIRED', 'The field password is required'),
|
|
164
|
+
minLength: {
|
|
165
|
+
value: 8,
|
|
166
|
+
message: t('VALIDATION_ERROR_PASSWORD_MIN_STRING', 'The Password must be at least 8 characters.').replace('_attribute_', t('PASSWORD', 'Password')).replace('_min_', 8)
|
|
167
|
+
}
|
|
168
|
+
})}
|
|
169
|
+
placeholder={t('NEW_PASSWORD', 'New passowrd')}
|
|
170
|
+
onChange={handleChangeInput}
|
|
171
|
+
autoComplete="new-password"
|
|
172
|
+
/>
|
|
173
|
+
<RiLockPasswordLine />
|
|
174
|
+
</InputWithIcon>
|
|
175
|
+
<InputWithIcon>
|
|
176
|
+
<Input
|
|
177
|
+
type='password'
|
|
178
|
+
name='confirm-password'
|
|
179
|
+
aria-label='confirm-password'
|
|
180
|
+
spellcheck='false'
|
|
181
|
+
ref={register({
|
|
182
|
+
required: t('VALIDATION_ERROR_PASSWORD_CONFIRM_REQUIRED', 'The field password confirm is required'),
|
|
183
|
+
validate: value =>
|
|
184
|
+
value === password.current || t('VALIDATION_ERROR_PASSWORDS_MATCH', 'The passwords do not match')
|
|
185
|
+
})}
|
|
186
|
+
placeholder={t('CONFIRM_PASSWORD', 'Confirm Password')}
|
|
187
|
+
onChange={handleChangeInput}
|
|
188
|
+
autoComplete="new-password"
|
|
189
|
+
/>
|
|
190
|
+
<RiLockPasswordLine />
|
|
191
|
+
</InputWithIcon>
|
|
192
|
+
<Button
|
|
193
|
+
type='submit'
|
|
194
|
+
color={(formState.loading) ? 'secondary' : 'primary'}
|
|
195
|
+
disabled={(formState.loading)}
|
|
196
|
+
>
|
|
197
|
+
{!formState.loading ? t('CHANGE_PASSWORD', 'Change password') : t('LOADING', 'Loading')}
|
|
198
|
+
</Button>
|
|
199
|
+
{elementLinkToLogin && (
|
|
200
|
+
<RedirectLink register>
|
|
201
|
+
<span>{t('SIGN_IN_MESSAGE', 'Do you want to sign in?')}</span>
|
|
202
|
+
{elementLinkToLogin}
|
|
203
|
+
</RedirectLink>
|
|
204
|
+
)}
|
|
205
|
+
</FormInput>
|
|
206
|
+
</FormSide>
|
|
207
|
+
) : (
|
|
208
|
+
<FormSide>
|
|
209
|
+
<TitleFormSide>
|
|
210
|
+
<h1>{t('TITLE_RESET_PASSWORD', 'Reset password')}</h1>
|
|
211
|
+
<p>{t('RESET_PASSWORD_CODES_TITLE', 'Please insert the codes')}</p>
|
|
212
|
+
</TitleFormSide>
|
|
213
|
+
<FormInput
|
|
214
|
+
noValidate
|
|
215
|
+
onSubmit={handleSubmit(onSubmit)}
|
|
216
|
+
>
|
|
217
|
+
{!code && (
|
|
218
|
+
<InputWithIcon>
|
|
219
|
+
<Input
|
|
220
|
+
name='code'
|
|
221
|
+
aria-label='code'
|
|
222
|
+
ref={register({
|
|
223
|
+
required: t('RESET_PASSWORD_CODE_REQUIRED', 'The field code is required')
|
|
224
|
+
})}
|
|
225
|
+
placeholder={t('CODE', 'Code')}
|
|
226
|
+
onChange={handleChangeInput}
|
|
227
|
+
autoComplete='off'
|
|
228
|
+
/>
|
|
229
|
+
<MdExitToApp />
|
|
230
|
+
</InputWithIcon>
|
|
231
|
+
)}
|
|
232
|
+
{!random && (
|
|
233
|
+
<InputWithIcon>
|
|
234
|
+
<Input
|
|
235
|
+
name='random'
|
|
236
|
+
aria-label='random'
|
|
237
|
+
ref={register({
|
|
238
|
+
required: t('RESET_PASSWORD_RANDOM_REQUIRED', 'The field random is required')
|
|
239
|
+
})}
|
|
240
|
+
placeholder={t('RAMDON', 'Random')}
|
|
241
|
+
onChange={handleChangeInput}
|
|
242
|
+
autoComplete='off'
|
|
243
|
+
/>
|
|
244
|
+
<MdExitToApp />
|
|
245
|
+
</InputWithIcon>
|
|
246
|
+
)}
|
|
247
|
+
<Button
|
|
248
|
+
type='submit'
|
|
249
|
+
color='primary'
|
|
250
|
+
>
|
|
251
|
+
{t('SUBMIT_CODES', 'Submit codes')}
|
|
252
|
+
</Button>
|
|
253
|
+
</FormInput>
|
|
254
|
+
</FormSide>
|
|
255
|
+
)}
|
|
256
|
+
<Alert
|
|
257
|
+
title={t('RESET_PASSWORD', 'Reset Password')}
|
|
258
|
+
content={alertState?.content}
|
|
259
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
260
|
+
open={alertState.open}
|
|
261
|
+
onClose={() => closeAlert()}
|
|
262
|
+
onAccept={() => isSuccessfulReset ? onPasswordReset() : closeAlert()}
|
|
263
|
+
closeOnBackdrop={false}
|
|
264
|
+
/>
|
|
265
|
+
</ResetPasswordContainer>
|
|
266
|
+
{props.afterComponents?.map((AfterComponent, i) => (
|
|
267
|
+
<AfterComponent key={i} {...props} />))}
|
|
268
|
+
{props.afterElements?.map((AfterElement, i) => (
|
|
269
|
+
<React.Fragment key={i}>
|
|
270
|
+
{AfterElement}
|
|
271
|
+
</React.Fragment>))}
|
|
272
|
+
</>
|
|
273
|
+
)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export const ResetPassword = (props) => {
|
|
277
|
+
const resetPasswordProps = {
|
|
278
|
+
...props,
|
|
279
|
+
UIComponent: ResetPasswordUI
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return <ResetPasswordController {...resetPasswordProps} />
|
|
283
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import styled, { css } from 'styled-components'
|
|
3
|
+
|
|
4
|
+
export const ResetPasswordContainer = styled.div`
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
min-height: ${({ isPopup }) => isPopup ? '500px' : '100vh'};
|
|
10
|
+
|
|
11
|
+
@media (min-width: 768px) {
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
}
|
|
14
|
+
`
|
|
15
|
+
const Side = styled.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
width: 100%;
|
|
18
|
+
`
|
|
19
|
+
export const HeroSide = styled(Side)`
|
|
20
|
+
display: none;
|
|
21
|
+
|
|
22
|
+
${({ bgimage }) => bgimage && css`
|
|
23
|
+
background-repeat: no-repeat, repeat;
|
|
24
|
+
background-size: cover;
|
|
25
|
+
object-fit: cover;
|
|
26
|
+
background-position: center;
|
|
27
|
+
`}
|
|
28
|
+
|
|
29
|
+
@media (min-width: 992px) {
|
|
30
|
+
width: 50%;
|
|
31
|
+
text-align: center;
|
|
32
|
+
display: block;
|
|
33
|
+
img {
|
|
34
|
+
width: 35%;
|
|
35
|
+
margin-top: 10%;
|
|
36
|
+
margin-left: -80px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`
|
|
40
|
+
|
|
41
|
+
export const HeroContainer = (props) => {
|
|
42
|
+
const style = {}
|
|
43
|
+
style.backgroundImage = `linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url(${props.bgimage})`
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<HeroSide {...props} style={style}>
|
|
47
|
+
{props.children}
|
|
48
|
+
</HeroSide>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const TitleFormSide = styled.div`
|
|
53
|
+
color: #fff;
|
|
54
|
+
|
|
55
|
+
h1 {
|
|
56
|
+
text-transform: uppercase;
|
|
57
|
+
font-size: 24px;
|
|
58
|
+
margin: 0px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
p {
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
margin-top: 0px;
|
|
64
|
+
margin-bottom: 40px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@media (min-width: 425px) {
|
|
68
|
+
h1 {
|
|
69
|
+
font-size: 24px;
|
|
70
|
+
}
|
|
71
|
+
p {
|
|
72
|
+
font-size: 16px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@media (min-width: 769px) {
|
|
77
|
+
h1 {
|
|
78
|
+
font-size: 32px;
|
|
79
|
+
}
|
|
80
|
+
p {
|
|
81
|
+
font-size: 16px;
|
|
82
|
+
margin-bottom: 60px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`
|
|
86
|
+
|
|
87
|
+
export const FormSide = styled(Side)`
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
background-color: #1C202E;
|
|
91
|
+
padding: 0 8%;
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
height: 100vh;
|
|
94
|
+
|
|
95
|
+
@media (min-width: 769px) {
|
|
96
|
+
height: auto;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@media (min-width: 992px) {
|
|
100
|
+
margin-left: -80px;
|
|
101
|
+
border-radius: 54px 0px 0px 54px;
|
|
102
|
+
width: calc(50% + 80px);
|
|
103
|
+
}
|
|
104
|
+
`
|
|
105
|
+
|
|
106
|
+
export const FormInput = styled.form`
|
|
107
|
+
width: ${({ isPopup }) => isPopup ? '90%' : '100%'};
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
|
|
111
|
+
* {
|
|
112
|
+
padding: 8px 0px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
input:not(:last-child) {
|
|
116
|
+
margin-top: 15px;
|
|
117
|
+
margin-bottom: 15px;
|
|
118
|
+
padding-left: 60px;
|
|
119
|
+
padding-top: 12px;
|
|
120
|
+
padding-bottom: 12px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
button {
|
|
124
|
+
position: relative;
|
|
125
|
+
margin-top: 40px;
|
|
126
|
+
padding: 9px 5px;
|
|
127
|
+
|
|
128
|
+
svg {
|
|
129
|
+
position: absolute;
|
|
130
|
+
right: 35px;
|
|
131
|
+
top: 8px;
|
|
132
|
+
font-size: 24px;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
`
|
|
136
|
+
export const InputWithIcon = styled.div`
|
|
137
|
+
position: relative;
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
|
|
141
|
+
input {
|
|
142
|
+
width: 100%;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
img {
|
|
146
|
+
position: absolute;
|
|
147
|
+
width: 20px;
|
|
148
|
+
padding: 0px;
|
|
149
|
+
margin: 0 20px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
svg {
|
|
153
|
+
position: absolute;
|
|
154
|
+
font-size: 24px;
|
|
155
|
+
color: #707070;
|
|
156
|
+
padding: 0px;
|
|
157
|
+
margin: 0 20px;
|
|
158
|
+
}
|
|
159
|
+
`
|
|
160
|
+
export const RedirectLink = styled.div`
|
|
161
|
+
padding: 10px;
|
|
162
|
+
display: flex;
|
|
163
|
+
justify-content: center;
|
|
164
|
+
align-items: center;
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
margin-top: 10px;
|
|
167
|
+
font-size: 17px;
|
|
168
|
+
|
|
169
|
+
span {
|
|
170
|
+
color: #FFF;
|
|
171
|
+
margin-right: 5px;
|
|
172
|
+
|
|
173
|
+
${props => props.theme?.rtl && css`
|
|
174
|
+
margin-left: 5px;
|
|
175
|
+
margin-right: 0px;
|
|
176
|
+
`}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
a {
|
|
180
|
+
color: ${props => props.theme.colors.primary};
|
|
181
|
+
text-decoration: none;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
* {
|
|
185
|
+
margin: 0px;
|
|
186
|
+
padding: 0px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
${({ register }) => register && css`
|
|
190
|
+
width: calc(90% - 20px);
|
|
191
|
+
|
|
192
|
+
@media (min-width: 481px) {
|
|
193
|
+
width: ${({ isPopup }) => isPopup ? 'calc(90% - 20px)' : 'calc(80% - 20px)'};
|
|
194
|
+
}
|
|
195
|
+
`}
|
|
196
|
+
|
|
197
|
+
@media (min-width: 425px) {
|
|
198
|
+
flex-direction: row;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@media (min-width: 768px) {
|
|
202
|
+
font-size: 14px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@media (min-width: 992px) {
|
|
206
|
+
font-size: ${({ isPopup }) => isPopup ? '13px' : '18px'};
|
|
207
|
+
flex-direction: row;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@media (min-width: 1200px) {
|
|
211
|
+
${({ isPopup }) => isPopup && css`
|
|
212
|
+
font-size: 16px;
|
|
213
|
+
`};
|
|
214
|
+
}
|
|
215
|
+
`
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ForgotPasswordForm } from './ForgotPasswordForm'
|
|
2
2
|
import { LoginForm } from './LoginForm'
|
|
3
3
|
import { QueryLogin } from './QueryLogin'
|
|
4
|
+
import { ResetPassword } from './ResetPassword'
|
|
4
5
|
|
|
5
6
|
export {
|
|
6
7
|
ForgotPasswordForm,
|
|
7
8
|
LoginForm,
|
|
8
|
-
QueryLogin
|
|
9
|
+
QueryLogin,
|
|
10
|
+
ResetPassword
|
|
9
11
|
}
|
|
@@ -7,6 +7,7 @@ import { CampaignWhatsapp } from '../CampaignWhatsapp'
|
|
|
7
7
|
import { CampaignNotification } from '../CampaignNotification'
|
|
8
8
|
import { CampaignPopup } from '../CampaignPopup'
|
|
9
9
|
import { CampaignWebHook } from '../CampaignWebHook'
|
|
10
|
+
import { Alert } from '../../Shared'
|
|
10
11
|
|
|
11
12
|
import {
|
|
12
13
|
Container,
|
|
@@ -17,12 +18,14 @@ import {
|
|
|
17
18
|
const CampaignDetailContentUI = (props) => {
|
|
18
19
|
const {
|
|
19
20
|
handleChangeType,
|
|
20
|
-
contactState
|
|
21
|
+
contactState,
|
|
22
|
+
isAddMode
|
|
21
23
|
} = props
|
|
22
24
|
|
|
23
25
|
const [, t] = useLanguage()
|
|
24
26
|
const [typeOptions, setTypeOptions] = useState(null)
|
|
25
27
|
const [contactTypeSearchVal, setContactTypeSearchVal] = useState('')
|
|
28
|
+
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
26
29
|
|
|
27
30
|
const typeList = [
|
|
28
31
|
{ value: 'email', content: <Option>{t('EMAIL', 'Email')}</Option> },
|
|
@@ -33,36 +36,63 @@ const CampaignDetailContentUI = (props) => {
|
|
|
33
36
|
// { value: 'whatsapp', content: <Option>{t('WHATSAPP', 'Whatsapp')}</Option> }
|
|
34
37
|
]
|
|
35
38
|
|
|
39
|
+
const closeAlert = () => {
|
|
40
|
+
setAlertState({
|
|
41
|
+
open: false,
|
|
42
|
+
content: []
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
|
|
36
46
|
useEffect(() => {
|
|
37
47
|
const options = typeList.filter(option => option?.value.toLocaleLowerCase().includes(contactTypeSearchVal.toLocaleLowerCase()))
|
|
38
48
|
setTypeOptions(options)
|
|
39
49
|
}, [contactTypeSearchVal])
|
|
40
50
|
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (!contactState?.error || contactState.loading) return
|
|
53
|
+
setAlertState({
|
|
54
|
+
open: true,
|
|
55
|
+
content: contactState?.error
|
|
56
|
+
})
|
|
57
|
+
}, [contactState?.error])
|
|
58
|
+
|
|
41
59
|
return (
|
|
42
|
-
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
<>
|
|
61
|
+
<Container>
|
|
62
|
+
<SelectWrapper>
|
|
63
|
+
<label>{t('CONTACT_TYPE', 'Contact type')}</label>
|
|
64
|
+
<Select
|
|
65
|
+
options={typeOptions}
|
|
66
|
+
className='select'
|
|
67
|
+
defaultValue={contactState?.changes?.contact_type || ''}
|
|
68
|
+
placeholder={t('SELECT_OPTION', 'Select an option')}
|
|
69
|
+
onChange={(value) => handleChangeType('contact_type', value)}
|
|
70
|
+
// isShowSearchBar
|
|
71
|
+
searchBarIsCustomLayout
|
|
72
|
+
searchBarIsNotLazyLoad
|
|
73
|
+
isDisabled={!isAddMode}
|
|
74
|
+
searchValue={contactTypeSearchVal}
|
|
75
|
+
handleChangeSearch={(val) => setContactTypeSearchVal(val)}
|
|
76
|
+
/>
|
|
77
|
+
</SelectWrapper>
|
|
58
78
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
79
|
+
{contactState?.changes?.contact_type === 'email' && <CampaignEmail {...props} />}
|
|
80
|
+
{contactState?.changes?.contact_type === 'sms' && <CampaignSMS {...props} />}
|
|
81
|
+
{contactState?.changes?.contact_type === 'whatsapp' && <CampaignWhatsapp {...props} />}
|
|
82
|
+
{contactState?.changes?.contact_type === 'notification' && <CampaignNotification {...props} />}
|
|
83
|
+
{contactState?.changes?.contact_type === 'popup' && <CampaignPopup {...props} />}
|
|
84
|
+
{contactState?.changes?.contact_type === 'webhook' && <CampaignWebHook {...props} />}
|
|
85
|
+
</Container>
|
|
86
|
+
<Alert
|
|
87
|
+
title={t('CAMPAIGN', 'Campaign')}
|
|
88
|
+
content={alertState.content}
|
|
89
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
90
|
+
open={alertState.open}
|
|
91
|
+
onClose={() => closeAlert()}
|
|
92
|
+
onAccept={() => closeAlert()}
|
|
93
|
+
closeOnBackdrop={false}
|
|
94
|
+
/>
|
|
95
|
+
</>
|
|
66
96
|
)
|
|
67
97
|
}
|
|
68
98
|
|
|
@@ -283,7 +283,7 @@ export const CampaignDetailGeneral = (props) => {
|
|
|
283
283
|
{!audienceState?.loading && !audienceState?.error && (
|
|
284
284
|
<p>
|
|
285
285
|
<span>{t('REACHING', 'Reaching')}: </span>
|
|
286
|
-
{audienceState?.
|
|
286
|
+
{audienceState?.pagination?.total || 0} {t('PEOPLE', 'People')}
|
|
287
287
|
</p>
|
|
288
288
|
)}
|
|
289
289
|
<CheckBoxListWrapper>
|