Merge branch 'new-theme' of code-repo.d4science.org:MaDgIK/openaire-library into new-theme

This commit is contained in:
argirok 2022-09-16 17:30:43 +03:00
commit 59c09d0295
22 changed files with 224 additions and 235 deletions

View File

@ -35,8 +35,7 @@
<div [class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '"> <div [class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '">
<div *ngIf="properties" class="uk-section uk-padding-remove-top"> <div *ngIf="properties" class="uk-section uk-padding-remove-top">
<div [class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '"> <div [class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '">
<div id="basketStickTop"></div> <div class="uk-grid basketContainer" *ngIf="showOptions.show!='claim'" uk-grid>
<div class="uk-grid basketContainer" *ngIf="showOptions.show!='claim'">
<div class="uk-width-2-3 uk-position-z-index"> <div class="uk-width-2-3 uk-position-z-index">
<div *ngIf="showOptions.show=='source'"> <div *ngIf="showOptions.show=='source'">
<claim-result-search-form [selectedResults]="sources" [properties]=properties <claim-result-search-form [selectedResults]="sources" [properties]=properties
@ -66,113 +65,113 @@
</div> </div>
<!-- Basket--> <!-- Basket-->
<div *ngIf="showOptions.show != 'claim'" class="uk-width-1-3"> <div *ngIf="showOptions.show != 'claim'" class="uk-width-1-3">
<div id="basket" uk-sticky=" offset: 220; top:#basketStickTop; end: .basketContainer; media: @m" <div id="basket" uk-sticky="offset: 220; bottom: !*; media: @m" style="z-index: 0!important;">
class="uk-card uk-card-default linkingBasket" style="z-index: 0!important;"> <div class="uk-card uk-card-default linkingBasket">
<div class="uk-card-body uk-padding-small"> <div class="uk-card-body uk-padding-small">
<div class="uk-margin-right"> <div class="uk-margin-right">
<ul class="uk-tab" uk-tab> <ul class="uk-tab" uk-tab>
<li [class.uk-active]="showOptions.basketShowSources" <li [class.uk-active]="showOptions.basketShowSources"
(click)="showOptions.basketswitchToSources()"> (click)="showOptions.basketswitchToSources()">
<a> <a>
Sources to link ({{(sources.length + (inlineEntity ? 1 : 0)) |number}}) Sources to link ({{(sources.length + (inlineEntity ? 1 : 0)) |number}})
</a> </a>
</li> </li>
<li [class.uk-disabled]="sources.length == 0 && !inlineEntity" <li [class.uk-disabled]="sources.length == 0 && !inlineEntity"
[class.uk-active]="showOptions.basketShowLinksTo"> [class.uk-active]="showOptions.basketShowLinksTo">
<a (click)="showOptions.basketswitchToLinkTo()">Link to <span <a (click)="showOptions.basketswitchToLinkTo()">Link to <span
*ngIf="results.length> 0">({{(results.length) | number}})</span> *ngIf="results.length> 0">({{(results.length) | number}})</span>
</a> </a>
</li> </li>
</ul> </ul>
<div *ngIf="showOptions.basketShowSources"> <div *ngIf="showOptions.basketShowSources">
<div class="uk-height-medium uk-overflow-auto"> <div class="uk-height-medium uk-overflow-auto">
<div *ngIf="showOptions.show == 'source'" class="uk-padding-small uk-padding-remove-horizontal" style="min-height:17px;"> <div *ngIf="showOptions.show == 'source'" class="uk-padding-small uk-padding-remove-horizontal" style="min-height:17px;">
<start-over *ngIf="showOptions.show == 'source' && sources.length> 0" <start-over *ngIf="showOptions.show == 'source' && sources.length> 0"
[results]="sources" [results]="sources"
[localStoragePrefix]="localStoragePrefix+'sources'" [localStoragePrefix]="localStoragePrefix+'sources'"
message="all sources" class="uk-float-right"></start-over> message="all sources" class="uk-float-right"></start-over>
<bulk-claim *ngIf="showOptions.show == 'source'" [results]="sources" <bulk-claim *ngIf="showOptions.show == 'source'" [results]="sources"
[properties]=properties [properties]=properties
[localStoragePrefix]="localStoragePrefix+'sources'" [basketLimit]="basketLimit" [localStoragePrefix]="localStoragePrefix+'sources'" [basketLimit]="basketLimit"
> >
</bulk-claim> </bulk-claim>
</div>
<div class="uk-padding-small uk-padding-remove-horizontal">
<div *ngIf="sources.length == 0 && !inlineEntity " class="uk-text-center uk-text-meta">
No Sources added yet. Start adding sources from the left panel. Or upload a DOI's CSV file.
</div> </div>
<div *ngIf="sources.length >= basketLimit " class="uk-alert uk-alert-warning uk-text-center"> <div class="uk-padding-small uk-padding-remove-horizontal">
Basket reached the size limit. No more sources can be added. <div *ngIf="sources.length == 0 && !inlineEntity " class="uk-text-center uk-text-meta">
No Sources added yet. Start adding sources from the left panel. Or upload a DOI's CSV file.
</div>
<div *ngIf="sources.length >= basketLimit " class="uk-alert uk-alert-warning uk-text-center">
Basket reached the size limit. No more sources can be added.
</div>
<claim-selected-results *ngIf="inlineEntity" [results]="[inlineEntity]"
[localStoragePrefix]="localStoragePrefix+'sources'" class=""
[enableRemove]="false" type="source">
</claim-selected-results>
<claim-selected-results *ngIf="sources.length > 0" [results]="sources"
[localStoragePrefix]="localStoragePrefix+'sources'" class=""
[enableRemove]="true" type="source">
</claim-selected-results>
</div> </div>
<claim-selected-results *ngIf="inlineEntity" [results]="[inlineEntity]"
[localStoragePrefix]="localStoragePrefix+'sources'" class=""
[enableRemove]="false" type="source">
</claim-selected-results>
<claim-selected-results *ngIf="sources.length > 0" [results]="sources"
[localStoragePrefix]="localStoragePrefix+'sources'" class=""
[enableRemove]="true" type="source">
</claim-selected-results>
</div> </div>
</div> </div>
</div> <div *ngIf="showOptions.basketShowLinksTo">
<div *ngIf="showOptions.basketShowLinksTo"> <div class="uk-height-medium uk-overflow-auto">
<div class="uk-height-medium uk-overflow-auto"> <div *ngIf="(results.length)> 0 || showOptions.show=='result'" class="uk-padding-small uk-padding-remove-horizontal" style="min-height: 17px;">
<div *ngIf="(results.length)> 0 || showOptions.show=='result'" class="uk-padding-small uk-padding-remove-horizontal" style="min-height: 17px;"> <start-over *ngIf=" (results.length)> 0"
<start-over *ngIf=" (results.length)> 0" [results]="results" [localStoragePrefix]="localStoragePrefix+'results'"
[results]="results" [localStoragePrefix]="localStoragePrefix+'results'" message="all results (projects, communities, research results)"
message="all results (projects, communities, research results)" class="uk-float-right"></start-over>
class="uk-float-right"></start-over> <bulk-claim *ngIf="showOptions.show=='result'" [results]="results" [properties]=properties
<bulk-claim *ngIf="showOptions.show=='result'" [results]="results" [properties]=properties [localStoragePrefix]="localStoragePrefix+'results'"
[localStoragePrefix]="localStoragePrefix+'results'" [basketLimit]="basketLimit"></bulk-claim>
[basketLimit]="basketLimit"></bulk-claim>
</div>
<div class="uk-padding-small uk-padding-remove-horizontal">
<div *ngIf="results.length >= basketLimit "
class="uk-alert uk-alert-warning uk-text-center">
Basket reached the size limit. No more entities can be added.
</div>
<claim-selected-results sectionTitle="Selected Results" [results]="results"
[localStoragePrefix]="localStoragePrefix+'results'" type="target">
</claim-selected-results>
<div *ngIf="(results.length) == 0 " class=" uk-text-center">
No entities to link with the sources. Start adding entities from the left panel.
</div> </div>
<div class="uk-padding-small uk-padding-remove-horizontal">
<div *ngIf="results.length >= basketLimit "
class="uk-alert uk-alert-warning uk-text-center">
Basket reached the size limit. No more entities can be added.
</div>
<claim-selected-results sectionTitle="Selected Results" [results]="results"
[localStoragePrefix]="localStoragePrefix+'results'" type="target">
</claim-selected-results>
<div *ngIf="(results.length) == 0 " class=" uk-text-center">
No entities to link with the sources. Start adding entities from the left panel.
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <div *ngIf="showOptions.show == 'source'"
<div *ngIf="showOptions.show == 'source'" class="uk-card-footer uk-flex uk-flex-center clickable"
class="uk-card-footer uk-flex uk-flex-center clickable" [class.uk-tile-primary]="sources.length > 0"
[class.uk-tile-primary]="sources.length > 0" [class.uk-background-muted]="sources.length == 0"
[class.uk-background-muted]="sources.length == 0" [class.uk-disabled]="sources.length == 0"
[class.uk-disabled]="sources.length == 0" (click)="stepHasChanged('target')">
(click)="stepHasChanged('target')"> <button class="uk-flex uk-flex-middle uk-button uk-button-text"
<button class="uk-flex uk-flex-middle uk-button uk-button-text" [class.uk-disabled]="sources.length == 0" [disabled]="sources.length == 0">
[class.uk-disabled]="sources.length == 0" [disabled]="sources.length == 0"> <icon name="link" visuallyHidden="link" [flex]="true"></icon>
<icon name="link" visuallyHidden="link" [flex]="true"></icon> <div class="uk-width-expand uk-margin-small-left">STEP 2 - LINK SOURCES TO ENTITIES</div>
<div class="uk-width-expand uk-margin-small-left">STEP 2 - LINK SOURCES TO ENTITIES</div> </button>
</button>
</div> </div>
<div *ngIf="showOptions.show != 'source'" <div *ngIf="showOptions.show != 'source'"
class="uk-card-footer uk-flex uk-flex-center clickable" class="uk-card-footer uk-flex uk-flex-center clickable"
[class.uk-tile-primary]="results.length > 0" [class.uk-tile-primary]="results.length > 0"
[class.uk-background-muted]="results.length == 0" [class.uk-background-muted]="results.length == 0"
[class.uk-disabled]="results.length == 0" (click)="stepHasChanged('claim')"> [class.uk-disabled]="results.length == 0" (click)="stepHasChanged('claim')">
<button class="uk-flex uk-flex-middle uk-button uk-button-text" <button class="uk-flex uk-flex-middle uk-button uk-button-text"
[class.uk-disabled]="results.length == 0" [disabled]="results.length == 0"> [class.uk-disabled]="results.length == 0" [disabled]="results.length == 0">
<icon *ngIf="inlineEntity" name="link" visuallyHidden="link" [flex]="true"></icon> <icon *ngIf="inlineEntity" name="link" visuallyHidden="link" [flex]="true"></icon>
<div class="uk-width-expand uk-margin-small-left">STEP {{inlineEntity ? '2' : '3'}} - FINALISE AND FINISH</div> <div class="uk-width-expand uk-margin-small-left">STEP {{inlineEntity ? '2' : '3'}} - FINALISE AND FINISH</div>
</button> </button>
</div>
</div> </div>
</div> </div>
</div> </div>
<!-- <helper position="right" styleName=" uk-width-1-5"></helper>--> <!-- <helper position="right" styleName=" uk-width-1-5"></helper>-->
</div> </div>
<div id="basketStickBottom"></div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0" <helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']"></helper> [texts]="pageContents['bottom']"></helper>
</div> </div>

View File

@ -22,7 +22,7 @@ export class ConnectAdminLoginGuard implements CanActivate, CanActivateChild {
check(community: string, path: string): Observable<boolean> | boolean { check(community: string, path: string): Observable<boolean> | boolean {
let errorCode = LoginErrorCodes.NOT_LOGIN; let errorCode = LoginErrorCodes.NOT_LOGIN;
const authorized = this.userManagementService.getUserInfo(false).pipe(take(1), map(user => { const authorized = this.userManagementService.getUserInfo().pipe(take(1), map(user => {
if (user) { if (user) {
if (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager('community', community, user)) { if (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager('community', community, user)) {
return of(true); return of(true);

View File

@ -30,7 +30,7 @@ export class ConnectSubscriberGuard implements CanActivate, CanActivateChild {
} else { } else {
community = ConnectHelper.getCommunityFromDomain(properties.domain); community = ConnectHelper.getCommunityFromDomain(properties.domain);
} }
const authorized = this.userManagementService.getUserInfo(false).pipe(take(1), map(user => { const authorized = this.userManagementService.getUserInfo().pipe(take(1), map(user => {
if (user) { if (user) {
if (Session.isSubscribedTo('community', community, user)) { if (Session.isSubscribedTo('community', community, user)) {
return of(true); return of(true);

View File

@ -58,10 +58,10 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class';
<span class="uk-text-meta">Funding stream: </span>{{item.funding}} <span class="uk-text-meta">Funding stream: </span>{{item.funding}}
</li> </li>
</ul> </ul>
<div *ngIf="item.provenanceAction || item.validated" class="uk-text-meta"> <div *ngIf="getVocabularyLabel(item, provenanceActionVocabulary, i) || item.validated" class="uk-text-meta">
<span *ngIf="item.validated">Validated by funder</span> <span *ngIf="item.validated">Validated by funder</span>
<span *ngIf="item.provenanceAction && item.validated"> | </span> <span *ngIf="item.provenanceAction && item.validated"> | </span>
<span *ngIf="item.provenanceAction">{{getVocabularyLabel(item.provenanceAction, provenanceActionVocabulary)}}</span> <span *ngIf="item.provenanceAction">{{item.provenanceAction}}</span>
</div> </div>
</div> </div>
</div> </div>
@ -80,6 +80,7 @@ export class FundedByComponent {
public url = properties.searchLinkToProject.split('?')[0]; public url = properties.searchLinkToProject.split('?')[0];
public title: string = "Funded by"; public title: string = "Funded by";
@Input() provenanceActionVocabulary = null; @Input() provenanceActionVocabulary = null;
public provenancesCalculated: boolean[] = [];
public viewAllClick() { public viewAllClick() {
if(this.fundedByProjects.length <= this.threshold*2) { if(this.fundedByProjects.length <= this.threshold*2) {
@ -96,7 +97,11 @@ export class FundedByComponent {
this.viewAllClicked.emit(""); this.viewAllClicked.emit("");
} }
public getVocabularyLabel(value: any, vocabulary: any) { public getVocabularyLabel(item: any, vocabulary: any, index: number) {
return HelperFunctions.getVocabularyLabel(value, vocabulary); if(!this.provenancesCalculated[index]) {
this.provenancesCalculated[index] = true;
item.provenanceAction = HelperFunctions.getVocabularyLabel(item.provenanceAction, vocabulary, false);
}
return item.provenanceAction;
} }
} }

View File

@ -273,7 +273,7 @@ export class ParsingFunctions {
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
let hostedBy = Array.isArray(instance['hostedby']) ? instance['hostedby'][i] : instance['hostedby']; let hostedBy = Array.isArray(instance['hostedby']) ? instance['hostedby'][i] : instance['hostedby'];
if (hostedBy.name && hostedBy.name != "other resources" && hostedBy.name != "Unknown Repository") { if (hostedBy.name && hostedBy.name != "other resources" && hostedBy.name != "Unknown Repository") {
downloadNames.add(hostedBy.name); downloadNames.add(String(hostedBy.name));
} }
} }
available.downloadNames = Array.from(downloadNames); available.downloadNames = Array.from(downloadNames);
@ -288,7 +288,7 @@ export class ParsingFunctions {
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
let collectedFrom = Array.isArray(instance['collectedfrom']) ? instance['collectedfrom'][i] : instance['collectedfrom']; let collectedFrom = Array.isArray(instance['collectedfrom']) ? instance['collectedfrom'][i] : instance['collectedfrom'];
if(collectedFrom.name && collectedFrom.id) { if(collectedFrom.name && collectedFrom.id) {
available.collectedNamesAndIds.set(collectedFrom.name, collectedFrom.id); available.collectedNamesAndIds.set(String(collectedFrom.name), collectedFrom.id);
} }
} }
} }
@ -399,42 +399,6 @@ export class ParsingFunctions {
} }
// publication & dataset & software & orp landing : for relatedResearchResults // publication & dataset & software & orp landing : for relatedResearchResults
parseRelatedResearchResults(relatedResearchResults: RelationResult[], relation: any, provenanceAction: string):
RelationResult[] {
if (relatedResearchResults == undefined) {
relatedResearchResults = []
}
relatedResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "trust", provenanceAction));
return relatedResearchResults;
}
// publication & dataset & software & orp landing : for supplementaryResearchResults
parseSupplementaryResearchResults(supplementaryResearchResults: RelationResult[], relation: any): RelationResult[] {
if (supplementaryResearchResults == undefined) {
supplementaryResearchResults = [];
}
supplementaryResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "trust"));
return supplementaryResearchResults;
}
// publication & dataset & software & orp landing : for supplementedByResearchResults
parseSupplementedByResearchResults(supplementedByResearchResults: RelationResult[], relation: any): RelationResult[] {
if (supplementedByResearchResults == undefined) {
supplementedByResearchResults = [];
}
supplementedByResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "trust"));
return supplementedByResearchResults;
}
// publication & dataset & software & orp landing : for similarResearchResults
parseSimilarResearchResults(similarResearchResults: RelationResult[], relation: any): RelationResult[] {
if (similarResearchResults == undefined) {
similarResearchResults = [];
}
similarResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "similarity"));
return similarResearchResults;
}
parseResults(researchResults: RelationResult[], relation, provenanceAction: string, relationName: string): RelationResult[] { parseResults(researchResults: RelationResult[], relation, provenanceAction: string, relationName: string): RelationResult[] {
if (researchResults == undefined) { if (researchResults == undefined) {
researchResults = []; researchResults = [];
@ -465,8 +429,17 @@ export class ParsingFunctions {
} }
} }
researchResult['id'] = relation['to'].content; researchResult['id'] = relation['to'].content;
let titleName = Array.isArray(relation['title']) ? relation['title'][0].content : (relation['title']?relation['title'].content:null); if(Array.isArray(relation['title'])) {
researchResult['name'] = titleName; for(let i=0; i<relation['title'].length; i++) {
if(relation['title'][i] && relation['title'][i].content) {
if(!researchResult['name'] || relation['title'][i].classid == "main title") {
researchResult['name'] = String(relation['title'][i].content);
}
}
}
} else {
researchResult['name'] = (relation['title'] && relation['title'].content) ? String(relation['title'].content) : "";
}
if(!researchResult['name']) { if(!researchResult['name']) {
researchResult['name'] = "[no title available]"; researchResult['name'] = "[no title available]";
} }
@ -489,50 +462,6 @@ export class ParsingFunctions {
return researchResults; return researchResults;
} }
parseResearchResults(researchResults: RelationResult[], relation: any, percentageName: string = "trust"): RelationResult[] {
if (researchResults == undefined) {
researchResults = [];
}
researchResults.push(this.parseRelatedOrSimilarResearchResult(relation, percentageName));
return researchResults;
}
// publication & dataset & software & orp landing : for relatedResearchResults and similarResearchResults
parseRelatedOrSimilarResearchResult(relation: any, percentageName: string, provenanceAction: string = null): RelationResult {
let researchResult: RelationResult = {
name: "",
id: "",
date: "",
percentage: null,
class: "",
provenanceAction: provenanceAction
};
if(relation['resulttype']) {
if (relation['resulttype'].classname == "publication") {
researchResult['class'] = "publication";
} else if (relation['resulttype'].classname == "dataset") {
researchResult['class'] = "dataset";
} else if (relation['resulttype'].classname == "software") {
researchResult['class'] = "software";
} else if (relation['resulttype'].classname == "other") {
researchResult['class'] = "other";
}
}
researchResult['id'] = relation['to'].content;
let titleName = Array.isArray(relation['title']) ? relation['title'][0].content : (relation['title']?relation['title'].content:null);
researchResult['name'] = titleName;
if(!researchResult['name']) {
researchResult['name'] = "[no title available]";
}
if (relation.hasOwnProperty("dateofacceptance")) {
var date: string = ((Array.isArray(relation.dateofacceptance)) ? (relation.dateofacceptance[0]) : (relation.dateofacceptance)) + ""; // transform to string in case it is an integer
researchResult['date'] = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;
}
//researchResult['date'] = relation.dateofacceptance.substring(0,4);;
researchResult['percentage'] = Math.round(relation[percentageName] * 100);
return researchResult;
}
sortByPercentage(results: RelationResult[]): RelationResult[] { sortByPercentage(results: RelationResult[]): RelationResult[] {
if (results) { if (results) {
return results.sort(function (a, b) { return results.sort(function (a, b) {

View File

@ -18,7 +18,7 @@ import {properties} from "../../../../environments/environment";
Subjects by Vocabulary Subjects by Vocabulary
</div> </div>
<ng-container *ngTemplateOutlet="subjects_by_vocabulary_template; context: {customClasses: 'multi-line-ellipsis lines-2', id: 'content'}"></ng-container> <ng-container *ngTemplateOutlet="subjects_by_vocabulary_template; context: {customClasses: 'multi-line-ellipsis lines-2', id: 'content'}"></ng-container>
<ng-container *ngTemplateOutlet="eosc_subjects_template"></ng-container> <ng-container *ngIf="eoscSubjects && eoscSubjects.length > 0"><ng-container *ngTemplateOutlet="eosc_subjects_template"></ng-container></ng-container>
<div *ngIf="isClassifiedLarge" class="uk-text-right"> <div *ngIf="isClassifiedLarge" class="uk-text-right">
<a (click)="openSubjectsByVocabularyModal()" class="view-more-less-link">View all</a> <a (click)="openSubjectsByVocabularyModal()" class="view-more-less-link">View all</a>
</div> </div>
@ -97,7 +97,7 @@ import {properties} from "../../../../environments/environment";
<modal-alert #subjectsByVocabularyModal *ngIf="(classifiedSubjects && classifiedSubjects.size > 0) || (eoscSubjects && eoscSubjects.length > 0)" large="true"> <modal-alert #subjectsByVocabularyModal *ngIf="(classifiedSubjects && classifiedSubjects.size > 0) || (eoscSubjects && eoscSubjects.length > 0)" large="true">
<div class="uk-text-small"> <div class="uk-text-small">
<ng-container *ngTemplateOutlet="subjects_by_vocabulary_template"></ng-container> <ng-container *ngTemplateOutlet="subjects_by_vocabulary_template"></ng-container>
<ng-container *ngTemplateOutlet="eosc_subjects_template"></ng-container> <ng-container *ngIf="eoscSubjects && eoscSubjects.length > 0"><ng-container *ngTemplateOutlet="eosc_subjects_template"></ng-container></ng-container>
</div> </div>
</modal-alert> </modal-alert>
` `

View File

@ -87,7 +87,7 @@ export class ResultLandingService {
res[1]['oaf:result']['pid'], // 4 res[1]['oaf:result']['pid'], // 4
res[1]['oaf:result']['journal'], // 5 res[1]['oaf:result']['journal'], // 5
res[1]['oaf:result']['language'], // 6 res[1]['oaf:result']['language'], // 6
res[1]['oaf:result']['eoscifgiudelines'], // 7 res[1]['oaf:result']['eoscifguidelines'], // 7
res[1]['oaf:result']['subject'], // 8 res[1]['oaf:result']['subject'], // 8
res[1]['oaf:result']['context'], // 9 res[1]['oaf:result']['context'], // 9
res[1]['oaf:result']['creator'], // 10 res[1]['oaf:result']['creator'], // 10

View File

@ -22,7 +22,7 @@ export class AdminLoginGuard implements CanActivate, CanActivateChild {
check(data: Data, path: string): Observable<boolean> { check(data: Data, path: string): Observable<boolean> {
let errorCode = LoginErrorCodes.NOT_LOGIN; let errorCode = LoginErrorCodes.NOT_LOGIN;
return this.userManagementService.getUserInfo(false).pipe(map(user => { return this.userManagementService.getUserInfo().pipe(map(user => {
if (user) { if (user) {
errorCode = LoginErrorCodes.NOT_ADMIN; errorCode = LoginErrorCodes.NOT_ADMIN;
} }

View File

@ -15,7 +15,7 @@ export class ClaimsCuratorGuard implements CanActivate {
check(path: string): Observable<boolean> | boolean { check(path: string): Observable<boolean> | boolean {
let errorCode = LoginErrorCodes.NOT_LOGIN; let errorCode = LoginErrorCodes.NOT_LOGIN;
return this.userManagementService.getUserInfo(false).pipe(map(user => { return this.userManagementService.getUserInfo().pipe(map(user => {
if (user) { if (user) {
errorCode = LoginErrorCodes.NOT_ADMIN; errorCode = LoginErrorCodes.NOT_ADMIN;
} }

View File

@ -22,7 +22,7 @@ export class LoginGuard implements CanActivate, CanLoad, CanActivateChild {
} }
check(path: string): Observable<boolean> | boolean { check(path: string): Observable<boolean> | boolean {
return this.userManagementService.getUserInfo(false).pipe(map(user => { return this.userManagementService.getUserInfo().pipe(map(user => {
return user !== null; return user !== null;
}),tap(isLoggedIn => { }),tap(isLoggedIn => {
if(!isLoggedIn) { if(!isLoggedIn) {

View File

@ -43,8 +43,8 @@ export class UserComponent {
this.loginUrl = this.properties.loginUrl; this.loginUrl = this.properties.loginUrl;
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
this.server = false; this.server = false;
this.subscriptions.push(this.userManagementsService.getUserInfo(false).subscribe(user => { this.userManagementsService.updateUserInfo(() => {
this.user = user; this.user = this.userManagementsService.user;
this.loggedIn = !!this.user; this.loggedIn = !!this.user;
this.errorMessage = ""; this.errorMessage = "";
this.loading = true; this.loading = true;
@ -58,7 +58,7 @@ export class UserComponent {
this.loading = false; this.loading = false;
} }
})); }));
})); });
} }
} }

View File

@ -26,7 +26,7 @@ import {Subscriber} from "rxjs";
<h5>Indicator themes that we are covering in the Monitor dashboards.</h5> <h5>Indicator themes that we are covering in the Monitor dashboards.</h5>
<p> <p>
Please be aware that this is the current set, which will be enriched as requests and data are coming into the Please be aware that this is the current set, which will be enriched as requests and data are coming into the
<a href="https://graph.openaire.eu" class="text-graph" target="_blank">OpenAIRE Research Graph</a>. We are in your disposal to add more indicator themes that may fit your needs. <a href="https://graph.openaire.eu" class="text-graph" target="_blank">OpenAIRE Research Graph</a>. We are at your disposal to add more indicator themes that may fit your needs.
</p> </p>
<p> <p>
Check out the indicator pages (for <a [routerLink]="['../funder']" [relativeTo]="route">funders</a>, Check out the indicator pages (for <a [routerLink]="['../funder']" [relativeTo]="route">funders</a>,

View File

@ -1,4 +1,4 @@
import {Component, OnDestroy, OnInit} from "@angular/core"; import {ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild} from "@angular/core";
import {Subscription} from "rxjs"; import {Subscription} from "rxjs";
import {Meta, Title} from "@angular/platform-browser"; import {Meta, Title} from "@angular/platform-browser";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
@ -7,9 +7,19 @@ import {SEOService} from "../../sharedComponents/SEO/SEO.service";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
declare var ResizeObserver;
@Component({ @Component({
selector: 'terminology', selector: 'terminology',
template: ` template: `
<div id="graph_element" #graph_element class="uk-blur-background" uk-sticky="bottom: true;" [attr.offset]="graph_offset">
<div class="uk-container uk-container-large uk-margin-small-top uk-margin-small-bottom">
<icon name="graph" customClass="text-graph"></icon>
<span class="uk-margin-small-left uk-text-meta">More information for </span>
<a href="https://graph.openaire.eu" class="text-graph">OpenAIRE Research Graph</a>
<span class="uk-text-meta">.</span>
</div>
</div>
<div class="uk-container uk-container-large uk-section uk-section-small uk-padding-remove-bottom"> <div class="uk-container uk-container-large uk-section uk-section-small uk-padding-remove-bottom">
<div class="uk-padding-small uk-padding-remove-horizontal"> <div class="uk-padding-small uk-padding-remove-horizontal">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs> <breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
@ -361,7 +371,7 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
<dd class="uk-width-1-3@m uk-width-1-1"> <dd class="uk-width-1-3@m uk-width-1-1">
<p>APC information is obtained from DOAJ using DOAJs exportable version of the journal metadata (<a <p>APC information is obtained from DOAJ using DOAJs exportable version of the journal metadata (<a
href="https://doaj.org/docs/public-data-dump/" target="_blank">https://doaj.org/docs/public-data-dump/</a>). href="https://doaj.org/docs/public-data-dump/" target="_blank">https://doaj.org/docs/public-data-dump/</a>).
We used it to determine whether a particular fully OA journal charges APCs. </p> We use it to determine whether a particular fully OA journal charges APCs. </p>
</dd> </dd>
</div> </div>
<hr> <hr>
@ -435,12 +445,12 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
</dl> </dl>
</li> </li>
</ul> </ul>
<div class="uk-margin-medium-top"> <!-- <div class="uk-margin-medium-top">
<icon name="graph" customClass="text-graph"></icon> <icon name="graph" customClass="text-graph"></icon>
<span class="uk-margin-small-left uk-text-meta">More information for </span> <span class="uk-margin-small-left uk-text-meta">More information for </span>
<a href="https://graph.openaire.eu" class="text-graph">OpenAIRE Research Graph</a> <a href="https://graph.openaire.eu" class="text-graph">OpenAIRE Research Graph</a>
<span class="uk-text-meta">.</span> <span class="uk-text-meta">.</span>
</div> </div> -->
</div> </div>
</div> </div>
` `
@ -450,12 +460,16 @@ export class TerminologyComponent implements OnInit, OnDestroy {
private subscriptions: any[] = []; private subscriptions: any[] = [];
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Resources'}, {name: 'Terminology and construction', keepFormat: true}]; public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Resources'}, {name: 'Terminology and construction', keepFormat: true}];
public graph_offset: number = 0;
public graph_height: number = 0;
@ViewChild("graph_element") graph_element;
constructor(private seoService: SEOService, constructor(private seoService: SEOService,
private meta: Meta, private meta: Meta,
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private title: Title) { private title: Title,
private cdr: ChangeDetectorRef) {
} }
ngOnInit() { ngOnInit() {
@ -467,6 +481,20 @@ export class TerminologyComponent implements OnInit, OnDestroy {
this.breadcrumbs[0].name = (params['stakeholder']?'dashboard':'home'); this.breadcrumbs[0].name = (params['stakeholder']?'dashboard':'home');
})); }));
} }
ngAfterViewInit() {
if (typeof document !== 'undefined') {
if(this.graph_element) {
this.observeGraphElement();
}
}
}
ngAfterContentChecked() {
if(this.graph_element && typeof document !== 'undefined') {
this.graph_offset = this.calcGraphOffset(this.graph_element.nativeElement);
}
}
ngOnDestroy() { ngOnDestroy() {
this.subscriptions.forEach(subscription => { this.subscriptions.forEach(subscription => {
@ -475,6 +503,24 @@ export class TerminologyComponent implements OnInit, OnDestroy {
} }
}); });
} }
public observeGraphElement() {
let resizeObs = new ResizeObserver(entries => {
entries.forEach(entry => {
setTimeout(() => {
this.graph_offset = this.calcGraphOffset(entry.target);
this.cdr.detectChanges();
});
})
});
this.subscriptions.push(resizeObs);
resizeObs.observe(this.graph_element.nativeElement);
}
calcGraphOffset(element) {
this.graph_height = element.offsetHeight;
return window.innerHeight-this.graph_height;
}
metaTags(title, description) { metaTags(title, description) {
const url = properties.domain + properties.baseLink + this.router.url; const url = properties.domain + properties.baseLink + this.router.url;

View File

@ -103,7 +103,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
ngAfterViewInit() { ngAfterViewInit() {
this.subs.push(this.route.queryParams.subscribe(params => { this.subs.push(this.route.queryParams.subscribe(params => {
if (params && params['verify']) { if (params && params['verify']) {
this.subs.push(this.userManagementService.getUserInfo(false).subscribe(user => { this.subs.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user; this.user = user;
if (this.user) { if (this.user) {
this.subs.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => { this.subs.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => {

View File

@ -103,7 +103,7 @@ export class SearchAllComponent {
resultTypes = {publication: true, dataset: true, software: true, other: true}; resultTypes = {publication: true, dataset: true, software: true, other: true};
//adv Search Form //adv Search Form
public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS; public fieldIds: string[] = this.searchFields.getResultAdvancedFields();
public fieldIdsMap = this.searchFields.RESULT_FIELDS; public fieldIdsMap = this.searchFields.RESULT_FIELDS;
public selectedFields: AdvancedField[] = []; public selectedFields: AdvancedField[] = [];

View File

@ -62,7 +62,7 @@ export class SearchResearchResultsComponent {
public searchUtils: SearchUtilsClass = new SearchUtilsClass(); public searchUtils: SearchUtilsClass = new SearchUtilsClass();
public searchFields: SearchFields = new SearchFields(); public searchFields: SearchFields = new SearchFields();
public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS; public fieldIds: string[] = this.searchFields.getResultAdvancedFields();
public fieldIdsMap = this.searchFields.RESULT_FIELDS; public fieldIdsMap = this.searchFields.RESULT_FIELDS;
public rangeFields: string[][] = this.searchFields.RESULT_RANGE_FIELDS; public rangeFields: string[][] = this.searchFields.RESULT_RANGE_FIELDS;
public selectedFields: AdvancedField[] = []; public selectedFields: AdvancedField[] = [];

View File

@ -6,7 +6,7 @@ import {
OnChanges, OnChanges,
OnDestroy, OnDestroy,
OnInit, OnInit,
Output, SimpleChanges, SimpleChanges,
ViewChild ViewChild
} from '@angular/core'; } from '@angular/core';
import {Location} from '@angular/common'; import {Location} from '@angular/common';
@ -985,7 +985,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
} }
} }
if (doisParams.length > 0) { if (doisParams.length > 0) {
params += this.createQuotedKeywordQuery(value, id, operatorId, countParams, true, true, includes) + (includes?(" or " + doisParams + ")"):")"); params += this.createQuotedKeywordQuery(value, id, operatorId, countParams, true, true, includes) + " or " + doisParams;
} else { } else {
//if it is PIDs but no doisquery produced, forced to use quotes as the query will fail due to special characters //if it is PIDs but no doisquery produced, forced to use quotes as the query will fail due to special characters
params += this.createQuotedKeywordQuery(value, id, operatorId, countParams, true, params += this.createQuotedKeywordQuery(value, id, operatorId, countParams, true,

View File

@ -16,22 +16,11 @@ export class UserManagementService {
private readonly getUserInfoSubject: AdvancedAsyncSubject<User> = new AdvancedAsyncSubject<User>(); private readonly getUserInfoSubject: AdvancedAsyncSubject<User> = new AdvancedAsyncSubject<User>();
public fixRedirectURL: string = null; public fixRedirectURL: string = null;
private redirectUrl: string = null; private redirectUrl: string = null;
private readonly promise: Promise<User>;
private subscription; private subscription;
private readonly routerSubscription; private readonly routerSubscription;
constructor(private http: HttpClient, private router: Router) { constructor(private http: HttpClient) {
this.promise = new Promise<any>((resolve => { this.updateUserInfo();
this.updateUserInfo(resolve);
}));
this.routerSubscription = this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
const token = COOKIE.getCookie('AccessToken');
if (!token && this.getUserInfoSubject.getValue() !== null) {
this.getUserInfoSubject.next(null);
}
}
});
} }
clearSubscriptions() { clearSubscriptions() {
@ -43,12 +32,12 @@ export class UserManagementService {
} }
} }
public getUserInfo(subject: boolean = true): Observable<User> { public get user(): User {
if (subject) { return this.getUserInfoSubject.getValue();
return this.getUserInfoSubject.asObservable(); }
} else {
return from(this.getUserInfoAsync()); public getUserInfo(): Observable<User> {
} return this.getUserInfoSubject.asObservable();
} }
public updateUserInfo(resolve: Function = null) { public updateUserInfo(resolve: Function = null) {
@ -67,14 +56,6 @@ export class UserManagementService {
}); });
} }
private async getUserInfoAsync(): Promise<User> {
await this.promise;
if (this.subscription) {
this.subscription.unsubscribe();
}
return this.getUserInfoSubject.getValue();
}
private parseUserInfo(info: any) { private parseUserInfo(info: any) {
const user: User = new User(); const user: User = new User();
user.id = (info.sub && info.sub.indexOf('@')) ? info.sub.substring(0, info.sub.indexOf('@')) : info.sub; user.id = (info.sub && info.sub.indexOf('@')) ? info.sub.substring(0, info.sub.indexOf('@')) : info.sub;
@ -144,6 +125,7 @@ export class UserManagementService {
public logout() { public logout() {
this.setRedirectUrl(); this.setRedirectUrl();
Session.removeUser(); Session.removeUser();
this.getUserInfoSubject.next(null);
window.location.href = properties.logoutUrl + "?redirect=" + this.redirectUrl; window.location.href = properties.logoutUrl + "?redirect=" + this.redirectUrl;
} }
} }

View File

@ -72,11 +72,17 @@ export class HelperFunctions {
return Object.keys(value).map(key => value[key]); return Object.keys(value).map(key => value[key]);
} }
public static getVocabularyLabel(value: any, vocabulary: any) { public static getVocabularyLabel(value: any, vocabulary: any, returnIfNotFound: boolean = true) {
if(value == undefined || value == null) {
return null;
}
if(vocabulary && value in vocabulary) { if(vocabulary && value in vocabulary) {
return vocabulary[value]; return vocabulary[value];
} }
return value; if(returnIfNotFound) {
return value;
}
return null;
} }
public static sortSDGs(sgd1: string, sdg2: string): number { public static sortSDGs(sgd1: string, sdg2: string): number {

View File

@ -20,14 +20,14 @@ declare var UIkit: any;
<div *ngIf="message" [hidden]=!alertMessage [innerHTML]="message | safeHtml"></div> <div *ngIf="message" [hidden]=!alertMessage [innerHTML]="message | safeHtml"></div>
<ng-content></ng-content> <ng-content></ng-content>
</div> </div>
<div *ngIf="choice || okButton || cancelButton" class="uk-modal-footer"> <div *ngIf="(choice || okButton || cancelButton) && alertFooter" class="uk-modal-footer">
<div class="uk-grid uk-flex uk-flex-middle" uk-grid> <div class="uk-grid uk-flex uk-flex-middle" uk-grid>
<label *ngIf="choice" class="uk-width-expand"> <label *ngIf="choice" class="uk-width-expand">
<input type="checkbox" [(ngModel)]="select"> <input type="checkbox" [(ngModel)]="select">
<span class="uk-margin-small-left">Don't show this message again</span> <span class="uk-margin-small-left">Don't show this message again</span>
</label> </label>
<div [ngClass]="(choice)?'uk-width-auto':'uk-width-1-1'"> <div [ngClass]="(choice)?'uk-width-auto':'uk-width-1-1'">
<div *ngIf="alertFooter" class="uk-flex-right uk-grid uk-grid-small" uk-grid> <div class="uk-flex-right uk-grid uk-grid-small" uk-grid>
<span *ngIf="okButton" [class.uk-flex-last]="!okButtonLeft"> <span *ngIf="okButton" [class.uk-flex-last]="!okButtonLeft">
<button class="uk-button uk-button-primary" [disabled]="okDisabled" <button class="uk-button uk-button-primary" [disabled]="okDisabled"
[class.uk-disabled]="okDisabled" (click)="ok()">{{okButtonText}}</button> [class.uk-disabled]="okDisabled" (click)="ok()">{{okButtonText}}</button>

View File

@ -1,4 +1,5 @@
import {Filter} from "../../searchPages/searchUtils/searchHelperClasses.class"; import {Filter} from "../../searchPages/searchUtils/searchHelperClasses.class";
import {properties} from "../../../../environments/environment";
export class SearchFields { export class SearchFields {
@ -17,7 +18,7 @@ export class SearchFields {
"relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id", "relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id",
"relproject", "sdg", "country", "resultlanguagename", "resulthostingdatasource", "community"]; "relproject", "sdg", "country", "resultlanguagename", "resulthostingdatasource", "community"];
public RESULT_ADVANCED_FIELDS: string[] = ["q", "resulttitle", "resultauthor", "authorid", "resultdescription", "resultsubject", "resultpublisher", public RESULT_ADVANCED_FIELDS: string[] = ["q", "resulttitle", "resultauthor", "authorid", "resultdescription", "resultsubject", "eoscifguidelines", "resultpublisher",
"resultbestaccessright", "community", "collectedfromdatasourceid", "resulthostingdatasourceid", "resultdateofacceptance", "resultbestaccessright", "community", "collectedfromdatasourceid", "resulthostingdatasourceid", "resultdateofacceptance",
"relfunder", "relfunder",
"relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id", "relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id",
@ -56,6 +57,14 @@ export class SearchFields {
equalityOperator: "=", equalityOperator: "=",
filterType: null filterType: null
}, },
["eoscifguidelines"]: {
name: "EOSC Subject",
type: "keyword",
param: "eoscSubj",
operator: "es",
equalityOperator: " exact ",
filterType: null
},
["resultdescription"]: { ["resultdescription"]: {
name: "Abstract", name: "Abstract",
type: "keyword", type: "keyword",
@ -690,6 +699,16 @@ export class SearchFields {
constructor() { constructor() {
} }
getResultAdvancedFields() {
if(properties.environment == "production") {
this.RESULT_ADVANCED_FIELDS = this.RESULT_ADVANCED_FIELDS.filter((value, index, array) => {
return value != "eoscifguidelines";
})
}
return this.RESULT_ADVANCED_FIELDS;
}
getField(fieldId: string, fieldType: string): any { getField(fieldId: string, fieldType: string): any {
if (fieldType == "publication" || fieldType == "dataset" || fieldType == "software" || fieldType == "other" || fieldType == "result") { if (fieldType == "publication" || fieldType == "dataset" || fieldType == "software" || fieldType == "other" || fieldType == "result") {
return this.RESULT_FIELDS[fieldId]; return this.RESULT_FIELDS[fieldId];

View File

@ -123,7 +123,10 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
this.beforeTitle.push(this.result.startYear.toString() + ' - ' + this.result.endYear.toString()); this.beforeTitle.push(this.result.startYear.toString() + ' - ' + this.result.endYear.toString());
} }
if(this.result.provenanceAction) { if(this.result.provenanceAction) {
this.beforeTitle.push(HelperFunctions.getVocabularyLabel(this.result.provenanceAction, this.provenanceActionVocabulary)); let value = HelperFunctions.getVocabularyLabel(this.result.provenanceAction, this.provenanceActionVocabulary, false);
if(value) {
this.beforeTitle.push(value);
}
} }
if(this.result.relationName) { if(this.result.relationName) {
this.beforeTitle.push(HelperFunctions.getVocabularyLabel(this.result.relationName, this.relationsVocabulary)); this.beforeTitle.push(HelperFunctions.getVocabularyLabel(this.result.relationName, this.relationsVocabulary));