Skip to content

Commit 7e723c1

Browse files
committed
wip(elections): route updates to elections and events archives
* updated the route to Events Archives from 'event-archive' to 'events/archives' * enabled the 'upcoming' and 'speeches' navbar entries
1 parent 29d6bc4 commit 7e723c1

4 files changed

Lines changed: 62 additions & 28 deletions

File tree

src/app/app.routes.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
import { Routes } from '@angular/router';
22
import { HomeComponent } from 'pages/home/home.component';
33

4+
export enum SiteRoute {
5+
ReadMe = '/readme',
6+
Officers = '/officers',
7+
Committees = '/committees',
8+
Affiliates = '/affiliates',
9+
CommonRoom = '/common-room',
10+
Events = '/events',
11+
EventsArchives = '/events/archives',
12+
Elections = '/elections',
13+
ElectionsUpcoming = '/elections/upcoming',
14+
ElectionsSpeeches = '/elections/speeches'
15+
}
16+
417
/**
518
* Formats the title on the web browser's tab/window.
619
* @param pageTitle - Title of the page
@@ -66,7 +79,7 @@ export const routes: Routes = [
6679
}
6780
},
6881
{
69-
path: 'events/archive',
82+
path: 'events/archives',
7083
loadComponent: () =>
7184
import('pages/event-archives/event-archives.component').then(m => m.EventArchivesComponent),
7285
title: makeTitle('Event Archives'),

src/app/components/nav-bar/nav-bar.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,18 @@ <h1 class="navbar__heading">SFU CSSS</h1>
3737
[routerLinkActiveOptions]="{ exact: true }"
3838
>
3939
@if (subItem.route) {
40+
<!-- For routes on the site -->
4041
<a
4142
class="nav-entry"
4243
(click)="navigate(subItem)"
4344
[routerLink]="subItem.route"
4445
[class.clickable]="!subItem.isDisabled"
45-
routerLinkActive="active"
4646
>
4747
<fa-icon class="nav-entry__icon" [icon]="subItem.icon" [fixedWidth]="true" />
4848
<span>{{ subItem.label }}</span>
4949
</a>
5050
} @else {
51+
<!-- For external links -->
5152
<a class="nav-entry clickable" [href]="subItem.href" target="_blank">
5253
<fa-icon class="nav-entry__icon" [icon]="subItem.icon" [fixedWidth]="true" />
5354
<span>{{ subItem.label }}</span>

src/app/components/nav-bar/nav-entries.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {
44
faBook,
55
faChevronRight,
66
faFile,
7-
faRoadBarrier,
87
faUpRightFromSquare
98
} from '@fortawesome/free-solid-svg-icons';
9+
import { SiteRoute } from 'app/app.routes';
1010
import { EXTERNAL_LINKS } from 'components/url/links.data';
1111

1212
export interface NavItem extends CodeListItem<NavItem> {
@@ -27,31 +27,31 @@ export const NAVBAR_ENTRIES: NavItem[] = [
2727
key: 'readme',
2828
label: 'README',
2929
icon: faFile,
30-
route: '/readme'
30+
route: SiteRoute.ReadMe
3131
},
3232
{
3333
key: 'officers',
3434
label: 'Officers',
3535
icon: faFile,
36-
route: '/officers'
36+
route: SiteRoute.Officers
3737
},
3838
{
3939
key: 'committees',
4040
label: 'Committees',
4141
icon: faFile,
42-
route: '/committees'
42+
route: SiteRoute.Committees
4343
},
4444
{
4545
key: 'common-room',
4646
label: 'Common Room',
4747
icon: faFile,
48-
route: '/common-room'
48+
route: SiteRoute.CommonRoom
4949
},
5050
{
5151
key: 'affiliates',
5252
label: 'Affiliates',
5353
icon: faFile,
54-
route: '/affiliates'
54+
route: SiteRoute.Affiliates
5555
}
5656
]
5757
},
@@ -65,7 +65,7 @@ export const NAVBAR_ENTRIES: NavItem[] = [
6565
key: 'events.about',
6666
label: 'About',
6767
icon: faFile,
68-
route: '/events'
68+
route: SiteRoute.Events
6969
},
7070
{
7171
key: 'events.tech-fair',
@@ -95,7 +95,7 @@ export const NAVBAR_ENTRIES: NavItem[] = [
9595
key: 'events.archives',
9696
label: 'Archives',
9797
icon: faBook,
98-
route: '/event-archives'
98+
route: SiteRoute.EventsArchives
9999
}
100100
]
101101
},
@@ -109,21 +109,19 @@ export const NAVBAR_ENTRIES: NavItem[] = [
109109
key: 'elections.about',
110110
label: 'About',
111111
icon: faFile,
112-
route: '/elections'
112+
route: SiteRoute.Elections
113113
},
114114
{
115115
key: 'elections.upcoming',
116116
label: 'Upcoming',
117-
icon: faRoadBarrier,
118-
route: '/upcoming-elections',
119-
isDisabled: true
117+
icon: faFile,
118+
route: SiteRoute.ElectionsUpcoming
120119
},
121120
{
122121
key: 'elections.speeches',
123122
label: 'Speeches',
124-
icon: faRoadBarrier,
125-
route: '/speeches',
126-
isDisabled: true
123+
icon: faFile,
124+
route: SiteRoute.ElectionsSpeeches
127125
}
128126
]
129127
},

src/app/services/application/applications.ts

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { SiteRoute } from 'app/app.routes';
2+
13
/**
24
* Interface representing an Application that is registered to run.
35
* Each application will be run in an activity.
@@ -23,14 +25,14 @@ export interface AppInfo {
2325
/**
2426
* The key of the application.
2527
* This should be unique to each activity.
26-
* Routes should be in the form `/<activity>/<application>` or `/<application>` to successfully launch apps.
2728
*/
2829
key: string;
2930

