Преглед изворни кода

removed mock-teams, now gets teams from backend

Patrick O'Carroll пре 7 година
родитељ
комит
ca06893e69

+ 1 - 3
public/app/features/org/partials/profile.html

@@ -32,13 +32,11 @@
       <thead>
         <tr>
           <th>Name</th>
-          <th>Members</th>
         </tr>
       </thead>
       <tbody>
-        <tr ng-repeat="team in ctrl.user.teams">
+        <tr ng-repeat="team in ctrl.teams">
           <td>{{team.name}}</td>
-          <td>{{team.members}}</td>
         </tr>
       </tbody>
     </table>

+ 3 - 7
public/app/features/org/profile_ctrl.ts

@@ -28,13 +28,9 @@ export class ProfileCtrl {
   }
 
   getUserTeams() {
-    this.backendSrv.get('/api/user').then(teams => {
-      this.user.teams = [
-        { name: 'Backend', email: 'backend@grafana.com', members: 5 },
-        { name: 'Frontend', email: 'frontend@grafana.com', members: 4 },
-        { name: 'Ops', email: 'ops@grafana.com', members: 6 },
-      ];
-      this.showTeamsList = this.user.teams.length > 1;
+    this.backendSrv.get('/api/user/teams').then(teams => {
+      this.teams = teams;
+      this.showTeamsList = this.teams.length > 1;
     });
   }