Compare commits
13 Commits
master
...
deprecated
Author | SHA1 | Date |
---|---|---|
Konstantina Galouni | 8672fb6359 | |
Konstantinos Triantafyllou | 93cdc71cf0 | |
Alex Martzios | 145cd1dd94 | |
Alex Martzios | 4dfe5f989a | |
Alex Martzios | 8f2fce6a19 | |
Alex Martzios | e837d55e27 | |
Alex Martzios | 825e29b5af | |
Alex Martzios | b93dff4f1b | |
Konstantina Galouni | b90c7a4ebf | |
Alex Martzios | 3c1429f6b7 | |
argirok | ad60292049 | |
argirok | 45be028336 | |
argirok | 14b80fb1c3 |
|
@ -1,6 +1,6 @@
|
||||||
import { Injectable, Inject, PLATFORM_ID } from '@angular/core';
|
import { Injectable, Inject, PLATFORM_ID } from '@angular/core';
|
||||||
import { HttpInterceptor, HttpRequest, HttpHandler } from '@angular/common/http';
|
import { HttpInterceptor, HttpRequest, HttpHandler } from '@angular/common/http';
|
||||||
import { TransferState } from '@angular/platform-browser';
|
import { TransferState } from '@angular/core';
|
||||||
import { properties } from "../../environments/environment";
|
import { properties } from "../../environments/environment";
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||||
import {FormGroup} from '@angular/forms';
|
import {UntypedFormGroup} from '@angular/forms';
|
||||||
import {EnvProperties} from "../utils/properties/env-properties";
|
import {EnvProperties} from "../utils/properties/env-properties";
|
||||||
import {Observable} from "rxjs";
|
import {Observable} from "rxjs";
|
||||||
import {map, startWith} from "rxjs/operators";
|
import {map, startWith} from "rxjs/operators";
|
||||||
|
@ -12,7 +12,7 @@ import {map, startWith} from "rxjs/operators";
|
||||||
|
|
||||||
export class ContactUsComponent {
|
export class ContactUsComponent {
|
||||||
@Input()
|
@Input()
|
||||||
public contactForm: FormGroup;
|
public contactForm: UntypedFormGroup;
|
||||||
@Input() formTitle: string;
|
@Input() formTitle: string;
|
||||||
@Input() properties: EnvProperties;
|
@Input() properties: EnvProperties;
|
||||||
@Output() sendEmitter: EventEmitter<any> = new EventEmitter<any>();
|
@Output() sendEmitter: EventEmitter<any> = new EventEmitter<any>();
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {take, tap} from 'rxjs/operators';
|
import {take, tap} from 'rxjs/operators';
|
||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {ActivatedRouteSnapshot, CanActivate, Data, Router, RouterStateSnapshot, UrlTree} from '@angular/router';
|
import { ActivatedRouteSnapshot, Data, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
||||||
import {ConfigurationService} from '../utils/configuration/configuration.service';
|
import {ConfigurationService} from '../utils/configuration/configuration.service';
|
||||||
import {ConnectHelper} from '../connect/connectHelper';
|
import {ConnectHelper} from '../connect/connectHelper';
|
||||||
import {properties} from "../../../environments/environment";
|
import {properties} from "../../../environments/environment";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class IsRouteEnabled implements CanActivate {
|
export class IsRouteEnabled {
|
||||||
|
|
||||||
constructor(private router: Router,
|
constructor(private router: Router,
|
||||||
private config: ConfigurationService) {
|
private config: ConfigurationService) {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Injectable, Inject, PLATFORM_ID } from '@angular/core';
|
||||||
import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpResponse } from '@angular/common/http';
|
import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpResponse } from '@angular/common/http';
|
||||||
import { Observable, of } from 'rxjs';
|
import { Observable, of } from 'rxjs';
|
||||||
import { tap } from 'rxjs/operators';
|
import { tap } from 'rxjs/operators';
|
||||||
import { TransferState, makeStateKey, StateKey } from '@angular/platform-browser';
|
import { TransferState, makeStateKey, StateKey } from '@angular/core';
|
||||||
import { isPlatformServer } from '@angular/common';
|
import { isPlatformServer } from '@angular/common';
|
||||||
import {properties} from "../../environments/environment";
|
import {properties} from "../../environments/environment";
|
||||||
|
|
||||||
|
|
|
@ -1,225 +0,0 @@
|
||||||
import {
|
|
||||||
Component,
|
|
||||||
ElementRef,
|
|
||||||
EventEmitter,
|
|
||||||
HostListener,
|
|
||||||
Input,
|
|
||||||
OnDestroy,
|
|
||||||
OnInit,
|
|
||||||
Output,
|
|
||||||
ViewChild
|
|
||||||
} from "@angular/core";
|
|
||||||
import {Annotation, AnnotationService} from "./annotation.service";
|
|
||||||
import {ResultLandingInfo} from "../../utils/entities/resultLandingInfo";
|
|
||||||
import {EnvProperties} from "../../utils/properties/env-properties";
|
|
||||||
import {properties} from "../../../../environments/environment";
|
|
||||||
import {UserManagementService} from "../../services/user-management.service";
|
|
||||||
import {COOKIE, Session, User} from "../../login/utils/helper.class";
|
|
||||||
import {Subscriber} from "rxjs";
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'b2note',
|
|
||||||
template: `
|
|
||||||
<div *ngIf="annotations && annotations.length > 0" class="sideInfoTitle uk-margin-small-bottom">Annotations</div>
|
|
||||||
<div class="b2note">
|
|
||||||
<form #form ngNoForm *ngIf="pid && isLoggedIn"
|
|
||||||
[action]="properties.b2noteAPIURL + 'widget'"
|
|
||||||
method="post"
|
|
||||||
target="b2note_iframe"
|
|
||||||
class="uk-padding-small uk-padding-remove-vertical">
|
|
||||||
<!--URL of the annotated record-->
|
|
||||||
<input
|
|
||||||
type="hidden"
|
|
||||||
name="recordurl_tofeed"
|
|
||||||
[value]="url">
|
|
||||||
<!--PID of the annotated record-->
|
|
||||||
<input
|
|
||||||
type="hidden"
|
|
||||||
name="pid_tofeed"
|
|
||||||
[value]="pid">
|
|
||||||
</form>
|
|
||||||
<loading *ngIf="loading" class="uk-margin-medium-top"></loading>
|
|
||||||
<ul *ngIf="annotations && !loading" class="uk-list uk-list-divider">
|
|
||||||
<li *ngFor="let annotation of annotations.slice(0, visibleAnnotations); let i=index" uk-grid
|
|
||||||
class="uk-flex uk-flex-top uk-margin-remove-left">
|
|
||||||
<div [ngClass]="annotation.type" class="type">{{annotation.type}}</div>
|
|
||||||
<div [class.uk-width-1-3]="annotation.targets"
|
|
||||||
[class.uk-width-1-6@s]="annotation.targets">{{annotation.text}}</div>
|
|
||||||
<ul class="uk-width-expand uk-list uk-margin-remove-top" *ngIf="annotation.targets">
|
|
||||||
<li *ngFor="let target of annotation.targets.slice(0, annotation.targetSize)">
|
|
||||||
<a *ngIf="target.url" [href]="target.url" target="_blank">{{target.id}}</a>
|
|
||||||
<a *ngIf="!target.url" routerLink="/search/result"
|
|
||||||
[queryParams]="searchPid(target.id)">{{target.id}}</a>
|
|
||||||
</li>
|
|
||||||
<li *ngIf="annotation.targetSize < annotation.targets.length"><a
|
|
||||||
(click)="open(i)">+ {{annotation.targets.length - annotation.targetSize}}
|
|
||||||
more</a></li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<div *ngIf="visibleAnnotations < annotations.length" class="uk-margin-medium-top uk-text-center">
|
|
||||||
<button class="uk-button uk-button-primary"
|
|
||||||
(click)="visibleAnnotations = (visibleAnnotations + annotationSize)">Load More
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div [class.uk-hidden]="!visible">
|
|
||||||
<div class="widget-container" cdkDrag>
|
|
||||||
<button type="button" class="close" aria-label="Close" (click)="toggleAnnotation($event)">
|
|
||||||
<span aria-hidden="true">×</span>
|
|
||||||
</button>
|
|
||||||
<iframe #iframe id="b2note_iframe" name="b2note_iframe" class="b2note-iframe">
|
|
||||||
</iframe>
|
|
||||||
</div>
|
|
||||||
</div>`,
|
|
||||||
styleUrls: ['annotation.css']
|
|
||||||
})
|
|
||||||
export class AnnotationComponent implements OnInit, OnDestroy {
|
|
||||||
|
|
||||||
@Input()
|
|
||||||
public landingInfo: ResultLandingInfo = null;
|
|
||||||
@Input()
|
|
||||||
public id: string = null;
|
|
||||||
public properties: EnvProperties = properties;
|
|
||||||
public url: string = null;
|
|
||||||
public pid: string = null;
|
|
||||||
public keywords: string[] = [];
|
|
||||||
public visible: boolean = false;
|
|
||||||
public annotations: Annotation[] = [];
|
|
||||||
public annotationSize: number = 10;
|
|
||||||
public isLoggedIn: boolean = Session.isLoggedIn();
|
|
||||||
public visibleAnnotations: number;
|
|
||||||
public loading: boolean = false;
|
|
||||||
public submitted: boolean = false;
|
|
||||||
@Output()
|
|
||||||
public pidEmitter: EventEmitter<string> = new EventEmitter<string>();
|
|
||||||
@ViewChild('iframe') iframe: ElementRef;
|
|
||||||
@ViewChild('form') form: ElementRef;
|
|
||||||
private subscriptions: any[] = [];
|
|
||||||
|
|
||||||
constructor(private annotationService: AnnotationService) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@HostListener('window:message', ['$event'])
|
|
||||||
public onChange(event) {
|
|
||||||
if (this.properties.b2noteAPIURL.includes(event.origin)) {
|
|
||||||
if (event.data === "B2NOTE loaded") {
|
|
||||||
let token = COOKIE.getCookie('AccessToken');
|
|
||||||
this.iframe.nativeElement.contentWindow.postMessage({token: token}, this.properties.b2noteAPIURL);
|
|
||||||
} else {
|
|
||||||
this.getAnnotations();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
this.visibleAnnotations = this.annotationSize;
|
|
||||||
if (typeof window !== "undefined") {
|
|
||||||
let id = this.id;
|
|
||||||
this.url = window.location.href;
|
|
||||||
if (this.landingInfo.deletedByInferenceIds) {
|
|
||||||
id = this.landingInfo.deletedByInferenceIds[0];
|
|
||||||
this.url = this.url.replace(this.id, id);
|
|
||||||
}
|
|
||||||
if (this.landingInfo.identifiers && this.landingInfo.identifiers.size > 0) {
|
|
||||||
if (this.landingInfo.identifiers.get('doi')) {
|
|
||||||
this.pid = this.landingInfo.identifiers.get('doi')[0];
|
|
||||||
} else {
|
|
||||||
const key: string = this.landingInfo.identifiers.keys().next().value;
|
|
||||||
if (key) {
|
|
||||||
this.pid = this.landingInfo.identifiers.get(key)[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.pid) {
|
|
||||||
this.getAnnotations();
|
|
||||||
}
|
|
||||||
this.pidEmitter.emit(this.pid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public get enabled(): boolean {
|
|
||||||
return this.pid && this.isLoggedIn;
|
|
||||||
}
|
|
||||||
|
|
||||||
private clearSubscriptions() {
|
|
||||||
this.subscriptions.forEach(subscription => {
|
|
||||||
if (subscription instanceof Subscriber) {
|
|
||||||
subscription.unsubscribe();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.subscriptions = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
private getAnnotations() {
|
|
||||||
if (!this.annotations || this.annotations.length === 0) {
|
|
||||||
this.loading = true;
|
|
||||||
}
|
|
||||||
this.subscriptions.push(this.annotationService.getAllAnnotations(this.pid).subscribe(annotations => {
|
|
||||||
this.annotations.forEach((annotation, index) => {
|
|
||||||
if (!annotations.find(element => element.type === annotation.type && element.text === annotation.text)) {
|
|
||||||
this.annotations.splice(index, 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
annotations.forEach(annotation => {
|
|
||||||
if (!this.annotations.find(element => element.type === annotation.type && element.text === annotation.text)) {
|
|
||||||
annotation.targetSize = 3;
|
|
||||||
this.annotationService.getAnnotationTargets(annotation.text, annotation.type).subscribe(targets => {
|
|
||||||
annotation.targets = targets.filter(target => target.id !== this.pid);
|
|
||||||
});
|
|
||||||
this.annotations.push(annotation);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.annotations = this.sort(this.annotations);
|
|
||||||
this.loading = false;
|
|
||||||
}, error => {
|
|
||||||
this.loading = false;
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public sort(annotations: Annotation[]): Annotation[] {
|
|
||||||
return annotations.sort((a, b) => {
|
|
||||||
if (a.type === b.type) {
|
|
||||||
return 1;
|
|
||||||
} else if (a.type === 'semantic') {
|
|
||||||
return -1;
|
|
||||||
} else if (b.type === 'semantic') {
|
|
||||||
return 1;
|
|
||||||
} else if (a.type === 'keyword') {
|
|
||||||
return -1;
|
|
||||||
} else if (b.type === 'keyword') {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public searchPid(pid: string): { [k: string]: any; } {
|
|
||||||
return {
|
|
||||||
pid: pid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnDestroy() {
|
|
||||||
this.clearSubscriptions();
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleAnnotation(event) {
|
|
||||||
if (this.visible) {
|
|
||||||
event.preventDefault();
|
|
||||||
} else if(!this.submitted) {
|
|
||||||
this.form.nativeElement.submit();
|
|
||||||
this.submitted = true;
|
|
||||||
}
|
|
||||||
this.visible = !this.visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
open(i: number) {
|
|
||||||
this.annotations.forEach((annotation, index) => {
|
|
||||||
if (index != i) {
|
|
||||||
annotation.targetSize = 3;
|
|
||||||
} else {
|
|
||||||
annotation.targetSize = annotation.targets.length
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
.widget-container {
|
|
||||||
position: fixed;
|
|
||||||
left: 50%;
|
|
||||||
top: 50%;
|
|
||||||
z-index: 1000;
|
|
||||||
padding: 19px;
|
|
||||||
margin-left: -167px;
|
|
||||||
margin-top: -311px;
|
|
||||||
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
|
|
||||||
0 2px 2px 0 rgba(0, 0, 0, 0.14),
|
|
||||||
0 1px 5px 0 rgba(0, 0, 0, 0.12);
|
|
||||||
border: 1px solid #e3e3e3;
|
|
||||||
border-radius: 4px;
|
|
||||||
outline: 0;
|
|
||||||
min-height: 20px;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
cursor: move;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-container:hover, .widget-container:active{
|
|
||||||
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2),
|
|
||||||
0 8px 10px 1px rgba(0, 0, 0, 0.14),
|
|
||||||
0 3px 14px 2px rgba(0, 0, 0, 0.12);
|
|
||||||
}
|
|
||||||
|
|
||||||
.close {
|
|
||||||
float: right;
|
|
||||||
padding: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
background: transparent;
|
|
||||||
border: 0;
|
|
||||||
font-size: 21px;
|
|
||||||
font-weight: bold;
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.b2note-iframe {
|
|
||||||
width: 100%;
|
|
||||||
height: 600px;
|
|
||||||
border: 1px solid #dddddd;
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
import {NgModule} from "@angular/core";
|
|
||||||
import {AnnotationComponent} from "./annotation.component";
|
|
||||||
import {CommonModule} from "@angular/common";
|
|
||||||
import {DragDropModule} from "@angular/cdk/drag-drop";
|
|
||||||
import {RouterModule} from "@angular/router";
|
|
||||||
import {LoadingModule} from "../../utils/loading/loading.module";
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [CommonModule, DragDropModule, RouterModule, LoadingModule],
|
|
||||||
declarations: [AnnotationComponent],
|
|
||||||
exports: [AnnotationComponent]
|
|
||||||
})
|
|
||||||
export class AnnotationModule {}
|
|
|
@ -1,95 +0,0 @@
|
||||||
import {Injectable} from "@angular/core";
|
|
||||||
import {HttpClient} from "@angular/common/http";
|
|
||||||
import {Observable} from "rxjs";
|
|
||||||
import {EnvProperties} from "../../utils/properties/env-properties";
|
|
||||||
import {map} from "rxjs/operators";
|
|
||||||
import {properties} from "../../../../environments/environment";
|
|
||||||
|
|
||||||
export interface AnnotationTarget {
|
|
||||||
id: string;
|
|
||||||
url: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Annotation {
|
|
||||||
text: string;
|
|
||||||
type: 'semantic' | 'keyword' | 'comment';
|
|
||||||
targets?: AnnotationTarget[];
|
|
||||||
targetSize?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Injectable({
|
|
||||||
providedIn: "root"
|
|
||||||
})
|
|
||||||
export class AnnotationService {
|
|
||||||
|
|
||||||
api = 'api/';
|
|
||||||
|
|
||||||
constructor(private http: HttpClient) {
|
|
||||||
}
|
|
||||||
|
|
||||||
getAllAnnotations(source: string): Observable<Annotation[]> {
|
|
||||||
let url = properties.b2noteAPIURL + this.api + 'annotations?target-id[]=' + encodeURIComponent(source);
|
|
||||||
return this.http.get<Annotation[]>(url).pipe(map((response: any[]) => {
|
|
||||||
return this.parseAnnotations(response);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
getAnnotationTargets(value: string, type: 'semantic' | 'keyword' | 'comment'): Observable<AnnotationTarget[]> {
|
|
||||||
let url = properties.b2noteAPIURL + this.api + 'annotations?value=' + encodeURIComponent(value) + '&type[]=' + type;
|
|
||||||
return this.http.get<AnnotationTarget[]>(url).pipe(map((response: any[]) => {
|
|
||||||
return this.parseAnnotationTargets(response);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
private parseAnnotations(response: any[]): Annotation[] {
|
|
||||||
let annotations: Annotation[] = [];
|
|
||||||
if (response && response.length > 0) {
|
|
||||||
response.forEach(value => {
|
|
||||||
if (value.visibility === 'public') {
|
|
||||||
let body = value.body;
|
|
||||||
if (body.type === 'TextualBody') {
|
|
||||||
if (body.purpose === 'tagging') {
|
|
||||||
annotations.push({
|
|
||||||
text: body.value,
|
|
||||||
type: "keyword"
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
annotations.push({
|
|
||||||
text: body.value,
|
|
||||||
type: "comment"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
let items = body.items;
|
|
||||||
let text: string = null;
|
|
||||||
items.forEach(item => {
|
|
||||||
if (item.type === 'TextualBody') {
|
|
||||||
text = item.value;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
annotations.push({
|
|
||||||
text: text,
|
|
||||||
type: "semantic"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return annotations;
|
|
||||||
}
|
|
||||||
|
|
||||||
private parseAnnotationTargets(response: any[]): AnnotationTarget[] {
|
|
||||||
let targets: AnnotationTarget[] = [];
|
|
||||||
if (response && response.length > 0) {
|
|
||||||
response.forEach(value => {
|
|
||||||
if (value.visibility === 'public') {
|
|
||||||
targets.push({
|
|
||||||
id: value.target.id,
|
|
||||||
url: value.target.source
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return targets;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -482,7 +482,7 @@
|
||||||
<div class="uk-width-2-3@m uk-width-1-2">
|
<div class="uk-width-2-3@m uk-width-1-2">
|
||||||
<img src="assets/common-assets/graph.svg" style="opacity: 0.4; width:20px; height:22px" loading="lazy"
|
<img src="assets/common-assets/graph.svg" style="opacity: 0.4; width:20px; height:22px" loading="lazy"
|
||||||
alt="graph">
|
alt="graph">
|
||||||
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
|
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Graph</a></span>
|
||||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
|
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
|
||||||
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -253,7 +253,7 @@
|
||||||
<div class="uk-width-2-3@m uk-width-1-2">
|
<div class="uk-width-2-3@m uk-width-1-2">
|
||||||
<img src="assets/common-assets/graph.svg" style="opacity: 0.4; width:20px; height:22px" loading="lazy"
|
<img src="assets/common-assets/graph.svg" style="opacity: 0.4; width:20px; height:22px" loading="lazy"
|
||||||
alt="graph">
|
alt="graph">
|
||||||
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
|
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Graph</a></span>
|
||||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
|
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
|
||||||
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -735,7 +735,7 @@
|
||||||
<img src="assets/common-assets/graph.svg" style="opacity: 0.4; width:20px; height:22px" loading="lazy"
|
<img src="assets/common-assets/graph.svg" style="opacity: 0.4; width:20px; height:22px" loading="lazy"
|
||||||
alt="graph">
|
alt="graph">
|
||||||
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a
|
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a
|
||||||
href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
|
href="https://graph.openaire.eu" class="graph-color">OpenAIRE Graph</a></span>
|
||||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
|
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
|
||||||
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -104,23 +104,6 @@
|
||||||
[pids]="pidsArrayString" [pageType]="'landing'">
|
[pids]="pidsArrayString" [pageType]="'landing'">
|
||||||
</orcid-work>
|
</orcid-work>
|
||||||
</li>
|
</li>
|
||||||
<li *ngIf="properties.b2noteAPIURL">
|
|
||||||
<a *ngIf="isLoggedIn && pid" class="uk-link-text uk-text-bold uk-text-uppercase" (click)="annotation.toggleAnnotation($event)">
|
|
||||||
<span class="uk-icon-button uk-button-primary uk-icon">
|
|
||||||
<img src="assets/common-assets/b2note.png" loading="lazy" alt="b2note" style="width:34px; height:21px">
|
|
||||||
</span>
|
|
||||||
<span class="uk-margin-small-left">add annotation</span>
|
|
||||||
</a>
|
|
||||||
<span *ngIf="!pid || !isLoggedIn" class="uk-link-text uk-text-bold uk-text-uppercase uk-text-muted half-opacity"
|
|
||||||
[attr.uk-tooltip]="!pid?'Annotations are available only for resources with a PID (persistent identifier) like DOI, handle, PMID':
|
|
||||||
'Annotations are available only for logged in users'">
|
|
||||||
<span class="uk-icon-button uk-button-primary uk-icon uk-disabled">
|
|
||||||
<img src="assets/common-assets/b2note.png" loading="lazy" alt="b2note" style="width:34px;
|
|
||||||
height:21px">
|
|
||||||
</span>
|
|
||||||
<span class="uk-margin-small-left">add annotation</span>
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
<!-- EGI Notebook-->
|
<!-- EGI Notebook-->
|
||||||
<li *ngIf="resultLandingInfo.showEgiNotebookButton && properties.adminToolsPortalType == 'explore'
|
<li *ngIf="resultLandingInfo.showEgiNotebookButton && properties.adminToolsPortalType == 'explore'
|
||||||
&& (properties.environment == 'beta' || properties.environment == 'development')">
|
&& (properties.environment == 'beta' || properties.environment == 'development')">
|
||||||
|
@ -184,7 +167,7 @@
|
||||||
<!-- Subjects -->
|
<!-- Subjects -->
|
||||||
<div *ngIf="resultLandingInfo.fos" class="uk-margin-medium-bottom">
|
<div *ngIf="resultLandingInfo.fos" class="uk-margin-medium-bottom">
|
||||||
<div class="uk-text-muted">
|
<div class="uk-text-muted">
|
||||||
Fields of Science and Technology classification (FOS)
|
Fields of Science (FOS) <span uk-text-small>[Beta]</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-margin-small-top">
|
<div class="uk-margin-small-top">
|
||||||
<div *ngIf="resultLandingInfo.fos && resultLandingInfo.fos.length > 0">
|
<div *ngIf="resultLandingInfo.fos && resultLandingInfo.fos.length > 0">
|
||||||
|
@ -198,7 +181,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="resultLandingInfo.sdg" class="uk-margin-medium-bottom">
|
<div *ngIf="resultLandingInfo.sdg" class="uk-margin-medium-bottom">
|
||||||
<div class="uk-text-muted">
|
<div class="uk-text-muted">
|
||||||
Sustainable Development Goals (SDG)
|
Sustainable Development Goals (SDG) <span uk-text-small>[Beta]</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-margin-small-top">
|
<div class="uk-margin-small-top">
|
||||||
<div *ngIf="resultLandingInfo.sdg && resultLandingInfo.sdg.length > 0">
|
<div *ngIf="resultLandingInfo.sdg && resultLandingInfo.sdg.length > 0">
|
||||||
|
@ -663,7 +646,7 @@
|
||||||
<div class="uk-width-2-3@m uk-width-1-2">
|
<div class="uk-width-2-3@m uk-width-1-2">
|
||||||
<img src="assets/common-assets/graph.svg" style="opacity: 0.4; width:20px; height:22px" loading="lazy"
|
<img src="assets/common-assets/graph.svg" style="opacity: 0.4; width:20px; height:22px" loading="lazy"
|
||||||
alt="graph">
|
alt="graph">
|
||||||
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
|
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Graph</a></span>
|
||||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
|
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
|
||||||
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
. Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||||
</span>
|
</span>
|
||||||
|
@ -674,10 +657,6 @@
|
||||||
<a (click)="showFeedback = true; scroll()" class="portal-link space">Report an Issue</a>
|
<a (click)="showFeedback = true; scroll()" class="portal-link space">Report an Issue</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- B2 Note-->
|
|
||||||
<div *ngIf="properties.b2noteAPIURL && resultLandingInfo" class="uk-margin-medium-top">
|
|
||||||
<b2note #annotation [id]="id" [landingInfo]="resultLandingInfo" (pidEmitter)="pidInit($event)"></b2note>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
|
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
|
||||||
|
|
|
@ -20,10 +20,8 @@ import {properties} from "../../../../environments/environment";
|
||||||
import {ISVocabulariesService} from "../../utils/staticAutoComplete/ISVocabularies.service";
|
import {ISVocabulariesService} from "../../utils/staticAutoComplete/ISVocabularies.service";
|
||||||
import {Subscriber} from "rxjs";
|
import {Subscriber} from "rxjs";
|
||||||
import {Session} from "../../login/utils/helper.class";
|
import {Session} from "../../login/utils/helper.class";
|
||||||
import {AnnotationComponent} from "../annotation/annotation.component";
|
|
||||||
import {ParsingFunctions} from "../landing-utils/parsingFunctions.class";
|
import {ParsingFunctions} from "../landing-utils/parsingFunctions.class";
|
||||||
import {ConnectHelper} from "../../connect/connectHelper";
|
import {ConnectHelper} from "../../connect/connectHelper";
|
||||||
import {$e} from "codelyzer/angular/styles/chars";
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -111,7 +109,6 @@ export class ResultLandingComponent {
|
||||||
|
|
||||||
public isLoggedIn: boolean = Session.isLoggedIn();
|
public isLoggedIn: boolean = Session.isLoggedIn();
|
||||||
public pid: string;
|
public pid: string;
|
||||||
@ViewChild("annotation") annotation: AnnotationComponent;
|
|
||||||
public contextsWithLink: any;
|
public contextsWithLink: any;
|
||||||
|
|
||||||
public relatedClassSelected: string = "";
|
public relatedClassSelected: string = "";
|
||||||
|
|
|
@ -21,7 +21,6 @@ import {ShowAuthorsModule} from "../../utils/authors/showAuthors.modu
|
||||||
import {HelperModule} from "../../utils/helper/helper.module";
|
import {HelperModule} from "../../utils/helper/helper.module";
|
||||||
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
|
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
|
||||||
import {AlertModalModule} from "../../utils/modal/alertModal.module";
|
import {AlertModalModule} from "../../utils/modal/alertModal.module";
|
||||||
import {AnnotationModule} from "../annotation/annotation.module";
|
|
||||||
import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module";
|
import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module";
|
||||||
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
|
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
|
||||||
import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module";
|
import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module";
|
||||||
|
@ -38,7 +37,7 @@ import {MatSelectModule} from "@angular/material/select";
|
||||||
CiteThisModule, PagingModule, IFrameModule,
|
CiteThisModule, PagingModule, IFrameModule,
|
||||||
MetricsModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule,
|
MetricsModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule,
|
||||||
DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule,
|
DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule,
|
||||||
AnnotationModule, LandingHeaderModule, NoLoadPaging, ResultPreviewModule, FeedbackModule, TabsModule, LoadingModule,
|
LandingHeaderModule, NoLoadPaging, ResultPreviewModule, FeedbackModule, TabsModule, LoadingModule,
|
||||||
OrcidModule, MatFormFieldModule, MatSelectModule
|
OrcidModule, MatFormFieldModule, MatSelectModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|
|
@ -1,16 +1,10 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import { Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router';
|
||||||
Router,
|
|
||||||
CanActivate,
|
|
||||||
ActivatedRouteSnapshot,
|
|
||||||
RouterStateSnapshot,
|
|
||||||
UrlTree
|
|
||||||
} from '@angular/router';
|
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {LoginErrorCodes} from './utils/guardHelper.class';
|
import {LoginErrorCodes} from './utils/guardHelper.class';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class FreeGuard implements CanActivate {
|
export class FreeGuard {
|
||||||
|
|
||||||
constructor(private router: Router) {
|
constructor(private router: Router) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ import {Component} from "@angular/core";
|
||||||
<img src="assets/common-assets/monitor-assets/how/3.png" loading="lazy">
|
<img src="assets/common-assets/monitor-assets/how/3.png" loading="lazy">
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-text-center">
|
<div class="uk-text-center">
|
||||||
build an open, global<br>and trusted Research graph
|
build an open, global<br>and trusted OpenAIRE Graph
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
</div>
|
</div>
|
||||||
<schema2jsonld *ngIf="name && logoURL" [URL]="properties.domain+ properties.baseLink +'/search/find'"
|
<schema2jsonld *ngIf="name && logoURL" [URL]="properties.domain+ properties.baseLink +'/search/find'"
|
||||||
[logoURL]="properties.domain + properties.baseLink+logoURL" type="search" [name]=name
|
[logoURL]="properties.domain + properties.baseLink+logoURL" type="search" [name]=name
|
||||||
description="Search for research outcomes (publications, datasets, software, other research products), projects, organizations, content providers in the OpenAIRE Research Graph. "></schema2jsonld>
|
description="Search for research outcomes (publications, datasets, software, other research products), projects, organizations, content providers in the OpenAIRE Graph. "></schema2jsonld>
|
||||||
<div class="uk-container-large uk-container">
|
<div class="uk-container-large uk-container">
|
||||||
|
|
||||||
<ul class=" portalTabs uk-tab uk-width-1-1 " uk-tab="animation: uk-animation-fade">
|
<ul class=" portalTabs uk-tab uk-width-1-1 " uk-tab="animation: uk-animation-fade">
|
||||||
|
|
|
@ -144,7 +144,7 @@ export class SearchAllComponent {
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
|
|
||||||
|
|
||||||
var description = "Search for research outcomes (publications, datasets, software, other research products), projects, organizations, content providers in the OpenAIRE Research Graph. ";
|
var description = "Search for research outcomes (publications, datasets, software, other research products), projects, organizations, content providers in the OpenAIRE Graph. ";
|
||||||
var title = "OpenAIRE |Search for research outcomes, projects, content providers & organizations";
|
var title = "OpenAIRE |Search for research outcomes, projects, content providers & organizations";
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
var url = this.properties.domain + this.properties.baseLink + this._router.url;
|
var url = this.properties.domain + this.properties.baseLink + this._router.url;
|
||||||
|
|
|
@ -43,37 +43,18 @@ export class DatasourcesHelperClass {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static getQueryPrefix(type: "all" | "registries" | "journals" | "compatible" | "deposit"): string {
|
public static getQueryPrefix(type: "all" | "registries" | "journals" | "compatible" | "deposit"): string {
|
||||||
if(properties.environment == "production") {
|
|
||||||
if (type == "registries") {
|
if (type == "registries") {
|
||||||
return ' (datasourcetypeuiid = "entityregistry" or datasourcetypeuiid = "entityregistry::products" or datasourcetypeuiid = "entityregistry::repositories" ' +
|
return 'datasourcetypeuiname exact "Registry"';
|
||||||
'or datasourcetypeuiid = "entityregistry::organizations" or datasourcetypeuiid = "entityregistry::researchers" ) ';
|
|
||||||
|
|
||||||
} else if (type == "journals") {
|
} else if (type == "journals") {
|
||||||
// return ' not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ) ';
|
// return ' not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ) ';
|
||||||
return 'oaftype exact datasource not datasourcecompatibilityid = notCompatible and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ) ';
|
return 'oaftype exact datasource not datasourcecompatibilityid = notCompatible and datasourcetypeuiname exact "Journal archive" ';
|
||||||
|
|
||||||
} else if (type == "compatible") {
|
} else if (type == "compatible") {
|
||||||
return ' oaftype exact datasource and datasourcecompatibilityid <> notCompatible and datasourcetypeuiid <> other and datasourcetypeuiid <> "pubsrepository::journal" and datasourcetypeuiid <> "aggregator::pubsrepository::journals" ';
|
return ' oaftype exact datasource and datasourcecompatibilityid <> notCompatible and datasourcetypeuiname exact "Repository" ';
|
||||||
}else if (type == "deposit") {
|
}else if (type == "deposit") {
|
||||||
return ' oaftype exact datasource ';
|
return ' oaftype exact datasource and (datasourcetypeuiname exact "Journal archive" or datasourcetypeuiname exact "Repository")';
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
if (type == "registries") {
|
|
||||||
return 'datasourcetypeuiname exact "Registry"';
|
|
||||||
} else if (type == "journals") {
|
|
||||||
// return ' not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ) ';
|
|
||||||
return 'oaftype exact datasource not datasourcecompatibilityid = notCompatible and datasourcetypeuiname exact "Journal archive" ';
|
|
||||||
|
|
||||||
} else if (type == "compatible") {
|
|
||||||
return ' oaftype exact datasource and datasourcecompatibilityid <> notCompatible and datasourcetypeuiname exact "Repository" ';
|
|
||||||
}else if (type == "deposit") {
|
|
||||||
return ' oaftype exact datasource and (datasourcetypeuiname exact "Journal archive" or datasourcetypeuiname exact "Repository")';
|
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static createFilters(type: "all" | "registries" | "journals" | "compatible" | "deposit"): Filter[] {
|
public static createFilters(type: "all" | "registries" | "journals" | "compatible" | "deposit"): Filter[] {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input} from '@angular/core';
|
||||||
|
|
||||||
import {DateValue} from './searchHelperClasses.class';
|
import {DateValue} from './searchHelperClasses.class';
|
||||||
import {FormControl} from "@angular/forms";
|
import {UntypedFormControl} from "@angular/forms";
|
||||||
import { MatDatepickerInputEvent } from "@angular/material/datepicker";
|
import { MatDatepickerInputEvent } from "@angular/material/datepicker";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -62,8 +62,8 @@ ngOnInit() {
|
||||||
this.updateDefaultRangeDates(this.dateValue.from,this.dateValue.to);
|
this.updateDefaultRangeDates(this.dateValue.from,this.dateValue.to);
|
||||||
}
|
}
|
||||||
updateDefaultRangeDates(df:Date,dt:Date){
|
updateDefaultRangeDates(df:Date,dt:Date){
|
||||||
this.fromDate = new FormControl(df);
|
this.fromDate = new UntypedFormControl(df);
|
||||||
this.toDate = new FormControl(dt);
|
this.toDate = new UntypedFormControl(dt);
|
||||||
|
|
||||||
}
|
}
|
||||||
typeChanged(type:string){
|
typeChanged(type:string){
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {Component, EventEmitter, Input, Output, ViewChild} from '@angular/core';
|
import {Component, EventEmitter, Input, Output, ViewChild} from '@angular/core';
|
||||||
import {FormBuilder} from "@angular/forms";
|
import {UntypedFormBuilder} from "@angular/forms";
|
||||||
import {EnvProperties} from "../../utils/properties/env-properties";
|
import {EnvProperties} from "../../utils/properties/env-properties";
|
||||||
import {SearchCustomFilter} from "./searchUtils.class";
|
import {SearchCustomFilter} from "./searchUtils.class";
|
||||||
import {ConfigurationService} from "../../utils/configuration/configuration.service";
|
import {ConfigurationService} from "../../utils/configuration/configuration.service";
|
||||||
|
@ -96,7 +96,7 @@ export class EntitiesSelectionComponent {
|
||||||
|
|
||||||
subs: Subscription[] = [];
|
subs: Subscription[] = [];
|
||||||
|
|
||||||
constructor(private _fb: FormBuilder, private config: ConfigurationService, private router: Router) {}
|
constructor(private _fb: UntypedFormBuilder, private config: ConfigurationService, private router: Router) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.show = 0;
|
this.show = 0;
|
||||||
|
|
|
@ -394,7 +394,7 @@
|
||||||
<div class="">
|
<div class="">
|
||||||
<img src="assets/common-assets/graph.svg" style="opacity: 0.4; width:20px; height:22px" loading="lazy"
|
<img src="assets/common-assets/graph.svg" style="opacity: 0.4; width:20px; height:22px" loading="lazy"
|
||||||
alt="graph">
|
alt="graph">
|
||||||
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Research Graph</a></span>
|
<span class="uk-margin-small-left uk-text-baseline uk-text-muted">Powered by <a href="https://graph.openaire.eu" class="graph-color">OpenAIRE Graph</a></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-text-right">
|
<div class="uk-text-right">
|
||||||
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
|
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-muted">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {ChangeDetectorRef, Component, EventEmitter, Input, Output} from '@angular/core';
|
import {ChangeDetectorRef, Component, EventEmitter, Input, Output} from '@angular/core';
|
||||||
import {FormBuilder} from "@angular/forms";
|
import {UntypedFormBuilder} from "@angular/forms";
|
||||||
import {Filter} from "./searchHelperClasses.class";
|
import {Filter} from "./searchHelperClasses.class";
|
||||||
import {EnvProperties} from "../../utils/properties/env-properties";
|
import {EnvProperties} from "../../utils/properties/env-properties";
|
||||||
import {ConfigurationService} from "../../utils/configuration/configuration.service";
|
import {ConfigurationService} from "../../utils/configuration/configuration.service";
|
||||||
|
@ -58,7 +58,7 @@ export class QuickSelectionsComponent {
|
||||||
|
|
||||||
subs: Subscription[] = [];
|
subs: Subscription[] = [];
|
||||||
|
|
||||||
constructor(private _fb: FormBuilder, private config: ConfigurationService, private _router: Router, private route: ActivatedRoute, private cdr:ChangeDetectorRef) {
|
constructor(private _fb: UntypedFormBuilder, private config: ConfigurationService, private _router: Router, private route: ActivatedRoute, private cdr:ChangeDetectorRef) {
|
||||||
}
|
}
|
||||||
|
|
||||||
changed() {
|
changed() {
|
||||||
|
|
|
@ -26,6 +26,19 @@ export class RefineFieldResultsService {
|
||||||
.pipe(map(res => [res['meta'].total, RefineResultsUtils.parse(res['refineResults'],fields, entityName)]));
|
.pipe(map(res => [res['meta'].total, RefineResultsUtils.parse(res['refineResults'],fields, entityName)]));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAllRefineFieldResultsByFieldName(fieldName:string, entityName:string, properties:EnvProperties, refineQuery:string=null):any{
|
||||||
|
// let keys:string[]=["funder", "relfunder", "fundinglevel"];
|
||||||
|
let url = properties.searchAPIURLLAst +this.getSearchAPIURLForEntity(entityName)+"?fields="+fieldName +('&sf='+fieldName)+ "&format=json";
|
||||||
|
if(refineQuery!= null && refineQuery != '' ) {
|
||||||
|
url += refineQuery;
|
||||||
|
}
|
||||||
|
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||||
|
//.map(res => <any> res.json())
|
||||||
|
|
||||||
|
.pipe(map(res => [res['meta'].total, RefineResultsUtils.parse(res['refineResults'],[fieldName], entityName)]));
|
||||||
|
}
|
||||||
|
|
||||||
getRefineFieldResultsByFieldName(fieldName:string, entityName:string, properties:EnvProperties):any{
|
getRefineFieldResultsByFieldName(fieldName:string, entityName:string, properties:EnvProperties):any{
|
||||||
let key:string="fundinglevel";
|
let key:string="fundinglevel";
|
||||||
let link = properties.searchAPIURLLAst +this.getSearchAPIURLForEntity(entityName)+"?fields="+fieldName +(fieldName.toString().indexOf(key)!=-1?('&sf='+fieldName):'')+ "&format=json";
|
let link = properties.searchAPIURLLAst +this.getSearchAPIURLForEntity(entityName)+"?fields="+fieldName +(fieldName.toString().indexOf(key)!=-1?('&sf='+fieldName):'')+ "&format=json";
|
||||||
|
|
|
@ -148,7 +148,7 @@
|
||||||
<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/magazine">Blogs</a></li>
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/newsletter">Newsletters</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/newsletters">Newsletters</a></li>
|
||||||
<li><a target="_blank" href="https://www.openaire.eu/documents">Documents</a></li>
|
<li><a target="_blank" href="https://www.openaire.eu/documents">Documents</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -210,9 +210,9 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a target="_blank" href="https://www.openaire.eu/newsletter" class="el-link newsletter">
|
<a target="_blank" href="https://www.openaire.eu/newsletters" class="el-link newsletter">
|
||||||
<span class="el-title uk-margin uk-text-large">
|
<span class="el-title uk-margin uk-text-large">
|
||||||
Newsletter
|
Newsletters
|
||||||
<span class="el-image uk-icon">
|
<span class="el-image uk-icon">
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
||||||
<circle cx="3.12" cy="16.8" r="1.85"></circle>
|
<circle cx="3.12" cy="16.8" r="1.85"></circle>
|
||||||
|
|
|
@ -17,7 +17,7 @@ export class MenuItem {
|
||||||
customClass: string = null;
|
customClass: string = null;
|
||||||
isFeatured: boolean;
|
isFeatured: boolean;
|
||||||
|
|
||||||
constructor(id: string, title: string, url: string, route: string, needsAuthorization: boolean, entitiesRequired: string[], routeRequired: string[], params, icon=null, fragment = null, customClass = null, routeActive = null) {
|
constructor(id: string, title: string, url: string, route: string, needsAuthorization: boolean, entitiesRequired: string[], routeRequired: string[], params, items=null, icon=null, fragment = null, customClass = null, routeActive = null) {
|
||||||
this._id = id;
|
this._id = id;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.url = url;
|
this.url = url;
|
||||||
|
@ -28,7 +28,7 @@ export class MenuItem {
|
||||||
this.routeRequired = routeRequired;
|
this.routeRequired = routeRequired;
|
||||||
this.params = params;
|
this.params = params;
|
||||||
this.markAsActive = true;
|
this.markAsActive = true;
|
||||||
this.items = [];
|
this.items = items;
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
this.fragment = fragment;
|
this.fragment = fragment;
|
||||||
this.customClass = customClass;
|
this.customClass = customClass;
|
||||||
|
|
|
@ -188,7 +188,7 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- <div *ngIf="!onlyTop" class="uk-navbar-center"> -->
|
<!-- <div *ngIf="!onlyTop" class="uk-navbar-center"> -->
|
||||||
<div *ngIf="!onlyTop" [class.uk-navbar-right]="header.menuPosition != 'center'"
|
<div *ngIf="!onlyTop" [class.uk-navbar-right]="header.menuPosition != 'center'"
|
||||||
[class.uk-navbar-center]="header.menuPosition == 'center'">
|
[class.uk-navbar-center]="header.menuPosition == 'center'" class="uk-position-top-right">
|
||||||
<div *ngIf="showLogo && header.position == 'center' && header.menuPosition == 'center' "
|
<div *ngIf="showLogo && header.position == 'center' && header.menuPosition == 'center' "
|
||||||
class="uk-margin-large-right uk-visible@m">
|
class="uk-margin-large-right uk-visible@m">
|
||||||
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
<ng-container *ngTemplateOutlet="header_template; context: {mobile: false}"></ng-container>
|
||||||
|
@ -212,7 +212,7 @@
|
||||||
<div *ngIf="menu.items.length > 0" class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left"
|
<div *ngIf="menu.items.length > 0" class="uk-navbar-dropdown uk-navbar-dropdown-bottom-left"
|
||||||
style="top: 80px; left: 0px;" id="{{menu.rootItem.id}}" uk-toggle>
|
style="top: 80px; left: 0px;" id="{{menu.rootItem.id}}" uk-toggle>
|
||||||
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
|
<div class="uk-navbar-dropdown-grid uk-child-width-1-1 uk-grid uk-grid-stack" uk-grid="">
|
||||||
<div class="uk-first-column uk-height-max-medium uk-overflow-auto">
|
<div class="uk-first-column uk-overflow-auto"> <!-- uk-height-max-medium -->
|
||||||
<ul class="uk-nav uk-navbar-dropdown-nav">
|
<ul class="uk-nav uk-navbar-dropdown-nav">
|
||||||
<ng-container *ngFor="let submenu of menu.items">
|
<ng-container *ngFor="let submenu of menu.items">
|
||||||
<li *ngIf="isEnabled(submenu.entitiesRequired,showEntity) &&
|
<li *ngIf="isEnabled(submenu.entitiesRequired,showEntity) &&
|
||||||
|
@ -231,7 +231,7 @@
|
||||||
routerLink="{{subsubmenu.route}}" [queryParams]="subsubmenu.params"
|
routerLink="{{subsubmenu.route}}" [queryParams]="subsubmenu.params"
|
||||||
[fragment]="subsubmenu.fragment">{{subsubmenu.title}}</a>
|
[fragment]="subsubmenu.fragment">{{subsubmenu.title}}</a>
|
||||||
<a *ngIf="subsubmenu.route.length == 0 && subsubmenu.url.length > 0" routerLinkActive="uk-link"
|
<a *ngIf="subsubmenu.route.length == 0 && subsubmenu.url.length > 0" routerLinkActive="uk-link"
|
||||||
href="{{subsubmenu.url}}" target="_blank">{{subsubmenu.title}}</a>
|
href="{{subsubmenu.url}}" target="{{submenu.url.includes('http') ? '_blank' : '_self'}}">{{subsubmenu.title}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -58,7 +58,7 @@ interface Link {
|
||||||
class="number-size">{{numbers.datasourcesSize.size}}</span>
|
class="number-size">{{numbers.datasourcesSize.size}}</span>
|
||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
<span class="uk-text-uppercase uk-text-large">Content providers</span>
|
<span class="uk-text-uppercase uk-text-large">Data sources</span>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="numbers.projectsSize">
|
<div *ngIf="numbers.projectsSize">
|
||||||
<h3>
|
<h3>
|
||||||
|
@ -113,7 +113,7 @@ interface Link {
|
||||||
class="number uk-text-bold uk-margin-bottom uk-text-center uk-text-left@m">{{numbers.softwareSize.count|number}}</a>
|
class="number uk-text-bold uk-margin-bottom uk-text-center uk-text-left@m">{{numbers.softwareSize.count|number}}</a>
|
||||||
<div class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center uk-flex-left@m">
|
<div class="uk-text-uppercase uk-flex uk-flex-middle uk-flex-center uk-flex-left@m">
|
||||||
<icon name="cog" ratio="1.5" [flex]="true" class="uk-margin-right" [customClass]="colorClass"></icon>
|
<icon name="cog" ratio="1.5" [flex]="true" class="uk-margin-right" [customClass]="colorClass"></icon>
|
||||||
<span>software</span>
|
<span>research software</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -259,7 +259,7 @@ export class NumbersComponent implements OnInit, OnDestroy {
|
||||||
(getSoftware) ? this.searchResearchResultsService.numOfSearchResults('software', '', this.properties, refineParams) : this.empty,
|
(getSoftware) ? this.searchResearchResultsService.numOfSearchResults('software', '', this.properties, refineParams) : this.empty,
|
||||||
(getSoftwareLinked) ? this.searchResearchResultsService.numOfSearchResultsLinkedToPub("software", this.properties) : this.empty,
|
(getSoftwareLinked) ? this.searchResearchResultsService.numOfSearchResultsLinkedToPub("software", this.properties) : this.empty,
|
||||||
(getOther) ? this.searchResearchResultsService.numOfSearchResults('other', '', this.properties, refineParams) : this.empty,
|
(getOther) ? this.searchResearchResultsService.numOfSearchResults('other', '', this.properties, refineParams) : this.empty,
|
||||||
(getProjects) ? this.refineFieldResultsService.getRefineFieldsResultsByEntityName(['funder'], 'project', this.properties, refineParams) : this.empty,
|
(getProjects) ? this.refineFieldResultsService.getAllRefineFieldResultsByFieldName('funder', 'project', this.properties, refineParams) : this.empty,
|
||||||
(getDataProviders) ? this.searchDataprovidersService.numOfSearchDataproviders('', this.properties, refineParams) : this.empty
|
(getDataProviders) ? this.searchDataprovidersService.numOfSearchDataproviders('', this.properties, refineParams) : this.empty
|
||||||
).subscribe((data: any[]) => {
|
).subscribe((data: any[]) => {
|
||||||
if (data[0] && data[0] > 0) {
|
if (data[0] && data[0] > 0) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ export class ConfigurationService{
|
||||||
private communityInformation: BehaviorSubject<Portal> = new BehaviorSubject(null);
|
private communityInformation: BehaviorSubject<Portal> = new BehaviorSubject(null);
|
||||||
private sub: Subscription = null;
|
private sub: Subscription = null;
|
||||||
private source: Observable<Portal> = null;
|
private source: Observable<Portal> = null;
|
||||||
private promise: Promise<boolean> = null;
|
private promise: Promise<void> = null;
|
||||||
|
|
||||||
constructor(private http: HttpClient ) {}
|
constructor(private http: HttpClient ) {}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ export class ConfigurationService{
|
||||||
}
|
}
|
||||||
|
|
||||||
public initStaticCommunityInformation(communityInformation: Portal) {
|
public initStaticCommunityInformation(communityInformation: Portal) {
|
||||||
this.promise = new Promise<any>((resolve => {
|
this.promise = new Promise<void>((resolve => {
|
||||||
this.communityInformation.next(communityInformation);
|
this.communityInformation.next(communityInformation);
|
||||||
resolve();
|
resolve();
|
||||||
}));
|
}));
|
||||||
|
@ -44,7 +44,7 @@ export class ConfigurationService{
|
||||||
if(community == null) return;
|
if(community == null) return;
|
||||||
|
|
||||||
let url = properties.adminToolsAPIURL +"/" + properties.adminToolsPortalType + "/" + community + "/full";
|
let url = properties.adminToolsAPIURL +"/" + properties.adminToolsPortalType + "/" + community + "/full";
|
||||||
this.promise = new Promise<any>((resolve => {
|
this.promise = new Promise<void>((resolve => {
|
||||||
this.source = this.http.get<Portal>((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
this.source = this.http.get<Portal>((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
||||||
|
|
||||||
this.sub = this.source
|
this.sub = this.source
|
||||||
|
|
|
@ -96,7 +96,7 @@ export class Composer {
|
||||||
public static composeEmailForGraph(contactForm: any, admins: any): Email {
|
public static composeEmailForGraph(contactForm: any, admins: any): Email {
|
||||||
let email: Email = new Email();
|
let email: Email = new Email();
|
||||||
|
|
||||||
email.subject = "OpenAIRE - Research Graph";
|
email.subject = "OpenAIRE - Graph";
|
||||||
email.body = "<div style='font-size:" + this.noteBodySize + "'>"
|
email.body = "<div style='font-size:" + this.noteBodySize + "'>"
|
||||||
+ "<span><b>Name</b>: " + contactForm.name + "</span><br>"
|
+ "<span><b>Name</b>: " + contactForm.name + "</span><br>"
|
||||||
+ "<span><b>Email</b>: " + contactForm.email + "</span><br>"
|
+ "<span><b>Email</b>: " + contactForm.email + "</span><br>"
|
||||||
|
|
|
@ -18,11 +18,11 @@ export class NumberUtils{
|
||||||
num=num/1000;
|
num=num/1000;
|
||||||
num= Math.round(num);
|
num= Math.round(num);
|
||||||
roundNum = { number: num, size: "K", count: initialNum};
|
roundNum = { number: num, size: "K", count: initialNum};
|
||||||
}else if (num >= 100) {
|
// }else if (num >= 100) {
|
||||||
num=num/100;
|
// num=num/100;
|
||||||
num= Math.round(num);
|
// num= Math.round(num);
|
||||||
num=num*100;
|
// num=num*100;
|
||||||
roundNum = { number: num, size: "" , count: initialNum};
|
// roundNum = { number: num, size: "" , count: initialNum};
|
||||||
}else{
|
}else{
|
||||||
roundNum = { number: num, size: "" , count: initialNum};
|
roundNum = { number: num, size: "" , count: initialNum};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CanDeactivate, Router} from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {properties} from "../../../../environments/environment";
|
import {properties} from "../../../../environments/environment";
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
}) // do not forget to register this class as a provider
|
}) // do not forget to register this class as a provider
|
||||||
export class PreviousRouteRecorder implements CanDeactivate<any> {
|
export class PreviousRouteRecorder {
|
||||||
constructor(private router: Router) {
|
constructor(private router: Router) {
|
||||||
}
|
}
|
||||||
canDeactivate(component: any): Observable<boolean> | boolean {
|
canDeactivate(component: any): Observable<boolean> | boolean {
|
||||||
|
|
|
@ -232,7 +232,7 @@ export class SearchFields {
|
||||||
filterType: "checkbox"
|
filterType: "checkbox"
|
||||||
},
|
},
|
||||||
["sdg"]: {
|
["sdg"]: {
|
||||||
name: "SDG",
|
name: "SDG [Beta]",
|
||||||
type: "vocabulary",
|
type: "vocabulary",
|
||||||
param: "sdg",
|
param: "sdg",
|
||||||
operator: "sg",
|
operator: "sg",
|
||||||
|
@ -240,7 +240,7 @@ export class SearchFields {
|
||||||
filterType: "checkbox"
|
filterType: "checkbox"
|
||||||
},
|
},
|
||||||
["fos"]: {
|
["fos"]: {
|
||||||
name: "Field of Science",
|
name: "Field of Science [Beta]",
|
||||||
type: "vocabulary",
|
type: "vocabulary",
|
||||||
param: "fos",
|
param: "fos",
|
||||||
operator: "fs",
|
operator: "fs",
|
||||||
|
|
|
@ -91,7 +91,7 @@ export class ISVocabulariesService {
|
||||||
|
|
||||||
async getVocabularyFromServiceAsync(vocabularyName: string, properties: EnvProperties): Promise<AutoCompleteValue[]> {
|
async getVocabularyFromServiceAsync(vocabularyName: string, properties: EnvProperties): Promise<AutoCompleteValue[]> {
|
||||||
if(!this.vocabularies.has(vocabularyName)) {
|
if(!this.vocabularies.has(vocabularyName)) {
|
||||||
await new Promise<any>(resolve => {
|
await new Promise<void>(resolve => {
|
||||||
this.vocabularies.set(vocabularyName, new BehaviorSubject<any>(null));
|
this.vocabularies.set(vocabularyName, new BehaviorSubject<any>(null));
|
||||||
|
|
||||||
this.subscriptions.push(this.getVocabularyFromService(vocabularyName, properties).subscribe(
|
this.subscriptions.push(this.getVocabularyFromService(vocabularyName, properties).subscribe(
|
||||||
|
@ -201,7 +201,7 @@ export class ISVocabulariesService {
|
||||||
|
|
||||||
async getProvenanceActionVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> {
|
async getProvenanceActionVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> {
|
||||||
if(!this.provenanceActionVocabulary || !this.provenanceActionVocabulary.getValue()) {
|
if(!this.provenanceActionVocabulary || !this.provenanceActionVocabulary.getValue()) {
|
||||||
await new Promise<any>(resolve => {
|
await new Promise<void>(resolve => {
|
||||||
this.subscriptions.push(this.getProvenanceActionVocabularyFromService(vocabularyName, properties).subscribe(
|
this.subscriptions.push(this.getProvenanceActionVocabularyFromService(vocabularyName, properties).subscribe(
|
||||||
vocabularyRes => {
|
vocabularyRes => {
|
||||||
this.provenanceActionVocabulary.next(vocabularyRes);
|
this.provenanceActionVocabulary.next(vocabularyRes);
|
||||||
|
|
Loading…
Reference in New Issue