diff --git a/src/app/auth/auth.component.html b/src/app/auth/auth.component.html index edb6bf8..29e4acf 100644 --- a/src/app/auth/auth.component.html +++ b/src/app/auth/auth.component.html @@ -1,6 +1,6 @@
-
+
Login to Supercredit @@ -27,8 +27,8 @@
- -
+ +
@@ -39,4 +39,4 @@ >
- \ No newline at end of file + diff --git a/src/app/auth/auth.component.ts b/src/app/auth/auth.component.ts index c18b103..d607086 100644 --- a/src/app/auth/auth.component.ts +++ b/src/app/auth/auth.component.ts @@ -37,8 +37,7 @@ export class AuthComponent implements OnInit, OnDestroy{ } // tslint:disable-next-line:typedef - submitForm() { - // console.log(this.userForm); + submitForm(): void { this.loading = true; this.authService.login(this.userForm.value.email, this.userForm.value.password); } diff --git a/src/app/broker-loan-list/broker-loan-list.component.html b/src/app/broker-loan-list/broker-loan-list.component.html index 4f23498..c955553 100644 --- a/src/app/broker-loan-list/broker-loan-list.component.html +++ b/src/app/broker-loan-list/broker-loan-list.component.html @@ -6,7 +6,24 @@ > - + + +
+
+
{{ p }}
+
+
+
+ + + + + + + {{dataItem.Status}} + + + @@ -22,7 +39,7 @@ - +
diff --git a/src/app/broker-reward/broker-reward.component.html b/src/app/broker-reward/broker-reward.component.html index 9f6efb2..f7129bd 100644 --- a/src/app/broker-reward/broker-reward.component.html +++ b/src/app/broker-reward/broker-reward.component.html @@ -1 +1,38 @@ -

broker-reward works!

+ + + + + + {{ dataItem.Amount | currency }} + + + + + + + + {{dataItem.Status}} + + + + + +
+ {{ dataItem.Ts | date: 'yyyy-MM-dd' }} +
+
+
+ + + + +
+ {{ dataItem.Settlement | date: 'yyyy-MM-dd' }} +
+
+
+ + +
diff --git a/src/app/broker-reward/broker-reward.component.ts b/src/app/broker-reward/broker-reward.component.ts index 6aeb664..7aacae4 100644 --- a/src/app/broker-reward/broker-reward.component.ts +++ b/src/app/broker-reward/broker-reward.component.ts @@ -1,4 +1,10 @@ import { Component, OnInit } from '@angular/core'; +import {HttpClient} from '@angular/common/http'; +import {GridDataResult} from '@progress/kendo-angular-grid'; +import {Observable} from 'rxjs'; +import {AuthService} from '../service/auth.service'; +import {map} from 'rxjs/operators'; +import {RewardByUserModel} from '../models/reward-by-user.model'; @Component({ selector: 'app-broker-reward', @@ -7,9 +13,18 @@ import { Component, OnInit } from '@angular/core'; }) export class BrokerRewardComponent implements OnInit { - constructor() { } + public gridData: RewardByUserModel[] = [] ; + + constructor(private http: HttpClient, private auth: AuthService ) { } ngOnInit(): void { + this.gridData = []; + this.http.get(this.auth.getUrl('user-reward/')).subscribe( + rsp => { + rsp.forEach(v => { + this.gridData.push(new RewardByUserModel(v)); + }); + } + ); } - } diff --git a/src/app/dashboard/dashboard.component.scss b/src/app/dashboard/dashboard.component.scss index 175cb18..1305331 100644 --- a/src/app/dashboard/dashboard.component.scss +++ b/src/app/dashboard/dashboard.component.scss @@ -1,7 +1,7 @@ .container.outer{ width:100%; max-width:100vw; - background: url('../../assets/img/body_bg.jpg') no-repeat center center fixed; + background: url('/assets/img/body_bg.jpg') no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; diff --git a/src/app/models/reward-by-user.model.ts b/src/app/models/reward-by-user.model.ts new file mode 100644 index 0000000..f178188 --- /dev/null +++ b/src/app/models/reward-by-user.model.ts @@ -0,0 +1,37 @@ +export class RewardByUserModel { + public Id: number; + public Ts: Date; + public To: string; + public Amount: number; + public Description: string; + public LoanId: string; + public PayOutId: number; + public ToFirst: string; + public ToMiddle: string; + public ToLast: string; + public ToTitle: string; + public ToDisplay: string; + public ToNick: string; + public Item: string; + public Status: string; + public Settlement: Date; + + constructor(payload: Partial) { + this.Id = payload.Id || 0; + this.Ts = new Date(payload.Ts); + this.To = payload.To || ''; + this.Amount = payload.Amount || 0; + this.Description = payload.Description || ''; + this.LoanId = payload.LoanId || ''; + this.PayOutId = payload.PayOutId || 0; + this.ToFirst = payload.ToFirst || ''; + this.ToMiddle = payload.ToMiddle || ''; + this.ToLast = payload.ToLast || ''; + this.ToTitle = payload.ToTitle || ''; + this.ToDisplay = payload.ToDisplay || ''; + this.ToNick = payload.ToNick || ''; + this.Item = payload.Item || ''; + this.Status = payload.Status || ''; + this.Settlement = new Date(payload.Settlement); + } +} diff --git a/src/app/models/reward.model.ts b/src/app/models/reward.model.ts index 6910272..5c48d0d 100644 --- a/src/app/models/reward.model.ts +++ b/src/app/models/reward.model.ts @@ -37,3 +37,6 @@ export class RewardModel { return this.lc.getUserPhotoUrl(this.From); } } + + + diff --git a/src/app/top-bar/top-bar.component.ts b/src/app/top-bar/top-bar.component.ts index 4c929aa..7836675 100644 --- a/src/app/top-bar/top-bar.component.ts +++ b/src/app/top-bar/top-bar.component.ts @@ -34,15 +34,15 @@ export class TopBarComponent implements OnInit , OnDestroy { public initAndSubLogin(): void{ this.login = this.authService.loggedIn.login; this.LoggedInUser = this.authService.loggedIn.user; - console.log(this); + this.selectMenuShow(this.authService.loggedIn.role); - // console.log('subscribe auto login', this.authService.loggedIn); + this.loginSub = this.authService.loginSuccess.subscribe( (rsp: apiV1LoginResponse) => { this.login = rsp.login; this.LoggedInUser = this.authService.loggedIn.user; this.selectMenuShow(rsp.role); - console.log ('topbar received auth events', rsp); + } ); }