Ticket Fixing: #111, #110, #108 (SortBy)

This commit is contained in:
2024-09-09 17:35:08 +02:00
parent 9ecc0c2429
commit 06d83a478d
23 changed files with 308 additions and 70 deletions

View File

@@ -1,7 +1,7 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { lastValueFrom } from 'rxjs';
import { KeyValue, KeyValueStyle } from '../../../../bizmatch-server/src/models/main.model';
import { KeyValue, KeyValueAsSortBy, KeyValueStyle } from '../../../../bizmatch-server/src/models/main.model';
import { environment } from '../../environments/environment';
@Injectable({
@@ -22,6 +22,7 @@ export class SelectOptionsService {
this.gender = allSelectOptions.gender;
this.typesOfCommercialProperty = allSelectOptions.typesOfCommercialProperty;
this.distances = allSelectOptions.distances;
this.sortByOptions = allSelectOptions.sortByOptions;
}
public typesOfBusiness: Array<KeyValueStyle>;
@@ -38,6 +39,10 @@ export class SelectOptionsService {
public states: Array<any>;
public customerSubTypes: Array<KeyValue>;
public distances: Array<KeyValue>;
public sortByOptions: Array<KeyValueAsSortBy>;
getSortByOption(value: string) {
return this.sortByOptions.find(l => l.value === value)?.name;
}
getState(value: string): string {
return this.states.find(l => l.value === value)?.name;
}
@@ -75,4 +80,11 @@ export class SelectOptionsService {
getIconTypeOfCommercials(value: string): string {
return this.typesOfCommercialProperty.find(c => c.value === value)?.icon;
}
getIconAndTextColorTypeOfCommercials(value: string): string {
const category = this.typesOfCommercialProperty.find(c => c.value === value);
return `${category?.icon} ${category?.textColorClass}`;
}
getTextColorTypeOfCommercial(value: string): string {
return this.typesOfCommercialProperty.find(c => c.value === value)?.textColorClass;
}
}