diff --git a/src/app/dashboard/dashboard.routing.ts b/src/app/dashboard/dashboard.routing.ts
index ba776f2..d0e56fe 100644
--- a/src/app/dashboard/dashboard.routing.ts
+++ b/src/app/dashboard/dashboard.routing.ts
@@ -13,6 +13,7 @@ import { AddDataComponent } from './add-data.component';
import { FeedbackComponent } from './feedback.component';
import { TransactionLogComponent } from './transaction-log.component';
import { PayrollLogComponent } from './payroll-log.component';
+import { LeaderboardComponent } from './leaderboard.component';
import { MapComponent } from './map.component';
// Using child path to allow for FullLayout theming
diff --git a/src/app/dashboard/leaderboard.component.html b/src/app/dashboard/leaderboard.component.html
index 7eee607..34345f3 100644
--- a/src/app/dashboard/leaderboard.component.html
+++ b/src/app/dashboard/leaderboard.component.html
@@ -7,15 +7,17 @@
By default this loads the page with your position.
-
-
-
+
+
{
- if (result.transactions.length > 0) {
- this.transactionList = result.transactions;
+ if (result.leaderboard.length > 0) {
+ this.leaderboardList = result.leaderboard;
// TODO Rename in server
- this.paginateConfig.totalItems = result.page_no;
+ this.paginateConfig.totalItems = result.count;
this.paginateConfig.currentPage = result.page;
this.noLeaderboardList = false;
} else {
- // handle the case when the transactionList is empty
+ // handle the case when the leaderboardList is empty
this.leaderboardList = null;
this.noLeaderboardList = true;
}
diff --git a/src/app/shared/leaderboard-result.component.html b/src/app/shared/leaderboard-result.component.html
index 8a728ba..76e4d3c 100644
--- a/src/app/shared/leaderboard-result.component.html
+++ b/src/app/shared/leaderboard-result.component.html
@@ -1,3 +1,3 @@
-{{ item.position }} |
-{{ item.display_name }} |
-{{ listType.includes('total') ? (item.value | currency:'GBP':true:'1.2-2') : (item.value | number:'1.0-0') }} |
+{{ leaderboard.position }} |
+{{ leaderboard.display_name }} |
+{{ listType.includes('total') ? (leaderboard.value | currency:'GBP':true:'1.2-2') : (leaderboard.value | number:'1.0-0') }} |
diff --git a/src/app/shared/leaderboard-result.component.ts b/src/app/shared/leaderboard-result.component.ts
index 53fce68..925f331 100644
--- a/src/app/shared/leaderboard-result.component.ts
+++ b/src/app/shared/leaderboard-result.component.ts
@@ -1,9 +1,9 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
interface LeaderboardData {
- seller: number;
+ position: number;
+ display_name: number,
value: number;
- purchase_time: string;
}
@Component({
@@ -12,7 +12,8 @@ interface LeaderboardData {
templateUrl: 'leaderboard-result.component.html',
})
export class LeaderboardResultComponent implements OnInit {
- @Input() public leaderboard: leaderboardData;
+ @Input() public leaderboard: LeaderboardData;
+ @Input() public listType: string;
ngOnInit(): void {
}