From e89bcbad67886174463d8e36ce16d02012881779 Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 6 Apr 2025 19:32:00 -0400 Subject: fix dashboard, make buttons use secondary color by default --- ufund-ui/src/app/components/dashboard/dashboard.component.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ufund-ui/src/app/components/dashboard') diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.css b/ufund-ui/src/app/components/dashboard/dashboard.component.css index 54f362b..cb4ad74 100644 --- a/ufund-ui/src/app/components/dashboard/dashboard.component.css +++ b/ufund-ui/src/app/components/dashboard/dashboard.component.css @@ -17,7 +17,7 @@ } .card { - background-color: #2e2e2e; + background-color: var(--tertiary-color); width: 400px; height: 130px; border-radius: 5px; @@ -34,7 +34,7 @@ .listCard { display: flex; flex-direction: column; - background-color: #2e2e2e; + background-color: var(--tertiary-color); border-radius: 5px; padding: 10px; gap: 10px; -- cgit v1.2.3 From 81917b7cae6d3d22bc8e54f7b2bd416acd70475f Mon Sep 17 00:00:00 2001 From: Gunther6070 Date: Mon, 7 Apr 2025 14:03:59 -0400 Subject: Added total physical contributions to dashboard and funding basket --- ufund-ui/src/app/components/dashboard/dashboard.component.html | 6 ++++++ ufund-ui/src/app/components/dashboard/dashboard.component.ts | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'ufund-ui/src/app/components/dashboard') diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.html b/ufund-ui/src/app/components/dashboard/dashboard.component.html index 233096a..20e1676 100644 --- a/ufund-ui/src/app/components/dashboard/dashboard.component.html +++ b/ufund-ui/src/app/components/dashboard/dashboard.component.html @@ -21,6 +21,12 @@ Most fulfilled needs +
+ Total physical contributions +
    +
  • {{need}}
  • +
+
} @else {

Unauthorized

diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.ts b/ufund-ui/src/app/components/dashboard/dashboard.component.ts index 2ab4db2..b73be44 100644 --- a/ufund-ui/src/app/components/dashboard/dashboard.component.ts +++ b/ufund-ui/src/app/components/dashboard/dashboard.component.ts @@ -16,10 +16,11 @@ import {userType} from '../../models/User'; export class DashboardComponent implements OnInit{ protected count = new BehaviorSubject(undefined) - protected totalDonations = new BehaviorSubject(undefined) + protected totalDonations = new BehaviorSubject(undefined) protected totalNeeds = new BehaviorSubject(undefined) protected fulfilledNeeds = new BehaviorSubject(undefined) protected mostFulfilledNeeds = new BehaviorSubject(undefined) + protected physicalTotal: string[] = [] constructor( protected authService: AuthService, @@ -30,15 +31,20 @@ export class DashboardComponent implements OnInit{ ngOnInit() { this.userService.getCount().subscribe(count => this.count.next(count)) + this.physicalTotal = [] this.cupboardService.getNeeds().subscribe(needs => { let totalValue = 0 for (let need of needs) { if (need.type === GoalType.MONETARY) { totalValue += need.current - this.totalDonations.next(totalValue) + this.totalDonations.next(totalValue.toLocaleString()) + } else { + this.physicalTotal.push(need.name + ": " + need.current) } } + + this.physicalTotal.sort((a, b) => a < b ? -1 : 1); this.fulfilledNeeds.next(needs.filter(a => ((a.current / a.maxGoal)) >= 1)) needs.sort((a, b) => b.current/b.maxGoal - a.current/a.maxGoal) -- cgit v1.2.3