add better messaging for removing own user record

pull/2703/head
Iris Scholten 2018-01-31 16:43:51 -08:00
parent 91317a164d
commit 96de896539
3 changed files with 6 additions and 3 deletions

View File

@ -165,7 +165,6 @@ export const deleteUserAsync = (
) => async dispatch => { ) => async dispatch => {
dispatch(removeUser(user)) dispatch(removeUser(user))
try { try {
console.log(user)
await deleteUserAJAX(user) await deleteUserAJAX(user)
dispatch( dispatch(
publishAutoDismissingNotification( publishAutoDismissingNotification(

View File

@ -38,6 +38,10 @@ const AllUsersTableRow = ({
const wrappedDelete = () => onDelete(user) const wrappedDelete = () => onDelete(user)
const removeWarning = userIsMe
? 'WARNING: this will remove your user record entirely and log you out'
: 'Remove from all Orgs'
return ( return (
<tr className={'chronograf-admin-table--user'}> <tr className={'chronograf-admin-table--user'}>
<td> <td>
@ -75,11 +79,10 @@ const AllUsersTableRow = ({
</td> </td>
<td style={{textAlign: 'right', width: colActions}}> <td style={{textAlign: 'right', width: colActions}}>
<ConfirmButton <ConfirmButton
confirmText="Remove from all Orgs" confirmText={removeWarning}
confirmAction={wrappedDelete} confirmAction={wrappedDelete}
size="btn-xs" size="btn-xs"
text="Remove" text="Remove"
disabled={userIsMe}
customClass="table--show-on-row-hover" customClass="table--show-on-row-hover"
/> />
</td> </td>

View File

@ -12,6 +12,7 @@
top: calc(100% + 8px); top: calc(100% + 8px);
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
z-index: 1;
} }
} }
.confirm-button--confirmation { .confirm-button--confirmation {