apply initial changes to library bases on new community API
This commit is contained in:
parent
5645deec97
commit
3ee4129c7e
|
@ -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'];
|
||||
|
|
|
@ -16,6 +16,7 @@ export class CommunityInfo {
|
|||
subjects: string[];
|
||||
status:string;
|
||||
zenodoCommunity:string;
|
||||
otherZenodoCommunities: string[];
|
||||
isUpload: boolean;
|
||||
isSubscribed: boolean;
|
||||
isManager: boolean;
|
||||
|
|
|
@ -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 => <any> 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']));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,12 +16,11 @@ export class ZenodoCommunitiesService {
|
|||
//.map(res => <any> 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 => <any> res.json())
|
||||
.pipe(map(res => {
|
||||
var community = this.parseZenodoCommunity(res);
|
||||
community["openaireId"]=openaireId;
|
||||
return community;
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -6,5 +6,4 @@ export class ZenodoCommunityInfo {
|
|||
logoUrl: string;
|
||||
date: Date;
|
||||
page: string;
|
||||
openaireId:string;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue