@@ -5,7 +5,6 @@ import { Card, CardBody, FormGroup } from '../../../../app/components'
5
5
import GluuViewWrapper from '../../../../app/routes/Apps/Gluu/GluuViewWrapper'
6
6
import GluuRibbon from '../../../../app/routes/Apps/Gluu/GluuRibbon'
7
7
import { getMapping } from '../../redux/actions/MappingActions'
8
- import config from './apiconfig'
9
8
import MappingItem from './MappingItem'
10
9
import {
11
10
hasPermission ,
@@ -16,23 +15,12 @@ import {
16
15
function MappingPage ( { mapping, permissions, dispatch } ) {
17
16
const { t } = useTranslation ( )
18
17
const options = [ ]
19
- const [ patches , setPatches ] = useState ( [ ] )
20
- const [ mappings , setMappings ] = useState (
21
- config [ 'rolePermissionMapping' ] || [ ] ,
22
- )
23
18
const userAction = { }
24
19
useEffect ( ( ) => {
25
20
buildPayload ( userAction , 'ROLES_MAPPING' , options )
26
21
dispatch ( getMapping ( userAction ) )
27
22
} , [ ] )
28
23
29
- const patchHandler = ( patch ) => {
30
- setPatches ( ( existingPatches ) => [ ...existingPatches , patch ] )
31
- const newPatches = patches
32
- newPatches . push ( patch )
33
- setPatches ( newPatches )
34
- }
35
-
36
24
return (
37
25
< Card >
38
26
< GluuRibbon title = { t ( 'titles.mapping' ) } fromLeft />
@@ -41,11 +29,8 @@ function MappingPage({ mapping, permissions, dispatch }) {
41
29
< FormGroup row />
42
30
< FormGroup row />
43
31
< GluuViewWrapper canShow = { hasPermission ( permissions , ROLE_READ ) } >
44
- { mappings . map ( ( candidate , idx ) => (
45
- < MappingItem
46
- key = { idx }
47
- candidate = { candidate }
48
- />
32
+ { mapping . map ( ( candidate , idx ) => (
33
+ < MappingItem key = { idx } candidate = { candidate } />
49
34
) ) }
50
35
</ GluuViewWrapper >
51
36
</ CardBody >
0 commit comments