Skip to content
This repository was archived by the owner on Jul 6, 2020. It is now read-only.

Commit 9d4a90a

Browse files
Merge branch 'master' into improve_coverage_ngx
2 parents 18b798e + 932a9c0 commit 9d4a90a

File tree

9 files changed

+133
-74
lines changed

9 files changed

+133
-74
lines changed

src/app/components/dashboard/dashboard-content/dashboard-content.component.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,4 @@
33
background: -webkit-linear-gradient(#f5ac28, #e07e7e);
44
-webkit-background-clip: text;
55
-webkit-text-fill-color: transparent;
6-
font-size: 26px;
76
}
8-
9-
.btn {
10-
font-size: 1.2rem;
11-
padding-top:.5%;
12-
height: 45px;
13-
}
14-
15-
.text-dark-black {
16-
font-size: 3rem;
17-
}
18-

src/app/components/publiclists/teamlist/teamcard/teamcard.component.html

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
<div class="team-card-container" [class.selected]='isSelected' [class.noexpand] = 'isHost' [class.expand] = '!isHost'>
22
<div class="team-card-container-child">
3-
<div class="team-content" (click)='selectToggle()'>
4-
<i class="fa fa-circle selectstate" *ngIf='!isSelected && (isHost || isOnChallengePage)'></i>
5-
<i class="fa fa-check selectstate" aria-hidden="true" *ngIf='isSelected && (isHost || isOnChallengePage)'></i>
6-
<i class="fa fa-users" aria-hidden="true"></i>
7-
<div class="team-details">
8-
<span class="title toptitle">
9-
Team:
10-
</span>
11-
<span *ngIf="teamView['team_url']">
12-
<a class="orange-text" target="_blank" href="{{teamView['team_url']}}">{{teamView['team_name']}}</a>
13-
</span>
14-
<span *ngIf="!teamView['team_url']">
15-
{{teamView['team_name']}}
16-
</span>
17-
<br>
18-
<span class="title">
19-
Created by:
20-
</span>
21-
<span>
22-
{{teamView['created_by']}}
23-
</span>
24-
</div>
25-
<div class='team-icons'>
26-
<a (click)="addMembersToTeam($event)"><i class="fa fa-user-plus list-icon text-highlight w-300 left" aria-hidden="true"></i></a>
27-
<a [class.host]="isHost" (click)="editTeam($event)"><i class="fa fa fa-pencil list-icon text-highlight w-300 left grey-text" aria-hidden="true"></i></a>
28-
<a (click)="deleteTeam($event)"><i class="fa fa-trash list-icon text-highlight w-300 left grey-text" aria-hidden="true"></i></a>
3+
<div class="team-content" (click)='selectTeamContentToggle()'>
4+
<input type="radio" class="with-gap selectPhase" name="teamSelection" (click)='selectTeamToggle()' *ngIf="isHost || isOnChallengePage" id="{{teamView['team_name']}}">
5+
<label id="teamToggleButton" for="{{teamView['team_name']}}"></label>
6+
<i class="fa fa-users" aria-hidden="true" *ngIf='!isHost'></i>
7+
<div class="team-details">
8+
<span class="title toptitle">
9+
Team:
10+
</span>
11+
<span *ngIf="teamView['team_url']">
12+
<a class="orange-text" target="_blank" href="{{teamView['team_url']}}">{{teamView['team_name']}}</a>
13+
</span>
14+
<span *ngIf="!teamView['team_url']" class="team-detail">
15+
{{teamView['team_name']}}
16+
</span>
17+
<br>
18+
<span class="title">
19+
Created by:
20+
</span>
21+
<span class="team-detail">
22+
{{teamView['created_by']}}
23+
</span>
24+
</div>
25+
<div class='team-icons'>
26+
<a (click)="addMembersToTeam($event)"><i class="fa fa-user-plus list-icon text-highlight w-300 left" aria-hidden="true"></i></a>
27+
<a (click)="editTeam($event)"><i class="fa fa fa-pencil list-icon text-highlight w-300 left grey-text" aria-hidden="true"></i></a>
28+
<a (click)="deleteTeam($event)"><i class="fa fa-trash list-icon text-highlight w-300 left grey-text" aria-hidden="true"></i></a>
29+
</div>
2930
</div>
30-
</div>
3131
<div class='team-members'>
3232
<div class="title">
3333
<h6><b>Team Members:</b></h6>

src/app/components/publiclists/teamlist/teamcard/teamcard.component.scss

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,17 @@
22
@import './mixins.scss';
33

