From 3e5422b90a09d1ed2cfffae56abf8dbe361f6c27 Mon Sep 17 00:00:00 2001 From: sowgro Date: Wed, 2 Apr 2025 23:27:27 -0400 Subject: [incomplete] rearrange code to begin need-list abstraction --- ufund-ui/src/app/components/funding-basket/funding-basket.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ufund-ui/src/app/components/funding-basket/funding-basket.component.ts') diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts index 847baee..0b3b9f3 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts @@ -2,7 +2,7 @@ import {Component, Input, OnInit, ViewChild} from '@angular/core'; import {UsersService} from '../../services/users.service'; import {Router} from '@angular/router'; import {CupboardService} from '../../services/cupboard.service'; -import {catchError, firstValueFrom, Observable} from 'rxjs'; +import {catchError, firstValueFrom, Observable, of} from 'rxjs'; import {AuthService} from '../../services/auth.service'; import {ToastsService, ToastType} from '../../services/toasts.service'; @@ -91,4 +91,5 @@ export class FundingBasketComponent implements OnInit { } + protected readonly of = of; } -- cgit v1.2.3 From b578584a1208178100bf90e8b06971772c7fc00f Mon Sep 17 00:00:00 2001 From: sowgro Date: Fri, 4 Apr 2025 21:55:12 -0400 Subject: Fix many bugs and code clean up --- .../app/components/funding-basket/funding-basket.component.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ufund-ui/src/app/components/funding-basket/funding-basket.component.ts') diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts index 0b3b9f3..767327e 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts @@ -5,6 +5,7 @@ import {CupboardService} from '../../services/cupboard.service'; import {catchError, firstValueFrom, Observable, of} from 'rxjs'; import {AuthService} from '../../services/auth.service'; import {ToastsService, ToastType} from '../../services/toasts.service'; +import {userType} from '../../models/User'; @Component({ selector: 'app-funding-basket', @@ -18,19 +19,14 @@ export class FundingBasketComponent implements OnInit { private router: Router, protected cupboardService: CupboardService, protected usersService: UsersService, - private authService: AuthService, + protected authService: AuthService, private toastService: ToastsService ) {} @ViewChild("contribution") contribution?: Input; @Input() isValid: boolean = true; - // this is for login rerouting ngOnInit(): void { - if (!this.authService.getCurrentUser()) { - this.router.navigate(['/login'], {queryParams: {redir: this.router.url}}); - return; - } this.usersService.refreshBasket(); // this.usersService.removeNeed(); <- call this to remove @@ -92,4 +88,5 @@ export class FundingBasketComponent implements OnInit { protected readonly of = of; + protected readonly userType = userType; } -- cgit v1.2.3 From 04db6f32b249ffb17c571cd6b16c8c54397f0be4 Mon Sep 17 00:00:00 2001 From: sowgro Date: Fri, 4 Apr 2025 23:55:19 -0400 Subject: Fix typos --- .../src/app/components/funding-basket/funding-basket.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ufund-ui/src/app/components/funding-basket/funding-basket.component.ts') diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts index c807271..371015a 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts @@ -2,7 +2,7 @@ import {Component, Input, OnInit, ViewChild} from '@angular/core'; import {UsersService} from '../../services/users.service'; import {Router} from '@angular/router'; import {CupboardService} from '../../services/cupboard.service'; -import {catchError, firstValueFrom, Observable, of} from 'rxjs'; +import {firstValueFrom, of} from 'rxjs'; import {AuthService} from '../../services/auth.service'; import {ToastsService, ToastType} from '../../services/toasts.service'; import {userType} from '../../models/User'; @@ -60,7 +60,7 @@ export class FundingBasketComponent implements OnInit { resetColor(ev: any) { // for (let contribution of document.querySelectorAll('.contribution')!) {} - (ev.target as HTMLInputElement).setAttribute("style", "border-color: unset") + (ev.target as HTMLInputElement).setAttribute("style", "") } protected readonly of = of; -- cgit v1.2.3