diff --git a/bizmatch/src/app/components/search-modal/search-modal.component.html b/bizmatch/src/app/components/search-modal/search-modal.component.html index 66af002..96b86ad 100644 --- a/bizmatch/src/app/components/search-modal/search-modal.component.html +++ b/bizmatch/src/app/components/search-modal/search-modal.component.html @@ -90,61 +90,67 @@
- + - - + /> --> +
- + /> --> + - - + /> --> +
- + /> --> + - - +
@@ -181,15 +187,33 @@
- +
- +
- +
diff --git a/bizmatch/src/app/components/search-modal/search-modal.component.ts b/bizmatch/src/app/components/search-modal/search-modal.component.ts index 81cdde7..708c0bb 100644 --- a/bizmatch/src/app/components/search-modal/search-modal.component.ts +++ b/bizmatch/src/app/components/search-modal/search-modal.component.ts @@ -12,12 +12,13 @@ import { UserService } from '../../services/user.service'; import { SharedModule } from '../../shared/shared/shared.module'; import { resetBusinessListingCriteria, resetCommercialPropertyListingCriteria, resetUserListingCriteria } from '../../utils/utils'; import { ValidatedCityComponent } from '../validated-city/validated-city.component'; +import { ValidatedPriceComponent } from '../validated-price/validated-price.component'; import { ModalService } from './modal.service'; @UntilDestroy() @Component({ selector: 'app-search-modal', standalone: true, - imports: [SharedModule, AsyncPipe, NgIf, NgSelectModule, ValidatedCityComponent], + imports: [SharedModule, AsyncPipe, NgIf, NgSelectModule, ValidatedCityComponent, ValidatedPriceComponent], templateUrl: './search-modal.component.html', styleUrl: './search-modal.component.scss', }) @@ -71,22 +72,6 @@ export class SearchModalComponent { } } } - // private loadCities() { - // this.cities$ = concat( - // of([]), // default items - // this.cityInput$.pipe( - // distinctUntilChanged(), - // tap(() => (this.cityLoading = true)), - // switchMap(term => - // this.geoService.findCitiesStartingWith(term).pipe( - // catchError(() => of([])), // empty list on error - // // map(cities => cities.map(city => city.city)), // transform the list of objects to a list of city names - // tap(() => (this.cityLoading = false)), - // ), - // ), - // ), - // ); - // } private loadCounties() { this.counties$ = concat( of([]), // default items @@ -169,4 +154,13 @@ export class SearchModalComponent { close() { this.modalService.reject(this.backupCriteria); } + onCheckboxChange(checkbox: string, value: boolean) { + // Deaktivieren Sie alle Checkboxes + (this.criteria).realEstateChecked = false; + (this.criteria).leasedLocation = false; + (this.criteria).franchiseResale = false; + + // Aktivieren Sie nur die aktuell ausgewählte Checkbox + this.criteria[checkbox] = value; + } } diff --git a/bizmatch/src/app/components/validated-price/validated-price.component.html b/bizmatch/src/app/components/validated-price/validated-price.component.html index c0cdc61..380b207 100644 --- a/bizmatch/src/app/components/validated-price/validated-price.component.html +++ b/bizmatch/src/app/components/validated-price/validated-price.component.html @@ -1,4 +1,5 @@
+ @if(label){ + }
diff --git a/bizmatch/src/app/components/validated-price/validated-price.component.ts b/bizmatch/src/app/components/validated-price/validated-price.component.ts index 9c3ddca..5ff7f6d 100644 --- a/bizmatch/src/app/components/validated-price/validated-price.component.ts +++ b/bizmatch/src/app/components/validated-price/validated-price.component.ts @@ -1,5 +1,5 @@ import { CommonModule } from '@angular/common'; -import { Component, forwardRef } from '@angular/core'; +import { Component, forwardRef, Input } from '@angular/core'; import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms'; import { NgxCurrencyDirective } from 'ngx-currency'; import { BaseInputComponent } from '../base-input/base-input.component'; @@ -18,14 +18,17 @@ import { ValidationMessagesService } from '../validation-messages.service'; }, ], templateUrl: './validated-price.component.html', + styles: `:host{width:100%}`, }) export class ValidatedPriceComponent extends BaseInputComponent { + @Input() inputClasses: string; + @Input() placeholder: string; constructor(validationMessagesService: ValidationMessagesService) { super(validationMessagesService); } onInputChange(event: Event): void { - this.value = event; + this.value = !event ? null : event; this.onChange(event); } } diff --git a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html index f4d5f12..ab2450f 100644 --- a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html +++ b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.html @@ -101,9 +101,9 @@ Draft } -

Asking price: {{ listing.price | currency }}

-

Sales revenue: {{ listing.salesRevenue | currency }}

-

Net profit: {{ listing.cashFlow | currency }}

+

Asking price: {{ listing.price | currency : 'USD' : 'symbol' : '1.0-0' }}

+

Sales revenue: {{ listing.salesRevenue | currency : 'USD' : 'symbol' : '1.0-0' }}

+

Net profit: {{ listing.cashFlow | currency : 'USD' : 'symbol' : '1.0-0' }}

Location: {{ listing.location.name }} - {{ listing.location.state }}

Established: {{ listing.established }}

Company logo diff --git a/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.html b/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.html index 3206ab5..3754016 100644 --- a/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.html +++ b/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.html @@ -19,7 +19,7 @@ }

{{ listing.location.name }}

-

{{ listing.price | currency }}

+

{{ listing.price | currency : 'USD' : 'symbol' : '1.0-0' }}

diff --git a/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.html b/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.html index 2f5bc69..d3c11ef 100644 --- a/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.html +++ b/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.html @@ -129,15 +129,36 @@
- +
- +
- +
diff --git a/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.ts b/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.ts index 376d948..6ce8f5f 100644 --- a/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.ts +++ b/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.ts @@ -160,13 +160,13 @@ export class EditBusinessListingComponent { } target[keys[keys.length - 1]] = value; } - onCheckboxChange(checkbox: string) { + onCheckboxChange(checkbox: string, value: boolean) { // Deaktivieren Sie alle Checkboxes this.listing.realEstateIncluded = false; this.listing.leasedLocation = false; this.listing.franchiseResale = false; // Aktivieren Sie nur die aktuell ausgewählte Checkbox - this.listing[checkbox] = true; + this.listing[checkbox] = value; } }