-
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.
Merge pull request #103 from sinfo/staging
Adapt frontend to new Deck and backend changes
- Loading branch information
Showing
44 changed files
with
3,851 additions
and
3,645 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 |
---|---|---|
|
@@ -4,7 +4,6 @@ on: | |
push: | ||
branches: | ||
- "staging" | ||
- "master" | ||
|
||
jobs: | ||
docker: | ||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
export class Info { | ||
info?: MiscInfo; | ||
titles?: Titles; | ||
|
||
constructor(info?: MiscInfo, titles?: Titles) { | ||
this.info = info; | ||
this.titles = titles; | ||
} | ||
} | ||
|
||
class MiscInfo { | ||
numberOfPeople?: Number; | ||
licensePlates?: String[]; | ||
|
||
constructor(numberOfPeople?: Number, licensePlates?: String[]) { | ||
this.numberOfPeople = numberOfPeople; | ||
this.licensePlates = licensePlates; | ||
} | ||
} | ||
|
||
class Titles { | ||
presentation?: String; | ||
lunchTalk?: String; | ||
workshop?: String; | ||
|
||
constructor(presentation?: String, workshop?: String, lunchTalk?: String) { | ||
this.presentation = presentation; | ||
this.workshop = workshop; | ||
this.lunchTalk = lunchTalk; | ||
} | ||
} |
Empty file.
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,3 @@ | ||
<p> | ||
infos works! | ||
</p> |
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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { InfosComponent } from './infos.component'; | ||
|
||
describe('InfosComponent', () => { | ||
let component: InfosComponent; | ||
let fixture: ComponentFixture<InfosComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ InfosComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(InfosComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-infos', | ||
templateUrl: './infos.component.html', | ||
styleUrls: ['./infos.component.css'] | ||
}) | ||
export class InfosComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
import { Injectable } from '@angular/core' | ||
|
||
/** | ||
* This code was taken from: https://github.com/auth0/angular2-jwt | ||
* We only need the basic functionality to decode and check if token is expired | ||
*/ | ||
@Injectable() | ||
export class JwtService { | ||
|
||
constructor () {} | ||
|
||
public urlBase64Decode (str: string): string { | ||
let output = str.replace(/-/g, '+').replace(/_/g, '/') | ||
switch (output.length % 4) { | ||
case 0: { | ||
break | ||
} | ||
case 2: { | ||
output += '==' | ||
break | ||
} | ||
case 3: { | ||
output += '=' | ||
break | ||
} | ||
default: { | ||
throw new Error('Illegal base64url string!') | ||
} | ||
} | ||
return this.b64DecodeUnicode(output) | ||
} | ||
|
||
// credits for decoder goes to https://github.com/atk | ||
private b64decode (str: string): string { | ||
let chars = | ||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' | ||
let output = '' | ||
|
||
str = String(str).replace(/=+$/, '') | ||
|
||
if (str.length % 4 === 1) { | ||
throw new Error( | ||
"'atob' failed: The string to be decoded is not correctly encoded." | ||
) | ||
} | ||
|
||
for ( | ||
// initialize result and counters | ||
// tslint:disable-next-line:one-variable-per-declaration | ||
let bc = 0, bs: any, buffer: any, idx = 0; | ||
// get next character | ||
// tslint:disable-next-line:no-conditional-assignment | ||
(buffer = str.charAt(idx++)); | ||
// character found in table? initialize bit storage and add its ascii value; | ||
// tslint:disable-next-line:no-bitwise | ||
~buffer && | ||
( | ||
// tslint:disable-next-line:no-conditional-assignment | ||
(bs = bc % 4 ? bs * 64 + buffer : buffer), | ||
// and if not first of each 4 characters, | ||
// convert the first 8 bits to one ascii character | ||
bc++ % 4 | ||
) | ||
// tslint:disable-next-line:no-bitwise | ||
? (output += String.fromCharCode(255 & (bs >> ((-2 * bc) & 6)))) | ||
: 0 | ||
) { | ||
// try to find character in table (0-63, not found => -1) | ||
buffer = chars.indexOf(buffer) | ||
} | ||
return output | ||
} | ||
|
||
private b64DecodeUnicode (str: any) { | ||
return decodeURIComponent( | ||
Array.prototype.map | ||
.call(this.b64decode(str), (c: any) => { | ||
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2) | ||
}) | ||
.join('') | ||
) | ||
} | ||
|
||
public decodeToken (token: string): any { | ||
let parts = token.split('.') | ||
|
||
if (parts.length !== 3) { | ||
throw new Error('The inspected token doesn\'t appear to be a JWT.') | ||
} | ||
|
||
let decoded = this.urlBase64Decode(parts[1]) | ||
if (!decoded) { | ||
throw new Error('Cannot decode the token.') | ||
} | ||
|
||
return JSON.parse(decoded) | ||
} | ||
|
||
public getTokenExpirationDate (token: string): Date { | ||
let decoded: any | ||
decoded = this.decodeToken(token) | ||
|
||
if (!decoded.hasOwnProperty('exp')) { | ||
return null | ||
} | ||
|
||
const date = new Date(0) | ||
date.setUTCSeconds(decoded.exp) | ||
|
||
return date | ||
} | ||
|
||
public isTokenExpired (token: string, offsetSeconds?: number): boolean { | ||
let date = this.getTokenExpirationDate(token) | ||
offsetSeconds = offsetSeconds || 0 | ||
|
||
if (date === null) { | ||
return false | ||
} | ||
|
||
return !(date.valueOf() > new Date().valueOf() + offsetSeconds * 1000) | ||
} | ||
} |
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
.card-body { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.input-group-prepend { | ||
|
Oops, something went wrong.