-
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.
Showing
143 changed files
with
132,438 additions
and
241 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"projects": { | ||
"default": "metabmaster" | ||
} | ||
} |
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,21 @@ | ||
{ | ||
"rules": { | ||
"pathways": { | ||
".read": true, | ||
"$pathway": { | ||
".read": true, | ||
".write": "(!data.exists() && auth!=null) || (data.exists() && data.child('userId').val() === auth.uid)", | ||
".validate": "newData.hasChildren(['userId', 'title', 'description', 'WPId'])", | ||
"title": { | ||
".validate": "newData.isString() && newData.val().length > 0 && newData.val().length < 100" | ||
}, | ||
"WPId": { | ||
".validate": "newData.isNumber() && newData.val() > 0" | ||
}, | ||
"description": { | ||
".validate": "newData.isString() && newData.val().length > 0" | ||
} | ||
} | ||
} | ||
} | ||
} |
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,14 @@ | ||
{ | ||
"database": { | ||
"rules": "database.rules.json" | ||
}, | ||
"hosting": { | ||
"public": "dist", | ||
"rewrites": [ | ||
{ | ||
"source": "**", | ||
"destination": "/index.html" | ||
} | ||
] | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions
14
...app/compounds/compounds.component.spec.ts → src/app/alert/alert.component.spec.ts
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,25 +1,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { CompoundsComponent } from './compounds.component'; | ||
import { AlertComponent } from './alert.component'; | ||
|
||
describe('CompoundsComponent', () => { | ||
let component: CompoundsComponent; | ||
let fixture: ComponentFixture<CompoundsComponent>; | ||
describe('AlertComponent', () => { | ||
let component: AlertComponent; | ||
let fixture: ComponentFixture<AlertComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ CompoundsComponent ] | ||
declarations: [ AlertComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(CompoundsComponent); | ||
fixture = TestBed.createComponent(AlertComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should be created', () => { | ||
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,35 @@ | ||
import {Component, Input, OnInit} from '@angular/core'; | ||
import Noty from 'noty'; | ||
|
||
@Component({ | ||
selector: 'app-alert', | ||
templateUrl: './alert.component.html', | ||
styleUrls: ['./alert.component.scss'] | ||
}) | ||
export class AlertComponent implements OnInit { | ||
private allowed = ['success', 'warning', 'error', 'alert', 'info']; | ||
@Input() type: string; | ||
@Input() heading: string; | ||
@Input() message: string; | ||
constructor() { } | ||
|
||
ngOnInit() { | ||
if (! this.allowed.indexOf(this.type)) { | ||
// Default to info | ||
this.type = 'info'; | ||
} | ||
|
||
new Noty({ | ||
type: this.type, | ||
text: this.message, | ||
timeout: 3000, | ||
closeWith: ['click', 'button'], | ||
queue: 'global', | ||
animation: { | ||
open: 'noty_effects_open', | ||
close: 'noty_effects_close' | ||
}, | ||
}).show(); | ||
} | ||
|
||
} |
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
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 { TestBed, async, inject } from '@angular/core/testing'; | ||
|
||
import { AuthGuard } from './auth.guard'; | ||
|
||
describe('AuthGuard', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [AuthGuard] | ||
}); | ||
}); | ||
|
||
it('should ...', inject([AuthGuard], (guard: AuthGuard) => { | ||
expect(guard).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,23 @@ | ||
import { Injectable } from '@angular/core'; | ||
import {CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router} from '@angular/router'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import {AuthService} from "./auth.service"; | ||
|
||
@Injectable() | ||
export class AuthGuard implements CanActivate { | ||
constructor(private auth: AuthService, private router: Router) {} | ||
canActivate( | ||
next: ActivatedRouteSnapshot, | ||
state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean { | ||
return this.checkLogin(state.url); | ||
|
||
} | ||
|
||
private checkLogin(url: string): boolean { | ||
if (this.auth.authenticated) { | ||
return true; | ||
} | ||
|
||
this.router.navigate(['/signin']); | ||
} | ||
} |
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 { TestBed, inject } from '@angular/core/testing'; | ||
|
||
import { AuthService } from './auth.service'; | ||
|
||
describe('AuthService', () => { | ||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [AuthService] | ||
}); | ||
}); | ||
|
||
it('should ...', inject([AuthService], (service: AuthService) => { | ||
expect(service).toBeTruthy(); | ||
})); | ||
}); |
Oops, something went wrong.