Production release June 2024 [EXPLORE] #41

Merged
konstantina.galouni merged 25 commits from develop into master 2024-06-04 16:34:02 +02:00
54 changed files with 858 additions and 684 deletions

View File

@ -129,7 +129,7 @@ export class ClaimContextSearchFormComponent {
} }
select(communityId, communityLabel) { select(communityId, communityLabel) {
console.log("SELECT", communityId) // console.log("SELECT", communityId)
this.selectedCommunityId = communityId; this.selectedCommunityId = communityId;
this.selectedCommunityLabel = communityLabel; this.selectedCommunityLabel = communityLabel;
this.getCategories(); this.getCategories();

View File

@ -202,6 +202,6 @@ export class ShowOptions {
options.push({value: 'context',label: OpenaireEntities.COMMUNITIES}) options.push({value: 'context',label: OpenaireEntities.COMMUNITIES})
} }
this.selectOptions = options; this.selectOptions = options;
console.log(options, claimProperties.SELECT_ENTITIES.projects) // console.log(options, claimProperties.SELECT_ENTITIES.projects)
} }
} }

View File

@ -1,11 +1,11 @@
<div class="uk-width-xlarge@l uk-width-large" [ngClass]="centerAlign ? 'uk-align-center':''"> <div class="uk-width-expand" [ngClass]="centerAlign ? 'uk-align-center':''">
<advanced-search-input (searchEmitter)="search(page,size)"> <advanced-search-input (searchEmitter)="search(page,size)">
<div input type="select" [(value)]="showOptions.show" placeholder="Type" hint="Select..." <div input type="select" [(value)]="showOptions.show" placeholder="Type" hint="Select..."
[options]="showOptions.selectOptions" class="uk-width-auto "></div> [options]="showOptions.selectOptions" class="uk-width-medium@xl uk-width-auto"></div>
<div *ngIf="funderOptions && funderOptions.length > 0" input type="select" [(value)]="selectedFunder" placeholder="Funder" hint="Select Funder..." <div *ngIf="funderOptions && funderOptions.length > 0" input type="select" [(value)]="selectedFunder" placeholder="Funder" hint="Select Funder..."
[options]="funderOptions" class="uk-width-expand" (valueChange)="funderChanged($event)"></div> [options]="funderOptions" class="uk-width-expand" (valueChange)="funderChanged($event)"></div>
<div *ngIf="selectedFunder && selectedFunder.number > 1" class="uk-width-expand" input type="text" [(value)]="keyword" [searchable]="true" placeholder="Projects to link" <div class="uk-width-expand" input type="text" [(value)]="keyword" [searchable]="true" placeholder="Projects to link"
[hint]="'Search for ' + openaireEntities.PROJECTS + '...'" tooltip="true" [disabled]="!selectedFunder"></div> [hint]="'Search for ' + openaireEntities.PROJECTS + '...'" tooltip="true" [disabled]="isNoProjectFunder"></div>
</advanced-search-input> </advanced-search-input>
</div> </div>
<div *ngIf=" openaireResultsStatus != errorCodes.LOADING && !isNoProjectFunder && this.selectedFunder && openaireResults.length == 0"> <div *ngIf=" openaireResultsStatus != errorCodes.LOADING && !isNoProjectFunder && this.selectedFunder && openaireResults.length == 0">
@ -14,7 +14,7 @@
</div> </div>
</div> </div>
<div *ngIf=" openaireResultsStatus != errorCodes.LOADING && this.funderOptions.length > 1 && !this.selectedFunder"> <div *ngIf=" openaireResultsStatus != errorCodes.LOADING && this.funderOptions.length > 1 && !this.selectedFunder">
<div class="uk-text-center uk-text-large uk-text-meta uk-margin-large-top">Select funder to proceed <div class="uk-text-center uk-text-large uk-text-meta uk-margin-large-top">Select funder or search for projects to proceed
</div> </div>
</div> </div>
<div class="uk-margin-top"> <div class="uk-margin-top">
@ -65,7 +65,7 @@
</div> </div>
<claim-results [localStoragePrefix]="localStoragePrefix" [results]=openaireResults <claim-results [localStoragePrefix]="localStoragePrefix" [results]=openaireResults
[selectedResults]=selectedProjects [basketLimit]="basketLimit"></claim-results> [selectedResults]=selectedProjects [basketLimit]="basketLimit"></claim-results>
<div *ngIf="isNoProjectFunder && openaireResultsStatus != errorCodes.LOADING " class="uk-alert uk-alert-default"><span class=" uk-text-bold">{{selectedFunder.name}}</span> has no projects. Proceed to next step. </div> <div *ngIf="isNoProjectFunder && openaireResultsStatus != errorCodes.LOADING " class="uk-alert uk-alert-default">No projects for funder <span class=" uk-text-bold">{{selectedFunder.name}}</span>. </div>
<div *ngIf="openaireResultsNum != null && openaireResultsNum > 0 && openaireResultsStatus != errorCodes.LOADING " class="uk-flex uk-flex-center "> <div *ngIf="openaireResultsNum != null && openaireResultsNum > 0 && openaireResultsStatus != errorCodes.LOADING " class="uk-flex uk-flex-center ">
<paging-no-load [currentPage]="openaireResultsPage" <paging-no-load [currentPage]="openaireResultsPage"
[totalResults]="openaireResultsNum" [term]="keyword" [totalResults]="openaireResultsNum" [term]="keyword"

View File

