This commit is contained in:
2024-08-05 18:54:03 +02:00
parent 8b71b073be
commit 398f8d29ca
9 changed files with 25 additions and 17 deletions

View File

@@ -11,7 +11,10 @@
@if (loadingService.isLoading$ | async) {
<div class="spinner-overlay">
<div class="spinner-container">
<div class="spinner-text" *ngIf="loadingService.loadingText$ | async as loadingText">{{ loadingText }}</div>
@let loadingText = (loadingService.loadingText$ | async);
<!-- @if(loadingService.loadingText$ | async){ -->
<div class="spinner-text">{{ loadingText }}</div>
<!-- } -->
</div>
</div>
}

View File

@@ -1,6 +1,7 @@
import { AsyncPipe, NgIf } from '@angular/common';
import { Component } from '@angular/core';
import { NgSelectModule } from '@ng-select/ng-select';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { catchError, concat, debounceTime, distinctUntilChanged, map, Observable, of, Subject, Subscription, switchMap, tap } from 'rxjs';
import { BusinessListingCriteria, CommercialPropertyListingCriteria, CountyResult, GeoResult, KeyValue, KeyValueStyle, UserListingCriteria } from '../../../../../bizmatch-server/src/models/main.model';
import { CriteriaChangeService } from '../../services/criteria-change.service';
@@ -10,7 +11,7 @@ import { SelectOptionsService } from '../../services/select-options.service';
import { UserService } from '../../services/user.service';
import { SharedModule } from '../../shared/shared/shared.module';
import { ModalService } from './modal.service';
@UntilDestroy()
@Component({
selector: 'app-search-modal',
standalone: true,
@@ -38,10 +39,15 @@ export class SearchModalComponent {
) {}
ngOnInit() {
this.setupCriteriaChangeListener();
this.modalService.message$.subscribe(msg => {
this.modalService.message$.pipe(untilDestroyed(this)).subscribe(msg => {
this.criteria = msg;
this.setTotalNumberOfResults();
});
this.modalService.modalVisible$.pipe(untilDestroyed(this)).subscribe(val => {
if (val) {
this.criteria.page = 1;
}
});
this.loadCities();
this.loadCounties();
}

View File

@@ -162,6 +162,7 @@ export class HomeComponent {
this.criteria.radius = 20;
}
} else {
this.criteria.state = null;
this.criteria.city = null;
this.criteria.radius = null;
this.criteria.searchType = 'exact';

View File

@@ -58,12 +58,11 @@ export class BusinessListingsComponent {
}
});
}
async ngOnInit() {}
async ngOnInit() {
this.search();
}
async init() {
this.reset();
const statesResult = await this.listingsService.getAllStates('business');
this.states = statesResult.map(ls => ({ name: this.selectOptions.getState(ls.state as string), value: ls.state, count: ls.count }));
this.search();
}
async search() {

View File

@@ -58,7 +58,7 @@
@for (listing of listings; track listing.id) {
<div class="bg-white rounded-lg shadow-md overflow-hidden">
@if (listing.imageOrder?.length>0){
<img src="{{ env.imageBaseUrl }}/pictures/property/{{ listing.imagePath }}/{{ listing.serialId }}/{{ listing.imageOrder[0] }}?_ts={{ getTS() }}" alt="Image" class="w-full h-48 object-cover" />
<img src="{{ env.imageBaseUrl }}/pictures/property/{{ listing.imagePath }}/{{ listing.serialId }}/{{ listing.imageOrder[0] }}" alt="Image" class="w-full h-48 object-cover" />
} @else {
<img src="assets/images/placeholder_properties.jpg" alt="Image" class="w-full h-48 object-cover" />
}

View File

@@ -37,6 +37,7 @@ export class CommercialPropertyListingsComponent {
env = environment;
page = 1;
pageCount = 1;
ts = new Date().getTime();
constructor(
public selectOptions: SelectOptionsService,
private listingsService: ListingsService,