mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-07 08:31:47 -05:00
Add roles modal to org access list
This commit is contained in:
50
src/components/AddRole/CheckboxCard.jsx
Normal file
50
src/components/AddRole/CheckboxCard.jsx
Normal file
@@ -0,0 +1,50 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {
|
||||
Checkbox
|
||||
} from '@patternfly/react-core';
|
||||
|
||||
class CheckboxCard extends Component {
|
||||
render () {
|
||||
const { name, description, isSelected, onSelect, itemId } = this.props;
|
||||
return (
|
||||
<div style={{
|
||||
display: 'flex',
|
||||
border: '1px solid var(--pf-global--BorderColor)',
|
||||
borderRadius: 'var(--pf-global--BorderRadius--sm)',
|
||||
padding: '10px'
|
||||
}}
|
||||
>
|
||||
<Checkbox
|
||||
checked={isSelected}
|
||||
onChange={onSelect}
|
||||
aria-label={name}
|
||||
id={`checkbox-card-${itemId}`}
|
||||
label={(
|
||||
<Fragment>
|
||||
<div style={{ fontWeight: 'bold' }}>{name}</div>
|
||||
<div>{description}</div>
|
||||
</Fragment>
|
||||
)}
|
||||
value={itemId}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
CheckboxCard.propTypes = {
|
||||
name: PropTypes.string.isRequired,
|
||||
description: PropTypes.string,
|
||||
isSelected: PropTypes.bool,
|
||||
onSelect: PropTypes.func,
|
||||
itemId: PropTypes.number.isRequired
|
||||
};
|
||||
|
||||
CheckboxCard.defaultProps = {
|
||||
description: '',
|
||||
isSelected: false,
|
||||
onSelect: null
|
||||
};
|
||||
|
||||
export default CheckboxCard;
|
||||
Reference in New Issue
Block a user