From 348374fba5db8415d37d5cd8b897048b1300f415 Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Tue, 4 Apr 2017 00:18:04 -0400
Subject: PLT-6098 Added Manage Teams modal to System Console users list
 (#5914)

* Added Manage Teams modal to System Console users list

* Localized ManageTeamsModal

* Fixed borders between Manage Teams list items

* Updated appearance of ManageTeamsModal

* Fixed admin being redirected from system console when removing self from a team

* Sorted teams in ManageTeamsModal

* Updated Manage Teams styling
---
 .../manage_teams_modal/remove_from_team_button.jsx | 52 ++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 webapp/components/admin_console/manage_teams_modal/remove_from_team_button.jsx

(limited to 'webapp/components/admin_console/manage_teams_modal/remove_from_team_button.jsx')

diff --git a/webapp/components/admin_console/manage_teams_modal/remove_from_team_button.jsx b/webapp/components/admin_console/manage_teams_modal/remove_from_team_button.jsx
new file mode 100644
index 000000000..d733135f4
--- /dev/null
+++ b/webapp/components/admin_console/manage_teams_modal/remove_from_team_button.jsx
@@ -0,0 +1,52 @@
+// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import React from 'react';
+import {FormattedMessage} from 'react-intl';
+
+import {removeUserFromTeam} from 'actions/team_actions.jsx';
+
+export default class RemoveFromTeamButton extends React.PureComponent {
+    static propTypes = {
+        onError: React.PropTypes.func.isRequired,
+        onMemberRemove: React.PropTypes.func.isRequired,
+        team: React.PropTypes.object.isRequired,
+        user: React.PropTypes.object.isRequired
+    };
+
+    constructor(props) {
+        super(props);
+
+        this.handleClick = this.handleClick.bind(this);
+        this.handleMemberRemove = this.handleMemberRemove.bind(this);
+    }
+
+    handleClick(e) {
+        e.preventDefault();
+
+        removeUserFromTeam(
+            this.props.team.id,
+            this.props.user.id,
+            this.handleMemberRemove,
+            this.props.onError
+        );
+    }
+
+    handleMemberRemove() {
+        this.props.onMemberRemove(this.props.team.id);
+    }
+
+    render() {
+        return (
+            <button
+                className='btn btn-default'
+                onClick={this.handleClick}
+            >
+                <FormattedMessage
+                    id='team_members_dropdown.leave_team'
+                    defaultMessage='Remove from Team'
+                />
+            </button>
+        );
+    }
+}
-- 
cgit v1.2.3-1-g7c22

