From 3ee4129c7e76cc7f4c8dcfcf27c135ce873f8f0d Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 14 Jul 2023 11:40:38 +0300 Subject: [PATCH] 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; }