-
diff --git a/bizmatch/src/app/components/header/header.component.ts b/bizmatch/src/app/components/header/header.component.ts
index 91805e0..9d32bcd 100644
--- a/bizmatch/src/app/components/header/header.component.ts
+++ b/bizmatch/src/app/components/header/header.component.ts
@@ -6,7 +6,7 @@ import { NavigationEnd, Router, RouterModule } from '@angular/router';
import { faUserGear } from '@fortawesome/free-solid-svg-icons';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { Collapse, Dropdown, initFlowbite } from 'flowbite';
-import { filter, Observable, Subject, Subscription } from 'rxjs';
+import { debounceTime, filter, Observable, Subject, Subscription } from 'rxjs';
import { SortByOptions, User } from '../../../../../bizmatch-server/src/models/db.model';
import { BusinessListingCriteria, CommercialPropertyListingCriteria, emailToDirName, KeycloakUser, KeyValueAsSortBy, UserListingCriteria } from '../../../../../bizmatch-server/src/models/main.model';
import { environment } from '../../../environments/environment';
@@ -92,7 +92,9 @@ export class HeaderComponent {
this.checkCurrentRoute(event.urlAfterRedirects);
this.setupSortByOptions();
});
-
+ this.subscription = this.criteriaChangeService.criteriaChange$.pipe(debounceTime(400)).subscribe(() => {
+ this.criteria = getCriteriaProxy(this.baseRoute, this);
+ });
this.userService.currentUser.pipe(untilDestroyed(this)).subscribe(u => {
this.user = u;
});
diff --git a/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts b/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts
index f54aac0..aca76d8 100644
--- a/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts
+++ b/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts
@@ -1,4 +1,4 @@
-import { Component } from '@angular/core';
+import { ChangeDetectorRef, Component } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { LeafletModule } from '@bluehalo/ngx-leaflet';
@@ -24,6 +24,7 @@ import { SharedModule } from '../../../shared/shared/shared.module';
import { createMailInfo, map2User } from '../../../utils/utils';
// Import für Leaflet
// Benannte Importe für Leaflet
+import dayjs from 'dayjs';
import { AuthService } from '../../../services/auth.service';
import { BaseDetailsComponent } from '../base-details.component';
@Component({
@@ -80,6 +81,7 @@ export class DetailsBusinessListingComponent extends BaseDetailsComponent {
public emailService: EMailService,
private geoService: GeoService,
public authService: AuthService,
+ private cdref: ChangeDetectorRef,
) {
super();
this.router.events.subscribe(event => {
@@ -123,6 +125,7 @@ export class DetailsBusinessListingComponent extends BaseDetailsComponent {
await this.mailService.mail(this.mailinfo);
this.auditService.createEvent(this.listing.id, 'contact', this.user?.email, this.mailinfo.sender);
this.messageService.addMessage({ severity: 'success', text: 'Your message has been sent to the creator of the listing', duration: 3000 });
+ this.mailinfo = createMailInfo(this.user);
} catch (error) {
this.messageService.addMessage({
severity: 'danger',
@@ -133,9 +136,6 @@ export class DetailsBusinessListingComponent extends BaseDetailsComponent {
this.validationMessagesService.updateMessages(error.error.message);
}
}
- if (this.user) {
- this.mailinfo = createMailInfo(this.user);
- }
}
get listingDetails() {
let typeOfRealEstate = '';
@@ -158,6 +158,7 @@ export class DetailsBusinessListingComponent extends BaseDetailsComponent {
{ label: 'Support & Training', value: this.listing.supportAndTraining },
{ label: 'Reason for Sale', value: this.listing.reasonForSale },
{ label: 'Broker licensing', value: this.listing.brokerLicencing },
+ { label: 'Listed since', value: `${this.dateInserted()} - ${this.getDaysListed()} days` },
];
if (this.listing.draft) {
result.push({ label: 'Draft', value: this.listing.draft ? 'Yes' : 'No' });
@@ -194,4 +195,10 @@ export class DetailsBusinessListingComponent extends BaseDetailsComponent {
createEvent(eventType: EventTypeEnum) {
this.auditService.createEvent(this.listing.id, eventType, this.user?.email);
}
+ getDaysListed() {
+ return dayjs().diff(this.listing.created, 'day');
+ }
+ dateInserted() {
+ return dayjs(this.listing.created).format('DD/MM/YYYY');
+ }
}
diff --git a/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.ts b/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.ts
index 77a8cc2..2bb01c6 100644
--- a/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.ts
+++ b/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.ts
@@ -3,6 +3,7 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router';
import { LeafletModule } from '@bluehalo/ngx-leaflet';
import { faTimes } from '@fortawesome/free-solid-svg-icons';
+import dayjs from 'dayjs';
import { GalleryModule, ImageItem } from 'ng-gallery';
import { ShareButton } from 'ngx-sharebuttons/button';
import { lastValueFrom } from 'rxjs';
@@ -109,6 +110,7 @@ export class DetailsCommercialPropertyListingComponent extends BaseDetailsCompon
{ label: 'Located in', value: this.selectOptions.getState(this.listing.location.state) },
{ label: this.listing.location.name ? 'City' : 'County', value: this.listing.location.name ? this.listing.location.name : this.listing.location.county },
{ label: 'Asking Price:', value: `$${this.listing.price?.toLocaleString()}` },
+ { label: 'Listed since', value: `${this.dateInserted()} - ${this.getDaysListed()} days` },
];
if (this.listing.draft) {
this.propertyDetails.push({ label: 'Draft', value: this.listing.draft ? 'Yes' : 'No' });
@@ -146,6 +148,7 @@ export class DetailsCommercialPropertyListingComponent extends BaseDetailsCompon
await this.mailService.mail(this.mailinfo);
this.auditService.createEvent(this.listing.id, 'contact', this.user?.email, this.mailinfo.sender);
this.messageService.addMessage({ severity: 'success', text: 'Your message has been sent to the creator of the listing', duration: 3000 });
+ this.mailinfo = createMailInfo(this.user);
} catch (error) {
this.messageService.addMessage({
severity: 'danger',
@@ -156,9 +159,6 @@ export class DetailsCommercialPropertyListingComponent extends BaseDetailsCompon
this.validationMessagesService.updateMessages(error.error.message);
}
}
- if (this.user) {
- this.mailinfo = createMailInfo(this.user);
- }
}
containsError(fieldname: string) {
return this.errorResponse?.fields.map(f => f.fieldname).includes(fieldname);
@@ -195,4 +195,10 @@ export class DetailsCommercialPropertyListingComponent extends BaseDetailsCompon
createEvent(eventType: EventTypeEnum) {
this.auditService.createEvent(this.listing.id, eventType, this.user?.email);
}
+ getDaysListed() {
+ return dayjs().diff(this.listing.created, 'day');
+ }
+ dateInserted() {
+ return dayjs(this.listing.created).format('DD/MM/YYYY');
+ }
}
diff --git a/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.html b/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.html
index 34ab667..51087cd 100644
--- a/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.html
+++ b/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.html
@@ -1,4 +1,5 @@
There’re no professionals here
+Try changing your filters to
see professionals
There’s no listing here
+Try changing your filters to
see listings
There’s no listing here
+Try changing your filters to
see listings