ordering-ui-admin-external 1.5.1 → 1.6.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/_bundles/{ordering-ui-admin.743f7975ef6f607887b2.js → ordering-ui-admin.47d189a0568d6b5734d5.js} +2 -2
- package/_bundles/{ordering-ui-admin.743f7975ef6f607887b2.js.LICENSE.txt → ordering-ui-admin.47d189a0568d6b5734d5.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/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/Shared/ColumnAllowSettingPopover/index.js +4 -3
- package/_modules/components/SidebarMenu/index.js +65 -29
- package/_modules/components/SidebarMenu/styles.js +3 -1
- package/_modules/components/Stores/BusinessLocation/index.js +1 -1
- 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/Shared/ColumnAllowSettingPopover/index.js +11 -7
- package/src/components/SidebarMenu/index.js +103 -41
- package/src/components/SidebarMenu/styles.js +7 -0
- package/src/components/Stores/BusinessLocation/index.js +1 -1
- 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
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import Skeleton from 'react-loading-skeleton'
|
|
3
3
|
import { useLanguage, useUtils } from 'ordering-components-admin-external'
|
|
4
|
-
import MdCheckBoxOutlineBlank from '@meronex/icons/md/MdCheckBoxOutlineBlank'
|
|
5
|
-
import MdCheckBox from '@meronex/icons/md/MdCheckBox'
|
|
6
4
|
import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
|
|
7
5
|
|
|
8
|
-
import { Envelope, Phone } from 'react-bootstrap-icons'
|
|
6
|
+
import { Envelope, Phone, CheckSquareFill, Square } from 'react-bootstrap-icons'
|
|
9
7
|
import { Switch } from '../../../styles'
|
|
10
8
|
import { ConfirmAdmin, Pagination } from '../../Shared'
|
|
11
9
|
|
|
@@ -24,7 +22,8 @@ import {
|
|
|
24
22
|
AddNewUserButton,
|
|
25
23
|
UsersBottomContainer,
|
|
26
24
|
VerifiedItemsContainer,
|
|
27
|
-
VerifiedItem
|
|
25
|
+
VerifiedItem,
|
|
26
|
+
AllCheckWrapper
|
|
28
27
|
} from './styles'
|
|
29
28
|
|
|
30
29
|
export const UsersList = (props) => {
|
|
@@ -37,13 +36,15 @@ export const UsersList = (props) => {
|
|
|
37
36
|
selectedUsers,
|
|
38
37
|
handleSelectedUsers,
|
|
39
38
|
handleOpenUserDetails,
|
|
40
|
-
handleOpenUserAddForm
|
|
39
|
+
handleOpenUserAddForm,
|
|
40
|
+
setSelectedUsers
|
|
41
41
|
} = props
|
|
42
42
|
|
|
43
43
|
const [, t] = useLanguage()
|
|
44
44
|
const [{ optimizeImage }] = useUtils()
|
|
45
45
|
|
|
46
46
|
const [confirmAdmin, setConfirmAdmin] = useState({ open: false, handleOnConfirm: null })
|
|
47
|
+
const [isAllChecked, setIsAllChecked] = useState(false)
|
|
47
48
|
|
|
48
49
|
const getUserType = (type) => {
|
|
49
50
|
const userTypes = [
|
|
@@ -87,6 +88,26 @@ export const UsersList = (props) => {
|
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
|
91
|
+
const handleSelecteAllUser = () => {
|
|
92
|
+
const userIds = usersList.users?.reduce((ids, user) => [...ids, user.id], [])
|
|
93
|
+
if (!isAllChecked) {
|
|
94
|
+
setSelectedUsers([...selectedUsers, ...userIds])
|
|
95
|
+
} else {
|
|
96
|
+
const userIdsToDeleteSet = new Set(userIds)
|
|
97
|
+
const updatedSelectedOrderIds = selectedUsers.filter((name) => {
|
|
98
|
+
return !userIdsToDeleteSet.has(name)
|
|
99
|
+
})
|
|
100
|
+
setSelectedUsers(updatedSelectedOrderIds)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (usersList.loading) return
|
|
106
|
+
const userIds = usersList.users?.reduce((ids, user) => [...ids, user.id], [])
|
|
107
|
+
const _isAllChecked = userIds.every(elem => selectedUsers.includes(elem))
|
|
108
|
+
setIsAllChecked(_isAllChecked)
|
|
109
|
+
}, [usersList.users, selectedUsers])
|
|
110
|
+
|
|
90
111
|
useEffect(() => {
|
|
91
112
|
if (usersList.loading || usersList.users.length > 0 || paginationProps.totalPages <= 1) return
|
|
92
113
|
if (paginationProps.currentPage !== paginationProps.totalPages) {
|
|
@@ -103,7 +124,22 @@ export const UsersList = (props) => {
|
|
|
103
124
|
<UsersTable>
|
|
104
125
|
<thead>
|
|
105
126
|
<tr>
|
|
106
|
-
<th>
|
|
127
|
+
<th>
|
|
128
|
+
<AllCheckWrapper>
|
|
129
|
+
<CheckBoxWrapper
|
|
130
|
+
className='all-checkbox'
|
|
131
|
+
isChecked={!usersList?.loading && isAllChecked}
|
|
132
|
+
onClick={() => handleSelecteAllUser()}
|
|
133
|
+
>
|
|
134
|
+
{(!usersList?.loading && isAllChecked) ? (
|
|
135
|
+
<CheckSquareFill />
|
|
136
|
+
) : (
|
|
137
|
+
<Square />
|
|
138
|
+
)}
|
|
139
|
+
</CheckBoxWrapper>
|
|
140
|
+
{t('USER', 'User')}
|
|
141
|
+
</AllCheckWrapper>
|
|
142
|
+
</th>
|
|
107
143
|
<th>{t('PHONE', 'Phone')}</th>
|
|
108
144
|
<th>{t('TYPE', 'Type')}</th>
|
|
109
145
|
<th className='amout-orders '>{t('AMOUNT_OF_ORDERS', 'Amount of orders')}</th>
|
|
@@ -159,9 +195,9 @@ export const UsersList = (props) => {
|
|
|
159
195
|
onClick={() => handleSelectedUsers(user.id)}
|
|
160
196
|
>
|
|
161
197
|
{selectedUsers.includes(user.id) ? (
|
|
162
|
-
<
|
|
198
|
+
<CheckSquareFill />
|
|
163
199
|
) : (
|
|
164
|
-
<
|
|
200
|
+
<Square />
|
|
165
201
|
)}
|
|
166
202
|
</CheckBoxWrapper>
|
|
167
203
|
<WrapperImage>
|
|
@@ -136,7 +136,7 @@ export const CheckBoxWrapper = styled.div`
|
|
|
136
136
|
margin-right: 10px;
|
|
137
137
|
`}
|
|
138
138
|
svg {
|
|
139
|
-
font-size:
|
|
139
|
+
font-size: 16px;
|
|
140
140
|
color: #B1BCCC;
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -144,7 +144,7 @@ export const CheckBoxWrapper = styled.div`
|
|
|
144
144
|
svg {
|
|
145
145
|
color: ${props => props.theme.colors?.primary};
|
|
146
146
|
}
|
|
147
|
-
`}
|
|
147
|
+
`}
|
|
148
148
|
`
|
|
149
149
|
|
|
150
150
|
export const InfoBlock = styled.div`
|
|
@@ -249,3 +249,8 @@ export const VerifiedItemsContainer = styled.div`
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
`
|
|
252
|
+
|
|
253
|
+
export const AllCheckWrapper = styled.div`
|
|
254
|
+
display: flex;
|
|
255
|
+
align-items: center;
|
|
256
|
+
`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useLocation } from 'react-router-dom'
|
|
3
|
-
import { UsersList as UsersListController
|
|
3
|
+
import { useLanguage, UsersList as UsersListController } from 'ordering-components-admin-external'
|
|
4
4
|
import { UsersList } from '../UsersList'
|
|
5
5
|
import { UsersListingHeader } from '../UsersListingHeader'
|
|
6
6
|
import { UserTypeFilter } from '../UserTypeFilter'
|
|
@@ -42,7 +42,8 @@ const UsersListingUI = (props) => {
|
|
|
42
42
|
onUserRedirect,
|
|
43
43
|
handleSuccessUpdate,
|
|
44
44
|
handleSuccessAddUser,
|
|
45
|
-
handleSuccessDeleteUser
|
|
45
|
+
handleSuccessDeleteUser,
|
|
46
|
+
setSelectedUsers
|
|
46
47
|
} = props
|
|
47
48
|
|
|
48
49
|
const [, t] = useLanguage()
|
|
@@ -139,6 +140,7 @@ const UsersListingUI = (props) => {
|
|
|
139
140
|
userDetailsId={openUser?.id || queryId}
|
|
140
141
|
handleOpenUserDetails={handleOpenUserDetails}
|
|
141
142
|
handleOpenUserAddForm={handleOpenUserAddForm}
|
|
143
|
+
setSelectedUsers={setSelectedUsers}
|
|
142
144
|
/>
|
|
143
145
|
</UsersListingContainer>
|
|
144
146
|
|
package/src/index.js
CHANGED
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
GoogleGpsButton
|
|
140
140
|
} from './components/Delivery'
|
|
141
141
|
import { HomePage } from './components/Home'
|
|
142
|
-
import { LoginForm, ForgotPasswordForm, QueryLogin } from './components/Login'
|
|
142
|
+
import { LoginForm, ForgotPasswordForm, QueryLogin, ResetPassword } from './components/Login'
|
|
143
143
|
import {
|
|
144
144
|
EnterprisePromotionListing,
|
|
145
145
|
CampaignListing,
|
|
@@ -337,12 +337,20 @@ import {
|
|
|
337
337
|
PointsWalletBusinessDetail,
|
|
338
338
|
PointsWalletBusinessList
|
|
339
339
|
} from './components/Loyalty'
|
|
340
|
+
import {
|
|
341
|
+
OrderingWebsite,
|
|
342
|
+
CustomerApp,
|
|
343
|
+
StoreApp,
|
|
344
|
+
DriverApp
|
|
345
|
+
} from './components/MyProducts'
|
|
340
346
|
import { OpenCartListing, RecoveryActionListing } from './components/CartRecovery'
|
|
341
347
|
import { FreeProductsList, PurchasedProductsList } from './components/Downloads'
|
|
342
348
|
|
|
343
349
|
import { Layout } from './components/Layout'
|
|
344
350
|
import { SidebarMenu } from './components/SidebarMenu'
|
|
345
351
|
import { NotNetworkConnectivity } from './components/NotNetworkConnectivity'
|
|
352
|
+
import { ProfilePage } from './components/Profile'
|
|
353
|
+
|
|
346
354
|
import {
|
|
347
355
|
Alert,
|
|
348
356
|
SpinnerLoader,
|
|
@@ -524,6 +532,7 @@ export {
|
|
|
524
532
|
HomePage,
|
|
525
533
|
LoginForm,
|
|
526
534
|
QueryLogin,
|
|
535
|
+
ResetPassword,
|
|
527
536
|
|
|
528
537
|
EnterprisePromotionListing,
|
|
529
538
|
CampaignListing,
|
|
@@ -728,9 +737,16 @@ export {
|
|
|
728
737
|
FreeProductsList,
|
|
729
738
|
PurchasedProductsList,
|
|
730
739
|
|
|
740
|
+
OrderingWebsite,
|
|
741
|
+
CustomerApp,
|
|
742
|
+
StoreApp,
|
|
743
|
+
DriverApp,
|
|
744
|
+
|
|
731
745
|
Layout,
|
|
732
746
|
SidebarMenu,
|
|
733
747
|
NotNetworkConnectivity,
|
|
748
|
+
ProfilePage,
|
|
749
|
+
|
|
734
750
|
Alert,
|
|
735
751
|
SpinnerLoader,
|
|
736
752
|
Modal,
|
package/template/app.js
CHANGED
|
@@ -48,6 +48,12 @@ import { Support } from './pages/Support'
|
|
|
48
48
|
import { AdvancedReports } from './pages/AdvancedReports'
|
|
49
49
|
import { EnterprisePromotionList } from './pages/EnterprisePromotionList'
|
|
50
50
|
import { Appointments } from './pages/Appointments'
|
|
51
|
+
// import { GiftCardsList } from './pages/GiftCardsList'
|
|
52
|
+
import { ResetPassword } from './pages/ResetPassword'
|
|
53
|
+
import { OrderingWebsite } from './pages/OrderingWebsite'
|
|
54
|
+
import { CustomerApp } from './pages/CustomerApp'
|
|
55
|
+
import { StoreApp } from './pages/StoreApp'
|
|
56
|
+
import { DriverApp } from './pages/DriverApp'
|
|
51
57
|
|
|
52
58
|
import { ScrollToTop } from './components/ScrollToTop'
|
|
53
59
|
import { ListenPageChanges } from './components/ListenPageChanges'
|
|
@@ -62,6 +68,7 @@ import { PurchasedProductsList } from './pages/PurchasedProductsList'
|
|
|
62
68
|
import { Professionals } from './pages/Professionals'
|
|
63
69
|
import { QueryLogin } from '../src/components/Login'
|
|
64
70
|
import { PluginSettings } from './pages/PluginSettings'
|
|
71
|
+
import { Profile } from './pages/Profile'
|
|
65
72
|
|
|
66
73
|
export const App = () => {
|
|
67
74
|
const [{ auth, loading, user }] = useSession()
|
|
@@ -131,7 +138,9 @@ export const App = () => {
|
|
|
131
138
|
<Route exact path='/'>
|
|
132
139
|
{
|
|
133
140
|
auth
|
|
134
|
-
? user?.level !== 5
|
|
141
|
+
? (user?.level !== 5 && user?.level !== 8)
|
|
142
|
+
? <Redirect to='/home' />
|
|
143
|
+
: user?.level === 8 ? <Redirect to='/profile' /> : <Redirect to='/orders' />
|
|
135
144
|
: (queryProject && queryToken)
|
|
136
145
|
? <QueryLogin project={queryProject} token={queryToken} />
|
|
137
146
|
: <Redirect to='/login' />
|
|
@@ -163,10 +172,33 @@ export const App = () => {
|
|
|
163
172
|
: <Redirect to='/home' />
|
|
164
173
|
}
|
|
165
174
|
</Route>
|
|
175
|
+
|
|
176
|
+
<Route exact path='/password/reset'>
|
|
177
|
+
{auth ? (
|
|
178
|
+
<Redirect to='/' />
|
|
179
|
+
) : (
|
|
180
|
+
<ResetPassword
|
|
181
|
+
elementLinkToLogin={<Link to='/login'>{t('LOGIN', 'Login')}</Link>}
|
|
182
|
+
/>
|
|
183
|
+
)}
|
|
184
|
+
</Route>
|
|
185
|
+
|
|
186
|
+
<Route exact path='/reset_password'>
|
|
187
|
+
{auth ? (
|
|
188
|
+
<Redirect to='/' />
|
|
189
|
+
) : (
|
|
190
|
+
<ResetPassword
|
|
191
|
+
elementLinkToLogin={<Link to='/login'>{t('LOGIN', 'Login')}</Link>}
|
|
192
|
+
/>
|
|
193
|
+
)}
|
|
194
|
+
</Route>
|
|
195
|
+
|
|
166
196
|
<Route exact path='/home'>
|
|
167
197
|
{
|
|
168
198
|
auth
|
|
169
|
-
? user?.level !== 5
|
|
199
|
+
? (user?.level !== 5 && user?.level !== 8)
|
|
200
|
+
? <Home />
|
|
201
|
+
: user?.level === 8 ? <Redirect to='/profile' /> : <Redirect to='/orders' />
|
|
170
202
|
: <Redirect to='/login' />
|
|
171
203
|
}
|
|
172
204
|
</Route>
|
|
@@ -180,7 +212,7 @@ export const App = () => {
|
|
|
180
212
|
<ProtectedRoute path='/drivers' allowedLevels={[0, 5]}>
|
|
181
213
|
<DriversList />
|
|
182
214
|
</ProtectedRoute>
|
|
183
|
-
<ProtectedRoute path='/appointments' allowedLevels={[0]}>
|
|
215
|
+
<ProtectedRoute path='/appointments' allowedLevels={[0, 2]}>
|
|
184
216
|
<Appointments />
|
|
185
217
|
</ProtectedRoute>
|
|
186
218
|
|
|
@@ -258,6 +290,22 @@ export const App = () => {
|
|
|
258
290
|
<RecoveryActionListing />
|
|
259
291
|
</ProtectedRoute>
|
|
260
292
|
|
|
293
|
+
<ProtectedRoute path='/my-products/ordering-website' allowedLevels={[0]}>
|
|
294
|
+
<OrderingWebsite />
|
|
295
|
+
</ProtectedRoute>
|
|
296
|
+
|
|
297
|
+
<ProtectedRoute path='/my-products/customer-app' allowedLevels={[0]}>
|
|
298
|
+
<CustomerApp />
|
|
299
|
+
</ProtectedRoute>
|
|
300
|
+
|
|
301
|
+
<ProtectedRoute path='/my-products/store-app' allowedLevels={[0]}>
|
|
302
|
+
<StoreApp />
|
|
303
|
+
</ProtectedRoute>
|
|
304
|
+
|
|
305
|
+
<ProtectedRoute path='/my-products/driver-app' allowedLevels={[0]}>
|
|
306
|
+
<DriverApp />
|
|
307
|
+
</ProtectedRoute>
|
|
308
|
+
|
|
261
309
|
<ProtectedRoute path='/settings/basic' allowedLevels={[0]}>
|
|
262
310
|
<BasicSettings />
|
|
263
311
|
</ProtectedRoute>
|
|
@@ -294,6 +342,10 @@ export const App = () => {
|
|
|
294
342
|
<OrderingProducts />
|
|
295
343
|
</ProtectedRoute>
|
|
296
344
|
|
|
345
|
+
<ProtectedRoute path='/profile' allowedLevels={[0, 2, 5, 8]}>
|
|
346
|
+
<Profile />
|
|
347
|
+
</ProtectedRoute>
|
|
348
|
+
|
|
297
349
|
<Route path='*'>
|
|
298
350
|
<PageNotFound />
|
|
299
351
|
</Route>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -38,6 +38,10 @@ export const ListenPageChanges = ({ children }) => {
|
|
|
38
38
|
reports: '/intelligence/reports',
|
|
39
39
|
open_carts: '/cart-recovery/open-carts',
|
|
40
40
|
recovery_actions: '/cart-recovery/recovery-actions',
|
|
41
|
+
ordering_website: '/my-products/ordering-website',
|
|
42
|
+
customer_app: '/my-products/customer-app',
|
|
43
|
+
store_app: '/my-products/store-app',
|
|
44
|
+
driver_app: '/my-products/driver-app',
|
|
41
45
|
delivery_drivers: '/delivery/drivers-list',
|
|
42
46
|
drivers_managers: '/delivery/drivers-managers',
|
|
43
47
|
drivers_companies: '/delivery/drivers-companies',
|
|
@@ -48,7 +52,9 @@ export const ListenPageChanges = ({ children }) => {
|
|
|
48
52
|
support: '/support',
|
|
49
53
|
rewards_programs: '/loyalty/rewards-programs',
|
|
50
54
|
free_products: '/downloads/free-products',
|
|
51
|
-
purchased_products: '/downloads/purchased-products'
|
|
55
|
+
purchased_products: '/downloads/purchased-products',
|
|
56
|
+
reset_password: '/password/reset',
|
|
57
|
+
profile: '/profile'
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
const handleGoToPage = ({ page, params = {}, search, replace = false }) => {
|
package/template/config.json
CHANGED
package/template/helmetdata.json
CHANGED
|
@@ -237,6 +237,34 @@
|
|
|
237
237
|
"robots": "index, follow",
|
|
238
238
|
"canonicalUrl": ""
|
|
239
239
|
},
|
|
240
|
+
"ordering_website": {
|
|
241
|
+
"title": "Ordering Website",
|
|
242
|
+
"description": "a dummy description about this page",
|
|
243
|
+
"keywords": "test, dummy, data",
|
|
244
|
+
"robots": "index, follow",
|
|
245
|
+
"canonicalUrl": ""
|
|
246
|
+
},
|
|
247
|
+
"customer_app": {
|
|
248
|
+
"title": "Customer App",
|
|
249
|
+
"description": "a dummy description about this page",
|
|
250
|
+
"keywords": "test, dummy, data",
|
|
251
|
+
"robots": "index, follow",
|
|
252
|
+
"canonicalUrl": ""
|
|
253
|
+
},
|
|
254
|
+
"store_app": {
|
|
255
|
+
"title": "Store App",
|
|
256
|
+
"description": "a dummy description about this page",
|
|
257
|
+
"keywords": "test, dummy, data",
|
|
258
|
+
"robots": "index, follow",
|
|
259
|
+
"canonicalUrl": ""
|
|
260
|
+
},
|
|
261
|
+
"driver_app": {
|
|
262
|
+
"title": "Driver App",
|
|
263
|
+
"description": "a dummy description about this page",
|
|
264
|
+
"keywords": "test, dummy, data",
|
|
265
|
+
"robots": "index, follow",
|
|
266
|
+
"canonicalUrl": ""
|
|
267
|
+
},
|
|
240
268
|
"support": {
|
|
241
269
|
"title": "Support",
|
|
242
270
|
"description": "a dummy description about this page",
|
|
@@ -285,5 +313,26 @@
|
|
|
285
313
|
"keywords": "test, dummy, data",
|
|
286
314
|
"robots": "index, follow",
|
|
287
315
|
"canonicalUrl": ""
|
|
316
|
+
},
|
|
317
|
+
"gift_cards": {
|
|
318
|
+
"title": "Gift Cards",
|
|
319
|
+
"description": "a dummy description about this page",
|
|
320
|
+
"keywords": "test, dummy, data",
|
|
321
|
+
"robots": "index, follow",
|
|
322
|
+
"canonicalUrl": ""
|
|
323
|
+
},
|
|
324
|
+
"reset_password": {
|
|
325
|
+
"title": "Reset Password",
|
|
326
|
+
"description": "a dummy description about this page",
|
|
327
|
+
"keywords": "test, dummy, data",
|
|
328
|
+
"robots": "index, follow",
|
|
329
|
+
"canonicalUrl": ""
|
|
330
|
+
},
|
|
331
|
+
"profile": {
|
|
332
|
+
"title": "Profile",
|
|
333
|
+
"description": "a dummy description about this page",
|
|
334
|
+
"keywords": "test, dummy, data",
|
|
335
|
+
"robots": "index, follow",
|
|
336
|
+
"canonicalUrl": ""
|
|
288
337
|
}
|
|
289
338
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { HelmetTags } from '../../components/HelmetTags'
|
|
3
|
+
import { CustomerApp as CustomerAppController } from '../../../src/components/MyProducts'
|
|
4
|
+
|
|
5
|
+
export const CustomerApp = (props) => {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<HelmetTags page='customer_app' />
|
|
9
|
+
<CustomerAppController {...props} />
|
|
10
|
+
</>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { HelmetTags } from '../../components/HelmetTags'
|
|
3
|
+
import { DriverApp as DriverAppController } from '../../../src/components/MyProducts'
|
|
4
|
+
|
|
5
|
+
export const DriverApp = (props) => {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<HelmetTags page='driver_app' />
|
|
9
|
+
<DriverAppController {...props} />
|
|
10
|
+
</>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { LoginForm } from '../../../src/components/Login'
|
|
3
3
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
4
|
+
import settings from '../../config.json'
|
|
4
5
|
|
|
5
6
|
export const Login = (props) => {
|
|
7
|
+
const loginProps = {
|
|
8
|
+
...props,
|
|
9
|
+
billingUrl: settings?.billing_url,
|
|
10
|
+
useProjectDomain: settings?.use_project_domain
|
|
11
|
+
}
|
|
6
12
|
return (
|
|
7
13
|
<>
|
|
8
14
|
<HelmetTags page='login' />
|
|
9
|
-
<LoginForm {...
|
|
15
|
+
<LoginForm {...loginProps} />
|
|
10
16
|
</>
|
|
11
17
|
)
|
|
12
18
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { HelmetTags } from '../../components/HelmetTags'
|
|
3
|
+
import { OrderingWebsite as OrderingWebsiteController } from '../../../src/components/MyProducts'
|
|
4
|
+
|
|
5
|
+
export const OrderingWebsite = (props) => {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<HelmetTags page='ordering_website' />
|
|
9
|
+
<OrderingWebsiteController {...props} />
|
|
10
|
+
</>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -8,6 +8,7 @@ export const Professionals = (props) => {
|
|
|
8
8
|
const [events] = useEvent()
|
|
9
9
|
const professionalProps = {
|
|
10
10
|
...props,
|
|
11
|
+
isProfessional: true,
|
|
11
12
|
headerTitle: t('PROFESSIONALS', 'Professionals'),
|
|
12
13
|
defaultUserTypesSelected: [8],
|
|
13
14
|
propsToFetch: [
|
|
@@ -15,7 +16,7 @@ export const Professionals = (props) => {
|
|
|
15
16
|
'country_phone_code', 'city_id', 'city', 'address', 'addresses', 'max_days_in_future',
|
|
16
17
|
'address_notes', 'dropdown_option_id', 'dropdown_option', 'location',
|
|
17
18
|
'zipcode', 'level', 'enabled', 'middle_name', 'second_lastname', 'birthdate', 'drivergroups',
|
|
18
|
-
'phone_verified', 'email_verified', 'wallets'
|
|
19
|
+
'phone_verified', 'email_verified', 'wallets', 'occupation_id', 'session', 'session_strategy'
|
|
19
20
|
],
|
|
20
21
|
onUserRedirect: (userId) => {
|
|
21
22
|
if (!userId) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { HelmetTags } from '../../components/HelmetTags'
|
|
3
|
+
import { ProfilePage as ProfileController } from '../../../src/components/Profile'
|
|
4
|
+
|
|
5
|
+
export const Profile = (props) => {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<HelmetTags page='profile' />
|
|
9
|
+
<ProfileController {...props} />
|
|
10
|
+
</>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useLocation } from 'react-router-dom'
|
|
3
|
+
import { useEvent } from 'ordering-components-admin-external'
|
|
4
|
+
import { HelmetTags } from '../../components/HelmetTags'
|
|
5
|
+
import { ResetPassword as ResetPasswordController } from '../../../src/components/Login/ResetPassword'
|
|
6
|
+
|
|
7
|
+
export const ResetPassword = (props) => {
|
|
8
|
+
const [events] = useEvent()
|
|
9
|
+
const {search} = useLocation()
|
|
10
|
+
let code, random, project
|
|
11
|
+
|
|
12
|
+
if (search) {
|
|
13
|
+
const data = search.substring(1).split('&')
|
|
14
|
+
code = data[0]
|
|
15
|
+
random = data[1]
|
|
16
|
+
project = data[2]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const codeString = code && code.split('=')[1]
|
|
20
|
+
const randomString = random && random.split('=')[1]
|
|
21
|
+
const projectString = project && project.split('=')[1]
|
|
22
|
+
|
|
23
|
+
const resetPasswordProps = {
|
|
24
|
+
...props,
|
|
25
|
+
code: codeString,
|
|
26
|
+
random: randomString,
|
|
27
|
+
project: projectString,
|
|
28
|
+
redirectResetPassword: ({ code, random }) => {
|
|
29
|
+
events.emit('go_to_page', {
|
|
30
|
+
page: 'reset_password',
|
|
31
|
+
search: `?code=${code}&random=${random}`
|
|
32
|
+
})
|
|
33
|
+
},
|
|
34
|
+
onPasswordReset: () => (events.emit('go_to_page', { page: 'login' }))
|
|
35
|
+
}
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
<HelmetTags page='reset_password' />
|
|
39
|
+
<ResetPasswordController {...resetPasswordProps} />
|
|
40
|
+
</>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { HelmetTags } from '../../components/HelmetTags'
|
|
3
|
+
import { StoreApp as StoreAppController } from '../../../src/components/MyProducts'
|
|
4
|
+
|
|
5
|
+
export const StoreApp = (props) => {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<HelmetTags page='store_app' />
|
|
9
|
+
<StoreAppController {...props} />
|
|
10
|
+
</>
|
|
11
|
+
)
|
|
12
|
+
}
|