Revision 59353
Added by Konstantina Galouni about 4 years ago
modules/uoa-services-library/branches/use-UoaAdminToolsLibrary/ng-openaire-library/src/app/services/searchResearchResults.service.ts | ||
---|---|---|
275 | 275 |
for(let i=0; i<length; i++) { |
276 | 276 |
let author = Array.isArray(authors) ? authors[i] : authors; |
277 | 277 |
if(author) { |
278 |
result['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID};
|
|
278 |
result['authors'][author.rank] = {"fullName": author.content, "orcid": author.orcid};
|
|
279 | 279 |
} |
280 | 280 |
} |
281 | 281 |
result.authors = result.authors.filter(function (item) { |
modules/uoa-services-library/branches/use-UoaAdminToolsLibrary/ng-openaire-library/src/app/services/user-registry.service.ts | ||
---|---|---|
1 | 1 |
import {Injectable} from '@angular/core'; |
2 | 2 |
import {HttpClient} from '@angular/common/http'; |
3 |
import {Observable, of} from "rxjs";
|
|
4 |
import {properties} from "../../../environments/environment";
|
|
5 |
import {CustomOptions} from "./servicesUtils/customOptions.class";
|
|
6 |
import {catchError, map} from "rxjs/operators";
|
|
3 |
import {Observable} from 'rxjs';
|
|
4 |
import {properties} from '../../../environments/environment';
|
|
5 |
import {CustomOptions} from './servicesUtils/customOptions.class';
|
|
6 |
import {map} from 'rxjs/operators';
|
|
7 | 7 |
|
8 | 8 |
@Injectable({ |
9 | 9 |
providedIn: 'root' |
10 | 10 |
}) |
11 | 11 |
export class UserRegistryService { |
12 |
|
|
12 |
|
|
13 | 13 |
constructor(private http: HttpClient) { |
14 | 14 |
} |
15 |
|
|
15 |
|
|
16 | 16 |
public getSubscribersCount(type: string, id: string): Observable<any> { |
17 | 17 |
return this.http.get(properties.registryUrl + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/subscribers/count'); |
18 | 18 |
} |
19 |
|
|
19 |
|
|
20 | 20 |
public subscribeTo(type: string, id: string): Observable<any> { |
21 | 21 |
return this.http.post(properties.registryUrl + 'subscribe/' + encodeURIComponent(type) + '/' + encodeURIComponent(id), |
22 |
null, CustomOptions.registryOptions()) |
|
22 |
null, CustomOptions.registryOptions());
|
|
23 | 23 |
} |
24 |
|
|
24 |
|
|
25 | 25 |
public unsubscribeFrom(type: string, id: string): Observable<any> { |
26 | 26 |
return this.http.post(properties.registryUrl + 'unsubscribe/' + encodeURIComponent(type) + '/' + encodeURIComponent(id), |
27 |
null, CustomOptions.registryOptions()) |
|
27 |
null, CustomOptions.registryOptions());
|
|
28 | 28 |
} |
29 |
|
|
29 |
|
|
30 |
public removeManagerRole(type: string, id: string, email: string): Observable<any> { |
|
31 |
return this.http.delete<any>(properties.registryUrl + |
|
32 |
encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email), CustomOptions.registryOptions()); |
|
33 |
} |
|
34 |
|
|
35 |
public invite(type: string, id: string, email: string, details: any): Observable<any[]> { |
|
36 |
return this.http.post<any>(properties.registryUrl + 'invite/' + |
|
37 |
encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email), details, |
|
38 |
CustomOptions.registryOptions()).pipe(map((response: any) => response.response)); |
|
39 |
} |
|
40 |
|
|
41 |
public cancelInvitation(type: string, id: string, email: string): Observable<any> { |
|
42 |
return this.http.delete<any>(properties.registryUrl + 'invite/' + |
|
43 |
encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email), |
|
44 |
CustomOptions.registryOptions()); |
|
45 |
} |
|
46 |
|
|
47 |
public getPendingManagers(type: string, id: string): Observable<any[]> { |
|
48 |
return this.http.get<any>(properties.registryUrl + 'invite/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/managers/', |
|
49 |
CustomOptions.registryOptions()).pipe(map((response: any) => response.response)); |
|
50 |
} |
|
51 |
|
|
30 | 52 |
public getSubscribers(type: string, id: string): Observable<any[]> { |
31 | 53 |
return this.http.get<any>(properties.registryUrl + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/subscribers/').pipe(map(response => response.response)); |
32 | 54 |
} |
33 |
|
|
55 |
|
|
34 | 56 |
public getManagers(type: string, id: string): Observable<any[]> { |
35 | 57 |
return this.http.get<any>(properties.registryUrl + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/managers/').pipe(map(response => response.response)); |
36 | 58 |
} |
37 |
|
|
59 |
|
|
38 | 60 |
public getSubscribersEmail(type: string, id: string): Observable<any[]> { |
39 | 61 |
return this.http.get<any>(properties.registryUrl + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/subscribers/email').pipe(map(response => response.response)); |
40 | 62 |
} |
41 |
|
|
63 |
|
|
42 | 64 |
public getInvitation(id: string): Observable<any> { |
43 |
return this.http.get<any>(properties.registryUrl + "verification/" + encodeURIComponent(id), CustomOptions.registryOptions())
|
|
65 |
return this.http.get<any>(properties.registryUrl + 'verification/' + encodeURIComponent(id), CustomOptions.registryOptions())
|
|
44 | 66 |
.pipe(map((response: any) => response.response)); |
45 | 67 |
} |
46 |
|
|
68 |
|
|
47 | 69 |
public verify(id: string, code: string): Observable<any> { |
48 |
return this.http.post<any>(properties.registryUrl + "verification/" + encodeURIComponent(id), code,CustomOptions.registryOptions());
|
|
70 |
return this.http.post<any>(properties.registryUrl + 'verification/' + encodeURIComponent(id), code, CustomOptions.registryOptions());
|
|
49 | 71 |
} |
50 |
|
|
72 |
|
|
51 | 73 |
public deleteVerification(id: string): Observable<any> { |
52 |
return this.http.delete<any>(properties.registryUrl + "verification/" + encodeURIComponent(id), CustomOptions.registryOptions());
|
|
74 |
return this.http.delete<any>(properties.registryUrl + 'verification/' + encodeURIComponent(id), CustomOptions.registryOptions());
|
|
53 | 75 |
} |
54 |
|
|
76 |
|
|
55 | 77 |
public getManagersEmail(type: string, id: string): Observable<any[]> { |
56 | 78 |
return this.http.get<any>(properties.registryUrl + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/managers/email').pipe(map(response => response.response)); |
57 | 79 |
} |
modules/uoa-services-library/branches/use-UoaAdminToolsLibrary/ng-openaire-library/src/app/connect/community/community.service.ts | ||
---|---|---|
42 | 42 |
return from(this.getCommunityByStateAsync(properties, url)); |
43 | 43 |
} |
44 | 44 |
|
45 |
/** |
|
46 |
* @deprecated |
|
47 |
*/ |
|
48 | 45 |
getCommunity(properties: EnvProperties, url: string) { |
49 | 46 |
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) |
50 | 47 |
.pipe(map(res => this.parseCommunity(res))); |
modules/uoa-services-library/branches/use-UoaAdminToolsLibrary/ng-openaire-library/src/app/landingPages/result/resultLanding.service.ts | ||
---|---|---|
291 | 291 |
for(let i=0; i<length; i++) { |
292 | 292 |
let author = Array.isArray(authors) ? authors[i] : authors; |
293 | 293 |
if(author) { |
294 |
this.resultLandingInfo['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID};
|
|
294 |
this.resultLandingInfo['authors'][author.rank] = {"fullName": author.content, "orcid": author.orcid};
|
|
295 | 295 |
} |
296 | 296 |
} |
297 | 297 |
this.resultLandingInfo.authors = this.resultLandingInfo.authors.filter(function (item) { |
modules/uoa-services-library/branches/use-UoaAdminToolsLibrary/ng-openaire-library/src/app/landingPages/result/deletedByInference/deletedByInference.service.ts | ||
---|---|---|
130 | 130 |
for(let i=0; i<length; i++) { |
131 | 131 |
let author = Array.isArray(authors) ? authors[i] : authors; |
132 | 132 |
if(author) { |
133 |
/*if (author.ORCID && author.ORCID.indexOf(properties.orcidURL) != -1) {
|
|
134 |
author.ORCID = author.ORCID.substr(properties.orcidURL.length);
|
|
133 |
/*if (author.orcid && author.orcid.indexOf(properties.orcidURL) != -1) {
|
|
134 |
author.orcid = author.orcid.substr(properties.orcidURL.length);
|
|
135 | 135 |
}*/ |
136 |
result['authors'][author.rank] = {"fullName": author.content, "orcid": author.ORCID};
|
|
136 |
result['authors'][author.rank] = {"fullName": author.content, "orcid": author.orcid};
|
|
137 | 137 |
} |
138 | 138 |
} |
139 | 139 |
result.authors = result.authors.filter(function (item) { |
modules/uoa-services-library/branches/use-UoaAdminToolsLibrary/ng-openaire-library/src/app/utils/properties/searchFields.ts | ||
---|---|---|
14 | 14 |
"resultbestaccessright", "relfunder", |
15 | 15 |
"relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id", |
16 | 16 |
"relproject", |
17 |
"instancetypename", "resultlanguagename", "community", "resulthostingdatasource"]; |
|
18 |
|
|
17 |
"instancetypename", "resultlanguagename", "community", "resulthostingdatasource", "country"];
|
|
18 |
|
|
19 | 19 |
public RESULT_ADVANCED_FIELDS: string[] = ["q", "resulttitle", "resultauthor", "authorid", "resultdescription", "resultsubject", "resultpublisher", |
20 | 20 |
"resultbestaccessright", "community", "collectedfromdatasourceid", "resulthostingdatasourceid", "resultdateofacceptance", |
21 | 21 |
"relfunder", |
... | ... | |
223 | 223 |
operator: "tp", |
224 | 224 |
equalityOperator: " exact ", |
225 | 225 |
filterType: "radio" |
226 |
}, |
|
227 |
["country"]: { |
|
228 |
name: "Country", |
|
229 |
type: "refine", |
|
230 |
param: "country", |
|
231 |
operator: "cu", |
|
232 |
equalityOperator: " exact ", |
|
233 |
filterType: "checkbox" |
|
226 | 234 |
} |
227 | 235 |
}; |
228 | 236 |
|
Also available in: Unified diff
[use-UoaAdminToolsLibrary | Library]: Merge trunk into branch.