BugFixes acc. gitea
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user