Refactor influxdb roles admin tables to use Confirm Button

pull/10616/head
Alex P 2018-03-29 15:40:24 -07:00
parent 164649ca32
commit a733909409
1 changed files with 14 additions and 6 deletions
ui/src/admin/components

View File

@ -7,7 +7,7 @@ import classnames from 'classnames'
import RoleEditingRow from 'src/admin/components/RoleEditingRow' import RoleEditingRow from 'src/admin/components/RoleEditingRow'
import MultiSelectDropdown from 'shared/components/MultiSelectDropdown' import MultiSelectDropdown from 'shared/components/MultiSelectDropdown'
import ConfirmOrCancel from 'shared/components/ConfirmOrCancel' import ConfirmOrCancel from 'shared/components/ConfirmOrCancel'
import DeleteConfirmTableCell from 'shared/components/DeleteConfirmTableCell' import ConfirmButton from 'shared/components/ConfirmButton'
import {ROLES_TABLE} from 'src/admin/constants/tableSizing' import {ROLES_TABLE} from 'src/admin/constants/tableSizing'
const RoleRow = ({ const RoleRow = ({
@ -62,6 +62,10 @@ const RoleRow = ({
) )
} }
const wrappedDelete = () => {
onDelete(role)
}
return ( return (
<tr> <tr>
<td style={{width: `${ROLES_TABLE.colName}px`}}>{roleName}</td> <td style={{width: `${ROLES_TABLE.colName}px`}}>{roleName}</td>
@ -97,11 +101,15 @@ const RoleRow = ({
/> />
) : null} ) : null}
</td> </td>
<DeleteConfirmTableCell <td className="text-right">
onDelete={onDelete} <ConfirmButton
item={role} customClass="table--show-on-row-hover"
buttonSize="btn-xs" size="btn-xs"
type="btn-danger"
text="Delete Role"
confirmAction={wrappedDelete}
/> />
</td>
</tr> </tr>
) )
} }