ordering-ui-admin-external 1.7.0 → 1.7.2
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.f6cdf30b6e7d2ac03d1b.js → ordering-ui-admin.bc627e82affd5d083888.js} +2 -2
- package/_bundles/{ordering-ui-admin.f6cdf30b6e7d2ac03d1b.js.LICENSE.txt → ordering-ui-admin.bc627e82affd5d083888.js.LICENSE.txt} +0 -0
- package/_modules/components/BusinessIntelligence/AnalyticsBusinessFilter/index.js +7 -18
- package/_modules/components/BusinessIntelligence/AnalyticsBusinessFilter/styles.js +5 -1
- package/_modules/components/BusinessIntelligence/AnalyticsCalendar/index.js +1 -0
- package/_modules/components/BusinessIntelligence/AnalyticsDriverOrders/index.js +9 -4
- package/_modules/components/BusinessIntelligence/AnalyticsDriverOrders/styles.js +3 -1
- package/_modules/components/BusinessIntelligence/AnalyticsDriversFilter/styles.js +6 -2
- package/_modules/components/BusinessIntelligence/AnalyticsFilterTimeZone/styles.js +9 -3
- package/_modules/components/BusinessIntelligence/AnalyticsOrdersAcceptSpend/styles.js +3 -1
- package/_modules/components/BusinessIntelligence/AnalyticsOrdersOrSales/index.js +5 -3
- package/_modules/components/BusinessIntelligence/AnalyticsOrdersOrSales/styles.js +3 -1
- package/_modules/components/BusinessIntelligence/AnalyticsOrdersStatus/styles.js +3 -1
- package/_modules/components/BusinessIntelligence/BusinessAnalytics/index.js +27 -3
- package/_modules/components/BusinessIntelligence/BusinessAnalytics/styles.js +6 -4
- package/_modules/components/BusinessIntelligence/CountryFilter/index.js +134 -0
- package/_modules/components/BusinessIntelligence/CountryFilter/styles.js +30 -0
- package/_modules/components/BusinessIntelligence/DriverAnalytics/index.js +27 -3
- package/_modules/components/BusinessIntelligence/DriverAnalytics/styles.js +3 -3
- package/_modules/components/BusinessIntelligence/InvoiceGeneral/styles.js +5 -1
- package/_modules/components/BusinessIntelligence/ReportsAppIdFilter/styles.js +3 -1
- package/_modules/components/BusinessIntelligence/ReportsBrandFilter/index.js +7 -18
- package/_modules/components/BusinessIntelligence/ReportsBrandFilter/styles.js +5 -1
- package/_modules/components/BusinessIntelligence/ReportsBusinessDistance/index.js +25 -4
- package/_modules/components/BusinessIntelligence/ReportsBusinessSpend/index.js +22 -1
- package/_modules/components/BusinessIntelligence/ReportsDriverDistance/index.js +29 -8
- package/_modules/components/BusinessIntelligence/ReportsDriverFilter/styles.js +3 -1
- package/_modules/components/BusinessIntelligence/ReportsDriverGroupFilter/styles.js +3 -1
- package/_modules/components/BusinessIntelligence/ReportsDriverOrder/index.js +22 -1
- package/_modules/components/BusinessIntelligence/ReportsDriverOrderTime/index.js +22 -1
- package/_modules/components/BusinessIntelligence/ReportsDriverSpend/index.js +22 -1
- package/_modules/components/BusinessIntelligence/ReportsGeneralSales/index.js +22 -1
- package/_modules/components/BusinessIntelligence/ReportsHeatMap/index.js +37 -16
- package/_modules/components/BusinessIntelligence/ReportsOrderDistance/index.js +25 -4
- package/_modules/components/BusinessIntelligence/ReportsOrderStatus/index.js +29 -8
- package/_modules/components/BusinessIntelligence/ReportsOrderTypeFilter/styles.js +3 -1
- package/_modules/components/BusinessIntelligence/ReportsOrders/index.js +26 -5
- package/_modules/components/BusinessIntelligence/ReportsOrders/styles.js +3 -1
- package/_modules/components/BusinessIntelligence/ReportsSaleAndCategory/index.js +22 -1
- package/_modules/components/BusinessIntelligence/ReportsSales/index.js +22 -1
- package/_modules/components/BusinessIntelligence/ReportsSales/styles.js +3 -1
- package/_modules/components/BusinessIntelligence/SettingItemUI/styles.js +6 -2
- package/_modules/components/CartRecovery/OpenCartList/styles.js +10 -7
- package/_modules/components/CartRecovery/OpenCartListing/styles.js +3 -1
- package/_modules/components/CartRecovery/RecoveryActionDetail/styles.js +3 -1
- package/_modules/components/Settings/IntegrationListing/index.js +12 -1
- package/_modules/components/Settings/LalamoveConnect/index.js +176 -0
- package/_modules/components/Settings/LalamoveConnect/styles.js +111 -0
- package/_modules/components/Settings/index.js +7 -0
- package/index-template.js +3 -1
- package/package.json +2 -2
- package/src/components/BusinessIntelligence/AnalyticsBusinessFilter/index.js +7 -17
- package/src/components/BusinessIntelligence/AnalyticsBusinessFilter/styles.js +3 -3
- package/src/components/BusinessIntelligence/AnalyticsCalendar/index.js +1 -1
- package/src/components/BusinessIntelligence/AnalyticsDriverOrders/index.js +11 -3
- package/src/components/BusinessIntelligence/AnalyticsDriverOrders/styles.js +1 -1
- package/src/components/BusinessIntelligence/AnalyticsDriversFilter/styles.js +2 -2
- package/src/components/BusinessIntelligence/AnalyticsFilterTimeZone/styles.js +5 -8
- package/src/components/BusinessIntelligence/AnalyticsOrdersAcceptSpend/styles.js +1 -1
- package/src/components/BusinessIntelligence/AnalyticsOrdersOrSales/index.js +6 -2
- package/src/components/BusinessIntelligence/AnalyticsOrdersOrSales/styles.js +1 -1
- package/src/components/BusinessIntelligence/AnalyticsOrdersStatus/styles.js +1 -1
- package/src/components/BusinessIntelligence/BusinessAnalytics/index.js +23 -1
- package/src/components/BusinessIntelligence/BusinessAnalytics/styles.js +26 -7
- package/src/components/BusinessIntelligence/CountryFilter/index.js +128 -0
- package/src/components/BusinessIntelligence/CountryFilter/styles.js +65 -0
- package/src/components/BusinessIntelligence/DriverAnalytics/index.js +23 -1
- package/src/components/BusinessIntelligence/DriverAnalytics/styles.js +14 -7
- package/src/components/BusinessIntelligence/InvoiceGeneral/styles.js +2 -2
- package/src/components/BusinessIntelligence/ReportsAppIdFilter/styles.js +1 -1
- package/src/components/BusinessIntelligence/ReportsBrandFilter/index.js +7 -17
- package/src/components/BusinessIntelligence/ReportsBrandFilter/styles.js +3 -3
- package/src/components/BusinessIntelligence/ReportsBusinessDistance/index.js +19 -0
- package/src/components/BusinessIntelligence/ReportsBusinessSpend/index.js +20 -0
- package/src/components/BusinessIntelligence/ReportsDriverDistance/index.js +19 -0
- package/src/components/BusinessIntelligence/ReportsDriverFilter/styles.js +1 -1
- package/src/components/BusinessIntelligence/ReportsDriverGroupFilter/styles.js +1 -1
- package/src/components/BusinessIntelligence/ReportsDriverOrder/index.js +19 -0
- package/src/components/BusinessIntelligence/ReportsDriverOrderTime/index.js +19 -0
- package/src/components/BusinessIntelligence/ReportsDriverSpend/index.js +19 -0
- package/src/components/BusinessIntelligence/ReportsGeneralSales/index.js +19 -1
- package/src/components/BusinessIntelligence/ReportsHeatMap/index.js +19 -0
- package/src/components/BusinessIntelligence/ReportsOrderDistance/index.js +19 -0
- package/src/components/BusinessIntelligence/ReportsOrderStatus/index.js +19 -0
- package/src/components/BusinessIntelligence/ReportsOrderTypeFilter/styles.js +1 -1
- package/src/components/BusinessIntelligence/ReportsOrders/index.js +22 -3
- package/src/components/BusinessIntelligence/ReportsOrders/styles.js +1 -1
- package/src/components/BusinessIntelligence/ReportsSaleAndCategory/index.js +19 -0
- package/src/components/BusinessIntelligence/ReportsSales/index.js +19 -0
- package/src/components/BusinessIntelligence/ReportsSales/styles.js +1 -1
- package/src/components/BusinessIntelligence/SettingItemUI/styles.js +2 -2
- package/src/components/CartRecovery/OpenCartList/styles.js +1 -1
- package/src/components/CartRecovery/OpenCartListing/styles.js +1 -1
- package/src/components/CartRecovery/RecoveryActionDetail/styles.js +1 -1
- package/src/components/Settings/IntegrationListing/index.js +18 -0
- package/src/components/Settings/LalamoveConnect/index.js +222 -0
- package/src/components/Settings/LalamoveConnect/styles.js +330 -0
- package/src/components/Settings/index.js +2 -0
- package/template/assets/images/lala-move.png +0 -0
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
MapWrraper
|
|
29
29
|
} from './styles'
|
|
30
30
|
import { ReportsBrandFilter } from '../ReportsBrandFilter'
|
|
31
|
+
import { CountryFilter } from '../CountryFilter'
|
|
31
32
|
|
|
32
33
|
const BusinessAnalyticsUI = (props) => {
|
|
33
34
|
const {
|
|
@@ -42,7 +43,8 @@ const BusinessAnalyticsUI = (props) => {
|
|
|
42
43
|
customerSatisfactionList,
|
|
43
44
|
ordersAcceptSpendList,
|
|
44
45
|
arrivedPickUpSpendList,
|
|
45
|
-
orderLocationList
|
|
46
|
+
orderLocationList,
|
|
47
|
+
countryCode
|
|
46
48
|
} = props
|
|
47
49
|
|
|
48
50
|
const [, t] = useLanguage()
|
|
@@ -50,6 +52,7 @@ const BusinessAnalyticsUI = (props) => {
|
|
|
50
52
|
|
|
51
53
|
const [businessFilterModal, setBusinessFilterModal] = useState(false)
|
|
52
54
|
const [isBrandFilter, setIsBrandFilter] = useState(false)
|
|
55
|
+
const [openCountryFilter, setOpenCountryFilter] = useState(true)
|
|
53
56
|
|
|
54
57
|
const handleChangeDate = (date1, date2) => {
|
|
55
58
|
handleChangeFilterList({ ...filterList, lapse: `${date1},${date2}` })
|
|
@@ -70,6 +73,11 @@ const BusinessAnalyticsUI = (props) => {
|
|
|
70
73
|
<h1>{t('BUSINESS_ANALYTICS', 'Business Analytics')}</h1>
|
|
71
74
|
</HeaderTitleContainer>
|
|
72
75
|
<HeaderFilterContainer>
|
|
76
|
+
<BusinessFilterWrapper>
|
|
77
|
+
<Button onClick={() => setOpenCountryFilter(true)}>
|
|
78
|
+
{t('COUNTRY', 'Country')}
|
|
79
|
+
</Button>
|
|
80
|
+
</BusinessFilterWrapper>
|
|
73
81
|
<BusinessFilterWrapper>
|
|
74
82
|
<Button onClick={() => setIsBrandFilter(true)}>
|
|
75
83
|
{t('BRAND', 'Brand')} ({filterList?.franchises_id ? filterList?.franchises_id.length : t('ALL', 'All')})
|
|
@@ -106,12 +114,14 @@ const BusinessAnalyticsUI = (props) => {
|
|
|
106
114
|
isOrders
|
|
107
115
|
filterList={filterList}
|
|
108
116
|
chartDataList={ordersList}
|
|
117
|
+
countryCode={countryCode}
|
|
109
118
|
/>
|
|
110
119
|
</div>
|
|
111
120
|
<div className='col-md-12 col-lg-6'>
|
|
112
121
|
<AnalyticsOrdersOrSales
|
|
113
122
|
filterList={filterList}
|
|
114
123
|
chartDataList={salesList}
|
|
124
|
+
countryCode={countryCode}
|
|
115
125
|
/>
|
|
116
126
|
</div>
|
|
117
127
|
<div className='col-md-12 col-lg-6'>
|
|
@@ -184,6 +194,18 @@ const BusinessAnalyticsUI = (props) => {
|
|
|
184
194
|
onClose={() => setIsBrandFilter(false)}
|
|
185
195
|
/>
|
|
186
196
|
</Modal>
|
|
197
|
+
<Modal
|
|
198
|
+
width='450px'
|
|
199
|
+
height='650px'
|
|
200
|
+
padding='25px'
|
|
201
|
+
open={openCountryFilter}
|
|
202
|
+
onClose={() => setOpenCountryFilter(false)}
|
|
203
|
+
>
|
|
204
|
+
<CountryFilter
|
|
205
|
+
{...props}
|
|
206
|
+
onClose={() => setOpenCountryFilter(false)}
|
|
207
|
+
/>
|
|
208
|
+
</Modal>
|
|
187
209
|
</BusinessAnalyticsContainer>
|
|
188
210
|
)
|
|
189
211
|
}
|
|
@@ -13,7 +13,7 @@ export const BusinessAnalyticsHeader = styled.div`
|
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
|
|
16
|
-
@media (min-width:
|
|
16
|
+
@media (min-width: 1024px) {
|
|
17
17
|
flex-direction: row;
|
|
18
18
|
align-items: center;
|
|
19
19
|
justify-content: space-between;
|
|
@@ -51,22 +51,41 @@ export const HeaderTitleContainer = styled.div`
|
|
|
51
51
|
export const HeaderFilterContainer = styled.div`
|
|
52
52
|
display: flex;
|
|
53
53
|
align-items: center;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
> div {
|
|
56
|
+
width: 100%;
|
|
57
|
+
margin-top: 10px;
|
|
58
|
+
> button {
|
|
59
|
+
width: 100%;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (min-width: 600px) {
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
> div {
|
|
66
|
+
margin-top: 0px;
|
|
67
|
+
width: auto;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
54
70
|
`
|
|
55
71
|
|
|
56
72
|
export const BusinessFilterWrapper = styled.div`
|
|
57
|
-
margin-left: 25px;
|
|
58
|
-
${props => props.theme.rtl && css`
|
|
59
|
-
margin-right: 25px;
|
|
60
|
-
margin-left: 0;
|
|
61
|
-
`}
|
|
62
73
|
> button {
|
|
63
74
|
background: #F8F9FA;
|
|
64
75
|
border-radius: 7.6px;
|
|
65
76
|
padding: 7px 12px;
|
|
66
77
|
font-size: 14px;
|
|
67
|
-
color:
|
|
78
|
+
color: ${props => props.theme.colors.secundaryContrast};
|
|
68
79
|
border: none;
|
|
69
80
|
}
|
|
81
|
+
|
|
82
|
+
@media (min-width: 600px) {
|
|
83
|
+
margin-left: 25px;
|
|
84
|
+
${props => props.theme.rtl && css`
|
|
85
|
+
margin-right: 25px;
|
|
86
|
+
margin-left: 0;
|
|
87
|
+
`}
|
|
88
|
+
}
|
|
70
89
|
`
|
|
71
90
|
|
|
72
91
|
export const BusinessCalendarWrapper = styled(BusinessFilterWrapper)`
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useLanguage, CountryList } from 'ordering-components-admin-external'
|
|
3
|
+
import { Button } from '../../../styles'
|
|
4
|
+
import Skeleton from 'react-loading-skeleton'
|
|
5
|
+
import { SearchBar, Pagination } from '../../Shared'
|
|
6
|
+
import { RecordCircleFill, Circle } from 'react-bootstrap-icons'
|
|
7
|
+
import {
|
|
8
|
+
Container,
|
|
9
|
+
SearchWrapper,
|
|
10
|
+
CountryListWrapper,
|
|
11
|
+
CountryItem,
|
|
12
|
+
ButtonWrapper,
|
|
13
|
+
PaginationWrapper
|
|
14
|
+
} from './styles'
|
|
15
|
+
|
|
16
|
+
const CountryFilterUI = (props) => {
|
|
17
|
+
const {
|
|
18
|
+
countriesState,
|
|
19
|
+
searchValue,
|
|
20
|
+
onSearch,
|
|
21
|
+
handleClickFilterButton,
|
|
22
|
+
countryCode,
|
|
23
|
+
handleChangeCode
|
|
24
|
+
} = props
|
|
25
|
+
|
|
26
|
+
const [, t] = useLanguage()
|
|
27
|
+
|
|
28
|
+
// Change page
|
|
29
|
+
const [currentPage, setCurrentPage] = useState(1)
|
|
30
|
+
const [pagesPerPage, setPagesPerPage] = useState(10)
|
|
31
|
+
|
|
32
|
+
// Get current products
|
|
33
|
+
const [currentPages, setCurrentPages] = useState([])
|
|
34
|
+
const [totalPages, setTotalPages] = useState(null)
|
|
35
|
+
|
|
36
|
+
const handleChangePage = (page) => {
|
|
37
|
+
setCurrentPage(page)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const handleChangePageSize = (pageSize) => {
|
|
41
|
+
const expectedPage = Math.ceil(((currentPage - 1) * pagesPerPage + 1) / pageSize)
|
|
42
|
+
setCurrentPage(expectedPage)
|
|
43
|
+
setPagesPerPage(pageSize)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (countriesState.loading) return
|
|
48
|
+
let _totalPages
|
|
49
|
+
if (countriesState.countries.length > 0) {
|
|
50
|
+
_totalPages = Math.ceil(countriesState.countries.length / pagesPerPage)
|
|
51
|
+
}
|
|
52
|
+
const indexOfLastPost = currentPage * pagesPerPage
|
|
53
|
+
const indexOfFirstPost = indexOfLastPost - pagesPerPage
|
|
54
|
+
const _currentBusinessList = countriesState.countries.slice(indexOfFirstPost, indexOfLastPost)
|
|
55
|
+
setTotalPages(_totalPages)
|
|
56
|
+
setCurrentPages(_currentBusinessList)
|
|
57
|
+
}, [countriesState, currentPage, pagesPerPage])
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
<Container>
|
|
62
|
+
<h2>{t('CHOOSE_A_COUNTRY', 'Choose a country')}</h2>
|
|
63
|
+
<SearchWrapper>
|
|
64
|
+
<SearchBar
|
|
65
|
+
search={searchValue}
|
|
66
|
+
isCustomLayout
|
|
67
|
+
lazyLoad
|
|
68
|
+
onSearch={(value) => onSearch(value)}
|
|
69
|
+
placeholder={t('SEARCH', 'Search')}
|
|
70
|
+
/>
|
|
71
|
+
</SearchWrapper>
|
|
72
|
+
<CountryListWrapper>
|
|
73
|
+
{countriesState?.loading ? (
|
|
74
|
+
<>
|
|
75
|
+
{[...Array(10).keys()].map(i => (
|
|
76
|
+
<CountryItem
|
|
77
|
+
key={i}
|
|
78
|
+
>
|
|
79
|
+
<Skeleton width={18} height={18} circle />
|
|
80
|
+
<Skeleton width={200} height={20} style={{ marginLeft: 10 }} />
|
|
81
|
+
</CountryItem>
|
|
82
|
+
))}
|
|
83
|
+
</>
|
|
84
|
+
) : (
|
|
85
|
+
<>
|
|
86
|
+
{currentPages?.map(country => (
|
|
87
|
+
<CountryItem key={country?.id} onClick={() => handleChangeCode(country?.code)}>
|
|
88
|
+
{countryCode === country?.code ? <RecordCircleFill className='checked' /> : <Circle />}
|
|
89
|
+
<span className='name'>{country?.name}</span>
|
|
90
|
+
</CountryItem>
|
|
91
|
+
))}
|
|
92
|
+
</>
|
|
93
|
+
)}
|
|
94
|
+
</CountryListWrapper>
|
|
95
|
+
<PaginationWrapper>
|
|
96
|
+
{countriesState?.countries?.length > 0 && (
|
|
97
|
+
<Pagination
|
|
98
|
+
currentPage={currentPage}
|
|
99
|
+
totalPages={totalPages}
|
|
100
|
+
handleChangePage={handleChangePage}
|
|
101
|
+
defaultPageSize={pagesPerPage}
|
|
102
|
+
handleChangePageSize={handleChangePageSize}
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
</PaginationWrapper>
|
|
106
|
+
</Container>
|
|
107
|
+
<ButtonWrapper>
|
|
108
|
+
<Button
|
|
109
|
+
color='primary'
|
|
110
|
+
disabled={countriesState.loading}
|
|
111
|
+
onClick={handleClickFilterButton}
|
|
112
|
+
>
|
|
113
|
+
{t('FILTER', 'Filter')}
|
|
114
|
+
</Button>
|
|
115
|
+
</ButtonWrapper>
|
|
116
|
+
</>
|
|
117
|
+
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export const CountryFilter = (props) => {
|
|
122
|
+
const countryFilterProps = {
|
|
123
|
+
...props,
|
|
124
|
+
UIComponent: CountryFilterUI,
|
|
125
|
+
isSearchByName: true
|
|
126
|
+
}
|
|
127
|
+
return <CountryList {...countryFilterProps} />
|
|
128
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div`
|
|
4
|
+
h2 {
|
|
5
|
+
font-weight: 700;
|
|
6
|
+
font-size: 20px;
|
|
7
|
+
line-height: 30px;
|
|
8
|
+
margin-top: 0px;
|
|
9
|
+
margin-bottom: 24px;
|
|
10
|
+
}
|
|
11
|
+
`
|
|
12
|
+
|
|
13
|
+
export const SearchWrapper = styled.div`
|
|
14
|
+
input {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
export const CountryListWrapper = styled.div`
|
|
20
|
+
padding-top: 17px;
|
|
21
|
+
`
|
|
22
|
+
|
|
23
|
+
export const CountryItem = styled.div`
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
margin: 10px 0px;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
width: fit-content;
|
|
29
|
+
|
|
30
|
+
span.name {
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
line-height: 18px;
|
|
34
|
+
margin-left: 10px;
|
|
35
|
+
user-select: none;
|
|
36
|
+
${props => props.theme.rtl && css`
|
|
37
|
+
margin-right: 10px;
|
|
38
|
+
margin-left: 0px;
|
|
39
|
+
`}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
svg {
|
|
43
|
+
font-size: 16px;
|
|
44
|
+
color: ${props => props.theme.colors.secundaryLight};
|
|
45
|
+
&.checked {
|
|
46
|
+
color: ${props => props.theme.colors.primary};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`
|
|
50
|
+
|
|
51
|
+
export const ButtonWrapper = styled.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: flex-end;
|
|
54
|
+
position: sticky;
|
|
55
|
+
top: 100%;
|
|
56
|
+
button {
|
|
57
|
+
border-radius: 8px;
|
|
58
|
+
height: 44px;
|
|
59
|
+
}
|
|
60
|
+
`
|
|
61
|
+
|
|
62
|
+
export const PaginationWrapper = styled.div`
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: flex-end;
|
|
65
|
+
`
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
} from './styles'
|
|
34
34
|
import { AnalyticsDriverOrders } from '../AnalyticsDriverOrders'
|
|
35
35
|
import { ReportsBrandFilter } from '../ReportsBrandFilter'
|
|
36
|
+
import { CountryFilter } from '../CountryFilter'
|
|
36
37
|
|
|
37
38
|
const DriverAnalyticsUI = (props) => {
|
|
38
39
|
const {
|
|
@@ -51,7 +52,8 @@ const DriverAnalyticsUI = (props) => {
|
|
|
51
52
|
busyTimesList,
|
|
52
53
|
completeSpendList,
|
|
53
54
|
pickUpSpendList,
|
|
54
|
-
deliverySpendList
|
|
55
|
+
deliverySpendList,
|
|
56
|
+
countryCode
|
|
55
57
|
} = props
|
|
56
58
|
|
|
57
59
|
const [, t] = useLanguage()
|
|
@@ -64,6 +66,7 @@ const DriverAnalyticsUI = (props) => {
|
|
|
64
66
|
const [driversFilterModal, setDriversFilterModal] = useState(false)
|
|
65
67
|
const [driverGroupModal, setDriverGroupModal] = useState(false)
|
|
66
68
|
const [isBrandFilter, setIsBrandFilter] = useState(false)
|
|
69
|
+
const [openCountryFilter, setOpenCountryFilter] = useState(true)
|
|
67
70
|
|
|
68
71
|
return (
|
|
69
72
|
<BusinessAnalyticsContainer>
|
|
@@ -80,6 +83,11 @@ const DriverAnalyticsUI = (props) => {
|
|
|
80
83
|
<h1>{t('DRIVERS_ANALYTICS', 'Drivers analytics')}</h1>
|
|
81
84
|
</HeaderTitleContainer>
|
|
82
85
|
<HeaderFilterContainer>
|
|
86
|
+
<BusinessFilterWrapper>
|
|
87
|
+
<Button onClick={() => setOpenCountryFilter(true)}>
|
|
88
|
+
{t('COUNTRY', 'Country')}
|
|
89
|
+
</Button>
|
|
90
|
+
</BusinessFilterWrapper>
|
|
83
91
|
<BusinessFilterWrapper>
|
|
84
92
|
<Button onClick={() => setIsBrandFilter(true)}>
|
|
85
93
|
{t('BRAND', 'Brand')} ({filterList?.franchises_id ? filterList?.franchises_id.length : t('ALL', 'All')})
|
|
@@ -124,12 +132,14 @@ const DriverAnalyticsUI = (props) => {
|
|
|
124
132
|
isOrders
|
|
125
133
|
filterList={filterList}
|
|
126
134
|
chartDataList={ordersList}
|
|
135
|
+
countryCode={countryCode}
|
|
127
136
|
/>
|
|
128
137
|
</div>
|
|
129
138
|
<div className='col-md-12 col-lg-6'>
|
|
130
139
|
<AnalyticsDriverOrders
|
|
131
140
|
filterList={filterList}
|
|
132
141
|
chartDataList={salesList}
|
|
142
|
+
countryCode={countryCode}
|
|
133
143
|
/>
|
|
134
144
|
</div>
|
|
135
145
|
<div className='col-md-12 col-lg-6'>
|
|
@@ -236,6 +246,18 @@ const DriverAnalyticsUI = (props) => {
|
|
|
236
246
|
onClose={() => setIsBrandFilter(false)}
|
|
237
247
|
/>
|
|
238
248
|
</Modal>
|
|
249
|
+
<Modal
|
|
250
|
+
width='450px'
|
|
251
|
+
height='650px'
|
|
252
|
+
padding='25px'
|
|
253
|
+
open={openCountryFilter}
|
|
254
|
+
onClose={() => setOpenCountryFilter(false)}
|
|
255
|
+
>
|
|
256
|
+
<CountryFilter
|
|
257
|
+
{...props}
|
|
258
|
+
onClose={() => setOpenCountryFilter(false)}
|
|
259
|
+
/>
|
|
260
|
+
</Modal>
|
|
239
261
|
</BusinessAnalyticsContainer>
|
|
240
262
|
)
|
|
241
263
|
}
|
|
@@ -56,24 +56,23 @@ export const HeaderFilterContainer = styled.div`
|
|
|
56
56
|
|
|
57
57
|
> div {
|
|
58
58
|
margin-top: 10px;
|
|
59
|
+
width: 100%;
|
|
60
|
+
> button, > div:not(.ordering-calendar) {
|
|
61
|
+
width: 100%;
|
|
62
|
+
}
|
|
59
63
|
}
|
|
60
64
|
|
|
61
|
-
@media (min-width:
|
|
65
|
+
@media (min-width: 600px) {
|
|
62
66
|
flex-direction: row;
|
|
63
67
|
|
|
64
68
|
> div {
|
|
65
69
|
margin-top: 0;
|
|
70
|
+
width: auto;
|
|
66
71
|
}
|
|
67
72
|
}
|
|
68
73
|
`
|
|
69
74
|
|
|
70
75
|
export const BusinessFilterWrapper = styled.div`
|
|
71
|
-
margin-left: 25px;
|
|
72
|
-
${props => props.theme.rtl && css`
|
|
73
|
-
margin-right: 25px;
|
|
74
|
-
margin-left: 0;
|
|
75
|
-
`}
|
|
76
|
-
|
|
77
76
|
> button {
|
|
78
77
|
background: #F8F9FA;
|
|
79
78
|
border-radius: 7.6px;
|
|
@@ -82,6 +81,14 @@ export const BusinessFilterWrapper = styled.div`
|
|
|
82
81
|
color: #748194;
|
|
83
82
|
border: none;
|
|
84
83
|
}
|
|
84
|
+
|
|
85
|
+
@media (min-width: 600px) {
|
|
86
|
+
margin-left: 25px;
|
|
87
|
+
${props => props.theme.rtl && css`
|
|
88
|
+
margin-right: 25px;
|
|
89
|
+
margin-left: 0;
|
|
90
|
+
`}
|
|
91
|
+
}
|
|
85
92
|
`
|
|
86
93
|
|
|
87
94
|
export const BusinessCalendarWrapper = styled(BusinessFilterWrapper)`
|
|
@@ -88,8 +88,8 @@ export const CalendarWrapper = styled.div`
|
|
|
88
88
|
> button {
|
|
89
89
|
padding: 7px 15px;
|
|
90
90
|
width: 100%;
|
|
91
|
-
color:
|
|
92
|
-
background:
|
|
91
|
+
color: ${props => props.theme.colors.secundaryContrast};
|
|
92
|
+
background: ${props => props.theme.colors.secundary};
|
|
93
93
|
border-radius: 7.6px;
|
|
94
94
|
border: none;
|
|
95
95
|
text-align: left;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import Skeleton from 'react-loading-skeleton'
|
|
3
3
|
import { useLanguage, ReportsBrandFilter as ReportsBrandFilterController } from 'ordering-components-admin-external'
|
|
4
|
-
import
|
|
5
|
-
import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
|
|
4
|
+
import { CheckSquareFill as Checked, Square as UnChecked } from 'react-bootstrap-icons'
|
|
6
5
|
import { Button } from '../../../styles'
|
|
7
6
|
import {
|
|
8
7
|
ReportsBrandFilterContainer,
|
|
@@ -23,22 +22,13 @@ const ReportsBrandFilterUI = (props) => {
|
|
|
23
22
|
|
|
24
23
|
const [, t] = useLanguage()
|
|
25
24
|
|
|
26
|
-
const isCheckEnableSate = (id) => {
|
|
27
|
-
const found = brandIds?.find(brandId => brandId === id)
|
|
28
|
-
let valid = false
|
|
29
|
-
if (found) {
|
|
30
|
-
valid = true
|
|
31
|
-
}
|
|
32
|
-
return valid
|
|
33
|
-
}
|
|
34
|
-
|
|
35
25
|
return (
|
|
36
26
|
<>
|
|
37
27
|
<ReportsBrandFilterContainer>
|
|
38
28
|
{brandList.loading ? (
|
|
39
29
|
[...Array(10).keys()].map(i => (
|
|
40
30
|
<BrandFilterOption key={i}>
|
|
41
|
-
<Skeleton width={
|
|
31
|
+
<Skeleton width={18} height={18} />
|
|
42
32
|
<BusinessName>
|
|
43
33
|
<Skeleton width={120} height={24} />
|
|
44
34
|
</BusinessName>
|
|
@@ -50,9 +40,9 @@ const ReportsBrandFilterUI = (props) => {
|
|
|
50
40
|
onClick={handleChangeAllCheck}
|
|
51
41
|
>
|
|
52
42
|
{isAllCheck ? (
|
|
53
|
-
<
|
|
43
|
+
<Checked className='fill' />
|
|
54
44
|
) : (
|
|
55
|
-
<
|
|
45
|
+
<UnChecked />
|
|
56
46
|
)}
|
|
57
47
|
<BusinessName>{t('ALL', 'All')}</BusinessName>
|
|
58
48
|
</BrandFilterOption>
|
|
@@ -61,10 +51,10 @@ const ReportsBrandFilterUI = (props) => {
|
|
|
61
51
|
key={i}
|
|
62
52
|
onClick={() => handleChangeBrandId(brand?.id)}
|
|
63
53
|
>
|
|
64
|
-
{
|
|
65
|
-
<
|
|
54
|
+
{brandIds?.includes(brand.id) ? (
|
|
55
|
+
<Checked className='fill' />
|
|
66
56
|
) : (
|
|
67
|
-
<
|
|
57
|
+
<UnChecked />
|
|
68
58
|
)}
|
|
69
59
|
<BusinessName>{brand?.name}</BusinessName>
|
|
70
60
|
</BrandFilterOption>
|
|
@@ -5,13 +5,13 @@ export const ReportsBrandFilterContainer = styled.div``
|
|
|
5
5
|
export const BrandFilterOption = styled.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
|
-
border-bottom: 1px solid
|
|
8
|
+
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
9
9
|
padding: 10px 0;
|
|
10
10
|
cursor: pointer;
|
|
11
11
|
|
|
12
12
|
svg {
|
|
13
|
-
font-size:
|
|
14
|
-
color:
|
|
13
|
+
font-size: 18px;
|
|
14
|
+
color: ${props => props.theme.colors.secundaryLight};
|
|
15
15
|
|
|
16
16
|
&.fill {
|
|
17
17
|
color: ${props => props.theme.colors.primary};
|
|
@@ -9,6 +9,7 @@ import { Modal } from '../../Shared'
|
|
|
9
9
|
import { AnalyticsBusinessFilter } from '../AnalyticsBusinessFilter'
|
|
10
10
|
import { ReportsBrandFilter } from '../ReportsBrandFilter'
|
|
11
11
|
import { ReportsBarChart } from '../ReportsBarChart'
|
|
12
|
+
import { CountryFilter } from '../CountryFilter'
|
|
12
13
|
import {
|
|
13
14
|
ReportsDistanceContainer,
|
|
14
15
|
Title,
|
|
@@ -39,6 +40,7 @@ const ReportsBusinessDistanceUI = (props) => {
|
|
|
39
40
|
const tableRef = useRef(null)
|
|
40
41
|
const [isBusinessFilter, setIsBusinessFilter] = useState(false)
|
|
41
42
|
const [isBrandFilter, setIsBrandFilter] = useState(false)
|
|
43
|
+
const [openCountryFilter, setOpenCountryFilter] = useState(true)
|
|
42
44
|
const [chartData, setChartData] = useState(null)
|
|
43
45
|
const [{ parseNumber }] = useUtils()
|
|
44
46
|
|
|
@@ -150,6 +152,11 @@ const ReportsBusinessDistanceUI = (props) => {
|
|
|
150
152
|
>
|
|
151
153
|
{t('BUSINESS', 'Business')} ({filterList?.businessIds ? filterList?.businessIds.length : t('ALL', 'All')})
|
|
152
154
|
</Button>
|
|
155
|
+
<Button
|
|
156
|
+
onClick={() => setOpenCountryFilter(true)}
|
|
157
|
+
>
|
|
158
|
+
{t('COUNTRY', 'Country')}
|
|
159
|
+
</Button>
|
|
153
160
|
</BrandBusinessWrapper>
|
|
154
161
|
<CalendarWrapper>
|
|
155
162
|
<AnalyticsCalendar
|
|
@@ -269,6 +276,18 @@ const ReportsBusinessDistanceUI = (props) => {
|
|
|
269
276
|
{...props} onClose={() => setIsBrandFilter(false)}
|
|
270
277
|
/>
|
|
271
278
|
</Modal>
|
|
279
|
+
<Modal
|
|
280
|
+
width='450px'
|
|
281
|
+
height='650px'
|
|
282
|
+
padding='25px'
|
|
283
|
+
open={openCountryFilter}
|
|
284
|
+
onClose={() => setOpenCountryFilter(false)}
|
|
285
|
+
>
|
|
286
|
+
<CountryFilter
|
|
287
|
+
{...props}
|
|
288
|
+
onClose={() => setOpenCountryFilter(false)}
|
|
289
|
+
/>
|
|
290
|
+
</Modal>
|
|
272
291
|
</ReportsDistanceContainer>
|
|
273
292
|
)
|
|
274
293
|
}
|
|
@@ -11,6 +11,7 @@ import { AnalyticsCalendar } from '../AnalyticsCalendar'
|
|
|
11
11
|
import { Modal } from '../../Shared'
|
|
12
12
|
import { AnalyticsBusinessFilter } from '../AnalyticsBusinessFilter'
|
|
13
13
|
import { ReportsBrandFilter } from '../ReportsBrandFilter'
|
|
14
|
+
import { CountryFilter } from '../CountryFilter'
|
|
14
15
|
import {
|
|
15
16
|
ReportsBusinessSpendContainer,
|
|
16
17
|
Title,
|
|
@@ -37,6 +38,8 @@ const ReportsBusinessSpendUI = (props) => {
|
|
|
37
38
|
const [, t] = useLanguage()
|
|
38
39
|
const [isBusinessFilter, setIsBusinessFilter] = useState(false)
|
|
39
40
|
const [isBrandFilter, setIsBrandFilter] = useState(false)
|
|
41
|
+
const [openCountryFilter, setOpenCountryFilter] = useState(true)
|
|
42
|
+
|
|
40
43
|
const [{ parsePrice }] = useUtils()
|
|
41
44
|
|
|
42
45
|
const tableRef = useRef(null)
|
|
@@ -116,6 +119,11 @@ const ReportsBusinessSpendUI = (props) => {
|
|
|
116
119
|
>
|
|
117
120
|
{t('BUSINESS', 'Business')} ({filterList?.businessIds ? filterList?.businessIds.length : t('ALL', 'All')})
|
|
118
121
|
</Button>
|
|
122
|
+
<Button
|
|
123
|
+
onClick={() => setOpenCountryFilter(true)}
|
|
124
|
+
>
|
|
125
|
+
{t('COUNTRY', 'Country')}
|
|
126
|
+
</Button>
|
|
119
127
|
</BrandBusinessWrapper>
|
|
120
128
|
<CalendarWrapper>
|
|
121
129
|
<AnalyticsCalendar
|
|
@@ -214,6 +222,18 @@ const ReportsBusinessSpendUI = (props) => {
|
|
|
214
222
|
{...props} onClose={() => setIsBrandFilter(false)}
|
|
215
223
|
/>
|
|
216
224
|
</Modal>
|
|
225
|
+
<Modal
|
|
226
|
+
width='450px'
|
|
227
|
+
height='650px'
|
|
228
|
+
padding='25px'
|
|
229
|
+
open={openCountryFilter}
|
|
230
|
+
onClose={() => setOpenCountryFilter(false)}
|
|
231
|
+
>
|
|
232
|
+
<CountryFilter
|
|
233
|
+
{...props}
|
|
234
|
+
onClose={() => setOpenCountryFilter(false)}
|
|
235
|
+
/>
|
|
236
|
+
</Modal>
|
|
217
237
|
</ReportsBusinessSpendContainer>
|
|
218
238
|
)
|
|
219
239
|
}
|
|
@@ -8,6 +8,7 @@ import { Alert, Modal } from '../../Shared'
|
|
|
8
8
|
import { AnalyticsBusinessFilter } from '../AnalyticsBusinessFilter'
|
|
9
9
|
import { ReportsDriverFilter } from '../ReportsDriverFilter'
|
|
10
10
|
import { ReportsDriverGroupFilter } from '../ReportsDriverGroupFilter'
|
|
11
|
+
import { CountryFilter } from '../CountryFilter'
|
|
11
12
|
import {
|
|
12
13
|
DriverDistanceContainer,
|
|
13
14
|
Title,
|
|
@@ -35,6 +36,7 @@ const ReportsDriverDistanceUI = (props) => {
|
|
|
35
36
|
const [isBusinessFilter, setIsBusinessFilter] = useState(false)
|
|
36
37
|
const [isDriverFilter, setIsDriverFilter] = useState(false)
|
|
37
38
|
const [isDriverGroupFilter, setIsDriverGroupFilter] = useState(false)
|
|
39
|
+
const [openCountryFilter, setOpenCountryFilter] = useState(true)
|
|
38
40
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
39
41
|
const [availableDriverIds, setAvailableDriverIds] = useState(null)
|
|
40
42
|
const [{ parseNumber }] = useUtils()
|
|
@@ -126,6 +128,11 @@ const ReportsDriverDistanceUI = (props) => {
|
|
|
126
128
|
>
|
|
127
129
|
{t('DRIVER', 'DRIVER')} ({filterList?.drivers_ids ? filterList?.drivers_ids.length : t('ALL', 'All')})
|
|
128
130
|
</Button>
|
|
131
|
+
<Button
|
|
132
|
+
onClick={() => setOpenCountryFilter(true)}
|
|
133
|
+
>
|
|
134
|
+
{t('COUNTRY', 'Country')}
|
|
135
|
+
</Button>
|
|
129
136
|
</BrandBusinessWrapper>
|
|
130
137
|
<CalendarWrapper>
|
|
131
138
|
<AnalyticsCalendar
|
|
@@ -235,6 +242,18 @@ const ReportsDriverDistanceUI = (props) => {
|
|
|
235
242
|
setAvailableDriverIds={setAvailableDriverIds}
|
|
236
243
|
/>
|
|
237
244
|
</Modal>
|
|
245
|
+
<Modal
|
|
246
|
+
width='450px'
|
|
247
|
+
height='650px'
|
|
248
|
+
padding='25px'
|
|
249
|
+
open={openCountryFilter}
|
|
250
|
+
onClose={() => setOpenCountryFilter(false)}
|
|
251
|
+
>
|
|
252
|
+
<CountryFilter
|
|
253
|
+
{...props}
|
|
254
|
+
onClose={() => setOpenCountryFilter(false)}
|
|
255
|
+
/>
|
|
256
|
+
</Modal>
|
|
238
257
|
</DriverDistanceContainer>
|
|
239
258
|
<Alert
|
|
240
259
|
title={t('DRIVER_SCHEDULE', 'Driver schedule')}
|