aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/filters/resource-type-filter.ts
blob: f2d06f0edd71aaa7bfe1b7db1bc3f09dba31ee27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import {CacheService} from "../services/cache-service";

export class ResourceTypeFilter {
    static '$inject' = ['Sdc.Services.CacheService'];

    constructor(cacheService:CacheService) {
        let filter = <ResourceTypeFilter>(resourceType:string) => {
            let uiConfiguration:any = cacheService.get('UIConfiguration');

            if (uiConfiguration.resourceTypes && uiConfiguration.resourceTypes[resourceType]) {
                return uiConfiguration.resourceTypes[resourceType];
            }
            return resourceType;
        }
        return filter;
    }
}