From ca2267d2dc0791efb81058cc3b54cc13163d4fff Mon Sep 17 00:00:00 2001 From: benal01 Date: Mon, 7 Apr 2025 16:52:49 -0400 Subject: warn modal if not signed in on need page --- ufund-ui/src/app/components/need-page/need-page.component.html | 10 +++++++++- ufund-ui/src/app/components/need-page/need-page.component.ts | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) 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 2629346..b344280 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,5 +1,13 @@ -
+ +
+

Not Logged in!

+

To contribute please log in :

+
+
+ +
@if (need) { + Need image

{{need.name}}

{{need.type}} GOAL diff --git a/ufund-ui/src/app/components/need-page/need-page.component.ts b/ufund-ui/src/app/components/need-page/need-page.component.ts index 17e330c..d4bd683 100644 --- a/ufund-ui/src/app/components/need-page/need-page.component.ts +++ b/ufund-ui/src/app/components/need-page/need-page.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, OnInit} from '@angular/core'; +import {Component, Input, OnInit, ViewChild, TemplateRef} from '@angular/core'; import {GoalType, Need} from '../../models/Need'; import {ActivatedRoute, Router} from "@angular/router"; import {CupboardService} from "../../services/cupboard.service"; @@ -14,7 +14,9 @@ import {ModalService} from '../../services/modal.service'; templateUrl: './need-page.component.html', styleUrl: './need-page.component.css' }) + export class NeedPageComponent implements OnInit { + constructor( private route: ActivatedRoute, private cupboardService: CupboardService, @@ -26,6 +28,8 @@ export class NeedPageComponent implements OnInit { ) {} @Input() need!: Need; + warned: boolean = false; + ngOnInit(): void { const id = Number(this.route.snapshot.paramMap.get('id')); -- cgit v1.2.3 From 71e01e85a33b0109847867878b2af733b4751e46 Mon Sep 17 00:00:00 2001 From: benal01 Date: Mon, 7 Apr 2025 17:36:27 -0400 Subject: popup text --- ufund-ui/src/app/components/need-page/need-page.component.html | 4 +++- ufund-ui/src/app/components/need-page/need-page.component.ts | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 b344280..b03e25f 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,7 +1,9 @@

Not Logged in!

-

To contribute please log in :

+

To contribute please log in

+

You can still view needs signed out!

+
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.ts b/ufund-ui/src/app/components/need-page/need-page.component.ts index d4bd683..8c4a513 100644 --- a/ufund-ui/src/app/components/need-page/need-page.component.ts +++ b/ufund-ui/src/app/components/need-page/need-page.component.ts @@ -29,8 +29,7 @@ export class NeedPageComponent implements OnInit { @Input() need!: Need; warned: boolean = false; - - + ngOnInit(): void { const id = Number(this.route.snapshot.paramMap.get('id')); this.cupboardService.getNeed(id).subscribe(n => this.need = n); -- cgit v1.2.3 From a6fd8cddfb5cf4812d6d974dc552bef44e816a21 Mon Sep 17 00:00:00 2001 From: sowgro Date: Mon, 7 Apr 2025 21:18:41 -0400 Subject: Make login popup look better, add missing toast --- .../src/app/components/need-page/need-page.component.css | 15 +++++++++++++++ .../src/app/components/need-page/need-page.component.html | 12 +++++++----- .../src/app/components/need-page/need-page.component.ts | 10 ++++++---- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/ufund-ui/src/app/components/need-page/need-page.component.css b/ufund-ui/src/app/components/need-page/need-page.component.css index 7f357db..83aeb5c 100644 --- a/ufund-ui/src/app/components/need-page/need-page.component.css +++ b/ufund-ui/src/app/components/need-page/need-page.component.css @@ -70,3 +70,18 @@ /* padding: 20px;*/ /* box-shadow: 0 0 100px black;*/ /*}*/ + +.accountWarn { + div { + display: flex; + flex-direction: row; + gap: 10px; + } + + background-color: var(--tertiary-color); + border-radius: 10px; + padding: 15px; + border-color: var(--secondary-color); + border-width: 1px; + border-style: solid; +} 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 8588852..1ef4598 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,15 +1,17 @@ -
+

Not Logged in!

-

To contribute please log in

-

You can still view needs signed out!

- +

To contribute to needs you must be logged in!

+
+ + +
@if (need) { - + Need image

{{need.name}}

{{need.type}} GOAL diff --git a/ufund-ui/src/app/components/need-page/need-page.component.ts b/ufund-ui/src/app/components/need-page/need-page.component.ts index 8c4a513..67dae83 100644 --- a/ufund-ui/src/app/components/need-page/need-page.component.ts +++ b/ufund-ui/src/app/components/need-page/need-page.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, OnInit, ViewChild, TemplateRef} from '@angular/core'; +import {Component, Input, OnInit} from '@angular/core'; import {GoalType, Need} from '../../models/Need'; import {ActivatedRoute, Router} from "@angular/router"; import {CupboardService} from "../../services/cupboard.service"; @@ -16,20 +16,20 @@ import {ModalService} from '../../services/modal.service'; }) export class NeedPageComponent implements OnInit { - + constructor( private route: ActivatedRoute, private cupboardService: CupboardService, private authService: AuthService, protected usersService: UsersService, private toastService: ToastsService, - private router: Router, + protected router: Router, protected modalService: ModalService ) {} @Input() need!: Need; warned: boolean = false; - + ngOnInit(): void { const id = Number(this.route.snapshot.paramMap.get('id')); this.cupboardService.getNeed(id).subscribe(n => this.need = n); @@ -47,6 +47,8 @@ export class NeedPageComponent implements OnInit { return of(); })) .subscribe(() => { + let action = {label: "View Basket", onAction: () => this.router.navigate(['/basket'])} + this.toastService.sendToast(ToastType.INFO, `"${need.name}" Added to basket`, action) this.usersService.refreshBasket(); }); } else { -- cgit v1.2.3