plugins-functionality #43
|
@ -2,13 +2,12 @@ import {Component, Input, ViewChild} from '@angular/core';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import {ContextsService} from './service/contexts.service';
|
import {ContextsService} from './service/contexts.service';
|
||||||
import {ClaimEntity, ShowOptions} from './claimHelper.class';
|
import {ClaimEntity, ShowOptions} from './claimHelper.class';
|
||||||
import {Session} from '../../login/utils/helper.class';
|
|
||||||
import {LoginErrorCodes} from '../../login/utils/guardHelper.class';
|
|
||||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||||
import {Subscriber} from "rxjs";
|
import {Subscriber} from "rxjs";
|
||||||
import {OpenaireEntities} from "../../utils/properties/searchFields";
|
import {OpenaireEntities} from "../../utils/properties/searchFields";
|
||||||
import {CommunitiesService} from "../../connect/communities/communities.service";
|
import {CommunitiesService} from "../../connect/communities/communities.service";
|
||||||
import {UserManagementService} from "../../services/user-management.service";
|
import {UserManagementService} from "../../services/user-management.service";
|
||||||
|
import {Session} from "../../login/utils/helper.class";
|
||||||
|
|
||||||
declare var UIkit: any;
|
declare var UIkit: any;
|
||||||
|
|
||||||
|
@ -183,10 +182,6 @@ export class ClaimContextSearchFormComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
getCommunities() {
|
getCommunities() {
|
||||||
if (!Session.isLoggedIn()) {
|
|
||||||
this.saveStateAndRedirectLogin();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.subscriptions.push(this._contextService.getCommunitiesByState().subscribe(
|
this.subscriptions.push(this._contextService.getCommunitiesByState().subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
@ -220,18 +215,14 @@ export class ClaimContextSearchFormComponent {
|
||||||
this.error = true;
|
this.error = true;
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getCategories() {
|
getCategories() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
// this.categories=[];
|
// this.categories=[];
|
||||||
if (this.selectedCommunityId != '0') {
|
if (this.selectedCommunityId != '0') {
|
||||||
if (!Session.isLoggedIn()) {
|
|
||||||
this.saveStateAndRedirectLogin();
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (this.categories[this.selectedCommunityId]) {
|
if (this.categories[this.selectedCommunityId]) {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if(this.categories[this.selectedCommunityId].length > 0){
|
if(this.categories[this.selectedCommunityId].length > 0){
|
||||||
|
@ -259,7 +250,7 @@ export class ClaimContextSearchFormComponent {
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
displaySubcategory(id) {
|
displaySubcategory(id) {
|
||||||
|
@ -272,9 +263,6 @@ export class ClaimContextSearchFormComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
browseConcepts(categoryId) {
|
browseConcepts(categoryId) {
|
||||||
if (!Session.isLoggedIn()) {
|
|
||||||
this.saveStateAndRedirectLogin();
|
|
||||||
} else {
|
|
||||||
if (this.conceptsClass[categoryId] != null) {
|
if (this.conceptsClass[categoryId] != null) {
|
||||||
this.conceptsClassDisplay[categoryId] = !this.conceptsClassDisplay[categoryId];
|
this.conceptsClassDisplay[categoryId] = !this.conceptsClassDisplay[categoryId];
|
||||||
return;
|
return;
|
||||||
|
@ -302,8 +290,6 @@ export class ClaimContextSearchFormComponent {
|
||||||
this.conceptsCategoryLoading[categoryId] = false;
|
this.conceptsCategoryLoading[categoryId] = false;
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
browseSubConcepts(categoryId, conceptId) {
|
browseSubConcepts(categoryId, conceptId) {
|
||||||
|
@ -325,24 +311,6 @@ export class ClaimContextSearchFormComponent {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
saveStateAndRedirectLogin() {
|
|
||||||
|
|
||||||
if (this.results != null) {
|
|
||||||
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
|
|
||||||
}
|
|
||||||
if (this.sources != null) {
|
|
||||||
localStorage.setItem(this.localStoragePrefix + "sources", JSON.stringify(this.sources));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.router.navigate(['/user-info'], {
|
|
||||||
queryParams: {
|
|
||||||
"errorCode": LoginErrorCodes.NOT_VALID,
|
|
||||||
"redirectUrl": this.router.url
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private static handleError(message: string, error) {
|
private static handleError(message: string, error) {
|
||||||
console.error("Claim context search form (component): " + message, error);
|
console.error("Claim context search form (component): " + message, error);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ export class ClaimsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private getClaimRequest(size : number, page : number, url :string, fromCache:boolean):any {
|
private getClaimRequest(size : number, page : number, url :string, fromCache:boolean):any {
|
||||||
return this.http.get(url, CustomOptions.getAuthOptions());
|
return this.http.get(url, CustomOptions.getAuthOptionsWithBody());
|
||||||
}
|
}
|
||||||
getClaims( size : number, page : number, keyword:string, sortby: string, descending: boolean, types: string, apiUrl:string):any {
|
getClaims( size : number, page : number, keyword:string, sortby: string, descending: boolean, types: string, apiUrl:string):any {
|
||||||
let url = apiUrl +"claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+(types.length>0?"&"+types:types);
|
let url = apiUrl +"claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+(types.length>0?"&"+types:types);
|
||||||
|
@ -44,10 +44,7 @@ export class ClaimsService {
|
||||||
deleteClaimById(claimId:string , apiUrl:string):any{
|
deleteClaimById(claimId:string , apiUrl:string):any{
|
||||||
//console.warn('Trying to delete claim with id : '+claimId);
|
//console.warn('Trying to delete claim with id : '+claimId);
|
||||||
let url = apiUrl +"claims/"+claimId;
|
let url = apiUrl +"claims/"+claimId;
|
||||||
// let headers = new Headers({ 'Content-Type': 'application/json' });
|
|
||||||
// let options = new RequestOptions({ headers: headers });
|
|
||||||
return this.http.delete( url, CustomOptions.getAuthOptionsWithBody())//.map(request => <any> request.json())
|
return this.http.delete( url, CustomOptions.getAuthOptionsWithBody())//.map(request => <any> request.json())
|
||||||
// .do(request => console.info("After delete" ))
|
|
||||||
.pipe(catchError(this.handleError));
|
.pipe(catchError(this.handleError));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,10 +58,7 @@ export class ClaimsService {
|
||||||
}
|
}
|
||||||
url= apiUrl +"claims/bulk?"+url;
|
url= apiUrl +"claims/bulk?"+url;
|
||||||
|
|
||||||
// let headers = new Headers({ 'Content-Type': 'application/json' });
|
return this.http.delete( url, CustomOptions.getAuthOptionsWithBody())//.map(request => <any> request.json())
|
||||||
// let options = new RequestOptions({ headers: headers });
|
|
||||||
return this.http.delete( url, CustomOptions.getAuthOptions())//.map(request => <any> request.json())
|
|
||||||
// .do(request => console.info("After delete" ))
|
|
||||||
.pipe(catchError(this.handleError));
|
.pipe(catchError(this.handleError));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -72,40 +66,27 @@ export class ClaimsService {
|
||||||
// console.warn('Trying toinsert claims : '+claims);
|
// console.warn('Trying toinsert claims : '+claims);
|
||||||
let url = apiUrl +"claims/bulk";
|
let url = apiUrl +"claims/bulk";
|
||||||
let body = JSON.stringify( claims );
|
let body = JSON.stringify( claims );
|
||||||
//console.warn('Json body: : '+body);
|
|
||||||
// let headers = new Headers({ 'Content-Type': 'application/json' });
|
|
||||||
// let options = new RequestOptions({ headers: headers });
|
|
||||||
return this.http.post(url, body, CustomOptions.getAuthOptionsWithBody())
|
return this.http.post(url, body, CustomOptions.getAuthOptionsWithBody())
|
||||||
//.map(res => res.json())
|
|
||||||
//.do(request => console.info("Insert Response:"+request.status) )
|
|
||||||
.pipe(catchError(this.handleError));
|
.pipe(catchError(this.handleError));
|
||||||
|
|
||||||
}
|
}
|
||||||
insertClaim(claim, apiUrl:string):any{
|
|
||||||
//console.warn('Trying toinsert claim : '+claim);
|
|
||||||
let url = apiUrl +"claims";
|
|
||||||
let body = JSON.stringify( claim );
|
|
||||||
// let headers = new Headers({ 'Content-Type': 'application/json' });
|
|
||||||
// let options = new RequestOptions({ headers: headers });
|
|
||||||
return this.http.post(url, body, CustomOptions.getAuthOptionsWithBody())
|
|
||||||
//.map(res => res.json())
|
|
||||||
//.do(request => console.info("Insert Response:"+request.status) )
|
|
||||||
.pipe(catchError(this.handleError));
|
|
||||||
|
|
||||||
}
|
|
||||||
insertDirectRecords(records, apiUrl:string):any{
|
insertDirectRecords(records, apiUrl:string):any{
|
||||||
//console.warn('Trying to feedrecords : '+records);
|
//console.warn('Trying to feedrecords : '+records);
|
||||||
let url = apiUrl +"feed/bulk";
|
let url = apiUrl +"feed/bulk";
|
||||||
let body = JSON.stringify( records );
|
let body = JSON.stringify( records );
|
||||||
//console.warn('Json body: : '+body);
|
|
||||||
// let headers = new Headers({ 'Content-Type': 'application/json' });
|
|
||||||
// let options = new RequestOptions({ headers: headers });
|
|
||||||
return this.http.post(url, body, CustomOptions.getAuthOptionsWithBody())
|
return this.http.post(url, body, CustomOptions.getAuthOptionsWithBody())
|
||||||
//.map(res => res.json())
|
|
||||||
//.do(request => console.info("Insert Response:"+request) )
|
|
||||||
.pipe(catchError(this.handleError));
|
.pipe(catchError(this.handleError));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
getStatus(jobId, apiUrl:string):any{
|
||||||
|
|
||||||
|
let url = apiUrl +"jobStatus/" + jobId;
|
||||||
|
|
||||||
|
return this.http.get(url,CustomOptions.getAuthOptionsWithBody())
|
||||||
|
.pipe(catchError(this.handleError));
|
||||||
|
|
||||||
|
}
|
||||||
private handleError (error: Response) {
|
private handleError (error: Response) {
|
||||||
// in a real world app, we may send the error to some remote logging infrastructure
|
// in a real world app, we may send the error to some remote logging infrastructure
|
||||||
// instead of just logging it to the console
|
// instead of just logging it to the console
|
||||||
|
@ -113,22 +94,4 @@ export class ClaimsService {
|
||||||
return observableThrowError(error || 'Server error');
|
return observableThrowError(error || 'Server error');
|
||||||
}
|
}
|
||||||
|
|
||||||
// getClaim(id:string, apiUrl:string):any {
|
|
||||||
// let url = apiUrl+"claims/"+id;
|
|
||||||
// return new Promise((resolve, reject) => {
|
|
||||||
// this.http.get(url)
|
|
||||||
// //.map(res => res.json())
|
|
||||||
// .subscribe(
|
|
||||||
// data => {
|
|
||||||
// resolve(data['data']);
|
|
||||||
// },
|
|
||||||
// err => {
|
|
||||||
// reject(err);
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
// ;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,26 +18,12 @@ export class ClaimsByTokenService {
|
||||||
|
|
||||||
let key = url;
|
let key = url;
|
||||||
|
|
||||||
return this.http.get(url, CustomOptions.getAuthOptions());
|
return this.http.get(url, CustomOptions.getAuthOptionsWithBody());
|
||||||
//.map(res => <any> res.text())
|
|
||||||
//.map(request => <any> request.json());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
getClaims(email: string, token: string, user_token: string):any {
|
|
||||||
let url = OpenaireProperties.getClaimsAPIURL(); // What else?
|
|
||||||
let body = JSON.stringify( {"email": email, "token": token} );
|
|
||||||
console.warn('Json body: : '+body);
|
|
||||||
let headers = new Headers({ 'Content-Type': 'application/json' });
|
|
||||||
let options = new RequestOptions({ headers: headers });
|
|
||||||
return this.http.post(url, body, options)
|
|
||||||
.map(res => res.json())
|
|
||||||
.do(request => console.info("Insert Response:"+request.status) )
|
|
||||||
.catch(this.handleError);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
updateClaimsCuration( selectedRight: Set<string>, selectedWrong: Set<string>, apiURL:string) {
|
updateClaimsCuration( selectedRight: Set<string>, selectedWrong: Set<string>, apiURL:string) {
|
||||||
let url = apiURL + "curate/bulk";
|
let url = apiURL + "curate/bulk";
|
||||||
|
|
|
@ -14,7 +14,8 @@ import {
|
||||||
Message
|
Message
|
||||||
} from "../../claim-utils/claimHelper.class";
|
} from "../../claim-utils/claimHelper.class";
|
||||||
import {UserManagementService} from "../../../services/user-management.service";
|
import {UserManagementService} from "../../../services/user-management.service";
|
||||||
import {Subscriber} from "rxjs";
|
import {Subscriber, timer} from "rxjs";
|
||||||
|
import {map} from "rxjs/operators";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'claim-insert',
|
selector: 'claim-insert',
|
||||||
|
@ -30,7 +31,19 @@ import {Subscriber} from "rxjs";
|
||||||
<div class="uk-width-expand uk-margin-small-left">CONFIRM LINKING</div>
|
<div class="uk-width-expand uk-margin-small-left">CONFIRM LINKING</div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<modal-loading [message]="'Please wait...'"></modal-loading>
|
<modal-loading [message]="'Please wait...'">
|
||||||
|
|
||||||
|
<div *ngIf="claimsJob">
|
||||||
|
<div *ngIf="claimsJob && claimsJob.insertedIds.length <1" class="uk-text-meta uk-text-small">
|
||||||
|
Initiating process....</div>
|
||||||
|
<div *ngIf="claimsJob && claimsJob.insertedIds.length >0" class="uk-text-meta uk-text-small">
|
||||||
|
{{claimsJob.insertedIds.length}} out of {{claims2Insert}} links created.</div>
|
||||||
|
<div *ngIf="feedRecordsJob && feedRecordsJob.insertedIds.length >0" class="uk-text-meta uk-text-small">
|
||||||
|
{{feedRecordsJob.insertedIds.length}} out of {{records2Insert}} records added in the index...</div>
|
||||||
|
<div *ngIf="claimsJob.status != 'COMPLETE'" class="uk-text-meta uk-text-small">
|
||||||
|
Please don't close the window, process is ongoing...</div>
|
||||||
|
</div>
|
||||||
|
</modal-loading>
|
||||||
<modal-alert (alertOutput)="confirmClose()">
|
<modal-alert (alertOutput)="confirmClose()">
|
||||||
<h4 class="modal-title uk-text-bold " id="myModalLabel">Confirmation notice</h4>
|
<h4 class="modal-title uk-text-bold " id="myModalLabel">Confirmation notice</h4>
|
||||||
<p>All the links you provided will be published in the OpenAIRE platform. <br>
|
<p>All the links you provided will be published in the OpenAIRE platform. <br>
|
||||||
|
@ -60,6 +73,32 @@ export class ClaimInsertComponent {
|
||||||
this.subscriptions.push(this.route.queryParams.subscribe(params => {
|
this.subscriptions.push(this.route.queryParams.subscribe(params => {
|
||||||
this.params = params;
|
this.params = params;
|
||||||
}));
|
}));
|
||||||
|
if(localStorage.getItem(this.localStoragePrefix + "claimsJob")){
|
||||||
|
this.claimsJob = JSON.parse(localStorage.getItem(this.localStoragePrefix + "claimsJob"));
|
||||||
|
this.feedRecordsJob = JSON.parse(localStorage.getItem(this.localStoragePrefix + "feedRecordsJob"));
|
||||||
|
if(this.claimsJob.status != "COMPLETE"){
|
||||||
|
this.claiming = true;
|
||||||
|
let loadingTimerSubscription = timer(0, 1000).pipe(
|
||||||
|
map(() => {
|
||||||
|
if(this.loading) {
|
||||||
|
this.loading.open();
|
||||||
|
loadingTimerSubscription.unsubscribe();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
).subscribe();
|
||||||
|
this.subscriptions.push(loadingTimerSubscription);
|
||||||
|
|
||||||
|
let timerSubscription = timer(0, 10000).pipe(
|
||||||
|
map(() => {
|
||||||
|
this.getStatus(); // load data contains the http request
|
||||||
|
})
|
||||||
|
).subscribe();
|
||||||
|
this.subscriptions.push(timerSubscription);
|
||||||
|
}else{
|
||||||
|
this.claimsJob = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
params = {};
|
params = {};
|
||||||
|
@ -84,15 +123,15 @@ export class ClaimInsertComponent {
|
||||||
private errorInClaims: ClaimRecord2Insert[] = [];
|
private errorInClaims: ClaimRecord2Insert[] = [];
|
||||||
private insertedRecords = [];
|
private insertedRecords = [];
|
||||||
private errorInRecords = [];
|
private errorInRecords = [];
|
||||||
|
public claimsJob;
|
||||||
|
public feedRecordsJob;
|
||||||
|
public claims2Insert;
|
||||||
|
public records2Insert
|
||||||
public insert() {
|
public insert() {
|
||||||
this.confirmOpen();
|
this.confirmOpen();
|
||||||
}
|
}
|
||||||
saveAndNavigate(){
|
saveAndNavigate(){
|
||||||
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
|
this.saveLocalStorage();
|
||||||
if (this.sources != null) {
|
|
||||||
localStorage.setItem(this.localStoragePrefix + "sources", JSON.stringify(this.sources));
|
|
||||||
}
|
|
||||||
this._router.navigate(['/user-info'], {
|
this._router.navigate(['/user-info'], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
"errorCode": LoginErrorCodes.NOT_VALID,
|
"errorCode": LoginErrorCodes.NOT_VALID,
|
||||||
|
@ -177,12 +216,15 @@ export class ClaimInsertComponent {
|
||||||
//first call direct index service - when call is done (success or error) call isertBulkClaims method to insert claims in DB
|
//first call direct index service - when call is done (success or error) call isertBulkClaims method to insert claims in DB
|
||||||
// console.log("directclaims");
|
// console.log("directclaims");
|
||||||
// console.log(directclaims);
|
// console.log(directclaims);
|
||||||
if (directclaims.length > 0 && this.properties.environment != "development"){
|
if (directclaims.length > 0/* && this.properties.environment != "development"*/){
|
||||||
this.subscriptions.push(this.claimService.insertDirectRecords(directclaims, this.properties.claimsAPIURL).subscribe(
|
this.subscriptions.push(this.claimService.insertDirectRecords(directclaims, this.properties.claimsAPIURL).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.insertedRecords = data.insertedIds;
|
this.feedRecordsJob = data.data;
|
||||||
|
this.records2Insert = directclaims.length;
|
||||||
this.errorInRecords = data.errorInClaims;
|
console.log(data);
|
||||||
|
// this.insertedRecords = data.insertedIds;
|
||||||
|
//
|
||||||
|
// this.errorInRecords = data.errorInClaims;
|
||||||
this.isertBulkClaims(claims);
|
this.isertBulkClaims(claims);
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -190,12 +232,12 @@ export class ClaimInsertComponent {
|
||||||
if (err.code && err.code == 403) {
|
if (err.code && err.code == 403) {
|
||||||
this.saveAndNavigate();
|
this.saveAndNavigate();
|
||||||
}
|
}
|
||||||
if (err.insertedIds && err.insertedIds.length > 0) {
|
/* if (err.insertedIds && err.insertedIds.length > 0) {
|
||||||
this.insertedRecords = err.insertedIds;
|
this.insertedRecords = err.insertedIds;
|
||||||
}
|
}
|
||||||
if (err.errorInClaims && err.errorInClaims.length > 0) {
|
if (err.errorInClaims && err.errorInClaims.length > 0) {
|
||||||
this.errorInRecords = err.errorInClaims;
|
this.errorInRecords = err.errorInClaims;
|
||||||
}
|
}*/
|
||||||
this.isertBulkClaims(claims);
|
this.isertBulkClaims(claims);
|
||||||
|
|
||||||
ClaimInsertComponent.handleError("Error inserting direct records: " + JSON.stringify(directclaims), err);
|
ClaimInsertComponent.handleError("Error inserting direct records: " + JSON.stringify(directclaims), err);
|
||||||
|
@ -209,30 +251,18 @@ export class ClaimInsertComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private isertBulkClaims(claims: ClaimRecord2Insert[]) {
|
private isertBulkClaims(claims: ClaimRecord2Insert[]) {
|
||||||
console.log("claims");
|
|
||||||
console.log(claims);
|
|
||||||
this.errors.splice(0, this.errors.length);
|
this.errors.splice(0, this.errors.length);
|
||||||
this.subscriptions.push(this.claimService.insertBulkClaims(claims, this.properties.claimsAPIURL).subscribe(
|
this.subscriptions.push(this.claimService.insertBulkClaims(claims, this.properties.claimsAPIURL).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.insertedClaims = data.insertedIds;
|
this.claims2Insert = claims.length;
|
||||||
this.errorInClaims = data.errorInClaims;
|
this.claimsJob = data.data;
|
||||||
//TODO remove - testing having errors in claims
|
this.saveLocalStorage();
|
||||||
// this.insertedClaims.pop();
|
let timerSubscription = timer(0, 10000).pipe(
|
||||||
// this.insertedClaims.pop();
|
map(() => {
|
||||||
// this.errorInClaims.push(claims[1]);
|
this.getStatus(); // load data contains the http request
|
||||||
// this.insertedClaims.splice(0,this.insertedClaims.length);
|
})
|
||||||
// this.errorInClaims = claims;
|
).subscribe();
|
||||||
//remove till here
|
this.subscriptions.push(timerSubscription);
|
||||||
|
|
||||||
if (claims.length != this.insertedClaims.length) {
|
|
||||||
let error: ClaimsErrorMessage = new ClaimsErrorMessage();
|
|
||||||
error.type = "claimServiceFail2Insert";
|
|
||||||
error.inserted = this.insertedClaims.length;
|
|
||||||
error.failed = this.errorInClaims.length;
|
|
||||||
this.createErrorMessagesPerEntity((this.insertedClaims.length == 0));
|
|
||||||
this.errors.push(error);
|
|
||||||
}
|
|
||||||
this.afterclaimsInsertion();
|
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
err = err && err.error?err.error:err;
|
err = err && err.error?err.error:err;
|
||||||
|
@ -335,13 +365,16 @@ export class ClaimInsertComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private afterclaimsInsertion() {
|
private afterclaimsInsertion() {
|
||||||
|
|
||||||
this.loading.close();
|
|
||||||
this.claiming = false;
|
this.claiming = false;
|
||||||
|
this.loading.close();
|
||||||
|
|
||||||
|
|
||||||
if (this.errorInClaims.length == 0 && this.insertedClaims.length > 0) {
|
if (this.errorInClaims.length == 0 && this.insertedClaims.length > 0) {
|
||||||
localStorage.removeItem(this.localStoragePrefix + "sources");
|
localStorage.removeItem(this.localStoragePrefix + "sources");
|
||||||
localStorage.removeItem(this.localStoragePrefix + "results");
|
localStorage.removeItem(this.localStoragePrefix + "results");
|
||||||
|
localStorage.removeItem(this.localStoragePrefix + "claimsJob");
|
||||||
|
localStorage.removeItem(this.localStoragePrefix + "feedRecordsJob");
|
||||||
|
|
||||||
this._router.navigate(['/myclaims'], {queryParams: this.params});
|
this._router.navigate(['/myclaims'], {queryParams: this.params});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -520,5 +553,74 @@ export class ClaimInsertComponent {
|
||||||
}
|
}
|
||||||
return buttonClass + "uk-text-center ";
|
return buttonClass + "uk-text-center ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getStatus(){
|
||||||
|
if(this.feedRecordsJob && ! (this.feedRecordsJob.status == "COMPLETE" || this.feedRecordsJob.status == "ERROR") ) {
|
||||||
|
this.subscriptions.push(this.claimService.getStatus(this.feedRecordsJob.id, this.properties.claimsAPIURL).subscribe(data => {
|
||||||
|
console.log("feed", data);
|
||||||
|
this.feedRecordsJob = data.data;
|
||||||
|
if (this.feedRecordsJob.status == "COMPLETE" || data.data.status == "ERROR") {
|
||||||
|
this.insertedRecords = this.feedRecordsJob.insertedIds;
|
||||||
|
this.errorInRecords = this.feedRecordsJob.errorInClaims;
|
||||||
|
}
|
||||||
|
}, err => {
|
||||||
|
let error: ClaimsErrorMessage = new ClaimsErrorMessage();
|
||||||
|
error.type = "jobError";
|
||||||
|
this.createErrorMessagesPerEntity((this.insertedClaims.length == 0));
|
||||||
|
this.errors.push(error);
|
||||||
|
this.afterclaimsInsertion();
|
||||||
|
this.feedRecordsJob = null;
|
||||||
|
localStorage.removeItem(this.localStoragePrefix + "feedRecordsJob");
|
||||||
|
}
|
||||||
|
|
||||||
|
));
|
||||||
|
}
|
||||||
|
if(this.claimsJob) {
|
||||||
|
this.subscriptions.push(this.claimService.getStatus(this.claimsJob.id, this.properties.claimsAPIURL).subscribe(data => {
|
||||||
|
console.log("claim", data);
|
||||||
|
this.claimsJob = data.data;
|
||||||
|
if ((this.claimsJob.status == "COMPLETE" || data.data.status == "ERROR") && ( !this.feedRecordsJob || !(this.feedRecordsJob.status == "COMPLETE" || data.data.status == "ERROR")) ) {
|
||||||
|
this.insertedClaims = this.claimsJob.insertedIds;
|
||||||
|
this.errorInClaims = this.claimsJob.errorInClaims;
|
||||||
|
|
||||||
|
if (this.claims2Insert != this.insertedClaims.length) {
|
||||||
|
let error: ClaimsErrorMessage = new ClaimsErrorMessage();
|
||||||
|
error.type = "claimServiceFail2Insert";
|
||||||
|
error.inserted = this.insertedClaims.length;
|
||||||
|
error.failed = this.errorInClaims.length;
|
||||||
|
this.createErrorMessagesPerEntity((this.insertedClaims.length == 0));
|
||||||
|
this.errors.push(error);
|
||||||
|
}
|
||||||
|
this.afterclaimsInsertion();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}, err => {
|
||||||
|
let error: ClaimsErrorMessage = new ClaimsErrorMessage();
|
||||||
|
error.type = "jobError";
|
||||||
|
this.createErrorMessagesPerEntity((this.insertedClaims.length == 0));
|
||||||
|
this.errors.push(error);
|
||||||
|
this.afterclaimsInsertion();
|
||||||
|
this.claimsJob = null;
|
||||||
|
localStorage.removeItem(this.localStoragePrefix + "claimsJob");
|
||||||
|
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
saveLocalStorage(){
|
||||||
|
if (this.results != null) {
|
||||||
|
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
|
||||||
|
}
|
||||||
|
if (this.sources != null) {
|
||||||
|
localStorage.setItem(this.localStoragePrefix + "sources", JSON.stringify(this.sources));
|
||||||
|
}
|
||||||
|
if (this.claimsJob != null) {
|
||||||
|
localStorage.setItem(this.localStoragePrefix + "claimsJob", JSON.stringify(this.claimsJob));
|
||||||
|
}
|
||||||
|
if (this.feedRecordsJob != null) {
|
||||||
|
localStorage.setItem(this.localStoragePrefix + "feedRecordsJob", JSON.stringify(this.feedRecordsJob));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@ import {OpenaireEntities} from "../../utils/properties/searchFields";
|
||||||
import {StringUtils} from "../../utils/string-utils.class";
|
import {StringUtils} from "../../utils/string-utils.class";
|
||||||
import {RouterHelper} from "../../utils/routerHelper.class";
|
import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
|
import {LoginErrorCodes} from "../../login/utils/guardHelper.class";
|
||||||
|
import {UserManagementService} from "../../services/user-management.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'linking-generic',
|
selector: 'linking-generic',
|
||||||
|
@ -51,12 +53,17 @@ export class LinkingGenericComponent {
|
||||||
constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
|
constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
|
||||||
private _meta: Meta, private _title: Title, private _piwikService:PiwikService,
|
private _meta: Meta, private _title: Title, private _piwikService:PiwikService,
|
||||||
private seoService: SEOService, private helper: HelperService, private cdr: ChangeDetectorRef,
|
private seoService: SEOService, private helper: HelperService, private cdr: ChangeDetectorRef,
|
||||||
private location: Location) {
|
private location: Location, private userManagementService: UserManagementService) {
|
||||||
}
|
}
|
||||||
subscriptions = [];
|
subscriptions = [];
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if(this.breadcrumbs.length === 0) {
|
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
||||||
|
if (!user) {
|
||||||
|
this.saveStateAndRedirectLogin();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
if(this.breadcrumbs.length === 0) {
|
||||||
this.breadcrumbs.push({name: 'home', route: '/'});
|
this.breadcrumbs.push({name: 'home', route: '/'});
|
||||||
this.breadcrumbs.push({name: "Link", route: null});
|
this.breadcrumbs.push({name: "Link", route: null});
|
||||||
}
|
}
|
||||||
|
@ -94,6 +101,11 @@ export class LinkingGenericComponent {
|
||||||
if(localStorage.getItem(this.localStoragePrefix + "sources")){
|
if(localStorage.getItem(this.localStoragePrefix + "sources")){
|
||||||
this.sources = JSON.parse(localStorage.getItem(this.localStoragePrefix + "sources"));
|
this.sources = JSON.parse(localStorage.getItem(this.localStoragePrefix + "sources"));
|
||||||
}
|
}
|
||||||
|
if(localStorage.getItem(this.localStoragePrefix + "claimsJob")){
|
||||||
|
let job = JSON.parse(localStorage.getItem(this.localStoragePrefix + "claimsJob"));
|
||||||
|
if(job.status != "COMPLETE"){
|
||||||
|
this.showOptions.show = 'claim'; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,4 +218,20 @@ export class LinkingGenericComponent {
|
||||||
this.location.back();
|
this.location.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
saveStateAndRedirectLogin() {
|
||||||
|
|
||||||
|
if (this.results != null) {
|
||||||
|
localStorage.setItem(this.localStoragePrefix + "results", JSON.stringify(this.results));
|
||||||
|
}
|
||||||
|
if (this.sources != null) {
|
||||||
|
localStorage.setItem(this.localStoragePrefix + "sources", JSON.stringify(this.sources));
|
||||||
|
}
|
||||||
|
|
||||||
|
this._router.navigate(['/user-info'], {
|
||||||
|
queryParams: {
|
||||||
|
"errorCode": LoginErrorCodes.NOT_VALID,
|
||||||
|
"redirectUrl": this._router.url
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,6 +250,14 @@
|
||||||
None of the links saved.
|
None of the links saved.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="message.type == 'jobError'">
|
||||||
|
|
||||||
|
<div class="">
|
||||||
|
<span class=" uk-text-bold">The saving status of your links can't be fetched. Please check your links or start over. </span>
|
||||||
|
<br>
|
||||||
|
<a routerLinkActive="router-link-active" routerLink="/myclaims">Manage your links here</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="warnings.length > 0"
|
<div *ngIf="warnings.length > 0"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import {StringUtils} from "../../utils/string-utils.class";
|
import {StringUtils} from "../../utils/string-utils.class";
|
||||||
import {properties} from "../../../../environments/environment";
|
|
||||||
import {SelectionCriteria} from "../../utils/entities/contentProvider";
|
import {SelectionCriteria} from "../../utils/entities/contentProvider";
|
||||||
|
|
||||||
export class CommunityInfo {
|
export class CommunityInfo {
|
||||||
|
@ -36,6 +35,11 @@ export class CommunityInfo {
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public isOpen() {
|
||||||
|
return !(this.membership && this.membership === 'byInvitation');
|
||||||
|
}
|
||||||
|
|
||||||
public isPublic(){
|
public isPublic(){
|
||||||
return this.status == "all" || this.status == "PUBLIC";
|
return this.status == "all" || this.status == "PUBLIC";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import {HttpParams} from '@angular/common/http';
|
import {HttpParams} from '@angular/common/http';
|
||||||
import {properties} from "../../../environments/environment";
|
import {properties} from "../../../environments/environment";
|
||||||
import {Session} from "../login/utils/helper.class";
|
import {Session} from "../login/utils/helper.class";
|
||||||
|
import {CommunityInfo} from "./community/communityInfo";
|
||||||
|
|
||||||
export class ConnectHelper {
|
export class ConnectHelper {
|
||||||
|
|
||||||
|
@ -8,7 +9,7 @@ export class ConnectHelper {
|
||||||
if(properties.environment == "development" &&
|
if(properties.environment == "development" &&
|
||||||
(properties.adminToolsPortalType == "connect" || properties.adminToolsPortalType == "community"
|
(properties.adminToolsPortalType == "connect" || properties.adminToolsPortalType == "community"
|
||||||
|| properties.adminToolsPortalType == "aggregator" || properties.adminToolsPortalType == "eosc")) {
|
|| properties.adminToolsPortalType == "aggregator" || properties.adminToolsPortalType == "eosc")) {
|
||||||
domain = "test.openaire.eu"; //for testing
|
domain = "covid-19.openaire.eu"; //for testing
|
||||||
}
|
}
|
||||||
domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix
|
domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix
|
||||||
if (domain.indexOf('eosc-portal.eu') != -1) {
|
if (domain.indexOf('eosc-portal.eu') != -1) {
|
||||||
|
@ -53,7 +54,12 @@ export class ConnectHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static isPrivate(community, 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))))
|
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))
|
||||||
|
)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,45 +11,60 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
selector: 'availableOn',
|
selector: 'availableOn',
|
||||||
template: `
|
template: `
|
||||||
<ng-container *ngIf="availableOn && availableOn.length > 0">
|
<ng-container *ngIf="availableOn && availableOn.length > 0">
|
||||||
<div class="uk-flex uk-flex-middle" [ngClass]="isMobile && !(usedBy == 'landing') ? 'uk-margin-left uk-margin-xsmall-bottom' : ''">
|
<div class="uk-flex uk-flex-middle"
|
||||||
<ng-container *ngIf="availableOn[0].downloadUrl">
|
[ngClass]="isMobile ? ('uk-flex-column ' + (!(usedBy == 'landing') ? 'uk-margin-left uk-margin-xsmall-bottom' : '')) : 'uk-grid uk-grid-small uk-child-width-auto'"
|
||||||
<span [class]="'uk-margin-xsmall-right ' + (availableOn[0].accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"
|
[attr.uk-grid]="!isMobile ? '' : null">
|
||||||
uk-tooltip [title]="getAccessLabel(availableOn[0].accessRight)">
|
<div *ngIf="properties.environment != 'production' && availableOn[0].fulltext" class="uk-flex uk-flex-middle"
|
||||||
<icon [name]="availableOn[0].accessRightIcon" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
|
[ngClass]="isMobile ? 'uk-width-1-1' : 'uk-text-bolder'">
|
||||||
</span>
|
<a [href]="availableOn[0].fulltext" target="_blank"
|
||||||
<ng-container *ngIf="!isMobile">
|
class="uk-flex uk-flex-middle uk-button-link"
|
||||||
<a uk-tooltip="Source" target="_blank"
|
[ngClass]="isMobile ? ((usedBy == 'landing') ? 'uk-width-1-1 uk-padding-small uk-padding-remove-horizontal' : '') : 'uk-flex-center'">
|
||||||
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder">
|
<!-- <icon [flex]="true" [ratio]="0.7" name="download" visuallyHidden="download"></icon>-->
|
||||||
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
|
<icon name="download" visuallyHidden="donwload" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
|
||||||
<span>
|
<span class="uk-margin-xsmall-left">Full-Text</span>
|
||||||
<!-- <icon [flex]="true" [name]="'expand_' + (isOpen?'less':'more')"></icon>-->
|
</a>
|
||||||
<icon [flex]="true" [name]="(isOpen?'arrow_drop_up':'arrow_drop_down')"></icon>
|
</div>
|
||||||
</span>
|
<div *ngIf="isMobile && (usedBy == 'landing') && availableOn[0].fulltext" class="uk-width-1-1"><hr></div>
|
||||||
</a>
|
<div *ngIf="availableOn[0].downloadUrl" [ngClass]="isMobile ? 'uk-width-1-1' : ''">
|
||||||
<div #dropElement uk-drop="mode: click; pos: bottom-left; flip: false; shift: false" class="uk-drop download-drop">
|
<div class="uk-flex uk-flex-middle" [ngClass]="isMobile ? ((usedBy == 'landing') ? 'uk-padding-small uk-padding-remove-horizontal' : '') : ''">
|
||||||
|
<span [class]="'uk-margin-xsmall-right ' + (availableOn[0].accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"
|
||||||
|
uk-tooltip [title]="getAccessLabel(availableOn[0].accessRight)">
|
||||||
|
<icon [name]="availableOn[0].accessRightIcon" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
|
||||||
|
</span>
|
||||||
|
<ng-container *ngIf="!isMobile">
|
||||||
|
<a uk-tooltip="Source" target="_blank"
|
||||||
|
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder">
|
||||||
|
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
|
||||||
|
<span>
|
||||||
|
<!-- <icon [flex]="true" [name]="'expand_' + (isOpen?'less':'more')"></icon>-->
|
||||||
|
<icon [flex]="true" [name]="(isOpen?'arrow_drop_up':'arrow_drop_down')"></icon>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<div #dropElement uk-drop="mode: click; pos: bottom-left; flip: false; shift: false" class="uk-drop download-drop">
|
||||||
<div class="uk-card uk-card-default uk-padding-small uk-padding-remove-horizontal uk-text-small uk-height-max-large uk-overflow-auto">
|
<div class="uk-card uk-card-default uk-padding-small uk-padding-remove-horizontal uk-text-small uk-height-max-large uk-overflow-auto">
|
||||||
<ng-container *ngTemplateOutlet="availableOnList"></ng-container>
|
<ng-container *ngTemplateOutlet="availableOnList"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngIf="isMobile">
|
<ng-container *ngIf="isMobile">
|
||||||
<a #toggle class="uk-flex uk-flex-between uk-flex-middle uk-flex-center uk-width-expand uk-button-link">
|
<a #toggle class="uk-flex uk-flex-between uk-flex-middle uk-flex-center uk-width-expand uk-button-link">
|
||||||
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
|
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
|
||||||
<span>
|
<span>
|
||||||
<icon [flex]="true" ratio="1.5" name="arrow_right"></icon>
|
<icon [flex]="true" ratio="1.5" name="arrow_right"></icon>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<mobile-dropdown [toggle]="toggle">
|
<mobile-dropdown [toggle]="toggle">
|
||||||
<div class="uk-text-emphasis uk-text-bolder uk-text-center uk-padding-small uk-padding-remove-vertical uk-text-uppercase">
|
<div class="uk-text-emphasis uk-text-bolder uk-text-center uk-padding-small uk-padding-remove-vertical uk-text-uppercase">
|
||||||
Sources
|
Sources
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-text-small download-drop uk-padding uk-padding-remove-horizontal">
|
<div class="uk-text-small download-drop uk-padding uk-padding-remove-horizontal">
|
||||||
<ng-container *ngTemplateOutlet="availableOnList"></ng-container>
|
<ng-container *ngTemplateOutlet="availableOnList"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
</mobile-dropdown>
|
</mobile-dropdown>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ng-container>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
@ -80,6 +95,14 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
||||||
</a>
|
</a>
|
||||||
<ng-template #elseBlock> {{instance.license}}</ng-template>
|
<ng-template #elseBlock> {{instance.license}}</ng-template>
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="properties.environment != 'production' && instance.fulltext" class="uk-text-meta uk-text-truncate" uk-tooltip [title]="instance.fulltext">
|
||||||
|
Full-Text:
|
||||||
|
<a *ngIf="isUrl(instance.fulltext); else elseBlock"
|
||||||
|
[href]="instance.fulltext" target="_blank" class="custom-external uk-link-text">
|
||||||
|
{{instance.fulltext}}
|
||||||
|
</a>
|
||||||
|
<ng-template #elseBlock> {{instance.fulltext}}</ng-template>
|
||||||
|
</div>
|
||||||
<div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta">
|
<div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta">
|
||||||
<span>Data sources: </span>
|
<span>Data sources: </span>
|
||||||
<a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index" [routerLink]="dataProviderUrl"
|
<a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index" [routerLink]="dataProviderUrl"
|
||||||
|
@ -145,4 +168,6 @@ export class AvailableOnComponent {
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected readonly properties = properties;
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,7 +264,8 @@ export class ParsingFunctions {
|
||||||
"accessRightIcon": "",
|
"accessRightIcon": "",
|
||||||
"types": [],
|
"types": [],
|
||||||
"years": [],
|
"years": [],
|
||||||
"license": ""
|
"license": "",
|
||||||
|
"fulltext": ""
|
||||||
};
|
};
|
||||||
|
|
||||||
if (instance.hasOwnProperty("hostedby")) {
|
if (instance.hasOwnProperty("hostedby")) {
|
||||||
|
@ -354,42 +355,59 @@ export class ParsingFunctions {
|
||||||
available.license = Array.isArray(instance['license']) ? instance['license'][0] : instance['license'];
|
available.license = Array.isArray(instance['license']) ? instance['license'][0] : instance['license'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(instance.hasOwnProperty("fulltext")) {
|
||||||
|
available.fulltext = instance['fulltext'];
|
||||||
|
}
|
||||||
|
|
||||||
hostedBy_collectedFrom.push(available);
|
hostedBy_collectedFrom.push(available);
|
||||||
}
|
}
|
||||||
|
|
||||||
compareHostedByCollectedFrom(a: HostedByCollectedFrom, b: HostedByCollectedFrom) {
|
compareHostedByCollectedFrom(a: HostedByCollectedFrom, b: HostedByCollectedFrom) {
|
||||||
|
let retValue: number = 0;
|
||||||
let firstAccessRight: string = (a.accessRight ? a.accessRight.toLowerCase() : null);
|
let firstAccessRight: string = (a.accessRight ? a.accessRight.toLowerCase() : null);
|
||||||
let secondAccessRight: string = (b.accessRight ? b.accessRight.toLowerCase() : null);
|
let secondAccessRight: string = (b.accessRight ? b.accessRight.toLowerCase() : null);
|
||||||
|
|
||||||
if (firstAccessRight === secondAccessRight) {
|
if (firstAccessRight !== secondAccessRight) {
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
if (firstAccessRight === 'open access') {
|
if (firstAccessRight === 'open access') {
|
||||||
return -1;
|
retValue = -1;
|
||||||
} else if (secondAccessRight === 'open access') {
|
} else if (secondAccessRight === 'open access') {
|
||||||
return 1;
|
retValue = 1;
|
||||||
} else if (firstAccessRight === "open source") {
|
} else if (firstAccessRight === "open source") {
|
||||||
return -1;
|
retValue = -1;
|
||||||
} else if (secondAccessRight === "open source") {
|
} else if (secondAccessRight === "open source") {
|
||||||
return 1;
|
retValue = 1;
|
||||||
} else if (firstAccessRight === "embargo") {
|
} else if (firstAccessRight === "embargo") {
|
||||||
return -1;
|
retValue = -1;
|
||||||
} else if (secondAccessRight === "embargo") {
|
} else if (secondAccessRight === "embargo") {
|
||||||
return 1;
|
retValue = 1;
|
||||||
} else if (firstAccessRight === "restricted") {
|
} else if (firstAccessRight === "restricted") {
|
||||||
return -1;
|
retValue = -1;
|
||||||
} else if (secondAccessRight === "restricted") {
|
} else if (secondAccessRight === "restricted") {
|
||||||
return 1;
|
retValue = 1;
|
||||||
} else if (firstAccessRight === "closed access") {
|
} else if (firstAccessRight === "closed access") {
|
||||||
return -1;
|
retValue = -1;
|
||||||
} else if (secondAccessRight === "closed access") {
|
} else if (secondAccessRight === "closed access") {
|
||||||
return 1;
|
retValue = 1;
|
||||||
} else if (firstAccessRight === "not available") {
|
} else if (firstAccessRight === "not available") {
|
||||||
return -1;
|
retValue = -1;
|
||||||
} else if (secondAccessRight === "not available") {
|
} else if (secondAccessRight === "not available") {
|
||||||
return 1;
|
retValue = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(retValue == 0) {
|
||||||
|
let firstFulltext: string = (a.fulltext ? a.fulltext : null);
|
||||||
|
let secondFulltext: string = (b.fulltext ? b.fulltext : null);
|
||||||
|
|
||||||
|
if (firstFulltext && !secondFulltext) {
|
||||||
|
return -1;
|
||||||
|
} else if (!firstFulltext && secondFulltext) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -390,7 +390,7 @@
|
||||||
<div>
|
<div>
|
||||||
<ng-container *ngIf="resultLandingInfo.measure.bip.length">
|
<ng-container *ngIf="resultLandingInfo.measure.bip.length">
|
||||||
<ng-container *ngFor="let measure of resultLandingInfo.measure.bip">
|
<ng-container *ngFor="let measure of resultLandingInfo.measure.bip">
|
||||||
<div *ngIf="measure.value" class="cell uk-flex uk-flex-middle uk-margin-xsmall-bottom">
|
<div class="cell uk-flex uk-flex-middle uk-margin-xsmall-bottom">
|
||||||
<icon [name]="measure.icon" [ratio]="0.8" [flex]="true"></icon>
|
<icon [name]="measure.icon" [ratio]="0.8" [flex]="true"></icon>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -406,7 +406,7 @@
|
||||||
<div>
|
<div>
|
||||||
<ng-container *ngIf="resultLandingInfo.measure.bip.length">
|
<ng-container *ngIf="resultLandingInfo.measure.bip.length">
|
||||||
<ng-container *ngFor="let measure of resultLandingInfo.measure.bip">
|
<ng-container *ngFor="let measure of resultLandingInfo.measure.bip">
|
||||||
<div *ngIf="measure.value" class="cell uk-margin-xsmall-bottom">
|
<div class="cell uk-margin-xsmall-bottom">
|
||||||
<a class="uk-text-capitalize">{{measure.name}}</a>
|
<a class="uk-text-capitalize">{{measure.name}}</a>
|
||||||
<ng-container *ngTemplateOutlet="dropInfo; context: {option: measure.name, isCompact: false}"></ng-container>
|
<ng-container *ngTemplateOutlet="dropInfo; context: {option: measure.name, isCompact: false}"></ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
@ -424,14 +424,14 @@
|
||||||
<div class="uk-text-uppercase uk-text-bolder">
|
<div class="uk-text-uppercase uk-text-bolder">
|
||||||
<ng-container *ngIf="resultLandingInfo.measure.bip.length">
|
<ng-container *ngIf="resultLandingInfo.measure.bip.length">
|
||||||
<ng-container *ngFor="let measure of resultLandingInfo.measure.bip">
|
<ng-container *ngFor="let measure of resultLandingInfo.measure.bip">
|
||||||
<ng-container *ngIf="isNumber(measure)">
|
<ng-container *ngIf="isNumber(measure.value)">
|
||||||
<div *ngIf="measure.value" [attr.uk-tooltip]="measure.value >= 1000 ? 'cls: uk-active' : 'cls: uk-invisible'"
|
<div [attr.uk-tooltip]="measure.value >= 1000 ? 'cls: uk-active' : 'cls: uk-invisible'"
|
||||||
title="{{measure.value | number}}" class="cell uk-margin-xsmall-bottom">
|
title="{{measure.value | number}}" class="cell uk-margin-xsmall-bottom">
|
||||||
{{formatNumber(measure.value)}}
|
{{formatNumber(measure.value)}}
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngIf="!isNumber(measure)">
|
<ng-container *ngIf="!isNumber(measure.value)">
|
||||||
<div *ngIf="measure.value" class="cell uk-margin-xsmall-bottom">
|
<div class="cell uk-margin-xsmall-bottom">
|
||||||
{{measure.value}}
|
{{measure.value}}
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -613,7 +613,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="mobileContent == 'actions'" class="uk-container uk-section">
|
<div *ngIf="mobileContent == 'actions'" class="uk-container uk-section">
|
||||||
<ng-container *ngIf="resultLandingInfo?.hostedBy_collectedFrom">
|
<ng-container *ngIf="resultLandingInfo?.hostedBy_collectedFrom">
|
||||||
<div class="uk-padding-small uk-padding-remove-horizontal">
|
<div class="">
|
||||||
<div class="clickable uk-button-link uk-flex uk-flex-middle uk-h6 uk-margin-remove"
|
<div class="clickable uk-button-link uk-flex uk-flex-middle uk-h6 uk-margin-remove"
|
||||||
(click)=" onSelectActiveTab('availableOn')">
|
(click)=" onSelectActiveTab('availableOn')">
|
||||||
<availableOn [availableOn]="resultLandingInfo.hostedBy_collectedFrom" (viewAllClicked)="viewAll=$event"
|
<availableOn [availableOn]="resultLandingInfo.hostedBy_collectedFrom" (viewAllClicked)="viewAll=$event"
|
||||||
|
|
|
@ -34,7 +34,7 @@ import {ClearCacheService} from "../services/clear-cache.service";
|
||||||
<loading></loading>
|
<loading></loading>
|
||||||
</div>
|
</div>
|
||||||
</modal-alert>
|
</modal-alert>
|
||||||
<modal-alert #memberModal [overflowBody]="false" *ngIf="service == 'monitor'" (cancelOutput)="cancel()"
|
<modal-alert #memberModal [overflowBody]="false" (cancelOutput)="cancel()"
|
||||||
(alertOutput)="verifyMember()" [okDisabled]="(code.invalid || loading) && !isMember">
|
(alertOutput)="verifyMember()" [okDisabled]="(code.invalid || loading) && !isMember">
|
||||||
<div *ngIf="!isMember">
|
<div *ngIf="!isMember">
|
||||||
<div>
|
<div>
|
||||||
|
@ -119,12 +119,8 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
if (this.paramsSubscription instanceof Subscription) {
|
|
||||||
this.paramsSubscription.unsubscribe();
|
|
||||||
}
|
|
||||||
this.paramsSubscription = this.route.queryParams.subscribe(params => {
|
this.paramsSubscription = this.route.queryParams.subscribe(params => {
|
||||||
if (params) {
|
if (params) {
|
||||||
this.isMember = !!params['isMember'];
|
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
if(params['verify'] && !this.isMember) {
|
if(params['verify'] && !this.isMember) {
|
||||||
if (this.user) {
|
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.user.email === this.verification.email.toLowerCase() && this.id === this.verification.entity && this.type === this.verification.type) {
|
||||||
if (this.verification.verificationType === 'manager') {
|
if (this.verification.verificationType === 'manager') {
|
||||||
this.openManagerModal();
|
this.openManagerModal();
|
||||||
} else if (this.verification.verificationType === 'member' && this.service === "monitor") {
|
} else if (this.verification.verificationType === 'member') {
|
||||||
this.openMemberModal();
|
this.openMemberModal();
|
||||||
} else {
|
} else {
|
||||||
this.openErrorModal();
|
this.openErrorModal();
|
||||||
|
@ -217,6 +213,9 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
|
||||||
this.managerModal.cancel();
|
this.managerModal.cancel();
|
||||||
this.error = null;
|
this.error = null;
|
||||||
this.userManagementService.updateUserInfo(() => {
|
this.userManagementService.updateUserInfo(() => {
|
||||||
|
if (this.paramsSubscription instanceof Subscription) {
|
||||||
|
this.paramsSubscription.unsubscribe();
|
||||||
|
}
|
||||||
if (this.service === "monitor") {
|
if (this.service === "monitor") {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.router.navigate(['/admin/' + this.verification.entity]);
|
this.router.navigate(['/admin/' + this.verification.entity]);
|
||||||
|
@ -254,8 +253,12 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
|
||||||
this.clearCacheService.clearCache('Members updated');
|
this.clearCacheService.clearCache('Members updated');
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.error = null;
|
this.error = null;
|
||||||
|
this.isMember = true;
|
||||||
this.userManagementService.updateUserInfo(() => {
|
this.userManagementService.updateUserInfo(() => {
|
||||||
this.router.navigate([], {queryParams: {'verify': null, 'isMember': true}});
|
if (this.paramsSubscription instanceof Subscription) {
|
||||||
|
this.paramsSubscription.unsubscribe();
|
||||||
|
}
|
||||||
|
this.cancel();
|
||||||
});
|
});
|
||||||
}, error => {
|
}, error => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
@ -271,6 +274,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
|
||||||
}
|
}
|
||||||
|
|
||||||
cancel() {
|
cancel() {
|
||||||
this.router.navigate([], {queryParams: {'verify': null, 'isMember': null}});
|
this.isMember = false;
|
||||||
|
this.router.navigate([]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,17 +16,12 @@ export class CustomOptions {
|
||||||
return {
|
return {
|
||||||
headers: new HttpHeaders({
|
headers: new HttpHeaders({
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'X-XSRF-TOKEN': COOKIE.getCookie(COOKIE.cookieName_id)?COOKIE.getCookie(COOKIE.cookieName_id):''
|
|
||||||
}), withCredentials: true
|
}), withCredentials: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getAuthOptions():{} {
|
public static getAuthOptions():{} {
|
||||||
return {
|
return this.getAuthOptionsWithBody();
|
||||||
headers: new HttpHeaders({
|
|
||||||
'X-XSRF-TOKEN': (COOKIE.getCookie(COOKIE.cookieName_id)) ? COOKIE.getCookie(COOKIE.cookieName_id) : ''
|
|
||||||
}), withCredentials: true
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -112,7 +112,7 @@
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/contact-noads">NOADs</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/contact-noads">NOADs</a></li>
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/guides">Guides</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/guides">Guides</a></li>
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/faqs">FAQs</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/faqs">FAQs</a></li>
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/frontpage/webinars">Webinars</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/support/webinars">Webinars</a></li>
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/helpdesk">Ask a question</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/helpdesk">Ask a question</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -123,7 +123,7 @@
|
||||||
<ul class="uk-nav uk-nav-default" uk-nav>
|
<ul class="uk-nav uk-nav-default" uk-nav>
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/news/">News</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/news/">News</a></li>
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/events">Events</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/events">Events</a></li>
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/blogs/magazine">Blogs</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/blogs">Blogs</a></li>
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/newsletters">Newsletter</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/newsletters">Newsletter</a></li>
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/public-documents">Documents</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/public-documents">Documents</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -231,10 +231,10 @@ declare var UIkit;
|
||||||
</div>
|
</div>
|
||||||
</mobile-dropdown>
|
</mobile-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<span *ngIf="formControl?.invalid && formControl?.touched" class="uk-text-danger">
|
<span *ngIf="formControl?.invalid && formControl?.touched" class="uk-text-small uk-text-danger">
|
||||||
<span *ngIf="errors?.error">{{errors?.error}}</span>
|
<span *ngIf="errors?.error">{{errors?.error}}</span>
|
||||||
<span *ngIf="type === 'URL' || type === 'logoURL'">Please provide a valid URL (e.g. https://example.com)</span>
|
<span *ngIf="type === 'URL' || type === 'logoURL'">Please provide a valid URL (e.g. https://example.com)</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="uk-text-small uk-text-danger">
|
<span class="uk-text-small uk-text-danger">
|
||||||
<ng-content select="[error]"></ng-content>
|
<ng-content select="[error]"></ng-content>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -90,7 +90,7 @@ export class SearchInputComponent implements OnInit, AfterViewInit {
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
if(typeof document !== 'undefined') {
|
if(typeof document !== 'undefined') {
|
||||||
this.ratio = Number.parseFloat(getComputedStyle(this.searchInput.nativeElement).getPropertyValue('--search-input-icon-ratio'));
|
this.ratio = Number.parseFloat(getComputedStyle(this.searchInput.nativeElement).getPropertyValue('--search-input-icon-ratio'));
|
||||||
this.cdr.detectChanges()
|
this.cdr.detectChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ export class SliderColumnComponent implements AfterContentInit, OnDestroy {
|
||||||
@Input()
|
@Input()
|
||||||
type: 'slider' | 'nav' = null;
|
type: 'slider' | 'nav' = null;
|
||||||
@Input()
|
@Input()
|
||||||
animation = 'uk-animation-fade';
|
animation = null;
|
||||||
@ContentChildren(SliderItemComponent) items: QueryList<SliderItemComponent>;
|
@ContentChildren(SliderItemComponent) items: QueryList<SliderItemComponent>;
|
||||||
@ContentChildren(SliderNavItemComponent) navItems: QueryList<SliderNavItemComponent>;
|
@ContentChildren(SliderNavItemComponent) navItems: QueryList<SliderNavItemComponent>;
|
||||||
public isMobile: boolean;
|
public isMobile: boolean;
|
||||||
|
@ -35,12 +35,14 @@ export class SliderColumnComponent implements AfterContentInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterContentInit() {
|
ngAfterContentInit() {
|
||||||
this.slides.forEach(slide => {
|
if (this.animation) {
|
||||||
slide.init(this.animation);
|
this.slides.forEach(slide => {
|
||||||
});
|
slide.init(this.animation);
|
||||||
this.navItems.forEach(slide => {
|
});
|
||||||
slide.init(this.animation);
|
this.navItems.forEach(slide => {
|
||||||
});
|
slide.init(this.animation);
|
||||||
|
});
|
||||||
|
}
|
||||||
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
|
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
|
||||||
this.isMobile = isMobile;
|
this.isMobile = isMobile;
|
||||||
}));
|
}));
|
||||||
|
@ -56,9 +58,7 @@ export class SliderColumnComponent implements AfterContentInit, OnDestroy {
|
||||||
if (this.type === 'nav') {
|
if (this.type === 'nav') {
|
||||||
let slides = this.navItems;
|
let slides = this.navItems;
|
||||||
for (let i = 0; i < slides.length; i++) {
|
for (let i = 0; i < slides.length; i++) {
|
||||||
if (this.isMobile) {
|
slides.get(i).setActive(!this.isMobile || (slides.get(i).start <= time && (!slides.get(i + 1) || slides.get(i + 1).start > time)));
|
||||||
slides.get(i).setActive(slides.get(i).start <= time && (!slides.get(i + 1) || slides.get(i + 1).start > time));
|
|
||||||
}
|
|
||||||
slides.get(i).active = slides.get(i).start <= time && (!slides.get(i + 1) || slides.get(i + 1).start > time);
|
slides.get(i).active = slides.get(i).start <= time && (!slides.get(i + 1) || slides.get(i + 1).start > time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ export class Stage {
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'slider-container',
|
selector: 'slider-container',
|
||||||
template: `
|
template: `
|
||||||
<div class="uk-grid uk-grid-large uk-flex uk-flex-middle uk-child-width-1-1" [ngClass]="'uk-child-width-1-' + sliders?.length + '@s'" uk-grid>
|
<div class="uk-grid uk-grid-large uk-flex uk-flex-middle uk-flex-between uk-child-width-1-1" [ngClass]="'uk-child-width-1-' + sliders?.length + '@m'" uk-grid>
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="navigation === 'progress' && stages.length > 0" class="uk-flex uk-flex-center uk-margin-large-top">
|
<div *ngIf="navigation === 'progress' && stages.length > 0" class="uk-flex uk-flex-center uk-margin-large-top">
|
||||||
|
@ -60,7 +60,7 @@ export class SliderContainerComponent implements OnInit, OnDestroy, AfterContent
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
if(this.observer) {
|
if(this.observer && typeof IntersectionObserver !== 'undefined') {
|
||||||
this.observer.disconnect();
|
this.observer.disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,24 +78,26 @@ export class SliderContainerComponent implements OnInit, OnDestroy, AfterContent
|
||||||
}
|
}
|
||||||
|
|
||||||
setObserver() {
|
setObserver() {
|
||||||
let options = {
|
if(typeof IntersectionObserver !== 'undefined') {
|
||||||
root: null,
|
let options = {
|
||||||
rootMargin: '0px',
|
root: null,
|
||||||
threshold: 0.1
|
rootMargin: '0px',
|
||||||
};
|
threshold: 0.1
|
||||||
this.observer = new IntersectionObserver(entries => {
|
};
|
||||||
entries.forEach(entry => {
|
this.observer = new IntersectionObserver(entries => {
|
||||||
if (entry.isIntersecting && !this.initialized) {
|
entries.forEach(entry => {
|
||||||
this.stopped = false;
|
if (entry.isIntersecting && !this.initialized) {
|
||||||
this.start(0);
|
this.stopped = false;
|
||||||
this.initialized = true;
|
this.start(0);
|
||||||
} else {
|
this.initialized = true;
|
||||||
this.initialized = false;
|
} else {
|
||||||
this.stopped = true;
|
this.initialized = false;
|
||||||
}
|
this.stopped = true;
|
||||||
});
|
}
|
||||||
}, options);
|
});
|
||||||
this.observer.observe(this.element.nativeElement);
|
}, options);
|
||||||
|
this.observer.observe(this.element.nativeElement);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
start(time: number) {
|
start(time: number) {
|
||||||
|
|
|
@ -302,21 +302,23 @@ export class Composer {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static composeEmailForCommunityDashboard(name: string, recipient: string) {
|
public static composeEmailForCommunityDashboard(name: string, role: "manager" | "member", recipient: string) {
|
||||||
let email: Email = new Email();
|
let email: Email = new Email();
|
||||||
email.subject = 'OpenAIRE Connect | ' + name;
|
email.subject = 'OpenAIRE Connect | ' + name;
|
||||||
email.body = this.composeMessageForCommunityDashboard(name);
|
email.body = this.composeMessageForCommunityDashboard(name, role);
|
||||||
email.recipient = recipient;
|
email.recipient = recipient;
|
||||||
return email;
|
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 = '<p>Dear ((__user__)),</p>' +
|
let message = '<p>Dear ((__user__)),</p>' +
|
||||||
'<p>You have been invited to be a manager of the OpenAIRE Research Community Dashboard for the ' + name + '.</p>' +
|
'<p>You have been invited to be a ' + role + ' of the OpenAIRE Research Community Dashboard for the ' + name + '.</p>' +
|
||||||
'<p>Click <a href="((__link__))" target="_blank">this URL</a> and use the verification code below to accept the invitation.</p>' +
|
'<p>Click <a href="((__link__))" target="_blank">this URL</a> and use the verification code below to accept the invitation.</p>' +
|
||||||
'<p>The verification code is <b>((__code__))</b>.</p>' +
|
'<p>The verification code is <b>((__code__))</b>.</p>' +
|
||||||
|
(role === 'manager'?
|
||||||
'<p>As a manager of the OpenAIRE Research Community Dashboard, you will have access to the administration part of the dashboard, ' +
|
'<p>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 + '.</p>' +
|
'where you will be able to customize and manage the content of the ' + name + '.</p>':
|
||||||
|
'<p>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.</p>') +
|
||||||
'<p>Please contact us at <a href="mailto:' + properties.helpdeskEmail+'">' + properties.helpdeskEmail +
|
'<p>Please contact us at <a href="mailto:' + properties.helpdeskEmail+'">' + properties.helpdeskEmail +
|
||||||
'</a> if you have any questions or concerns.</p>' +
|
'</a> if you have any questions or concerns.</p>' +
|
||||||
'<p>Kind Regards<br>The OpenAIRE Team</p>' +
|
'<p>Kind Regards<br>The OpenAIRE Team</p>' +
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {EnvProperties} from "../properties/env-properties";
|
||||||
routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
|
routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
|
||||||
[title]="'Link '+openaireEntities.RESULTS+' with a '+openaireEntities.PROJECT+', a '+openaireEntities.COMMUNITY+' or other '+openaireEntities.RESULTS+' and make the new information available in OpenAIRE information space.'"
|
[title]="'Link '+openaireEntities.RESULTS+' with a '+openaireEntities.PROJECT+', a '+openaireEntities.COMMUNITY+' or other '+openaireEntities.RESULTS+' and make the new information available in OpenAIRE information space.'"
|
||||||
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
|
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
|
||||||
class="uk-flex uk-flex-middle uk-button-link uk-text-bolder" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-flex-center'">
|
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
|
||||||
<icon [flex]="true" [ratio]="0.7" name="link_to" visuallyHidden="link"></icon>
|
<icon [flex]="true" [ratio]="0.7" name="link_to" visuallyHidden="link"></icon>
|
||||||
<span class="uk-margin-xsmall-left">Link to</span>
|
<span class="uk-margin-xsmall-left">Link to</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -25,15 +25,15 @@ import {EnvProperties} from "../properties/env-properties";
|
||||||
<a (click)="openAddThisModal()"
|
<a (click)="openAddThisModal()"
|
||||||
[title]="'Share this '+getTypeName() + ' in your social networks'"
|
[title]="'Share this '+getTypeName() + ' in your social networks'"
|
||||||
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'"
|
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'"
|
||||||
class="uk-flex uk-flex-middle uk-button-link uk-text-bolder" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-flex-center'">
|
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
|
||||||
<icon [flex]="true" [ratio]="0.8" name="share" visuallyHidden="share"></icon>
|
<icon class="uk-text-bolder" [flex]="true" [ratio]="0.8" name="share" visuallyHidden="share"></icon>
|
||||||
<span class="uk-margin-xsmall-left">Share</span>
|
<span class="uk-margin-xsmall-left">Share</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="cite">
|
<div *ngIf="cite">
|
||||||
<a (click)="openCiteModal()"
|
<a (click)="openCiteModal()"
|
||||||
class="uk-flex uk-flex-middle uk-button-link uk-text-bolder" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-flex-center'">
|
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
|
||||||
<icon [flex]="true" [ratio]="0.7" name="cite" visuallyHidden="cite"></icon>
|
<icon class="uk-text-bolder" [flex]="true" [ratio]="0.7" name="cite" visuallyHidden="cite"></icon>
|
||||||
<span class="uk-margin-xsmall-left">Cite</span>
|
<span class="uk-margin-xsmall-left">Cite</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -41,7 +41,7 @@ import {EnvProperties} from "../properties/env-properties";
|
||||||
<a routerLinkActive="router-link-active" routerLink="/participate/deposit/learn-how"
|
<a routerLinkActive="router-link-active" routerLink="/participate/deposit/learn-how"
|
||||||
[title]="'Find a repository to deposit or publish your research in Open Access'"
|
[title]="'Find a repository to deposit or publish your research in Open Access'"
|
||||||
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
|
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
|
||||||
class="uk-flex uk-flex-middle uk-button-link uk-text-bolder" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-flex-center'">
|
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
|
||||||
<icon flex="true" ratio="0.7" name="upload" visuallyHidden="upload"></icon>
|
<icon flex="true" ratio="0.7" name="upload" visuallyHidden="upload"></icon>
|
||||||
<span class="uk-margin-xsmall-left">Deposit</span>
|
<span class="uk-margin-xsmall-left">Deposit</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -50,7 +50,7 @@ import {EnvProperties} from "../properties/env-properties";
|
||||||
<a (click)="openEmbedResultsModal()"
|
<a (click)="openEmbedResultsModal()"
|
||||||
[title]="'Embed the related '+openaireEntities.RESULTS+' of this '+getTypeName()+' in your website'"
|
[title]="'Embed the related '+openaireEntities.RESULTS+' of this '+getTypeName()+' in your website'"
|
||||||
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
|
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
|
||||||
class="uk-flex uk-flex-middle uk-button-link uk-text-bolder" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-flex-center'">
|
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
|
||||||
<icon flex="true" ratio="0.8" name="code" visuallyHidden="code"></icon>
|
<icon flex="true" ratio="0.8" name="code" visuallyHidden="code"></icon>
|
||||||
<span class="uk-margin-xsmall-left">Embed</span>
|
<span class="uk-margin-xsmall-left">Embed</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -12,6 +12,7 @@ export class FetchResearchResults {
|
||||||
private errorMessages: ErrorMessagesComponent;
|
private errorMessages: ErrorMessagesComponent;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
|
public allResults =[]; // in case of paging
|
||||||
|
|
||||||
public requestComplete: Subject<void>;
|
public requestComplete: Subject<void>;
|
||||||
|
|
||||||
|
@ -88,7 +89,8 @@ export class FetchResearchResults {
|
||||||
this.subscriptions.push(this._searchResearchResultsService.advancedSearchResults(resultType, "", page, size, "resultdateofacceptance,descending", properties, "&type=results&fq=communityid=" + communityId +(contextId?'&fq=categoryid=' + encodeURIComponent(contextId):'')).subscribe(
|
this.subscriptions.push(this._searchResearchResultsService.advancedSearchResults(resultType, "", page, size, "resultdateofacceptance,descending", properties, "&type=results&fq=communityid=" + communityId +(contextId?'&fq=categoryid=' + encodeURIComponent(contextId):'')).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.searchUtils.totalResults = data[0];
|
this.searchUtils.totalResults = data[0];
|
||||||
this.results = data[1];
|
this.allResults = data[1];
|
||||||
|
this.results = data[1].slice(0, 5) ;
|
||||||
|
|
||||||
this.searchUtils.status = this.errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
|
|
|
@ -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",
|
||||||
|
}
|
|
@ -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",
|
||||||
|
}
|
|
@ -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",
|
||||||
|
}
|
|
@ -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",
|
||||||
|
}
|
|
@ -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",
|
||||||
|
}
|
|
@ -11,6 +11,7 @@ export interface HostedByCollectedFrom {
|
||||||
years: string[];
|
years: string[];
|
||||||
accessRightIcon: string;
|
accessRightIcon: string;
|
||||||
license?: string;
|
license?: string;
|
||||||
|
fulltext?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Journal {
|
export interface Journal {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input, SimpleChanges} from '@angular/core';
|
||||||
import {EnvProperties} from "../../properties/env-properties";
|
import {EnvProperties} from "../../properties/env-properties";
|
||||||
import {ErrorCodes} from "../../properties/errorCodes";
|
import {ErrorCodes} from "../../properties/errorCodes";
|
||||||
import {OpenaireEntities} from "../../properties/searchFields";
|
import {OpenaireEntities} from "../../properties/searchFields";
|
||||||
|
@ -41,7 +41,7 @@ import {StringUtils} from "../../string-utils.class";
|
||||||
|
|
||||||
<ng-container *ngIf="fetch.searchUtils.status == errorCodes.DONE">
|
<ng-container *ngIf="fetch.searchUtils.status == errorCodes.DONE">
|
||||||
<search-result [properties]="properties"
|
<search-result [properties]="properties"
|
||||||
[results]="results"
|
[results]="fetch.results"
|
||||||
[status]="fetch.searchUtils.status"
|
[status]="fetch.searchUtils.status"
|
||||||
[type]="resultType" [showEnermaps]="showEnermaps" [prevPath]="prevPath">
|
[type]="resultType" [showEnermaps]="showEnermaps" [prevPath]="prevPath">
|
||||||
</search-result>
|
</search-result>
|
||||||
|
@ -67,7 +67,6 @@ export class SearchTabComponent {
|
||||||
@Input() properties: EnvProperties;
|
@Input() properties: EnvProperties;
|
||||||
@Input() customTitle;
|
@Input() customTitle;
|
||||||
@Input() showEnermaps: boolean;
|
@Input() showEnermaps: boolean;
|
||||||
@Input() currentPage: number = null;
|
|
||||||
|
|
||||||
public errorCodes: ErrorCodes = new ErrorCodes();
|
public errorCodes: ErrorCodes = new ErrorCodes();
|
||||||
|
|
||||||
|
@ -75,10 +74,6 @@ export class SearchTabComponent {
|
||||||
return StringUtils.getEntityName(entityType, true);
|
return StringUtils.getEntityName(entityType, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
get results() {
|
|
||||||
return this.currentPage ? this.fetch.results.slice((this.currentPage - 1) * this.searchNumber, this.currentPage * this.searchNumber) : this.fetch.results;
|
|
||||||
}
|
|
||||||
|
|
||||||
get paramsForExternalUrl() {
|
get paramsForExternalUrl() {
|
||||||
let parameters: string = "";
|
let parameters: string = "";
|
||||||
Object.keys(this.params).forEach(paramKey => {
|
Object.keys(this.params).forEach(paramKey => {
|
||||||
|
|
Loading…
Reference in New Issue