-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin-ui): design the layout for role-permission mapping #336
- Loading branch information
Showing
3 changed files
with
77 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react' | ||
import { Button, Row, Col, FormGroup } from '../../../../app/components' | ||
|
||
function ItemRow({ key, candidate, permission }) { | ||
function doRemove(item) { | ||
//confirm('=============' + item) | ||
} | ||
return ( | ||
<div key={key}> | ||
<FormGroup row /> | ||
<Row> | ||
<Col sm={10}>{permission}</Col> | ||
<Col sm={2}> | ||
<Button | ||
type="button" | ||
color="danger" | ||
style={{ margin: '1px', float: 'right', padding: '0px' }} | ||
onClick={doRemove(permission)} | ||
> | ||
<i className="fa fa-trash mr-2"></i> | ||
Remove | ||
</Button> | ||
</Col> | ||
</Row> | ||
<FormGroup row /> | ||
</div> | ||
) | ||
} | ||
|
||
export default ItemRow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from 'react' | ||
import { | ||
Row, | ||
Badge, | ||
Col, | ||
FormGroup, | ||
Accordion, | ||
} from '../../../../app/components' | ||
import ItemRow from './ItemRow' | ||
|
||
function MappingItem({ candidate, key }) { | ||
return ( | ||
<div key={key}> | ||
<FormGroup row /> | ||
<Row> | ||
<Col sm={12}> | ||
<Accordion className="mb-12"> | ||
<Accordion.Header className="text-info"> | ||
<Accordion.Indicator className="mr-2" /> | ||
{candidate.role} | ||
<Badge | ||
color="info" | ||
style={{ | ||
float: 'right', | ||
}} | ||
> | ||
{candidate.permissions.length} | ||
</Badge> | ||
</Accordion.Header> | ||
<Accordion.Body> | ||
{candidate.permissions.map((perm, id) => ( | ||
<ItemRow key={id} candiadate={candidate} permission={perm}></ItemRow> | ||
))} | ||
</Accordion.Body> | ||
</Accordion> | ||
</Col> | ||
<FormGroup row /> | ||
</Row> | ||
</div> | ||
) | ||
} | ||
|
||
export default MappingItem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters