Skip to content

Commit 36c8bfc

Browse files
committed
feat(admin-ui): design the layout for role-permission mapping #336
1 parent 207c282 commit 36c8bfc

File tree

2 files changed

+2
-331
lines changed

2 files changed

+2
-331
lines changed

plugins/admin/components/Mapping/MappingPage.js

+2-17
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Card, CardBody, FormGroup } from '../../../../app/components'
55
import GluuViewWrapper from '../../../../app/routes/Apps/Gluu/GluuViewWrapper'
66
import GluuRibbon from '../../../../app/routes/Apps/Gluu/GluuRibbon'
77
import { getMapping } from '../../redux/actions/MappingActions'
8-
import config from './apiconfig'
98
import MappingItem from './MappingItem'
109
import {
1110
hasPermission,
@@ -16,23 +15,12 @@ import {
1615
function MappingPage({ mapping, permissions, dispatch }) {
1716
const { t } = useTranslation()
1817
const options = []
19-
const [patches, setPatches] = useState([])
20-
const [mappings, setMappings] = useState(
21-
config['rolePermissionMapping'] || [],
22-
)
2318
const userAction = {}
2419
useEffect(() => {
2520
buildPayload(userAction, 'ROLES_MAPPING', options)
2621
dispatch(getMapping(userAction))
2722
}, [])
2823

29-
const patchHandler = (patch) => {
30-
setPatches((existingPatches) => [...existingPatches, patch])
31-
const newPatches = patches
32-
newPatches.push(patch)
33-
setPatches(newPatches)
34-
}
35-
3624
return (
3725
<Card>
3826
<GluuRibbon title={t('titles.mapping')} fromLeft />
@@ -41,11 +29,8 @@ function MappingPage({ mapping, permissions, dispatch }) {
4129
<FormGroup row />
4230
<FormGroup row />
4331
<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} />
4934
))}
5035
</GluuViewWrapper>
5136
</CardBody>

plugins/admin/components/Mapping/apiconfig.js

-314
This file was deleted.

0 commit comments

Comments
 (0)