From 0b49430e3b0a5cc14521db58af19dafa5384c3c4 Mon Sep 17 00:00:00 2001 From: sowgro Date: Tue, 1 Apr 2025 16:58:12 -0400 Subject: Fix warnings and misaligned prev page button --- .../src/app/components/need-list/need-list.component.html | 2 +- .../src/app/components/need-page/need-page.component.html | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'ufund-ui/src') diff --git a/ufund-ui/src/app/components/need-list/need-list.component.html b/ufund-ui/src/app/components/need-list/need-list.component.html index c0501ba..8d01291 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.html +++ b/ufund-ui/src/app/components/need-list/need-list.component.html @@ -65,7 +65,7 @@
- + Page {{currentPage + 1}} of {{totalPages}}
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.html b/ufund-ui/src/app/components/need-page/need-page.component.html index 958dfa6..522b710 100644 --- a/ufund-ui/src/app/components/need-page/need-page.component.html +++ b/ufund-ui/src/app/components/need-page/need-page.component.html @@ -1,14 +1,14 @@
-

{{need?.name}}

- {{need?.type}} GOAL +

{{need.name}}

+ {{need.type}} GOAL - Need image + Need image -

{{need?.description}}

+

{{need.description}}

- - This goal is {{(((need?.current ?? 0)*100) / (need?.maxGoal ?? 0)).toFixed(0)}}% complete! + + This goal is {{(((need.current)*100) / (need.maxGoal)).toFixed(0)}}% complete!
Target Goal: {{need.maxGoal}} -- cgit v1.2.3 From 734d3d380cd70e87474adebedec5e230959bcf81 Mon Sep 17 00:00:00 2001 From: sowgro Date: Tue, 1 Apr 2025 19:44:28 -0400 Subject: Make nav bar buttons only show conditionally --- ufund-ui/src/app/app.component.html | 4 ++-- ufund-ui/src/app/models/User.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'ufund-ui/src') diff --git a/ufund-ui/src/app/app.component.html b/ufund-ui/src/app/app.component.html index 959eada..f697695 100644 --- a/ufund-ui/src/app/app.component.html +++ b/ufund-ui/src/app/app.component.html @@ -5,9 +5,9 @@
- Dashboard + Dashboard Cupboard - Basket + Basket diff --git a/ufund-ui/src/app/models/User.ts b/ufund-ui/src/app/models/User.ts index e6848fa..d7d67b5 100644 --- a/ufund-ui/src/app/models/User.ts +++ b/ufund-ui/src/app/models/User.ts @@ -1,6 +1,6 @@ export enum userType { - HELPER, - MANAGER + HELPER = "HELPER", + MANAGER = "MANAGER" } export interface User { -- cgit v1.2.3 From 92fbcbfd6ade1c5fe0cc3c37d6a6914ef1d2a2a4 Mon Sep 17 00:00:00 2001 From: sowgro Date: Tue, 1 Apr 2025 20:04:33 -0400 Subject: Add skip to first / last page in pagination --- ufund-ui/src/app/app.component.ts | 4 +++- .../app/components/need-list/need-list.component.css | 4 ++++ .../app/components/need-list/need-list.component.html | 8 ++++---- .../app/components/need-list/need-list.component.ts | 19 +++++++++++++------ 4 files changed, 24 insertions(+), 11 deletions(-) (limited to 'ufund-ui/src') diff --git a/ufund-ui/src/app/app.component.ts b/ufund-ui/src/app/app.component.ts index 2f98334..bc0e71a 100644 --- a/ufund-ui/src/app/app.component.ts +++ b/ufund-ui/src/app/app.component.ts @@ -3,7 +3,7 @@ import {BehaviorSubject} from 'rxjs'; import { DOCUMENT } from '@angular/common'; import {AuthService} from './services/auth.service'; import {ToastsService} from './services/toasts.service'; -import {User} from './models/User'; +import {User, userType} from './models/User'; import {ActivatedRoute, Router} from '@angular/router'; @Component({ @@ -48,4 +48,6 @@ export class AppComponent implements OnInit { localStorage.removeItem("credential") location.reload() } + + protected readonly userType = userType; } diff --git a/ufund-ui/src/app/components/need-list/need-list.component.css b/ufund-ui/src/app/components/need-list/need-list.component.css index 5f2e5e1..e17609b 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.css +++ b/ufund-ui/src/app/components/need-list/need-list.component.css @@ -89,6 +89,10 @@ select { background-color: #3a3a3a; border-radius: 5px; cursor: pointer; + height: 130px; + display: flex; + flex-direction: column; + justify-content: space-between; } .clickable:hover { diff --git a/ufund-ui/src/app/components/need-list/need-list.component.html b/ufund-ui/src/app/components/need-list/need-list.component.html index 8d01291..88317dd 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.html +++ b/ufund-ui/src/app/components/need-list/need-list.component.html @@ -40,8 +40,6 @@
-
-
{{need.current}}/{{need.maxGoal}} ({{((need.current / need.maxGoal) * 100).toFixed(0)}}%) @@ -65,7 +63,9 @@
- + + Page {{currentPage + 1}} of {{totalPages}} - + +
diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts index cd3d9bd..06a612e 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.ts +++ b/ufund-ui/src/app/components/need-list/need-list.component.ts @@ -74,12 +74,22 @@ export class NeedListComponent { decrementPage() { this.currentPage--; - this.updateVisibleNeeds(); + this.updateVisibleNeeds(); } incrementPage() { this.currentPage++; - this.updateVisibleNeeds(); + this.updateVisibleNeeds(); + } + + lastPage() { + this.currentPage = this.totalPages - 1 + this.updateVisibleNeeds() + } + + firstPage() { + this.currentPage = 0 + this.updateVisibleNeeds() } editNeedsPerPage(amount: number) { @@ -135,7 +145,7 @@ export class NeedListComponent { ngOnInit(): void { this.refresh() - + } changeSortMode(form : any) { @@ -269,7 +279,4 @@ export class NeedListComponent { } } } -function not(location: string) { - throw new Error('Function not implemented.'); -} -- cgit v1.2.3 From 77f3cf60bbb9e7b13cc2642fa06b5f40dccdbdb1 Mon Sep 17 00:00:00 2001 From: sowgro Date: Tue, 1 Apr 2025 20:05:06 -0400 Subject: Stub out new admin dashboard --- .../src/app/components/dashboard/dashboard.component.css | 2 +- .../src/app/components/dashboard/dashboard.component.html | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'ufund-ui/src') diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.css b/ufund-ui/src/app/components/dashboard/dashboard.component.css index 78a69ba..185fdc2 100644 --- a/ufund-ui/src/app/components/dashboard/dashboard.component.css +++ b/ufund-ui/src/app/components/dashboard/dashboard.component.css @@ -1,7 +1,7 @@ :host { display: flex; flex-direction: column; - width: 1000px; + width: 800px; align-self: center; gap: 20px } diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.html b/ufund-ui/src/app/components/dashboard/dashboard.component.html index 6a95ecd..2d7b4c3 100644 --- a/ufund-ui/src/app/components/dashboard/dashboard.component.html +++ b/ufund-ui/src/app/components/dashboard/dashboard.component.html @@ -1,5 +1,10 @@ -

Your Dashboard

- - - +

Admin Dashboard

+ + + +_ Registered users +_ Needs with overflow +_ Needs in peoples baskets +_ Total monetary contributions +_ -- cgit v1.2.3 From 2eb67f9481d858474e77af545e71f68b2cea7041 Mon Sep 17 00:00:00 2001 From: sowgro Date: Tue, 1 Apr 2025 21:17:45 -0400 Subject: Simplify sign up process --- ufund-ui/src/app/components/signup/signup.component.html | 4 +--- ufund-ui/src/app/components/signup/signup.component.ts | 13 ++++--------- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'ufund-ui/src') diff --git a/ufund-ui/src/app/components/signup/signup.component.html b/ufund-ui/src/app/components/signup/signup.component.html index bc3aaf0..84f15e4 100644 --- a/ufund-ui/src/app/components/signup/signup.component.html +++ b/ufund-ui/src/app/components/signup/signup.component.html @@ -8,7 +8,7 @@
- + {{passwordStatusText | async}}
@@ -24,8 +24,6 @@
- Account created Proceed to login - {{statusText | async}}
Already have an account? Log in
diff --git a/ufund-ui/src/app/components/signup/signup.component.ts b/ufund-ui/src/app/components/signup/signup.component.ts index a20d828..b040d1a 100644 --- a/ufund-ui/src/app/components/signup/signup.component.ts +++ b/ufund-ui/src/app/components/signup/signup.component.ts @@ -6,7 +6,6 @@ import {ToastsService, ToastType} from '../../services/toasts.service'; class PasswordRequirements { sixLong: {title: string, value: boolean} = {title: 'Is 6 characters or longer' , value: false} - twelveLong: {title: string, value: boolean} = {title: 'Is 12 characters or longer', value: false} lowercase: {title: string, value: boolean} = {title: 'Includes lowercase letter' , value: false} uppercase: {title: string, value: boolean} = {title: 'Includes uppercase letter' , value: false} number: {title: string, value: boolean} = {title: 'Includes number' , value: false} @@ -25,12 +24,10 @@ export class SignupComponent { protected passwordStatusText = new BehaviorSubject("") protected passwordsMatch = new BehaviorSubject(false) protected usernameStatusText = new BehaviorSubject("") - protected showSuccessMessage = new BehaviorSubject(false) protected passwordStrongEnough = new BehaviorSubject(false) protected ableToCreateAccount = new BehaviorSubject(false) protected passwordRequirements: PasswordRequirements = new PasswordRequirements() protected strength = new BehaviorSubject(0) - protected statusText = new BehaviorSubject(""); constructor( protected usersService: UsersService, @@ -45,7 +42,9 @@ export class SignupComponent { } this.usersService.createUser(username, password).then(() => { - this.showSuccessMessage.next(true); + // let action = {label: 'Proceed to login', onAction: () => this.router.navigate(["/login"])} + this.toastService.sendToast(ToastType.INFO, "Account successfully created") + this.router.navigate(["/login"]) }).catch(ex => { this.toastService.sendToast(ToastType.ERROR, "Unable to create account: " + friendlyHttpStatus[ex.status]) console.log(ex) @@ -74,16 +73,12 @@ export class SignupComponent { if (password.match(/[^!-~]/g)) { this.passwordStatusText.next("Invalid characters") - return } if (password.length > 6) { this.passwordRequirements.sixLong.value = true } - if (password.length > 12) { - this.passwordRequirements.twelveLong.value = true - } if (password.match(/[a-z]/g)) { this.passwordRequirements.lowercase.value = true } @@ -108,7 +103,7 @@ export class SignupComponent { } else if (strength == 0) { this.passwordStatusText.next("") } else { - this.passwordStatusText.next("5/6 checks required") + this.passwordStatusText.next("Password must meet requirements") } this.strength.next(strength) -- cgit v1.2.3