Commit 71630e4a by Daniel Lee Committed by GitHub

Merge pull request #12856 from grafana/12855-team-members-delete-button

Delete button for team members page 
parents 1bb3cf1c f339b350
......@@ -2,9 +2,9 @@ import React from 'react';
import { hot } from 'react-hot-loader';
import { observer } from 'mobx-react';
import { ITeam, ITeamMember } from 'app/stores/TeamsStore/TeamsStore';
import appEvents from 'app/core/app_events';
import SlideDown from 'app/core/components/Animations/SlideDown';
import { UserPicker, User } from 'app/core/components/Picker/UserPicker';
import DeleteButton from 'app/core/components/DeleteButton/DeleteButton';
interface Props {
team: ITeam;
......@@ -31,15 +31,7 @@ export class TeamMembers extends React.Component<Props, State> {
};
removeMember(member: ITeamMember) {
appEvents.emit('confirm-modal', {
title: 'Remove Member',
text: 'Are you sure you want to remove ' + member.login + ' from this group?',
yesText: 'Remove',
icon: 'fa-warning',
onConfirm: () => {
this.removeMemberConfirmed(member);
},
});
this.props.team.removeMember(member);
}
removeMemberConfirmed(member: ITeamMember) {
......@@ -54,10 +46,8 @@ export class TeamMembers extends React.Component<Props, State> {
</td>
<td>{member.login}</td>
<td>{member.email}</td>
<td style={{ width: '1%' }}>
<a onClick={() => this.removeMember(member)} className="btn btn-danger btn-mini">
<i className="fa fa-remove" />
</a>
<td className="text-right">
<DeleteButton onConfirmDelete={() => this.removeMember(member)} />
</td>
</tr>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment