diff options
| author | sowgro <tpoke.ferrari@gmail.com> | 2025-02-26 22:50:01 -0500 | 
|---|---|---|
| committer | sowgro <tpoke.ferrari@gmail.com> | 2025-02-26 22:50:01 -0500 | 
| commit | 897a4d53505d23c8b1f96c14b0a8984932fae699 (patch) | |
| tree | 664090526d6f6674daadf4246651f7e3c58efa60 | |
| parent | 501ac045d6042f194e2a5dbc4d7f4abccaf2732b (diff) | |
| download | JellySolutions-897a4d53505d23c8b1f96c14b0a8984932fae699.tar.gz JellySolutions-897a4d53505d23c8b1f96c14b0a8984932fae699.tar.bz2 JellySolutions-897a4d53505d23c8b1f96c14b0a8984932fae699.zip  | |
Clean up project and start implementation of user sign in system
14 files changed, 12 insertions, 229 deletions
diff --git a/ufund-ui/src/app/app.component.spec.ts b/ufund-ui/src/app/app.component.spec.ts deleted file mode 100644 index f1f78e9..0000000 --- a/ufund-ui/src/app/app.component.spec.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { TestBed } from '@angular/core/testing'; -import { RouterModule } from '@angular/router'; -import { AppComponent } from './app.component'; - -describe('AppComponent', () => { -  beforeEach(async () => { -    await TestBed.configureTestingModule({ -      imports: [ -        RouterModule.forRoot([]) -      ], -      declarations: [ -        AppComponent -      ], -    }).compileComponents(); -  }); - -  it('should create the app', () => { -    const fixture = TestBed.createComponent(AppComponent); -    const app = fixture.componentInstance; -    expect(app).toBeTruthy(); -  }); - -  it(`should have as title 'ufund-ui'`, () => { -    const fixture = TestBed.createComponent(AppComponent); -    const app = fixture.componentInstance; -    expect(app.title).toEqual('ufund-ui'); -  }); - -  it('should render title', () => { -    const fixture = TestBed.createComponent(AppComponent); -    fixture.detectChanges(); -    const compiled = fixture.nativeElement as HTMLElement; -    expect(compiled.querySelector('h1')?.textContent).toContain('Hello, ufund-ui'); -  }); -}); diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.spec.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.spec.ts deleted file mode 100644 index ece4f23..0000000 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { CupboardComponent } from './cupboard.component'; - -describe('CupboardComponent', () => { -  let component: CupboardComponent; -  let fixture: ComponentFixture<CupboardComponent>; - -  beforeEach(async () => { -    await TestBed.configureTestingModule({ -      declarations: [CupboardComponent] -    }) -    .compileComponents(); - -    fixture = TestBed.createComponent(CupboardComponent); -    component = fixture.componentInstance; -    fixture.detectChanges(); -  }); - -  it('should create', () => { -    expect(component).toBeTruthy(); -  }); -}); diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.spec.ts b/ufund-ui/src/app/components/dashboard/dashboard.component.spec.ts deleted file mode 100644 index 1a763b8..0000000 --- a/ufund-ui/src/app/components/dashboard/dashboard.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { DashboardComponent } from './dashboard.component'; - -describe('DashboardComponent', () => { -  let component: DashboardComponent; -  let fixture: ComponentFixture<DashboardComponent>; - -  beforeEach(async () => { -    await TestBed.configureTestingModule({ -      declarations: [DashboardComponent] -    }) -    .compileComponents(); - -    fixture = TestBed.createComponent(DashboardComponent); -    component = fixture.componentInstance; -    fixture.detectChanges(); -  }); - -  it('should create', () => { -    expect(component).toBeTruthy(); -  }); -}); diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.spec.ts b/ufund-ui/src/app/components/funding-basket/funding-basket.component.spec.ts deleted file mode 100644 index 1cdd9d2..0000000 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { FundingBasketComponent } from './funding-basket.component'; - -describe('FundingBasketComponent', () => { -  let component: FundingBasketComponent; -  let fixture: ComponentFixture<FundingBasketComponent>; - -  beforeEach(async () => { -    await TestBed.configureTestingModule({ -      declarations: [FundingBasketComponent] -    }) -    .compileComponents(); - -    fixture = TestBed.createComponent(FundingBasketComponent); -    component = fixture.componentInstance; -    fixture.detectChanges(); -  }); - -  it('should create', () => { -    expect(component).toBeTruthy(); -  }); -}); diff --git a/ufund-ui/src/app/components/home-page/home-page.component.html b/ufund-ui/src/app/components/home-page/home-page.component.html index 7454417..e13c539 100644 --- a/ufund-ui/src/app/components/home-page/home-page.component.html +++ b/ufund-ui/src/app/components/home-page/home-page.component.html @@ -1 +1,4 @@ +<a routerLink="/login"> +    Login/Sign Up +</a>  <p>home-page works!</p> diff --git a/ufund-ui/src/app/components/home-page/home-page.component.spec.ts b/ufund-ui/src/app/components/home-page/home-page.component.spec.ts deleted file mode 100644 index 8ff10c7..0000000 --- a/ufund-ui/src/app/components/home-page/home-page.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { HomePageComponent } from './home-page.component'; - -describe('HomePageComponent', () => { -  let component: HomePageComponent; -  let fixture: ComponentFixture<HomePageComponent>; - -  beforeEach(async () => { -    await TestBed.configureTestingModule({ -      declarations: [HomePageComponent] -    }) -    .compileComponents(); - -    fixture = TestBed.createComponent(HomePageComponent); -    component = fixture.componentInstance; -    fixture.detectChanges(); -  }); - -  it('should create', () => { -    expect(component).toBeTruthy(); -  }); -}); diff --git a/ufund-ui/src/app/components/login/login.component.css b/ufund-ui/src/app/components/login/login.component.css index 4cef8a0..afd4bf1 100644 --- a/ufund-ui/src/app/components/login/login.component.css +++ b/ufund-ui/src/app/components/login/login.component.css @@ -1,4 +1,6 @@  :host {    display: flex;    flex-direction: column; +    max-width: 300px; +    gap: 5px  } diff --git a/ufund-ui/src/app/components/login/login.component.html b/ufund-ui/src/app/components/login/login.component.html index 1bf2a3f..41427ae 100644 --- a/ufund-ui/src/app/components/login/login.component.html +++ b/ufund-ui/src/app/components/login/login.component.html @@ -2,4 +2,4 @@  <input placeholder="Username" type="text">  <input placeholder="Password" type="password">  <button>Login</button> -<button>Create Account</button> +<button>Create Account...</button> diff --git a/ufund-ui/src/app/components/login/login.component.spec.ts b/ufund-ui/src/app/components/login/login.component.spec.ts deleted file mode 100644 index 4adbc3d..0000000 --- a/ufund-ui/src/app/components/login/login.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { LoginComponent } from './login.component'; - -describe('LoginComponent', () => { -  let component: LoginComponent; -  let fixture: ComponentFixture<LoginComponent>; - -  beforeEach(async () => { -    await TestBed.configureTestingModule({ -      declarations: [LoginComponent] -    }) -    .compileComponents(); - -    fixture = TestBed.createComponent(LoginComponent); -    component = fixture.componentInstance; -    fixture.detectChanges(); -  }); - -  it('should create', () => { -    expect(component).toBeTruthy(); -  }); -}); diff --git a/ufund-ui/src/app/components/need-list/need-list.component.spec.ts b/ufund-ui/src/app/components/need-list/need-list.component.spec.ts deleted file mode 100644 index f9b7830..0000000 --- a/ufund-ui/src/app/components/need-list/need-list.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { NeedListComponent } from './need-list.component'; - -describe('NeedListComponent', () => { -  let component: NeedListComponent; -  let fixture: ComponentFixture<NeedListComponent>; - -  beforeEach(async () => { -    await TestBed.configureTestingModule({ -      declarations: [NeedListComponent] -    }) -    .compileComponents(); - -    fixture = TestBed.createComponent(NeedListComponent); -    component = fixture.componentInstance; -    fixture.detectChanges(); -  }); - -  it('should create', () => { -    expect(component).toBeTruthy(); -  }); -}); diff --git a/ufund-ui/src/app/components/need-page/need-page.component.spec.ts b/ufund-ui/src/app/components/need-page/need-page.component.spec.ts deleted file mode 100644 index 028c477..0000000 --- a/ufund-ui/src/app/components/need-page/need-page.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { NeedPageComponent } from './need-page.component'; - -describe('NeedPageComponent', () => { -  let component: NeedPageComponent; -  let fixture: ComponentFixture<NeedPageComponent>; - -  beforeEach(async () => { -    await TestBed.configureTestingModule({ -      declarations: [NeedPageComponent] -    }) -    .compileComponents(); - -    fixture = TestBed.createComponent(NeedPageComponent); -    component = fixture.componentInstance; -    fixture.detectChanges(); -  }); - -  it('should create', () => { -    expect(component).toBeTruthy(); -  }); -}); diff --git a/ufund-ui/src/app/services/cupboard.service.spec.ts b/ufund-ui/src/app/services/cupboard.service.spec.ts deleted file mode 100644 index 56da56d..0000000 --- a/ufund-ui/src/app/services/cupboard.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { CupboardService } from './cupboard.service'; - -describe('CupboardService', () => { -  let service: CupboardService; - -  beforeEach(() => { -    TestBed.configureTestingModule({}); -    service = TestBed.inject(CupboardService); -  }); - -  it('should be created', () => { -    expect(service).toBeTruthy(); -  }); -}); diff --git a/ufund-ui/src/app/services/users.service.spec.ts b/ufund-ui/src/app/services/users.service.spec.ts deleted file mode 100644 index f81244a..0000000 --- a/ufund-ui/src/app/services/users.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { UsersService } from './users.service'; - -describe('UsersService', () => { -  let service: UsersService; - -  beforeEach(() => { -    TestBed.configureTestingModule({}); -    service = TestBed.inject(UsersService); -  }); - -  it('should be created', () => { -    expect(service).toBeTruthy(); -  }); -}); diff --git a/ufund-ui/src/app/services/users.service.ts b/ufund-ui/src/app/services/users.service.ts index 1b6dfb6..571c004 100644 --- a/ufund-ui/src/app/services/users.service.ts +++ b/ufund-ui/src/app/services/users.service.ts @@ -8,6 +8,8 @@ import {User} from '../models/User';  })  export class UsersService { +    private currentUserID? : number +      private url = "http://localhost:8080/users"      private httpOptions = {          headers: new HttpHeaders({'Content-Type': 'application/json'}) @@ -32,4 +34,8 @@ export class UsersService {      deleteUser(id: number): Observable<boolean> {          return this.http.delete<boolean>(`${this.url}/${id}`, this.httpOptions)      } + +    getCurrentUser(): Observable<User> | undefined { +        return this.currentUserID ? this.getUser(this.currentUserID) : undefined +    }  }  | 
