This repository has been archived by the owner on Dec 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Admin Checklist and HC2019 Bug Fixes/Tweaks (#25)
* Feature commit * New favicons, resized logo and fixed typo * Added sponsors schedule and fixed a favicon bug * Fixed bug where Product Demo header showed even when the sponsor didn't have one * Fixed bug where an empty blank mentor broke page rendering * Fixed empty array bug when adding/removing people, and added clarification about the start time to the sponsors' schedule
- Loading branch information
Harri Bell-Thomas
authored
Jan 15, 2019
1 parent
1a083aa
commit 4d74856
Showing
38 changed files
with
414 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,4 @@ src/environments/firebase.ts | |
# Firebase | ||
.firebaserc | ||
functions/* | ||
.firebase/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
<h1 rows="1">Admin Interface</h1> | ||
<h3 rows="1">Registered sponsors</h3> | ||
<a rel="next" rows="0.5" *ngFor="let sponsor of sponsors" [routerLink]="[ '/', sponsor.id ]">{{ sponsor.name }}</a> | ||
<br> | ||
<div *ngFor="let sponsor of sponsors"> | ||
<p style="margin: 20px 0;"><a style="font-weight: 700;font-size: large;" rel="next" [routerLink]="[ '/', sponsor.id ]">{{ sponsor.name }}</a></p> | ||
<ul> | ||
<li *ngFor="let note of sponsor.notes"><a href="{{ note.link }}">{{ note.text }}</a></li> | ||
</ul> | ||
<hr style="border: 0.5px solid red;margin-top: 20px;"> | ||
</div> | ||
|
||
<div rows="0.5"> | ||
<button [routerLink]="[ '/admin/new' ]">Add Sponsor →</button> | ||
<button [routerLink]="[ '/admin/new' ]">Add Sponsor →</button> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,164 @@ | ||
import { SponsorIndexModel } from 'app/admin/sponsor-index.model'; | ||
import { SponsorNoteModel } from 'app/admin/sponsor-note.model'; | ||
import { AdminService } from 'app/admin/admin.service'; | ||
import { BenefitsService } from 'app/benefits/benefits.service'; | ||
import { EventsService } from 'app/events/events.service'; | ||
import { PeopleService } from 'app/people/people.service'; | ||
import { PresentationService } from 'app/presentation/presentation.service'; | ||
import { SponsorsService } from 'app/sponsors/sponsors.service'; | ||
import { TechService } from 'app/tech/tech.service'; | ||
import { WorkshopService } from 'app/workshops/workshop.service'; | ||
import { Component } from '@angular/core'; | ||
import { LayoutService } from 'app/layout.service'; | ||
import { SponsorshipBenefitModel } from 'app/benefits/sponsorship-benefit.model'; | ||
import { first } from 'rxjs/operators'; | ||
|
||
@Component({ | ||
selector: 'section[component="admin"][grid="rows"]', | ||
selector: 'section[component="admin"]', | ||
templateUrl: './admin.component.html' | ||
}) | ||
export class AdminComponent { | ||
sponsors: SponsorIndexModel[]; | ||
|
||
constructor(private adminService: AdminService, | ||
private layoutService: LayoutService) { | ||
private layoutService: LayoutService, | ||
private benefitsService: BenefitsService, | ||
private workshopService: WorkshopService, | ||
private eventsService: EventsService, | ||
private peopleService: PeopleService, | ||
private techService: TechService, | ||
private presentationService: PresentationService) { | ||
adminService.getSponsors().subscribe( | ||
sponsors => this.sponsors = (sponsors ? sponsors.sort((a, b) => a.name.localeCompare(b.name)) : []) | ||
sponsors => { | ||
this.sponsors = (sponsors ? sponsors.sort((a, b) => a.name.localeCompare(b.name)) : []); | ||
for (let sponsor of this.sponsors) { | ||
this.benefitsService.getSponsorBenefitDescriptions(sponsor.id).pipe(first()).subscribe( | ||
benefits => sponsor.notes = this.generateSponsorNotes(sponsor.id, benefits) | ||
); | ||
} | ||
} | ||
); | ||
this.layoutService.setLayoutMode('a4'); | ||
} | ||
|
||
private generateSponsorNotes(guid: string, benefits: SponsorshipBenefitModel[]): SponsorNoteModel[] { | ||
var sponsorNotes: SponsorNoteModel[] = [] | ||
|
||
if(this.benefitsService.hasProductDemoSlot(benefits)) { | ||
this.workshopService.getDoingProductDemo(guid).pipe(first()).subscribe( | ||
doingProductDemo => { | ||
if(doingProductDemo == null) { | ||
sponsorNotes.push({ | ||
text: "No Product Demo Information Submitted", | ||
link: guid + "/workshops" | ||
}); | ||
} | ||
} | ||
); | ||
} | ||
|
||
if(this.benefitsService.hasWorkshopSlot(benefits)) { | ||
this.workshopService.getDoingWorkshop(guid).pipe(first()).subscribe( | ||
doingWorkshop => { | ||
if(doingWorkshop == null) { | ||
sponsorNotes.push({ | ||
text: "No Workshop Information Submitted", | ||
link: guid + "/workshops" | ||
}); | ||
} | ||
} | ||
); | ||
} | ||
|
||
|
||
if (this.benefitsService.canRunCompetitionAndEvents(benefits)) { | ||
this.eventsService.getCompetitions(guid).pipe(first()).subscribe( | ||
competitions => { | ||
var hardwareAPIComp = competitions == null ? | ||
false : | ||
competitions["doingHardwareApiCompetition"] !== undefined; | ||
|
||
var sideEventFlag = competitions == null ? | ||
false : | ||
competitions["doingSideEvent"] !== undefined; | ||
|
||
var themedComp = competitions == null ? | ||
false : | ||
competitions["doingThemedCompetition"] !== undefined; | ||
|
||
if(!hardwareAPIComp) { | ||
sponsorNotes.push({ | ||
text: "No Hardware/API Competition Information Submitted", | ||
link: guid + "/events" | ||
}); | ||
} | ||
if(!sideEventFlag) { | ||
sponsorNotes.push({ | ||
text: "No Side Event Information Submitted", | ||
link: guid + "/events" | ||
}); | ||
} | ||
if(!themedComp) { | ||
sponsorNotes.push({ | ||
text: "No Themed Competition Information Submitted", | ||
link: guid + "/events" | ||
}); | ||
} | ||
} | ||
); | ||
} | ||
|
||
if (this.benefitsService.canRunOpeningCeremonyPresentation(benefits)) { | ||
this.presentationService.getUploadedPresentation(guid).pipe(first()).subscribe( | ||
presentation => { | ||
if(presentation != null) { | ||
sponsorNotes.push({ | ||
text: "No Opening Ceremony Presentation Submitted", | ||
link: guid + "/presentation" | ||
}); | ||
} | ||
} | ||
); | ||
} | ||
|
||
this.peopleService.getMentors(guid).pipe(first()).subscribe( | ||
mentors => { | ||
var numMentors = mentors == null ? 0 : mentors.length; | ||
sponsorNotes.push({ | ||
text: "Mentors: " + numMentors, | ||
link: guid + "/people" | ||
}); | ||
} | ||
); | ||
|
||
this.benefitsService.getMaxNumberOfRecruiters(guid).subscribe( | ||
limit => { | ||
if(limit > 0) { | ||
this.peopleService.getRecruiters(guid).pipe(first()).subscribe( | ||
recruiters => { | ||
var numRecruiters = recruiters == null ? 0 : recruiters.length; | ||
sponsorNotes.push({ | ||
text: "Recruiters: " + numRecruiters, | ||
link: guid + "/people" | ||
}); | ||
} | ||
); | ||
} | ||
} | ||
); | ||
|
||
if (this.benefitsService.canListHardwareAndApis(benefits)) { | ||
this.techService.getTechList(guid).pipe(first()).subscribe( | ||
tech => { | ||
var numTech = tech == null ? 0 : tech.length; | ||
sponsorNotes.push({ | ||
text: "Items of Tech: " + numTech, | ||
link: guid + "/tech" | ||
}); | ||
} | ||
); | ||
} | ||
|
||
return sponsorNotes; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import { SponsorNoteModel } from 'app/admin/sponsor-note.model'; | ||
|
||
export class SponsorIndexModel { | ||
id: string; | ||
name: string; | ||
notes: SponsorNoteModel[] = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export class SponsorNoteModel { | ||
text: string; | ||
link: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.