Skip to content

Commit 7e5fe55

Browse files
committed
Switched to Sass from CSS. Broke everything. Discussion active here: angular/angular-cli#1253
1 parent 17ac335 commit 7e5fe55

File tree

57 files changed

+310
-209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+310
-209
lines changed

angular-cli.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"prefix": "lal",
1919
"mobile": false,
2020
"styles": [
21-
"styles/styles.css",
21+
"styles/styles.scss",
2222
"styles/material-themes/lal-theme.scss"
2323
],
2424
"scripts": [],
@@ -42,7 +42,7 @@
4242
}
4343
},
4444
"defaults": {
45-
"styleExt": "css",
45+
"styleExt": "scss",
4646
"prefixInterfaces": false,
4747
"inline": {
4848
"style": false,
@@ -57,4 +57,4 @@
5757
"service": true
5858
}
5959
}
60-
}
60+
}

src/app/app.component.css renamed to src/app/app.component.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
}
66

77
#app-content {
8-
background-color: var(--color-primary);
8+
background-color: $color-primary;
99
flex: 1;
1010
padding: 1em;
1111
}
1212

1313
#app-titlebar {
14-
background-color: var(--color-accent);
14+
background-color: $color-accent;
1515
display: flex;
1616
flex-shrink: 0;
1717
align-items: center;
1818
padding: 1em;
1919
}
2020

