ordering-ui-admin-external 1.12.5 → 1.13.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.d53a7ee886aee7937e13.js → ordering-ui-admin.6980225e31cb682b0268.js} +2 -2
- package/_bundles/{ordering-ui-admin.d53a7ee886aee7937e13.js.LICENSE.txt → ordering-ui-admin.6980225e31cb682b0268.js.LICENSE.txt} +0 -0
- package/_modules/components/BusinessIntelligence/BusinessReviewDetails/index.js +2 -12
- package/_modules/components/BusinessIntelligence/BusinessReviewList/index.js +5 -3
- package/_modules/components/BusinessIntelligence/BusinessReviewList/styles.js +1 -1
- package/_modules/components/BusinessIntelligence/ReviewProductsListing/index.js +31 -49
- package/_modules/components/BusinessIntelligence/ReviewProductsListing/styles.js +20 -33
- package/_modules/components/BusinessIntelligence/ReviewsListing/index.js +54 -7
- package/_modules/components/BusinessIntelligence/ReviewsListing/styles.js +7 -3
- package/_modules/components/Delivery/DriversGroupGeneralForm/index.js +14 -14
- package/_modules/components/Loyalty/GiftCards/index.js +168 -0
- package/_modules/components/Loyalty/GiftCards/styles.js +80 -0
- package/_modules/components/Loyalty/PointsWalletLevels/index.js +5 -2
- package/_modules/components/Marketing/BannerDetails/BannerImages.js +6 -4
- package/_modules/components/Marketing/BannerDetails/index.js +2 -1
- package/_modules/components/Marketing/BannerImageDetails/index.js +1 -1
- package/_modules/components/Marketing/PageBanner/index.js +3 -1
- package/_modules/components/Marketing/PageBanner/styles.js +1 -1
- package/_modules/components/MyProducts/CustomProject/index.js +49 -0
- package/_modules/components/MyProducts/CustomProject/styles.js +27 -0
- package/_modules/components/MyProducts/index.js +8 -1
- package/_modules/components/Orders/OrderDetailsHeader/index.js +4 -4
- package/_modules/components/Settings/ApiKeysList/index.js +3 -1
- package/_modules/components/Settings/ApiKeysList/styles.js +4 -10
- package/_modules/components/Settings/Deliverect/index.js +4 -1
- package/_modules/components/Settings/Deliverect/styles.js +33 -31
- package/_modules/components/Settings/DoordashConnect/index.js +4 -1
- package/_modules/components/Settings/DoordashConnect/styles.js +31 -29
- package/_modules/components/Settings/ItsaCheckmate/index.js +4 -1
- package/_modules/components/Settings/ItsaCheckmate/styles.js +33 -39
- package/_modules/components/Settings/LalamoveConnect/index.js +4 -1
- package/_modules/components/Settings/LalamoveConnect/styles.js +32 -30
- package/_modules/components/Settings/LanguageTransTable/index.js +9 -2
- package/_modules/components/Settings/PickerExpress/index.js +4 -1
- package/_modules/components/Settings/PickerExpress/styles.js +32 -30
- package/_modules/components/Settings/PluginList/index.js +3 -1
- package/_modules/components/Settings/PluginList/styles.js +4 -8
- package/_modules/components/Settings/SettingsDetail/index.js +4 -1
- package/_modules/components/Settings/SettingsDetail/styles.js +15 -21
- package/_modules/components/Settings/SettingsList/index.js +16 -0
- package/_modules/components/Settings/SettingsList/styles.js +4 -1
- package/_modules/components/Settings/WebhookList/index.js +4 -2
- package/_modules/components/Settings/WebhookList/styles.js +4 -8
- package/_modules/components/Shared/ImageCrop/index.js +4 -2
- package/_modules/components/SidebarMenu/index.js +13 -10
- package/_modules/components/Stores/BusinessCateringDelivery/index.js +215 -0
- package/_modules/components/Stores/BusinessCateringDelivery/styles.js +20 -0
- package/_modules/components/Stores/BusinessDetails/index.js +5 -2
- package/_modules/components/Stores/BusinessPreorderDetails/index.js +18 -4
- package/_modules/components/Stores/BusinessPreorderDetails/styles.js +7 -5
- package/_modules/components/Stores/BusinessSummary/index.js +1 -1
- package/_modules/components/Stores/BusinessesListing/index.js +14 -14
- package/_modules/components/Stores/BusinessesListing/styles.js +1 -3
- package/_modules/components/Stores/ProductTagDetails/styles.js +1 -1
- package/_modules/components/Stores/SeoOptions/styles.js +1 -1
- package/_modules/index.js +6 -0
- package/index-template.js +3 -1
- package/package.json +2 -2
- package/src/components/BusinessIntelligence/BusinessReviewDetails/index.js +3 -7
- package/src/components/BusinessIntelligence/BusinessReviewList/index.js +13 -9
- package/src/components/BusinessIntelligence/BusinessReviewList/styles.js +2 -1
- package/src/components/BusinessIntelligence/ReviewProductsListing/index.js +33 -55
- package/src/components/BusinessIntelligence/ReviewProductsListing/styles.js +3 -53
- package/src/components/BusinessIntelligence/ReviewsListing/index.js +59 -8
- package/src/components/BusinessIntelligence/ReviewsListing/styles.js +19 -0
- package/src/components/Delivery/DriversGroupGeneralForm/index.js +14 -14
- package/src/components/Loyalty/GiftCards/index.js +200 -0
- package/src/components/Loyalty/GiftCards/styles.js +147 -0
- package/src/components/Loyalty/PointsWalletLevels/index.js +9 -12
- package/src/components/Marketing/BannerDetails/BannerImages.js +5 -3
- package/src/components/Marketing/BannerDetails/index.js +1 -0
- package/src/components/Marketing/BannerImageDetails/index.js +1 -1
- package/src/components/Marketing/PageBanner/index.js +4 -3
- package/src/components/Marketing/PageBanner/styles.js +5 -0
- package/src/components/MyProducts/CustomProject/index.js +56 -0
- package/src/components/MyProducts/CustomProject/styles.js +108 -0
- package/src/components/MyProducts/index.js +3 -1
- package/src/components/Orders/OrderDetailsHeader/index.js +2 -2
- package/src/components/Settings/ApiKeysList/index.js +5 -4
- package/src/components/Settings/ApiKeysList/styles.js +5 -11
- package/src/components/Settings/Deliverect/index.js +2 -3
- package/src/components/Settings/Deliverect/styles.js +23 -0
- package/src/components/Settings/DoordashConnect/index.js +2 -3
- package/src/components/Settings/DoordashConnect/styles.js +23 -0
- package/src/components/Settings/ItsaCheckmate/index.js +2 -3
- package/src/components/Settings/ItsaCheckmate/styles.js +23 -26
- package/src/components/Settings/LalamoveConnect/index.js +2 -3
- package/src/components/Settings/LalamoveConnect/styles.js +23 -0
- package/src/components/Settings/LanguageTransTable/index.js +12 -2
- package/src/components/Settings/PickerExpress/index.js +2 -3
- package/src/components/Settings/PickerExpress/styles.js +23 -0
- package/src/components/Settings/PluginList/index.js +4 -3
- package/src/components/Settings/PluginList/styles.js +3 -6
- package/src/components/Settings/SettingsDetail/index.js +3 -4
- package/src/components/Settings/SettingsDetail/styles.js +24 -27
- package/src/components/Settings/SettingsList/index.js +43 -0
- package/src/components/Settings/SettingsList/styles.js +1 -1
- package/src/components/Settings/WebhookList/index.js +5 -4
- package/src/components/Settings/WebhookList/styles.js +3 -5
- package/src/components/Shared/ImageCrop/index.js +4 -2
- package/src/components/SidebarMenu/index.js +14 -7
- package/src/components/Stores/BusinessCateringDelivery/index.js +174 -0
- package/src/components/Stores/BusinessCateringDelivery/styles.js +53 -0
- package/src/components/Stores/BusinessDetails/index.js +5 -2
- package/src/components/Stores/BusinessPreorderDetails/index.js +38 -11
- package/src/components/Stores/BusinessPreorderDetails/styles.js +9 -1
- package/src/components/Stores/BusinessSummary/index.js +1 -1
- package/src/components/Stores/BusinessesListing/index.js +57 -56
- package/src/components/Stores/BusinessesListing/styles.js +3 -11
- package/src/components/Stores/ProductTagDetails/styles.js +1 -0
- package/src/components/Stores/SeoOptions/styles.js +1 -0
- package/src/index.js +3 -1
- package/template/app.js +4 -4
- package/template/assets/images/myProducts/custom-project.png +0 -0
- package/template/components/ListenPageChanges/index.js +1 -1
- package/template/helmetdata.json +7 -7
- package/template/pages/CustomProject/index.js +12 -0
- package/template/pages/ReviewProducts/index.js +0 -22
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { useLanguage, useUtils,
|
|
2
|
+
import { useLanguage, useUtils, BusinessReviews as BusinessReviewsController } from 'ordering-components-admin-external'
|
|
3
3
|
import Skeleton from 'react-loading-skeleton'
|
|
4
4
|
import { useTheme } from 'styled-components'
|
|
5
5
|
import { PersonFill } from 'react-bootstrap-icons'
|
|
@@ -27,22 +27,18 @@ const BusinessReviewDetailsUI = (props) => {
|
|
|
27
27
|
const {
|
|
28
28
|
business,
|
|
29
29
|
reviewsList,
|
|
30
|
+
handleOpenProducts,
|
|
30
31
|
handleChangeReviewEnabled
|
|
31
32
|
} = props
|
|
32
33
|
|
|
33
34
|
const [, t] = useLanguage()
|
|
34
35
|
const theme = useTheme()
|
|
35
36
|
const [{ optimizeImage, parseDate }] = useUtils()
|
|
36
|
-
const [events] = useEvent()
|
|
37
37
|
|
|
38
38
|
const getReviewPercent = (quality) => {
|
|
39
39
|
return quality / 5 * 100
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
const handleGoToPage = (data) => {
|
|
43
|
-
events.emit('go_to_page', data)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
42
|
return (
|
|
47
43
|
<>
|
|
48
44
|
<ReviewDetailsContainer>
|
|
@@ -51,7 +47,7 @@ const BusinessReviewDetailsUI = (props) => {
|
|
|
51
47
|
<Button
|
|
52
48
|
color='lightPrimary'
|
|
53
49
|
borderRadius='8px'
|
|
54
|
-
onClick={() =>
|
|
50
|
+
onClick={() => handleOpenProducts(business)}
|
|
55
51
|
>
|
|
56
52
|
{t('PRODUCT_REVIEW', 'Product review')}
|
|
57
53
|
</Button>
|
|
@@ -24,7 +24,8 @@ const BusinessReviewsListingUI = (props) => {
|
|
|
24
24
|
parentSearchValue,
|
|
25
25
|
getPageBusinesses,
|
|
26
26
|
handleUpdateReview,
|
|
27
|
-
onSearch
|
|
27
|
+
onSearch,
|
|
28
|
+
handleOpenProducts
|
|
28
29
|
} = props
|
|
29
30
|
const [, t] = useLanguage()
|
|
30
31
|
const theme = useTheme()
|
|
@@ -100,14 +101,16 @@ const BusinessReviewsListingUI = (props) => {
|
|
|
100
101
|
</ReviewObject>
|
|
101
102
|
</td>
|
|
102
103
|
<td>
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
104
|
+
<div>
|
|
105
|
+
<ReviewMarkerWrapper>
|
|
106
|
+
{business?.reviews?.total && (
|
|
107
|
+
<>
|
|
108
|
+
<StarFill />
|
|
109
|
+
<p>{business?.reviews?.total}</p>
|
|
110
|
+
</>
|
|
111
|
+
)}
|
|
112
|
+
</ReviewMarkerWrapper>
|
|
113
|
+
</div>
|
|
111
114
|
</td>
|
|
112
115
|
</tr>
|
|
113
116
|
</ReviewTbody>
|
|
@@ -141,6 +144,7 @@ const BusinessReviewsListingUI = (props) => {
|
|
|
141
144
|
businessId={curBusiness?.id}
|
|
142
145
|
reviews={curBusiness?.reviews?.reviews}
|
|
143
146
|
handleUpdateReview={handleUpdateReview}
|
|
147
|
+
handleOpenProducts={handleOpenProducts}
|
|
144
148
|
/>
|
|
145
149
|
</SideBar>
|
|
146
150
|
)}
|
|
@@ -119,9 +119,10 @@ export const ReviewMarkerWrapper = styled.div`
|
|
|
119
119
|
|
|
120
120
|
${({ isHeader }) => !isHeader && css`
|
|
121
121
|
height: 40px;
|
|
122
|
+
width: 45px;
|
|
122
123
|
display: flex;
|
|
123
124
|
flex-direction: column;
|
|
124
|
-
align-items:
|
|
125
|
+
align-items: center;
|
|
125
126
|
justify-content: center;
|
|
126
127
|
${props => props.theme.colors.rtl ? css`
|
|
127
128
|
border-right: 1px solid ${props => props.theme.colors.borderColor};
|
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { useLanguage, useUtils,
|
|
3
|
-
import {
|
|
4
|
-
import { List as MenuIcon, ImageFill } from 'react-bootstrap-icons'
|
|
2
|
+
import { useLanguage, useUtils, ReviewProductList as ReviewProductListController } from 'ordering-components-admin-external'
|
|
3
|
+
import { ImageFill, StarFill } from 'react-bootstrap-icons'
|
|
5
4
|
import Skeleton from 'react-loading-skeleton'
|
|
6
|
-
import { Pagination,
|
|
7
|
-
import { IconButton } from '../../../styles'
|
|
5
|
+
import { Pagination, SideBar } from '../../Shared'
|
|
8
6
|
import { ProductReviewDetails } from '../ProductReviewDetails'
|
|
9
7
|
|
|
10
8
|
import {
|
|
11
9
|
ReviewsListingContainer,
|
|
12
|
-
Header,
|
|
13
|
-
HeaderLeft,
|
|
14
|
-
HeaderRight,
|
|
15
10
|
ReviewsTable,
|
|
16
11
|
ReviewTbody,
|
|
17
12
|
WrapperImage,
|
|
18
13
|
Image,
|
|
19
14
|
ReviewObject,
|
|
20
|
-
PagesBottomContainer
|
|
15
|
+
PagesBottomContainer,
|
|
16
|
+
ReviewMarkerWrapper
|
|
21
17
|
} from './styles'
|
|
22
18
|
|
|
23
19
|
export const ReviewProductsListingUI = (props) => {
|
|
24
20
|
const {
|
|
25
|
-
|
|
26
|
-
categoryState,
|
|
21
|
+
productState,
|
|
27
22
|
handleChangeSearch,
|
|
28
|
-
searchValue
|
|
23
|
+
searchValue,
|
|
24
|
+
parentSearchValue,
|
|
25
|
+
businessId
|
|
29
26
|
} = props
|
|
30
27
|
|
|
31
28
|
const [, t] = useLanguage()
|
|
32
29
|
const [{ optimizeImage }] = useUtils()
|
|
33
30
|
|
|
34
|
-
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
35
31
|
const [openReview, setOpenReview] = useState(false)
|
|
36
32
|
const [curProduct, setCurProduct] = useState(null)
|
|
37
33
|
|
|
@@ -51,17 +47,17 @@ export const ReviewProductsListingUI = (props) => {
|
|
|
51
47
|
}
|
|
52
48
|
|
|
53
49
|
useEffect(() => {
|
|
54
|
-
if (
|
|
50
|
+
if (productState.loading) return
|
|
55
51
|
let _totalPages
|
|
56
|
-
if (
|
|
57
|
-
_totalPages = Math.ceil(
|
|
52
|
+
if (productState.products.length > 0) {
|
|
53
|
+
_totalPages = Math.ceil(productState.products.length / productsPerPage)
|
|
58
54
|
}
|
|
59
55
|
const indexOfLastPost = currentPage * productsPerPage
|
|
60
56
|
const indexOfFirstPost = indexOfLastPost - productsPerPage
|
|
61
|
-
const _currentProducts =
|
|
57
|
+
const _currentProducts = productState.products.slice(indexOfFirstPost, indexOfLastPost)
|
|
62
58
|
setTotalPages(_totalPages)
|
|
63
59
|
setCurrentProducts(_currentProducts)
|
|
64
|
-
}, [
|
|
60
|
+
}, [productState, currentPage, productsPerPage])
|
|
65
61
|
|
|
66
62
|
const handleOpenReview = (product) => {
|
|
67
63
|
setCurProduct(product)
|
|
@@ -72,38 +68,21 @@ export const ReviewProductsListingUI = (props) => {
|
|
|
72
68
|
setCurrentPage(1)
|
|
73
69
|
}, [searchValue])
|
|
74
70
|
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
handleChangeSearch(parentSearchValue)
|
|
73
|
+
}, [parentSearchValue])
|
|
74
|
+
|
|
75
75
|
return (
|
|
76
76
|
<>
|
|
77
77
|
<ReviewsListingContainer>
|
|
78
|
-
<Header>
|
|
79
|
-
<HeaderLeft>
|
|
80
|
-
{isCollapse && (
|
|
81
|
-
<IconButton
|
|
82
|
-
color='black'
|
|
83
|
-
onClick={() => handleMenuCollapse(false)}
|
|
84
|
-
>
|
|
85
|
-
<MenuIcon />
|
|
86
|
-
</IconButton>
|
|
87
|
-
)}
|
|
88
|
-
<h1>{businessState?.loading ? <Skeleton width={150} /> : businessState?.business?.name}</h1>
|
|
89
|
-
</HeaderLeft>
|
|
90
|
-
<HeaderRight>
|
|
91
|
-
<SearchBar
|
|
92
|
-
lazyLoad
|
|
93
|
-
placeholder={t('SEARCH', 'Search')}
|
|
94
|
-
searchValue={searchValue}
|
|
95
|
-
onSearch={handleChangeSearch}
|
|
96
|
-
/>
|
|
97
|
-
</HeaderRight>
|
|
98
|
-
</Header>
|
|
99
78
|
<ReviewsTable>
|
|
100
79
|
<thead>
|
|
101
80
|
<tr>
|
|
102
81
|
<th><ReviewObject isHeader>{t('PRODUCT', 'Product')}</ReviewObject></th>
|
|
103
|
-
|
|
82
|
+
<th><ReviewMarkerWrapper isHeader>{t('REVIEWS', 'Reviews')}</ReviewMarkerWrapper></th>
|
|
104
83
|
</tr>
|
|
105
84
|
</thead>
|
|
106
|
-
{
|
|
85
|
+
{productState?.loading ? (
|
|
107
86
|
[...Array(10).keys()].map(i => (
|
|
108
87
|
<ReviewTbody key={i}>
|
|
109
88
|
<tr>
|
|
@@ -115,7 +94,7 @@ export const ReviewProductsListingUI = (props) => {
|
|
|
115
94
|
<p><Skeleton width={80} /></p>
|
|
116
95
|
</ReviewObject>
|
|
117
96
|
</td>
|
|
118
|
-
|
|
97
|
+
<td><ReviewMarkerWrapper><Skeleton width={20} /></ReviewMarkerWrapper></td>
|
|
119
98
|
</tr>
|
|
120
99
|
</ReviewTbody>
|
|
121
100
|
))
|
|
@@ -139,12 +118,16 @@ export const ReviewProductsListingUI = (props) => {
|
|
|
139
118
|
<p>{product?.name}</p>
|
|
140
119
|
</ReviewObject>
|
|
141
120
|
</td>
|
|
142
|
-
|
|
121
|
+
<td>
|
|
143
122
|
<ReviewMarkerWrapper>
|
|
144
|
-
|
|
145
|
-
|
|
123
|
+
{product?.reviews?.total && (
|
|
124
|
+
<>
|
|
125
|
+
<StarFill />
|
|
126
|
+
<p>{product?.reviews?.total}</p>
|
|
127
|
+
</>
|
|
128
|
+
)}
|
|
146
129
|
</ReviewMarkerWrapper>
|
|
147
|
-
</td>
|
|
130
|
+
</td>
|
|
148
131
|
</tr>
|
|
149
132
|
</ReviewTbody>
|
|
150
133
|
))
|
|
@@ -152,7 +135,7 @@ export const ReviewProductsListingUI = (props) => {
|
|
|
152
135
|
</ReviewsTable>
|
|
153
136
|
|
|
154
137
|
{
|
|
155
|
-
!
|
|
138
|
+
!productState.loading && productState?.products?.length > 0 && (
|
|
156
139
|
<PagesBottomContainer>
|
|
157
140
|
<Pagination
|
|
158
141
|
currentPage={currentPage}
|
|
@@ -177,7 +160,7 @@ export const ReviewProductsListingUI = (props) => {
|
|
|
177
160
|
}}
|
|
178
161
|
>
|
|
179
162
|
<ProductReviewDetails
|
|
180
|
-
businessId={
|
|
163
|
+
businessId={businessId}
|
|
181
164
|
product={curProduct}
|
|
182
165
|
productId={curProduct?.id}
|
|
183
166
|
/>
|
|
@@ -188,18 +171,13 @@ export const ReviewProductsListingUI = (props) => {
|
|
|
188
171
|
}
|
|
189
172
|
|
|
190
173
|
export const ReviewProductsListing = (props) => {
|
|
191
|
-
const [isInitialRender, setIsInitialRender] = useState(false)
|
|
192
|
-
|
|
193
174
|
const businessProductslistingProps = {
|
|
194
175
|
...props,
|
|
195
|
-
isAllCategoryProducts: true,
|
|
196
176
|
UIComponent: ReviewProductsListingUI,
|
|
197
|
-
isInitialRender,
|
|
198
177
|
isSearchByName: true,
|
|
199
|
-
isSearchByDescription: true
|
|
200
|
-
handleUpdateInitialRender: (val) => setIsInitialRender(val)
|
|
178
|
+
isSearchByDescription: true
|
|
201
179
|
}
|
|
202
180
|
return (
|
|
203
|
-
<
|
|
181
|
+
<ReviewProductListController {...businessProductslistingProps} />
|
|
204
182
|
)
|
|
205
183
|
}
|
|
@@ -1,58 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import styled, { css } from 'styled-components'
|
|
3
3
|
|
|
4
|
-
export const ReviewsListingContainer = styled.div
|
|
5
|
-
flex: 1;
|
|
6
|
-
padding: 20px;
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
transition: all 0.5s;
|
|
9
|
-
max-height: 100vh;
|
|
10
|
-
overflow: auto;
|
|
11
|
-
`
|
|
12
|
-
|
|
13
|
-
export const Header = styled.div`
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
justify-content: space-between;
|
|
17
|
-
margin-bottom: 20px;
|
|
18
|
-
flex-wrap: wrap;
|
|
19
|
-
row-gap: 20px;
|
|
20
|
-
`
|
|
21
|
-
|
|
22
|
-
export const HeaderLeft = styled.div`
|
|
23
|
-
display: flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
h1 {
|
|
26
|
-
font-size: 20px;
|
|
27
|
-
font-weight: 700;
|
|
28
|
-
color: ${props => props.theme.colors.headingColor};
|
|
29
|
-
margin: 0px;
|
|
30
|
-
}
|
|
31
|
-
> button {
|
|
32
|
-
${props => props.theme?.rtl ? css`
|
|
33
|
-
margin-left: 8px;
|
|
34
|
-
margin-right: -8px;
|
|
35
|
-
` : css`
|
|
36
|
-
margin-right: 8px;
|
|
37
|
-
margin-left: -8px;
|
|
38
|
-
`}
|
|
39
|
-
|
|
40
|
-
svg {
|
|
41
|
-
width: 25px;
|
|
42
|
-
height: 25px;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
`
|
|
46
|
-
|
|
47
|
-
export const HeaderRight = styled.div`
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
|
|
51
|
-
input {
|
|
52
|
-
border: none;
|
|
53
|
-
background-color: ${props => props.theme.colors.secundary};
|
|
54
|
-
}
|
|
55
|
-
`
|
|
4
|
+
export const ReviewsListingContainer = styled.div``
|
|
56
5
|
|
|
57
6
|
export const ReviewsTable = styled.table`
|
|
58
7
|
margin: 10px 0;
|
|
@@ -162,9 +111,10 @@ export const ReviewMarkerWrapper = styled.div`
|
|
|
162
111
|
|
|
163
112
|
${({ isHeader }) => !isHeader && css`
|
|
164
113
|
height: 40px;
|
|
114
|
+
width: 45px;
|
|
165
115
|
display: flex;
|
|
166
116
|
flex-direction: column;
|
|
167
|
-
align-items:
|
|
117
|
+
align-items: center;
|
|
168
118
|
justify-content: center;
|
|
169
119
|
${props => props.theme.colors.rtl ? css`
|
|
170
120
|
border-right: 1px solid ${props => props.theme.colors.borderColor};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
3
|
import { useInfoShare } from '../../../contexts/InfoShareContext'
|
|
4
|
-
import { List as MenuIcon } from 'react-bootstrap-icons'
|
|
4
|
+
import { List as MenuIcon, CaretDownFill } from 'react-bootstrap-icons'
|
|
5
5
|
import { SearchBar } from '../../Shared'
|
|
6
6
|
import { IconButton } from '../../../styles'
|
|
7
7
|
import { BusinessReviewList } from '../BusinessReviewList'
|
|
8
8
|
import { UsersReviewList } from '../UsersReviewList'
|
|
9
|
+
import { BusinessSelectHeader } from '../../Stores/BusinessSelectHeader'
|
|
10
|
+
import { ReviewProductsListing } from '../ReviewProductsListing'
|
|
9
11
|
|
|
10
12
|
import {
|
|
11
13
|
ReviewsListingContainer,
|
|
@@ -13,7 +15,9 @@ import {
|
|
|
13
15
|
HeaderLeft,
|
|
14
16
|
HeaderRight,
|
|
15
17
|
Tabs,
|
|
16
|
-
Tab
|
|
18
|
+
Tab,
|
|
19
|
+
SelectWrapper,
|
|
20
|
+
TitleWrapper
|
|
17
21
|
} from './styles'
|
|
18
22
|
|
|
19
23
|
export const ReviewsListing = (props) => {
|
|
@@ -21,6 +25,24 @@ export const ReviewsListing = (props) => {
|
|
|
21
25
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
22
26
|
const [showOption, setShowOption] = useState('business')
|
|
23
27
|
const [searchValue, setSearchValue] = useState(null)
|
|
28
|
+
const [showSelect, setShowSelect] = useState(false)
|
|
29
|
+
const [business, setBusiness] = useState('')
|
|
30
|
+
|
|
31
|
+
const changeBusinessState = (business) => {
|
|
32
|
+
setShowSelect(false)
|
|
33
|
+
setBusiness(business)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const handleChangeOption = (option) => {
|
|
37
|
+
setShowOption(option)
|
|
38
|
+
if (option === 'products' && !business) setShowSelect(true)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const handleOpenProducts = (business) => {
|
|
42
|
+
setBusiness(business)
|
|
43
|
+
setShowOption('products')
|
|
44
|
+
setShowSelect(false)
|
|
45
|
+
}
|
|
24
46
|
|
|
25
47
|
return (
|
|
26
48
|
<>
|
|
@@ -35,7 +57,24 @@ export const ReviewsListing = (props) => {
|
|
|
35
57
|
<MenuIcon />
|
|
36
58
|
</IconButton>
|
|
37
59
|
)}
|
|
38
|
-
|
|
60
|
+
{showOption === 'products' ? (
|
|
61
|
+
<SelectWrapper>
|
|
62
|
+
<TitleWrapper onClick={() => setShowSelect(prev => !prev)}>
|
|
63
|
+
<h1>{business?.name || t('REVIEWS_MANAGER', 'Reviews manager')}</h1>
|
|
64
|
+
<CaretDownFill className={`${showSelect && 'rotate'}`} />
|
|
65
|
+
</TitleWrapper>
|
|
66
|
+
{showSelect && (
|
|
67
|
+
<BusinessSelectHeader
|
|
68
|
+
close={() => setShowSelect(false)}
|
|
69
|
+
isOpen={showSelect}
|
|
70
|
+
noActiveStatusCondition
|
|
71
|
+
changeBusinessState={changeBusinessState}
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
74
|
+
</SelectWrapper>
|
|
75
|
+
) : (
|
|
76
|
+
<h1>{t('REVIEWS_MANAGER', 'Reviews manager')}</h1>
|
|
77
|
+
)}
|
|
39
78
|
</HeaderLeft>
|
|
40
79
|
<HeaderRight>
|
|
41
80
|
<SearchBar
|
|
@@ -49,31 +88,37 @@ export const ReviewsListing = (props) => {
|
|
|
49
88
|
<Tabs>
|
|
50
89
|
<Tab
|
|
51
90
|
active={showOption === 'business'}
|
|
52
|
-
onClick={() =>
|
|
91
|
+
onClick={() => handleChangeOption('business')}
|
|
53
92
|
>
|
|
54
93
|
{t('BUSINESS', 'Business')}
|
|
55
94
|
</Tab>
|
|
56
95
|
<Tab
|
|
57
96
|
active={showOption === 'drivers'}
|
|
58
|
-
onClick={() =>
|
|
97
|
+
onClick={() => handleChangeOption('drivers')}
|
|
59
98
|
>
|
|
60
99
|
{t('DRIVERS', 'Drivers')}
|
|
61
100
|
</Tab>
|
|
62
101
|
<Tab
|
|
63
102
|
active={showOption === 'customers'}
|
|
64
|
-
onClick={() =>
|
|
103
|
+
onClick={() => handleChangeOption('customers')}
|
|
65
104
|
>
|
|
66
105
|
{t('CUSTOMERS', 'Customers')}
|
|
67
106
|
</Tab>
|
|
68
107
|
<Tab
|
|
69
108
|
active={showOption === 'professionals'}
|
|
70
|
-
onClick={() =>
|
|
109
|
+
onClick={() => handleChangeOption('professionals')}
|
|
71
110
|
>
|
|
72
111
|
{t('PROFESSIONALS', 'Professionals')}
|
|
73
112
|
</Tab>
|
|
113
|
+
<Tab
|
|
114
|
+
active={showOption === 'products'}
|
|
115
|
+
onClick={() => handleChangeOption('products')}
|
|
116
|
+
>
|
|
117
|
+
{t('PRODUCTS', 'Products')}
|
|
118
|
+
</Tab>
|
|
74
119
|
</Tabs>
|
|
75
120
|
{showOption === 'business' && (
|
|
76
|
-
<BusinessReviewList parentSearchValue={searchValue} />
|
|
121
|
+
<BusinessReviewList parentSearchValue={searchValue} handleOpenProducts={handleOpenProducts} />
|
|
77
122
|
)}
|
|
78
123
|
{showOption === 'drivers' && (
|
|
79
124
|
<UsersReviewList
|
|
@@ -93,6 +138,12 @@ export const ReviewsListing = (props) => {
|
|
|
93
138
|
parentSearchValue={searchValue}
|
|
94
139
|
/>
|
|
95
140
|
)}
|
|
141
|
+
{showOption === 'products' && business?.id && (
|
|
142
|
+
<ReviewProductsListing
|
|
143
|
+
parentSearchValue={searchValue}
|
|
144
|
+
businessId={business?.id}
|
|
145
|
+
/>
|
|
146
|
+
)}
|
|
96
147
|
</ReviewsListingContainer>
|
|
97
148
|
</>
|
|
98
149
|
)
|
|
@@ -80,3 +80,22 @@ export const Tab = styled.div`
|
|
|
80
80
|
color: ${props => props.theme.colors.lightGray};
|
|
81
81
|
`}
|
|
82
82
|
`
|
|
83
|
+
|
|
84
|
+
export const SelectWrapper = styled.div`
|
|
85
|
+
position: relative;
|
|
86
|
+
`
|
|
87
|
+
|
|
88
|
+
export const TitleWrapper = styled.div`
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
|
|
93
|
+
svg {
|
|
94
|
+
margin: 0 5px;
|
|
95
|
+
font-size: 16px;
|
|
96
|
+
transition: 0.2s ease-in-out;
|
|
97
|
+
&.rotate {
|
|
98
|
+
transform: rotate(180deg);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
`
|
|
@@ -76,20 +76,20 @@ export const DriversGroupGeneralForm = (props) => {
|
|
|
76
76
|
}
|
|
77
77
|
handleUpdateDriversGroup(changesState)
|
|
78
78
|
} else {
|
|
79
|
-
if (user?.level !== 5 && !changesState?.administrator_id) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
if (typeof changesState?.priority === 'undefined') {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
79
|
+
// if (user?.level !== 5 && !changesState?.administrator_id) {
|
|
80
|
+
// setAlertState({
|
|
81
|
+
// open: true,
|
|
82
|
+
// content: [t('VALIDATION_ERROR_REQUIRED', 'The manager is required.').replace('_attribute_', t('DRIVER_MANAGER', 'Driver manager'))]
|
|
83
|
+
// })
|
|
84
|
+
// return
|
|
85
|
+
// }
|
|
86
|
+
// if (typeof changesState?.priority === 'undefined') {
|
|
87
|
+
// setAlertState({
|
|
88
|
+
// open: true,
|
|
89
|
+
// content: [t('VALIDATION_ERROR_REQUIRED', 'The priority is required.').replace('_attribute_', t('PRIORITY', 'Priority'))]
|
|
90
|
+
// })
|
|
91
|
+
// return
|
|
92
|
+
// }
|
|
93
93
|
if (changesState?.type === 0 && !changesState?.drivers) {
|
|
94
94
|
setAlertState({
|
|
95
95
|
open: true,
|