autocomplete off bei numeric fields, Mail Mask emptied after Mail dispatch, unknown listing controller for EMail Listings

This commit is contained in:
2024-08-12 13:55:23 +02:00
parent 245e76f697
commit 3a6a64cce9
9 changed files with 57 additions and 36 deletions

View File

@@ -16,7 +16,7 @@ import { MailService } from '../../../services/mail.service';
import { SelectOptionsService } from '../../../services/select-options.service';
import { UserService } from '../../../services/user.service';
import { SharedModule } from '../../../shared/shared/shared.module';
import { map2User } from '../../../utils/utils';
import { createMailInfo, map2User } from '../../../utils/utils';
@Component({
selector: 'app-details-business-listing',
standalone: true,
@@ -81,7 +81,7 @@ export class DetailsBusinessListingComponent {
this.keycloakUser = map2User(token);
if (this.keycloakUser) {
this.user = await this.userService.getByMail(this.keycloakUser.email);
this.mailinfo.sender = { name: `${this.user.firstname} ${this.user.lastname}`, email: this.user.email, phoneNumber: this.user.phoneNumber, state: this.user.companyLocation.state };
this.mailinfo = createMailInfo(this.user);
}
this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'business'));
this.listingUser = await this.userService.getByMail(this.listing.email);
@@ -99,6 +99,7 @@ export class DetailsBusinessListingComponent {
this.mailinfo.listing = this.listing;
await this.mailService.mail(this.mailinfo);
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',

View File

@@ -18,7 +18,7 @@ import { MailService } from '../../../services/mail.service';
import { SelectOptionsService } from '../../../services/select-options.service';
import { UserService } from '../../../services/user.service';
import { SharedModule } from '../../../shared/shared/shared.module';
import { map2User } from '../../../utils/utils';
import { createMailInfo, map2User } from '../../../utils/utils';
@Component({
selector: 'app-details-commercial-property-listing',
@@ -86,7 +86,7 @@ export class DetailsCommercialPropertyListingComponent {
this.keycloakUser = map2User(token);
if (this.keycloakUser) {
this.user = await this.userService.getByMail(this.keycloakUser.email);
this.mailinfo.sender = { name: `${this.user.firstname} ${this.user.lastname}`, email: this.user.email, phoneNumber: this.user.phoneNumber, state: this.user.companyLocation.state };
this.mailinfo = createMailInfo(this.user);
}
this.listing = (await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'))) as CommercialPropertyListing;
this.listingUser = await this.userService.getByMail(this.listing.email);
@@ -123,6 +123,7 @@ export class DetailsCommercialPropertyListingComponent {
this.mailinfo.listing = this.listing;
await this.mailService.mail(this.mailinfo);
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',

View File

@@ -129,15 +129,15 @@
<div class="flex mb-4 space-x-4">
<div class="flex items-center">
<input type="checkbox" id="realEstateIncluded" [(ngModel)]="listing.realEstateIncluded" name="realEstateIncluded" class="mr-2" />
<input type="checkbox" id="realEstateIncluded" [(ngModel)]="listing.realEstateIncluded" (change)="onCheckboxChange('realEstateIncluded')" name="realEstateIncluded" class="mr-2" />
<label for="realEstateIncluded" class="text-sm font-bold text-gray-700">Real Estate Included</label>
</div>
<div class="flex items-center">
<input type="checkbox" id="leasedLocation" [(ngModel)]="listing.leasedLocation" name="leasedLocation" class="mr-2" />
<input type="checkbox" id="leasedLocation" [(ngModel)]="listing.leasedLocation" (change)="onCheckboxChange('leasedLocation')" name="leasedLocation" class="mr-2" />
<label for="leasedLocation" class="text-sm font-bold text-gray-700">Leased Location</label>
</div>
<div class="flex items-center">
<input type="checkbox" id="franchiseResale" [(ngModel)]="listing.franchiseResale" name="franchiseResale" class="mr-2" />
<input type="checkbox" id="franchiseResale" [(ngModel)]="listing.franchiseResale" (change)="onCheckboxChange('franchiseResale')" name="franchiseResale" class="mr-2" />
<label for="franchiseResale" class="text-sm font-bold text-gray-700">Franchise Re-Sale</label>
</div>
</div>

View File

@@ -159,4 +159,13 @@ export class EditBusinessListingComponent {
}
target[keys[keys.length - 1]] = value;
}
onCheckboxChange(checkbox: string) {
// 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;
}
}

View File

@@ -11,7 +11,7 @@ import { ValidationMessagesService } from '../../../components/validation-messag
import { MailService } from '../../../services/mail.service';
import { UserService } from '../../../services/user.service';
import { SharedModule } from '../../../shared/shared/shared.module';
import { map2User } from '../../../utils/utils';
import { createMailInfo, map2User } from '../../../utils/utils';
@Component({
selector: 'app-email-us',
standalone: true,
@@ -39,7 +39,7 @@ export class EmailUsComponent {
this.keycloakUser = map2User(token);
if (this.keycloakUser) {
this.user = await this.userService.getByMail(this.keycloakUser.email);
this.mailinfo.sender = { name: `${this.user.firstname} ${this.user.lastname}`, email: this.user.email, phoneNumber: this.user.phoneNumber, state: this.user.companyLocation.state };
this.mailinfo = createMailInfo(this.user);
}
}
ngOnDestroy() {
@@ -50,6 +50,7 @@ export class EmailUsComponent {
this.mailinfo.email = 'support@bizmatch.net';
await this.mailService.mail(this.mailinfo);
this.messageService.addMessage({ severity: 'success', text: 'Your request has been forwarded to the support team of bizmatch.', duration: 3000 });
this.mailinfo = createMailInfo(this.user);
} catch (error) {
this.messageService.addMessage({
severity: 'danger',