@ -11,7 +11,6 @@ import {OpenaireEntities, SearchFields} from "../../utils/properties/searchField
import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component"; import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component";
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import { properties } from 'src/environments/environment'; import { properties } from 'src/environments/environment';
import {error} from "protractor";
declare var UIkit:any; declare var UIkit:any;
@ -75,6 +74,8 @@ export class ClaimProjectsSearchFormComponent {
this.sub = this._projectService.advancedSearchProjects("", 1, 0, this.properties, this.sub = this._projectService.advancedSearchProjects("", 1, 0, this.properties,
this.refineFieldsQuery, this.refineFields, "&type=projects&sf=funder").subscribe( this.refineFieldsQuery, this.refineFields, "&type=projects&sf=funder").subscribe(
data => { data => {
let option = {value : null, label: "No funder selected"};
this.funderOptions.push(option);
for(let v of data[2][0].values){ for(let v of data[2][0].values){
let option = {value : v, label: v.name}; let option = {value : v, label: v.name};
this.funderOptions.push(option); this.funderOptions.push(option);
@ -108,7 +109,7 @@ export class ClaimProjectsSearchFormComponent {
this.prevFilters = this.filters; this.prevFilters = this.filters;
//searchProjects (params: string, refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any { //searchProjects (params: string, refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any {
this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, null, [], this.createOpenaireRefineQuery()).subscribe( this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, this.createOpenaireRefineQuery(), [], null).subscribe(
// this.sub = this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe( // this.sub = this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe(
data => { data => {
if (data != null) { if (data != null) {
@ -151,7 +152,7 @@ export class ClaimProjectsSearchFormComponent {
const entity: ClaimEntity = new ClaimEntity(); const entity: ClaimEntity = new ClaimEntity();
entity.project = new ClaimProject(); entity.project = new ClaimProject();
entity.project.funderId = item.funderId; entity.project.funderId = item.funderId;
entity.project.funderShortname = item.funderShortname?item.funderShortname:(entity.project.funderId.split("::")[1]); entity.project.funderShortname = item.funderShortname?item.funderShortname:(entity.project.funderId?entity.project.funderId.split("::")[1]:"");
entity.project.funderName = item.funderName; entity.project.funderName = item.funderName;
entity.id = item.id; entity.id = item.id;
entity.project.url = (item.code !="unidentified") ? properties.searchLinkToProject + entity.id : null; entity.project.url = (item.code !="unidentified") ? properties.searchLinkToProject + entity.id : null;
@ -187,12 +188,6 @@ export class ClaimProjectsSearchFormComponent {
} }
createOpenaireRefineQuery(): string { createOpenaireRefineQuery(): string {
/*if(this.startYear.length > 0 ){
query+='&fq=projectstartyear exact \"'+this.startYear+'\"'
}
if(this.endYear.length > 0 ){
query+='&fq=projectendyear exact \"'+this.endYear+'\"'
}*/
let allFqs = ""; let allFqs = "";
for (let filter of this.filters) { for (let filter of this.filters) {
if (filter.countSelectedValues > 0) { if (filter.countSelectedValues > 0) {
@ -210,8 +205,11 @@ export class ClaimProjectsSearchFormComponent {
} }
} }
} }
if(this.isNoProjectFunder){ if(this.selectedFunder){
allFqs += "&fq=" + StringUtils.URIEncode( "funder exact " + (StringUtils.quote(this.selectedFunder.id))); ; allFqs += "&fq=" + StringUtils.URIEncode( "funder exact " + (StringUtils.quote(this.selectedFunder.id)));
}
if(!this.isNoProjectFunder || !this.selectedFunder){
allFqs += '&fq=(projectcode<>"unidentified")'
} }
for (let i = 0; i < this.rangeFilters.length; i++) { for (let i = 0; i < this.rangeFilters.length; i++) {
let filter = this.rangeFilters[i]; let filter = this.rangeFilters[i];

View File

@ -329,7 +329,7 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy {
delete() { delete() {
let claimsToBeDeleted = ((this.index != null) ? [this.claims[this.index].id] : this.selected.map(claim => claim.id)); let claimsToBeDeleted = ((this.index != null) ? [this.claims[this.index].id] : this.selected.map(claim => claim.id));
console.log(claimsToBeDeleted); // console.log(claimsToBeDeleted);
this.subscriptions.push(this._claimService.deleteBulk(claimsToBeDeleted, this.properties.claimsAPIURL).subscribe( this.subscriptions.push(this._claimService.deleteBulk(claimsToBeDeleted, this.properties.claimsAPIURL).subscribe(
res => { res => {
if (this.index != null) { if (this.index != null) {

View File

@ -108,7 +108,6 @@ export class SearchOrcidService {
static parseOrcidAuthor(data: any, authorIds: string[], authors, addId): any { static parseOrcidAuthor(data: any, authorIds: string[], authors, addId): any {
console.log(data)
if (data[2] != null) { if (data[2] != null) {
if (addId) { if (addId) {
authorIds.push(data[2].path); authorIds.push(data[2].path);
@ -128,9 +127,7 @@ export class SearchOrcidService {
if (data[3] != null) { if (data[3] != null) {
author['institution'] = data[3]; author['institution'] = data[3];
} }
console.log(author['institution'])
authors.push(author); authors.push(author);
return true; return true;
} }
return false; return false;

View File

@ -1,3 +1,4 @@
<loading *ngIf="validInput === null" [full]="true" class="uk-position-center"></loading>
<linking-generic *ngIf="validInput" [localStoragePrefix]="localStoragePrefix" [results]="results" [sources]="sources" <linking-generic *ngIf="validInput" [localStoragePrefix]="localStoragePrefix" [results]="results" [sources]="sources"
[communityId]="communityId" [inlineEntity]="inlineEntity" [showOptions]="showOptions" [communityId]="communityId" [inlineEntity]="inlineEntity" [showOptions]="showOptions"
pageTitle="Direct Linking" [claimsProperties]="claimsProperties"> pageTitle="Direct Linking" [claimsProperties]="claimsProperties">

View File

@ -8,12 +8,13 @@ import {SearchResearchResultsServiceModule} from '../../services/searchResearchR
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {LinkingGenericModule} from '../linking/linkingGeneric.module'; import {LinkingGenericModule} from '../linking/linkingGeneric.module';
import {LoadingModule} from "../../utils/loading/loading.module";
@NgModule({ @NgModule({
imports: [ imports: [
SharedModule, SharedModule,
EntitySearchServiceModule, SearchResearchResultsServiceModule, EntitySearchServiceModule, SearchResearchResultsServiceModule,
Schema2jsonldModule, SEOServiceModule, LinkingGenericModule Schema2jsonldModule, SEOServiceModule, LinkingGenericModule, LoadingModule
], ],
providers:[], providers:[],
declarations: [ declarations: [

View File

@ -133,11 +133,11 @@ export class BulkClaimComponent {
} }
}); });
} }
upload() { upload() {
this.enableUpload = false; this.enableUpload = false;
this.showReport = false; this.showReport = false;
this.errorMessage = ""; this.errorMessage = "";
console.log(this.filesToUpload);
if (this.filesToUpload.length == 0) { if (this.filesToUpload.length == 0) {
this.errorMessage = "There is no selected file to upload."; this.errorMessage = "There is no selected file to upload.";
return; return;

View File

@ -232,7 +232,7 @@ export class ClaimInsertComponent {
data => { data => {
this.feedRecordsJob = data.data; this.feedRecordsJob = data.data;
this.records2Insert = directclaims.length; this.records2Insert = directclaims.length;
console.log(data); // console.log(data);
// this.insertedRecords = data.insertedIds; // this.insertedRecords = data.insertedIds;
// //
// this.errorInRecords = data.errorInClaims; // this.errorInRecords = data.errorInClaims;

View File

@ -132,42 +132,6 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy {
this.sticky.footer = UIkit.sticky(this.sticky_footer.nativeElement, {end: true, offset: footer_offset}); this.sticky.footer = UIkit.sticky(this.sticky_footer.nativeElement, {end: true, offset: footer_offset});
} }
/**
* @deprecated
*
* Should be smooth
*
* */
private observeBottom() {
let bottom = document.getElementById('bottom');
if (bottom) {
let bottomObs = new IntersectionObserver(entries => {
entries.forEach(entry => {
this.shouldSticky = !entry.isIntersecting;
})
});
this.subscriptions.push(bottomObs);
bottomObs.observe(bottom);
}
}
/**
* @deprecated
* */
private observeHeader() {
if (this.header) {
let headerObs = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.boundingClientRect.height > 0) {
this.layoutService.setReplaceHeader(!entry.isIntersecting);
}
})
});
this.subscriptions.push(headerObs);
headerObs.observe(this.header.nativeElement);
}
}
private observeStickyFooter() { private observeStickyFooter() {
if (this.sticky_footer) { if (this.sticky_footer) {
let resizeObs = new ResizeObserver(entries => { let resizeObs = new ResizeObserver(entries => {

View File

@ -1,4 +1,4 @@
import {Injectable} from "@angular/core"; import {AfterViewInit, Injectable} from "@angular/core";
import {BehaviorSubject, Observable, Subscriber} from "rxjs"; import {BehaviorSubject, Observable, Subscriber} from "rxjs";
import {ActivationStart, Router} from "@angular/router"; import {ActivationStart, Router} from "@angular/router";
import {Icon} from "../../../sharedComponents/menu"; import {Icon} from "../../../sharedComponents/menu";
@ -92,6 +92,7 @@ export class LayoutService {
* Display help pop-up on non-admin pages. (default true for the rest of the pages) * Display help pop-up on non-admin pages. (default true for the rest of the pages)
* */ * */
private hasHelpPopUpSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true); private hasHelpPopUpSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
private isBottomIntersectingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
private subscriptions: any[] = []; private subscriptions: any[] = [];
ngOnDestroy() { ngOnDestroy() {
@ -119,6 +120,20 @@ export class LayoutService {
this.subscriptions.push(resizeObs); this.subscriptions.push(resizeObs);
resizeObs.observe(document.documentElement); resizeObs.observe(document.documentElement);
} }
if(typeof document !== "undefined") {
setTimeout(() => {
let bottom = document.getElementById('bottom');
if (bottom) {
let bottomObs = new IntersectionObserver(entries => {
entries.forEach(entry => {
this.isBottomIntersectingSubject.next(entry.isIntersecting);
})
});
this.subscriptions.push(bottomObs);
bottomObs.observe(bottom);
}
}, 500)
}
} }
constructor(private router: Router) { constructor(private router: Router) {
@ -355,4 +370,8 @@ export class LayoutService {
setHasHelpPopUp(value: boolean) { setHasHelpPopUp(value: boolean) {
this.hasHelpPopUpSubject.next(value); this.hasHelpPopUpSubject.next(value);
} }
get isBottomIntersecting(): Observable<boolean> {
return this.isBottomIntersectingSubject.asObservable();
}
} }

View File

@ -40,7 +40,7 @@
<a [routerLink]="getItemRoute(item)" [title]="item.title" (click)="item.items.length === 0?closeOffcanvas():null" <a [routerLink]="getItemRoute(item)" [title]="item.title" (click)="item.items.length === 0?closeOffcanvas():null"
[queryParams]="item.route?item.params:null" [queryParamsHandling]="item.route?queryParamsHandling:null" class="uk-flex uk-flex-middle"> [queryParams]="item.route?item.params:null" [queryParamsHandling]="item.route?queryParamsHandling:null" class="uk-flex uk-flex-middle">
<div *ngIf="item.icon && (item.icon.svg || item.icon.name)" class="uk-width-auto"> <div *ngIf="item.icon && (item.icon.svg || item.icon.name)" class="uk-width-auto">
<icon class="menu-icon" [customClass]="item.icon.class" [name]="item.icon.name" ratio="0.9" [svg]="item.icon.svg" [flex]="true"></icon> <icon class="menu-icon" [customClass]="item.icon.class" [name]="item.icon.name" [ratio]="item.icon.ratio?item.icon.ratio:0.9" [svg]="item.icon.svg" [flex]="true"></icon>
</div> </div>
<span [class.hide-on-close]="item.icon" class="uk-width-expand@l uk-text-truncate uk-margin-small-left">{{item.title}}</span> <span [class.hide-on-close]="item.icon" class="uk-width-expand@l uk-text-truncate uk-margin-small-left">{{item.title}}</span>
<span *ngIf="item.items.length > 0" class="uk-nav-parent-icon hide-on-close"></span> <span *ngIf="item.items.length > 0" class="uk-nav-parent-icon hide-on-close"></span>

View File

@ -8,16 +8,16 @@
<div class="uk-flex uk-flex-left@m uk-flex-center uk-width-expand"> <div class="uk-flex uk-flex-left@m uk-flex-center uk-width-expand">
<ul class="uk-subnav uk-subnav-pill"> <ul class="uk-subnav uk-subnav-pill">
<li [class.uk-active]="showCurrent" (click)="showCurrent = true"> <li [class.uk-active]="showCurrent" (click)="showCurrent = true">
<a class="uk-text-capitalize">{{stakeholderUtils.roles[role]}}s</a> <a class="uk-text-capitalize">{{roleUtils.roles[role]}}s</a>
</li> </li>
<li [class.uk-active]="!showCurrent" (click)="showCurrent = false"> <li [class.uk-active]="!showCurrent" (click)="showCurrent = false">
<a>Pending {{stakeholderUtils.roles[role]}}s</a> <a>Pending {{roleUtils.roles[role]}}s</a>
</li> </li>
</ul> </ul>
</div> </div>
<div class="uk-width-expand@m uk-width-1-1 uk-grid uk-flex-right@m uk-flex-center uk-flex-middle" uk-grid> <div class="uk-width-expand@m uk-width-1-1 uk-grid uk-flex-right@m uk-flex-center uk-flex-middle" uk-grid>
<div *ngIf="showCurrent" [disabled]="loadActive" search-input class="uk-width-expand@l uk-width-1-1" <div *ngIf="showCurrent" [disabled]="loadActive" search-input class="uk-width-expand@l uk-width-1-1"
[searchControl]="filterForm.get('active')" [expandable]="true" [placeholder]="'Search ' + stakeholderUtils.roles[role] + 's'" searchInputClass="outer"> [searchControl]="filterForm.get('active')" [expandable]="true" [placeholder]="'Search ' + roleUtils.roles[role] + 's'" searchInputClass="outer">
</div> </div>
<div *ngIf="!showCurrent" [disabled]="loadPending" search-input class="uk-width-expand@l uk-width-1-1" <div *ngIf="!showCurrent" [disabled]="loadPending" search-input class="uk-width-expand@l uk-width-1-1"
[searchControl]="filterForm.get('pending')" [expandable]="true" [placeholder]="'Search invitations'" searchInputClass="outer"> [searchControl]="filterForm.get('pending')" [expandable]="true" [placeholder]="'Search invitations'" searchInputClass="outer">
@ -27,7 +27,7 @@
[attr.uk-tooltip]="inviteDisableMessage" [class.uk-disabled]="loadPending || loadPending" [attr.uk-tooltip]="inviteDisableMessage" [class.uk-disabled]="loadPending || loadPending"
[disabled]="loadActive || loadPending || !!inviteDisableMessage" (click)="openInviteModal()"> [disabled]="loadActive || loadPending || !!inviteDisableMessage" (click)="openInviteModal()">
<icon name="person_add" [flex]="true" type="filled"></icon> <icon name="person_add" [flex]="true" type="filled"></icon>
<span class="uk-margin-small-left uk-text-bold uk-text-uppercase">Invite {{stakeholderUtils.roles[role]}}</span> <span class="uk-margin-small-left uk-text-bold uk-text-uppercase">Invite {{roleUtils.roles[role]}}</span>
</button> </button>
<button *ngIf="!exists && isCurator" class="uk-button uk-button-default uk-flex uk-flex-middle" <button *ngIf="!exists && isCurator" class="uk-button uk-button-default uk-flex uk-flex-middle"
(click)="openCreateRoleModal()"> (click)="openCreateRoleModal()">
@ -47,16 +47,16 @@
<div *ngIf="!loadActive && !loadPending"> <div *ngIf="!loadActive && !loadPending">
<div *ngIf="(showCurrent && showActive.length == 0) || (!showCurrent && showPending.length == 0)" <div *ngIf="(showCurrent && showActive.length == 0) || (!showCurrent && showPending.length == 0)"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold"> class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
<div *ngIf="showCurrent">No {{stakeholderUtils.roles[role]}}s found</div> <div *ngIf="showCurrent">No {{roleUtils.roles[role]}}s found</div>
<div *ngIf="!showCurrent">No pending {{stakeholderUtils.roles[role]}} invitations found</div> <div *ngIf="!showCurrent">No pending {{roleUtils.roles[role]}} invitations found</div>
</div> </div>
<div *ngIf="(showCurrent && showActive.length > 0) || (!showCurrent && showPending.length > 0)"> <div *ngIf="(showCurrent && showActive.length > 0) || (!showCurrent && showPending.length > 0)">
<no-load-paging *ngIf="showCurrent" [type]="(showActive.length > 1)?(stakeholderUtils.roles[role] + 's'):role" <no-load-paging *ngIf="showCurrent" [type]="(showActive.length > 1)?(roleUtils.roles[role] + 's'):role"
(pageChange)="updateActivePage($event)" (pageChange)="updateActivePage($event)"
[page]="activePage" [pageSize]="pageSize" [page]="activePage" [pageSize]="pageSize"
[totalResults]="showActive.length"> [totalResults]="showActive.length">
</no-load-paging> </no-load-paging>
<no-load-paging *ngIf="!showCurrent" [type]="stakeholderUtils.roles[role] + ' ' + (showPending.length > 1?'invitations':'invitation')" <no-load-paging *ngIf="!showCurrent" [type]="roleUtils.roles[role] + ' ' + (showPending.length > 1?'invitations':'invitation')"
(pageChange)="updatePendingPage($event)" (pageChange)="updatePendingPage($event)"
[page]="pendingPage" [pageSize]="pageSize" [page]="pendingPage" [pageSize]="pageSize"
[totalResults]="showPending.length"> [totalResults]="showPending.length">
@ -109,12 +109,12 @@
</modal-alert> </modal-alert>
<modal-alert #deleteModal [overflowBody]="false" (alertOutput)="deleteActive()" classTitle="uk-background-primary uk-light"> <modal-alert #deleteModal [overflowBody]="false" (alertOutput)="deleteActive()" classTitle="uk-background-primary uk-light">
<div *ngIf="selectedUser"> <div *ngIf="selectedUser">
Are you sure you want to remove <span class="uk-text-bold">{{selectedUser}}</span> from {{stakeholderUtils.roles[role]}}s? Are you sure you want to remove <span class="uk-text-bold">{{selectedUser}}</span> from {{roleUtils.roles[role]}}s?
</div> </div>
</modal-alert> </modal-alert>
<modal-alert #deletePendingModal [overflowBody]="false" (alertOutput)="deletePending()" classTitle="uk-background-primary uk-light"> <modal-alert #deletePendingModal [overflowBody]="false" (alertOutput)="deletePending()" classTitle="uk-background-primary uk-light">
<div *ngIf="selectedUser"> <div *ngIf="selectedUser">
Are you sure you want to cancel {{stakeholderUtils.roles[role]}} invitation of <span class="uk-text-bold">{{selectedUser}}</span>? Are you sure you want to cancel {{roleUtils.roles[role]}} invitation of <span class="uk-text-bold">{{selectedUser}}</span>?
</div> </div>
</modal-alert> </modal-alert>
<modal-alert #createRoleModal [overflowBody]="false" (alertOutput)="createGroup()" classTitle="uk-background-primary uk-light" <modal-alert #createRoleModal [overflowBody]="false" (alertOutput)="createGroup()" classTitle="uk-background-primary uk-light"

View File

@ -13,7 +13,7 @@ import {AlertModal} from "../../../utils/modal/alert";
import {UserRegistryService} from "../../../services/user-registry.service"; import {UserRegistryService} from "../../../services/user-registry.service";
import {EnvProperties} from "../../../utils/properties/env-properties"; import {EnvProperties} from "../../../utils/properties/env-properties";
import {properties} from "../../../../../environments/environment"; import {properties} from "../../../../../environments/environment";
import {Role, Session, User} from "../../../login/utils/helper.class"; import {Role, RoleUtils, Session, User} from "../../../login/utils/helper.class";
import {UserManagementService} from "../../../services/user-management.service"; import {UserManagementService} from "../../../services/user-management.service";
import {Router} from "@angular/router"; import {Router} from "@angular/router";
import {StringUtils} from "../../../utils/string-utils.class"; import {StringUtils} from "../../../utils/string-utils.class";
@ -92,6 +92,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
@ViewChild('deletePendingModal') deletePendingModal: AlertModal; @ViewChild('deletePendingModal') deletePendingModal: AlertModal;
@ViewChild('createRoleModal') createRoleModal: AlertModal; @ViewChild('createRoleModal') createRoleModal: AlertModal;
public stakeholderUtils: StakeholderUtils = new StakeholderUtils(); public stakeholderUtils: StakeholderUtils = new StakeholderUtils();
public roleUtils: RoleUtils = new RoleUtils();
private _type: string; private _type: string;
constructor(private userRegistryService: UserRegistryService, constructor(private userRegistryService: UserRegistryService,
@ -188,7 +189,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
openDeleteModal(item: any) { openDeleteModal(item: any) {
if (this.showCurrent) { if (this.showCurrent) {
this.selectedUser = item.email; this.selectedUser = item.email;
this.deleteModal.alertTitle = 'Delete ' + this.stakeholderUtils.roles[this.role]; this.deleteModal.alertTitle = 'Delete ' + this.roleUtils.roles[this.role];
this.deleteModal.open(); this.deleteModal.open();
} else { } else {
this.selectedUser = item; this.selectedUser = item;
@ -198,7 +199,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
} }
openInviteModal() { openInviteModal() {
this.inviteModal.alertTitle = 'Invite ' + this.stakeholderUtils.roles[this.role]; this.inviteModal.alertTitle = 'Invite ' + this.roleUtils.roles[this.role];
this.inviteModal.okButtonLeft = false; this.inviteModal.okButtonLeft = false;
this.inviteModal.okButtonText = 'Send'; this.inviteModal.okButtonText = 'Send';
this.emailsForm = this.fb.array([], Validators.required); this.emailsForm = this.fb.array([], Validators.required);
@ -247,7 +248,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
if (this.currentPendingPage.length === 0) { if (this.currentPendingPage.length === 0) {
this.pendingPage = 1; this.pendingPage = 1;
} }
NotificationHandler.rise(StringUtils.capitalize(this.stakeholderUtils.roles[this.role]) + ' invitation to ' + this.selectedUser + ' has been <b>canceled</b>'); NotificationHandler.rise(StringUtils.capitalize(this.roleUtils.roles[this.role]) + ' invitation to ' + this.selectedUser + ' has been <b>canceled</b>');
this.loadPending = false; this.loadPending = false;
}, error => { }, error => {
NotificationHandler.rise('An error has occurred. Please try again later', 'danger'); NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
@ -296,7 +297,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
} }
} else { } else {
NotificationHandler.rise('An error has occurred while sending the invitation mail to ' + NotificationHandler.rise('An error has occurred while sending the invitation mail to ' +
response.email + '.Check if the user is already a ' + this.stakeholderUtils.roles[this.role] + ' or try again later', 'danger'); response.email + '.Check if the user is already a ' + this.roleUtils.roles[this.role] + ' or try again later', 'danger');
return of(null); return of(null);
} }
}); });
@ -316,7 +317,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
this.updateLists(); this.updateLists();
}, error => { }, error => {
if(error.status === 409) { if(error.status === 409) {
NotificationHandler.rise('Group already exists. You can try to invite a ' + this.stakeholderUtils.roles[this.role] + ' instead.', 'warning'); NotificationHandler.rise('Group already exists. You can try to invite a ' + this.roleUtils.roles[this.role] + ' instead.', 'warning');
this.updateLists(); this.updateLists();
} else { } else {
NotificationHandler.rise('An error has occurred. Please try again later', 'danger'); NotificationHandler.rise('An error has occurred. Please try again later', 'danger');

View File

@ -2,7 +2,9 @@
<schema2jsonld *ngIf="dataProviderInfo" <schema2jsonld *ngIf="dataProviderInfo"
[data]=dataProviderInfo [URL]="canonicalUrl" type="datasource" [data]=dataProviderInfo [URL]="canonicalUrl" type="datasource"
[otherURL]="(dataProviderInfo.provenance)?provenanceUrls:null"></schema2jsonld> [otherURL]="(dataProviderInfo.provenance)?provenanceUrls:null"></schema2jsonld>
<div *ngIf="dataProviderInfo && !dataProviderInfo.belongsTo && !isBottomIntersecting" [innerHTML]="dataProviderInfo.message"
class="uk-alert uk-alert-warning uk-position-fixed uk-position-bottom-center uk-text-small" style="z-index: 1000;">
</div>
<!-- Desktop view --> <!-- Desktop view -->
<div class="uk-visible@m landing uk-section uk-padding-remove tm-middle"> <div class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
<div *ngIf="!isMobile" class="tm-main"> <div *ngIf="!isMobile" class="tm-main">

View File

@ -148,14 +148,13 @@ export class DataProviderComponent {
@ViewChild("descriptionDiv") descriptionDiv: ElementRef; @ViewChild("descriptionDiv") descriptionDiv: ElementRef;
@ViewChild('descriptionModal') descriptionModal; @ViewChild('descriptionModal') descriptionModal;
// public shouldSticky: boolean = true;
subscriptions = []; subscriptions = [];
private sub: Subscription; private sub: Subscription;
properties: EnvProperties = properties; properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
public isMobile: boolean = false; public isMobile: boolean = false;
public isBottomIntersecting: boolean = false;
public mobileContent: "info" | "metrics" | "actions" = "info"; public mobileContent: "info" | "metrics" | "actions" = "info";
public tabMobile: string = ""; public tabMobile: string = "";
public viewAllMobile: string = ""; public viewAllMobile: string = "";
@ -198,6 +197,11 @@ export class DataProviderComponent {
ngOnInit() { ngOnInit() {
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => { this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
this.isMobile = isMobile; this.isMobile = isMobile;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
})); }));
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
@ -261,16 +265,6 @@ export class DataProviderComponent {
} else { } else {
this.offset = 0; this.offset = 0;
} }
// let bottom = document.getElementById('bottom');
// if(bottom) {
// let observer = new IntersectionObserver(entries => {
// entries.forEach(entry => {
// this.shouldSticky = !entry.isIntersecting;
// })
// });
// this.subscriptions.push(observer);
// observer.observe(bottom);
// }
if(this.graph_and_feedback) { if(this.graph_and_feedback) {
this.observeGraphAndFeedback(); this.observeGraphAndFeedback();
} }
@ -389,6 +383,7 @@ export class DataProviderComponent {
this.dataProviderInfo = data; this.dataProviderInfo = data;
this.getProvenanceUrls(); this.getProvenanceUrls();
this.datasourceId = this.dataProviderInfo.objIdentifier; this.datasourceId = this.dataProviderInfo.objIdentifier;
this.dataProviderInfo.setBelongsTo(this.datasourceId);
let pid:Identifier = Identifier.getPIDFromIdentifiers(this.dataProviderInfo.identifiers); let pid:Identifier = Identifier.getPIDFromIdentifiers(this.dataProviderInfo.identifiers);
this.canonicalUrl = this.properties.domain+ properties.baseLink + ( pid ? (this.linkToLandingPage.split("?")[0] + "?pid=" + encodeURIComponent(pid.id)): this.canonicalUrl = this.properties.domain+ properties.baseLink + ( pid ? (this.linkToLandingPage.split("?")[0] + "?pid=" + encodeURIComponent(pid.id)):
(this.linkToLandingPage + this.dataProviderInfo.relcanId)); (this.linkToLandingPage + this.dataProviderInfo.relcanId));

View File

@ -17,8 +17,8 @@ import {OpenaireEntities} from "../../utils/properties/searchFields";
</errorMessages> </errorMessages>
<div *ngIf="fetchResults.searchUtils.status == errorCodes.DONE && !loading" class="uk-text-small"> <div *ngIf="fetchResults.searchUtils.status == errorCodes.DONE && !loading" class="uk-text-small">
<div class="uk-text-meta uk-margin-medium-bottom"> <div *ngIf="results.length > 90" class="uk-text-meta uk-margin-medium-bottom">
*Only top 100 {{openaireEntities.DATASOURCES}} that host {{openaireEntities.RESULTS}} which are also available via the Federated Research Data Repository are shown. *Only top 100 {{openaireEntities.DATASOURCES}} that host {{openaireEntities.RESULTS}} which are also available via {{collectedFromName}} are shown.
</div> </div>
<results-and-pages *ngIf="results.length >pageSize" [type]="openaireEntities.DATASOURCES" <results-and-pages *ngIf="results.length >pageSize" [type]="openaireEntities.DATASOURCES"
[page]="page" [pageSize]="pageSize" [page]="page" [pageSize]="pageSize"

View File

@ -159,7 +159,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<span>{{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}}</span> <span>{{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}}</span>
<span *ngIf="projects.length > projectsLimit"> <span *ngIf="projects.length > projectsLimit">
<a *ngIf="!showInline" (click)="viewAllProjectsClick();" class="uk-background-muted custom-extra-entities"> <a *ngIf="!showInline" (click)="viewAllProjectsClick();" class="uk-background-muted custom-extra-entities">
+{{projects.length - projectsLimit | number}} projects +{{projects.length - projectsLimit | number}}{{projects.length == 1000 ? ' more' : ''}} projects
</a> </a>
<a *ngIf="showInline && lessBtn" (click)="showInline = !showInline; lessBtn = false;" <a *ngIf="showInline && lessBtn" (click)="showInline = !showInline; lessBtn = false;"
class="uk-background-muted custom-extra-entities"> class="uk-background-muted custom-extra-entities">
@ -173,7 +173,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<span>{{showInline ? organizationNames.join(', ') : organizationNames.slice(0, organizationsLimit).join(', ')}}</span> <span>{{showInline ? organizationNames.join(', ') : organizationNames.slice(0, organizationsLimit).join(', ')}}</span>
<span *ngIf="organizations.length > organizationsLimit"> <span *ngIf="organizations.length > organizationsLimit">
<a *ngIf="!showInline" (click)="viewAllPartnersClick();" class="uk-background-muted custom-extra-entities"> <a *ngIf="!showInline" (click)="viewAllPartnersClick();" class="uk-background-muted custom-extra-entities">
+{{organizations.length - organizationsLimit | number}} partners +{{organizations.length - organizationsLimit | number}}{{organizations.length == 1000 ? ' more' : ''}} partners
</a> </a>
<a *ngIf="showInline && lessBtn" (click)="showInline = !showInline; lessBtn = false;" <a *ngIf="showInline && lessBtn" (click)="showInline = !showInline; lessBtn = false;"
class="uk-background-muted custom-extra-entities"> class="uk-background-muted custom-extra-entities">
@ -197,6 +197,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<modal-alert *ngIf="!isMobile" #partnersModal> <modal-alert *ngIf="!isMobile" #partnersModal>
<div *ngIf="organizations?.length == 1000" class="uk-text-meta uk-margin-medium-bottom">Only 1000 Partners<span *ngIf="resultTitle"> of {{resultTitle}}</span> are shown here.</div>
<div class="uk-text-small uk-text-emphasis uk-grid uk-grid-column-collapse uk-grid-row-small" uk-grid> <div class="uk-text-small uk-text-emphasis uk-grid uk-grid-column-collapse uk-grid-row-small" uk-grid>
<ng-container *ngFor="let item of organizations; let i = index"> <ng-container *ngFor="let item of organizations; let i = index">
<div class="uk-margin-xsmall-right"> <div class="uk-margin-xsmall-right">
@ -207,6 +208,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
</modal-alert> </modal-alert>
<modal-alert *ngIf="!isMobile" #projectsModal> <modal-alert *ngIf="!isMobile" #projectsModal>
<div *ngIf="projects?.length == 1000" class="uk-text-meta uk-margin-medium-bottom">Only 1000 {{openaireEntities.PROJECTS}}<span *ngIf="resultTitle"> of {{resultTitle}}</span> are shown here.</div>
<div class="uk-text-small uk-text-emphasis uk-grid uk-grid-column-collapse uk-grid-row-small" uk-grid> <div class="uk-text-small uk-text-emphasis uk-grid uk-grid-column-collapse uk-grid-row-small" uk-grid>
<ng-container *ngFor="let item of projects; let i = index"> <ng-container *ngFor="let item of projects; let i = index">
<div class="uk-margin-xsmall-right"> <div class="uk-margin-xsmall-right">
@ -223,6 +225,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
styleUrls: ['entity-metadata.component.less'] styleUrls: ['entity-metadata.component.less']
}) })
export class EntityMetadataComponent { export class EntityMetadataComponent {
@Input() resultTitle: string = null;
@Input() isMobile: boolean = false; @Input() isMobile: boolean = false;
@Input() entityType: string; @Input() entityType: string;
@Input() types: string[]; @Input() types: string[];

View File

@ -39,7 +39,7 @@ export class ParsingFunctions {
let fundedByProject: Project = { let fundedByProject: Project = {
"id": "", "acronym": "", "title": "", "id": "", "acronym": "", "title": "",
"funderShortname": "", "funderName": "", "funderShortname": "", "funderName": "", "funderJurisdiction": "",
"funding": "", "code": "", "provenanceAction": "", "validated": false "funding": "", "code": "", "provenanceAction": "", "validated": false
}; };
@ -61,8 +61,7 @@ export class ParsingFunctions {
} }
if (relation.hasOwnProperty("funding")) { if (relation.hasOwnProperty("funding")) {
let funding: { "funderName": string, "funderShortname": string, "stream": string }; let funding = this.parseFundingTrees(relation.funding);
funding = this.parseFundingTrees(relation.funding);
if (funding.funderName) { if (funding.funderName) {
fundedByProject['funderName'] = funding.funderName; fundedByProject['funderName'] = funding.funderName;
@ -70,6 +69,9 @@ export class ParsingFunctions {
if (funding.funderShortname) { if (funding.funderShortname) {
fundedByProject['funderShortname'] = funding.funderShortname; fundedByProject['funderShortname'] = funding.funderShortname;
} }
if(funding.funderJurisdiction) {
fundedByProject['funderJurisdiction'] = funding.funderJurisdiction;
}
if (funding.stream) { if (funding.stream) {
fundedByProject['funding'] = funding.stream; fundedByProject['funding'] = funding.stream;
} }
@ -79,10 +81,11 @@ export class ParsingFunctions {
} }
// publication & research data : for fundedByProjects | project landing : for funding // publication & research data : for fundedByProjects | project landing : for funding
public parseFundingTrees(fundingTree: any): { "funderName": string, "funderShortname": string, "stream": string } { public parseFundingTrees(fundingTree: any): any {
let funding: { "funderName": string, "funderShortname": string, "stream": string } = { let funding: { "funderName": string, "funderShortname": string, "funderJurisdiction": string, "stream": string } = {
"funderName": "", "funderName": "",
"funderShortname": "", "funderShortname": "",
"funderJurisdiction": "",
"stream": "" "stream": ""
}; };
let length = Array.isArray(fundingTree) ? fundingTree.length : 1; let length = Array.isArray(fundingTree) ? fundingTree.length : 1;
@ -93,6 +96,7 @@ export class ParsingFunctions {
if (fundingData.hasOwnProperty("funder")) { if (fundingData.hasOwnProperty("funder")) {
funding.funderShortname = fundingData['funder'].shortname; funding.funderShortname = fundingData['funder'].shortname;
funding.funderName = fundingData['funder'].name; funding.funderName = fundingData['funder'].name;
funding.funderJurisdiction = fundingData['funder'].jurisdiction;
} }
funding.stream = this.addFundingLevel0(fundingData, funding.stream); funding.stream = this.addFundingLevel0(fundingData, funding.stream);

View File

@ -116,7 +116,8 @@ export class ProjectsInModalComponent {
} }
if (filterLimits.length > 0) { if (filterLimits.length > 0) {
//this.filterQuery+=' and '+filter.filterId + ' exact '+ filterLimits + ' '; //this.filterQuery+=' and '+filter.filterId + ' exact '+ filterLimits + ' ';
this.filterQuery += ' and ( ' + filterLimits + ' ) '; // this.filterQuery += ' and ( ' + filterLimits + ' ) ';
this.filterQuery += '( ' + filterLimits + ' ) ';
} }
} }

View File

@ -3,7 +3,9 @@
[URL]="properties.domain + properties.baseLink+this.properties.searchLinkToOrganization+organizationInfo.relcanId" [URL]="properties.domain + properties.baseLink+this.properties.searchLinkToOrganization+organizationInfo.relcanId"
type="organization"> type="organization">
</schema2jsonld> </schema2jsonld>
<div *ngIf="organizationInfo && !organizationInfo.belongsTo && !isBottomIntersecting" [innerHTML]="organizationInfo.message"
class="uk-alert uk-alert-warning uk-position-fixed uk-position-bottom-center uk-text-small" style="z-index: 1000;">
</div>
<!-- Desktop view --> <!-- Desktop view -->
<div id="tm-main" class="uk-visible@m landing uk-section uk-padding-remove tm-middle"> <div id="tm-main" class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
<div *ngIf="!isMobile" class="tm-main"> <div *ngIf="!isMobile" class="tm-main">

View File

@ -115,8 +115,6 @@ export class OrganizationComponent {
public graph_height: number = 0; public graph_height: number = 0;
@ViewChild("graph_and_feedback") graph_and_feedback; @ViewChild("graph_and_feedback") graph_and_feedback;
// public shouldSticky: boolean = true;
subscriptions = []; subscriptions = [];
innerReportSubscriptions = []; innerReportSubscriptions = [];
properties: EnvProperties; properties: EnvProperties;
@ -131,6 +129,7 @@ export class OrganizationComponent {
public deleteByInferenceOpened: boolean = false; public deleteByInferenceOpened: boolean = false;
public isMobile: boolean = false; public isMobile: boolean = false;
public isBottomIntersecting: boolean = false;
public mobileContent: "info" | "actions" = "info"; public mobileContent: "info" | "actions" = "info";
public viewAllMobile: string = ""; public viewAllMobile: string = "";
@ -162,6 +161,11 @@ export class OrganizationComponent {
ngOnInit() { ngOnInit() {
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => { this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
this.isMobile = isMobile; this.isMobile = isMobile;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
})); }));
this.properties = properties; this.properties = properties;
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
@ -218,16 +222,6 @@ export class OrganizationComponent {
} else { } else {
this.offset = 0; this.offset = 0;
} }
// let bottom = document.getElementById('bottom');
// if(bottom) {
// let observer = new IntersectionObserver(entries => {
// entries.forEach(entry => {
// this.shouldSticky = !entry.isIntersecting;
// })
// });
// this.subscriptions.push(observer);
// observer.observe(bottom);
// }
if(this.graph_and_feedback) { if(this.graph_and_feedback) {
this.observeGraphAndFeedback(); this.observeGraphAndFeedback();
} }
@ -401,6 +395,7 @@ export class OrganizationComponent {
} else { } else {
this.organizationInfo = data; this.organizationInfo = data;
this.organizationId = this.organizationInfo.objIdentifier; // reset in case the parameter was a canonical url. The related queries and reports should have the dedup id this.organizationId = this.organizationInfo.objIdentifier; // reset in case the parameter was a canonical url. The related queries and reports should have the dedup id
this.organizationInfo.setBelongsTo(this.organizationId);
this.csvParamsTail = '" and relorganizationid exact "' + this.organizationId + '" ))'; this.csvParamsTail = '" and relorganizationid exact "' + this.organizationId + '" ))';
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToOrganization + this.organizationInfo.relcanId); this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToOrganization + this.organizationInfo.relcanId);
this.updateTitle((this.organizationInfo.title.name?this.organizationInfo.title.name:(this.organizationInfo.name?this.organizationInfo.name:'No title available'))); this.updateTitle((this.organizationInfo.title.name?this.organizationInfo.title.name:(this.organizationInfo.name?this.organizationInfo.name:'No title available')));
@ -488,7 +483,7 @@ export class OrganizationComponent {
let filename: string = 'funder-project-' + this.contentFileName + '-report'; let filename: string = 'funder-project-' + this.contentFileName + '-report';
this.subscriptions.push(this._searchProjectsService.getProjectsForOrganizations(this.organizationId, ' and (funder exact "' + this.encodeURI(this.funderId) + '" ) ', 1, this.funderCount, [], this.properties).subscribe( this.subscriptions.push(this._searchProjectsService.getProjectsForOrganizations(this.organizationId, '(funder exact "' + this.encodeURI(this.funderId) + '" ) ', 1, this.funderCount, [], this.properties).subscribe(
data => { data => {
projects = data[1]; projects = data[1];
for (let index = 0; index < projects.length; index++) { for (let index = 0; index < projects.length; index++) {

View File

@ -2,7 +2,9 @@
<schema2jsonld *ngIf="projectInfo" <schema2jsonld *ngIf="projectInfo"
[data]=projectInfo [URL]="properties.domain+properties.baseLink+properties.searchLinkToProject+projectId" [data]=projectInfo [URL]="properties.domain+properties.baseLink+properties.searchLinkToProject+projectId"
type="project"></schema2jsonld> type="project"></schema2jsonld>
<div *ngIf="projectInfo && !projectInfo.belongsTo && !isBottomIntersecting" [innerHTML]="projectInfo.message"
class="uk-alert uk-alert-warning uk-position-fixed uk-position-bottom-center uk-text-small" style="z-index: 1000;">
</div>
<!-- Desktop view --> <!-- Desktop view -->
<div class=" uk-visible@m landing uk-section uk-padding-remove tm-middle"> <div class=" uk-visible@m landing uk-section uk-padding-remove tm-middle">
<div *ngIf="!isMobile" class="tm-main"> <div *ngIf="!isMobile" class="tm-main">

View File

@ -169,14 +169,13 @@ export class ProjectComponent {
@ViewChild("descriptionDiv") descriptionDiv: ElementRef; @ViewChild("descriptionDiv") descriptionDiv: ElementRef;
@ViewChild('descriptionModal') descriptionModal; @ViewChild('descriptionModal') descriptionModal;
// public shouldSticky: boolean = true;
subscriptions = []; subscriptions = [];
private sub: Subscription; private sub: Subscription;
properties: EnvProperties; properties: EnvProperties;
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
public isMobile: boolean = false; public isMobile: boolean = false;
public isBottomIntersecting: boolean = false;
public mobileContent: "info" | "metrics" | "actions" = "info"; public mobileContent: "info" | "metrics" | "actions" = "info";
public tabMobile: string = ""; public tabMobile: string = "";
public viewAllMobile: string = ""; public viewAllMobile: string = "";
@ -209,6 +208,11 @@ export class ProjectComponent {
ngOnInit() { ngOnInit() {
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => { this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
this.isMobile = isMobile; this.isMobile = isMobile;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
})); }));
this.properties = properties; this.properties = properties;
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
@ -278,16 +282,6 @@ export class ProjectComponent {
} else { } else {
this.offset = 0; this.offset = 0;
} }
// let bottom = document.getElementById('bottom');
// if(bottom) {
// let observer = new IntersectionObserver(entries => {
// entries.forEach(entry => {
// this.shouldSticky = !entry.isIntersecting;
// })
// });
// this.subscriptions.push(observer);
// observer.observe(bottom);
// }
if(this.graph_and_feedback) { if(this.graph_and_feedback) {
this.observeGraphAndFeedback(); this.observeGraphAndFeedback();
} }
@ -466,6 +460,7 @@ export class ProjectComponent {
this.subscriptions.push(this._projectService.getProjectInfo(id, this.properties).subscribe( this.subscriptions.push(this._projectService.getProjectInfo(id, this.properties).subscribe(
data => { data => {
this.projectInfo = data; this.projectInfo = data;
this.projectInfo.setBelongsTo(id);
this.projectInfo.id = this.projectId; this.projectInfo.id = this.projectId;
this.actionsAfterGettingProjectInfo(); this.actionsAfterGettingProjectInfo();

View File

@ -4,29 +4,28 @@ import {throwError} from 'rxjs';
import {ProjectInfo} from '../../utils/entities/projectInfo'; import {ProjectInfo} from '../../utils/entities/projectInfo';
import {EnvProperties} from '../../utils/properties/env-properties';
import{EnvProperties} from '../../utils/properties/env-properties'; import {ParsingFunctions} from '../landing-utils/parsingFunctions.class';
import { ParsingFunctions } from '../landing-utils/parsingFunctions.class';
import {map} from "rxjs/operators"; import {map} from "rxjs/operators";
import {StringUtils} from "../../utils/string-utils.class"; import {StringUtils} from "../../utils/string-utils.class";
@Injectable() @Injectable()
export class ProjectService { export class ProjectService {
constructor(private http: HttpClient ) { constructor(private http: HttpClient) {
this.parsingFunctions = new ParsingFunctions(); this.parsingFunctions = new ParsingFunctions();
} }
public parsingFunctions: ParsingFunctions; public parsingFunctions: ParsingFunctions;
projectInfo: ProjectInfo; projectInfo: ProjectInfo;
getProjectInfo (id: string, properties:EnvProperties):any { getProjectInfo(id: string, properties: EnvProperties): any {
let url = properties.searchAPIURLLAst + 'projects/'+id+"?format=json"; let url = properties.searchAPIURLLAst + 'projects/' + id + "?format=json";
let key = url; let key = url;
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
//.map(res => <any> res.json()) //.map(res => <any> res.json())
.pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project'])) .pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project']))
.pipe(map(res => [res, .pipe(map(res => [res,
@ -36,118 +35,124 @@ export class ProjectService {
} }
getProjectInfoByGrantId (grant: string, funder:string, properties:EnvProperties):any { getProjectInfoByGrantId(grant: string, funder: string, properties: EnvProperties): any {
let url =properties.searchAPIURLLAst+ 'resources?query=(oaftype exact project)'+ let url = properties.searchAPIURLLAst + 'resources?query=(oaftype exact project)' +
'and (projectcode_nt exact "'+grant+'" ) and (fundershortname exact '+'"'+funder+ '"'+')'+"&format=json&size=1"; 'and (projectcode_nt exact "' + grant + '" ) and (fundershortname exact ' + '"' + funder + '"' + ')' + "&format=json&size=1";
let key = url; let key = url;
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
//.map(res => <any> res.json()) //.map(res => <any> res.json())
.pipe(map(res => res['results'][0])) .pipe(map(res => res['results'][0]))
.pipe(map(res => [res['result']['metadata']['oaf:entity']['oaf:project'],res['result']['header']['dri:objIdentifier']])) .pipe(map(res => [res['result']['metadata']['oaf:entity']['oaf:project'], res['result']['header']['dri:objIdentifier']]))
.pipe(map(res => [res[0], .pipe(map(res => [res[0],
res[0]['fundingtree'], res[0]['fundingtree'],
res[0]['rels']['rel'],res[1]])) res[0]['rels']['rel'], res[1]]))
.pipe(map(res => this.parseProjectInfo(res, properties))); .pipe(map(res => this.parseProjectInfo(res, properties)));
} }
/* /*
get project strtDate and endDate get project strtDate and endDate
*/ */
getProjectDates (id: string, properties:EnvProperties):any { getProjectDates(id: string, properties: EnvProperties): any {
let url = properties.searchAPIURLLAst+'projects/'+id+"?format=json"; let url = properties.searchAPIURLLAst + 'projects/' + id + "?format=json";
let key = url+'_projectDates'; let key = url + '_projectDates';
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
//.map(res => <any> res.json()) //.map(res => <any> res.json())
.pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project'])) .pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project']))
.pipe(map(res => [res, .pipe(map(res => [res,
res['fundingtree'], res['fundingtree'],
res['rels']['rel']])) res['rels']['rel']]))
.pipe(map(res => this.parseProjectDates(id,res))) .pipe(map(res => this.parseProjectDates(id, res)))
} }
getHTMLInfo(id: string, properties:EnvProperties): any { getHTMLInfo(id: string, properties: EnvProperties): any {
let url = properties.searchAPIURLLAst + 'projects/'+id+"?format=json"; let url = properties.searchAPIURLLAst + 'projects/' + id + "?format=json";
let key = url; let key = url;
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
//.map(res => <any> res.json()) //.map(res => <any> res.json())
.pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project'])) .pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project']))
.pipe(map(res => this.parseHTMLInfo(res))); .pipe(map(res => this.parseHTMLInfo(res)));
} }
private handleError (error: HttpErrorResponse) { private handleError(error: HttpErrorResponse) {
console.log(error); console.log(error);
return throwError(error || 'Server error'); return throwError(error || 'Server error');
} }
parseHTMLInfo (data: any):any { parseHTMLInfo(data: any): any {
let htmlInfo: {"title": string, "acronym": string, "callIdentifier": string}; let htmlInfo: { "title": string, "acronym": string, "callIdentifier": string };
if(data != null) { if (data != null) {
htmlInfo = {"title": data.title, "acronym": data.acronym, "callIdentifier": data.callidentifier}; htmlInfo = {"title": data.title, "acronym": data.acronym, "callIdentifier": data.callidentifier};
} }
return htmlInfo; return htmlInfo;
} }
parseProjectInfo (data: any, properties:EnvProperties):any { parseProjectInfo(data: any, properties: EnvProperties): any {
this.projectInfo = new ProjectInfo(); this.projectInfo = new ProjectInfo();
this.projectInfo.funding = {funderName: "", funderShortName: "", code: "", callIdentifier: "", this.projectInfo.funding = {
fundingStream: "", budget: "", contribution: "", currency: ""}; funderName: "", funderShortName: "", funderJurisdiction: "", code: "", callIdentifier: "",
fundingStream: "", budget: "", contribution: "", currency: ""
};
// ['result']['header']['dri:objIdentifier'] // ['result']['header']['dri:objIdentifier']
if(data[3] != null) { if (data[3] != null) {
this.projectInfo.id = data[3]; this.projectInfo.id = data[3];
} }
// ['result']['metadata']['oaf:entity']['oaf:project']['fundingtree'] // ['result']['metadata']['oaf:entity']['oaf:project']['fundingtree']
if(data[1] != null) { if (data[1] != null) {
let funding: {"funderName": string, "funderShortname": string, "stream": string}; let funding: { "funderName": string, "funderShortname": string, "funderJurisdiction": string, "stream": string };
funding = this.parsingFunctions.parseFundingTrees(data[1]); funding = this.parsingFunctions.parseFundingTrees(data[1]);
if(funding.funderName) { if (funding.funderName) {
this.projectInfo.funding.funderName = funding.funderName; this.projectInfo.funding.funderName = funding.funderName;
} }
if(funding.funderShortname) { if (funding.funderShortname) {
this.projectInfo.funding.funderShortName = funding.funderShortname; this.projectInfo.funding.funderShortName = funding.funderShortname;
} }
if(funding.stream) { if (funding.funderJurisdiction) {
this.projectInfo.funding.funderJurisdiction = funding.funderJurisdiction;
}
if (funding.stream) {
this.projectInfo.funding.fundingStream = funding.stream; this.projectInfo.funding.fundingStream = funding.stream;
} }
} }
// ['result']['metadata']['oaf:entity']['oaf:project'] // ['result']['metadata']['oaf:entity']['oaf:project']
if(data[0] != null) { if (data[0] != null) {
this.projectInfo.acronym = data[0].acronym; this.projectInfo.acronym = data[0].acronym;
if(data[0]['title']) { if (data[0]['title']) {
this.projectInfo.title = Array.isArray(data[0]['title']) ? StringUtils.HTMLToString(String(data[0].title[0])) : StringUtils.HTMLToString(String(data[0].title)); this.projectInfo.title = Array.isArray(data[0]['title']) ? StringUtils.HTMLToString(String(data[0].title[0])) : StringUtils.HTMLToString(String(data[0].title));
} else { } else {
this.projectInfo.title = ""; this.projectInfo.title = "";
} }
this.projectInfo.funding.code = data[0].code; this.projectInfo.funding.code = data[0].code;
if(data[0].startdate) { if (data[0].startdate) {
let date: number = Date.parse(data[0].startdate); let date: number = Date.parse(data[0].startdate);
this.projectInfo.startDate = (date ? date : null); this.projectInfo.startDate = (date ? date : null);
} }
if(data[0].enddate) { if (data[0].enddate) {
let date: number = Date.parse(data[0].enddate); let date: number = Date.parse(data[0].enddate);
this.projectInfo.endDate = (date ? date : null); this.projectInfo.endDate = (date ? date : null);
} }
if(this.projectInfo.endDate || this.projectInfo.startDate) { if (this.projectInfo.endDate || this.projectInfo.startDate) {
let todayDate = Date.parse(new Date().toString()); let todayDate = Date.parse(new Date().toString());
this.projectInfo.currentDate = todayDate; this.projectInfo.currentDate = todayDate;
if(this.projectInfo.startDate) { if (this.projectInfo.startDate) {
let startDate = +(this.projectInfo.startDate); let startDate = +(this.projectInfo.startDate);
if (todayDate < startDate) { if (todayDate < startDate) {
this.projectInfo.status = "Not started"; this.projectInfo.status = "Not started";
} }
} }
if(this.projectInfo.endDate && !this.projectInfo.status) { if (this.projectInfo.endDate && !this.projectInfo.status) {
let endDate = +(this.projectInfo.endDate); let endDate = +(this.projectInfo.endDate);
if (todayDate <= endDate) { if (todayDate <= endDate) {
this.projectInfo.status = "On going"; this.projectInfo.status = "On going";
@ -156,13 +161,13 @@ export class ProjectService {
} }
} }
} }
if(this.projectInfo.funding) { if (this.projectInfo.funding) {
if(this.projectInfo.funding.funderShortName == "EC") { if (this.projectInfo.funding.funderShortName == "EC") {
this.projectInfo.openAccessMandatePublications = data[0].oamandatepublications; this.projectInfo.openAccessMandatePublications = data[0].oamandatepublications;
// this.projectInfo.specialClause39 = data[0].ecsc39; // this.projectInfo.specialClause39 = data[0].ecsc39;
if(data[0].hasOwnProperty("projectoamandatedata")) { if (data[0].hasOwnProperty("projectoamandatedata")) {
this.projectInfo.openAccessMandateDatasets = data[0].projectoamandatedata; this.projectInfo.openAccessMandateDatasets = data[0].projectoamandatedata;
} else if(data[0].hasOwnProperty("ecarticle29_3")) { } else if (data[0].hasOwnProperty("ecarticle29_3")) {
this.projectInfo.openAccessMandateDatasets = data[0].ecarticle29_3; this.projectInfo.openAccessMandateDatasets = data[0].ecarticle29_3;
} }
this.projectInfo.funding.callIdentifier = data[0].callidentifier; this.projectInfo.funding.callIdentifier = data[0].callidentifier;
@ -176,18 +181,22 @@ export class ProjectService {
// } else { // } else {
// this.projectInfo.description = (data[0]['summary'][0]) ? String(data[0]['summary'][0]) : ""; // this.projectInfo.description = (data[0]['summary'][0]) ? String(data[0]['summary'][0]) : "";
// } // }
this.projectInfo.description = this.parsingFunctions.parseDescription(data[0] && data[0].summary?data[0].summary:[]); this.projectInfo.description = this.parsingFunctions.parseDescription(data[0] && data[0].summary ? data[0].summary : []);
} }
// ['result']['metadata']['oaf:entity']['oaf:project']['rels']['rel'] // ['result']['metadata']['oaf:entity']['oaf:project']['rels']['rel']
if(data[2] != null) { if (data[2] != null) {
this.projectInfo.organizations = [];//new Map<string, string>(); this.projectInfo.organizations = [];
if(!Array.isArray(data[2])) { if (!Array.isArray(data[2])) {
if(data[2].hasOwnProperty("to") && data[2]['to'].class && data[2]['to'].class.toLowerCase() == "hasparticipant") { if (data[2].hasOwnProperty("to") && data[2]['to'].class && data[2]['to'].class.toLowerCase() == "hasparticipant") {
let country: string = "";
let acronym: string = ""; let acronym: string = "";
let name: string = ""; let name: string = "";
let id: string = ""; let id: string = "";
if(data[2].hasOwnProperty("country")) {
country = data[2].country.classname;
}
if (data[2].hasOwnProperty("legalshortname")) { if (data[2].hasOwnProperty("legalshortname")) {
acronym = data[2].legalshortname; acronym = data[2].legalshortname;
} }
@ -203,36 +212,40 @@ export class ProjectService {
id = data[2]['to'].content; id = data[2]['to'].content;
} }
this.projectInfo.organizations.push({"acronym": acronym, "name": name, "id": id}); this.projectInfo.organizations.push({"country": country, "acronym": acronym, "name": name, "id": id});
} }
} else { } else {
for(let i=0; i<data[2].length; i++) { for (let i = 0; i < data[2].length; i++) {
let country: string = "";
let acronym: string = ""; let acronym: string = "";
let name: string = ""; let name: string = "";
let id: string = ""; let id: string = "";
if(data[2][i].hasOwnProperty("to") && data[2][i]['to'].class && data[2][i]['to'].class.toLowerCase() == "hasparticipant") { if (data[2][i].hasOwnProperty("to") && data[2][i]['to'].class && data[2][i]['to'].class.toLowerCase() == "hasparticipant") {
if(data[2][i].hasOwnProperty("legalshortname")) { if(data[2][i].hasOwnProperty("country")) {
country = data[2][i].country.classname;
}
if (data[2][i].hasOwnProperty("legalshortname")) {
acronym = data[2][i].legalshortname; acronym = data[2][i].legalshortname;
} }
if(data[2][i].hasOwnProperty("legalname")) { if (data[2][i].hasOwnProperty("legalname")) {
name = data[2][i].legalname; name = data[2][i].legalname;
} }
if(!acronym && !name){ if (!acronym && !name) {
acronym = "[no title available]"; acronym = "[no title available]";
} }
if(data[2][i].hasOwnProperty("to")) { if (data[2][i].hasOwnProperty("to")) {
id = data[2][i]['to'].content; id = data[2][i]['to'].content;
} }
this.projectInfo.organizations.push({"acronym": acronym, "name": name, "id": id}); this.projectInfo.organizations.push({"country": country, "acronym": acronym, "name": name, "id": id});
} }
} }
} }
} }
if(this.projectInfo.funding && this.projectInfo.funding.funderShortName == "EC") { if (this.projectInfo.funding && this.projectInfo.funding.funderShortName == "EC") {
this.projectInfo.url = properties.cordisURL+this.projectInfo.funding.code; this.projectInfo.url = properties.cordisURL + this.projectInfo.funding.code;
this.projectInfo.urlInfo = "Detailed project information (CORDIS)"; this.projectInfo.urlInfo = "Detailed project information (CORDIS)";
} }
@ -244,9 +257,9 @@ export class ProjectService {
} }
parseProjectDates (id: string, data: any):any { parseProjectDates(id: string, data: any): any {
let project = { id: id, startDate: "", endDate: ""}; let project = {id: id, startDate: "", endDate: ""};
if(data[0] != null) { if (data[0] != null) {
project.startDate = data[0].startdate; project.startDate = data[0].startdate;
project.endDate = data[0].enddate; project.endDate = data[0].enddate;
} }

View File

@ -2,7 +2,9 @@
<schema2jsonld *ngIf="resultLandingInfo && resultLandingInfo.record" <schema2jsonld *ngIf="resultLandingInfo && resultLandingInfo.record"
[data]=resultLandingInfo.record [URL]="canonicalUrl" [data]=resultLandingInfo.record [URL]="canonicalUrl"
[searchActionRoute]="properties.searchLinkToResults"></schema2jsonld> [searchActionRoute]="properties.searchLinkToResults"></schema2jsonld>
<div *ngIf="resultLandingInfo && !resultLandingInfo.belongsTo && !isBottomIntersecting" [innerHTML]="resultLandingInfo.message"
class="uk-alert uk-alert-warning uk-position-fixed uk-position-bottom-center uk-text-small" style="z-index: 1000;">
</div>
<!-- Desktop view --> <!-- Desktop view -->
<div *ngIf="!isMobile" id="tm-main" class="landing uk-section uk-padding-remove tm-middle"> <div *ngIf="!isMobile" id="tm-main" class="landing uk-section uk-padding-remove tm-middle">
<div class="tm-main"> <div class="tm-main">

View File

@ -1,4 +1,4 @@
import {ChangeDetectorRef, Component, ElementRef, Input, ViewChild} from '@angular/core'; import {ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Output, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router'; import {ActivatedRoute, Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser'; import {Meta, Title} from '@angular/platform-browser';
@ -43,6 +43,7 @@ export class ResultLandingComponent {
@Input() type: string = "publication"; @Input() type: string = "publication";
@Input() communityId = null; @Input() communityId = null;
@Output() result: EventEmitter<ResultLandingInfo> = new EventEmitter<ResultLandingInfo>();
enermapsId; enermapsId;
// @ViewChild('linkModal') linkModal; // @ViewChild('linkModal') linkModal;
@ViewChild('citeModal') citeModal; @ViewChild('citeModal') citeModal;
@ -154,8 +155,6 @@ export class ResultLandingComponent {
@ViewChild("descriptionDiv") descriptionDiv: ElementRef; @ViewChild("descriptionDiv") descriptionDiv: ElementRef;
@ViewChild('descriptionModal') descriptionModal; @ViewChild('descriptionModal') descriptionModal;
// public shouldSticky: boolean = true;
public mobileContent: "info" | "metrics" | "actions" = "info"; public mobileContent: "info" | "metrics" | "actions" = "info";
public tabMobile: string = ""; public tabMobile: string = "";
public viewAllMobile: string = ""; public viewAllMobile: string = "";
@ -163,6 +162,7 @@ export class ResultLandingComponent {
@ViewChild("sdgFosSuggest") sdgFosSuggest: SdgFosSuggestComponent; @ViewChild("sdgFosSuggest") sdgFosSuggest: SdgFosSuggestComponent;
public isMobile: boolean = false; public isMobile: boolean = false;
public isBottomIntersecting: boolean = false;
// Full screen modals for small screens (mobile) // Full screen modals for small screens (mobile)
@ViewChild('summaryFsModal') summaryFsModal: FullScreenModalComponent; @ViewChild('summaryFsModal') summaryFsModal: FullScreenModalComponent;
@ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent; @ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent;
@ -207,6 +207,11 @@ export class ResultLandingComponent {
ngOnInit() { ngOnInit() {
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => { this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
this.isMobile = isMobile; this.isMobile = isMobile;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
})); }));
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.isLoggedIn = !!user; this.isLoggedIn = !!user;
@ -293,16 +298,6 @@ export class ResultLandingComponent {
} else { } else {
this.offset = 0; this.offset = 0;
} }
// let bottom = document.getElementById('bottom');
// if(bottom) {
// let observer = new IntersectionObserver(entries => {
// entries.forEach(entry => {
// this.shouldSticky = !entry.isIntersecting;
// })
// });
// this.subscriptions.push(observer);
// observer.observe(bottom);
// }
if(this.graph_and_feedback) { if(this.graph_and_feedback) {
this.observeGraphAndFeedback(); this.observeGraphAndFeedback();
} }
@ -514,6 +509,9 @@ export class ResultLandingComponent {
this.resultLandingInfo = data; this.resultLandingInfo = data;
this.id = this.resultLandingInfo.objIdentifier; this.id = this.resultLandingInfo.objIdentifier;
let typeId = this.identifier?.id?'pid':'id';
let id = this.identifier?.id?this.identifier.id:this.id;
this.resultLandingInfo.setBelongsTo(typeId, id);
//old //old
// this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false'; // this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
// this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"' + this.id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false'; // this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"' + this.id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":200,"sort":"xaxis","xStyle":{"r":-30,"s":"6","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
@ -591,7 +589,6 @@ export class ResultLandingComponent {
this.setActiveTab(); this.setActiveTab();
this.cdr.detectChanges(); this.cdr.detectChanges();
if (contexts) { if (contexts) {
if (this.communityId && this.communityId == "enermaps" && properties.enermapsURL) { if (this.communityId && this.communityId == "enermaps" && properties.enermapsURL) {
this.enermapsId = ParsingFunctions.getEnermapsConceptId(contexts); this.enermapsId = ParsingFunctions.getEnermapsConceptId(contexts);

View File

@ -221,6 +221,11 @@ export class COOKIE {
} }
} }
class Roles {
manager = 'manager';
member = 'member';
}
export class Role { export class Role {
public static GROUP = ''; public static GROUP = '';
public static PORTAL_ADMIN = 'PORTAL_ADMINISTRATOR'; public static PORTAL_ADMIN = 'PORTAL_ADMINISTRATOR';
@ -228,6 +233,7 @@ export class Role {
public static ANONYMOUS_USER = 'ROLE_ANONYMOUS'; public static ANONYMOUS_USER = 'ROLE_ANONYMOUS';
public static USER_MANAGER = 'USER_MANAGER'; public static USER_MANAGER = 'USER_MANAGER';
public static CURATOR_CLAIM = 'CURATOR_CLAIM'; public static CURATOR_CLAIM = 'CURATOR_CLAIM';
public static ROLES: Roles = new Roles();
public static roleName(type: string, id: string) { public static roleName(type: string, id: string) {
return this.GROUP + this.mapType(type) + '.' + id; return this.GROUP + this.mapType(type) + '.' + id;
@ -285,3 +291,10 @@ export class Role {
return this.mapType(type, false).toUpperCase() + "_" + id.toUpperCase(); return this.mapType(type, false).toUpperCase() + "_" + id.toUpperCase();
} }
} }
export class RoleUtils {
get roles() {
return Role.ROLES;
}
}

View File

@ -181,19 +181,6 @@
class="uk-text-center uk-text-bold uk-margin-small-bottom"> class="uk-text-center uk-text-bold uk-margin-small-bottom">
{{ indicator.name }} {{ indicator.name }}
</div> </div>
<div *ngIf="indicator.indicatorPaths.length > 1" class="uk-margin-medium-bottom">
<ul class="uk-subnav uk-subnav-pill uk-subnav-small">
<li *ngFor="let indicatorPath of indicator.indicatorPaths; let i=index"
class="uk-flex uk-margin-small-top"
[class.uk-active]="(!indicator.activePath && i == 0) || indicator.activePath === i">
<a (click)="indicator.activePath = i">
<span>
{{ indicatorPath.parameters.title ? indicatorPath.parameters.title : '--' }}
</span>
</a>
</li>
</ul>
</div>
<iframe *ngIf="!properties.disableFrameLoad && getActiveIndicatorPath(indicator) && getActiveIndicatorPath(indicator).source !=='image' && <iframe *ngIf="!properties.disableFrameLoad && getActiveIndicatorPath(indicator) && getActiveIndicatorPath(indicator).source !=='image' &&
safeUrls.get(indicatorUtils.getFullUrl(stakeholder, getActiveIndicatorPath(indicator)))" safeUrls.get(indicatorUtils.getFullUrl(stakeholder, getActiveIndicatorPath(indicator)))"
allowfullscreen="true" mozallowfullscreen="true" allowfullscreen="true" mozallowfullscreen="true"
@ -213,6 +200,13 @@
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')" [ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
[src]="getActiveIndicatorPath(indicator).url"> [src]="getActiveIndicatorPath(indicator).url">
</div> </div>
<slider-tabs *ngIf="indicator.indicatorPaths.length > 1" [type]="'dynamic'" [flexPosition]="'right'" (activeEmitter)="indicator.activePath = $event"
tabsClass="uk-subnav uk-subnav-pill uk-subnav-small" containerClass="uk-margin-top uk-margin-bottom" [border]="false">
<slider-tab *ngFor="let indicatorPath of indicator.indicatorPaths; let i=index"
[tabTitle]="indicatorPath.parameters.tab ? indicatorPath.parameters.tab : indicatorPath.parameters.title"
[tabId]="i" [active]="(!indicator.activePath && i == 0) || indicator.activePath == i">
</slider-tab>
</slider-tabs>
</div> </div>
</div> </div>
</div> </div>
@ -483,7 +477,7 @@
class="uk-visible-toggle uk-flex uk-margin-small-top" transition-group-item class="uk-visible-toggle uk-flex uk-margin-small-top" transition-group-item
[class.uk-active]="(!indicator.activePath && i == 0) || indicator.activePath === i"> [class.uk-active]="(!indicator.activePath && i == 0) || indicator.activePath === i">
<a (click)="activeChartIndicatorPath(i)"> <a (click)="activeChartIndicatorPath(i)">
<span>{{ getParameter(i, 'title')?.get('value')?.value ? getParameter(i, 'title').get('value').value : 'No title yet' }}</span> <span>{{ getParameter(i, 'tab')?.get('value')?.value ? getParameter(i, 'tab').get('value').value : 'No title yet' }}</span>
</a> </a>
<span *ngIf="!indicator.defaultId && chartIndicatorPaths.length > 1" <span *ngIf="!indicator.defaultId && chartIndicatorPaths.length > 1"
class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left" class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left"
@ -522,7 +516,7 @@
</div> </div>
</span> </span>
</li> </li>
<li class="uk-margin-small-top"> <li *ngIf="!indicator.defaultId" class="uk-margin-small-top">
<a (click)="activeChartIndicatorPath(chartIndicatorPaths.length); $event.preventDefault()" <a (click)="activeChartIndicatorPath(chartIndicatorPaths.length); $event.preventDefault()"
class="uk-flex uk-flex-middle"> class="uk-flex uk-flex-middle">
<icon name="add" [flex]="true"></icon> <icon name="add" [flex]="true"></icon>
@ -548,6 +542,9 @@
</div> </div>
<div class="uk-width-1-1" formArrayName="parameters"> <div class="uk-width-1-1" formArrayName="parameters">
<div class="uk-grid" uk-grid> <div class="uk-grid" uk-grid>
<div *ngIf="stakeholderUtils.hasMultiChartIndicatorPaths && getParameter(i, 'tab')" input class="uk-width-1-1"
[formInput]="getParameter(i, 'tab').get('value')"
placeholder="Tab Title"></div>
<div *ngIf="getParameter(i, 'title')" input class="uk-width-1-1" <div *ngIf="getParameter(i, 'title')" input class="uk-width-1-1"
[formInput]="getParameter(i, 'title').get('value')" [formInput]="getParameter(i, 'title').get('value')"
placeholder="Chart Title"></div> placeholder="Chart Title"></div>

View File

@ -668,6 +668,9 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
if(!indicatorPath.parameters.statsProfile) { if(!indicatorPath.parameters.statsProfile) {
indicatorPath.parameters.statsProfile = null; indicatorPath.parameters.statsProfile = null;
} }
if(!indicatorPath.parameters.tab) {
indicatorPath.parameters.tab = indicatorPath.parameters.title;
}
Object.keys(indicatorPath.parameters).forEach(key => { Object.keys(indicatorPath.parameters).forEach(key => {
if (this.indicatorUtils.ignoredParameters.indexOf(key) === -1) { if (this.indicatorUtils.ignoredParameters.indexOf(key) === -1) {
if (this.indicatorUtils.parametersValidators.has(key)) { if (this.indicatorUtils.parametersValidators.has(key)) {

View File

@ -15,11 +15,6 @@ import {Option} from "../../sharedComponents/input/input.component";
import {Session} from "../../login/utils/helper.class"; import {Session} from "../../login/utils/helper.class";
import {properties} from "src/environments/environment"; import {properties} from "src/environments/environment";
class Roles {
manager = 'manager';
member = 'member';
}
class Entities { class Entities {
stakeholder = 'Dashboard'; stakeholder = 'Dashboard';
funder = 'Funder'; funder = 'Funder';
@ -45,7 +40,7 @@ export interface OAIndicator {
} }
export class StakeholderConfiguration { export class StakeholderConfiguration {
public static ROLES: Roles = new Roles();
public static ENTITIES: Entities = new Entities(); public static ENTITIES: Entities = new Entities();
public static TYPES: Option[] = [ public static TYPES: Option[] = [
{value: 'funder', label: StakeholderConfiguration.ENTITIES.funder}, {value: 'funder', label: StakeholderConfiguration.ENTITIES.funder},
@ -70,10 +65,6 @@ export class StakeholderConfiguration {
} }
export class StakeholderUtils { export class StakeholderUtils {
get roles() {
return StakeholderConfiguration.ROLES;
}
get entities() { get entities() {
return StakeholderConfiguration.ENTITIES; return StakeholderConfiguration.ENTITIES;
} }
@ -996,6 +987,7 @@ export class IndicatorUtils {
obj[this.getDescriptionObjectName(obj)]["options"]["title"] = ChartHelper.prefix + "title" + ChartHelper.suffix; obj[this.getDescriptionObjectName(obj)]["options"]["title"] = ChartHelper.prefix + "title" + ChartHelper.suffix;
} }
indicatorPath.parameters["title"] = title ? title : ""; indicatorPath.parameters["title"] = title ? title : "";
indicatorPath.parameters["tab"] = title ? title : "";
} }
private extractSubTitle(obj, indicatorPath: IndicatorPath) { private extractSubTitle(obj, indicatorPath: IndicatorPath) {

View File

@ -103,7 +103,7 @@ export class BrowseStakeholderBaseComponent<T> extends StakeholderBaseComponent
} }
get typeAsLabel() { get typeAsLabel() {
return this.stakeholderUtils.types.find(type => type.value === this.stakeholderType).label; return this.stakeholderUtils.types.find(type => type.value === this.stakeholderType)?.label;
} }
afterStakeholdersInitialized() { afterStakeholdersInitialized() {

View File

@ -1,5 +1,5 @@
import {AfterViewInit, ChangeDetectorRef, Component, Input, OnInit, ViewChild} from "@angular/core"; import {AfterViewInit, ChangeDetectorRef, Component, Input, OnInit, ViewChild} from "@angular/core";
import {Role, User} from "../login/utils/helper.class"; import {Role, RoleUtils, User} from "../login/utils/helper.class";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {UserManagementService} from "../services/user-management.service"; import {UserManagementService} from "../services/user-management.service";
import {UserRegistryService} from "../services/user-registry.service"; import {UserRegistryService} from "../services/user-registry.service";
@ -21,7 +21,7 @@ import {StringUtils} from "../utils/string-utils.class";
<modal-alert #managerModal [overflowBody]="false" (alertOutput)="verifyManager()" (cancelOutput)="cancel()" <modal-alert #managerModal [overflowBody]="false" (alertOutput)="verifyManager()" (cancelOutput)="cancel()"
[okDisabled]="code.invalid || loading"> [okDisabled]="code.invalid || loading">
<div> <div>
You have been invited to join <span class="uk-text-bold">{{name}}</span> {{(dashboard)}} Dashboard as a {{stakeholderUtils.roles.manager}}. You have been invited to join <span class="uk-text-bold">{{name}}</span> {{(dashboard)}} Dashboard as a {{roleUtils.roles.manager}}.
<span class="uk-text-primary">Fill</span> in the <span class="uk-text-primary">verification code</span>, sent to <span class="uk-text-primary">Fill</span> in the <span class="uk-text-primary">verification code</span>, sent to
your email, to accept the invitation request. your email, to accept the invitation request.
</div> </div>
@ -38,7 +38,7 @@ import {StringUtils} from "../utils/string-utils.class";
(alertOutput)="verifyMember()" [okDisabled]="(code.invalid || loading)"> (alertOutput)="verifyMember()" [okDisabled]="(code.invalid || loading)">
<div> <div>
<div> <div>
You have been invited to join <span class="uk-text-bold">{{name}}</span> {{(dashboard)}} Dashboard as a {{stakeholderUtils.roles.member}}. You have been invited to join <span class="uk-text-bold">{{name}}</span> {{(dashboard)}} Dashboard as a {{roleUtils.roles.member}}.
<span class="uk-text-primary">Fill</span> in the <span class="uk-text-primary">verification code</span>, sent <span class="uk-text-primary">Fill</span> in the <span class="uk-text-primary">verification code</span>, sent
to your email, to accept the invitation request. to your email, to accept the invitation request.
</div> </div>
@ -98,6 +98,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
public error: string = null; public error: string = null;
public loading: boolean = false; public loading: boolean = false;
public stakeholderUtils: StakeholderUtils = new StakeholderUtils(); public stakeholderUtils: StakeholderUtils = new StakeholderUtils();
public roleUtils: RoleUtils = new RoleUtils();
constructor(protected _route: ActivatedRoute, constructor(protected _route: ActivatedRoute,
protected _router: Router, protected _router: Router,
@ -173,7 +174,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
this.managerModal.okButtonText = 'Accept'; this.managerModal.okButtonText = 'Accept';
this.managerModal.stayOpen = true; this.managerModal.stayOpen = true;
this.managerModal.cancelButtonText = 'Cancel'; this.managerModal.cancelButtonText = 'Cancel';
this.managerModal.alertTitle = StringUtils.capitalize(this.stakeholderUtils.roles.manager) + ' Invitation'; this.managerModal.alertTitle = StringUtils.capitalize(this.roleUtils.roles.manager) + ' Invitation';
this.managerModal.open(); this.managerModal.open();
} }
@ -184,7 +185,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
this.memberModal.okButtonLeft = false; this.memberModal.okButtonLeft = false;
this.memberModal.stayOpen = true; this.memberModal.stayOpen = true;
this.memberModal.cancelButtonText = 'Cancel'; this.memberModal.cancelButtonText = 'Cancel';
this.memberModal.alertTitle = StringUtils.capitalize(this.stakeholderUtils.roles.member) + ' Invitation'; this.memberModal.alertTitle = StringUtils.capitalize(this.roleUtils.roles.member) + ' Invitation';
this.cdr.detectChanges(); this.cdr.detectChanges();
this.memberModal.open(); this.memberModal.open();
} }

View File

@ -13,6 +13,7 @@ import {DatasourcesHelperClass} from "./searchUtils/datasourcesHelper.class";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {RefineResultsUtils} from "../services/servicesUtils/refineResults.class"; import {RefineResultsUtils} from "../services/servicesUtils/refineResults.class";
import {RefineFieldResultsService} from "../services/refineFieldResults.service"; import {RefineFieldResultsService} from "../services/refineFieldResults.service";
import {zip} from "rxjs";
@Component({ @Component({
@ -207,12 +208,28 @@ export class SearchDataProvidersComponent {
parametersFull = parameters; parametersFull = parameters;
refineQueryFull = refineFieldsFilterQuery+(refineFieldsFilterQuery.length > 0 && datasourceQueryPrefix.length >0 ? "&" : "")+(datasourceQueryPrefix.length>0 ? "fq=" : "")+datasourceQueryPrefix; refineQueryFull = refineFieldsFilterQuery+(refineFieldsFilterQuery.length > 0 && datasourceQueryPrefix.length >0 ? "&" : "")+(datasourceQueryPrefix.length>0 ? "fq=" : "")+datasourceQueryPrefix;
} }
this.searchFiltersSub = this._searchDataProvidersService.advancedSearchDataproviders( parametersFull, page, size, this.properties, (refine /*&& (this.type=="all" || this.type == "deposit")*/) ? this.searchPage.getRefineFieldsQuery() : null, this.searchPage.getFields(), refineQueryFull, isDeposit, true)
//.switchMap( let filterQueries;
.subscribe( let filterIds = [];
let fields = this.searchPage.getFields();
for(let filter of this.searchPage.URLCreatedFilters) {
filterIds.push(filter.filterId);
fields = fields.filter(field => field != filter.filterId);
}
if(filterIds.length > 0) {
filterQueries = zip(this._searchDataProvidersService.advancedSearchDataproviders(parametersFull, page, size, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(filterIds) : null, filterIds, refineQueryFull, isDeposit, false),
this._searchDataProvidersService.advancedSearchDataproviders(parametersFull, page, size, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(fields) : null, fields, refineQueryFull, isDeposit, true)
);
} else {
filterQueries = this._searchDataProvidersService.advancedSearchDataproviders(parametersFull, page, size, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(fields) : null, fields, refineQueryFull, isDeposit, true)
}
this.searchFiltersSub = filterQueries.subscribe(
data => { data => {
let totalResults = data[0]; let totalResults = filterIds.length > 0 ? data[0][0] : data[0];
let filters = data[2]; let filters = filterIds.length > 0 ? data[0][2].concat(data[1][2]) : data[2];
this.filtersReturned(refine, filters, totalResults, page); this.filtersReturned(refine, filters, totalResults, page);
}, },
err => { err => {

View File

@ -10,6 +10,7 @@ import {EnvProperties} from '../utils/properties/env-properties';
import {NewSearchPageComponent, SearchForm} from "./searchUtils/newSearchPage.component"; import {NewSearchPageComponent, SearchForm} from "./searchUtils/newSearchPage.component";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {RefineFieldResultsService} from "../services/refineFieldResults.service"; import {RefineFieldResultsService} from "../services/refineFieldResults.service";
import {zip} from "rxjs";
@Component({ @Component({
@ -169,12 +170,28 @@ export class SearchOrganizationsComponent {
this.searchUtils.refineStatus = this.errorCodes.LOADING; this.searchUtils.refineStatus = this.errorCodes.LOADING;
this.disableRefineForms = true; this.disableRefineForms = true;
this.searchPageUpdates.emit({disableForms: this.disableForms, disableRefineForms: this.disableRefineForms, searchUtils: this.searchUtils}); this.searchPageUpdates.emit({disableForms: this.disableForms, disableRefineForms: this.disableRefineForms, searchUtils: this.searchUtils});
this.searchFiltersSub = this._searchOrganizationsService.advancedSearchOrganizations(parameters, page, size, this.properties,(refine) ? this.searchPage.getRefineFieldsQuery() : null, this.searchPage.getFields(), refineFieldsFilterQuery, true)
//.switchMap( let filterQueries;
.subscribe( let filterIds = [];
let fields = this.searchPage.getFields();
for(let filter of this.searchPage.URLCreatedFilters) {
filterIds.push(filter.filterId);
fields = fields.filter(field => field != filter.filterId);
}
if(filterIds.length > 0) {
filterQueries = zip(this._searchOrganizationsService.advancedSearchOrganizations(parameters, page, size, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(filterIds) : null, filterIds, refineFieldsFilterQuery, false),
this._searchOrganizationsService.advancedSearchOrganizations(parameters, page, size, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(fields) : null, fields, refineFieldsFilterQuery, true)
);
} else {
filterQueries = this._searchOrganizationsService.advancedSearchOrganizations(parameters, page, size, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(fields) : null, fields, refineFieldsFilterQuery, true)
}
this.searchFiltersSub = filterQueries.subscribe(
data => { data => {
let totalResults = data[0]; let totalResults = filterIds.length > 0 ? data[0][0] : data[0];
let filters = data[2]; let filters = filterIds.length > 0 ? data[0][2].concat(data[1][2]) : data[2];
this.filtersReturned(refine, filters, totalResults, page); this.filtersReturned(refine, filters, totalResults, page);
}, },
err => { err => {

View File

@ -11,6 +11,7 @@ import {NewSearchPageComponent, SearchForm} from "./searchUtils/newSearchPage.co
import {RangeFilter} from "../utils/rangeFilter/rangeFilterHelperClasses.class"; import {RangeFilter} from "../utils/rangeFilter/rangeFilterHelperClasses.class";
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
import {RefineFieldResultsService} from "../services/refineFieldResults.service"; import {RefineFieldResultsService} from "../services/refineFieldResults.service";
import {zip} from "rxjs";
@Component({ @Component({
selector: 'search-projects', selector: 'search-projects',
@ -174,14 +175,29 @@ export class SearchProjectsComponent {
disableRefineForms: this.disableRefineForms, disableRefineForms: this.disableRefineForms,
searchUtils: this.searchUtils searchUtils: this.searchUtils
}); });
this.searchFiltersSub = this._searchProjectsService.advancedSearchProjects(parameters, page, size, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery() : null, this.searchPage.getFields(), refineFieldsFilterQuery, true)
//.switchMap(
.subscribe(
data => {
let totalResults = data[0];
let filters = data[2];
this.filtersReturned(refine, filters, totalResults, page);
let filterQueries;
let filterIds = [];
let fields = this.searchPage.getFields();
for(let filter of this.searchPage.URLCreatedFilters) {
filterIds.push(filter.filterId);
fields = fields.filter(field => field != filter.filterId);
}
if(filterIds.length > 0) {
filterQueries = zip(this._searchProjectsService.advancedSearchProjects(parameters, page, size, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(filterIds) : null, filterIds, refineFieldsFilterQuery, false),
this._searchProjectsService.advancedSearchProjects(parameters, page, size, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(fields) : null, fields, refineFieldsFilterQuery, true)
);
} else {
filterQueries = this._searchProjectsService.advancedSearchProjects(parameters, page, size, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(fields) : null, fields, refineFieldsFilterQuery, true)
}
this.searchFiltersSub = filterQueries.subscribe(
data => {
let totalResults = filterIds.length > 0 ? data[0][0] : data[0];
let filters = filterIds.length > 0 ? data[0][2].concat(data[1][2]) : data[2];
this.filtersReturned(refine, filters, totalResults, page);
}, },
err => { err => {
this.filters = this.searchPage.prepareFiltersToShow([], 0); this.filters = this.searchPage.prepareFiltersToShow([], 0);

View File

@ -14,6 +14,7 @@ import {ContextsService} from "../claims/claim-utils/service/contexts.service";
import {StringUtils} from "../utils/string-utils.class"; import {StringUtils} from "../utils/string-utils.class";
import {RefineResultsUtils} from "../services/servicesUtils/refineResults.class"; import {RefineResultsUtils} from "../services/servicesUtils/refineResults.class";
import {RefineFieldResultsService} from "../services/refineFieldResults.service"; import {RefineFieldResultsService} from "../services/refineFieldResults.service";
import {zip} from "rxjs";
@Component({ @Component({
selector: 'search-research-results', selector: 'search-research-results',
@ -253,13 +254,27 @@ export class SearchResearchResultsComponent {
this.searchUtils.refineStatus = this.errorCodes.LOADING; this.searchUtils.refineStatus = this.errorCodes.LOADING;
this.disableRefineForms = true; this.disableRefineForms = true;
this.searchPageUpdates.emit({disableForms: this.disableForms, disableRefineForms: this.disableRefineForms, searchUtils: this.searchUtils}); this.searchPageUpdates.emit({disableForms: this.disableForms, disableRefineForms: this.disableRefineForms, searchUtils: this.searchUtils});
this.searchFiltersSub = this._searchResearchResultsService.advancedSearchResults(this.resultType, parameters, page, size, sortBy, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery() : null, this.searchPage.getFields(), refineFieldsFilterQuery, true)
// this.subs.push(this._searchResearchResultsService.advancedSearchResults(this.resultType, parameters, page, size, sortBy, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery() : null, this.searchPage.getFields(), refineFieldsFilterQuery) let filterQueries;
//.switchMap( let filterIds = [];
.subscribe( let fields = this.searchPage.getFields();
for(let filter of this.searchPage.URLCreatedFilters) {
filterIds.push(filter.filterId);
fields = fields.filter(field => field != filter.filterId);
}
if(filterIds.length > 0) {
filterQueries = zip(this._searchResearchResultsService.advancedSearchResults(this.resultType, parameters, page, size, sortBy, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(filterIds) : null, filterIds, refineFieldsFilterQuery, false),
this._searchResearchResultsService.advancedSearchResults(this.resultType, parameters, page, size, sortBy, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(fields) : null, fields, refineFieldsFilterQuery, true)
);
} else {
filterQueries = this._searchResearchResultsService.advancedSearchResults(this.resultType, parameters, page, size, sortBy, this.properties, (refine) ? this.searchPage.getRefineFieldsQuery(fields) : null, fields, refineFieldsFilterQuery, true);
}
this.searchFiltersSub = filterQueries.subscribe(
data => { data => {
let totalResults = data[0]; let totalResults = filterIds.length > 0 ? data[0][0] : data[0];
let filters = data[2]; let filters = filterIds.length > 0 ? data[0][2].concat(data[1][2]) : data[2];
// if (refine) { // if (refine) {
// this.filters = this.searchPage.prepareFiltersToShow(filters, totalResults); // this.filters = this.searchPage.prepareFiltersToShow(filters, totalResults);

View File

@ -551,9 +551,11 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
/* /*
* Get a query string of all fields, that want to get from search (e.g. &fields=funderid&fields=projectstartyear&...)) * Get a query string of all fields, that want to get from search (e.g. &fields=funderid&fields=projectstartyear&...))
*/ */
public getRefineFieldsQuery(): string { public getRefineFieldsQuery(fields: string[] = null): string {
var fields: string[] = this.getFields(); if(!fields) {
fields = this.getFields();
}
var fieldsStr = "" var fieldsStr = ""
for (var i = 0; i < fields.length; i++) { for (var i = 0; i < fields.length; i++) {
fieldsStr += "&fields=" + fields[i]; fieldsStr += "&fields=" + fields[i];

View File

@ -34,14 +34,15 @@ export class SearchProjectsService {
} }
getProjectsforDataProvider (datasourceId: string, page: number, size: number, properties:EnvProperties ):any { getProjectsforDataProvider (datasourceId: string, page: number, size: number, properties:EnvProperties ):any {
let url = properties.searchResourcesAPIURL; let url = properties.searchResourcesAPIURL;
var basicQuery = "(oaftype exact project) " var basicQuery = "(oaftype exact project) ";
var filterQuery = "&fq=(projectcode<>\"unidentified\")";
url += "?query="; url += "?query=";
if(datasourceId!= null && datasourceId != '' ) { if(datasourceId!= null && datasourceId != '' ) {
url +=" ( "+basicQuery+ " ) " +" and (collectedfromdatasourceid exact \"" + datasourceId + "\" or resulthostingdatasourceid exact \""+ datasourceId + "\")"; url +=" ( "+basicQuery+ " ) " +" and (collectedfromdatasourceid exact \"" + datasourceId + "\" or resulthostingdatasourceid exact \""+ datasourceId + "\")";
}else{ }else{
url +=" ( "+basicQuery+ " ) "; url +=" ( "+basicQuery+ " ) ";
} }
url += filterQuery;
url += "&page="+(page-1)+"&size="+size; url += "&page="+(page-1)+"&size="+size;
url += "&format=json"; url += "&format=json";
@ -53,6 +54,7 @@ export class SearchProjectsService {
// &type=projects // &type=projects
let url = properties.searchAPIURLLAst+"resources2/?format=json"; let url = properties.searchAPIURLLAst+"resources2/?format=json";
// var basicQuery = "(oaftype exact project) " // var basicQuery = "(oaftype exact project) "
var basicQuery = "&fq=(projectcode<>\"unidentified\")";
// url += "?query="; // url += "?query=";
if(params!= null && params != '' ) { if(params!= null && params != '' ) {
url +="&query=(" + params + ")"; url +="&query=(" + params + ")";
@ -66,6 +68,8 @@ export class SearchProjectsService {
if(refineQuery) { if(refineQuery) {
url += "&" + refineQuery; url += "&" + refineQuery;
} }
// url += "&fq="+basicQuery;
url += basicQuery;
url += "&page="+(page-1)+"&size="+size; url += "&page="+(page-1)+"&size="+size;
url += minRef ? "&minRef=true" : ""; url += minRef ? "&minRef=true" : "";
@ -80,11 +84,15 @@ export class SearchProjectsService {
let url = properties.searchResourcesAPIURL; let url = properties.searchResourcesAPIURL;
var basicQuery = "(oaftype exact project) " var basicQuery = "(oaftype exact project) "
url += "?query="; url += "?query=";
if(filterquery!= null && filterquery != '' ) { // if(filterquery!= null && filterquery != '' ) {
url +="( ( "+basicQuery+ " ) and (relorganizationid exact \"" + organizationId + "\")"+" " + filterquery + ")"; // url +="( ( "+basicQuery+ " ) and (relorganizationid exact \"" + organizationId + "\")"+" " + filterquery + ")";
}else{ // }else{
url +=" (( "+basicQuery+ " ) " +" and (relorganizationid exact \"" + organizationId + "\"))"; url +=" (( "+basicQuery+ " ) " +" and (relorganizationid exact \"" + organizationId + "\"))";
// }
if(filterquery) {
url += "&fq=" + filterquery;
} }
url += "&fq=(projectcode<>\"unidentified\")";
if(refineFields!= null && refineFields.length > 0 ) { if(refineFields!= null && refineFields.length > 0 ) {
url +="&refine=true"; url +="&refine=true";
for(let i=0; i< refineFields.length ; i++ ){ for(let i=0; i< refineFields.length ; i++ ){
@ -304,6 +312,8 @@ export class SearchProjectsService {
if(refineParams!= null && refineParams != '' ) { if(refineParams!= null && refineParams != '' ) {
url += refineParams; url += refineParams;
} }
url += "&fq=(projectcode<>\"unidentified\")";
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.pipe(map(res => res['meta']['total'])); .pipe(map(res => res['meta']['total']));
} }

View File

@ -829,7 +829,6 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
resetValue(event: any) { resetValue(event: any) {
event.stopPropagation(); event.stopPropagation();
console.log(1)
this.formControl.setValue(''); this.formControl.setValue('');
this.focus(true, event); this.focus(true, event);
} }

View File

@ -1,7 +1,8 @@
export interface Icon { export interface Icon {
name?: string, name?: string,
svg?: string, svg?: string,
class?: string class?: string,
ratio?: number
} }
export class MenuItem { export class MenuItem {

View File

@ -9,7 +9,7 @@ export class SliderTabComponent {
@Input("tabTitle") @Input("tabTitle")
public title: string; public title: string;
@Input("tabId") @Input("tabId")
public id: string; public id: string | number;
@Input() @Input()
public active: boolean = false; public active: boolean = false;
@Input() @Input()

View File

@ -143,7 +143,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
/** /**
* Notify regarding new active element * Notify regarding new active element
* */ * */
@Output() activeEmitter: EventEmitter<string> = new EventEmitter<string>(); @Output() activeEmitter: EventEmitter<string | number> = new EventEmitter<number>();
private activeIndex: number = 0; private activeIndex: number = 0;
private subscriptions: any[] = []; private subscriptions: any[] = [];
private observer: IntersectionObserver; private observer: IntersectionObserver;
@ -235,7 +235,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
}); });
}, {threshold: 0.1}); }, {threshold: 0.1});
this.tabs.forEach(tab => { this.tabs.forEach(tab => {
let element = document.getElementById(tab.id); let element = document.getElementById(tab.id.toString());
if (element) { if (element) {
this.observer.observe(element); this.observer.observe(element);
} }

View File

@ -1,7 +1,7 @@
import {Email} from "./email"; import {Email} from "./email";
import {Body} from "./body"; import {Body} from "./body";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {User} from "../../login/utils/helper.class"; import {Role, User} from "../../login/utils/helper.class";
import {StakeholderConfiguration} from "../../monitor-admin/utils/indicator-utils"; import {StakeholderConfiguration} from "../../monitor-admin/utils/indicator-utils";
export class Composer { export class Composer {
@ -33,7 +33,7 @@ export class Composer {
email.subject = this.subjectPrefix + communityName + ": Welcome new manager"; email.subject = this.subjectPrefix + communityName + ": Welcome new manager";
email.body = "<div style='font-size:" + this.noteBodySize + "'><p>Welcome to OpenAIRE Connect!</p>" email.body = "<div style='font-size:" + this.noteBodySize + "'><p>Welcome to OpenAIRE Connect!</p>"
+ "<p>You are receiving this e-mail as you were assigned as manager of the <a href='https://beta." + "<p>You are receiving this e-mail as you were assigned as " + Role.ROLES['manager'] + " of the <a href='https://beta."
+ communityId + ".openaire.eu/'>" + communityName + "</a> gateway. " + communityId + ".openaire.eu/'>" + communityName + "</a> gateway. "
+ "In order to access the administration section of your community you must first login using one of the available options. " + "In order to access the administration section of your community you must first login using one of the available options. "
+ "<br>The administrative rights are associated with the e-mail address that was used to send you this message." + "<br>The administrative rights are associated with the e-mail address that was used to send you this message."
@ -329,9 +329,9 @@ export class Composer {
'<p>The verification code is <b>((__code__))</b>.</p>' + '<p>The verification code is <b>((__code__))</b>.</p>' +
'<p>By logging in and using the service you accept and agree to the <a href="' + pdppLink + '" target="_blank">OpenAIRE personal data protection policy</a>.</p>' + '<p>By logging in and using the service you accept and agree to the <a href="' + pdppLink + '" target="_blank">OpenAIRE personal data protection policy</a>.</p>' +
(role === "manager"? (role === "manager"?
'<p>As a manager of the OpenAIRE Monitor Dashboard, you will have access to the administration part of the dashboard, ' + '<p>As a ' + Role.ROLES[role] + ' of the OpenAIRE Monitor Dashboard, you will have access to the administration part of the dashboard, ' +
'where you will be able to customize and manage the profile of the ' + name + '.</p>': 'where you will be able to customize and manage the profile of the ' + name + '.</p>':
'<p>As a member of the OpenAIRE Monitor Dashboard, you will have access to the restricted access areas of the profile for the ' + name + '.') + '<p>As a ' + Role.ROLES[role] + ' of the OpenAIRE Monitor Dashboard, you will have access to the restricted access areas of the profile for the ' + name + '.') +
'<p>Please contact us at <a href="mailto:' + properties.helpdeskEmail+'">' + properties.helpdeskEmail + '<p>Please contact us at <a href="mailto:' + properties.helpdeskEmail+'">' + properties.helpdeskEmail +
'</a> if you have any questions or concerns.</p>' + '</a> if you have any questions or concerns.</p>' +
'<p>Kind Regards<br>The OpenAIRE Team</p>' + '<p>Kind Regards<br>The OpenAIRE Team</p>' +
@ -350,13 +350,13 @@ export class Composer {
email.subject = 'National Open Access Monitor Ireland | ' + name; email.subject = 'National Open Access Monitor Ireland | ' + name;
email.recipient = recipient; email.recipient = recipient;
email.body = '<p>Dear user,</p>' + email.body = '<p>Dear user,</p>' +
'<p>You have been invited to be a ' + StakeholderConfiguration.ROLES[role] +' of the for the National Open Access Monitor, Ireland dashboard for the ' + name + '.</p>' + '<p>You have been invited to be a ' + Role.ROLES[role] +' of the for the National Open Access Monitor, Ireland dashboard for the ' + name + '.</p>' +
'<p>Click <a href="((__link__))" target="_blank">this URL</a> and use the verification code below to accept the invitation.</p>' + '<p>Click <a href="((__link__))" target="_blank">this URL</a> and use the verification code below to accept the invitation.</p>' +
'<p>The verification code is <b>((__code__))</b>.</p>' + '<p>The verification code is <b>((__code__))</b>.</p>' +
'<p>At your first sign in you will be asked to accept and consent to the "OpenAIRE Personal Data Protection Policy and Consent Form" to be able to use the service.</p>' + '<p>At your first sign in you will be asked to accept and consent to the "OpenAIRE Personal Data Protection Policy and Consent Form" to be able to use the service.</p>' +
(role === "manager"? (role === "manager"?
'<p>As a ' + StakeholderConfiguration.ROLES[role] + ' of the National Open Access Monitor, Ireland, you will have access to the administration part of the dashboard, where you will be able to also invite other users to become ' + StakeholderConfiguration.ROLES['member'] + 's.</p>': '<p>As a ' + Role.ROLES[role] + ' of the National Open Access Monitor, Ireland, you will have access to the administration part of the dashboard, where you will be able to also invite other users to become ' + Role.ROLES['member'] + 's.</p>':
'<p>As a ' + StakeholderConfiguration.ROLES[role] + ' of the National Open Access Monitor, Ireland, you will have access to the sandbox of the profile for the ' + name + '.') + '<p>As a ' + Role.ROLES[role] + ' of the National Open Access Monitor, Ireland, you will have access to the sandbox of the profile for the ' + name + '.') +
'<p>Please contact us at <a href="mailto:' + properties.helpdeskEmail+'">' + properties.helpdeskEmail + '<p>Please contact us at <a href="mailto:' + properties.helpdeskEmail+'">' + properties.helpdeskEmail +
'</a> if you have any questions or concerns.</p>' + '</a> if you have any questions or concerns.</p>' +
'<p>Kind Regards<br>The OpenAIRE Team</p>' + '<p>Kind Regards<br>The OpenAIRE Team</p>' +
@ -379,9 +379,9 @@ export class Composer {
'<p>Click <a href="((__link__))" target="_blank">this URL</a> and use the verification code below to accept the invitation.</p>' + '<p>Click <a href="((__link__))" target="_blank">this URL</a> and use the verification code below to accept the invitation.</p>' +
'<p>The verification code is <b>((__code__))</b>.</p>' + '<p>The verification code is <b>((__code__))</b>.</p>' +
(role === 'manager'? (role === 'manager'?
'<p>As a manager of the OpenAIRE Research Community Dashboard, you will have access to the administration part of the dashboard, ' + '<p>As a ' + Role.ROLES[role] + ' of the OpenAIRE Research Community Dashboard, you will have access to the administration part of the dashboard, ' +
'where you will be able to customize and manage the content of the ' + name + '.</p>': 'where you will be able to customize and manage the content of the ' + name + '.</p>':
'<p>As a member of the OpenAIRE Research Community Dashboard, you will have access to the community dashboard and link research results with projects, communities and other research projects.</p>') + '<p>As a ' + Role.ROLES[role] + ' of the OpenAIRE Research Community Dashboard, you will have access to the community dashboard and link research results with projects, communities and other research projects.</p>') +
'<p>Please contact us at <a href="mailto:' + properties.helpdeskEmail+'">' + properties.helpdeskEmail + '<p>Please contact us at <a href="mailto:' + properties.helpdeskEmail+'">' + properties.helpdeskEmail +
'</a> if you have any questions or concerns.</p>' + '</a> if you have any questions or concerns.</p>' +
'<p>Kind Regards<br>The OpenAIRE Team</p>' + '<p>Kind Regards<br>The OpenAIRE Team</p>' +

View File

@ -1,15 +1,18 @@
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {Measure} from "./resultLandingInfo"; import {BelongsTo, Measure} from "./resultLandingInfo";
export class DataproviderProvenance { export class DataproviderProvenance {
provenance: Map<string, {"urlPrefix": string, "name": string}>; provenance: Map<string, { "urlPrefix": string, "name": string }>;
constructor() { constructor() {
this.provenance = new Map(); this.provenance = new Map();
this.provenance.set("opendoar____::", {"urlPrefix": properties.openDoarURL, "name": "OpenDOAR"});//, "idRegexPrefix": ""}); this.provenance.set("opendoar____::", {"urlPrefix": properties.openDoarURL, "name": "OpenDOAR"});//, "idRegexPrefix": ""});
this.provenance.set("re3data_____::", {"urlPrefix": properties.r3DataURL, "name": "re3data.org"}); this.provenance.set("re3data_____::", {"urlPrefix": properties.r3DataURL, "name": "re3data.org"});
this.provenance.set("fairsharing_::", {"urlPrefix": properties.fairSharingURL, "name": "FAIRsharing"}); this.provenance.set("fairsharing_::", {"urlPrefix": properties.fairSharingURL, "name": "FAIRsharing"});
this.provenance.set("eosc________::", {"urlPrefix": properties.eoscMarketplaceURL, "name": "EOSC Service Catalogue"}); this.provenance.set("eosc________::", {
"urlPrefix": properties.eoscMarketplaceURL,
"name": "EOSC Service Catalogue"
});
} }
} }
@ -25,10 +28,10 @@ export class DataProviderInfo {
oaiPmhURL: string; oaiPmhURL: string;
openDoarId: string; openDoarId: string;
r3DataId: string; r3DataId: string;
provenance: Map<string, {"url": string[]}>; provenance: Map<string, { "url": string[] }>;
originalId: string; originalId: string;
countries: string[]; countries: string[];
journal: {"journal": "", "issn": string, "lissn": string, "eissn": string}; journal: { "journal": "", "issn": string, "lissn": string, "eissn": string };
description: string; description: string;
subjects: string[]; subjects: string[];
jurisdiction: string; jurisdiction: string;
@ -41,13 +44,13 @@ export class DataProviderInfo {
//collected from datasource api //collected from datasource api
// aggregationStatus: {"fundedContent": string, "indexRecords": string, "fulltexts": string, "lastUpdateDate": string}; // aggregationStatus: {"fundedContent": string, "indexRecords": string, "fulltexts": string, "lastUpdateDate": string};
aggregationStatus: {"fulltexts": string}; aggregationStatus: { "fulltexts": string };
tabs: {"name": string, "content": string}[]; tabs: { "name": string, "content": string }[];
tabs2: string[] =[]; tabs2: string[] = [];
tabsInTypes = { tabsInTypes = {
"publicationsTab": new Set<string>( "publicationsTab": new Set<string>(
[ "aggregator::datarepository", ["aggregator::datarepository",
"aggregator::pubsrepository::institutional", "aggregator::pubsrepository::institutional",
"aggregator::pubsrepository::unknown", "aggregator::pubsrepository::unknown",
"aggregator::pubsrepository::journals", "aggregator::pubsrepository::journals",
@ -63,7 +66,7 @@ export class DataProviderInfo {
"orprepository" "orprepository"
]), ]),
"datasetsTab": new Set<string>( "datasetsTab": new Set<string>(
[ "aggregator::datarepository", ["aggregator::datarepository",
"aggregator::pubsrepository::institutional", "aggregator::pubsrepository::institutional",
"aggregator::pubsrepository::unknown", "aggregator::pubsrepository::unknown",
"aggregator::pubsrepository::journals", "aggregator::pubsrepository::journals",
@ -79,7 +82,7 @@ export class DataProviderInfo {
"orprepository" "orprepository"
]), ]),
"statisticsTab": new Set<string>( "statisticsTab": new Set<string>(
[ "aggregator::datarepository", ["aggregator::datarepository",
"aggregator::pubsrepository::institutional", "aggregator::pubsrepository::institutional",
"aggregator::pubsrepository::unknown", "aggregator::pubsrepository::unknown",
"aggregator::pubsrepository::journals", "aggregator::pubsrepository::journals",
@ -99,7 +102,7 @@ export class DataProviderInfo {
"projectsTab": new Set<string>(["entityregistry::projects"]), "projectsTab": new Set<string>(["entityregistry::projects"]),
"datasourcesTab": new Set<string>(["entityregistry::repositories"]), "datasourcesTab": new Set<string>(["entityregistry::repositories"]),
"relatedDatasourcesTab": new Set<string>( "relatedDatasourcesTab": new Set<string>(
[ "aggregator::pubsrepository::unknown", ["aggregator::pubsrepository::unknown",
"aggregator::pubsrepository::journals", "aggregator::pubsrepository::journals",
"aggregator::pubsrepository::institutional", "aggregator::pubsrepository::institutional",
"aggregator::datarepository" "aggregator::datarepository"
@ -143,7 +146,7 @@ export class DataProviderInfo {
"orprepository" "orprepository"
]), ]),
"metricsTab": new Set<string>( "metricsTab": new Set<string>(
[ "aggregator::datarepository", ["aggregator::datarepository",
"aggregator::pubsrepository::institutional", "aggregator::pubsrepository::institutional",
"aggregator::pubsrepository::unknown", "aggregator::pubsrepository::unknown",
"aggregator::pubsrepository::journals", "aggregator::pubsrepository::journals",
@ -167,7 +170,7 @@ export class DataProviderInfo {
resultsBy: string; resultsBy: string;
resultTypes = { resultTypes = {
"collectedFrom": new Set<string>( "collectedFrom": new Set<string>(
[ "aggregator::datarepository", ["aggregator::datarepository",
"aggregator::pubsrepository::institutional", "aggregator::pubsrepository::institutional",
"aggregator::pubsrepository::unknown", "aggregator::pubsrepository::unknown",
"aggregator::pubsrepository::journals", "aggregator::pubsrepository::journals",
@ -179,7 +182,7 @@ export class DataProviderInfo {
"aggregator::softwarerepository" "aggregator::softwarerepository"
]), ]),
"hostedBy": new Set<string>( "hostedBy": new Set<string>(
[ "crissystem", ["crissystem",
"datarepository::unknown", "datarepository::unknown",
"pubsrepository::institutional", "pubsrepository::institutional",
"pubsrepository::journal", "pubsrepository::journal",
@ -190,7 +193,7 @@ export class DataProviderInfo {
]) ])
}; };
organizations: {"acronym": string, "name": string, "id": string}[] = []; organizations: { "acronym": string, "name": string, "id": string }[] = [];
//publications: any; //publications: any;
//datasets: any; //datasets: any;
statistics: any; statistics: any;
@ -198,5 +201,16 @@ export class DataProviderInfo {
datasources: any; datasources: any;
//relatedDatasources: Map<string, {"name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string}>; //relatedDatasources: Map<string, {"name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string}>;
relatedDatasources: {"id": string, "name": string, "count": number}[] = []; relatedDatasources: { "id": string, "name": string, "count": number }[] = [];
belongsTo: boolean = true;
message: string;
setBelongsTo(id: string) {
this.belongsTo = !BelongsTo.datasource || BelongsTo.datasource.fields.findIndex(field => BelongsTo.check(this, field)) != -1;
this.message = !this.belongsTo ? BelongsTo.datasource.message : null;
if (this.message) {
this.message = this.message.replace('((id))', id);
}
}
} }

View File

@ -1,3 +1,5 @@
import {BelongsTo} from "./resultLandingInfo";
export interface OrganizationProject { export interface OrganizationProject {
name: string; name: string;
id: string; id: string;
@ -27,4 +29,14 @@ export class OrganizationInfo {
deletedByInferenceIds: string[]; deletedByInferenceIds: string[];
identifiers: Map<string, string[]>; //key is the classname identifiers: Map<string, string[]>; //key is the classname
belongsTo: boolean = true;
message: string;
setBelongsTo(id: string) {
this.belongsTo = !BelongsTo.organization || BelongsTo.organization.fields.findIndex(field => BelongsTo.check(this, field)) != -1;
this.message = !this.belongsTo ? BelongsTo.organization.message : null;
if (this.message) {
this.message = this.message.replace('((id))', id);
}
}
} }

View File

@ -1,11 +1,29 @@
import {Measure} from "./resultLandingInfo"; import {BelongsTo, Measure} from "./resultLandingInfo";
export interface Funding {
funderName: string,
funderShortName: string,
funderJurisdiction: string,
code: string,
callIdentifier: string,
fundingStream: string,
budget: string,
contribution: string,
currency: string
}
export interface ProjectOrganization {
acronym: string,
country: string,
name: string,
id: string
}
export class ProjectInfo { export class ProjectInfo {
id:string; id: string;
acronym: string; acronym: string;
title: string; title: string;
funding: {funderName: string, funderShortName: string, code: string, callIdentifier: string, funding: Funding;
fundingStream: string, budget: string, contribution: string, currency: string};
startDate: number; startDate: number;
endDate: number; endDate: number;
currentDate: number; currentDate: number;
@ -13,7 +31,7 @@ export class ProjectInfo {
openAccessMandatePublications: string; openAccessMandatePublications: string;
openAccessMandateDatasets: string; openAccessMandateDatasets: string;
// specialClause39: string; // specialClause39: string;
organizations: { "acronym": string, "name": string, "id": string }[];//Map<string, string>; organizations: ProjectOrganization[];
url: string; url: string;
urlInfo: string; urlInfo: string;
description: string; description: string;
@ -23,4 +41,14 @@ export class ProjectInfo {
totalDatasets: number; totalDatasets: number;
publicationsStatus: any; publicationsStatus: any;
measure: Measure; measure: Measure;
belongsTo: boolean = true;
message: string;
setBelongsTo(id: string) {
this.belongsTo = !BelongsTo.project || BelongsTo.project.fields.findIndex(field => BelongsTo.check(this, field)) != -1;
this.message = !this.belongsTo ? BelongsTo.project.message : null;
if (this.message) {
this.message = this.message.replace('((id))', id);
}
}
} }

View File

@ -6,6 +6,9 @@ import {
Project, Project,
RelationResult RelationResult
} from "../result-preview/result-preview"; } from "../result-preview/result-preview";
import {isArray} from "rxjs/internal-compatibility";
import {OpenaireEntities} from "../properties/searchFields";
import {StringUtils} from "../string-utils.class";
export interface Id { export interface Id {
type: "pmid" | "doi" | "pmc" | "handle" | "openaire" | "swhid"; type: "pmid" | "doi" | "pmc" | "handle" | "openaire" | "swhid";
@ -30,18 +33,6 @@ export interface Context {
} }
export interface Measure { export interface Measure {
// /** @deprecated*/
// downloads?: string;
// /** @deprecated*/
// views?: string;
// /** @deprecated*/
// influence?: string;
// /** @deprecated*/
// popularity?: string;
// /** @deprecated*/
// citations?: string;
// /** @deprecated*/
// impulse?: string;
bip?: Metric[] bip?: Metric[]
counts?: Metric[] counts?: Metric[]
countsPerDatasource?: MetricPerDatasource[]; countsPerDatasource?: MetricPerDatasource[];
@ -61,12 +52,45 @@ export interface Metric {
value: any value: any
} }
class Field {
path: string[];
value: string;
}
export class BelongsTo {
public static result: BelongsTo = null;
public static project: BelongsTo = null;
public static organization: BelongsTo = null;
public static datasource: BelongsTo = null;
fields: Field[];
message: string;
public static check(element: any, field: Field): boolean {
if (field) {
field = Object.assign({}, field);
let json: any = element;
if (field.path.length > 0 && json) {
if (Array.isArray(json)) {
return json.findIndex(value => BelongsTo.check(value, field)) != -1;
} else {
json = json[field.path[0]];
field.path = field.path.slice(1);
return BelongsTo.check(json, field);
}
}
return json == field.value;
}
return false;
}
}
export class ResultLandingInfo { export class ResultLandingInfo {
relcanId; relcanId;
objIdentifier: string; objIdentifier: string;
// PUBLICATION, DATASET, SOFTWARE, ORP // PUBLICATION, DATASET, SOFTWARE, ORP
record; record;
resultType: "publication"|"dataset"|"other"|"software"; resultType: "publication" | "dataset" | "other" | "software";
// PUBLICATION, DATASET, SOFTWARE, ORP, DELETED_BY_INFERENCE // PUBLICATION, DATASET, SOFTWARE, ORP, DELETED_BY_INFERENCE
title: string; title: string;
accessMode: string; accessMode: string;
@ -92,7 +116,7 @@ export class ResultLandingInfo {
subjects: string[]; subjects: string[];
otherSubjects: Map<string, string[]>; otherSubjects: Map<string, string[]>;
classifiedSubjects: Map<string, string[]>; //<class of subject, subjects> classifiedSubjects: Map<string, string[]>; //<class of subject, subjects>
fos: {"id": string, "label": string}[] = []; fos: { "id": string, "label": string }[] = [];
sdg: string[]; sdg: string[];
eoscSubjects: any[]; eoscSubjects: any[];
@ -177,4 +201,17 @@ export class ResultLandingInfo {
programmingLanguages: string[]; programmingLanguages: string[];
measure: Measure; measure: Measure;
belongsTo: boolean = true;
message: string;
setBelongsTo(typeId: string, id: string) {
this.belongsTo = !BelongsTo.result || BelongsTo.result.fields.findIndex(field => BelongsTo.check(this, field)) != -1;
this.message = !this.belongsTo ? BelongsTo.result.message : null;
if (this.message) {
this.message = this.message.replace('((result))', StringUtils.capitalizeAll(StringUtils.getEntityName(this.resultType)));
this.message = this.message.replace('((type_id))', typeId);
this.message = this.message.replace('((id))', id);
}
}
} }

View File

@ -148,7 +148,7 @@ private fetch (link,id,oafEntityType,type, properties:EnvProperties ){
if(keyword!= null && keyword != '' ) { if(keyword!= null && keyword != '' ) {
if(type=="project") { if(type=="project") {
//name, title, acronym, grantid //name, title, acronym, grantid
url += "fq="+'(projectcode_nt="'+keyword+'" ) or (fundershortname='+'"'+keyword+ '"'+') or (projectacronym="'+keyword+'" ) or (projecttitle="'+keyword+'")'; url += "fq="+'(projectcode_nt="'+keyword+'" ) or (fundershortname='+'"'+keyword+ '"'+') or (projectacronym="'+keyword+'" ) or (projecttitle="'+keyword+'")&fq=(projectcode<>"unidentified")';
} else if(type=="organization") { } else if(type=="organization") {
//name fields //name fields
url += "fq="+'(organizationlegalname="'+keyword+'" ) or (organizationlegalshortname='+'"'+keyword+ '")'; url += "fq="+'(organizationlegalname="'+keyword+'" ) or (organizationlegalshortname='+'"'+keyword+ '")';

View File

@ -116,7 +116,7 @@ export let commonDev: EnvProperties = {
cookieDomain: ".di.uoa.gr", cookieDomain: ".di.uoa.gr",
feedbackmail: "kostis30fylloy@gmail.com", feedbackmail: "kostis30fylloy@gmail.com",
cacheUrl: "http://dl170.madgik.di.uoa.gr:3000/get?url=", cacheUrl: "http://dl170.madgik.di.uoa.gr:3000/get?url=",
monitorServiceAPIURL: "http://duffy.di.uoa.gr:19380/uoa-monitor-service", monitorServiceAPIURL: "http://mpagasas.di.uoa.gr:19380/uoa-monitor-service",
adminToolsAPIURL: "http://duffy.di.uoa.gr:19280/uoa-admin-tools/", adminToolsAPIURL: "http://duffy.di.uoa.gr:19280/uoa-admin-tools/",
datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/api/", datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/api/",
contextsAPI: "https://dev-openaire.d4science.org/openaire/context", contextsAPI: "https://dev-openaire.d4science.org/openaire/context",

View File

@ -3,9 +3,11 @@
<span *ngIf="result.acronym"> <span *ngIf="result.acronym">
{{result.acronym}} {{result.acronym}}
</span> </span>
<ng-container *ngIf="result.acronym != result.title">
<span *ngIf="result.acronym && (result.title)"> (</span> <span *ngIf="result.acronym && (result.title)"> (</span>
<span *ngIf="result.title" [innerHTML]="result.title"></span> <span *ngIf="result.title" [innerHTML]="result.title"></span>
<span *ngIf="result.acronym && result.title">)</span> <span *ngIf="result.acronym && result.title">)</span>
</ng-container>
</div> </div>
<div *ngIf="!result.title && !result.acronym"> <div *ngIf="!result.title && !result.acronym">
[no title available] [no title available]
@ -77,7 +79,8 @@
</div> </div>
<!-- Metadata --> <!-- Metadata -->
<div class="uk-margin-xsmall-top"> <div class="uk-margin-xsmall-top">
<entity-metadata [entityType]="type" [types]="result.types" [startYear]="result.startYear?.toString()" <entity-metadata [resultTitle]="result?.title"
[entityType]="type" [types]="result.types" [startYear]="result.startYear?.toString()"
[endYear]="result.endYear?.toString()" [endYear]="result.endYear?.toString()"
[year]="result.year?.toString()" [year]="result.year?.toString()"
[openAccessMandatePublications]="result.openAccessMandatePublications" [openAccessMandatePublications]="result.openAccessMandatePublications"

View File

@ -43,6 +43,7 @@ export interface Project {
title: string; title: string;
funderShortname: string; funderShortname: string;
funderName: string; funderName: string;
funderJurisdiction?: string
funding?: string; funding?: string;
code: string; code: string;
validated?: boolean; validated?: boolean;

View File

@ -444,8 +444,12 @@ export class StringUtils {
return <string []>words; return <string []>words;
} }
public static capitalize(value: string): string { public static capitalizeAll(str: string): string {
return value.charAt(0).toUpperCase() + value.slice(1); return str.split(' ').map(value => StringUtils.capitalize(value)).join(' ');
}
public static capitalize(str: string): string {
return str.charAt(0).toUpperCase() + str.slice(1);
} }
/** /**