3031
/**
3132
* Route to access the application.
33+
* Routes should be in the form `/<activity>/<application>` or `/<application>` to successfully launch apps.
3234
*/
33-
route: string;
35+
route: SiteRoute;
3436
}
3537

3638
/**
@@ -44,7 +46,7 @@ export const routeApplicationMap: Map<number, AppInfo> = new Map([
4446
label: 'README',
4547
activityKey: '',
4648
key: 'readme',
47-
route: '/readme'
49+
route: SiteRoute.ReadMe
4850
}
4951
],
5052
[
@@ -54,7 +56,7 @@ export const routeApplicationMap: Map<number, AppInfo> = new Map([
5456
label: 'Officers',
5557
activityKey: '',
5658
key: 'officers',
57-
route: '/officers'
59+
route: SiteRoute.Officers
5860
}
5961
],
6062
[
@@ -64,7 +66,7 @@ export const routeApplicationMap: Map<number, AppInfo> = new Map([
6466
label: 'Committees',
6567
activityKey: '',
6668
key: 'committees',
67-
route: '/committees'
69+
route: SiteRoute.Committees
6870
}
6971
],
7072
[
@@ -74,7 +76,7 @@ export const routeApplicationMap: Map<number, AppInfo> = new Map([
7476
label: 'Affiliates',
7577
activityKey: '',
7678
key: 'affiliates',
77-
route: '/affiliates'
79+
route: SiteRoute.Affiliates
7880
}
7981
],
8082
[
@@ -84,7 +86,7 @@ export const routeApplicationMap: Map<number, AppInfo> = new Map([
8486
label: 'Common Room',
8587
activityKey: '',
8688
key: 'common-room',
87-
route: '/common-room'
89+
route: SiteRoute.CommonRoom
8890
}
8991
],
9092
[
@@ -94,17 +96,17 @@ export const routeApplicationMap: Map<number, AppInfo> = new Map([
9496
label: 'Events',
9597
activityKey: '',
9698
key: 'events',
97-
route: '/events'
99+
route: SiteRoute.Events
98100
}
99101
],
100102
[
101103
6,
102104
{
103105
id: 6,
104-
label: 'Event Archives',
106+
label: 'Events Archives',
105107
activityKey: '',
106108
key: 'event-archives',
107-
route: '/event-archives'
109+
route: SiteRoute.EventsArchives
108110
}
109111
],
110112
[
@@ -114,7 +116,27 @@ export const routeApplicationMap: Map<number, AppInfo> = new Map([
114116
label: 'Elections',
115117
activityKey: '',
116118
key: 'elections',
117-
route: '/elections'
119+
route: SiteRoute.Elections
120+
}
121+
],
122+
[
123+
8,
124+
{
125+
id: 8,
126+
label: 'Upcoming',
127+
activityKey: '',
128+
key: 'elections-upcoming',
129+
route: SiteRoute.ElectionsUpcoming
130+
}
131+
],
132+
[
133+
9,
134+
{
135+
id: 9,
136+
label: 'Speeches',
137+
activityKey: '',
138+
key: 'elections-speeches',
139+
route: SiteRoute.ElectionsSpeeches
118140
}
119141
]
120142
]);

0 commit comments

Comments
 (0)