From 76a72c175dd8b638d91bf14509d3cb66572f0a31 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 7 Feb 2024 10:31:42 +0200 Subject: [PATCH 1/9] [develop | DONE | FIXED]: [BUG FIX] claimResultSearchForm.component.ts: In method "checkSelectedFilters()" set "filter.countAllValues = filter.values.length;", because filters were loading forever. --- claims/claim-utils/claimResultSearchForm.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/claims/claim-utils/claimResultSearchForm.component.ts b/claims/claim-utils/claimResultSearchForm.component.ts index b99f5e2a..095a5532 100644 --- a/claims/claim-utils/claimResultSearchForm.component.ts +++ b/claims/claim-utils/claimResultSearchForm.component.ts @@ -865,7 +865,7 @@ export class ClaimResultSearchFormComponent { } } - + filter.countAllValues = filter.values.length; } return filters; } From ffedfc06189f9c30ffbcb8cebc43fec23c18e48a Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 7 Feb 2024 11:57:55 +0200 Subject: [PATCH 2/9] [develop | DONE | FIXED]: [BUG FIX] fetchProjects.class.ts: In method "getResultsForOrganizations()" set "this.filters[i].countAllValues = this.filters[i].values.length;", because filters were loading forever. --- utils/fetchEntitiesClasses/fetchProjects.class.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/fetchEntitiesClasses/fetchProjects.class.ts b/utils/fetchEntitiesClasses/fetchProjects.class.ts index b637e820..f9ca6fb9 100644 --- a/utils/fetchEntitiesClasses/fetchProjects.class.ts +++ b/utils/fetchEntitiesClasses/fetchProjects.class.ts @@ -175,6 +175,7 @@ export class FetchProjects { } } } + this.filters[i].countAllValues = this.filters[i].values.length; } } if (filterquery == "") { @@ -186,6 +187,7 @@ export class FetchProjects { this.funders = (this.filters[i].values); } + this.filters[i].countAllValues = this.filters[i].values.length; } //console.log(" this.funders:"+ this.funders); From 514e92b177f57d6de0cde8363e1fb191f8b2de6b Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 7 Feb 2024 15:45:58 +0200 Subject: [PATCH 3/9] [develop | DONE | FIXED]: [BUG FIX] searchResearchResults.component.ts: In method "filterRequestedAll()", call "this.searchPage.filterFilterValues(this.filters);", to filter out from funding filters, values not related to the selected funder. --- searchPages/searchResearchResults.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/searchPages/searchResearchResults.component.ts b/searchPages/searchResearchResults.component.ts index d8e78fe6..09fd44ba 100644 --- a/searchPages/searchResearchResults.component.ts +++ b/searchPages/searchResearchResults.component.ts @@ -530,6 +530,7 @@ export class SearchResearchResultsComponent { filter.countSelectedValues = oldFilter.countSelectedValues; filter.radioValue = oldFilter.radioValue; this.filters[index] = filter; + this.searchPage.filterFilterValues(this.filters); this.updateOrderedFilter(filter); this.cdr.detectChanges(); From f45598b1907ec948b3c92262886929c83743b073 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 7 Feb 2024 15:55:56 +0200 Subject: [PATCH 4/9] [develop | DONE | FIXED]: [BUG FIX] Moved checks for filtering out filter values in parsing phase. 1. refineResults.class.ts: a. Updated method "includeValue()" and include "null" (as a string) check | Call method "includeValue()" when creating filters. b. Set filter.countUnfilteredValues to the length of values returned by the service before filtering them out. c. Check if filters returned by service before trying to parse anything. 2. searchHelperClasses.class.ts: Added in Filter structure the field "public countUnfilteredValues?: number = 0;", to check if there are more values to be queried (show "view all" link or not). 3. searchFilter.component.ts: Updated check of hasMoreValues to show or not the "view all" link - check filter.countUnfilteredValues | Comment filtering out of filter values - moved to refineResults.class.ts. --- .../searchUtils/searchFilter.component.ts | 6 ++++-- .../searchUtils/searchHelperClasses.class.ts | 1 + services/servicesUtils/refineResults.class.ts | 16 ++++++++++------ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/searchPages/searchUtils/searchFilter.component.ts b/searchPages/searchUtils/searchFilter.component.ts index 896cc360..12a4bed0 100644 --- a/searchPages/searchUtils/searchFilter.component.ts +++ b/searchPages/searchUtils/searchFilter.component.ts @@ -84,9 +84,11 @@ export class SearchFilterComponent implements OnInit, OnChanges { ngOnChanges(changes: SimpleChanges) { if (changes.filter) { - this.hasMoreValues = this.filter.values.length > this.filterValuesNum; + this.hasMoreValues = (this.filter.countUnfilteredValues > 0 ? this.filter.countUnfilteredValues : this.filter.values.length) > this.filterValuesNum; // this.filter.values = this.filter.values.filter(value => !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available')); - this.filter.values = this.filter.values.filter(value => value && value.name != "unidentified" && value.name != "Undetermined" && !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available')); + // this.filter.values = this.filter.values.filter(value => value && value.name != "unidentified" && value.name != "Undetermined" && !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available') + // && value.name.toLowerCase() != "null" + // ); if (this.filter.filterType == "radio") { this.filter.radioValue = ""; diff --git a/searchPages/searchUtils/searchHelperClasses.class.ts b/searchPages/searchUtils/searchHelperClasses.class.ts index 01a68404..03d5a603 100644 --- a/searchPages/searchUtils/searchHelperClasses.class.ts +++ b/searchPages/searchUtils/searchHelperClasses.class.ts @@ -13,6 +13,7 @@ export class Filter{ // public uniqueValueIdSelected: string; public countAllValues?: number = -1; // -1: not yet requested, 0: request failed, >0 OK public isOpen?: boolean = false; + public countUnfilteredValues?: number = 0; } export class Value{ diff --git a/services/servicesUtils/refineResults.class.ts b/services/servicesUtils/refineResults.class.ts index 01ec207b..dcd48d17 100644 --- a/services/servicesUtils/refineResults.class.ts +++ b/services/servicesUtils/refineResults.class.ts @@ -11,7 +11,7 @@ export class RefineResultsUtils { var searchFields:SearchFields = new SearchFields(); var filters:Filter[] = []; - if(data && fields){ + if(data && Object.keys(data).length > 0 && fields){ for(let j=0; j Date: Wed, 7 Feb 2024 16:56:16 +0200 Subject: [PATCH 5/9] [develop | DONE | FIXED]: [BUG FIX] resultLanding.component.html & project.component.html & organization.component.html & dataProvider.component.html: Moved outside any parent html tag - was missing from mobile screens. --- .../dataProvider/dataProvider.component.html | 11 ++++++----- .../organization/organization.component.html | 12 +++++++----- landingPages/project/project.component.html | 10 ++++++---- landingPages/result/resultLanding.component.html | 11 ++++++----- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/landingPages/dataProvider/dataProvider.component.html b/landingPages/dataProvider/dataProvider.component.html index 59528c96..d9cd5a60 100644 --- a/landingPages/dataProvider/dataProvider.component.html +++ b/landingPages/dataProvider/dataProvider.component.html @@ -1,3 +1,8 @@ + + +
@@ -95,11 +100,7 @@
- - +
diff --git a/landingPages/organization/organization.component.html b/landingPages/organization/organization.component.html index dbcb6cca..04f4235a 100644 --- a/landingPages/organization/organization.component.html +++ b/landingPages/organization/organization.component.html @@ -1,3 +1,9 @@ + + + +
@@ -116,11 +122,7 @@
- - - +
diff --git a/landingPages/project/project.component.html b/landingPages/project/project.component.html index 1c0742a9..709366de 100644 --- a/landingPages/project/project.component.html +++ b/landingPages/project/project.component.html @@ -1,3 +1,8 @@ + + +
@@ -141,10 +146,7 @@
- - +
diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index d102c511..b43476da 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -1,3 +1,8 @@ + + +
@@ -161,11 +166,7 @@
- - - +
From 92f43c280e9767122052f85ad9bdf9677bc11aa7 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 7 Feb 2024 17:47:42 +0200 Subject: [PATCH 6/9] =?UTF-8?q?[develop=20|=20DONE=20|=20FIXED]:=20[BUG=20?= =?UTF-8?q?FI=CE=A7]=20open-aire-jsonld-converter.service.ts:=20Fixed=20ho?= =?UTF-8?q?w=20description=20is=20set=20in=20methods=20"convertProject()",?= =?UTF-8?q?=20"convertDatasource()",=20"getDescription()"=20(called=20for?= =?UTF-8?q?=20research=20products).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/open-aire-jsonld-converter.service.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts index 54d42f10..5997caf6 100644 --- a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts +++ b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts @@ -140,8 +140,8 @@ export class OpenAireJsonldConverterService { doc["description"] = []; if(project.description) { let parsing = new ParsingFunctions(); - let abstracts = parsing.parseDescription(project.description); - doc["description"] = [abstracts && abstracts[0] ?(abstracts[0].substring(0,4997)+(abstracts[0].substring(0,4997).length == 4997?'...':'')):"" ]; + let abstracts = parsing.parseDescription(project.description, true); + doc["description"] = [abstracts ?(abstracts.substring(0,4997)+(abstracts.substring(0,4997).length == 4997?'...':'')):"" ]; } else { doc["description"].push(("project" + (project.title ? "," + project.title : "") + (project.funding && project.funding.funderName ? ", funder: " + project.funding.funderName : "") + (project.acronym ? "," + project.acronym : ""))); } @@ -178,8 +178,8 @@ convertDatasource(datasource: any, URL, otherUrl): Organization { doc["description"] = []; if(datasource.description) { let parsing = new ParsingFunctions(); - let abstracts = parsing.parseDescription(datasource.description); - doc["description"] = [abstracts && abstracts[0] ?(abstracts[0].substring(0,4997)+(abstracts[0].substring(0,4997).length == 4997?'...':'')):"" ]; + let abstracts = parsing.parseDescription(datasource.description, true); + doc["description"] = [abstracts ?(abstracts.substring(0,4997)+(abstracts.substring(0,4997).length == 4997?'...':'')):"" ]; } else { doc["description"].push(datasource.title.name?datasource.title.name:datasource.officialName); } @@ -242,8 +242,8 @@ convertDatasource(datasource: any, URL, otherUrl): Organization { const item = _.get(result, "result.metadata.oaf:entity.oaf:result.description", null); if (!item) return [ "" + this.getTitle(result)]; let parsing = new ParsingFunctions(); - let abstracts = parsing.parseDescription(item); - return [abstracts && abstracts[0] ?(abstracts[0].substring(0,4997)+(abstracts[0].substring(0,4997).length == 4997?'...':'')):"" ]; + let abstracts = parsing.parseDescription(item, true); + return [abstracts ?(abstracts.substring(0,4997)+(abstracts.substring(0,4997).length == 4997?'...':'')):"" ]; } private getDateCreated(result: any): String[] { From 09960fda9e5be54062d396c7fb9258e4998ef006 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 7 Feb 2024 21:12:43 +0200 Subject: [PATCH 7/9] [develop | DONE | FIXED]: availableOn.component.ts: Added field "@Input() inModal: boolean = false;" and display download sources when in modal - e.g. versions. | result-preview.component.html: Display download sources () in versions (isDeletedByInferenceModal). --- .../landing-utils/availableOn.component.ts | 118 ++++++++++-------- .../result-preview.component.html | 97 +++++++------- 2 files changed, 117 insertions(+), 98 deletions(-) diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 91bd51bd..34f71a93 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -14,68 +14,79 @@ import {RouterHelper} from "../../utils/routerHelper.class";
- -

- -
+
- + - -
- +
-
-
- - - -
-
    - - -
    -
    - - - - - - - - - - Added in ORCID: +
    + + +
    +
    + + + + + +
    +
      + + +
      +
      + + + + + - - {{date | date: 'dd MMM yyyy'}} - - & + + + + Added in ORCID: + + + {{date | date: 'dd MMM yyyy'}} + + & + - - - - -
    -
    + + +
    +
+
+
From b357ff2ae203cf1336addea86314678d710006e3 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 7 Feb 2024 21:28:45 +0200 Subject: [PATCH 8/9] [develop | DONE | CHANGED]: Remove preselected "Open Access" filter from search. 1. home.component.ts: Set field "resultsQuickFilter" to null. 2. searchAll.component.ts: Set field "quickFilter" to null | In method "entityChanged()" do not set parameter "resultbestaccessright" | [BUG FIX] Clear subscriptions from fetchOrps. 3. searchResearchResults.component.ts: Set field "quickFilter" to null. 4. navigationBar.component.ts: Set field "resultsQuickFilter" to null. 5. app.component.ts: Remove "resultbestaccessright" parameter from menu items of Search research products. --- searchPages/find/searchAll.component.ts | 20 +++++++++---------- .../searchResearchResults.component.ts | 12 +++++------ sharedComponents/navigationBar.component.ts | 12 +++++------ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/searchPages/find/searchAll.component.ts b/searchPages/find/searchAll.component.ts index c59d975a..cea70fd9 100644 --- a/searchPages/find/searchAll.component.ts +++ b/searchPages/find/searchAll.component.ts @@ -97,12 +97,12 @@ export class SearchAllComponent { subs: Subscription[] = []; - quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = { - filter: null, - selected: true, - filterId: "resultbestaccessright", - value: "Open Access" - }; + quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = null;//{ + // filter: null, + // selected: true, + // filterId: "resultbestaccessright", + // value: "Open Access" + // }; resultTypes = {publication: true, dataset: true, software: true, other: true}; @@ -290,7 +290,7 @@ export class SearchAllComponent { this.fetchDatasets.clearSubscriptions(); this.fetchPublications.clearSubscriptions(); this.fetchSoftware.clearSubscriptions(); - this.fetchPublications.clearSubscriptions(); + this.fetchOrps.clearSubscriptions(); this.fetchOrganizations.clearSubscriptions(); this.fetchDataproviders.clearSubscriptions(); this.fetchServices.clearSubscriptions(); @@ -603,9 +603,9 @@ export class SearchAllComponent { } if (entity == "result") { entity = "research-outcomes"; - if(!!this.openAccess) { - this.parameters["resultbestaccessright"] = '"' + encodeURIComponent("Open Access") + '"'; - } + // if(!!this.openAccess) { + // this.parameters["resultbestaccessright"] = '"' + encodeURIComponent("Open Access") + '"'; + // } } this.router.navigate(["/search/find", entity], {queryParams: this.parameters}); } diff --git a/searchPages/searchResearchResults.component.ts b/searchPages/searchResearchResults.component.ts index 09fd44ba..00bc7bc2 100644 --- a/searchPages/searchResearchResults.component.ts +++ b/searchPages/searchResearchResults.component.ts @@ -91,12 +91,12 @@ export class SearchResearchResultsComponent { public orderedFields = this.searchFields.RESULT_FIELDS_ORDERED; @ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent; @Input() simpleView: boolean = true; - quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = { - filter: null, - selected: true, - filterId: "resultbestaccessright", - value: "Open Access" - }; + quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = null;//{ + // filter: null, + // selected: true, + // filterId: "resultbestaccessright", + // value: "Open Access" + // }; @Input() includeOnlyResultsAndFilter: boolean = false; @Input() showBreadcrumb: boolean = false; @Output() searchPageUpdates = new EventEmitter(); diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts index d2ed7fb6..7b30e85e 100644 --- a/sharedComponents/navigationBar.component.ts +++ b/sharedComponents/navigationBar.component.ts @@ -80,12 +80,12 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges { public featuredAlignment: string = MenuAlignment.CENTER.valueOf(); public hasSearchBar: boolean = false; - public resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = { - filter: null, - selected: true, - filterId: "resultbestaccessright", - value: "Open Access" - }; + public resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = null;//{ + // filter: null, + // selected: true, + // filterId: "resultbestaccessright", + // value: "Open Access" + // }; @ViewChild('search_input') search_input: SearchInputComponent; @ViewChild('canvas') canvas: ElementRef; public routerHelper: RouterHelper = new RouterHelper(); From 137278522e0d3577b222dc6bab3dbc3842c013a0 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 7 Feb 2024 21:36:47 +0200 Subject: [PATCH 9/9] [develop | DONE | CHANGED]: indexInfo.service.ts: Added "lastIndexDateSubject" BehaviorSubject | newSearchPage.component.ts: In ngOninit, call "indexInfoService.lastIndexDate" get method instead of "indexInfoService.getLastIndexDate()", to get last index date from subject value. --- .../searchUtils/newSearchPage.component.ts | 2 +- utils/indexInfo.service.ts | 21 +++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index 3335bf93..be34dfef 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -218,7 +218,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { } } if (typeof document !== 'undefined') { - this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { + this.subscriptions.push(this.indexInfoService.lastIndexDate.subscribe(lastIndexUpdate => { if (lastIndexUpdate) { this.indexUpdateDate = new Date(lastIndexUpdate); } diff --git a/utils/indexInfo.service.ts b/utils/indexInfo.service.ts index 1570a7e2..f81b1019 100644 --- a/utils/indexInfo.service.ts +++ b/utils/indexInfo.service.ts @@ -1,21 +1,34 @@ import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {EnvProperties} from './properties/env-properties'; -import {Observable, of} from "rxjs"; +import {BehaviorSubject, Observable, of} from "rxjs"; import {catchError, map} from "rxjs/operators"; +import {properties} from "../../../environments/environment"; @Injectable({ providedIn: "root" }) export class IndexInfoService { + private lastIndexDateSubject: BehaviorSubject = new BehaviorSubject(null); constructor(private http: HttpClient) { } - getLastIndexDate(properties: EnvProperties): Observable { - let url = properties.indexInfoAPI; - return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url).pipe(map(res => res['claim_load_date'])).pipe(catchError(err => {return of(null)})); + get lastIndexDate(): Observable { + return this.lastIndexDateSubject.getValue() ? this.lastIndexDateSubject.asObservable() : this.getLastIndexDate(); + } + + setLastIndexDate(value: any) { + this.lastIndexDateSubject.next(value); + } + + getLastIndexDate(props: EnvProperties = properties): Observable { + let url = props.indexInfoAPI; + return this.http.get((props.useLongCache)? (props.cacheUrl+encodeURIComponent(url)): url).pipe(map(res => { + this.setLastIndexDate(res['claim_load_date']); + return res['claim_load_date']; + })).pipe(catchError(err => {return of(null)})); } getStatsLastDate(properties: EnvProperties): Observable { let url = properties.indexInfoAPI;