Merge branch 'new-theme' of code-repo.d4science.org:MaDgIK/openaire-library into new-theme
This commit is contained in:
commit
59c09d0295
|
@ -35,8 +35,7 @@
|
|||
<div [class]="((showOptions.show == 'claim')?'':' uk-margin-top ')+' uk-container uk-container-large '">
|
||||
<div *ngIf="properties" class="uk-section uk-padding-remove-top">
|
||||
<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'">
|
||||
<div class="uk-grid basketContainer" *ngIf="showOptions.show!='claim'" uk-grid>
|
||||
<div class="uk-width-2-3 uk-position-z-index">
|
||||
<div *ngIf="showOptions.show=='source'">
|
||||
<claim-result-search-form [selectedResults]="sources" [properties]=properties
|
||||
|
@ -66,8 +65,8 @@
|
|||
</div>
|
||||
<!-- Basket-->
|
||||
<div *ngIf="showOptions.show != 'claim'" class="uk-width-1-3">
|
||||
<div id="basket" uk-sticky=" offset: 220; top:#basketStickTop; end: .basketContainer; media: @m"
|
||||
class="uk-card uk-card-default linkingBasket" style="z-index: 0!important;">
|
||||
<div id="basket" uk-sticky="offset: 220; bottom: !*; media: @m" style="z-index: 0!important;">
|
||||
<div class="uk-card uk-card-default linkingBasket">
|
||||
<div class="uk-card-body uk-padding-small">
|
||||
<div class="uk-margin-right">
|
||||
<ul class="uk-tab" uk-tab>
|
||||
|
@ -170,9 +169,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <helper position="right" styleName=" uk-width-1-5"></helper>-->
|
||||
</div>
|
||||
<div id="basketStickBottom"></div>
|
||||
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
|
||||
[texts]="pageContents['bottom']"></helper>
|
||||
</div>
|
||||
|
|
|
@ -22,7 +22,7 @@ export class ConnectAdminLoginGuard implements CanActivate, CanActivateChild {
|
|||
|
||||
check(community: string, path: string): Observable<boolean> | boolean {
|
||||
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 (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user) || Session.isManager('community', community, user)) {
|
||||
return of(true);
|
||||
|
|
|
@ -30,7 +30,7 @@ export class ConnectSubscriberGuard implements CanActivate, CanActivateChild {
|
|||
} else {
|
||||
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 (Session.isSubscribedTo('community', community, user)) {
|
||||
return of(true);
|
||||
|
|
|
@ -58,10 +58,10 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class';
|
|||
<span class="uk-text-meta">Funding stream: </span>{{item.funding}}
|
||||
</li>
|
||||
</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.provenanceAction && item.validated"> | </span>
|
||||
<span *ngIf="item.provenanceAction">{{getVocabularyLabel(item.provenanceAction, provenanceActionVocabulary)}}</span>
|
||||
<span *ngIf="item.provenanceAction">{{item.provenanceAction}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -80,6 +80,7 @@ export class FundedByComponent {
|
|||
public url = properties.searchLinkToProject.split('?')[0];
|
||||
public title: string = "Funded by";
|
||||
@Input() provenanceActionVocabulary = null;
|
||||
public provenancesCalculated: boolean[] = [];
|
||||
|
||||
public viewAllClick() {
|
||||
if(this.fundedByProjects.length <= this.threshold*2) {
|
||||
|
@ -96,7 +97,11 @@ export class FundedByComponent {
|
|||
this.viewAllClicked.emit("");
|
||||
}
|
||||
|
||||
public getVocabularyLabel(value: any, vocabulary: any) {
|
||||
return HelperFunctions.getVocabularyLabel(value, vocabulary);
|
||||
public getVocabularyLabel(item: any, vocabulary: any, index: number) {
|
||||
if(!this.provenancesCalculated[index]) {
|
||||
this.provenancesCalculated[index] = true;
|
||||
item.provenanceAction = HelperFunctions.getVocabularyLabel(item.provenanceAction, vocabulary, false);
|
||||
}
|
||||
return item.provenanceAction;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -273,7 +273,7 @@ export class ParsingFunctions {
|
|||
for (let i = 0; i < length; i++) {
|
||||
let hostedBy = Array.isArray(instance['hostedby']) ? instance['hostedby'][i] : instance['hostedby'];
|
||||
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);
|
||||
|
@ -288,7 +288,7 @@ export class ParsingFunctions {
|
|||
for (let i = 0; i < length; i++) {
|
||||
let collectedFrom = Array.isArray(instance['collectedfrom']) ? instance['collectedfrom'][i] : instance['collectedfrom'];
|
||||
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
|
||||
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[] {
|
||||
if (researchResults == undefined) {
|
||||
researchResults = [];
|
||||
|
@ -465,8 +429,17 @@ export class ParsingFunctions {
|
|||
}
|
||||
}
|
||||
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(Array.isArray(relation['title'])) {
|
||||
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']) {
|
||||
researchResult['name'] = "[no title available]";
|
||||
}
|
||||
|
@ -489,50 +462,6 @@ export class ParsingFunctions {
|
|||
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[] {
|
||||
if (results) {
|
||||
return results.sort(function (a, b) {
|
||||
|
|
|
@ -18,7 +18,7 @@ import {properties} from "../../../../environments/environment";
|
|||
Subjects by Vocabulary
|
||||
</div>
|
||||
<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">
|
||||
<a (click)="openSubjectsByVocabularyModal()" class="view-more-less-link">View all</a>
|
||||
</div>
|
||||
|
@ -97,7 +97,7 @@ import {properties} from "../../../../environments/environment";
|
|||
<modal-alert #subjectsByVocabularyModal *ngIf="(classifiedSubjects && classifiedSubjects.size > 0) || (eoscSubjects && eoscSubjects.length > 0)" large="true">
|
||||
<div class="uk-text-small">
|
||||
<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>
|
||||
</modal-alert>
|
||||
`
|
||||
|
|
|
@ -87,7 +87,7 @@ export class ResultLandingService {
|
|||
res[1]['oaf:result']['pid'], // 4
|
||||
res[1]['oaf:result']['journal'], // 5
|
||||
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']['context'], // 9
|
||||
res[1]['oaf:result']['creator'], // 10
|
||||
|
|
|
@ -22,7 +22,7 @@ export class AdminLoginGuard implements CanActivate, CanActivateChild {
|
|||
|
||||
check(data: Data, path: string): Observable<boolean> {
|
||||
let errorCode = LoginErrorCodes.NOT_LOGIN;
|
||||
return this.userManagementService.getUserInfo(false).pipe(map(user => {
|
||||
return this.userManagementService.getUserInfo().pipe(map(user => {
|
||||
if (user) {
|
||||
errorCode = LoginErrorCodes.NOT_ADMIN;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ export class ClaimsCuratorGuard implements CanActivate {
|
|||
|
||||
check(path: string): Observable<boolean> | boolean {
|
||||
let errorCode = LoginErrorCodes.NOT_LOGIN;
|
||||
return this.userManagementService.getUserInfo(false).pipe(map(user => {
|
||||
return this.userManagementService.getUserInfo().pipe(map(user => {
|
||||
if (user) {
|
||||
errorCode = LoginErrorCodes.NOT_ADMIN;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ export class LoginGuard implements CanActivate, CanLoad, CanActivateChild {
|
|||
}
|
||||
|
||||
check(path: string): Observable<boolean> | boolean {
|
||||
return this.userManagementService.getUserInfo(false).pipe(map(user => {
|
||||
return this.userManagementService.getUserInfo().pipe(map(user => {
|
||||
return user !== null;
|
||||
}),tap(isLoggedIn => {
|
||||
if(!isLoggedIn) {
|
||||
|
|
|
@ -43,8 +43,8 @@ export class UserComponent {
|
|||
this.loginUrl = this.properties.loginUrl;
|
||||
if (typeof document !== 'undefined') {
|
||||
this.server = false;
|
||||
this.subscriptions.push(this.userManagementsService.getUserInfo(false).subscribe(user => {
|
||||
this.user = user;
|
||||
this.userManagementsService.updateUserInfo(() => {
|
||||
this.user = this.userManagementsService.user;
|
||||
this.loggedIn = !!this.user;
|
||||
this.errorMessage = "";
|
||||
this.loading = true;
|
||||
|
@ -58,7 +58,7 @@ export class UserComponent {
|
|||
this.loading = false;
|
||||
}
|
||||
}));
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import {Subscriber} from "rxjs";
|
|||
<h5>Indicator themes that we are covering in the Monitor dashboards.</h5>
|
||||
<p>
|
||||
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>
|
||||
Check out the indicator pages (for <a [routerLink]="['../funder']" [relativeTo]="route">funders</a>,
|
||||
|
|
|
@ -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 {Meta, Title} from "@angular/platform-browser";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
|
@ -7,9 +7,19 @@ import {SEOService} from "../../sharedComponents/SEO/SEO.service";
|
|||
import {properties} from "../../../../environments/environment";
|
||||
import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
|
||||
|
||||
declare var ResizeObserver;
|
||||
|
||||
@Component({
|
||||
selector: 'terminology',
|
||||
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-padding-small uk-padding-remove-horizontal">
|
||||
<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">
|
||||
<p>APC information is obtained from DOAJ using DOAJ’s 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>).
|
||||
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>
|
||||
</div>
|
||||
<hr>
|
||||
|
@ -435,12 +445,12 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
|
|||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="uk-margin-medium-top">
|
||||
<!-- <div class="uk-margin-medium-top">
|
||||
<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>
|
||||
</div>
|
||||
`
|
||||
|
@ -450,12 +460,16 @@ export class TerminologyComponent implements OnInit, OnDestroy {
|
|||
private subscriptions: any[] = [];
|
||||
public openaireEntities = OpenaireEntities;
|
||||
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,
|
||||
private meta: Meta,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private title: Title) {
|
||||
private title: Title,
|
||||
private cdr: ChangeDetectorRef) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@ -468,6 +482,20 @@ export class TerminologyComponent implements OnInit, OnDestroy {
|
|||
}));
|
||||
}
|
||||
|
||||
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() {
|
||||
this.subscriptions.forEach(subscription => {
|
||||
if (subscription instanceof Subscription) {
|
||||
|
@ -476,6 +504,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) {
|
||||
const url = properties.domain + properties.baseLink + this.router.url;
|
||||
this.seoService.createLinkForCanonicalURL(url, false);
|
||||
|
|
|
@ -103,7 +103,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
|
|||
ngAfterViewInit() {
|
||||
this.subs.push(this.route.queryParams.subscribe(params => {
|
||||
if (params && params['verify']) {
|
||||
this.subs.push(this.userManagementService.getUserInfo(false).subscribe(user => {
|
||||
this.subs.push(this.userManagementService.getUserInfo().subscribe(user => {
|
||||
this.user = user;
|
||||
if (this.user) {
|
||||
this.subs.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => {
|
||||
|
|
|
@ -103,7 +103,7 @@ export class SearchAllComponent {
|
|||
resultTypes = {publication: true, dataset: true, software: true, other: true};
|
||||
|
||||
//adv Search Form
|
||||
public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS;
|
||||
public fieldIds: string[] = this.searchFields.getResultAdvancedFields();
|
||||
public fieldIdsMap = this.searchFields.RESULT_FIELDS;
|
||||
public selectedFields: AdvancedField[] = [];
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ export class SearchResearchResultsComponent {
|
|||
public searchUtils: SearchUtilsClass = new SearchUtilsClass();
|
||||
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 rangeFields: string[][] = this.searchFields.RESULT_RANGE_FIELDS;
|
||||
public selectedFields: AdvancedField[] = [];
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
OnChanges,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
Output, SimpleChanges,
|
||||
SimpleChanges,
|
||||
ViewChild
|
||||
} from '@angular/core';
|
||||
import {Location} from '@angular/common';
|
||||
|
@ -985,7 +985,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
|||
}
|
||||
}
|
||||
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 {
|
||||
//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,
|
||||
|
|
|
@ -16,22 +16,11 @@ export class UserManagementService {
|
|||
private readonly getUserInfoSubject: AdvancedAsyncSubject<User> = new AdvancedAsyncSubject<User>();
|
||||
public fixRedirectURL: string = null;
|
||||
private redirectUrl: string = null;
|
||||
private readonly promise: Promise<User>;
|
||||
private subscription;
|
||||
private readonly routerSubscription;
|
||||
|
||||
constructor(private http: HttpClient, private router: Router) {
|
||||
this.promise = new Promise<any>((resolve => {
|
||||
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);
|
||||
}
|
||||
}
|
||||
});
|
||||
constructor(private http: HttpClient) {
|
||||
this.updateUserInfo();
|
||||
}
|
||||
|
||||
clearSubscriptions() {
|
||||
|
@ -43,12 +32,12 @@ export class UserManagementService {
|
|||
}
|
||||
}
|
||||
|
||||
public getUserInfo(subject: boolean = true): Observable<User> {
|
||||
if (subject) {
|
||||
return this.getUserInfoSubject.asObservable();
|
||||
} else {
|
||||
return from(this.getUserInfoAsync());
|
||||
public get user(): User {
|
||||
return this.getUserInfoSubject.getValue();
|
||||
}
|
||||
|
||||
public getUserInfo(): Observable<User> {
|
||||
return this.getUserInfoSubject.asObservable();
|
||||
}
|
||||
|
||||
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) {
|
||||
const user: User = new User();
|
||||
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() {
|
||||
this.setRedirectUrl();
|
||||
Session.removeUser();
|
||||
this.getUserInfoSubject.next(null);
|
||||
window.location.href = properties.logoutUrl + "?redirect=" + this.redirectUrl;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,12 +72,18 @@ export class HelperFunctions {
|
|||
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) {
|
||||
return vocabulary[value];
|
||||
}
|
||||
if(returnIfNotFound) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static sortSDGs(sgd1: string, sdg2: string): number {
|
||||
let splitA: string[] = sgd1.split(".");
|
||||
|
|
|
@ -20,14 +20,14 @@ declare var UIkit: any;
|
|||
<div *ngIf="message" [hidden]=!alertMessage [innerHTML]="message | safeHtml"></div>
|
||||
<ng-content></ng-content>
|
||||
</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>
|
||||
<label *ngIf="choice" class="uk-width-expand">
|
||||
<input type="checkbox" [(ngModel)]="select">
|
||||
<span class="uk-margin-small-left">Don't show this message again</span>
|
||||
</label>
|
||||
<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">
|
||||
<button class="uk-button uk-button-primary" [disabled]="okDisabled"
|
||||
[class.uk-disabled]="okDisabled" (click)="ok()">{{okButtonText}}</button>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import {Filter} from "../../searchPages/searchUtils/searchHelperClasses.class";
|
||||
import {properties} from "../../../../environments/environment";
|
||||
|
||||
export class SearchFields {
|
||||
|
||||
|
@ -17,7 +18,7 @@ export class SearchFields {
|
|||
"relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id",
|
||||
"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",
|
||||
"relfunder",
|
||||
"relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id",
|
||||
|
@ -56,6 +57,14 @@ export class SearchFields {
|
|||
equalityOperator: "=",
|
||||
filterType: null
|
||||
},
|
||||
["eoscifguidelines"]: {
|
||||
name: "EOSC Subject",
|
||||
type: "keyword",
|
||||
param: "eoscSubj",
|
||||
operator: "es",
|
||||
equalityOperator: " exact ",
|
||||
filterType: null
|
||||
},
|
||||
["resultdescription"]: {
|
||||
name: "Abstract",
|
||||
type: "keyword",
|
||||
|
@ -690,6 +699,16 @@ export class SearchFields {
|
|||
|
||||
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 {
|
||||
if (fieldType == "publication" || fieldType == "dataset" || fieldType == "software" || fieldType == "other" || fieldType == "result") {
|
||||
return this.RESULT_FIELDS[fieldId];
|
||||
|
|
|
@ -123,7 +123,10 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
|
|||
this.beforeTitle.push(this.result.startYear.toString() + ' - ' + this.result.endYear.toString());
|
||||
}
|
||||
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) {
|
||||
this.beforeTitle.push(HelperFunctions.getVocabularyLabel(this.result.relationName, this.relationsVocabulary));
|
||||
|
|
Loading…
Reference in New Issue