From bb9ce55cb5b55a6aaed2399e39a01d68f2491ce3 Mon Sep 17 00:00:00 2001 From: sowgro Date: Thu, 6 Mar 2025 21:41:39 -0500 Subject: Push current changes (working on documentation and tests) --- ufund-ui/src/app/app.module.ts | 6 ++++++ ufund-ui/src/app/components/dashboard/dashboard.component.html | 2 ++ ufund-ui/src/app/components/dashboard/dashboard.component.ts | 2 +- ufund-ui/src/app/components/login/login.component.ts | 8 ++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) (limited to 'ufund-ui/src') diff --git a/ufund-ui/src/app/app.module.ts b/ufund-ui/src/app/app.module.ts index d818841..9203e3b 100644 --- a/ufund-ui/src/app/app.module.ts +++ b/ufund-ui/src/app/app.module.ts @@ -9,6 +9,8 @@ import {FundingBasketComponent} from './components/funding-basket/funding-basket import {CupboardComponent} from './components/cupboard/cupboard.component'; import {NeedListComponent} from './components/need-list/need-list.component'; import {HttpClientModule} from '@angular/common/http'; +import {FormsModule} from '@angular/forms'; +import {RouterLink, RouterLinkActive, RouterOutlet} from '@angular/router'; @NgModule({ declarations: [ @@ -22,6 +24,10 @@ import {HttpClientModule} from '@angular/common/http'; imports: [ BrowserModule, AppRoutingModule, + FormsModule, + RouterLink, + RouterLinkActive, + RouterOutlet, HttpClientModule, ], providers: [], diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.html b/ufund-ui/src/app/components/dashboard/dashboard.component.html index 9c5fce9..f41ccef 100644 --- a/ufund-ui/src/app/components/dashboard/dashboard.component.html +++ b/ufund-ui/src/app/components/dashboard/dashboard.component.html @@ -1 +1,3 @@

dashboard works!

+Go to the Cupboard +Go to my basket diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.ts b/ufund-ui/src/app/components/dashboard/dashboard.component.ts index 6da4013..dd323c4 100644 --- a/ufund-ui/src/app/components/dashboard/dashboard.component.ts +++ b/ufund-ui/src/app/components/dashboard/dashboard.component.ts @@ -7,5 +7,5 @@ import { Component } from '@angular/core'; styleUrl: './dashboard.component.css' }) export class DashboardComponent { - + constructor() {} } diff --git a/ufund-ui/src/app/components/login/login.component.ts b/ufund-ui/src/app/components/login/login.component.ts index 9a4eb0f..50dd018 100644 --- a/ufund-ui/src/app/components/login/login.component.ts +++ b/ufund-ui/src/app/components/login/login.component.ts @@ -1,5 +1,6 @@ import { Component } from '@angular/core' import {UsersService} from '../../services/users.service'; +import {Router} from '@angular/router'; @Component({ selector: 'app-login', @@ -9,7 +10,8 @@ import {UsersService} from '../../services/users.service'; }) export class LoginComponent { constructor( - protected usersService: UsersService + protected usersService: UsersService, + private router: Router ) {} login(username: string | null, password: string | null) { @@ -18,6 +20,8 @@ export class LoginComponent { return; } - this.usersService.login(username, password) + this.usersService.login(username, password).then(() => { + this.router.navigate(['/dashboard']); + }) } } -- cgit v1.2.3