Refactor influxdb roles admin tables to use Confirm Button
parent
164649ca32
commit
a733909409
ui/src/admin/components
|
@ -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>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue