update message component, bugfixes

This commit is contained in:
2024-08-05 13:31:32 +02:00
parent 4c1b1fbc87
commit 8b71b073be
15 changed files with 1332 additions and 756 deletions

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={{ ts }}" alt="Image" class="w-full h-48 object-cover" />
<img src="{{ env.imageBaseUrl }}/pictures/property/{{ listing.imagePath }}/{{ listing.serialId }}/{{ listing.imageOrder[0] }}?_ts={{ getTS() }}" 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

@@ -34,7 +34,6 @@ export class CommercialPropertyListingsComponent {
statesSet = new Set();
state: string;
totalRecords: number = 0;
ts = new Date().getTime();
env = environment;
page = 1;
pageCount = 1;
@@ -85,4 +84,7 @@ export class CommercialPropertyListingsComponent {
reset() {
this.criteria.title = null;
}
getTS() {
return new Date().getTime();
}
}

View File

@@ -9,7 +9,7 @@
<input type="email" id="email" name="email" [(ngModel)]="user.email" disabled class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" />
<p class="text-xs text-gray-500 mt-1">You can only modify your email by contacting us at support&#64;bizwatch.net</p>
</div>
@if (isProfessional){
@if (isProfessional || isAdmin()){
<div class="flex flex-row items-center justify-around md:space-x-4">
<div class="flex h-full justify-between flex-col">
<p class="text-sm font-medium text-gray-700 mb-1">Company Logo</p>
@@ -71,8 +71,14 @@
<option *ngFor="let type of customerTypes" [value]="type">{{ type | titlecase }}</option>
</select>
</div> -->
@if (!isAdmin()){
<app-validated-select label="Customer Type" name="customerType" [(ngModel)]="user.customerType" [options]="customerTypeOptions"></app-validated-select>
@if (isProfessional){
}@else{
<div>
<label for="customerType" class="block text-sm font-medium text-gray-700">User Type</label>
<span class="bg-blue-100 text-blue-800 text-sm font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300">ADMIN</span>
</div>
} @if (isProfessional){
<!-- <div>
<label for="customerSubType" class="block text-sm font-medium text-gray-700">Professional Type</label>
<select id="customerSubType" name="customerSubType" [(ngModel)]="user.customerSubType" required class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">

View File

@@ -226,7 +226,7 @@ export class AccountComponent {
const message = this.validationMessages.find(msg => msg.field === fieldName);
return message ? message.message : '';
}
test(value) {
console.log(`--->${value}`);
isAdmin() {
return this.keycloakService.getUserRoles(true).includes('ADMIN');
}
}

View File

@@ -130,6 +130,7 @@
<app-drag-drop-mixed [listing]="listing" (imageOrderChanged)="imageOrderChanged($event)" (imageToDelete)="deleteConfirm($event)"></app-drag-drop-mixed>
<!-- </div> -->
</div>
@if (mode!=='create'){
<div class="bg-white p-4 rounded-lg shadow">
<h2 class="text-lg font-semibold mb-2">Property Pictures</h2>
<p class="text-sm text-gray-500 mb-4">(Pictures can be uploaded once the listing is posted initially)</p>
@@ -144,7 +145,7 @@
</button>
<input type="file" #fileInput style="display: none" (change)="fileChangeEvent($event)" accept="image/*" />
</div>
@if (mode==='create'){
} @if (mode==='create'){
<button (click)="save()" class="bg-blue-500 text-white px-4 py-2 mt-3 rounded-md hover:bg-blue-600">Post Listing</button>
} @else {
<button (click)="save()" class="bg-blue-500 text-white px-4 py-2 mt-3 rounded-md hover:bg-blue-600">Update Listing</button>

View File

@@ -54,7 +54,7 @@ export class EmailUsComponent {
this.messageService.addMessage({
severity: 'danger',
text: 'An error occurred',
duration: 5000,
duration: 50000,
});
if (error.error && Array.isArray(error.error?.message)) {
this.validationMessagesService.updateMessages(error.error.message);