@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user