ordering-ui-admin-external 1.43.27 → 1.43.29
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.8d98f68e3600ae0aa81d.js → ordering-ui-admin.f248812e2a3189380b5f.js} +2 -2
- package/_modules/components/Delivery/DeliveryUsersListing/index.js +10 -6
- package/_modules/components/Delivery/UserDetails/index.js +2 -1
- package/_modules/components/Orders/OrderBill/index.js +4 -3
- package/_modules/components/Orders/OrderContactInformation/index.js +4 -3
- package/_modules/components/Orders/OrderDetails/index.js +7 -2
- package/_modules/components/Orders/OrderStatusTypeSelector/index.js +4 -2
- package/_modules/components/Orders/WebsocketStatus/styles.js +2 -2
- package/_modules/components/SidebarMenu/index.js +32 -29
- package/package.json +1 -1
- package/src/components/Delivery/DeliveryUsersListing/index.js +7 -5
- package/src/components/Delivery/UserDetails/index.js +2 -1
- package/src/components/Orders/OrderBill/index.js +4 -3
- package/src/components/Orders/OrderContactInformation/index.js +9 -6
- package/src/components/Orders/OrderDetails/index.js +6 -0
- package/src/components/Orders/OrderStatusTypeSelector/index.js +3 -1
- package/src/components/Orders/WebsocketStatus/styles.js +4 -3
- package/src/components/SidebarMenu/index.js +92 -88
- package/template/app.js +5 -2
- /package/_bundles/{ordering-ui-admin.8d98f68e3600ae0aa81d.js.LICENSE.txt → ordering-ui-admin.f248812e2a3189380b5f.js.LICENSE.txt} +0 -0
|
@@ -51,6 +51,7 @@ export const OrderContactInformation = (props) => {
|
|
|
51
51
|
const [{ optimizeImage }] = useUtils()
|
|
52
52
|
const [{ configs }] = useConfig()
|
|
53
53
|
const googleInputRef = useRef(null)
|
|
54
|
+
const readOnlyBusinessOwner = user?.readOnlyBusinessOwner
|
|
54
55
|
|
|
55
56
|
const googleMapsApiKey = configs?.google_maps_api_key?.value
|
|
56
57
|
const isDisableDriverCompanies = configs?.disable_companies_order_details?.value === '1'
|
|
@@ -211,10 +212,12 @@ export const OrderContactInformation = (props) => {
|
|
|
211
212
|
</ReviewButton>
|
|
212
213
|
)}
|
|
213
214
|
</InfoContent>
|
|
214
|
-
|
|
215
|
-
<
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
{!readOnlyBusinessOwner && (
|
|
216
|
+
<ActionIconWrapper>
|
|
217
|
+
<Pencil className='edit-icon' onClick={handleEdit} />
|
|
218
|
+
<ChevronDown className='down-arrow' />
|
|
219
|
+
</ActionIconWrapper>
|
|
220
|
+
)}
|
|
218
221
|
</CustomerInfo>
|
|
219
222
|
</ContextAwareToggle>
|
|
220
223
|
<Accordion.Collapse eventKey='1'>
|
|
@@ -348,7 +351,7 @@ export const OrderContactInformation = (props) => {
|
|
|
348
351
|
</Accordion>
|
|
349
352
|
{deliveryTypes.includes(order?.delivery_type) && !isServiceOrder && (
|
|
350
353
|
<>
|
|
351
|
-
{!order?.driver_id && !isDisableDriverCompanies && (
|
|
354
|
+
{!order?.driver_id && !isDisableDriverCompanies && !readOnlyBusinessOwner && (
|
|
352
355
|
<CompanySelectorContainer>
|
|
353
356
|
<p>{t('DRIVER_COMPANY', 'Driver company')}</p>
|
|
354
357
|
<CompanySelector
|
|
@@ -365,7 +368,7 @@ export const OrderContactInformation = (props) => {
|
|
|
365
368
|
/>
|
|
366
369
|
</CompanySelectorContainer>
|
|
367
370
|
)}
|
|
368
|
-
{!order?.driver_company_id && !commentInfoState?.open && (
|
|
371
|
+
{!order?.driver_company_id && !commentInfoState?.open && !readOnlyBusinessOwner && (
|
|
369
372
|
<DriverSelectorContainer>
|
|
370
373
|
<p>{t('DRIVER_ASSIGN', 'Driver assign')}</p>
|
|
371
374
|
<DriverSelector
|
|
@@ -104,6 +104,10 @@ const OrderDetailsUI = (props) => {
|
|
|
104
104
|
const [commentInfoState, setCommentInfostate] = useState({ open: false, driverId: null })
|
|
105
105
|
const cateringTypes = [7, 8]
|
|
106
106
|
const placeSpotEnabled = [3, 4]
|
|
107
|
+
const readOnlyBusinessOwner = user?.readOnlyBusinessOwner
|
|
108
|
+
const readOnlyDeliveryManager = user?.readOnlyDeliveryManager
|
|
109
|
+
const readOnlyAdmin = user?.readOnlyAdmin
|
|
110
|
+
|
|
107
111
|
const {
|
|
108
112
|
order,
|
|
109
113
|
loading
|
|
@@ -375,6 +379,7 @@ const OrderDetailsUI = (props) => {
|
|
|
375
379
|
deliveryType={order?.delivery_type}
|
|
376
380
|
defaultValue={parseInt(order.status)}
|
|
377
381
|
handleUpdateOrderStatus={handleUpdateOrderStatus}
|
|
382
|
+
viewOnly={(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner)}
|
|
378
383
|
/>
|
|
379
384
|
</OrderStatusSelectorWrapper>
|
|
380
385
|
</OrderStatus>
|
|
@@ -445,6 +450,7 @@ const OrderDetailsUI = (props) => {
|
|
|
445
450
|
actionStatus={actionStatus}
|
|
446
451
|
handleRefundPaymentsStripe={handleRefundPaymentsStripe}
|
|
447
452
|
handleOrderRefund={handleOrderRefund}
|
|
453
|
+
viewOnly={(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner)}
|
|
448
454
|
/>
|
|
449
455
|
</div>
|
|
450
456
|
<DetailBottom />
|
|
@@ -20,7 +20,8 @@ export const OrderStatusTypeSelector = (props) => {
|
|
|
20
20
|
filterValues,
|
|
21
21
|
handleUpdateOrderStatus,
|
|
22
22
|
handleChangeMultiOrdersStatus,
|
|
23
|
-
handleChangeOrderStatus
|
|
23
|
+
handleChangeOrderStatus,
|
|
24
|
+
viewOnly
|
|
24
25
|
} = props
|
|
25
26
|
|
|
26
27
|
const [, t] = useLanguage()
|
|
@@ -551,6 +552,7 @@ export const OrderStatusTypeSelector = (props) => {
|
|
|
551
552
|
isShowSearchBar
|
|
552
553
|
searchValue={searchValue}
|
|
553
554
|
handleChangeSearch={handleChangeSearch}
|
|
555
|
+
isDisabled={viewOnly}
|
|
554
556
|
/>
|
|
555
557
|
) : (
|
|
556
558
|
<Select
|
|
@@ -7,7 +7,7 @@ export const Contatiner = styled.div`
|
|
|
7
7
|
> button {
|
|
8
8
|
height: 41px;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
@media (min-width: 576px) {
|
|
12
12
|
${props => props.theme?.rtl ? css`
|
|
13
13
|
margin-left: 10px;
|
|
@@ -89,7 +89,7 @@ export const InfoContent = styled.div`
|
|
|
89
89
|
visibility: hidden;
|
|
90
90
|
opacity: 0;
|
|
91
91
|
/* display: none; */
|
|
92
|
-
|
|
92
|
+
left: 0px;
|
|
93
93
|
${props => props.theme.rtl && css`
|
|
94
94
|
left: 0px;
|
|
95
95
|
right: initial;
|
|
@@ -112,7 +112,8 @@ export const InfoContent = styled.div`
|
|
|
112
112
|
@media (min-width: 576px) {
|
|
113
113
|
min-width: 350px;
|
|
114
114
|
padding: 12px 15px;
|
|
115
|
-
|
|
115
|
+
right: 0px;
|
|
116
|
+
left: auto;
|
|
116
117
|
${props => props.theme.rtl && css`
|
|
117
118
|
right: 0px;
|
|
118
119
|
left: initial;
|
|
@@ -60,7 +60,9 @@ const SidebarMenuUI = (props) => {
|
|
|
60
60
|
const windowSize = useWindowSize()
|
|
61
61
|
const isPoweredByOrderingModule = configs?.powered_by_ordering_module?.value
|
|
62
62
|
const isEnabledAppointmentsFeature = configs?.appointments?.value
|
|
63
|
-
|
|
63
|
+
const readOnlyBusinessOwner = sessionState?.user?.readOnlyBusinessOwner
|
|
64
|
+
const readOnlyDeliveryManager = sessionState?.user?.readOnlyDeliveryManager
|
|
65
|
+
const readOnlyAdmin = sessionState?.user?.readOnlyAdmin
|
|
64
66
|
const [showMessage, setShowMessage] = useState(false)
|
|
65
67
|
|
|
66
68
|
const ordersSubMenus = [
|
|
@@ -344,28 +346,28 @@ const SidebarMenuUI = (props) => {
|
|
|
344
346
|
title: t('DRIVER_MANAGERS', 'Drivers manager'),
|
|
345
347
|
pageName: 'drivers_managers',
|
|
346
348
|
url: '/delivery/drivers-managers',
|
|
347
|
-
enabled: sessionState?.user?.level === 0
|
|
349
|
+
enabled: sessionState?.user?.level === 0 && !(readOnlyAdmin || readOnlyDeliveryManager)
|
|
348
350
|
},
|
|
349
351
|
{
|
|
350
352
|
id: 3,
|
|
351
353
|
title: t('DELIVERY_COMPANIES', 'Delivery companies'),
|
|
352
354
|
pageName: 'drivers_companies',
|
|
353
355
|
url: '/delivery/drivers-companies',
|
|
354
|
-
enabled: sessionState?.user?.level === 0
|
|
356
|
+
enabled: sessionState?.user?.level === 0 && !(readOnlyAdmin || readOnlyDeliveryManager)
|
|
355
357
|
},
|
|
356
358
|
{
|
|
357
359
|
id: 4,
|
|
358
360
|
title: t('DELIVERY_AUTOMATION', 'Delivery automation'),
|
|
359
361
|
pageName: 'drivers_groups',
|
|
360
362
|
url: '/delivery/drivers-groups',
|
|
361
|
-
enabled: sessionState?.user?.level === 5 || sessionState?.user?.level === 0
|
|
363
|
+
enabled: (sessionState?.user?.level === 5 || sessionState?.user?.level === 0) && !(readOnlyAdmin || readOnlyDeliveryManager)
|
|
362
364
|
},
|
|
363
365
|
{
|
|
364
366
|
id: 5,
|
|
365
367
|
title: t('DRIVERS_TIME_DISPLAY', 'Drivers time display'),
|
|
366
368
|
pageName: 'drivers_time_display',
|
|
367
369
|
url: '/delivery/drivers-time-display',
|
|
368
|
-
enabled: sessionState?.user?.level === 5 || sessionState?.user?.level === 0
|
|
370
|
+
enabled: (sessionState?.user?.level === 5 || sessionState?.user?.level === 0) && !(readOnlyAdmin || readOnlyDeliveryManager)
|
|
369
371
|
}
|
|
370
372
|
]
|
|
371
373
|
|
|
@@ -512,7 +514,7 @@ const SidebarMenuUI = (props) => {
|
|
|
512
514
|
</Button>
|
|
513
515
|
)} */}
|
|
514
516
|
|
|
515
|
-
{sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8 && (
|
|
517
|
+
{sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8 && !(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner) && (
|
|
516
518
|
<MenuContainer>
|
|
517
519
|
<ContextAwareToggle
|
|
518
520
|
eventKey='0'
|
|
@@ -548,8 +550,8 @@ const SidebarMenuUI = (props) => {
|
|
|
548
550
|
<MenuContent>
|
|
549
551
|
{ordersSubMenus.map(item => (
|
|
550
552
|
!(sessionState?.user?.level === 2 && item.pageName === 'drivers') &&
|
|
551
|
-
!((sessionState?.user?.level === 2 || sessionState?.user?.level === 5) && item.pageName === 'giftCards') &&
|
|
552
|
-
!(sessionState?.user?.level === 5 && item.pageName === 'appointments') && (
|
|
553
|
+
!((sessionState?.user?.level === 2 || sessionState?.user?.level === 5 || readOnlyAdmin) && item.pageName === 'giftCards') &&
|
|
554
|
+
!((sessionState?.user?.level === 5 || readOnlyAdmin) && item.pageName === 'appointments') && (
|
|
553
555
|
item.pageName === 'appointments' ? (
|
|
554
556
|
isEnabledAppointmentsFeature && (
|
|
555
557
|
<SubMenu
|
|
@@ -576,7 +578,7 @@ const SidebarMenuUI = (props) => {
|
|
|
576
578
|
</MenuContainer>
|
|
577
579
|
)}
|
|
578
580
|
|
|
579
|
-
{(sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8) && (
|
|
581
|
+
{(sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8) && !(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner) && (
|
|
580
582
|
<MenuContainer>
|
|
581
583
|
<ContextAwareToggle
|
|
582
584
|
eventKey='2'
|
|
@@ -590,7 +592,7 @@ const SidebarMenuUI = (props) => {
|
|
|
590
592
|
</MenuContainer>
|
|
591
593
|
)}
|
|
592
594
|
|
|
593
|
-
{(sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8) && (
|
|
595
|
+
{(sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8) && !(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner) && (
|
|
594
596
|
<MenuContainer>
|
|
595
597
|
<ContextAwareToggle
|
|
596
598
|
eventKey='3'
|
|
@@ -619,7 +621,7 @@ const SidebarMenuUI = (props) => {
|
|
|
619
621
|
</MenuContainer>
|
|
620
622
|
)}
|
|
621
623
|
|
|
622
|
-
{(sessionState?.user?.level === 0 || sessionState?.user?.level === 2) && (
|
|
624
|
+
{(sessionState?.user?.level === 0 || sessionState?.user?.level === 2) && !(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner) && (
|
|
623
625
|
<MenuContainer>
|
|
624
626
|
<ContextAwareToggle
|
|
625
627
|
eventKey='4'
|
|
@@ -666,7 +668,7 @@ const SidebarMenuUI = (props) => {
|
|
|
666
668
|
</MenuContainer>
|
|
667
669
|
)}
|
|
668
670
|
|
|
669
|
-
{(sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8) && (
|
|
671
|
+
{(sessionState?.user?.level !== 5 && sessionState?.user?.level !== 8) && !(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner) && (
|
|
670
672
|
<MenuContainer>
|
|
671
673
|
<ContextAwareToggle
|
|
672
674
|
eventKey='5'
|
|
@@ -735,14 +737,14 @@ const SidebarMenuUI = (props) => {
|
|
|
735
737
|
</MenuContainer>
|
|
736
738
|
)}
|
|
737
739
|
|
|
738
|
-
{sessionState?.user?.level === 0 && (
|
|
740
|
+
{sessionState?.user?.level === 0 && !(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner) && (
|
|
739
741
|
<MenuContainer>
|
|
740
742
|
<ContextAwareToggle
|
|
741
743
|
eventKey='8'
|
|
742
744
|
active={
|
|
743
745
|
location.pathname === '/marketing/promotions-enterprise' ||
|
|
744
746
|
location.pathname === '/marketing/campaign' ||
|
|
745
|
-
location.pathname === '/marketing/ad-banners'||
|
|
747
|
+
location.pathname === '/marketing/ad-banners' ||
|
|
746
748
|
location.pathname === '/loyalty/rewards-programs' ||
|
|
747
749
|
location.pathname === '/loyalty/levels' ||
|
|
748
750
|
location.pathname === '/loyalty/reports' ||
|
|
@@ -769,7 +771,7 @@ const SidebarMenuUI = (props) => {
|
|
|
769
771
|
</MenuContainer>
|
|
770
772
|
)}
|
|
771
773
|
|
|
772
|
-
{/* {sessionState?.user?.level === 0 && (
|
|
774
|
+
{/* {sessionState?.user?.level === 0 && !(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner) && (
|
|
773
775
|
<MenuContainer>
|
|
774
776
|
<ContextAwareToggle
|
|
775
777
|
eventKey='9'
|
|
@@ -798,7 +800,7 @@ const SidebarMenuUI = (props) => {
|
|
|
798
800
|
</MenuContainer>
|
|
799
801
|
)}
|
|
800
802
|
|
|
801
|
-
{sessionState?.user?.level === 0 && (
|
|
803
|
+
{sessionState?.user?.level === 0 && !(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner) && (
|
|
802
804
|
<MenuContainer>
|
|
803
805
|
<ContextAwareToggle
|
|
804
806
|
eventKey='10'
|
|
@@ -825,7 +827,7 @@ const SidebarMenuUI = (props) => {
|
|
|
825
827
|
</Accordion.Collapse>
|
|
826
828
|
</MenuContainer>
|
|
827
829
|
)} */}
|
|
828
|
-
{sessionState?.user?.level === 0 && (
|
|
830
|
+
{sessionState?.user?.level === 0 && !(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner) && (
|
|
829
831
|
<MenuContainer>
|
|
830
832
|
<span>{t('SALES_CHANNELS_AND_PRODUCTS', 'Sales channels and products')}</span>
|
|
831
833
|
<ContextAwareToggle
|
|
@@ -861,77 +863,79 @@ const SidebarMenuUI = (props) => {
|
|
|
861
863
|
)}
|
|
862
864
|
</Accordion>
|
|
863
865
|
</div>
|
|
864
|
-
|
|
865
|
-
<
|
|
866
|
-
<
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
<
|
|
871
|
-
<
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
<
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
866
|
+
{!(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner) && (
|
|
867
|
+
<div className='d-flex flex-column mt-4'>
|
|
868
|
+
<LanguageSelectorContainer>
|
|
869
|
+
<LanguageSelector />
|
|
870
|
+
</LanguageSelectorContainer>
|
|
871
|
+
{sessionState?.user?.level === 0 && (
|
|
872
|
+
<Accordion>
|
|
873
|
+
<MenuContainer>
|
|
874
|
+
<ContextAwareToggle
|
|
875
|
+
eventKey='5'
|
|
876
|
+
active={
|
|
877
|
+
location.pathname === '/settings/basic' ||
|
|
878
|
+
location.pathname === '/settings/operation' ||
|
|
879
|
+
location.pathname === '/settings/plugin' ||
|
|
880
|
+
location.pathname === '/settings/pages' ||
|
|
881
|
+
location.pathname === '/settings/integrations' ||
|
|
882
|
+
location.pathname === '/settings/places' ||
|
|
883
|
+
location.pathname === '/settings/advanced' ||
|
|
884
|
+
location.pathname === '/settings/language' ||
|
|
885
|
+
location.pathname === '/settings/logs'
|
|
886
|
+
}
|
|
887
|
+
>
|
|
888
|
+
<GearIcon />
|
|
889
|
+
<span>{t('SETTINGS', 'Settings')}</span>
|
|
890
|
+
</ContextAwareToggle>
|
|
891
|
+
<Accordion.Collapse eventKey='5'>
|
|
892
|
+
<MenuContent>
|
|
893
|
+
{settingsSubMenus.map(item => (
|
|
894
|
+
<SubMenu
|
|
895
|
+
key={item.id}
|
|
896
|
+
active={location.pathname.includes(item.pageName) || location.pathname.includes(item?.url)}
|
|
897
|
+
onClick={() => handleGoToPage({ page: item.pageName })}
|
|
898
|
+
>
|
|
899
|
+
{firstLetterCapital(item.title)}
|
|
900
|
+
</SubMenu>
|
|
901
|
+
))}
|
|
902
|
+
</MenuContent>
|
|
903
|
+
</Accordion.Collapse>
|
|
904
|
+
</MenuContainer>
|
|
905
|
+
</Accordion>
|
|
906
|
+
)}
|
|
907
|
+
{/* {sessionState?.user?.level === 0 && (
|
|
908
|
+
<Button
|
|
909
|
+
className='d-flex align-items-center'
|
|
910
|
+
variant={location.pathname === '/ordering-products' && 'primary'}
|
|
911
|
+
onClick={() => handleGoToPage({ page: 'ordering_products' })}
|
|
912
|
+
>
|
|
913
|
+
<WindowDock />
|
|
914
|
+
<span>{t('ORDERING_PRODUCTS', 'Ordering products')}</span>
|
|
915
|
+
</Button>
|
|
916
|
+
)} */}
|
|
917
|
+
{sessionState?.user?.level === 0 && (
|
|
918
|
+
<Button
|
|
919
|
+
className='d-flex align-items-center'
|
|
920
|
+
variant={location.pathname === '/support' && 'primary'}
|
|
921
|
+
onClick={() => handleGoToPage({ page: 'support' })}
|
|
922
|
+
>
|
|
923
|
+
<HeadsetIcon />
|
|
924
|
+
<span>{t('SUPPORT', 'Support')}</span>
|
|
925
|
+
</Button>
|
|
926
|
+
)}
|
|
927
|
+
{sessionState?.user?.level === 0 && (
|
|
928
|
+
<Button
|
|
929
|
+
className='d-flex align-items-center'
|
|
930
|
+
variant={false}
|
|
931
|
+
onClick={() => handleClickBilling()}
|
|
932
|
+
>
|
|
933
|
+
<Cash />
|
|
934
|
+
<span>{t('BILLING', 'Billing')}</span>
|
|
935
|
+
</Button>
|
|
936
|
+
)}
|
|
937
|
+
</div>
|
|
938
|
+
)}
|
|
935
939
|
</SidebarContent>
|
|
936
940
|
<UserInfo
|
|
937
941
|
id='user_info'
|
package/template/app.js
CHANGED
|
@@ -106,6 +106,9 @@ export const App = () => {
|
|
|
106
106
|
const onlineStatus = useOnlineStatus()
|
|
107
107
|
const { height } = useWindowSize()
|
|
108
108
|
|
|
109
|
+
const readOnlyBusinessOwner = user?.readOnlyBusinessOwner
|
|
110
|
+
const readOnlyDeliveryManager = user?.readOnlyDeliveryManager
|
|
111
|
+
const readOnlyAdmin = user?.readOnlyAdmin
|
|
109
112
|
const cannyAppId = '5b05e5e2d3f6c47201694ad4'
|
|
110
113
|
const isPastDue = projectStatus.project?.current_status === 'past_due'
|
|
111
114
|
const showBanner = auth && isPastDue
|
|
@@ -232,7 +235,7 @@ export const App = () => {
|
|
|
232
235
|
<Route exact path='/'>
|
|
233
236
|
{
|
|
234
237
|
auth
|
|
235
|
-
? (user?.level !== 5 && user?.level !== 8)
|
|
238
|
+
? ((user?.level !== 5 && user?.level !== 8) && !(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner))
|
|
236
239
|
? <Redirect to='/home' />
|
|
237
240
|
: user?.level === 8 ? <Redirect to='/profile' /> : <Redirect to='/orders' />
|
|
238
241
|
: (queryProject && queryToken)
|
|
@@ -291,7 +294,7 @@ export const App = () => {
|
|
|
291
294
|
<Route exact path='/home'>
|
|
292
295
|
{
|
|
293
296
|
auth
|
|
294
|
-
? (user?.level !== 5 && user?.level !== 8)
|
|
297
|
+
? ((user?.level !== 5 && user?.level !== 8) && !(readOnlyAdmin || readOnlyDeliveryManager || readOnlyBusinessOwner))
|
|
295
298
|
? <Home />
|
|
296
299
|
: user?.level === 8 ? <Redirect to='/profile' /> : <Redirect to='/orders' />
|
|
297
300
|
: <Redirect to='/login' />
|