From 497a19a60d581523e9421efa0e4d063d31e8d73f Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 16 Feb 2022 18:43:20 +0200 Subject: [PATCH 1/5] apply changes for datasource search pages #7546 --- searchPages/searchDataProviders.component.ts | 18 ++++++------- .../searchUtils/datasourcesHelper.class.ts | 25 ++++++++++++++++--- utils/properties/searchFields.ts | 10 ++++---- 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/searchPages/searchDataProviders.component.ts b/searchPages/searchDataProviders.component.ts index 704ba1a0..a938be47 100644 --- a/searchPages/searchDataProviders.component.ts +++ b/searchPages/searchDataProviders.component.ts @@ -38,7 +38,7 @@ import {properties} from "../../../environments/environment"; [entitiesSelection]="type=='all'" [showSwitchSearchLink]="showSwitchSearchLink" [filters]="filters" [simpleView]="simpleView" formPlaceholderText="Search by name, description, subject..." - [showResultCount]="(type=='all' || type == 'deposit')" [showIndexInfo]="type!='deposit'" + [showResultCount]="true" [showIndexInfo]="type!='deposit'" [tableViewLink]="tableViewLink" [sort]="false" [showBreadcrumb]="showBreadcrumb" [basicMetaDescription]="metaDescription"> @@ -142,11 +142,11 @@ export class SearchDataProvidersComponent { } // console.log(this.refineFields) this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], this.fieldIdsMap,this.customFilter,params, "dataprovider"); - if(refine && (this.type == "all" || this.type == "deposit")) { + if(refine /*&& (this.type == "all" || this.type == "deposit")*/) { this._getFilters(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, 0, true, this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad)); - } else if(refine) { // static filters - this.searchUtils.refineStatus = this.errorCodes.LOADING; - this.filters = DatasourcesHelperClass.createFilters(this.type); + // } else if(refine) { // static filters + // this.searchUtils.refineStatus = this.errorCodes.LOADING; + // this.filters = DatasourcesHelperClass.createFilters(this.type); } else { this.searchUtils.refineStatus = this.errorCodes.DONE; } @@ -173,7 +173,7 @@ export class SearchDataProvidersComponent { this.searchPageUpdates.emit({disableForms: this.disableForms, disableRefineForms: this.disableRefineForms, searchUtils: this.searchUtils}); let datasourceQueryPrefix = DatasourcesHelperClass.getQueryPrefix(this.type); - this.searchFiltersSub = this._searchDataProvidersService.advancedSearchDataproviders( datasourceQueryPrefix +(datasourceQueryPrefix.length > 0 && parameters.length > 0 ?' and (':'') + parameters +(datasourceQueryPrefix.length > 0 && parameters.length > 0 ?' ) ':''), page, size, this.properties, (refine && (this.type=="all" || this.type == "deposit")) ? this.searchPage.getRefineFieldsQuery() : null, this.searchPage.getFields(), refineFieldsFilterQuery, (this.type == "deposit")) + this.searchFiltersSub = this._searchDataProvidersService.advancedSearchDataproviders( datasourceQueryPrefix +(datasourceQueryPrefix.length > 0 && parameters.length > 0 ?' and (':'') + parameters +(datasourceQueryPrefix.length > 0 && parameters.length > 0 ?' ) ':''), page, size, this.properties, (refine /*&& (this.type=="all" || this.type == "deposit")*/) ? this.searchPage.getRefineFieldsQuery() : null, this.searchPage.getFields(), refineFieldsFilterQuery, (this.type == "deposit")) //.switchMap( .subscribe( data => { @@ -198,7 +198,7 @@ export class SearchDataProvidersComponent { if (refine) { this.filters = this.searchPage.prepareFiltersToShow(filters, totalResults); } - +console.log(filters) this.searchUtils.refineStatus = this.errorCodes.DONE; if(totalResults == 0) { this.searchUtils.refineStatus = this.errorCodes.NONE; @@ -258,9 +258,9 @@ export class SearchDataProvidersComponent { data => { let totalResults = data[0]; let results = data[1]; - if(refine && !(this.type == "all" || this.type == "deposit")){ + /* if(refine && !(this.type == "all" || this.type == "deposit")){ this.filtersReturned(refine, this.filters, totalResults, page); - } + }*/ this.resultsReturned(refine, results, totalResults, page); }, err => { diff --git a/searchPages/searchUtils/datasourcesHelper.class.ts b/searchPages/searchUtils/datasourcesHelper.class.ts index fe16fd41..ce949974 100644 --- a/searchPages/searchUtils/datasourcesHelper.class.ts +++ b/searchPages/searchUtils/datasourcesHelper.class.ts @@ -1,5 +1,6 @@ import {Filter, Value} from "./searchHelperClasses.class"; import {SearchFields} from "../../utils/properties/searchFields"; +import {properties} from "../../../../environments/environment"; export class DatasourcesHelperClass { @@ -42,8 +43,11 @@ export class DatasourcesHelperClass { } } public static getQueryPrefix(type: "all" | "registries" | "journals" | "compatible" | "deposit"): string { + if(properties.environment == "production") { if (type == "registries") { - return ' datasourcetypeuiid = other '; + return ' (datasourcetypeuiid = "entityregistry" or datasourcetypeuiid = "entityregistry::products" or datasourcetypeuiid = "entityregistry::repositories" ' + + 'or datasourcetypeuiid = "entityregistry::organizations" or datasourcetypeuiid = "entityregistry::researchers" ) '; + } else if (type == "journals") { // return ' not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ) '; return 'oaftype exact datasource not datasourcecompatibilityid = notCompatible and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ) '; @@ -55,6 +59,21 @@ export class DatasourcesHelperClass { } else { return ""; } + }else{ + if (type == "registries") { + return 'datasourcetypeuiname exact "Registry"'; + } else if (type == "journals") { + // return ' not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ) '; + return 'oaftype exact datasource not datasourcecompatibilityid = notCompatible and datasourcetypeuiname exact "Journal archive" '; + + } else if (type == "compatible") { + return ' oaftype exact datasource and datasourcecompatibilityid <> notCompatible and datasourcetypeuiname exact "Repository" '; + }else if (type == "deposit") { + return ' oaftype exact datasource and (datasourcetypeuiname exact "Journal archive" or datasourcetypeuiname exact "Repository")'; + } else { + return ""; + } + } } public static createFilters(type: "all" | "registries" | "journals" | "compatible" | "deposit"): Filter[] { @@ -62,8 +81,8 @@ export class DatasourcesHelperClass { return this.createRegistriesFilters(); } else if (type == "journals") { return this.createJournalFilters(); - } else if (type == "compatible") { - return this.createCompatibleFilters(); +/* } else if (type == "compatible") { + return this.createCompatibleFilters();*/ } else { return []; } diff --git a/utils/properties/searchFields.ts b/utils/properties/searchFields.ts index d948fb09..1426ddab 100644 --- a/utils/properties/searchFields.ts +++ b/utils/properties/searchFields.ts @@ -426,7 +426,7 @@ export class SearchFields { param: "type", operator: "tp", equalityOperator: " exact ", - filterType: "checkbox" + filterType: "radio" }, ["datasourcetypename"]: { name: "Type", @@ -434,7 +434,7 @@ export class SearchFields { param: "type", operator: "tp", equalityOperator: " exact ", - filterType: null + filterType: "radio" }, ["datasourceodlanguages"]: { name: "Language", @@ -511,7 +511,7 @@ export class SearchFields { {"name": "country", "equalityOperator": " exact "}, {"name": "datasourcesubject", "equalityOperator": " all "} ]; - public DEPOSIT_DATASOURCE_REFINE_FIELDS: string[] = ["datasourcetypeuiname", "country", "datasourceodsubjects", "datasourceodcontenttypes", "datasourcecompatibilityname"]; + public DEPOSIT_DATASOURCE_REFINE_FIELDS: string[] = ["datasourcetypename", "country", "datasourceodsubjects", "datasourceodcontenttypes", "datasourcecompatibilityname"]; public DEPOSIT_DATASOURCE_FIELDS: { [key: string]: FieldDetails } = { ["datasourcetypeuiname"]: { @@ -556,9 +556,9 @@ export class SearchFields { }, }; - public COMPATIBLE_DATAPROVIDER_FIELDS: string[] = ["datasourcetypeuiid", "datasourcecompatibilityname"]; + public COMPATIBLE_DATAPROVIDER_FIELDS: string[] = ["datasourcetypename", "datasourcecompatibilityname"]; public ENTITY_REGISTRIES_FIELDS: string[] = ["datasourcetypename", "datasourcecompatibilityname"]; - public JOURNAL_FIELDS: string[] = ["datasourcetypeuiid", "datasourcecompatibilityname"]; + public JOURNAL_FIELDS: string[] = ["datasourcetypename", "datasourcecompatibilityname"]; //ORGANIZATION From 66eed055970529c78d98ea3833070d5f45acd139 Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 18 Feb 2022 16:57:25 +0200 Subject: [PATCH 2/5] apply changes related to eosc/aggregator --- connect/connectHelper.ts | 3 ++ sharedComponents/navigationBar.component.html | 11 ++++-- sharedComponents/navigationBar.component.ts | 34 ++++++++++--------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/connect/connectHelper.ts b/connect/connectHelper.ts index 7d9df3ff..18bde834 100644 --- a/connect/connectHelper.ts +++ b/connect/connectHelper.ts @@ -9,6 +9,9 @@ export class ConnectHelper { domain = "covid-19.openaire.eu"; //for testing } domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix + if (domain.indexOf('eosc-portal.eu') != -1) { + return "eosc"; + } if (domain.indexOf('openaire.eu') === -1) { return null; } diff --git a/sharedComponents/navigationBar.component.html b/sharedComponents/navigationBar.component.html index 1f4d71e9..893bb754 100644 --- a/sharedComponents/navigationBar.component.html +++ b/sharedComponents/navigationBar.component.html @@ -176,18 +176,23 @@ alt="BETA" style="height: 102px; width: 102px">
-