44
.team-card-container {
5-
font-size: $fs-16;
6-
color: $gray-darker;
7-
font-weight: $fw-light;
8-
overflow: auto;
5+
font-size: $fs-14;
96
position: relative;
10-
text-align: center;
11-
padding-bottom: 20px;
127
.team-content {
138
cursor: pointer;
149
@include box-shadow(0px, 0px, 5px, 0px, $overlay-light);
15-
width: 90%;
10+
width: 100%;
1611
display: inline-block;
1712
position: relative;
1813
background: white;
19-
padding: 15px;
20-
border-radius: 5px;
21-
margin-top: 10px;
22-
margin-bottom: 10px;
14+
padding: 6px 5px;
15+
margin-bottom: 36px;
2316
z-index: 5;
2417
overflow: auto;
2518
text-align: left;
@@ -30,23 +23,28 @@
3023
color:$gray-dark;
3124
margin-top:15px;
3225
}
33-
font-size: $fs-24;
26+
font-size: $fs-16;
3427
vertical-align:top;
35-
margin-top:10px;
28+
margin-top:15px;
3629
}
3730
.title {
3831
&.toptitle {
3932
margin-bottom: 10px;
4033
}
34+
color: $dark-black;
4135
display:inline-block;
4236
font-weight: $fw-bolder;
4337
}
4438
.team-details {
4539
display: inline-block;
46-
margin: 0px 10px 0px 10px;
47-
max-width: 185px;
40+
margin: 2px 10px 0px 10px;
41+
max-width: 300px;
4842
overflow:hidden;
4943
}
44+
.team-detail {
45+
color: rgb(22, 21, 21);
46+
font-weight: 400;
47+
}
5048
.team-icons {
5149
display: inline-block;
5250
position: relative;
@@ -70,26 +68,30 @@
7068
text-align: left;
7169
margin: 0 auto;
7270
margin-top: -25px;
73-
margin-bottom: 10px;
74-
width: 90%;
71+
width: 100%;
7572
position: relative;
7673
overflow: hidden;
7774
border-radius: 0px 0px 5px 5px;
7875
max-height: 0;
7976
transition: all 0.5s ease;
8077
.title {
78+
color: black;
8179
margin-bottom: 10px;
8280
font-weight: $fw-bolder;
8381
}
8482
background:$gray-lighter;
8583
}
84+
.team-members .team-detail {
85+
color: rgb(22, 21, 21);
86+
font-weight: 400;
87+
}
8688
&.selected {
8789
&.expand, &.noexpand {
8890
.team-members {
8991
@include box-shadow(0px, 0px, 5px, 0px, $overlay-light);
9092
max-height: 300px;
9193
transition: all 0.5s ease;
92-
padding: 20px 15px 15px 20px;
94+
padding: 20px 15px 15px 40px;
9395
}
9496
}
9597
&.noexpand {
@@ -111,24 +113,42 @@
111113
text-align: center;
112114
display: block;
113115
float: unset;
116+
font-size: 100px;
114117
}
115118
}
116119
.team-members {
117-
width: 95%;
120+
width: 100%;
118121
}
119122
}
120123
}
121124

122-
123125
.selected {
124126
height: unset !important;
125127
border-bottom-style: none !important;
126128
}
127129

