Skip to content

Commit 68a0bbd

Browse files
author
Stojanovic Igor
committed
Merge branch '129-hot-bugfixes' into 'develop'
Hot Fixes first batch :-) See merge request aligmara/riversurf-angular!104
2 parents c171b25 + 438fbe2 commit 68a0bbd

22 files changed

+221
-251
lines changed

src/app/core/header/navigation/navigation.component.scss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
display: flex;
88
justify-content: flex-end;
99

10-
&__notification{
10+
&__notification {
1111
margin-right: 1rem;
1212
@include respond(small) {
1313
display: none;
1414
}
1515
}
1616

17-
1817
&__checkbox {
1918
display: none;
2019
}
@@ -24,13 +23,14 @@
2423
position: relative;
2524
top: .4rem;
2625
right: 0;
27-
z-index: 12;
2826
box-shadow: 0 1rem 3rem rgba($color-black, 0.1);
2927
text-align: center;
3028
cursor: pointer;
3129
outline: none;
30+
}
3231

33-
32+
&__button {
33+
z-index: 12;
3434
}
3535

3636
&__logout {
@@ -149,7 +149,7 @@
149149
}
150150
}
151151

152-
&__notification-menu{
152+
&__notification-menu {
153153
display: none;
154154
@include respond(small) {
155155
display: inherit;
@@ -158,13 +158,15 @@
158158

159159
&__checkbox:checked ~ &__background {
160160
height: 100vh;
161+
position: fixed;
161162
}
162163

163164
&__checkbox:checked ~ &__nav {
164165
width: 100vw;
165166
opacity: 1;
166167
left: 0;
167168
}
169+
168170
&__checkbox:checked + &__button {
169171
background-color: transparent;
170172
}

src/app/core/services/surf-event.service.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ export class SurfEventService {
104104
return this.surfEvents$;
105105
}
106106

107+
isUpcomingSurfEvent(startDateTime: string): boolean {
108+
const today = new Date();
109+
today.setHours(0, 0, 0, 0);
110+
const startDate: Date = new Date(startDateTime);
111+
startDate.setHours(0, 0, 0, 0);
112+
return today < startDate;
113+
}
114+
107115
getEnrolledRiders(id: string): Observable<Rider[]> {
108116
return this.getSurfEvent(id).pipe(
109117
filter(surfEvent => surfEvent !== undefined),

src/app/riders/rider-profile/rider-timeline/rider-time-line.component.scss

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
flex-direction: column;
1010
padding: 1rem;
1111

12+
@include respond(small) {
13+
padding: 0rem;
14+
}
15+
1216
&__loading{
1317
flex: 100%;
1418
display: flex;
@@ -40,16 +44,9 @@
4044
}
4145

4246
&-location {
43-
display: inline-block;
44-
margin-left: .3rem;
45-
position: relative;
46-
vertical-align: top;
4747
font-weight: 400;
4848
text-transform: uppercase;
49-
padding: .3rem .5rem;
5049
font-size: 1rem;
51-
background-color: $color-primary;
52-
color: $color-white;
5350
border-radius: 1.5rem;
5451
}
5552

src/app/riders/rider-profile/rider-timeline/time-line/time-line.component.scss

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11
@import "responsive";
22
@import "variables";
3+
@import "mixins";
34

45
$ongoing-color: #bb4444;
56
$line-color: #b4bbe4;
67
$line-width: 0.1rem;
78
$line-dash-width: 0.35rem;
89

910
.container {
10-
display: grid;
11-
grid-template-columns: min-content minmax(400px, 40%);
12-
13-
@include respond(medium) {
14-
grid-template-columns: min-content minmax(max-content, 80%);
15-
}
16-
17-
@include respond(small) {
18-
grid-template-columns: min-content auto;
19-
}
20-
align-items: stretch;
11+
display: flex;
2112

2213
&__timeline {
23-
grid-column: 1 / 2;
2414

2515
&-viewbox{
2616
position: relative;
2717
height: 100%;
28-
2918
min-width: 60px;
3019

3120
svg{
@@ -59,9 +48,20 @@ $line-dash-width: 0.35rem;
5948
}
6049

6150
&__details {
62-
grid-column: 2 / 3;
6351
margin: 0.5rem 0;
64-
position: relative;
52+
min-width: 500px;
53+
54+
@include respond(medium) {
55+
max-width: 400px;
56+
min-width: 400px;
57+
}
58+
59+
@include respond(small) {
60+
max-width: 350px;
61+
min-width: 250px;
62+
}
63+
64+
6565

6666
&__card {
6767
display: flex;
@@ -106,9 +106,7 @@ $line-dash-width: 0.35rem;
106106
}
107107

108108
&__points {
109-
padding: .5rem 1rem;
110-
border: 1px solid $color-primary;
111-
border-radius: 4px;
109+
@include underline-magical;
112110
align-self: flex-end;
113111
}
114112
}

src/app/riders/rider-profile/rider-timeline/time-line/timeline-item.model.ts

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -6,109 +6,3 @@ export interface TimeLineItem {
66
content: string;
77
icon: TimeLineItemIcon;
88
}
9-
10-
export const DefaultTimeLineItem : TimeLineItem = {
11-
title : "",
12-
content : "",
13-
time : new Date(),
14-
icon : "default"
15-
}
16-
17-
export const DefaultTimeLineItemsWinning: TimeLineItem[] = [{
18-
title: "Rides in heat 2 of round 1",
19-
content: "",
20-
time: new Date(2021, 9, 11, 12, 1),
21-
icon: "start"
22-
}, {
23-
title: "Won heat 2 of round 1",
24-
content: "Scored 30 points",
25-
time: new Date(2021, 9, 11, 12, 34),
26-
icon: "finish"
27-
}, {
28-
title: "Rides in heat 3 of round 2",
29-
content: "",
30-
time: new Date(2021, 9, 11, 13, 15),
31-
icon: "start"
32-
}, {
33-
title: "Won heat 3 of round 2",
34-
content: "Scored 24 points",
35-
time: new Date(2021, 9, 11, 13, 41),
36-
icon: "finish"
37-
}, {
38-
title: "Rides in heat 1 of round 3",
39-
content: "",
40-
time: new Date(2021, 9, 11, 15, 20),
41-
icon: "start"
42-
}, {
43-
title: "Won heat 1 of round 3",
44-
content: "Scored 41 points",
45-
time: new Date(2021, 9, 11, 15, 59),
46-
icon: "finish"
47-
}, {
48-
title: "Won the competition",
49-
content: "",
50-
time: new Date(2021, 9, 11, 15, 59),
51-
icon: "win"
52-
}
53-
]
54-
55-
export const DefaultTimeLineItemsLosing: TimeLineItem[] = [{
56-
title: "Rides in heat 2 of round 1",
57-
content: "",
58-
time: new Date(2020, 9, 11, 12, 1),
59-
icon: "start"
60-
}, {
61-
title: "Won heat 2 of round 1",
62-
content: "Scored 30 points",
63-
time: new Date(2020, 9, 11, 12, 34),
64-
icon: "finish"
65-
}, {
66-
title: "Rides in heat 3 of round 2",
67-
content: "",
68-
time: new Date(2020, 9, 11, 13, 15),
69-
icon: "start"
70-
}, {
71-
title: "Won heat 3 of round 2",
72-
content: "Scored 24 points",
73-
time: new Date(2020, 9, 11, 13, 41),
74-
icon: "finish"
75-
}, {
76-
title: "Rides in heat 1 of round 3",
77-
content: "",
78-
time: new Date(2020, 9, 11, 15, 20),
79-
icon: "start"
80-
}, {
81-
title: "Lost in heat 1 of round 3",
82-
content: "Scored 12 points",
83-
time: new Date(2020, 9, 11, 15, 59),
84-
icon: "lose"
85-
}
86-
]
87-
88-
export const DefaultTimeLineItemsOngoing: TimeLineItem[] = [{
89-
title: "Rides in heat 2 of round 1",
90-
content: "",
91-
time: new Date(2021, 9, 11, 12, 1),
92-
icon: "start"
93-
}, {
94-
title: "Won heat 2 of round 1",
95-
content: "Scored 30 points",
96-
time: new Date(2021, 9, 11, 12, 34),
97-
icon: "finish"
98-
}, {
99-
title: "Rides in heat 3 of round 2",
100-
content: "",
101-
time: new Date(2021, 9, 11, 13, 15),
102-
icon: "start"
103-
}, {
104-
title: "Won heat 3 of round 2",
105-
content: "Scored 24 points",
106-
time: new Date(2021, 9, 11, 13, 41),
107-
icon: "finish"
108-
}, {
109-
title: "Rides in heat 1 of round 3",
110-
content: "",
111-
time: new Date(2021, 9, 11, 15, 20),
112-
icon: "start"
113-
}
114-
]

src/app/riders/riders.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
<div>
33
<mat-button-toggle-group class="division-selector" aria-label="Division" #group="matButtonToggleGroup">
44
<mat-button-toggle value="male" (change)="toggleDivision($event, group)" [checked]="division === 'male'"
5-
class="division-selector__item division-selector__item--male">
5+
class="division-selector__item division-selector__item division-male">
66
<mat-icon class="division-selector__item__icon">male</mat-icon>
77
<h2 class="division-selector__item__info">{{ maleCount }} Men</h2>
88
</mat-button-toggle>
99
<mat-button-toggle value="female" (change)="toggleDivision($event, group)" [checked]="division === 'female'"
10-
class="division-selector__item division-selector__item--female">
10+
class="division-selector__item division-selector__item division-female">
1111
<mat-icon class="division-selector__item__icon" >female</mat-icon>
1212
<h2 class="division-selector__item__info" >{{ femaleCount }} female</h2>
1313
</mat-button-toggle>
1414
<mat-button-toggle value="kid" (change)="toggleDivision($event, group)" [checked]="division === 'kid'"
15-
class="division-selector__item division-selector__item--kids">
15+
class="division-selector__item division-selector__item division-kid">
1616
<mat-icon class="division-selector__item__icon">child_care</mat-icon>
1717
<h2 class="division-selector__item__info">{{ kidCount }} kids </h2>
1818
</mat-button-toggle>

src/app/riders/riders.component.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,6 @@
2424
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.1);
2525
}
2626

27-
&--male {
28-
background-color: $color-male;
29-
}
30-
31-
&--female {
32-
background-color: $color-female;
33-
}
34-
35-
&--kids {
36-
background-color: $color-kids;
37-
}
38-
3927
&__info {
4028
color: $color-white;
4129
text-transform: uppercase;

src/app/shared/event-card/event-card.component.html

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,24 @@
1515
</p>
1616
</mat-card-content>
1717
<div class="event__card__division">
18-
<a mat-raised-button
19-
*ngFor="let division of surfEvent.divisions"
20-
class="division-{{division}}"
21-
(click)="onClick($event)"
22-
routerLink="/event/{{surfEvent.name | slugify}}-{{surfEvent.id}}/competition/{{ division }}">
23-
{{division | titlecase}}
24-
</a>
18+
<ng-container *ngIf="!isUpcomingSurfEvent">
19+
<a mat-raised-button
20+
*ngFor="let division of surfEvent.divisions"
21+
class="division-{{division}}"
22+
(click)="onClick($event)"
23+
routerLink="/event/{{surfEvent.name | slugify}}-{{surfEvent.id}}/competition/{{ division }}">
24+
<mat-icon>{{division | divisionIcon}}</mat-icon>
25+
{{division | titlecase}}
26+
</a>
27+
</ng-container>
28+
<ng-container *ngIf="isUpcomingSurfEvent">
29+
<a mat-stroked-button
30+
*ngFor="let division of surfEvent.divisions"
31+
class="division-{{division}} division-disabled">
32+
<mat-icon>{{division | divisionIcon}}</mat-icon>
33+
{{division | titlecase}}
34+
</a>
35+
</ng-container>
2536
</div>
2637
</mat-card>
2738
</a>

src/app/shared/event-card/event-card.component.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
a {
4848
color: $color-white;
4949
margin-right: 1rem;
50+
51+
@include respond(small) {
52+
mat-icon {
53+
display: none;
54+
}
55+
}
5056
}
5157
}
5258
}

src/app/shared/event-card/event-card.component.ts

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
import {Component, Input} from '@angular/core';
1+
import {Component, Input, OnInit} from '@angular/core';
22
import {SurfEvent} from "../../core/models/surf-event.model";
3-
import {Division} from "../../core/models/division.type";
3+
import {SurfEventService} from "../../core/services/surf-event.service";
44

55
@Component({
66
selector: 'rs-event-card',
77
templateUrl: './event-card.component.html',
88
styleUrls: ['./event-card.component.scss']
99
})
10-
export class EventCardComponent {
10+
export class EventCardComponent implements OnInit {
1111
@Input()
1212
surfEvent!: SurfEvent;
13+
isUpcomingSurfEvent!: boolean;
1314

14-
getColorOfDivision(division: Division) {
15-
switch (division) {
16-
case "male":
17-
return 'primary'
18-
case "female":
19-
return 'accent'
20-
case "kid":
21-
return 'warn'
22-
}
15+
constructor(private surfEventService: SurfEventService) {
16+
}
17+
18+
ngOnInit(): void {
19+
this.isUpcomingSurfEvent = this.surfEventService.isUpcomingSurfEvent(this.surfEvent.startDateTime);
2320
}
2421

2522
onClick(event: Event) {

0 commit comments

Comments
 (0)