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
---
 webapp/client/client.jsx | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

(limited to 'webapp/client/client.jsx')

diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx
index 1f2e5517f..1f70300e8 100644
--- a/webapp/client/client.jsx
+++ b/webapp/client/client.jsx
@@ -550,6 +550,16 @@ export default class Client {
             end(this.handleResponse.bind(this, 'getAllTeamListings', success, error));
     }
 
+    getTeamsForUser(userId, success, error) {
+        // Call out to API v4 since this call doesn't exist in v3
+        request.
+            get(`${this.url}/api/v4/users/${userId}/teams`).
+            set(this.defaultHeaders).
+            type('application/json').
+            accept('application/json').
+            end(this.handleResponse.bind(this, 'getTeamsForUser', success, error));
+    }
+
     getMyTeam(success, error) {
         request.
             get(`${this.getTeamNeededRoute()}/me`).
@@ -586,6 +596,16 @@ export default class Client {
         end(this.handleResponse.bind(this, 'getMyTeamMembers', success, error));
     }
 
+    getTeamMembersForUser(userId, success, error) {
+        // Call out to API v4 since this call doesn't exist in v3
+        request.
+            get(`${this.url}/api/v4/users/${userId}/teams/members`).
+            set(this.defaultHeaders).
+            type('application/json').
+            accept('application/json').
+            end(this.handleResponse.bind(this, 'getTeamsForUser', success, error));
+    }
+
     getMyTeamsUnread(teamId, success, error) {
         let url = `${this.getTeamsRoute()}/unread`;
 
@@ -1275,6 +1295,16 @@ export default class Client {
         this.trackEvent('api', 'api_users_update_profile_picture');
     }
 
+    getProfilePictureUrl(id, lastPictureUpdate) {
+        let url = `${this.getUsersRoute()}/${id}/image`;
+
+        if (lastPictureUpdate) {
+            url += `?time=${lastPictureUpdate}`;
+        }
+
+        return url;
+    }
+
     // Channel Routes Section
 
     createChannel(channel, success, error) {
-- 
cgit v1.2.3-1-g7c22

