File tree Expand file tree Collapse file tree 6 files changed +41
-7
lines changed Expand file tree Collapse file tree 6 files changed +41
-7
lines changed Original file line number Diff line number Diff line change 1+ import EmptyState from '../../EmptyState/EmptyState' ;
2+ import { Illustration } from '../../Illustration' ;
3+
4+ import i18n from '../i18n' ;
5+
6+ interface AccessDeniedProps {
7+ title ?: string ;
8+ description ?: string ;
9+ }
10+
11+ export const AccessDenied = ( { title, description} : AccessDeniedProps ) => {
12+ return (
13+ < EmptyState
14+ image = { < Illustration name = "403" /> }
15+ title = { title || i18n ( '403.title' ) }
16+ description = { description || i18n ( '403.description' ) }
17+ />
18+ ) ;
19+ } ;
Original file line number Diff line number Diff line change 1+ export * from './AccessDenied' ;
Original file line number Diff line number Diff line change 1+ {
2+ "403.title" : " Access denied" ,
3+ "403.description" : " You don’t have the necessary roles to view this page."
4+ }
Original file line number Diff line number Diff line change 1+ import { i18n , Lang } from '../../../utils/i18n' ;
2+
3+ import en from './en.json' ;
4+ import ru from './ru.json' ;
5+
6+ const COMPONENT = 'ydb-errors-access-denied' ;
7+
8+ i18n . registerKeyset ( Lang . En , COMPONENT , en ) ;
9+ i18n . registerKeyset ( Lang . Ru , COMPONENT , ru ) ;
10+
11+ export default i18n . keyset ( COMPONENT ) ;
Original file line number Diff line number Diff line change 1+ {
2+ "403.title" : " Доступ запрещен" ,
3+ "403.description" : " У вас недостаточно прав для просмотра данной страницы."
4+ }
Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ import cn from 'bem-cn-lite';
44import { useLocation } from 'react-router' ;
55import qs from 'qs' ;
66
7- import EmptyState from '../../components/EmptyState/EmptyState' ;
8- import { Illustration } from '../../components/Illustration' ;
7+ import { AccessDenied } from '../../components/Errors/403' ;
98
109import { setHeader } from '../../store/reducers/header' ;
1110import ObjectGeneralTabs from './ObjectGeneralTabs/ObjectGeneralTabs' ;
@@ -129,11 +128,7 @@ function Tenant(props: TenantProps) {
129128 return (
130129 < div className = { b ( ) } >
131130 { showBlockingError ? (
132- < EmptyState
133- image = { < Illustration name = "403" /> }
134- title = "Access denied"
135- description = "You don’t have the necessary roles to view this page."
136- />
131+ < AccessDenied />
137132 ) : (
138133 < >
139134 < ObjectGeneralTabs />
You can’t perform that action at this time.
0 commit comments