File tree Expand file tree Collapse file tree 4 files changed +38
-5
lines changed Expand file tree Collapse file tree 4 files changed +38
-5
lines changed Original file line number Diff line number Diff line change
1
+ import { useTranslation } from 'react-i18next' ;
2
+ import { AclPermission } from './acl' ;
3
+
4
+ export default function AclHeader ( { aclName} : { aclName : string } ) {
5
+ const { t} = useTranslation ( ) ;
6
+
7
+ const aclPermissionLabels : { [ key : string ] : string } = {
8
+ [ AclPermission . VIEW ] : t ( 'acl.permission.view' , 'VIEW' ) ,
9
+ [ AclPermission . SHARE ] : t ( 'acl.permission.share' , 'SHARE' ) ,
10
+ [ AclPermission . CREATE ] : t ( 'acl.permission.create' , 'CREATE' ) ,
11
+ [ AclPermission . EDIT ] : t ( 'acl.permission.edit' , 'EDIT' ) ,
12
+ [ AclPermission . DELETE ] : t ( 'acl.permission.delete' , 'DELETE' ) ,
13
+ [ AclPermission . UNDELETE ] : t ( 'acl.permission.undelete' , 'UNDELETE' ) ,
14
+ [ AclPermission . OPERATOR ] : t ( 'acl.permission.operator' , 'OPERATOR' ) ,
15
+ [ AclPermission . MASTER ] : t ( 'acl.permission.master' , 'MASTER' ) ,
16
+ [ AclPermission . OWNER ] : t ( 'acl.permission.owner' , 'OWNER' ) ,
17
+ [ AclPermission . ALL ] : t ( 'acl.permission.all' , 'ALL' ) ,
18
+ } ;
19
+
20
+ return < span > { aclPermissionLabels [ aclName ] } </ span > ;
21
+ }
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ export default function AttributeEntityFields({
69
69
) : null }
70
70
< FormRow >
71
71
< InputLabel >
72
- { t ( 'form.attribute_entity.synonym .label' , 'Synonyms' ) }
72
+ { t ( 'form.attribute_entity.synonyms .label' , 'Synonyms' ) }
73
73
</ InputLabel >
74
74
< KeyTranslationsWidget
75
75
renderLocale = { l => {
Original file line number Diff line number Diff line change 6
6
import { Ace , UserType } from '../../types' ;
7
7
import { useTranslation } from 'react-i18next' ;
8
8
import { AclPermission , aclPermissions } from '../Acl/acl' ;
9
+ import AclHeader from '../Acl/AclHeader' ;
9
10
import { Box } from '@mui/material' ;
10
11
import PermissionRow from './PermissionRow' ;
11
12
import type { TFunction } from '@alchemy/i18n' ;
@@ -23,15 +24,13 @@ type Props = {
23
24
onMaskChange : OnMaskChange ;
24
25
onDelete : OnPermissionDelete ;
25
26
displayedPermissions ?: DisplayedPermissions ;
26
- permissionHelper ?: PermissionHelpers ;
27
27
} ;
28
28
29
29
export default function PermissionTable ( {
30
30
permissions,
31
31
onMaskChange,
32
32
onDelete,
33
33
displayedPermissions,
34
- permissionHelper,
35
34
} : Props ) {
36
35
const { t} = useTranslation ( ) ;
37
36
@@ -100,7 +99,7 @@ export default function PermissionTable({
100
99
{ allColumns . map ( k => {
101
100
return (
102
101
< th key = { k } className = { 'p' } >
103
- < span > { permissionHelper ?. [ k ] ?. label ?? k } </ span >
102
+ < AclHeader aclName = { k } / >
104
103
</ th >
105
104
) ;
106
105
} ) }
Original file line number Diff line number Diff line change 13
13
}
14
14
},
15
15
"permission" : {
16
- "manage_collection" : " Manage"
16
+ "all" : " ALL" ,
17
+ "create" : " CREATE" ,
18
+ "delete" : " DELETE" ,
19
+ "edit" : " EDIT" ,
20
+ "manage_collection" : " Manage" ,
21
+ "master" : " MASTER" ,
22
+ "operator" : " OPERATOR" ,
23
+ "owner" : " OWNER" ,
24
+ "share" : " SHARE" ,
25
+ "undelete" : " UNDELETE" ,
26
+ "view" : " VIEW"
17
27
},
18
28
"table" : {
19
29
"cols" : {
719
729
},
720
730
"attribute_entity" : {
721
731
"synonym" : {
732
+ "label" : " Synonym"
733
+ },
734
+ "synonyms" : {
722
735
"label" : " Synonyms"
723
736
},
724
737
"value" : {
You can’t perform that action at this time.
0 commit comments