2121
h1, h1 a {
22-
color: var(--color-primary);
22+
color: $color-primary;
2323
display: inline;
2424
flex: 1;
2525
font-family: EasonPro-Caps;
@@ -33,7 +33,7 @@ nav {
3333
}
3434

3535
nav a {
36-
color: var(--color-primary);
36+
color: $color-primary;
3737
margin: 0 20px 0px 0px;
3838
font-size: 1.2em;
3939
text-transform: lowercase;

src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { EventNotificationsService } from './core/services/event-notifications-s
77
@Component({
88
selector: 'lal-app',
99
templateUrl: 'app.component.html',
10-
styleUrls: ['app.component.css']
10+
styleUrls: ['app.component.scss']
1111
})
1212
export class AppComponent implements OnInit, OnDestroy {
1313
private title: string = `Lion's Arch, Ltd.`;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { EventType } from '../../shared/models/event-type';
2+
3+
export let MOCK_EVENT_TYPES: EventType[] = [
4+
{
5+
id: "ec3525ff-58cd-4f25-b727-d3085e60c5de",
6+
name: "Meta Events: Classic"
7+
},
8+
{
9+
id: "021146d9-2314-4e85-b964-279d9d0d745d",
10+
name: "Meta Events: Heart of Thorns"
11+
},
12+
{
13+
id: "80940b84-7a00-4b3f-8e4d-bf9f3db17ff3",
14+
name: "World Bosses"
15+
}
16+
];

src/app/core/mock-data/mock-events.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const MOCK_EVENTS: Event[] = [
77
name: "Night and the Enemy",
88
zone: "Verdant Brink",
99
description: "Help Pact forces survive the darkest of nights against the servants of Mordremoth.",
10+
eventTypeId: "021146d9-2314-4e85-b964-279d9d0d745d",
1011
primaryWaypointId: "58151f49-8998-4c51-b6d1-351ca5ee7bb9",
1112
waypoints: [
1213
{
@@ -96,6 +97,7 @@ When 20:30 remains on the timer, choppers will land at all controlled camps (and
9697
description: `Fly armors. Save the Exalted. Stop the Mordrem from taking Tarir.
9798
9899
Don't screw up South.`,
100+
eventTypeId: "021146d9-2314-4e85-b964-279d9d0d745d",
99101
primaryWaypointId: "299425a1-b208-4b7b-9bbe-b216bc5e85e1",
100102
waypoints: [
101103
{
@@ -178,6 +180,7 @@ The [Mushroom Master](https://wiki.guildwars2.com/wiki/Mushroom_Master) waits in
178180
name: "King of the Jungle",
179181
zone: "Tangled Depths",
180182
description: "Join forces with ogres, Nuhoch, Rata Novus, and SCAR to kill chak, steal loot, and [learn new words](http://www.dictionary.com/browse/gerent).",
183+
eventTypeId: "021146d9-2314-4e85-b964-279d9d0d745d",
181184
primaryWaypointId: "7dae3d65-d3cb-4233-965c-6b93a228c467",
182185
waypoints: [
183186
{
@@ -247,6 +250,7 @@ SCAR Lane is among the conceptually easiest of the four lanes. Here, the SCAR un
247250
name: "Shadow of the Dragon",
248251
zone: "Dragon's Stand",
249252
description: "Three paths. Three towers. One mouth. Also, a weird body. Don't forget your machetes!",
253+
eventTypeId: "021146d9-2314-4e85-b964-279d9d0d745d",
250254
primaryWaypointId: "95718376-f193-49bb-895e-ebe66c966c41",
251255
waypoints: [
252256
{
@@ -336,6 +340,7 @@ When you've sent the Mouth of Mordremoth packing, experienced a heart attack at
336340
name: "Sandstorm!",
337341
zone: "Dry Top",
338342
description: "The most profitable recurring environmental disaster since Disney World.",
343+
eventTypeId: "ec3525ff-58cd-4f25-b727-d3085e60c5de",
339344
primaryWaypointId: "9941ef2d-98eb-4c82-afc1-58fb2e2961c9",
340345
waypoints: [
341346
{

src/app/core/services/events-service/events.service.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ function getTestEventWithOffsets(offsets: Timespan[]): Event {
1414
zone: 'Donkland',
1515
description: 'The testiest of events',
1616
key: 'te',
17+
eventTypeId: '',
1718
primaryWaypointId: '',
1819
waypoints: [],
1920
occurrenceOffsets: offsets || [Timespan.fromMilliseconds(0)],
2021
goalContributions: []
2122
};
2223
}
2324

24-
describe('Events service', () => {
25+
describe('The events service', () => {
2526
it('should indicate that the offset of the next event is 0 when the event has a 0 offset from UTC midnight and now is UTC midnight', function() {
2627
// arrange
2728
let event: Event = getTestEvent();

src/app/core/services/events-service/events.service.ts

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,54 @@ import 'rxjs/add/operator/map';
66

77
import { Event } from '../../../shared/models/event';
88
import { MOCK_EVENTS } from '../../mock-data/mock-events';
9+
import { EventType } from '../../../shared/models/event-type';
10+
import { MOCK_EVENT_TYPES } from '../../mock-data/mock-event-types';
911
import { NowService } from '../now.service';
1012
import { Timespan } from '../../../modules/timespan/timespan';
1113

1214
@Injectable()
1315
export class EventsService {
14-
constructor(private nowService: NowService) { }
16+
constructor(private nowService: NowService) { }
1517

16-
getEvent(id: string): Observable<Event> {
17-
return Observable.of(MOCK_EVENTS.find(e => e.id === id));
18-
}
19-
20-
getEvents(): Observable<Event[]> {
21-
return Observable.of(MOCK_EVENTS);
22-
}
18+
getEvent(id: string): Observable<Event> {
19+
return Observable.of(MOCK_EVENTS.find(e => e.id === id));
20+
}
2321

24-
getOffsetOfNextOccurrenceSync(event: Event, includePastEventsOffset = 0): number {
25-
let msInADay = Timespan.fromHours(24).totalMilliseconds;
26-
let nowish = (this.nowService.getTimespanSinceMidnightUtc().totalMilliseconds - includePastEventsOffset + msInADay) % msInADay;
27-
let eventOffsetIndex = 0;
28-
let eventOffset = event.occurrenceOffsets[eventOffsetIndex];
22+
getEvents(): Observable<Event[]> {
23+
return Observable.of(MOCK_EVENTS);
24+
}
2925

30-
while (nowish - eventOffset.totalMilliseconds > 0 && event.occurrenceOffsets[++eventOffsetIndex]) {
31-
eventOffset = event.occurrenceOffsets[eventOffsetIndex];
26+
getEventTypes(): Observable<EventType[]> {
27+
return Observable.of(MOCK_EVENT_TYPES);
3228
}
3329

34-
return eventOffset.totalMilliseconds;
35-
}
30+
getOffsetOfNextOccurrenceSync(event: Event, includePastEventsOffset = 0): number {
31+
let msInADay = Timespan.fromHours(24).totalMilliseconds;
32+
let nowish = (this.nowService.getTimespanSinceMidnightUtc().totalMilliseconds - includePastEventsOffset + msInADay) % msInADay;
33+
let eventOffsetIndex = 0;
34+
let eventOffset = event.occurrenceOffsets[eventOffsetIndex];
35+
36+
while (nowish - eventOffset.totalMilliseconds > 0 && event.occurrenceOffsets[++eventOffsetIndex]) {
37+
eventOffset = event.occurrenceOffsets[eventOffsetIndex];
38+
}
3639

37-
getMsTilNextOccurrenceOfSync(event: Event, includePastEventsOffset = 0): number {
38-
let msSinceMidnightUtc = this.nowService.getTimespanSinceMidnightUtc().totalMilliseconds;
39-
let offsetOfNextEvent = this.getOffsetOfNextOccurrenceSync(event);
40+
return eventOffset.totalMilliseconds;
41+
}
42+
43+
getMsTilNextOccurrenceOfSync(event: Event, includePastEventsOffset = 0): number {
44+
let msSinceMidnightUtc = this.nowService.getTimespanSinceMidnightUtc().totalMilliseconds;
45+
let offsetOfNextEvent = this.getOffsetOfNextOccurrenceSync(event);
4046

41-
return offsetOfNextEvent - msSinceMidnightUtc;
42-
}
47+
return offsetOfNextEvent - msSinceMidnightUtc;
48+
}
4349

44-
getMsTilNextOccurrenceOf(event: Event, includePastEventsOffset = 0): Observable<number> {
45-
// this is the only way I know of right now to emit the value right now and then again every 20 seconds
46-
let timeTilOccurrenceFromNow = Observable.of(this.getMsTilNextOccurrenceOfSync(event));
47-
let timeTilOccurrenceFromEveryInterval = Observable
48-
.interval(20000)
49-
.map(() => { return this.getMsTilNextOccurrenceOfSync(event); });
50+
getMsTilNextOccurrenceOf(event: Event, includePastEventsOffset = 0): Observable<number> {
51+
// this is the only way I know of right now to emit the value right now and then again every 20 seconds
52+
let timeTilOccurrenceFromNow = Observable.of(this.getMsTilNextOccurrenceOfSync(event));
53+
let timeTilOccurrenceFromEveryInterval = Observable
54+
.interval(20000)
55+
.map(() => { return this.getMsTilNextOccurrenceOfSync(event); });
5056

51-
return timeTilOccurrenceFromNow.concat(timeTilOccurrenceFromEveryInterval);
52-
}
57+
return timeTilOccurrenceFromNow.concat(timeTilOccurrenceFromEveryInterval);
58+
}
5359
}

src/app/features/dailies/components/dailies-landing/dailies-landing.component.css renamed to src/app/features/dailies/components/dailies-landing/dailies-landing.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
}
55

66
h3 {
7-
color: var(--color-accent);
7+
color: $color-accent;
88
font-family: EasonPro;
99
font-size: 1.8em;
1010
}

src/app/features/dailies/components/dailies-landing/dailies-landing.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { DailyGroupType } from '../../../../modules/gw2api/gw2api-dailies-servic
1212

1313
@Component({
1414
selector: 'lal-dailies-landing',
15-
styleUrls: ['dailies-landing.component.css'],
15+
styleUrls: ['dailies-landing.component.scss'],
1616
templateUrl: 'dailies-landing.component.html'
1717
})
1818
export class DailiesLandingComponent implements OnInit, OnDestroy {

src/app/features/dailies/components/daily-group-fractals/daily-group-fractals.component.css renamed to src/app/features/dailies/components/daily-group-fractals/daily-group-fractals.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
h3 {
2-
color: var(--color-accent);
2+
color: $color-accent;
33
font-family: EasonPro-Caps;
44
font-size: 1.2em;
55
font-weight: bold;

src/app/features/dailies/components/daily-group-fractals/daily-group-fractals.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Observable } from 'rxjs/Observable';
44

55
@Component({
66
selector: 'lal-daily-group-fractals',
7-
styleUrls: [ './daily-group-fractals.component.css' ],
7+
styleUrls: ['./daily-group-fractals.component.scss'],
88
templateUrl: 'daily-group-fractals.component.html'
99
})
1010
export class DailyGroupFractalsComponent {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
}
44

55
.recommended-ar-label {
6-
color: var(--color-subtle);
7-
font-weight:lighter;
6+
// color: $color-subtle;
7+
font-weight: lighter;
88
}
99

1010
.recommended-ar {
11-
color: var(--color-accent);
11+
// color: $color-accent;
1212
}

src/app/features/dailies/components/daily-recommended-fractal/daily-recommended-fractal.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DailyRecommendedFractalViewModel } from '../../viewmodels/daily-recomme
33

44
@Component({
55
selector: 'lal-daily-recommended-fractal',
6-
styleUrls: ['daily-recommended-fractal.component.css'],
6+
styleUrls: ['daily-recommended-fractal.component.scss'],
77
templateUrl: 'daily-recommended-fractal.component.html'
88
})
99
export class DailyRecommendedFractalComponent {

src/app/features/dailies/components/daily-tier-fractal/daily-tier-fractal.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Fractal } from '../../../../shared/models/fractal';
33

44
@Component({
55
selector: 'lal-daily-tier-fractal',
6-
styleUrls: ['daily-tier-fractal.component.css'],
6+
styleUrls: ['daily-tier-fractal.component.scss'],
77
templateUrl: 'daily-tier-fractal.component.html'
88
})
99
export class DailyTierFractalComponent {

src/app/features/dailies/components/daily/daily.component.css renamed to src/app/features/dailies/components/daily/daily.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}
66

77
.daily-description {
8-
color: var(--color-subtle);
8+
color: $color-subtle;
99
font-style: italic;
1010
font-size: 0.9em;
1111
}

src/app/features/dailies/components/daily/daily.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DailyViewModel } from '../../viewmodels/daily.viewmodel';
33

44
@Component({
55
selector: 'lal-daily',
6-
styleUrls: [ 'daily.component.css' ],
6+
styleUrls: ['daily.component.scss'],
77
templateUrl: 'daily.component.html'
88
})
99
export class DailyComponent {

src/app/features/events/event-card/event-card.component.css renamed to src/app/features/events/components/event-card/event-card.component.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ h4 {
1818
}
1919

2020
.event-countdown-text {
21-
color: var(--color-subtle);
21+
color: $color-subtle;
2222
}
2323

2424
.event-countdown {
25-
color: var(--color-accent);
25+
color: $color-accent;
2626
}
2727

2828
.event-goal-contribution {

src/app/features/events/event-card/event-card.component.ts renamed to src/app/features/events/components/event-card/event-card.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Component, Input } from '@angular/core';
2-
import { EventViewModel } from '../../../shared/viewmodels/event.viewmodel';
2+
import { EventViewModel } from '../../../../shared/viewmodels/event.viewmodel';
33

44
@Component({
55
selector: 'event-card',
6-
styleUrls: ['event-card.component.css'],
6+
styleUrls: ['event-card.component.scss'],
77
templateUrl: 'event-card.component.html'
88
})
99
export class EventCardComponent {

src/app/features/events/event-waypoint/event-waypoint.component.ts renamed to src/app/features/events/components/event-waypoint/event-waypoint.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
2-
import { EventWaypointViewModel } from '../../../shared/viewmodels/event-waypoint.viewmodel';
2+
import { EventWaypointViewModel } from '../../../../shared/viewmodels/event-waypoint.viewmodel';
33

44
@Component({
55
selector: 'lal-event-waypoint',
6-
styleUrls: [ 'event-waypoint.component.css' ],
6+
styleUrls: ['event-waypoint.component.scss'],
77
templateUrl: 'event-waypoint.component.html'
88
})
99
export class EventWaypointComponent implements OnChanges {

src/app/features/events/event/event.component.css renamed to src/app/features/events/components/event/event.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ h4 {
1515
}
1616

1717
.subtle-label {
18-
color: var(--color-subtle);
18+
color: $color-subtle;
1919
}
2020

2121
.event-start-info {

src/app/features/events/event/event.component.ts renamed to src/app/features/events/components/event/event.component.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { Component, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
22
import { ActivatedRoute, Params } from '@angular/router';
3-
import { Observable } from 'rxjs/Observable';
43
import { Subscription } from 'rxjs/Subscription';
54

6-
import { EventViewModel } from '../../../shared/viewmodels/event.viewmodel';
7-
import { EventViewModelsService } from '../../../core/services/viewmodels-services/event-viewmodels.service';
8-
import { EventsService } from '../../../core/services/events-service/events.service';
5+
import { EventViewModel } from '../../../../shared/viewmodels/event.viewmodel';
6+
import { EventViewModelsService } from '../../../../core/services/viewmodels-services/event-viewmodels.service';
7+
import { EventsService } from '../../../../core/services/events-service/events.service';
98

109
@Component({
1110
selector: 'lal-event',
12-
styleUrls: ['./event.component.css'],
13-
templateUrl: './event.component.html'
11+
styleUrls: ['event.component.scss'],
12+
templateUrl: 'event.component.html'
1413
})
1514
export class EventComponent implements OnInit, OnDestroy {
1615
private routeParamsSubscription: Subscription;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div class="events">
2+
<div *ngFor="let eventTypeGroup of (viewModel | async)?.eventTypeGroups" class="event-type-group">
3+
<h2>{{eventTypeGroup.eventType.name}}</h2>
4+
<div class="event-cards">
5+
<event-card [viewModel]="event" *ngFor="let event of eventTypeGroup.events"></event-card>
6+
</div>
7+
</div>
8+
</div>

0 commit comments

Comments
 (0)