130+
.title.toptitle {
131+
margin-bottom: 0px !important;
132+
}
133+
134+
.fa-users {
135+
padding: 0px 3px 0px 8px;
136+
}
137+
138+
#TeamToggleButton {
139+
margin-bottom: 13.4px;
140+
}
141+
142+
.fa-user-plus, .fa-pencil, .fa-trash {
143+
margin: 0px;
144+
padding-left: 10px;
145+
}
146+
128147
.member-class{
129148
display: flex;
130149
margin: 2% 0%;
131150
}
151+
132152
.trash-icon {
133153
margin-left: 80%;
134154
position: absolute;

src/app/components/publiclists/teamlist/teamcard/teamcard.component.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ export class TeamcardComponent implements OnInit, OnChanges {
5454
*/
5555
@Output() selectTeamCard = new EventEmitter<any>();
5656

57+
/**
58+
* Deselect team event
59+
*/
60+
@Output() deselectTeamCard = new EventEmitter<any>();
61+
5762
/**
5863
* Edit team event
5964
*/
@@ -125,16 +130,22 @@ export class TeamcardComponent implements OnInit, OnChanges {
125130
this.updateView();
126131
}
127132

133+
/**
134+
* Select a team content toggle.
135+
*/
136+
selectTeamContentToggle() {
137+
this.isSelected = !this.isSelected;
138+
this.team['isSelected'] = this.isSelected;
139+
this.deselectTeamCard.emit(this.team);
140+
}
141+
128142
/**
129143
* Select a team toggle.
130144
*/
131-
selectToggle() {
132-
if ((this.isHost && !this.isSelected) || !this.isHost) {
145+
selectTeamToggle() {
146+
if (this.isHost || this.isOnChallengePage) {
133147
this.isSelected = !this.isSelected;
134-
this.team['isSelected'] = this.isSelected;
135-
if (this.isSelected && (this.isHost || this.isOnChallengePage)) {
136-
this.selectTeam();
137-
}
148+
this.selectTeam();
138149
}
139150
}
140151

src/app/components/publiclists/teamlist/teamlist.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
<app-teamcard *ngFor="let team of filteredTeams"
1010
[team]="team" [selected]="team['isSelected']" [isOnChallengePage]="isOnChallengePage"
1111
(deleteTeamCard)="deleteTeamWrapper()($event)" (deleteMemberCard)="deleteTeamMemberWrapper()($event)" (editTeamCard)="editTeamWrapper()($event)" (addMembersTeamCard)="addMembersToTeamWrapper()($event)"
12-
(selectTeamCard)="selectTeamWrapper()($event)">
12+
(selectTeamCard)="selectTeamWrapper()($event)" (deselectTeamCard)="deselectTeamWrapper()($event)">
1313
</app-teamcard>
1414
</ul>
1515
<section class="pagination" *ngIf="allTeams.length !== 0">
1616
<div class="row rm-gut">
17-
<div class="col s12 m6 ">
17+
<div class="col s12 m6 pagination">
1818
<a [class.disabled]="seeMore <= 1" class="btn-floating btn-pagination waves-effect waves-light " (click)="seeLessClicked()">
1919
<i class="fa fa-chevron-left"></i>
2020
</a>
@@ -33,7 +33,7 @@
3333
</div>
3434
</div>
3535
<div class="col s12 m6">
36-
<div class=" ev-card-panel ev-z-depth-5">
36+
<div class=" list-card ev-card-panel ev-z-depth-5">
3737
<div class="ev-md-container ev-panel-title"><strong>{{teamCreateTitle}}</strong></div>
3838
<div class="ev-md-container ev-card-body new-team-card">
3939
<form name="createTeamForm" #createTeamForm="ngForm" (ngSubmit)="createTeamSubmit(createTeamForm.valid)">

src/app/components/publiclists/teamlist/teamlist.component.scss

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
}
1212
li {
13-
margin: 20px 0px;
13+
margin: 10px 0px;
1414
min-height: 40px;
1515
.collapsible-header {
1616
border-bottom: 0;
@@ -47,7 +47,7 @@
4747
}
4848

4949
.pagination {
50-
margin-top: 20px;
50+
margin: 0px;
5151
}
5252

5353
.pagination-title {
@@ -156,6 +156,22 @@ span.link-team-user {
156156
color: #9d9d9d;
157157
}
158158

159+
.ev-panel-title {
160+
margin: 10px 0px;
161+
}
162+
163+
section {
164+
margin: 0px 15px;
165+
}
166+
167+
.input-field label {
168+
font-size: 12px;
169+
}
170+
171+
.fa-chevron-left, .fa-chevron-right {
172+
font-size: 12px;
173+
}
174+
159175
@media only screen and (max-width: 992px) and (min-width: 601px) {
160176
.team-heading {
161177
margin-top: 30px;

src/app/components/publiclists/teamlist/teamlist.component.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ export class TeamlistComponent implements OnInit, OnDestroy {
124124
*/
125125
selectedTeam: any = null;
126126

127+
/**
128+
* Currently clicked team
129+
*/
130+
currentlyClickedTeam: any = null;
131+
127132
/**
128133
* challenge object
129134
*/
@@ -304,6 +309,17 @@ export class TeamlistComponent implements OnInit, OnDestroy {
304309
const SELF = this;
305310
const selectTeam = (team) => {
306311
SELF.selectedTeam = team;
312+
};
313+
return selectTeam;
314+
}
315+
316+
/**
317+
* Unselect a team.
318+
*/
319+
deselectTeamWrapper() {
320+
const SELF = this;
321+
const selectTeam = (team) => {
322+
SELF.currentlyClickedTeam = team;
307323
SELF.unselectOtherTeams(SELF);
308324
};
309325
return selectTeam;
@@ -316,7 +332,7 @@ export class TeamlistComponent implements OnInit, OnDestroy {
316332
const temp = self.allTeams.slice();
317333
for (let i = 0; i < temp.length; i++) {
318334
temp[i]['isSelected'] = false;
319-
if (self.selectedTeam['id'] === temp[i]['id']) {
335+
if (self.currentlyClickedTeam['id'] === temp[i]['id']) {
320336
temp[i]['isSelected'] = true;
321337
}
322338
}
@@ -399,10 +415,12 @@ export class TeamlistComponent implements OnInit, OnDestroy {
399415
*/
400416
editTeamWrapper() {
401417
const SELF = this;
418+
let TeamUrl;
402419
const editTeam = (team) => {
420+
TeamUrl = (this.isHost) ? SELF.endpointsService.hostTeamURL(team) : SELF.endpointsService.participantTeamURL(team);
403421
SELF.apiCall = (params) => {
404422
const BODY = JSON.stringify(params);
405-
SELF.apiService.patchUrl(SELF.endpointsService.participantTeamURL(team), BODY).subscribe(
423+
SELF.apiService.patchUrl(TeamUrl, BODY).subscribe(
406424
data => {
407425
// Success Message in data.message
408426
SELF.globalService.showToast('success', 'Team Updated', 5);

src/app/services/endpoints.service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,17 @@ export class EndpointsService {
9191
}
9292

9393
/**
94-
* Edit Team Name
94+
* Edit Participant Team Name
9595
*/
9696
participantTeamURL(teamId) {
9797
return `${this.participants}participant_team/${teamId}`;
9898
}
99+
/**
100+
* Edit Host Team Name
101+
*/
102+
hostTeamURL(teamId) {
103+
return `${this.hosts}challenge_host_team/${teamId}`;
104+
}
99105

100106
/**
101107
* Our Team members

0 commit comments

Comments
 (0)