| import {BrokerProfileComponent} from './broker-profile/broker-profile.component'; | import {BrokerProfileComponent} from './broker-profile/broker-profile.component'; | ||||
| import {ClientLoanListComponent} from './client-loan-list/client-loan-list.component'; | import {ClientLoanListComponent} from './client-loan-list/client-loan-list.component'; | ||||
| import {ClientProfileComponent} from './client-profile/client-profile.component'; | import {ClientProfileComponent} from './client-profile/client-profile.component'; | ||||
| import {E403Component} from './e403/e403.component'; | |||||
| const routes: Routes = [ | const routes: Routes = [ | ||||
| {path : 'broker-profile', component: BrokerProfileComponent, }, | {path : 'broker-profile', component: BrokerProfileComponent, }, | ||||
| {path : 'client-loan-list', component: ClientLoanListComponent, }, | {path : 'client-loan-list', component: ClientLoanListComponent, }, | ||||
| {path : 'client-profile', component: ClientProfileComponent, }, | {path : 'client-profile', component: ClientProfileComponent, }, | ||||
| {path : 'e403', component: E403Component, }, | |||||
| ]; | ]; | ||||
| @NgModule({ | @NgModule({ |
| import { BrokerProfileComponent } from './broker-profile/broker-profile.component'; | import { BrokerProfileComponent } from './broker-profile/broker-profile.component'; | ||||
| import { ClientLoanListComponent } from './client-loan-list/client-loan-list.component'; | import { ClientLoanListComponent } from './client-loan-list/client-loan-list.component'; | ||||
| import { ClientProfileComponent } from './client-profile/client-profile.component'; | import { ClientProfileComponent } from './client-profile/client-profile.component'; | ||||
| import { E403Component } from './e403/e403.component'; | |||||
| BrokerRewardComponent, | BrokerRewardComponent, | ||||
| BrokerProfileComponent, | BrokerProfileComponent, | ||||
| ClientLoanListComponent, | ClientLoanListComponent, | ||||
| ClientProfileComponent | |||||
| ClientProfileComponent, | |||||
| E403Component | |||||
| ], | ], | ||||
| imports: [ | imports: [ | ||||
| BrowserModule, | BrowserModule, |
| this.authService.login(this.userForm.value.email, this.userForm.value.password); | this.authService.login(this.userForm.value.email, this.userForm.value.password); | ||||
| } | } | ||||
| public onLogin(rsp: apiV1LoginResponse) { | |||||
| public onLogin(rsp: apiV1LoginResponse): void { | |||||
| this.loading = false; | this.loading = false; | ||||
| // console.log ('found login ' , rsp ); | // console.log ('found login ' , rsp ); | ||||
| if (rsp.login) { | if (rsp.login) { | ||||
| this.router.navigate(['/dashboard']); | |||||
| switch ( rsp.role ) { | |||||
| case 'admin': | |||||
| this.router.navigate(['/dashboard']); | |||||
| break; | |||||
| case 'broker': | |||||
| this.router.navigate(['/broker-loan-list']); | |||||
| break; | |||||
| case 'user': | |||||
| this.router.navigate(['/client-loan-list']); | |||||
| break; | |||||
| default: | |||||
| this.router.navigate(['/e403']); | |||||
| break; | |||||
| } | |||||
| } | } | ||||
| else { | else { | ||||
| this.show(); | this.show(); |
| <div class="body"> | |||||
| <article> | |||||
| <h1>Page’s not available!</h1> | |||||
| <div> | |||||
| <p>Sorry for the inconvenience but you’re not allowed to visit this page <p> | |||||
| Please feel free to <a href="https://sfmarkets.com.au">contact us</a>, otherwise please try other links</p> | |||||
| <p>— The Team</p> | |||||
| </div> | |||||
| </article> | |||||
| </div> |
| div.body { | |||||
| text-align: center; | |||||
| padding: 150px; | |||||
| display: table; | |||||
| width: 100%; | |||||
| height: 100vh; | |||||
| opacity: 0.95; | |||||
| background: url('../../assets/img/body_bg.jpg') no-repeat center center fixed; | |||||
| background-size: cover; | |||||
| } | |||||
| h1 { | |||||
| font-size: 50px; | |||||
| } | |||||
| body { | |||||
| font: 20px Helvetica, sans-serif; | |||||
| color: #333; | |||||
| } | |||||
| article { | |||||
| display: block; | |||||
| text-align: left; | |||||
| width: 650px; | |||||
| margin: 0 auto; | |||||
| } | |||||
| a { | |||||
| color: #dc8100; | |||||
| text-decoration: none; | |||||
| } | |||||
| a:hover { | |||||
| color: #333; | |||||
| text-decoration: none; | |||||
| } | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { E403Component } from './e403.component'; | |||||
| describe('E403Component', () => { | |||||
| let component: E403Component; | |||||
| let fixture: ComponentFixture<E403Component>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [ E403Component ] | |||||
| }) | |||||
| .compileComponents(); | |||||
| }); | |||||
| beforeEach(() => { | |||||
| fixture = TestBed.createComponent(E403Component); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); |
| import { Component, OnInit } from '@angular/core'; | |||||
| @Component({ | |||||
| selector: 'app-e403', | |||||
| templateUrl: './e403.component.html', | |||||
| styleUrls: ['./e403.component.scss'] | |||||
| }) | |||||
| export class E403Component implements OnInit { | |||||
| constructor() { } | |||||
| ngOnInit(): void { | |||||
| } | |||||
| } |