diff --git a/bizmatch/src/app/components/header/header.component.html b/bizmatch/src/app/components/header/header.component.html index 201592c..ab5838c 100644 --- a/bizmatch/src/app/components/header/header.component.html +++ b/bizmatch/src/app/components/header/header.component.html @@ -68,9 +68,9 @@
  • Account
  • - @if(user.customerType==='professional' || user.customerType==='seller' || (authService.isAdmin() | async)){ + @if((user.customerType==='professional' && user.customerSubType==='broker') || user.customerType==='seller' || (authService.isAdmin() | async)){
  • - @if(user.customerSubType==='broker'){ + @if(user.customerType==='professional'){ Create Listing 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 92c87bd..3c01220 100644 --- a/bizmatch/src/app/components/search-modal/search-modal.component.html +++ b/bizmatch/src/app/components/search-modal/search-modal.component.html @@ -394,7 +394,7 @@ [items]="counties$ | async" bindLabel="name" class="custom" - [multiple]="false" + [multiple]="true" [hideSelected]="true" [trackByFn]="trackByFn" [minTermLength]="2" diff --git a/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.html b/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.html index 7af6230..d4de47e 100644 --- a/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.html +++ b/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.html @@ -14,13 +14,17 @@

    -
    -
    {{ item.label }}
    - @if(item.label==='Category'){ - {{ item.value }} - } @else { -
    {{ item.value }}
    - } +
    +
    {{ detail.label }}
    + +
    {{ detail.value }}
    + +
    + +
    @@ -84,17 +88,6 @@
    - @if(listingUser){ -
    -

    Listing by

    - - {{ listingUser.firstname }} {{ listingUser.lastname }} - - @if(listingUser.hasCompanyLogo){ - - } -
    - }
    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 18f7fa0..923373c 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 @@ -159,6 +159,16 @@ export class DetailsBusinessListingComponent extends BaseDetailsComponent { { label: 'Reason for Sale', value: this.listing.reasonForSale }, { label: 'Broker licensing', value: this.listing.brokerLicencing }, { label: 'Listed since', value: `${this.dateInserted()} - ${this.getDaysListed()} days` }, + { + label: 'Listing by', + value: null, // Wird nicht verwendet + isHtml: true, + isListingBy: true, // Flag für den speziellen Fall + user: this.listingUser, // Übergebe das User-Objekt + imagePath: this.listing.imageName, + imageBaseUrl: this.env.imageBaseUrl, + ts: this.ts, + }, ]; if (this.listing.draft) { result.push({ label: 'Draft', value: this.listing.draft ? 'Yes' : 'No' }); diff --git a/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.html b/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.html index 99fb384..bd9998f 100644 --- a/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.html +++ b/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.html @@ -16,7 +16,18 @@
    {{ detail.label }}
    -
    {{ detail.value }}
    + + +
    {{ detail.value }}
    + + +
    + + +
    @@ -88,15 +99,6 @@
    - @if(listingUser){ -
    -

    Listing by

    - {{ listingUser.firstname }} {{ listingUser.lastname }} - @if(listingUser.hasCompanyLogo){ - - } -
    - }
    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 2bb01c6..bf99028 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 @@ -111,6 +111,16 @@ export class DetailsCommercialPropertyListingComponent extends BaseDetailsCompon { 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` }, + { + label: 'Listing by', + value: null, // Wird nicht verwendet + isHtml: true, + isListingBy: true, // Flag für den speziellen Fall + user: this.listingUser, // Übergebe das User-Objekt + imagePath: this.listing.imagePath, + imageBaseUrl: this.env.imageBaseUrl, + ts: this.ts, + }, ]; if (this.listing.draft) { this.propertyDetails.push({ label: 'Draft', value: this.listing.draft ? 'Yes' : 'No' }); diff --git a/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.ts b/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.ts index 2434025..767ff98 100644 --- a/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.ts +++ b/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.ts @@ -15,7 +15,7 @@ import { ListingsService } from '../../../services/listings.service'; import { SearchService } from '../../../services/search.service'; import { SelectOptionsService } from '../../../services/select-options.service'; import { UserService } from '../../../services/user.service'; -import { getCriteriaProxy, resetUserListingCriteria } from '../../../utils/utils'; +import { assignProperties, getCriteriaProxy, resetUserListingCriteria } from '../../../utils/utils'; @UntilDestroy() @Component({ selector: 'app-broker-listings', @@ -104,8 +104,13 @@ export class BrokerListingsComponent { this.searchService.search(this.criteria); } - openFilterModal() { + async openFilterModal() { // Open the search modal with current criteria - this.modalService.showModal(this.criteria); + const modalResult = await this.modalService.showModal(this.criteria); + if (modalResult.accepted) { + this.searchService.search(this.criteria); + } else { + this.criteria = assignProperties(this.criteria, modalResult.criteria); + } } } diff --git a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts index 55872eb..6026f4f 100644 --- a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts +++ b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts @@ -14,7 +14,7 @@ import { ImageService } from '../../../services/image.service'; import { ListingsService } from '../../../services/listings.service'; import { SearchService } from '../../../services/search.service'; import { SelectOptionsService } from '../../../services/select-options.service'; -import { getCriteriaProxy, resetBusinessListingCriteria } from '../../../utils/utils'; +import { assignProperties, getCriteriaProxy, resetBusinessListingCriteria } from '../../../utils/utils'; @UntilDestroy() @Component({ selector: 'app-business-listings', @@ -107,8 +107,13 @@ export class BusinessListingsComponent { this.searchService.search(this.criteria); } - openFilterModal() { + async openFilterModal() { // Open the search modal with current criteria - this.modalService.showModal(this.criteria); + const modalResult = await this.modalService.showModal(this.criteria); + if (modalResult.accepted) { + this.searchService.search(this.criteria); + } else { + this.criteria = assignProperties(this.criteria, modalResult.criteria); + } } } diff --git a/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.ts b/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.ts index 023816c..e49304b 100644 --- a/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.ts +++ b/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.ts @@ -14,7 +14,7 @@ import { ImageService } from '../../../services/image.service'; import { ListingsService } from '../../../services/listings.service'; import { SearchService } from '../../../services/search.service'; import { SelectOptionsService } from '../../../services/select-options.service'; -import { getCriteriaProxy, resetCommercialPropertyListingCriteria } from '../../../utils/utils'; +import { assignProperties, getCriteriaProxy, resetCommercialPropertyListingCriteria } from '../../../utils/utils'; @UntilDestroy() @Component({ selector: 'app-commercial-property-listings', @@ -105,8 +105,13 @@ export class CommercialPropertyListingsComponent { this.searchService.search(this.criteria); } - openFilterModal() { + async openFilterModal() { // Open the search modal with current criteria - this.modalService.showModal(this.criteria); + const modalResult = await this.modalService.showModal(this.criteria); + if (modalResult.accepted) { + this.searchService.search(this.criteria); + } else { + this.criteria = assignProperties(this.criteria, modalResult.criteria); + } } } diff --git a/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts b/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts index 3473c6a..1bb6ea5 100644 --- a/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts +++ b/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts @@ -150,7 +150,7 @@ export class EditCommercialPropertyListingComponent { const email = keycloakUser.email; this.user = await this.userService.getByMail(email); this.listingCategories = this.selectOptions.listingCategories - .filter(lc => lc.value === 'commercialProperty' || (this.user.customerSubType === 'broker' && lc.value === 'business')) + .filter(lc => lc.value === 'commercialProperty' || this.user.customerType === 'professional') .map(e => { return { name: e.name, value: e.value }; }); diff --git a/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.html b/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.html index 892bb16..a37a861 100644 --- a/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.html +++ b/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.html @@ -11,6 +11,7 @@ Category Located in Price + Publication Status Actions @@ -20,6 +21,11 @@ {{ listing.listingsCategory === 'commercialProperty' ? 'Commercial Property' : 'Business' }} {{ listing.location.name ? listing.location.name : listing.location.county }}, {{ listing.location.state }} ${{ listing.price.toLocaleString() }} + + + {{ listing.draft ? 'Draft' : 'Published' }} + + @if(listing.listingsCategory==='business'){