diff --git a/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/0.pack b/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/0.pack new file mode 100644 index 0000000..d1bc6a1 Binary files /dev/null and b/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/0.pack differ diff --git a/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/1.pack b/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/1.pack new file mode 100644 index 0000000..5a23160 Binary files /dev/null and b/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/1.pack differ diff --git a/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/index.pack b/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/index.pack new file mode 100644 index 0000000..eb9943a Binary files /dev/null and b/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/index.pack differ diff --git a/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/index.pack.old b/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/index.pack.old new file mode 100644 index 0000000..2e28a26 Binary files /dev/null and b/angular/.angular/cache/16.0.2/angular-webpack/dce62bf0d9033346257a7611f5885fbc901e18e6/index.pack.old differ diff --git a/angular/src/app/contactform/contactform.component.ts b/angular/src/app/contactform/contactform.component.ts index 03faae9..cce0a8b 100644 --- a/angular/src/app/contactform/contactform.component.ts +++ b/angular/src/app/contactform/contactform.component.ts @@ -37,7 +37,7 @@ export class ContactformComponent { message: this.message }; - this.http.post('/api/contact', contactForm).subscribe( + this.http.post('/property/contact', contactForm).subscribe( () => { alert('Contact form submitted successfully!'); // Reset the form fields diff --git a/angular/src/app/models/property.ts b/angular/src/app/models/property.ts index 2342f9e..170b61f 100644 --- a/angular/src/app/models/property.ts +++ b/angular/src/app/models/property.ts @@ -1,4 +1,5 @@ export interface Property { + rentPerSqm: number; id: number; userId: number; externalId: string; diff --git a/angular/src/app/property-list/property-list.component.css b/angular/src/app/property-list/property-list.component.css index 4a29db4..f62c6ad 100644 --- a/angular/src/app/property-list/property-list.component.css +++ b/angular/src/app/property-list/property-list.component.css @@ -54,22 +54,29 @@ .contact-form.show { display: block; /* Show the contact form when the 'showContactForm' flag is set */ } - -.property-filter { - margin-bottom: 20px; +.property-filter select, +.property-filter input[type="number"], +.property-filter input[type="text"] { + margin-right: 10px; + height: 30px; /* Set a fixed height for all input fields */ } - -.property-filter label { +.property-filter button { margin-right: 10px; } -.property-filter select, .property-filter input[type="number"] { - margin-right: 10px; + max-width: 100px; /* Limit the width of the number field */ +} + +.property-filter input[type="number"]::-webkit-inner-spin-button, +.property-filter input[type="number"]::-webkit-outer-spin-button { + -webkit-appearance: none; /* Remove the spinner arrows on number input */ + margin: 0; /* Remove default margin */ } .property-filter .apply-button { margin-left: 10px; + height: 30px; /* Set a fixed height for the apply button */ } /* Adjust text size based on screen size */ @@ -84,3 +91,24 @@ width: 100%; /* Set the width to 100% for single item on a row */ } } +.property-filter select, +.property-filter input[type="number"], +.property-filter input[type="text"] { + margin-right: 10px; + height: 30px; /* Set a fixed height for all input fields */ +} + +.property-filter input[type="number"] { + max-width: 100px; /* Limit the width of the number field */ +} + +.property-filter input[type="number"]::-webkit-inner-spin-button, +.property-filter input[type="number"]::-webkit-outer-spin-button { + -webkit-appearance: none; /* Remove the spinner arrows on number input */ + margin: 0; /* Remove default margin */ +} + +.property-filter .apply-button { + margin-left: 10px; + height: 30px; /* Set a fixed height for the apply button */ +} diff --git a/angular/src/app/property-list/property-list.component.html b/angular/src/app/property-list/property-list.component.html index 644ed35..76f7e43 100644 --- a/angular/src/app/property-list/property-list.component.html +++ b/angular/src/app/property-list/property-list.component.html @@ -3,16 +3,16 @@
{{ property.city }} - {{ property.propertyType }}
{{ property.title }}, {{ property.postalCode }}
+Area (sqm): {{ property.areaSqm }}
Rent: € {{ property.rent }}
Additional Costs: € {{ property.additionalCosts }}
Deposit: € {{ property.deposit }}
@@ -52,7 +60,7 @@{{ property.descriptionTranslated }}
-Area (sqm): {{ property.areaSqm }}
+Furnish: {{ property.furnish }}
+Is Room Active: {{ property.isRoomActive }}
Kitchen: {{ property.kitchen }}
Living: {{ property.living }}
Match Age: {{ property.matchAge }}
diff --git a/angular/src/app/property-list/property-list.component.ts b/angular/src/app/property-list/property-list.component.ts index 5f94bf4..cdc8e83 100644 --- a/angular/src/app/property-list/property-list.component.ts +++ b/angular/src/app/property-list/property-list.component.ts @@ -48,6 +48,8 @@ export class PropertyListComponent implements OnInit { selectedGender: string = ''; id: number = 2; distinctCities: string[] = []; + showFilterButtons: boolean = false; + currentPage = 1; constructor( private http: HttpClient, @@ -59,9 +61,11 @@ export class PropertyListComponent implements OnInit { } ngOnInit(): void { - this.applyFilters(); + this.applyInit(); this.getDistinctCities(); + this.selectedCity = this.distinctCities.length > 0 ? '' : 'All Cities'; } + onCitySelect(event: any) { this.selectedCity = event.target.value; } @@ -84,7 +88,7 @@ export class PropertyListComponent implements OnInit { (data: { cities: string[] }) => { this.distinctCities = data.toString().split(","); //data.split(","); if (this.distinctCities.length > 0) { - this.selectedCity = "all cities"; + this.selectedCity = "All Cities"; } }, error => { @@ -93,13 +97,33 @@ export class PropertyListComponent implements OnInit { ); } + applyInit(): void { + console.log('Apply Filters clicked'); + const apiUrl = 'http://localhost:8080/property'; + const params: any = {}; + + if (this.selectedCity && this.selectedCity !== 'All Cities') { + params.city = this.selectedCity; + } + // Make the API call with the updated URL and query parameters + this.http.get