Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Administrator can now view details of teams assigned to each project … #31

Merged
merged 1 commit into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<a class="waves-effect waves-light btn green darken-3" (click)="viewTasks(project)">view tasks</a>
</td>
<td>
<a class="waves-effect waves-light btn blue darken-3" routerLink="/dashboard/teams">team</a>
<a class="waves-effect waves-light btn blue darken-3" (click)="viewTeam(project)">team</a>
</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,17 @@ export class AdminViewProjectsComponent implements OnInit {
this.router.navigateByUrl('/dashboard/tasks');
}

// navigate to the team details page to see all details about the project team

viewTeam(project) {
// store project id in local storage for future reference

localStorage.removeItem('project-id');
localStorage.setItem('project-id', project._id);

// use router to navigate to admin view team page

this.router.navigateByUrl('/dashboard/teams/admin-view-team');
}

}
15 changes: 15 additions & 0 deletions client/src/app/admin-view-team/admin-view-team.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.add-btn-area {
margin: 5%;
}

.add-btn {
border-radius: 25px;
}

.team-info {
margin: 5%;
}

.collection-item-head {
margin: 2% !important;
}
33 changes: 30 additions & 3 deletions client/src/app/admin-view-team/admin-view-team.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
<p>
admin-view-team works!
</p>
<div class="team-info">
<div class="card team-info-card">
<div class="card-action red">
<h6 class="white-text center">Team Information</h6>
</div>
<div class="card-content center center-align">
<ul class="collection">
<li class="collection-item center-align">
<p class="collection-item-head"><b>Team Name:</b></p>
<p>{{teams.team_name}}</p>
</li>

<li class="collection-item center-align">
<p class="collection-item-head"><b>Team Project:</b></p>
<p>{{teams.team_project}}</p>
</li>

<li class="collection-item center-align">
<p class="collection-item-head"><b>Team Lead:</b></p>
<p>{{teams.team_lead}}</p>
</li>

<li class="collection-item center-align">
<p class="collection-item-head"><b>Team Description:</b></p>
<p>{{teams.team_description}}</p>
</li>
</ul>
</div>
</div>
</div>
10 changes: 9 additions & 1 deletion client/src/app/admin-view-team/admin-view-team.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { TeamsService } from '../services/teams.service';

@Component({
selector: 'app-admin-view-team',
Expand All @@ -7,9 +8,16 @@ import { Component, OnInit } from '@angular/core';
})
export class AdminViewTeamComponent implements OnInit {

constructor() { }
teams;

constructor(private teamsService: TeamsService) { }

ngOnInit() {
// access teams service method getUserTeams to return data on the team associated with the project

this.teamsService.getProjectTeam().subscribe(res => {
this.teams = res;
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class ViewUserTeamsComponent implements OnInit {

this.teamsService.getProjectTeam().subscribe(res => {
this.teams = res;
console.log(this.teams);

// store team id in local storage for easy identification

Expand Down