From 3ee4129c7e76cc7f4c8dcfcf27c135ce873f8f0d Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 14 Jul 2023 11:40:38 +0300 Subject: [PATCH 01/29] apply initial changes to library bases on new community API --- connect/community/community.service.ts | 1 + connect/community/communityInfo.ts | 1 + connect/projects/searchProjects.service.ts | 8 ++++---- connect/zenodoCommunities/zenodo-communities.service.ts | 3 +-- connect/zenodoCommunities/zenodoCommunityInfo.ts | 1 - 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/connect/community/community.service.ts b/connect/community/community.service.ts index d8fe6975..38dfaf87 100644 --- a/connect/community/community.service.ts +++ b/connect/community/community.service.ts @@ -100,6 +100,7 @@ export class CommunityService { community.zenodoCommunity = resData.zenodoCommunity; community.status = 'all'; community.type = resData.type; + community.otherZenodoCommunities = resData.otherZenodoCommunities; if (resData.hasOwnProperty('status')) { community.status = resData.status; const status = ['all', 'hidden', 'manager']; diff --git a/connect/community/communityInfo.ts b/connect/community/communityInfo.ts index 231a642d..8f1989fd 100644 --- a/connect/community/communityInfo.ts +++ b/connect/community/communityInfo.ts @@ -16,6 +16,7 @@ export class CommunityInfo { subjects: string[]; status:string; zenodoCommunity:string; + otherZenodoCommunities: string[]; isUpload: boolean; isSubscribed: boolean; isManager: boolean; diff --git a/connect/projects/searchProjects.service.ts b/connect/projects/searchProjects.service.ts index c580d190..1d823262 100644 --- a/connect/projects/searchProjects.service.ts +++ b/connect/projects/searchProjects.service.ts @@ -7,15 +7,15 @@ import {map} from "rxjs/operators"; export class SearchCommunityProjectsService { constructor(private http: HttpClient ) {} - searchProjects (properties:EnvProperties, pid: string):any { - let url = properties.communityAPI+pid+"/projects"; + searchProjects (properties:EnvProperties, pid: string, page=0, size=100):any { + let url = properties.communityAPI+pid+"/projects/"+ page + "/" + size; return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); //.map(res => res.json()) } countTotalProjects(properties:EnvProperties,pid:string) { - let url = properties.communityAPI+pid+"/projects"; + let url = properties.communityAPI+pid+"/projects/0/0"; return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) - .pipe(map(res => res['length'])); + .pipe(map(res => res['totalElements'])); } } diff --git a/connect/zenodoCommunities/zenodo-communities.service.ts b/connect/zenodoCommunities/zenodo-communities.service.ts index bf790f27..5268a079 100644 --- a/connect/zenodoCommunities/zenodo-communities.service.ts +++ b/connect/zenodoCommunities/zenodo-communities.service.ts @@ -16,12 +16,11 @@ export class ZenodoCommunitiesService { //.map(res => res.json()) .pipe(map(res => [this.parseZenodoCommunities(res['hits'].hits),res['hits'].total])); } - getZenodoCommunityById(properties:EnvProperties, url: string, openaireId:string) { + getZenodoCommunityById(properties:EnvProperties, url: string) { return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)) : url) //.map(res => res.json()) .pipe(map(res => { var community = this.parseZenodoCommunity(res); - community["openaireId"]=openaireId; return community; })); } diff --git a/connect/zenodoCommunities/zenodoCommunityInfo.ts b/connect/zenodoCommunities/zenodoCommunityInfo.ts index 491bec39..5fb7df3f 100644 --- a/connect/zenodoCommunities/zenodoCommunityInfo.ts +++ b/connect/zenodoCommunities/zenodoCommunityInfo.ts @@ -6,5 +6,4 @@ export class ZenodoCommunityInfo { logoUrl: string; date: Date; page: string; - openaireId:string; } From 1355f2cdb58977cbe859daa67c9f1a5e6bf6a482 Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 14 Jul 2023 13:55:47 +0300 Subject: [PATCH 02/29] remove get communities services - available in community profile update search in projects size and fix count query --- connect/projects/searchProjects.service.ts | 4 ++-- .../searchZenodoCommunities.service.ts | 15 ------------- .../searchZenodoCommunitiesService.module.ts | 21 ------------------- 3 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 connect/zenodoCommunities/searchZenodoCommunities.service.ts delete mode 100644 connect/zenodoCommunities/searchZenodoCommunitiesService.module.ts diff --git a/connect/projects/searchProjects.service.ts b/connect/projects/searchProjects.service.ts index 1d823262..9ddd5996 100644 --- a/connect/projects/searchProjects.service.ts +++ b/connect/projects/searchProjects.service.ts @@ -7,14 +7,14 @@ import {map} from "rxjs/operators"; export class SearchCommunityProjectsService { constructor(private http: HttpClient ) {} - searchProjects (properties:EnvProperties, pid: string, page=0, size=100):any { + searchProjects (properties:EnvProperties, pid: string, page=0, size=500):any { let url = properties.communityAPI+pid+"/projects/"+ page + "/" + size; return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); //.map(res => res.json()) } countTotalProjects(properties:EnvProperties,pid:string) { - let url = properties.communityAPI+pid+"/projects/0/0"; + let url = properties.communityAPI+pid+"/projects/0/1"; return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(res => res['totalElements'])); } diff --git a/connect/zenodoCommunities/searchZenodoCommunities.service.ts b/connect/zenodoCommunities/searchZenodoCommunities.service.ts deleted file mode 100644 index 02fb8fda..00000000 --- a/connect/zenodoCommunities/searchZenodoCommunities.service.ts +++ /dev/null @@ -1,15 +0,0 @@ -import {Injectable} from '@angular/core'; -import {HttpClient} from "@angular/common/http"; -import{EnvProperties} from '../../utils/properties/env-properties'; - -@Injectable() -export class SearchZenodoCommunitiesService { - constructor(private http: HttpClient ) {} - - searchZCommunities (properties:EnvProperties, pid: string):any { - let url = properties.communityAPI+pid+"/zenodocommunities"; - - return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); - //.map(res => res.json()) - } -} diff --git a/connect/zenodoCommunities/searchZenodoCommunitiesService.module.ts b/connect/zenodoCommunities/searchZenodoCommunitiesService.module.ts deleted file mode 100644 index 704bfe82..00000000 --- a/connect/zenodoCommunities/searchZenodoCommunitiesService.module.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { NgModule} from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import {SearchZenodoCommunitiesService} from './searchZenodoCommunities.service'; - - - -@NgModule({ - imports: [ - CommonModule, FormsModule - ], - declarations: [ - ], - providers:[ - SearchZenodoCommunitiesService -], - exports: [ - ] -}) -export class SearchZenodoCommunitiesServiceModule { } From 7354d0ad556f6f0df8d91417690c5138fa9ada1e Mon Sep 17 00:00:00 2001 From: argirok Date: Tue, 18 Jul 2023 14:26:12 +0300 Subject: [PATCH 03/29] update status field values with PUBLIC, RESTRICTED, PRIVATE add methods isPublic, isRestricted, isPrivate instead of using the previous checks --- connect/community/community.service.ts | 6 +++--- connect/community/communityInfo.ts | 11 ++++++++++- connect/connectHelper.ts | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/connect/community/community.service.ts b/connect/community/community.service.ts index 38dfaf87..03f5e327 100644 --- a/connect/community/community.service.ts +++ b/connect/community/community.service.ts @@ -98,14 +98,14 @@ export class CommunityService { community.description = resData.description; community.date = resData.creationDate; community.zenodoCommunity = resData.zenodoCommunity; - community.status = 'all'; + community.status = 'PUBLIC'; community.type = resData.type; community.otherZenodoCommunities = resData.otherZenodoCommunities; if (resData.hasOwnProperty('status')) { community.status = resData.status; const status = ['all', 'hidden', 'manager']; - if (status.indexOf(community['status']) === -1) { - community.status = 'hidden'; + if(!( community.isPrivate() || community.isRestricted() || community.isPublic())) { + community.status = 'PRIVATE'; } } if (resData.subjects != null) { diff --git a/connect/community/communityInfo.ts b/connect/community/communityInfo.ts index 8f1989fd..75daa955 100644 --- a/connect/community/communityInfo.ts +++ b/connect/community/communityInfo.ts @@ -14,7 +14,7 @@ export class CommunityInfo { managers: string[]; date:Date; subjects: string[]; - status:string; + status:"all" | "manager" | "hidden" | "PUBLIC" | "RESTRICTED" | "PRIVATE"; zenodoCommunity:string; otherZenodoCommunities: string[]; isUpload: boolean; @@ -34,5 +34,14 @@ export class CommunityInfo { } return response; } + public isPublic(){ + return this.status == "all" || this.status == "PUBLIC"; + } + public isRestricted(){ + return this.status == "manager" || this.status == "RESTRICTED"; + } + public isPrivate(){ + return this.status == "hidden" || this.status == "PRIVATE"; + } } // export const prodReadyCommunities = ["dh-ch", "ee", "fam", "mes", "ni", "covid-19", "dariah", "epos", "egi"]; diff --git a/connect/connectHelper.ts b/connect/connectHelper.ts index 1fbbc59a..0e65047a 100644 --- a/connect/connectHelper.ts +++ b/connect/connectHelper.ts @@ -54,6 +54,6 @@ export class ConnectHelper { public static isPrivate(community, user) { - return community && (community.status == "hidden" || (community.status == "manager" && !(Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager("community", community.communityId, user)))) + return community && (community.isPrivate() || (community.isRestricted() && !(Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager("community", community.communityId, user)))) } } From c8c5e2d92583cecb61ecd7ce52f2d32d4e07db4e Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 19 Jul 2023 12:57:28 +0300 Subject: [PATCH 04/29] use methods isPublic, isRestricted, isPrivate instead of using the previous checks and add validateStatus method --- connect/communities/communities.service.ts | 5 +---- connect/community/community.service.ts | 5 +---- connect/community/communityInfo.ts | 5 +++++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/connect/communities/communities.service.ts b/connect/communities/communities.service.ts index 299cfe32..c16b439a 100644 --- a/connect/communities/communities.service.ts +++ b/connect/communities/communities.service.ts @@ -58,10 +58,7 @@ export class CommunitiesService { result['status'] = 'all'; if (resData.hasOwnProperty('status')) { result['status'] = resData.status; - const status = ['all', 'hidden', 'manager']; - if (status.indexOf(result['status']) === -1) { - result['status'] = 'hidden'; - } + result.validateStatus(); } if (resData.type != null) { result['type'] = resData.type; diff --git a/connect/community/community.service.ts b/connect/community/community.service.ts index 03f5e327..e9e6ded0 100644 --- a/connect/community/community.service.ts +++ b/connect/community/community.service.ts @@ -103,10 +103,7 @@ export class CommunityService { community.otherZenodoCommunities = resData.otherZenodoCommunities; if (resData.hasOwnProperty('status')) { community.status = resData.status; - const status = ['all', 'hidden', 'manager']; - if(!( community.isPrivate() || community.isRestricted() || community.isPublic())) { - community.status = 'PRIVATE'; - } + community.validateStatus(); } if (resData.subjects != null) { community.subjects = Array.isArray(resData.subjects)?resData.subjects:[resData.subjects]; diff --git a/connect/community/communityInfo.ts b/connect/community/communityInfo.ts index 75daa955..e92ad608 100644 --- a/connect/community/communityInfo.ts +++ b/connect/community/communityInfo.ts @@ -43,5 +43,10 @@ export class CommunityInfo { public isPrivate(){ return this.status == "hidden" || this.status == "PRIVATE"; } + public validateStatus(){ + if(!(this.isPrivate() || this.isRestricted() || this.isPublic())){ + this.status = "PRIVATE"; + } + } } // export const prodReadyCommunities = ["dh-ch", "ee", "fam", "mes", "ni", "covid-19", "dariah", "epos", "egi"]; From ff49c02a52fe6cecd9f662ccc7b232fdeb23c8fd Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 19 Jul 2023 14:25:23 +0300 Subject: [PATCH 05/29] add fields claim and membership --- connect/community/community.service.ts | 2 ++ connect/community/communityInfo.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/connect/community/community.service.ts b/connect/community/community.service.ts index e9e6ded0..06d222e0 100644 --- a/connect/community/community.service.ts +++ b/connect/community/community.service.ts @@ -99,6 +99,8 @@ export class CommunityService { community.date = resData.creationDate; community.zenodoCommunity = resData.zenodoCommunity; community.status = 'PUBLIC'; + community.claim = resData.claim; + community.membership = resData.membership; community.type = resData.type; community.otherZenodoCommunities = resData.otherZenodoCommunities; if (resData.hasOwnProperty('status')) { diff --git a/connect/community/communityInfo.ts b/connect/community/communityInfo.ts index e92ad608..1185f8d1 100644 --- a/connect/community/communityInfo.ts +++ b/connect/community/communityInfo.ts @@ -15,6 +15,8 @@ export class CommunityInfo { date:Date; subjects: string[]; status:"all" | "manager" | "hidden" | "PUBLIC" | "RESTRICTED" | "PRIVATE"; + claim: "all" | "managersOnly" | "membersOnly"; + membership: "open" | "byInvitation"; zenodoCommunity:string; otherZenodoCommunities: string[]; isUpload: boolean; From 8310eddd92bd4c1b72b247619a54dfa5235971f6 Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 28 Jul 2023 13:15:46 +0300 Subject: [PATCH 06/29] update check in portal search results --- searchPages/searchUtils/portal-search-result.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searchPages/searchUtils/portal-search-result.component.html b/searchPages/searchUtils/portal-search-result.component.html index 9c202293..7be77b69 100644 --- a/searchPages/searchUtils/portal-search-result.component.html +++ b/searchPages/searchUtils/portal-search-result.component.html @@ -8,11 +8,11 @@ Member
-
+
restricted
- + private From 116ead698b65f5cb1203c3e5796f10a2245ac40f Mon Sep 17 00:00:00 2001 From: argirok Date: Tue, 1 Aug 2023 12:25:46 +0300 Subject: [PATCH 07/29] Linking: check the claim field for its community before add it in the list of the communities that can be claimed. Allow all for connect and claim curators --- .../claimContextSearchForm.component.ts | 31 ++++++++++++++----- connect/communities/communities.service.ts | 2 ++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/claims/claim-utils/claimContextSearchForm.component.ts b/claims/claim-utils/claimContextSearchForm.component.ts index 95289d97..d48540e8 100644 --- a/claims/claim-utils/claimContextSearchForm.component.ts +++ b/claims/claim-utils/claimContextSearchForm.component.ts @@ -7,8 +7,8 @@ import {LoginErrorCodes} from '../../login/utils/guardHelper.class'; import {EnvProperties} from '../../utils/properties/env-properties'; import {Subscriber} from "rxjs"; import {OpenaireEntities} from "../../utils/properties/searchFields"; -import {CommunityService} from "../../connect/community/community.service"; import {CommunitiesService} from "../../connect/communities/communities.service"; +import {UserManagementService} from "../../services/user-management.service"; declare var UIkit: any; @@ -49,9 +49,14 @@ export class ClaimContextSearchFormComponent { keyword = ""; subscriptions = []; communityLogos = {}; + communityIds = []; + user = null; ngOnInit() { this.entitiesSelectOptions = this.showOptions.selectOptions; //get community logos + this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { + this.user = user; + this.subscriptions.push(this._communitiesService.getCommunities(this.properties, this.properties.communityAPI+"/communities/").subscribe( communitiesResults => { if(communitiesResults!=null) { @@ -61,6 +66,13 @@ export class ClaimContextSearchFormComponent { this.communityLogos[community.communityId] = community; } } + this.communityIds = communitiesResults.filter(community => { + return community.claim == "all" || + Session.isCommunityCurator(this.user) || + Session.isClaimsCurator(this.user) || + (community.claim == "membersOnly" && Session.isSubscribedTo("community", community.communityId,this.user)) || + (community.claim == "managersOnly" && Session.isManager("community", community.communityId,this.user)) + }).map(community => community.communityId); this.getCommunities(); } }, @@ -68,6 +80,10 @@ export class ClaimContextSearchFormComponent { this.getCommunities(); } )); + + }, error => { + + })); } ngOnDestroy() { @@ -77,7 +93,7 @@ export class ClaimContextSearchFormComponent { } }); } - constructor(private _contextService: ContextsService, private router: Router, private _communitiesService: CommunitiesService) { + constructor(private _contextService: ContextsService, private router: Router, private _communitiesService: CommunitiesService, private userManagementService: UserManagementService,) { } @@ -172,15 +188,16 @@ export class ClaimContextSearchFormComponent { } else { this.loading = true; - this.subscriptions.push(this._contextService.getPublicCommunitiesByState().subscribe( + this.subscriptions.push(this._contextService.getCommunitiesByState().subscribe( data => { - this.communities = data; - console.log(this.communities) + this.communities = data.filter(community => { + return this.communityIds.indexOf(community.id) != -1 + }); if (this.communities.length > 0) { - this.communities.sort((n1, n2) => n1.label > n2.label); + this.communities.sort((n1, n2) => n1.title > n2.title); } this.loading = false; - if (this.communityId != null) { + if (this.communityId != null && this.communityIds.indexOf(this.communityId) != -1) { //preselect community this.selectedCommunityId = this.communityId; for (let i = 0; i < this.communities.length; i++) { diff --git a/connect/communities/communities.service.ts b/connect/communities/communities.service.ts index c16b439a..05f427a6 100644 --- a/connect/communities/communities.service.ts +++ b/connect/communities/communities.service.ts @@ -56,6 +56,8 @@ export class CommunitiesService { result['description'] = resData.description; result['date'] = resData.creationDate; result['status'] = 'all'; + result['claim'] = resData.claim; + result['membership'] = resData.membership; if (resData.hasOwnProperty('status')) { result['status'] = resData.status; result.validateStatus(); From 741a70fa1c236c83d96c4135063ef6bc8b0c431e Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 7 Sep 2023 14:57:07 +0300 Subject: [PATCH 08/29] register the icons book, cog, database, earth in ResultLandingUtilsModule --- landingPages/landing-utils/resultLandingUtils.module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/landingPages/landing-utils/resultLandingUtils.module.ts b/landingPages/landing-utils/resultLandingUtils.module.ts index 05869cf7..7ae62115 100644 --- a/landingPages/landing-utils/resultLandingUtils.module.ts +++ b/landingPages/landing-utils/resultLandingUtils.module.ts @@ -19,7 +19,7 @@ import {AlertModalModule} from "../../utils/modal/alertModal.module"; import { SearchInputModule } from '../../sharedComponents/search-input/search-input.module'; import {EntityMetadataComponent} from "./entity-metadata.component"; import {IconsService} from "../../utils/icons/icons.service"; -import {closed_access, open_access, unknown_access} from "../../utils/icons/icons"; +import {book, closed_access, cog, database, earth, open_access, unknown_access} from "../../utils/icons/icons"; import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module"; import {MobileDropdownModule} from "../../utils/mobile-dropdown/mobile-dropdown.module"; @@ -45,6 +45,6 @@ import {MobileDropdownModule} from "../../utils/mobile-dropdown/mobile-dropdown. }) export class ResultLandingUtilsModule { constructor(private iconsService: IconsService) { - this.iconsService.registerIcons([open_access, closed_access, unknown_access]); + this.iconsService.registerIcons([open_access, closed_access, unknown_access, book, cog, database, earth]); } } From f6793857253fa5ca79e9576b25d0f8d0f67d3835 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 11 Sep 2023 18:08:34 +0300 Subject: [PATCH 09/29] [Library | develop]: transferData.component.ts: Keep data transfer modal open after transfer action, to show status of the transfer. --- utils/dataTransfer/transferData.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/dataTransfer/transferData.component.ts b/utils/dataTransfer/transferData.component.ts index 0c250dfe..4ca426d9 100644 --- a/utils/dataTransfer/transferData.component.ts +++ b/utils/dataTransfer/transferData.component.ts @@ -152,6 +152,7 @@ export class EGIDataTransferComponent { this.init(); if(!this.isMobile) { + this.egiTransferModal.stayOpen = true; // this.egiTransferModal.back = true; this.egiTransferModal.cancelButton = false; this.egiTransferModal.okButton = true; From 6958a8ef9b2e76d689ba0fc161bce5e4b4a45a87 Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 18 Sep 2023 12:23:33 +0300 Subject: [PATCH 10/29] fix parameter for grant openaire access to Orcid --- orcid/my-orcid-links/myOrcidLinks.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orcid/my-orcid-links/myOrcidLinks.component.ts b/orcid/my-orcid-links/myOrcidLinks.component.ts index d77e14a4..5fbe58b8 100644 --- a/orcid/my-orcid-links/myOrcidLinks.component.ts +++ b/orcid/my-orcid-links/myOrcidLinks.component.ts @@ -163,7 +163,7 @@ export class MyOrcidLinksComponent { if(typeof document !== 'undefined') { this.tokenUrl = properties.orcidTokenURL - + "clientid="+properties.orcidClientId + + "client_id=" + properties.orcidClientId // + "&response_type=code&scope=/activities/update" // + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited" + "&response_type=code&scope=/activities/update /read-limited" From 82348a8a3b9a486a7174cfae34b06ddea7edfc1a Mon Sep 17 00:00:00 2001 From: argirok Date: Tue, 19 Sep 2023 15:59:37 +0300 Subject: [PATCH 11/29] update manage projects page to use paging and search through new communities API --- connect/projects/searchProjects.service.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/connect/projects/searchProjects.service.ts b/connect/projects/searchProjects.service.ts index 9ddd5996..16715225 100644 --- a/connect/projects/searchProjects.service.ts +++ b/connect/projects/searchProjects.service.ts @@ -7,11 +7,16 @@ import {map} from "rxjs/operators"; export class SearchCommunityProjectsService { constructor(private http: HttpClient ) {} - searchProjects (properties:EnvProperties, pid: string, page=0, size=500):any { - let url = properties.communityAPI+pid+"/projects/"+ page + "/" + size; - + searchProjects (properties:EnvProperties, pid: string, page=1, size=500):any { + this.searchProjectsWithPaging(properties,pid,page, size, null, null); + } + searchProjectsWithPaging (properties:EnvProperties, pid: string, page=1, size=500, searchFilter, funder):any { + let params = funder ? ["funder="+ funder] :[]; + if (searchFilter) { + params.push("searchFilter="+ searchFilter) + } + let url = properties.communityAPI+pid+"/projects/"+ (page-1) + "/" + size + (params.length > 0?"?" + params.join("&"):""); return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); - //.map(res => res.json()) } countTotalProjects(properties:EnvProperties,pid:string) { let url = properties.communityAPI+pid+"/projects/0/1"; From adae1f074953b1316956cd7a7964a5bb76933426 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 19 Sep 2023 16:38:16 +0300 Subject: [PATCH 12/29] [Library | develop]: searchProjects.service.ts: Added more checks if startdate and enddate properties exist in the response | entity-metadata.component.ts: Added "From" or "Until" before startYear and endYear respectively when only one of them exists in data. --- landingPages/landing-utils/entity-metadata.component.ts | 4 ++-- services/searchProjects.service.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/landingPages/landing-utils/entity-metadata.component.ts b/landingPages/landing-utils/entity-metadata.component.ts index c15f50e0..aba2fc82 100644 --- a/landingPages/landing-utils/entity-metadata.component.ts +++ b/landingPages/landing-utils/entity-metadata.component.ts @@ -60,10 +60,10 @@ import {RouterHelper} from "../../utils/routerHelper.class"; {{year}} - {{startYear}} + From {{startYear}} - {{endYear}} + Until {{endYear}} diff --git a/services/searchProjects.service.ts b/services/searchProjects.service.ts index 2109666f..b513b737 100644 --- a/services/searchProjects.service.ts +++ b/services/searchProjects.service.ts @@ -248,10 +248,10 @@ export class SearchProjectsService { } } } - if(resData.hasOwnProperty("startdate")) { + if(resData.hasOwnProperty("startdate") && resData['startdate']) { result.startYear = resData.startdate.split('-')[0]; } - if(resData.hasOwnProperty("enddate")) { + if(resData.hasOwnProperty("enddate") && resData['enddate']) { result.endYear = resData.enddate.split('-')[0]; } // Measure From be187c3fed3aac65731a9f7d7a1e10efa7a78346 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 19 Sep 2023 16:40:56 +0300 Subject: [PATCH 13/29] [Library | develop]: citation.class.ts: Updated bibtex to include case for type="software" - add @software instead of @misc. --- landingPages/landing-utils/citeThis/citation.class.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/landingPages/landing-utils/citeThis/citation.class.ts b/landingPages/landing-utils/citeThis/citation.class.ts index 986b9244..03a3766c 100644 --- a/landingPages/landing-utils/citeThis/citation.class.ts +++ b/landingPages/landing-utils/citeThis/citation.class.ts @@ -6,7 +6,7 @@ export class Citation{ public fileSuffix:string[]=[".bib", ".ris"]; public fileFormatOptions: Option[]=[{label: "bibtex (.bib)", value: "bibtex"}, {label: "ris (.ris)", value: "ris"}]; //https://github.com/citation-style-language/styles - bibtex:string =``; + bibtex:string =``; ieee:string =` `; chicago:string =` `; science:string =' '; From 46a8928a208989cc37b5ec416745148fd8b05e0d Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 19 Sep 2023 16:45:17 +0300 Subject: [PATCH 14/29] [Library | develop]: project.component.ts: [Bug fix] In method "getProjectInfo()", added this.projectInfo.id = this.projectId; - direct link action button was not working, id was missing. --- landingPages/project/project.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 34936cd8..4e7eb8ba 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -464,6 +464,7 @@ export class ProjectComponent { this.subscriptions.push(this._projectService.getProjectInfo(id, this.properties).subscribe( data => { this.projectInfo = data; + this.projectInfo.id = this.projectId; this.actionsAfterGettingProjectInfo(); }, From bc514b62d121ec7e1e7a06b5c016d99bf72c5fc6 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 19 Sep 2023 16:48:08 +0300 Subject: [PATCH 15/29] [Library | develop]: result-preview.component.ts: Added method "isNumber()" | resultLanding.component.html: [Bug fix] Updated view of bip indicators - format the numbers correctly. --- utils/result-preview/result-preview.component.html | 8 +++++--- utils/result-preview/result-preview.component.ts | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index d8608abb..04f65a8f 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -214,7 +214,8 @@ - {{result.measure.bip[0].value}} + {{formatNumber(result.measure.bip[0].value)}} + {{result.measure.bip[0].value}}
@@ -223,7 +224,8 @@ - + +
{{metric.name}}{{metric.value}}{{metric.value | number}}{{metric.value}}
@@ -252,7 +254,7 @@
Powered by BIP! + loading="lazy" alt="Usage counts">
diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index 9c041854..6352e9b9 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -223,6 +223,10 @@ export class ResultPreviewComponent implements OnInit, OnChanges { return formatted.number + formatted.size; } + public isNumber(value): boolean { + return typeof value === 'number'; + } + public getAccessLabel(accessRight) : string { if(accessRight) { return (accessRight + (accessRight.toLowerCase().endsWith(" access") ? "" : " access")); From 966dedde45872fee8f9e55d90d7dbb0e367c9c75 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 20 Sep 2023 10:48:20 +0300 Subject: [PATCH 16/29] [Library | develop]: searchSorting.component.ts: Added sorting options (generalOptions), "citation_count,descending", "popularity,descending", "influence,descending", "impulse,descending" | searchResearchResults.component.ts: Added the new sorting options in the checks. --- searchPages/searchResearchResults.component.ts | 4 +++- searchPages/searchUtils/searchSorting.component.ts | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/searchPages/searchResearchResults.component.ts b/searchPages/searchResearchResults.component.ts index 5e4e3c59..f4f03fa7 100644 --- a/searchPages/searchResearchResults.component.ts +++ b/searchPages/searchResearchResults.component.ts @@ -160,7 +160,9 @@ export class SearchResearchResultsComponent { this.searchUtils.validateSize(params['size']); this.searchUtils.sortBy = (params['sortBy']) ? params['sortBy'] : ''; - if (this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending") { + if (this.searchUtils.sortBy && this.searchUtils.sortBy != "resultdateofacceptance,descending" && this.searchUtils.sortBy != "resultdateofacceptance,ascending" + && this.searchUtils.sortBy != "citation_count,descending" && this.searchUtils.sortBy != "popularity,descending" + && this.searchUtils.sortBy != "influence,descending" && this.searchUtils.sortBy != "impulse,descending") { this.searchUtils.sortBy = ""; } this.selectedFields = []; diff --git a/searchPages/searchUtils/searchSorting.component.ts b/searchPages/searchUtils/searchSorting.component.ts index f70ac1cf..7a1e7fe8 100644 --- a/searchPages/searchUtils/searchSorting.component.ts +++ b/searchPages/searchUtils/searchSorting.component.ts @@ -23,6 +23,10 @@ export class SearchSortingComponent { {value: '', label: 'Relevance'}, {value: 'resultdateofacceptance,descending', label: 'Date (most recent)'}, {value: 'resultdateofacceptance,ascending', label: 'Date (least recent)'}, + {value: 'citation_count,descending', label: 'Citation Count'}, + {value: 'popularity,descending', label: 'Popularity'}, + {value: 'influence,descending', label: 'Influence'}, + {value: 'impulse,descending', label: 'Impulse'} ]; private communityOptions = [ {value: '', label: 'Title'}, From 0d22ba8a3b119c43537e94317b4f2a0f4b35757b Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 20 Sep 2023 14:13:34 +0300 Subject: [PATCH 17/29] [Library | develop]: searchSorting.component.ts: Do not add new sorting options in production yet. --- .../searchUtils/searchSorting.component.ts | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/searchPages/searchUtils/searchSorting.component.ts b/searchPages/searchUtils/searchSorting.component.ts index 7a1e7fe8..e75e3930 100644 --- a/searchPages/searchUtils/searchSorting.component.ts +++ b/searchPages/searchUtils/searchSorting.component.ts @@ -1,5 +1,6 @@ import {Component, Input, Output, EventEmitter} from '@angular/core'; import {Option} from "../../sharedComponents/input/input.component"; +import {properties} from "../../../../environments/environment"; @Component({ selector: 'search-sorting', @@ -19,15 +20,21 @@ export class SearchSortingComponent { @Input() entityType: string = ''; @Output() sortByChange = new EventEmitter(); public options: Option[]; - private generalOptions = [ - {value: '', label: 'Relevance'}, - {value: 'resultdateofacceptance,descending', label: 'Date (most recent)'}, - {value: 'resultdateofacceptance,ascending', label: 'Date (least recent)'}, - {value: 'citation_count,descending', label: 'Citation Count'}, - {value: 'popularity,descending', label: 'Popularity'}, - {value: 'influence,descending', label: 'Influence'}, - {value: 'impulse,descending', label: 'Impulse'} - ]; + private generalOptions = properties.environment != "production" ? + [ + {value: '', label: 'Relevance'}, + {value: 'resultdateofacceptance,descending', label: 'Date (most recent)'}, + {value: 'resultdateofacceptance,ascending', label: 'Date (least recent)'}, + {value: 'citation_count,descending', label: 'Citation Count'}, + {value: 'popularity,descending', label: 'Popularity'}, + {value: 'influence,descending', label: 'Influence'}, + {value: 'impulse,descending', label: 'Impulse'} + ] : + [ + {value: '', label: 'Relevance'}, + {value: 'resultdateofacceptance,descending', label: 'Date (most recent)'}, + {value: 'resultdateofacceptance,ascending', label: 'Date (least recent)'} + ]; private communityOptions = [ {value: '', label: 'Title'}, {value: 'creationdate,descending', label: 'Creation Date (most recent)'}, From d10df32853e4ffa29add4447f5a69ea1b8e8722f Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 26 Sep 2023 11:38:09 +0300 Subject: [PATCH 18/29] Result Preview: Fix space betwwen ngIf and class. --- utils/result-preview/result-preview.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 04f65a8f..c4574c8d 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -225,7 +225,7 @@ {{metric.name}} {{metric.value | number}} - {{metric.value}} + {{metric.value}}
From af95b395bd24f102b3ec967c05b5a6d0bd2fbc57 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Mon, 2 Oct 2023 12:18:29 +0300 Subject: [PATCH 19/29] search page: add view more option for partners, projects, match styling for authors as well --- .../entity-metadata.component.ts | 111 +++++++++++++++++- utils/authors/showAuthors.component.ts | 2 +- 2 files changed, 106 insertions(+), 7 deletions(-) diff --git a/landingPages/landing-utils/entity-metadata.component.ts b/landingPages/landing-utils/entity-metadata.component.ts index aba2fc82..caad8627 100644 --- a/landingPages/landing-utils/entity-metadata.component.ts +++ b/landingPages/landing-utils/entity-metadata.component.ts @@ -1,4 +1,4 @@ -import {Component, Input} from "@angular/core"; +import {Component, Input, ViewChild} from "@angular/core"; import {EnvProperties} from "../../utils/properties/env-properties"; import {properties} from "../../../../environments/environment"; import {OpenaireEntities} from "../../utils/properties/searchFields"; @@ -151,12 +151,32 @@ import {RouterHelper} from "../../utils/routerHelper.class"; Thematic - - {{projectNames.slice(0,3).join(', ')}} + + {{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}} + + + +{{projects.length - projectsLimit | number}} projects + + + View less + + - - {{organizationNames.slice(0, 3).join(', ')}} + + {{showInline ? organizationNames.join(', ') : organizationNames.slice(0, organizationsLimit).join(', ')}} + + + +{{organizations.length - organizationsLimit | number}} partners + + + View less + + @@ -169,10 +189,37 @@ import {RouterHelper} from "../../utils/routerHelper.class"; {{relationName}}
+ + + + +
+ +
+ {{item.name}}{{i == organizations.length - 1 ? '' : ','}} +
+
+
+
+ + +
+ +
+ {{item['funderShortname'] ? item['funderShortname'] : item['funderName']}} + [no funder available] + | {{ item['acronym'] ? item['acronym'] : item['title']}} + {{i == projects.length - 1 ? '' : ','}} +
+
+
+
`, styleUrls: ['entity-metadata.component.less'] }) export class EntityMetadataComponent { + @Input() isMobile: boolean = false; @Input() entityType: string; @Input() types: string[]; @Input() year: string; // search result @@ -204,6 +251,14 @@ export class EntityMetadataComponent { @Input() subjects: string[]; @Input() prevPath: string = ""; + @ViewChild('partnersModal') partnersModal; + @ViewChild('projectsModal') projectsModal; + + organizationsLimit: number = 5; + projectsLimit: number = 3; + showInline: boolean = false; + lessBtn: boolean = false; + properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; public routerHelper: RouterHelper = new RouterHelper(); @@ -260,4 +315,48 @@ export class EntityMetadataComponent { } return obj; } -} + + public viewAllPartnersClick() { + if(this.organizations.length <= this.organizationsLimit * 2) { + this.showInline = true; + this.lessBtn = true; + } else { + this.openPartnersModal(); + } + } + + public openPartnersModal() { + if (this.isMobile) { + this.partnersModal.okButton = false; + this.partnersModal.title = "Partners"; + this.partnersModal.open(); + } else { + this.partnersModal.cancelButton = false; + this.partnersModal.okButton = false; + this.partnersModal.alertTitle = "Partners"; + this.partnersModal.open(); + } + } + + public viewAllProjectsClick() { + if(this.projects.length <= this.projectsLimit * 2) { + this.showInline = true; + this.lessBtn = true; + } else { + this.openProjectsModal(); + } + } + + public openProjectsModal() { + if (this.isMobile) { + this.projectsModal.okButton = false; + this.projectsModal.title = "Projects"; + this.projectsModal.open(); + } else { + this.projectsModal.cancelButton = false; + this.projectsModal.okButton = false; + this.projectsModal.alertTitle = "Projects"; + this.projectsModal.open(); + } + } +} \ No newline at end of file diff --git a/utils/authors/showAuthors.component.ts b/utils/authors/showAuthors.component.ts index a9987197..42296345 100644 --- a/utils/authors/showAuthors.component.ts +++ b/utils/authors/showAuthors.component.ts @@ -109,7 +109,7 @@ import {properties} from "../../../../environments/environment"; +{{authors.length - authorsLimit | number}} more - + +{{authors.length - authorsLimit | number}} Authors From edf8ae835c66c52f1c2282bc01eff53dcd945766 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 2 Oct 2023 13:13:22 +0300 Subject: [PATCH 20/29] [Library | develop] fos/fos.component.ts & landing-utilts/fos.component.ts & searchFields.ts: Restored checks for environment to use fos or foslabel field - foslabel not yet introduced in current prod index. --- fos/fos.component.ts | 3 ++- landingPages/landing-utils/fos.component.ts | 6 ++++-- utils/properties/searchFields.ts | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fos/fos.component.ts b/fos/fos.component.ts index c02b6bed..043e7bd5 100644 --- a/fos/fos.component.ts +++ b/fos/fos.component.ts @@ -216,6 +216,7 @@ export class FosComponent implements OnInit, OnDestroy { } public buildFosQueryParam(fos) { - return {'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}; + // return {'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}; + return (properties.environment !== 'production' ? ({'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}) : ({'fos': this.urlEncodeAndQuote(fos.id)})); } } diff --git a/landingPages/landing-utils/fos.component.ts b/landingPages/landing-utils/fos.component.ts index 4dfc59e6..ba95bdc8 100644 --- a/landingPages/landing-utils/fos.component.ts +++ b/landingPages/landing-utils/fos.component.ts @@ -121,10 +121,12 @@ export class FosComponent { } public buildFosQueryParam(fos) { - return {'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}; + // return {'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}; + return (properties.environment !== 'production' ? ({'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}) : ({'fos': this.urlEncodeAndQuote(fos.id)})); } public buildFosHrefParam(fos): string { - return ('foslabel='+this.urlEncodeAndQuote(fos.id+"||"+fos.label)); + // return ('foslabel='+this.urlEncodeAndQuote(fos.id+"||"+fos.label)); + return (properties.environment !== 'production' ? ('foslabel='+this.urlEncodeAndQuote(fos.id+"||"+fos.label)) : ('fos='+this.urlEncodeAndQuote(fos.id))); } } diff --git a/utils/properties/searchFields.ts b/utils/properties/searchFields.ts index 7ae0fcda..65ca6a4b 100644 --- a/utils/properties/searchFields.ts +++ b/utils/properties/searchFields.ts @@ -14,7 +14,7 @@ export class SearchFields { // Remove Collected From Filter "collectedfrom","collectedfrom" public RESULT_REFINE_FIELDS = [ - "resultbestaccessright", "instancetypename", "foslabel", "relfunder", + "resultbestaccessright", "instancetypename", properties.environment!='production'?"foslabel":'fos', "relfunder", "relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id", "relproject", "sdg", "country", "resultlanguagename", "resulthostingdatasource", "community"]; From d2248f4b8415fc664e7f137ad7fe522c098e3d9b Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 2 Oct 2023 15:11:35 +0300 Subject: [PATCH 21/29] fix return in SearchCommunityProjectsService --- connect/projects/searchProjects.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connect/projects/searchProjects.service.ts b/connect/projects/searchProjects.service.ts index 16715225..a94616da 100644 --- a/connect/projects/searchProjects.service.ts +++ b/connect/projects/searchProjects.service.ts @@ -8,7 +8,7 @@ export class SearchCommunityProjectsService { constructor(private http: HttpClient ) {} searchProjects (properties:EnvProperties, pid: string, page=1, size=500):any { - this.searchProjectsWithPaging(properties,pid,page, size, null, null); + return this.searchProjectsWithPaging(properties,pid,page, size, null, null); } searchProjectsWithPaging (properties:EnvProperties, pid: string, page=1, size=500, searchFilter, funder):any { let params = funder ? ["funder="+ funder] :[]; From 5e7d10b96b6f2e0011360517cd3cde1dfe6fd3f7 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 4 Oct 2023 16:04:42 +0300 Subject: [PATCH 22/29] Community projects: add filtering and sorting --- connect/projects/searchProjects.service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/connect/projects/searchProjects.service.ts b/connect/projects/searchProjects.service.ts index 16715225..46da3044 100644 --- a/connect/projects/searchProjects.service.ts +++ b/connect/projects/searchProjects.service.ts @@ -10,11 +10,12 @@ export class SearchCommunityProjectsService { searchProjects (properties:EnvProperties, pid: string, page=1, size=500):any { this.searchProjectsWithPaging(properties,pid,page, size, null, null); } - searchProjectsWithPaging (properties:EnvProperties, pid: string, page=1, size=500, searchFilter, funder):any { + searchProjectsWithPaging (properties:EnvProperties, pid: string, page=1, size=500, searchFilter, funder, orderBy = "name"):any { let params = funder ? ["funder="+ funder] :[]; if (searchFilter) { params.push("searchFilter="+ searchFilter) } + params.push("orderBy="+ orderBy); let url = properties.communityAPI+pid+"/projects/"+ (page-1) + "/" + size + (params.length > 0?"?" + params.join("&"):""); return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url); } @@ -23,4 +24,8 @@ export class SearchCommunityProjectsService { return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(res => res['totalElements'])); } + getProjectFunders(properties:EnvProperties,pid:string) { + let url = properties.communityAPI+pid+"/funders"; + return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); + } } From 1c5a0b22a8bd977eb77edded7f00ad3b56edccf6 Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 5 Oct 2023 14:31:37 +0300 Subject: [PATCH 23/29] restrict links to user roles management to portal Admins --- login/user.component.html | 8 ++++---- login/user.component.ts | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/login/user.component.html b/login/user.component.html index a69412e4..45cb0d51 100644 --- a/login/user.component.html +++ b/login/user.component.html @@ -17,13 +17,13 @@
Roles {{getTheRolesFormatted(user.role)}}
- diff --git a/login/user.component.ts b/login/user.component.ts index e279b7b6..f95adf67 100644 --- a/login/user.component.ts +++ b/login/user.component.ts @@ -100,12 +100,9 @@ export class UserComponent { return formattedRoles.join(", "); } - get isCurator() { - return Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user); + get isPortalAdministrator() { + return Session.isPortalAdministrator(this.user); } - get isUserManager() { - return Session.isUserManager(this.user); - } } From 445441572d30bb2c6cd889abfb62bc225e87de98 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 6 Oct 2023 12:22:00 +0300 Subject: [PATCH 24/29] [Library & Explore | develop]: Added software heritage as pid for research products. 1. environments/: Added in all environments, property: swhURL: "https://archive.softwareheritage.org/". 2. env-properties.ts: Added property swhURL?: string; 3. string-utils.class.ts: Added method "isValidSwhId()" and swhid in checks and definitions. 4. resultLandingInfo.ts: Added swhid in accepted types of interface Id. 5. resultLanding.component.ts: Added check for swhid in "getReferenceIdName()" and "getReferenceUrl()". 6. parsingFunctions.class.ts: Added pid[i].classid == "swhid" check in "parseIdentifiers()". 7. showIdentifiers.component.ts: Added "swhid" in display of pids. --- landingPages/landing-utils/parsingFunctions.class.ts | 6 ++++-- .../landing-utils/showIdentifiers.component.ts | 4 +++- landingPages/result/resultLanding.component.ts | 4 ++++ utils/entities/resultLandingInfo.ts | 2 +- utils/properties/env-properties.ts | 1 + utils/string-utils.class.ts | 12 ++++++++++-- 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index fd2c3b12..faeaaada 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -514,7 +514,8 @@ export class ParsingFunctions { let identifiers = new Map(); if (pid.hasOwnProperty("classid") && pid['classid'] != "") { - if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data") { + if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data" + || pid.classid == "swhid") { if (!identifiers.has(pid.classid)) { identifiers.set(pid.classid, new Array()); } @@ -522,7 +523,8 @@ export class ParsingFunctions { } } else { for (let i = 0; i < pid.length; i++) { - if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data") { + if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data" + || pid[i].classid == "swhid") { if (!identifiers.has(pid[i].classid)) { identifiers.set(pid[i].classid, new Array()); } diff --git a/landingPages/landing-utils/showIdentifiers.component.ts b/landingPages/landing-utils/showIdentifiers.component.ts index e4644c34..8a0b4680 100644 --- a/landingPages/landing-utils/showIdentifiers.component.ts +++ b/landingPages/landing-utils/showIdentifiers.component.ts @@ -26,7 +26,7 @@ import {properties} from "../../../../environments/environment"; {{key}}: - {{item}} @@ -124,6 +124,8 @@ export class ShowIdentifiersComponent implements AfterViewInit { return properties.handleURL; } else if(key == "re3data") { return properties.r3DataURL; + } else if(key == "swhid") { + return properties.swhURL; } } diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 932901d7..9ba1309b 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -825,6 +825,8 @@ export class ResultLandingComponent { return this.properties.pmidURL + id.value; } else if (id.type === "handle") { return this.properties.handleURL + id.value; + } else if (id.type === "swhid") { + return this.properties.swhURL + id.value; } else { return null; } @@ -839,6 +841,8 @@ export class ResultLandingComponent { return 'PubMed'; } else if (id.type === "handle") { return 'Handle.NET'; + } else if(id.type == "swhid") { + return 'Software Heritage'; } else { return null; } diff --git a/utils/entities/resultLandingInfo.ts b/utils/entities/resultLandingInfo.ts index 0ae3866f..30e1e76b 100644 --- a/utils/entities/resultLandingInfo.ts +++ b/utils/entities/resultLandingInfo.ts @@ -8,7 +8,7 @@ import { } from "../result-preview/result-preview"; export interface Id { - type: "pmid" | "doi" | "pmc" | "handle" | "openaire"; + type: "pmid" | "doi" | "pmc" | "handle" | "openaire" | "swhid"; value: string; trust: number } diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index af367504..4a2ccd68 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -44,6 +44,7 @@ export interface EnvProperties { cordisURL?: string; openDoarURL?: string; r3DataURL?: string; + swhURL?: string; fairSharingURL?: string, eoscMarketplaceURL?: string, sherpaURL?: string; diff --git a/utils/string-utils.class.ts b/utils/string-utils.class.ts index d05bc57e..dff363ff 100644 --- a/utils/string-utils.class.ts +++ b/utils/string-utils.class.ts @@ -149,7 +149,7 @@ export class DOI { } export class Identifier { - class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" | "re3data" = null; + class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" | "re3data" | "swhid" = null; id: string; public static getDOIsFromString(str: string): string[] { @@ -202,13 +202,15 @@ export class Identifier { return {"class": "handle", "id": pid}; } else if (Identifier.isValidRe3Data(pid)) { return {"class": "re3data", "id": pid}; + } else if (Identifier.isValidSwhId(pid)) { + return {"class": "swhid", "id": pid}; } //set it as a doi, to catch the case that doi has not valid format return (strict?null:{"class": "doi", "id": pid}); } public static getPIDFromIdentifiers(identifiers: Map): Identifier { - let classes:string [] = ["doi", "handle", "pmc", "pmid", "re3data"]; + let classes:string [] = ["doi", "handle", "pmc", "pmid", "re3data", "swhid"]; if(identifiers) { for (let cl of classes) { if (identifiers.get(cl)) { @@ -257,6 +259,12 @@ export class Identifier { let exp = /(r3d[1-9]\d{0,8})/g; return str.match(exp) != null; } + + public static isValidSwhId(str: string): boolean { + // let exp = /swh:1:(snp|rel|rev|dir|cnt):[0-9a-f]{40}/g; + let exp = /swh:1:snp:[0-9a-f]{40}/g; + return str.match(exp) != null; + } } export class StringUtils { From c12916583247fc225ee49c4851b8b4183edc2be0 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 10 Oct 2023 12:25:03 +0300 Subject: [PATCH 25/29] CommunityInfo: Add isOpen method. Email Composer: Add role in community dashboard invitation. --- connect/community/communityInfo.ts | 6 ++++++ utils/email/composer.ts | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/connect/community/communityInfo.ts b/connect/community/communityInfo.ts index 1185f8d1..67904a2d 100644 --- a/connect/community/communityInfo.ts +++ b/connect/community/communityInfo.ts @@ -1,6 +1,7 @@ import {StringUtils} from "../../utils/string-utils.class"; import {properties} from "../../../../environments/environment"; import {SelectionCriteria} from "../../utils/entities/contentProvider"; +import tryThese = CKEDITOR.tools.tryThese; export class CommunityInfo { title: string; @@ -36,6 +37,11 @@ export class CommunityInfo { } return response; } + + public isOpen() { + return !(this.membership && this.membership === 'byInvitation'); + } + public isPublic(){ return this.status == "all" || this.status == "PUBLIC"; } diff --git a/utils/email/composer.ts b/utils/email/composer.ts index 6fead2f0..d2df6d38 100644 --- a/utils/email/composer.ts +++ b/utils/email/composer.ts @@ -302,21 +302,23 @@ export class Composer { return message; } - public static composeEmailForCommunityDashboard(name: string, recipient: string) { + public static composeEmailForCommunityDashboard(name: string, role: "manager" | "member", recipient: string) { let email: Email = new Email(); email.subject = 'OpenAIRE Connect | ' + name; - email.body = this.composeMessageForCommunityDashboard(name); + email.body = this.composeMessageForCommunityDashboard(name, role); email.recipient = recipient; return email; } - public static composeMessageForCommunityDashboard(name: string, user: string = null, invitation: any = null) { + public static composeMessageForCommunityDashboard(name: string, role: "manager" | "member", user: string = null, invitation: any = null) { let message = '

Dear ((__user__)),

' + - '

You have been invited to be a manager of the OpenAIRE Research Community Dashboard for the ' + name + '.

' + + '

You have been invited to be a ' + role + ' of the OpenAIRE Research Community Dashboard for the ' + name + '.

' + '

Click this URL and use the verification code below to accept the invitation.

' + '

The verification code is ((__code__)).

' + + (role === 'manager'? '

As a manager of the OpenAIRE Research Community Dashboard, you will have access to the administration part of the dashboard, ' + - 'where you will be able to customize and manage the content of the ' + name + '.

' + + 'where you will be able to customize and manage the content of the ' + name + '.

': + '

As a member of the OpenAIRE Research Community Dashboard, you will have access to the community dashboard and link research results with projects, communities and other research projects.

') + '

Please contact us at ' + properties.helpdeskEmail + ' if you have any questions or concerns.

' + '

Kind Regards
The OpenAIRE Team

' + From a30ec46a89d772c2d4fae2a63e5c852285cb6512 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 10 Oct 2023 17:20:03 +0300 Subject: [PATCH 26/29] Delete wrong imports --- connect/community/communityInfo.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/connect/community/communityInfo.ts b/connect/community/communityInfo.ts index 67904a2d..8a8469ce 100644 --- a/connect/community/communityInfo.ts +++ b/connect/community/communityInfo.ts @@ -1,7 +1,5 @@ import {StringUtils} from "../../utils/string-utils.class"; -import {properties} from "../../../../environments/environment"; import {SelectionCriteria} from "../../utils/entities/contentProvider"; -import tryThese = CKEDITOR.tools.tryThese; export class CommunityInfo { title: string; From c29488545e6450bd422baf158623df07b4e8cb8a Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 10 Oct 2023 17:42:40 +0300 Subject: [PATCH 27/29] [Library & Explore | develop]: Added in openaireLibrary environment files for common properties (environment.all.ts: Common properties among all portals, regardless environment, environment.-/test/beta/prod.ts: Common properties per environment among all portals) | environments/: Build and export properties by merging local properties and common properties. --- .../environments/environment.all.ts | 25 +++++++++++++++++++ .../environments/environment.beta.ts | 6 +++++ .../environments/environment.prod.ts | 6 +++++ .../environments/environment.test.ts | 6 +++++ utils/properties/environments/environment.ts | 6 +++++ 5 files changed, 49 insertions(+) create mode 100644 utils/properties/environments/environment.all.ts create mode 100644 utils/properties/environments/environment.beta.ts create mode 100644 utils/properties/environments/environment.prod.ts create mode 100644 utils/properties/environments/environment.test.ts create mode 100644 utils/properties/environments/environment.ts diff --git a/utils/properties/environments/environment.all.ts b/utils/properties/environments/environment.all.ts new file mode 100644 index 00000000..020b7e89 --- /dev/null +++ b/utils/properties/environments/environment.all.ts @@ -0,0 +1,25 @@ +import {EnvProperties} from "../env-properties"; + +export let common: EnvProperties = { + swhURL: "https://archive.softwareheritage.org/", + // searchCrossrefAPIURL: "https://api.crossref.org/works", + // searchDataciteAPIURL: "https://api.datacite.org/works", + // searchOrcidURL: "https://pub.orcid.org/v2.1/", + // orcidURL: "https://orcid.org/", + // doiURL: "https://doi.org/", + // pmcURL: "http://europepmc.org/articles/", + // pmidURL: "https://www.ncbi.nlm.nih.gov/pubmed/", + // handleURL: "http://hdl.handle.net/", + // cordisURL: "http://cordis.europa.eu/projects/", + // openDoarURL: "http://v2.sherpa.ac.uk/id/repository/", + // r3DataURL: "http://service.re3data.org/repository/", + // fairSharingURL: "https://fairsharing.org/", + // sherpaURL: "http://sherpa.ac.uk/romeo/issn/", + // sherpaURLSuffix: "/", + // zenodo: "https://zenodo.org/", + // openAccess: "https://www.openaire.eu/support/faq#article-id-234", + // openAccessRepo: "https://www.openaire.eu/support/faq#article-id-310", + // fp7Guidlines: "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme", + // h2020Guidlines: "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020", + // ercGuidlines: "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf", +} \ No newline at end of file diff --git a/utils/properties/environments/environment.beta.ts b/utils/properties/environments/environment.beta.ts new file mode 100644 index 00000000..520b88e2 --- /dev/null +++ b/utils/properties/environments/environment.beta.ts @@ -0,0 +1,6 @@ +import {EnvProperties} from "../env-properties"; + +export let commonBeta: EnvProperties = { + // searchAPIURLLAst: "http://beta.services.openaire.eu/search/v2/api/", + // searchResourcesAPIURL: "https://beta.services.openaire.eu/search/v2/api/resources", +} \ No newline at end of file diff --git a/utils/properties/environments/environment.prod.ts b/utils/properties/environments/environment.prod.ts new file mode 100644 index 00000000..a2aa22f8 --- /dev/null +++ b/utils/properties/environments/environment.prod.ts @@ -0,0 +1,6 @@ +import {EnvProperties} from "../env-properties"; + +export let commonProd: EnvProperties = { + // searchAPIURLLAst: "https://services.openaire.eu/search/v2/api/", + // searchResourcesAPIURL: "https://services.openaire.eu/search/v2/api/resources", +} \ No newline at end of file diff --git a/utils/properties/environments/environment.test.ts b/utils/properties/environments/environment.test.ts new file mode 100644 index 00000000..81abb978 --- /dev/null +++ b/utils/properties/environments/environment.test.ts @@ -0,0 +1,6 @@ +import {EnvProperties} from "../env-properties"; + +export let commonTest: EnvProperties = { + // searchAPIURLLAst: "https://services.openaire.eu/shadowSearch/v2/api/", + // searchResourcesAPIURL: "https://services.openaire.eu/shadowSearch/v2/api/resources", +} \ No newline at end of file diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts new file mode 100644 index 00000000..69e7ceb1 --- /dev/null +++ b/utils/properties/environments/environment.ts @@ -0,0 +1,6 @@ +import {EnvProperties} from "../env-properties"; + +export let commonDev: EnvProperties = { + // searchAPIURLLAst: "http://beta.services.openaire.eu/search/v2/api/", + // searchResourcesAPIURL: "https://beta.services.openaire.eu/search/v2/api/resources", +} \ No newline at end of file From ff4411d69587e012a274dbd0451ca770d1afb969 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 10 Oct 2023 22:40:01 +0300 Subject: [PATCH 28/29] Fix role verification for community members. Modify isPrivate in communityHelper to include membership. --- connect/connectHelper.ts | 10 ++++++++-- .../role-verification.component.ts | 20 +++++++++++-------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/connect/connectHelper.ts b/connect/connectHelper.ts index 0e65047a..d53a63a3 100644 --- a/connect/connectHelper.ts +++ b/connect/connectHelper.ts @@ -1,6 +1,7 @@ import {HttpParams} from '@angular/common/http'; import {properties} from "../../../environments/environment"; import {Session} from "../login/utils/helper.class"; +import {CommunityInfo} from "./community/communityInfo"; export class ConnectHelper { @@ -53,7 +54,12 @@ export class ConnectHelper { } - public static isPrivate(community, user) { - return community && (community.isPrivate() || (community.isRestricted() && !(Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager("community", community.communityId, user)))) + public static isPrivate(community: CommunityInfo, user) { + return community && (community.isPrivate() || (community.isRestricted() && !( + Session.isPortalAdministrator(user) || + Session.isCommunityCurator(user) || + Session.isManager("community", community.communityId, user) || + (!community.isOpen() && Session.isMember('community', community.communityId, user)) + ))) } } diff --git a/role-verification/role-verification.component.ts b/role-verification/role-verification.component.ts index 9030d636..c4a9a71a 100644 --- a/role-verification/role-verification.component.ts +++ b/role-verification/role-verification.component.ts @@ -34,7 +34,7 @@ import {ClearCacheService} from "../services/clear-cache.service";
-
@@ -119,12 +119,8 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn ngAfterViewInit() { this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { this.user = user; - if (this.paramsSubscription instanceof Subscription) { - this.paramsSubscription.unsubscribe(); - } this.paramsSubscription = this.route.queryParams.subscribe(params => { if (params) { - this.isMember = !!params['isMember']; this.cdr.detectChanges(); if(params['verify'] && !this.isMember) { if (this.user) { @@ -133,7 +129,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn if (this.user.email === this.verification.email.toLowerCase() && this.id === this.verification.entity && this.type === this.verification.type) { if (this.verification.verificationType === 'manager') { this.openManagerModal(); - } else if (this.verification.verificationType === 'member' && this.service === "monitor") { + } else if (this.verification.verificationType === 'member') { this.openMemberModal(); } else { this.openErrorModal(); @@ -217,6 +213,9 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn this.managerModal.cancel(); this.error = null; this.userManagementService.updateUserInfo(() => { + if (this.paramsSubscription instanceof Subscription) { + this.paramsSubscription.unsubscribe(); + } if (this.service === "monitor") { this.loading = false; this.router.navigate(['/admin/' + this.verification.entity]); @@ -254,8 +253,12 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn this.clearCacheService.clearCache('Members updated'); this.loading = false; this.error = null; + this.isMember = true; this.userManagementService.updateUserInfo(() => { - this.router.navigate([], {queryParams: {'verify': null, 'isMember': true}}); + if (this.paramsSubscription instanceof Subscription) { + this.paramsSubscription.unsubscribe(); + } + this.cancel(); }); }, error => { this.loading = false; @@ -271,6 +274,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn } cancel() { - this.router.navigate([], {queryParams: {'verify': null, 'isMember': null}}); + this.isMember = false; + this.router.navigate([]); } } From 9226a5975df57cdb43b795a202db565ac456f0b9 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 11 Oct 2023 12:46:10 +0300 Subject: [PATCH 29/29] [Library | develop]: Added Full-Text in research products actions when available. 1. availableOn.component.ts: Added Full-Text before Data sources, as a separate action and as information for each instance. 2. parsingFunctions.class.ts: Added parsing for fulltext and updated method "compareHostedByCollectedFrom()" to sort by both access and existence of fulltext. 3. resultLanding.component.html: Removed classes for in mobile actions. 4. entity-actions.component.ts: Updated uk-text-bolder class for all actions. 5. result-preview.ts: Added "fulltext?: string;" in HostedByCollectedFrom. --- .../landing-utils/availableOn.component.ts | 95 ++++++++++++------- .../landing-utils/parsingFunctions.class.ts | 52 ++++++---- .../result/resultLanding.component.html | 2 +- .../entity-actions.component.ts | 14 +-- utils/result-preview/result-preview.ts | 1 + 5 files changed, 104 insertions(+), 60 deletions(-) diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 9a1d217c..23c8ef1e 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -11,44 +11,59 @@ import {RouterHelper} from "../../utils/routerHelper.class"; selector: 'availableOn', template: ` -
- - - - - - - {{sliceString(availableOn[0].downloadNames.join("; "), 20)}} - - - - - -
- -
-
- - - - {{sliceString(availableOn[0].downloadNames.join("; "), 20)}} - - +
+ +

+ @@ -79,6 +94,14 @@ import {RouterHelper} from "../../utils/routerHelper.class"; {{instance.license}}
+
+ Full-Text: + + {{instance.fulltext}} + + {{instance.fulltext}} +
Data sources:
-
+
@@ -41,7 +41,7 @@ import {EnvProperties} from "../properties/env-properties"; + class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> Deposit @@ -50,7 +50,7 @@ import {EnvProperties} from "../properties/env-properties"; + class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> Embed diff --git a/utils/result-preview/result-preview.ts b/utils/result-preview/result-preview.ts index b7a2450b..11ee68c5 100644 --- a/utils/result-preview/result-preview.ts +++ b/utils/result-preview/result-preview.ts @@ -11,6 +11,7 @@ export interface HostedByCollectedFrom { years: string[]; accessRightIcon: string; license?: string; + fulltext?: string; } export interface Journal {