@@ -4,6 +4,9 @@ import cn from 'bem-cn-lite';
4
4
import { useLocation } from 'react-router' ;
5
5
import qs from 'qs' ;
6
6
7
+ import EmptyState from '../../components/EmptyState/EmptyState' ;
8
+ import { Illustration } from '../../components/Illustration' ;
9
+
7
10
import ObjectSummary from './ObjectSummary/ObjectSummary' ;
8
11
import { setHeader } from '../../store/reducers/header' ;
9
12
import ObjectGeneral from './ObjectGeneral/ObjectGeneral' ;
@@ -53,6 +56,9 @@ function Tenant(props: TenantProps) {
53
56
( state : any ) => state . schema ,
54
57
) ;
55
58
59
+ const { data : { status : tenantStatus = 200 } = { } } = useSelector ( ( state : any ) => state . tenant ) ;
60
+ const { error : { status : schemaStatus = 200 } = { } } = useSelector ( ( state : any ) => state . schema ) ;
61
+
56
62
const dispatch = useDispatch ( ) ;
57
63
58
64
const location = useLocation ( ) ;
@@ -111,29 +117,39 @@ function Tenant(props: TenantProps) {
111
117
dispatchSummaryVisibilityAction ( PaneVisibilityActionTypes . clear ) ;
112
118
} ;
113
119
120
+ const showBlockingError = tenantStatus === 403 || schemaStatus === 403 ;
121
+
114
122
return (
115
123
< div className = { b ( ) } >
116
- < SplitPane
117
- defaultSizePaneKey = { DEFAULT_SIZE_TENANT_KEY }
118
- defaultSizes = { [ 25 , 75 ] }
119
- triggerCollapse = { summaryVisibilityState . triggerCollapse }
120
- triggerExpand = { summaryVisibilityState . triggerExpand }
121
- minSize = { [ 36 , 200 ] }
122
- onSplitStartDragAdditional = { onSplitStartDragAdditional }
123
- >
124
- < ObjectSummary
125
- type = { currentPathType }
126
- onCollapseSummary = { onCollapseSummaryHandler }
127
- onExpandSummary = { onExpandSummaryHandler }
128
- isCollapsed = { summaryVisibilityState . collapsed }
129
- additionalTenantInfo = { props . additionalTenantInfo }
130
- />
131
- < ObjectGeneral
132
- type = { currentPathType }
133
- additionalTenantInfo = { props . additionalTenantInfo }
134
- additionalNodesInfo = { props . additionalNodesInfo }
124
+ { showBlockingError ? (
125
+ < EmptyState
126
+ image = { < Illustration name = "403" /> }
127
+ title = "Access denied"
128
+ description = "You don’t have the necessary roles to view this page."
135
129
/>
136
- </ SplitPane >
130
+ ) : (
131
+ < SplitPane
132
+ defaultSizePaneKey = { DEFAULT_SIZE_TENANT_KEY }
133
+ defaultSizes = { [ 25 , 75 ] }
134
+ triggerCollapse = { summaryVisibilityState . triggerCollapse }
135
+ triggerExpand = { summaryVisibilityState . triggerExpand }
136
+ minSize = { [ 36 , 200 ] }
137
+ onSplitStartDragAdditional = { onSplitStartDragAdditional }
138
+ >
139
+ < ObjectSummary
140
+ type = { currentPathType }
141
+ onCollapseSummary = { onCollapseSummaryHandler }
142
+ onExpandSummary = { onExpandSummaryHandler }
143
+ isCollapsed = { summaryVisibilityState . collapsed }
144
+ additionalTenantInfo = { props . additionalTenantInfo }
145
+ />
146
+ < ObjectGeneral
147
+ type = { currentPathType }
148
+ additionalTenantInfo = { props . additionalTenantInfo }
149
+ additionalNodesInfo = { props . additionalNodesInfo }
150
+ />
151
+ </ SplitPane >
152
+ ) }
137
153
</ div >
138
154
) ;
139
155
}
0 commit comments