openaire-library/utils/properties/searchFields.ts

64 lines
2.0 KiB
TypeScript
Raw Normal View History

import {SearchFieldsBase} from "src/app/openaireLibrary/utils/properties/searchFields.base";
export class SearchFields extends SearchFieldsBase {
public static getParameterOrder(fieldId: string, params): number {
let fields = [];
let searchFields = new SearchFields();
if (searchFields.RESULT_REFINE_FIELDS.indexOf(fieldId) != -1) {
fields = searchFields.RESULT_REFINE_FIELDS;
} else if (searchFields.PROJECT_REFINE_FIELDS.indexOf(fieldId) != -1) {
fields = searchFields.PROJECT_REFINE_FIELDS
} else if (searchFields.ORGANIZATION_REFINE_FIELDS.indexOf(fieldId) != -1) {
fields = searchFields.ORGANIZATION_REFINE_FIELDS;
} else if (searchFields.DATASOURCE_REFINE_FIELDS.indexOf(fieldId) != -1) {
fields = searchFields.DATASOURCE_REFINE_FIELDS;
}
let index = fields.indexOf(fieldId);
let paramIndex = 0;
if (index != -1) {
for (let keyValue of params) {
if (fields.indexOf(keyValue[0]) > index) {
break;
}
paramIndex++
}
}
return paramIndex;
}
}
2022-04-08 15:54:45 +02:00
export enum OpenaireEntities {
RESULTS = "Research products",
2022-04-08 15:54:45 +02:00
PUBLICATIONS = "Publications",
DATASETS = "Research data",
SOFTWARE = "Research software",
2022-04-08 15:54:45 +02:00
OTHER = "Other research products",
PROJECTS = "Projects",
ORGANIZATIONS = "Organizations",
DATASOURCES = "Data sources",
2022-05-13 14:57:31 +02:00
SERVICES = "Services",
COMMUNITIES = "Research communities",
RESULT = "Research product",
PUBLICATION = "Publication",
DATASET = "Research data",
SOFTWARE_SINGULAR = "Research software",
OTHER_SINGULAR = "Other research product",
PROJECT = "Project",
ORGANIZATION = "Organization",
DATASOURCE = "Data source",
2022-05-13 14:57:31 +02:00
SERVICE = "Service",
COMMUNITY = "Research community",
RESULTS_FILE = "research-products",
PUBLICATIONS_FILE = "publications",
DATASETS_FILE = "research-data",
SOFTWARE_FILE = "research-software",
OTHER_FILE = "other-research-products",
PROJECTS_FILE = "projects",
ORGANIZATIONS_FILE = "organizations",
DATASOURCES_FILE = "data-sources",
2022-05-13 14:57:31 +02:00
SERVICES_FILE = "services",
2022-04-08 15:54:45 +02:00
}