monitor-dashboard/src/app/search/links-resolver.ts

53 lines
1.8 KiB
TypeScript
Raw Normal View History

import {properties} from "../../environments/environment";
interface Links {
searchLinkToResult;
searchLinkToPublication;
searchLinkToProject;
searchLinkToDataProvider;
searchLinkToDataset;
searchLinkToSoftwareLanding;
searchLinkToOrp;
searchLinkToOrganization;
searchLinkToResults,
searchLinkToProjects,
searchLinkToDataProviders,
searchLinkToAdvancedResults,
searchLinkToAdvancedProjects,
searchLinkToAdvancedDataProviders,
searchLinkToAdvancedOrganizations,
}
export class LinksResolver {
private static default: Links = {
searchLinkToResult: properties.searchLinkToResult,
searchLinkToPublication: properties.searchLinkToPublication,
searchLinkToProject: properties.searchLinkToProject,
searchLinkToDataProvider: properties.searchLinkToDataProvider,
searchLinkToDataset: properties.searchLinkToDataset,
searchLinkToSoftwareLanding: properties.searchLinkToSoftwareLanding,
searchLinkToOrp: properties.searchLinkToOrp,
searchLinkToOrganization: properties.searchLinkToOrganization,
searchLinkToResults: properties.searchLinkToResults,
searchLinkToDataProviders: properties.searchLinkToDataProviders,
searchLinkToProjects: properties.searchLinkToProjects,
searchLinkToAdvancedResults: properties.searchLinkToAdvancedResults,
searchLinkToAdvancedProjects: properties.searchLinkToAdvancedProjects,
searchLinkToAdvancedDataProviders: properties.searchLinkToAdvancedDataProviders,
searchLinkToAdvancedOrganizations: properties.searchLinkToAdvancedOrganizations,
};
public static setProperties( alias: string) {
Object.keys(this.default).forEach(field => {
properties[field] = "/" + alias + (<string>this.default[field]);
});
}
public static resetProperties() {
Object.keys(this.default).forEach(field => {
properties[field] = this.default[field];
});
}
}