From bedfe9dfb62e3fc8733e3b9c8e024db95cfb0884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ovidiu=20=C8=98tefan=20Popescu?= Date: Mon, 29 Jan 2024 18:38:52 +0200 Subject: [PATCH] Added routes for property-related pages --- frontend/src/app/app.routes.ts | 14 +++++++++++ frontend/src/app/home/home.component.html | 13 +++++++---- frontend/src/app/home/home.component.ts | 8 +++---- .../list-properties.component.css | 0 .../list-properties.component.html | 1 + .../list-properties.component.spec.ts | 23 +++++++++++++++++++ .../list-properties.component.ts | 12 ++++++++++ .../new-property/new-property.component.css | 0 .../new-property/new-property.component.html | 1 + .../new-property.component.spec.ts | 23 +++++++++++++++++++ .../new-property/new-property.component.ts | 12 ++++++++++ 11 files changed, 98 insertions(+), 9 deletions(-) create mode 100644 frontend/src/app/properties/list-properties/list-properties.component.css create mode 100644 frontend/src/app/properties/list-properties/list-properties.component.html create mode 100644 frontend/src/app/properties/list-properties/list-properties.component.spec.ts create mode 100644 frontend/src/app/properties/list-properties/list-properties.component.ts create mode 100644 frontend/src/app/properties/new-property/new-property.component.css create mode 100644 frontend/src/app/properties/new-property/new-property.component.html create mode 100644 frontend/src/app/properties/new-property/new-property.component.spec.ts create mode 100644 frontend/src/app/properties/new-property/new-property.component.ts diff --git a/frontend/src/app/app.routes.ts b/frontend/src/app/app.routes.ts index 94b8491..351292e 100644 --- a/frontend/src/app/app.routes.ts +++ b/frontend/src/app/app.routes.ts @@ -5,6 +5,8 @@ import {map} from "rxjs"; import {AppComponent} from "./app.component"; import AuthenticationComponent from "./authentication/authentication.component"; import {HomeComponent} from "./home/home.component"; +import {ListPropertiesComponent} from "./properties/list-properties/list-properties.component"; +import {NewPropertyComponent} from "./properties/new-property/new-property.component"; export const routes: Routes = [ { @@ -25,4 +27,16 @@ export const routes: Routes = [ () => inject(AuthenticationService).isAuthenticated.pipe(map((isAuth) => !isAuth)), ], }, + { + path: "properties", + component: ListPropertiesComponent, + canActivate: [() => inject(AuthenticationService).isAuthenticated], + children: [ + { + path: "new", + component: NewPropertyComponent, + canActivate: [() => inject(AuthenticationService).isAuthenticated], + }, + ], + }, ] diff --git a/frontend/src/app/home/home.component.html b/frontend/src/app/home/home.component.html index 1296653..f1350e9 100644 --- a/frontend/src/app/home/home.component.html +++ b/frontend/src/app/home/home.component.html @@ -1,10 +1,13 @@
diff --git a/frontend/src/app/home/home.component.ts b/frontend/src/app/home/home.component.ts index 7769bd6..e02fb92 100644 --- a/frontend/src/app/home/home.component.ts +++ b/frontend/src/app/home/home.component.ts @@ -1,15 +1,15 @@ import { Component } from '@angular/core'; import {NgOptimizedImage} from "@angular/common"; +import {Router, RouterLink, RouterModule} from "@angular/router"; @Component({ selector: 'app-home', standalone: true, imports: [ - NgOptimizedImage + NgOptimizedImage, + RouterModule ], templateUrl: './home.component.html', styleUrl: './home.component.css' }) -export class HomeComponent { - -} +export class HomeComponent {} diff --git a/frontend/src/app/properties/list-properties/list-properties.component.css b/frontend/src/app/properties/list-properties/list-properties.component.css new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/app/properties/list-properties/list-properties.component.html b/frontend/src/app/properties/list-properties/list-properties.component.html new file mode 100644 index 0000000..aebbd43 --- /dev/null +++ b/frontend/src/app/properties/list-properties/list-properties.component.html @@ -0,0 +1 @@ +

list-properties works!

diff --git a/frontend/src/app/properties/list-properties/list-properties.component.spec.ts b/frontend/src/app/properties/list-properties/list-properties.component.spec.ts new file mode 100644 index 0000000..d18933c --- /dev/null +++ b/frontend/src/app/properties/list-properties/list-properties.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ListPropertiesComponent } from './list-properties.component'; + +describe('ListPropertiesComponent', () => { + let component: ListPropertiesComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [ListPropertiesComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ListPropertiesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/properties/list-properties/list-properties.component.ts b/frontend/src/app/properties/list-properties/list-properties.component.ts new file mode 100644 index 0000000..851d10a --- /dev/null +++ b/frontend/src/app/properties/list-properties/list-properties.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'list-properties-component', + standalone: true, + imports: [], + templateUrl: './list-properties.component.html', + styleUrl: './list-properties.component.css' +}) +export class ListPropertiesComponent { + +} diff --git a/frontend/src/app/properties/new-property/new-property.component.css b/frontend/src/app/properties/new-property/new-property.component.css new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/app/properties/new-property/new-property.component.html b/frontend/src/app/properties/new-property/new-property.component.html new file mode 100644 index 0000000..0dd5b24 --- /dev/null +++ b/frontend/src/app/properties/new-property/new-property.component.html @@ -0,0 +1 @@ +

new-property works!

diff --git a/frontend/src/app/properties/new-property/new-property.component.spec.ts b/frontend/src/app/properties/new-property/new-property.component.spec.ts new file mode 100644 index 0000000..7c2a471 --- /dev/null +++ b/frontend/src/app/properties/new-property/new-property.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NewPropertyComponent } from './new-property.component'; + +describe('NewPropertyComponent', () => { + let component: NewPropertyComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [NewPropertyComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(NewPropertyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/properties/new-property/new-property.component.ts b/frontend/src/app/properties/new-property/new-property.component.ts new file mode 100644 index 0000000..00593ad --- /dev/null +++ b/frontend/src/app/properties/new-property/new-property.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-new-property', + standalone: true, + imports: [], + templateUrl: './new-property.component.html', + styleUrl: './new-property.component.css' +}) +export class NewPropertyComponent { + +}