[develop | DONE | ADDED] Add Organization refine field in results for Connect
This commit is contained in:
parent
355889dc92
commit
edf7491c26
36
angular.json
36
angular.json
|
@ -34,6 +34,12 @@
|
||||||
"build": {
|
"build": {
|
||||||
"builder": "@angular-devkit/build-angular:browser",
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
"options": {
|
"options": {
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/app/openaireLibrary/utils/properties/searchFields.ts",
|
||||||
|
"with": "src/app/shared/searchFields.community.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
"outputPath": "dist/connect/browser",
|
"outputPath": "dist/connect/browser",
|
||||||
"index": "src/index.html",
|
"index": "src/index.html",
|
||||||
"main": "src/main.ts",
|
"main": "src/main.ts",
|
||||||
|
@ -74,6 +80,12 @@
|
||||||
"extractLicenses": true,
|
"extractLicenses": true,
|
||||||
"vendorChunk": false,
|
"vendorChunk": false,
|
||||||
"buildOptimizer": true,
|
"buildOptimizer": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/app/openaireLibrary/utils/properties/searchFields.ts",
|
||||||
|
"with": "src/app/shared/searchFields.community.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"src/assets/common-assets/library-css/material.scss"
|
"src/assets/common-assets/library-css/material.scss"
|
||||||
],
|
],
|
||||||
|
@ -98,6 +110,10 @@
|
||||||
{
|
{
|
||||||
"replace": "src/environments/environment.ts",
|
"replace": "src/environments/environment.ts",
|
||||||
"with": "src/environments/environment.beta.ts"
|
"with": "src/environments/environment.beta.ts"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"replace": "src/app/openaireLibrary/utils/properties/searchFields.ts",
|
||||||
|
"with": "src/app/shared/searchFields.community.ts"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optimization": {
|
"optimization": {
|
||||||
|
@ -138,6 +154,10 @@
|
||||||
{
|
{
|
||||||
"replace": "src/environments/environment.ts",
|
"replace": "src/environments/environment.ts",
|
||||||
"with": "src/environments/environment.prod.ts"
|
"with": "src/environments/environment.prod.ts"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"replace": "src/app/openaireLibrary/utils/properties/searchFields.ts",
|
||||||
|
"with": "src/app/shared/searchFields.community.ts"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"optimization": {
|
"optimization": {
|
||||||
|
@ -221,7 +241,13 @@
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"optimization": true,
|
"optimization": true,
|
||||||
"vendorChunk": true,
|
"vendorChunk": true,
|
||||||
"buildOptimizer": true
|
"buildOptimizer": true,
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/app/openaireLibrary/utils/properties/searchFields.ts",
|
||||||
|
"with": "src/app/shared/searchFields.community.ts"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"beta": {
|
"beta": {
|
||||||
"outputHashing": "media",
|
"outputHashing": "media",
|
||||||
|
@ -229,6 +255,10 @@
|
||||||
{
|
{
|
||||||
"replace": "src/environments/environment.ts",
|
"replace": "src/environments/environment.ts",
|
||||||
"with": "src/environments/environment.beta.ts"
|
"with": "src/environments/environment.beta.ts"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"replace": "src/app/openaireLibrary/utils/properties/searchFields.ts",
|
||||||
|
"with": "src/app/shared/searchFields.community.ts"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
|
@ -241,6 +271,10 @@
|
||||||
{
|
{
|
||||||
"replace": "src/environments/environment.ts",
|
"replace": "src/environments/environment.ts",
|
||||||
"with": "src/environments/environment.prod.ts"
|
"with": "src/environments/environment.prod.ts"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"replace": "src/app/openaireLibrary/utils/properties/searchFields.ts",
|
||||||
|
"with": "src/app/shared/searchFields.community.ts"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
|
|
|
@ -309,11 +309,13 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
initAdminToolCommunity(communityId) {
|
initAdminToolCommunity(communityId) {
|
||||||
if (communityId) {
|
if (communityId) {
|
||||||
this.properties.adminToolsPortalType = "community";
|
this.properties.adminToolsPortalType = "community";
|
||||||
|
this.properties.plan = communityId == 'covid-19'?'Premium':this.community.plan;
|
||||||
if (this.document) {
|
if (this.document) {
|
||||||
this.initLayout(communityId);
|
this.initLayout(communityId);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.properties.adminToolsPortalType = "connect";
|
this.properties.adminToolsPortalType = "connect";
|
||||||
|
this.properties.plan = null;
|
||||||
if (this.document) {
|
if (this.document) {
|
||||||
this.initLayout(this.communityId?this.communityId:'connect');
|
this.initLayout(this.communityId?this.communityId:'connect');
|
||||||
}
|
}
|
||||||
|
@ -409,7 +411,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
new MenuItem("search", "Search", "", "/search/find", false, [], ["/search/find"], {},
|
new MenuItem("search", "Search", "", "/search/find", false, [], ["/search/find"], {},
|
||||||
null, null, null, null, "_blank", "internal", false,
|
null, null, null, null, "_blank", "internal", false,
|
||||||
[
|
[
|
||||||
new MenuItem("", OpenaireEntities.RESULTS, "", "/search/find/research-outcomes", false, [], ["/search/find/research-outcomes"], {resultbestaccessright: '"' + encodeURIComponent("Open Access") + '"'}),
|
new MenuItem("", OpenaireEntities.RESULTS, "", "/search/find/research-outcomes", false, [], ["/search/find/research-outcomes"], {}),
|
||||||
new MenuItem("", OpenaireEntities.PROJECTS, "", "/search/find/projects/", false, ["project"], ["/search/find/projects"], {}),
|
new MenuItem("", OpenaireEntities.PROJECTS, "", "/search/find/projects/", false, ["project"], ["/search/find/projects"], {}),
|
||||||
new MenuItem("", OpenaireEntities.DATASOURCES, "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], {}),
|
new MenuItem("", OpenaireEntities.DATASOURCES, "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], {}),
|
||||||
]
|
]
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
import {SearchFieldsBase} from "src/app/openaireLibrary/utils/properties/searchFields.base";
|
||||||
|
import {properties} from "src/environments/environment";
|
||||||
|
|
||||||
|
|
||||||
|
export class SearchFields extends SearchFieldsBase {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
if(properties.plan == "Premium" && properties.environment != 'production'){
|
||||||
|
this.RESULT_REFINE_FIELDS.push("relorganization");
|
||||||
|
this.RESULT_FIELDS_ORDERED[3].values.push("relorganization")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum OpenaireEntities {
|
||||||
|
RESULTS = "Research products",
|
||||||
|
PUBLICATIONS = "Publications",
|
||||||
|
DATASETS = "Research data",
|
||||||
|
SOFTWARE = "Research software",
|
||||||
|
OTHER = "Other research products",
|
||||||
|
PROJECTS = "Projects",
|
||||||
|
ORGANIZATIONS = "Organizations",
|
||||||
|
DATASOURCES = "Data sources",
|
||||||
|
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",
|
||||||
|
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",
|
||||||
|
SERVICES_FILE = "services",
|
||||||
|
}
|
Loading…
Reference in New Issue