Merge pull request 'Production release June 2024 [EXPLORE]' (#41) from develop into master
Reviewed-on: #41
This commit is contained in:
commit
b57c46d969
|
@ -129,7 +129,7 @@ export class ClaimContextSearchFormComponent {
|
|||
|
||||
}
|
||||
select(communityId, communityLabel) {
|
||||
console.log("SELECT", communityId)
|
||||
// console.log("SELECT", communityId)
|
||||
this.selectedCommunityId = communityId;
|
||||
this.selectedCommunityLabel = communityLabel;
|
||||
this.getCategories();
|
||||
|
|
|
@ -202,6 +202,6 @@ export class ShowOptions {
|
|||
options.push({value: 'context',label: OpenaireEntities.COMMUNITIES})
|
||||
}
|
||||
this.selectOptions = options;
|
||||
console.log(options, claimProperties.SELECT_ENTITIES.projects)
|
||||
// console.log(options, claimProperties.SELECT_ENTITIES.projects)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)">
|
||||
<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..."
|
||||
[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"
|
||||
[hint]="'Search for ' + openaireEntities.PROJECTS + '...'" tooltip="true" [disabled]="!selectedFunder"></div>
|
||||
<div class="uk-width-expand" input type="text" [(value)]="keyword" [searchable]="true" placeholder="Projects to link"
|
||||
[hint]="'Search for ' + openaireEntities.PROJECTS + '...'" tooltip="true" [disabled]="isNoProjectFunder"></div>
|
||||
</advanced-search-input>
|
||||
</div>
|
||||
<div *ngIf=" openaireResultsStatus != errorCodes.LOADING && !isNoProjectFunder && this.selectedFunder && openaireResults.length == 0">
|
||||
|
@ -14,7 +14,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<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 class="uk-margin-top">
|
||||
|
@ -65,7 +65,7 @@
|
|||
</div>
|
||||
<claim-results [localStoragePrefix]="localStoragePrefix" [results]=openaireResults
|
||||
[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 ">
|
||||
<paging-no-load [currentPage]="openaireResultsPage"
|
||||
[totalResults]="openaireResultsNum" [term]="keyword"
|
||||
|
|
|
@ -11,7 +11,6 @@ import {OpenaireEntities, SearchFields} from "../../utils/properties/searchField
|
|||
import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component";
|
||||
import {Subscriber} from "rxjs";
|
||||
import { properties } from 'src/environments/environment';
|
||||
import {error} from "protractor";
|
||||
|
||||
declare var UIkit:any;
|
||||
|
||||
|
@ -75,6 +74,8 @@ export class ClaimProjectsSearchFormComponent {
|
|||
this.sub = this._projectService.advancedSearchProjects("", 1, 0, this.properties,
|
||||
this.refineFieldsQuery, this.refineFields, "&type=projects&sf=funder").subscribe(
|
||||
data => {
|
||||
let option = {value : null, label: "No funder selected"};
|
||||
this.funderOptions.push(option);
|
||||
for(let v of data[2][0].values){
|
||||
let option = {value : v, label: v.name};
|
||||
this.funderOptions.push(option);
|
||||
|
@ -108,7 +109,7 @@ export class ClaimProjectsSearchFormComponent {
|
|||
this.prevFilters = this.filters;
|
||||
|
||||
//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(
|
||||
data => {
|
||||
if (data != null) {
|
||||
|
@ -151,7 +152,7 @@ export class ClaimProjectsSearchFormComponent {
|
|||
const entity: ClaimEntity = new ClaimEntity();
|
||||
entity.project = new ClaimProject();
|
||||
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.id = item.id;
|
||||
entity.project.url = (item.code !="unidentified") ? properties.searchLinkToProject + entity.id : null;
|
||||
|
@ -187,12 +188,6 @@ export class ClaimProjectsSearchFormComponent {
|
|||
}
|
||||
|
||||
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 = "";
|
||||
for (let filter of this.filters) {
|
||||
if (filter.countSelectedValues > 0) {
|
||||
|
@ -210,8 +205,11 @@ export class ClaimProjectsSearchFormComponent {
|
|||
}
|
||||
}
|
||||
}
|
||||
if(this.isNoProjectFunder){
|
||||
allFqs += "&fq=" + StringUtils.URIEncode( "funder exact " + (StringUtils.quote(this.selectedFunder.id))); ;
|
||||
if(this.selectedFunder){
|
||||
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++) {
|
||||
let filter = this.rangeFilters[i];
|
||||
|
|
|
@ -329,7 +329,7 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy {
|
|||
|
||||
delete() {
|
||||
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(
|
||||
res => {
|
||||
if (this.index != null) {
|
||||
|
|
|
@ -108,7 +108,6 @@ export class SearchOrcidService {
|
|||
|
||||
|
||||
static parseOrcidAuthor(data: any, authorIds: string[], authors, addId): any {
|
||||
console.log(data)
|
||||
if (data[2] != null) {
|
||||
if (addId) {
|
||||
authorIds.push(data[2].path);
|
||||
|
@ -128,9 +127,7 @@ export class SearchOrcidService {
|
|||
if (data[3] != null) {
|
||||
author['institution'] = data[3];
|
||||
}
|
||||
console.log(author['institution'])
|
||||
authors.push(author);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -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"
|
||||
[communityId]="communityId" [inlineEntity]="inlineEntity" [showOptions]="showOptions"
|
||||
pageTitle="Direct Linking" [claimsProperties]="claimsProperties">
|
||||
|
|
|
@ -8,12 +8,13 @@ import {SearchResearchResultsServiceModule} from '../../services/searchResearchR
|
|||
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
|
||||
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
|
||||
import {LinkingGenericModule} from '../linking/linkingGeneric.module';
|
||||
import {LoadingModule} from "../../utils/loading/loading.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
SharedModule,
|
||||
EntitySearchServiceModule, SearchResearchResultsServiceModule,
|
||||
Schema2jsonldModule, SEOServiceModule, LinkingGenericModule
|
||||
Schema2jsonldModule, SEOServiceModule, LinkingGenericModule, LoadingModule
|
||||
],
|
||||
providers:[],
|
||||
declarations: [
|
||||
|
|
|
@ -133,11 +133,11 @@ export class BulkClaimComponent {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
upload() {
|
||||
this.enableUpload = false;
|
||||
this.showReport = false;
|
||||
this.errorMessage = "";
|
||||
console.log(this.filesToUpload);
|
||||
if (this.filesToUpload.length == 0) {
|
||||
this.errorMessage = "There is no selected file to upload.";
|
||||
return;
|
||||
|
|
|
@ -232,7 +232,7 @@ export class ClaimInsertComponent {
|
|||
data => {
|
||||
this.feedRecordsJob = data.data;
|
||||
this.records2Insert = directclaims.length;
|
||||
console.log(data);
|
||||
// console.log(data);
|
||||
// this.insertedRecords = data.insertedIds;
|
||||
//
|
||||
// this.errorInRecords = data.errorInClaims;
|
||||
|
|
|
@ -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});
|
||||
}
|
||||
|
||||
/**
|
||||
* @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() {
|
||||
if (this.sticky_footer) {
|
||||
let resizeObs = new ResizeObserver(entries => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {Injectable} from "@angular/core";
|
||||
import {AfterViewInit, Injectable} from "@angular/core";
|
||||
import {BehaviorSubject, Observable, Subscriber} from "rxjs";
|
||||
import {ActivationStart, Router} from "@angular/router";
|
||||
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)
|
||||
* */
|
||||
private hasHelpPopUpSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
|
||||
private isBottomIntersectingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
||||
private subscriptions: any[] = [];
|
||||
|
||||
ngOnDestroy() {
|
||||
|
@ -119,6 +120,20 @@ export class LayoutService {
|
|||
this.subscriptions.push(resizeObs);
|
||||
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) {
|
||||
|
@ -355,4 +370,8 @@ export class LayoutService {
|
|||
setHasHelpPopUp(value: boolean) {
|
||||
this.hasHelpPopUpSubject.next(value);
|
||||
}
|
||||
|
||||
get isBottomIntersecting(): Observable<boolean> {
|
||||
return this.isBottomIntersectingSubject.asObservable();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<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">
|
||||
<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>
|
||||
<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>
|
||||
|
|
|
@ -8,16 +8,16 @@
|
|||
<div class="uk-flex uk-flex-left@m uk-flex-center uk-width-expand">
|
||||
<ul class="uk-subnav uk-subnav-pill">
|
||||
<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 [class.uk-active]="!showCurrent" (click)="showCurrent = false">
|
||||
<a>Pending {{stakeholderUtils.roles[role]}}s</a>
|
||||
<a>Pending {{roleUtils.roles[role]}}s</a>
|
||||
</li>
|
||||
</ul>
|
||||
</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 *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 *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">
|
||||
|
@ -27,7 +27,7 @@
|
|||
[attr.uk-tooltip]="inviteDisableMessage" [class.uk-disabled]="loadPending || loadPending"
|
||||
[disabled]="loadActive || loadPending || !!inviteDisableMessage" (click)="openInviteModal()">
|
||||
<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 *ngIf="!exists && isCurator" class="uk-button uk-button-default uk-flex uk-flex-middle"
|
||||
(click)="openCreateRoleModal()">
|
||||
|
@ -47,16 +47,16 @@
|
|||
<div *ngIf="!loadActive && !loadPending">
|
||||
<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">
|
||||
<div *ngIf="showCurrent">No {{stakeholderUtils.roles[role]}}s found</div>
|
||||
<div *ngIf="!showCurrent">No pending {{stakeholderUtils.roles[role]}} invitations found</div>
|
||||
<div *ngIf="showCurrent">No {{roleUtils.roles[role]}}s found</div>
|
||||
<div *ngIf="!showCurrent">No pending {{roleUtils.roles[role]}} invitations found</div>
|
||||
</div>
|
||||
<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)"
|
||||
[page]="activePage" [pageSize]="pageSize"
|
||||
[totalResults]="showActive.length">
|
||||
</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)"
|
||||
[page]="pendingPage" [pageSize]="pageSize"
|
||||
[totalResults]="showPending.length">
|
||||
|
@ -109,12 +109,12 @@
|
|||
</modal-alert>
|
||||
<modal-alert #deleteModal [overflowBody]="false" (alertOutput)="deleteActive()" classTitle="uk-background-primary uk-light">
|
||||
<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>
|
||||
</modal-alert>
|
||||
<modal-alert #deletePendingModal [overflowBody]="false" (alertOutput)="deletePending()" classTitle="uk-background-primary uk-light">
|
||||
<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>
|
||||
</modal-alert>
|
||||
<modal-alert #createRoleModal [overflowBody]="false" (alertOutput)="createGroup()" classTitle="uk-background-primary uk-light"
|
||||
|
|
|
@ -13,7 +13,7 @@ import {AlertModal} from "../../../utils/modal/alert";
|
|||
import {UserRegistryService} from "../../../services/user-registry.service";
|
||||
import {EnvProperties} from "../../../utils/properties/env-properties";
|
||||
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 {Router} from "@angular/router";
|
||||
import {StringUtils} from "../../../utils/string-utils.class";
|
||||
|
@ -92,6 +92,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
|||
@ViewChild('deletePendingModal') deletePendingModal: AlertModal;
|
||||
@ViewChild('createRoleModal') createRoleModal: AlertModal;
|
||||
public stakeholderUtils: StakeholderUtils = new StakeholderUtils();
|
||||
public roleUtils: RoleUtils = new RoleUtils();
|
||||
private _type: string;
|
||||
|
||||
constructor(private userRegistryService: UserRegistryService,
|
||||
|
@ -188,7 +189,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
|||
openDeleteModal(item: any) {
|
||||
if (this.showCurrent) {
|
||||
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();
|
||||
} else {
|
||||
this.selectedUser = item;
|
||||
|
@ -198,7 +199,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
|||
}
|
||||
|
||||
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.okButtonText = 'Send';
|
||||
this.emailsForm = this.fb.array([], Validators.required);
|
||||
|
@ -247,7 +248,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
|||
if (this.currentPendingPage.length === 0) {
|
||||
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;
|
||||
}, error => {
|
||||
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
|
||||
|
@ -296,7 +297,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
|||
}
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
@ -316,7 +317,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
|||
this.updateLists();
|
||||
}, error => {
|
||||
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();
|
||||
} else {
|
||||
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<schema2jsonld *ngIf="dataProviderInfo"
|
||||
[data]=dataProviderInfo [URL]="canonicalUrl" type="datasource"
|
||||
[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 -->
|
||||
<div class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
|
||||
<div *ngIf="!isMobile" class="tm-main">
|
||||
|
|
|
@ -148,14 +148,13 @@ export class DataProviderComponent {
|
|||
@ViewChild("descriptionDiv") descriptionDiv: ElementRef;
|
||||
@ViewChild('descriptionModal') descriptionModal;
|
||||
|
||||
// public shouldSticky: boolean = true;
|
||||
|
||||
subscriptions = [];
|
||||
private sub: Subscription;
|
||||
properties: EnvProperties = properties;
|
||||
public openaireEntities = OpenaireEntities;
|
||||
|
||||
public isMobile: boolean = false;
|
||||
public isBottomIntersecting: boolean = false;
|
||||
public mobileContent: "info" | "metrics" | "actions" = "info";
|
||||
public tabMobile: string = "";
|
||||
public viewAllMobile: string = "";
|
||||
|
@ -198,6 +197,11 @@ export class DataProviderComponent {
|
|||
ngOnInit() {
|
||||
this.subscriptions.push(this.layoutService.isMobile.subscribe(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') {
|
||||
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
|
||||
|
@ -261,16 +265,6 @@ export class DataProviderComponent {
|
|||
} else {
|
||||
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) {
|
||||
this.observeGraphAndFeedback();
|
||||
}
|
||||
|
@ -389,6 +383,7 @@ export class DataProviderComponent {
|
|||
this.dataProviderInfo = data;
|
||||
this.getProvenanceUrls();
|
||||
this.datasourceId = this.dataProviderInfo.objIdentifier;
|
||||
this.dataProviderInfo.setBelongsTo(this.datasourceId);
|
||||
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.linkToLandingPage + this.dataProviderInfo.relcanId));
|
||||
|
|
|
@ -17,8 +17,8 @@ import {OpenaireEntities} from "../../utils/properties/searchFields";
|
|||
</errorMessages>
|
||||
|
||||
<div *ngIf="fetchResults.searchUtils.status == errorCodes.DONE && !loading" class="uk-text-small">
|
||||
<div 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.
|
||||
<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 {{collectedFromName}} are shown.
|
||||
</div>
|
||||
<results-and-pages *ngIf="results.length >pageSize" [type]="openaireEntities.DATASOURCES"
|
||||
[page]="page" [pageSize]="pageSize"
|
||||
|
|
|
@ -159,7 +159,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
|||
<span>{{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}}</span>
|
||||
<span *ngIf="projects.length > projectsLimit">
|
||||
<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 *ngIf="showInline && lessBtn" (click)="showInline = !showInline; lessBtn = false;"
|
||||
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 *ngIf="organizations.length > organizationsLimit">
|
||||
<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 *ngIf="showInline && lessBtn" (click)="showInline = !showInline; lessBtn = false;"
|
||||
class="uk-background-muted custom-extra-entities">
|
||||
|
@ -197,6 +197,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
|||
|
||||
|
||||
<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>
|
||||
<ng-container *ngFor="let item of organizations; let i = index">
|
||||
<div class="uk-margin-xsmall-right">
|
||||
|
@ -207,6 +208,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
|||
</modal-alert>
|
||||
|
||||
<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>
|
||||
<ng-container *ngFor="let item of projects; let i = index">
|
||||
<div class="uk-margin-xsmall-right">
|
||||
|
@ -223,6 +225,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
|||
styleUrls: ['entity-metadata.component.less']
|
||||
})
|
||||
export class EntityMetadataComponent {
|
||||
@Input() resultTitle: string = null;
|
||||
@Input() isMobile: boolean = false;
|
||||
@Input() entityType: string;
|
||||
@Input() types: string[];
|
||||
|
|
|
@ -39,7 +39,7 @@ export class ParsingFunctions {
|
|||
|
||||
let fundedByProject: Project = {
|
||||
"id": "", "acronym": "", "title": "",
|
||||
"funderShortname": "", "funderName": "",
|
||||
"funderShortname": "", "funderName": "", "funderJurisdiction": "",
|
||||
"funding": "", "code": "", "provenanceAction": "", "validated": false
|
||||
};
|
||||
|
||||
|
@ -61,8 +61,7 @@ export class ParsingFunctions {
|
|||
}
|
||||
|
||||
if (relation.hasOwnProperty("funding")) {
|
||||
let funding: { "funderName": string, "funderShortname": string, "stream": string };
|
||||
funding = this.parseFundingTrees(relation.funding);
|
||||
let funding = this.parseFundingTrees(relation.funding);
|
||||
|
||||
if (funding.funderName) {
|
||||
fundedByProject['funderName'] = funding.funderName;
|
||||
|
@ -70,6 +69,9 @@ export class ParsingFunctions {
|
|||
if (funding.funderShortname) {
|
||||
fundedByProject['funderShortname'] = funding.funderShortname;
|
||||
}
|
||||
if(funding.funderJurisdiction) {
|
||||
fundedByProject['funderJurisdiction'] = funding.funderJurisdiction;
|
||||
}
|
||||
if (funding.stream) {
|
||||
fundedByProject['funding'] = funding.stream;
|
||||
}
|
||||
|
@ -79,10 +81,11 @@ export class ParsingFunctions {
|
|||
}
|
||||
|
||||
// publication & research data : for fundedByProjects | project landing : for funding
|
||||
public parseFundingTrees(fundingTree: any): { "funderName": string, "funderShortname": string, "stream": string } {
|
||||
let funding: { "funderName": string, "funderShortname": string, "stream": string } = {
|
||||
public parseFundingTrees(fundingTree: any): any {
|
||||
let funding: { "funderName": string, "funderShortname": string, "funderJurisdiction": string, "stream": string } = {
|
||||
"funderName": "",
|
||||
"funderShortname": "",
|
||||
"funderJurisdiction": "",
|
||||
"stream": ""
|
||||
};
|
||||
let length = Array.isArray(fundingTree) ? fundingTree.length : 1;
|
||||
|
@ -93,6 +96,7 @@ export class ParsingFunctions {
|
|||
if (fundingData.hasOwnProperty("funder")) {
|
||||
funding.funderShortname = fundingData['funder'].shortname;
|
||||
funding.funderName = fundingData['funder'].name;
|
||||
funding.funderJurisdiction = fundingData['funder'].jurisdiction;
|
||||
}
|
||||
|
||||
funding.stream = this.addFundingLevel0(fundingData, funding.stream);
|
||||
|
|
|
@ -116,7 +116,8 @@ export class ProjectsInModalComponent {
|
|||
}
|
||||
if (filterLimits.length > 0) {
|
||||
//this.filterQuery+=' and '+filter.filterId + ' exact '+ filterLimits + ' ';
|
||||
this.filterQuery += ' and ( ' + filterLimits + ' ) ';
|
||||
// this.filterQuery += ' and ( ' + filterLimits + ' ) ';
|
||||
this.filterQuery += '( ' + filterLimits + ' ) ';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
[URL]="properties.domain + properties.baseLink+this.properties.searchLinkToOrganization+organizationInfo.relcanId"
|
||||
type="organization">
|
||||
</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 -->
|
||||
<div id="tm-main" class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
|
||||
<div *ngIf="!isMobile" class="tm-main">
|
||||
|
|
|
@ -115,8 +115,6 @@ export class OrganizationComponent {
|
|||
public graph_height: number = 0;
|
||||
@ViewChild("graph_and_feedback") graph_and_feedback;
|
||||
|
||||
// public shouldSticky: boolean = true;
|
||||
|
||||
subscriptions = [];
|
||||
innerReportSubscriptions = [];
|
||||
properties: EnvProperties;
|
||||
|
@ -131,6 +129,7 @@ export class OrganizationComponent {
|
|||
public deleteByInferenceOpened: boolean = false;
|
||||
|
||||
public isMobile: boolean = false;
|
||||
public isBottomIntersecting: boolean = false;
|
||||
public mobileContent: "info" | "actions" = "info";
|
||||
public viewAllMobile: string = "";
|
||||
|
||||
|
@ -162,6 +161,11 @@ export class OrganizationComponent {
|
|||
ngOnInit() {
|
||||
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
|
||||
this.isMobile = isMobile;
|
||||
this.cdr.detectChanges();
|
||||
}));
|
||||
this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => {
|
||||
this.isBottomIntersecting = isBottomIntersecting;
|
||||
this.cdr.detectChanges();
|
||||
}));
|
||||
this.properties = properties;
|
||||
if (typeof document !== 'undefined') {
|
||||
|
@ -218,16 +222,6 @@ export class OrganizationComponent {
|
|||
} else {
|
||||
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) {
|
||||
this.observeGraphAndFeedback();
|
||||
}
|
||||
|
@ -401,6 +395,7 @@ export class OrganizationComponent {
|
|||
} else {
|
||||
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.organizationInfo.setBelongsTo(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.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';
|
||||
|
||||
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 => {
|
||||
projects = data[1];
|
||||
for (let index = 0; index < projects.length; index++) {
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<schema2jsonld *ngIf="projectInfo"
|
||||
[data]=projectInfo [URL]="properties.domain+properties.baseLink+properties.searchLinkToProject+projectId"
|
||||
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 -->
|
||||
<div class=" uk-visible@m landing uk-section uk-padding-remove tm-middle">
|
||||
<div *ngIf="!isMobile" class="tm-main">
|
||||
|
|
|
@ -169,14 +169,13 @@ export class ProjectComponent {
|
|||
@ViewChild("descriptionDiv") descriptionDiv: ElementRef;
|
||||
@ViewChild('descriptionModal') descriptionModal;
|
||||
|
||||
// public shouldSticky: boolean = true;
|
||||
|
||||
subscriptions = [];
|
||||
private sub: Subscription;
|
||||
properties: EnvProperties;
|
||||
public openaireEntities = OpenaireEntities;
|
||||
|
||||
public isMobile: boolean = false;
|
||||
public isBottomIntersecting: boolean = false;
|
||||
public mobileContent: "info" | "metrics" | "actions" = "info";
|
||||
public tabMobile: string = "";
|
||||
public viewAllMobile: string = "";
|
||||
|
@ -209,6 +208,11 @@ export class ProjectComponent {
|
|||
ngOnInit() {
|
||||
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
|
||||
this.isMobile = isMobile;
|
||||
this.cdr.detectChanges();
|
||||
}));
|
||||
this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => {
|
||||
this.isBottomIntersecting = isBottomIntersecting;
|
||||
this.cdr.detectChanges();
|
||||
}));
|
||||
this.properties = properties;
|
||||
if (typeof document !== 'undefined') {
|
||||
|
@ -278,16 +282,6 @@ export class ProjectComponent {
|
|||
} else {
|
||||
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) {
|
||||
this.observeGraphAndFeedback();
|
||||
}
|
||||
|
@ -466,6 +460,7 @@ export class ProjectComponent {
|
|||
this.subscriptions.push(this._projectService.getProjectInfo(id, this.properties).subscribe(
|
||||
data => {
|
||||
this.projectInfo = data;
|
||||
this.projectInfo.setBelongsTo(id);
|
||||
this.projectInfo.id = this.projectId;
|
||||
|
||||
this.actionsAfterGettingProjectInfo();
|
||||
|
|
|
@ -4,254 +4,267 @@ import {throwError} from 'rxjs';
|
|||
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 {StringUtils} from "../../utils/string-utils.class";
|
||||
|
||||
@Injectable()
|
||||
export class ProjectService {
|
||||
|
||||
constructor(private http: HttpClient ) {
|
||||
this.parsingFunctions = new ParsingFunctions();
|
||||
constructor(private http: HttpClient) {
|
||||
this.parsingFunctions = new ParsingFunctions();
|
||||
}
|
||||
|
||||
public parsingFunctions: ParsingFunctions;
|
||||
projectInfo: ProjectInfo;
|
||||
|
||||
getProjectInfo(id: string, properties: EnvProperties): any {
|
||||
|
||||
let url = properties.searchAPIURLLAst + 'projects/' + id + "?format=json";
|
||||
let key = url;
|
||||
|
||||
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||
//.map(res => <any> res.json())
|
||||
.pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project']))
|
||||
.pipe(map(res => [res,
|
||||
res['fundingtree'],
|
||||
res['rels']['rel']]))
|
||||
.pipe(map(res => this.parseProjectInfo(res, properties)));
|
||||
|
||||
}
|
||||
|
||||
getProjectInfoByGrantId(grant: string, funder: string, properties: EnvProperties): any {
|
||||
|
||||
let url = properties.searchAPIURLLAst + 'resources?query=(oaftype exact project)' +
|
||||
'and (projectcode_nt exact "' + grant + '" ) and (fundershortname exact ' + '"' + funder + '"' + ')' + "&format=json&size=1";
|
||||
|
||||
|
||||
let key = url;
|
||||
|
||||
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||
//.map(res => <any> res.json())
|
||||
.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[0],
|
||||
res[0]['fundingtree'],
|
||||
res[0]['rels']['rel'], res[1]]))
|
||||
.pipe(map(res => this.parseProjectInfo(res, properties)));
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
get project strtDate and endDate
|
||||
*/
|
||||
getProjectDates(id: string, properties: EnvProperties): any {
|
||||
|
||||
let url = properties.searchAPIURLLAst + 'projects/' + id + "?format=json";
|
||||
let key = url + '_projectDates';
|
||||
|
||||
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||
//.map(res => <any> res.json())
|
||||
.pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project']))
|
||||
.pipe(map(res => [res,
|
||||
res['fundingtree'],
|
||||
res['rels']['rel']]))
|
||||
.pipe(map(res => this.parseProjectDates(id, res)))
|
||||
|
||||
}
|
||||
|
||||
getHTMLInfo(id: string, properties: EnvProperties): any {
|
||||
let url = properties.searchAPIURLLAst + 'projects/' + id + "?format=json";
|
||||
let key = url;
|
||||
|
||||
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||
//.map(res => <any> res.json())
|
||||
.pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project']))
|
||||
.pipe(map(res => this.parseHTMLInfo(res)));
|
||||
}
|
||||
|
||||
private handleError(error: HttpErrorResponse) {
|
||||
console.log(error);
|
||||
return throwError(error || 'Server error');
|
||||
}
|
||||
|
||||
parseHTMLInfo(data: any): any {
|
||||
let htmlInfo: { "title": string, "acronym": string, "callIdentifier": string };
|
||||
|
||||
if (data != null) {
|
||||
htmlInfo = {"title": data.title, "acronym": data.acronym, "callIdentifier": data.callidentifier};
|
||||
}
|
||||
return htmlInfo;
|
||||
}
|
||||
|
||||
parseProjectInfo(data: any, properties: EnvProperties): any {
|
||||
this.projectInfo = new ProjectInfo();
|
||||
this.projectInfo.funding = {
|
||||
funderName: "", funderShortName: "", funderJurisdiction: "", code: "", callIdentifier: "",
|
||||
fundingStream: "", budget: "", contribution: "", currency: ""
|
||||
};
|
||||
|
||||
// ['result']['header']['dri:objIdentifier']
|
||||
if (data[3] != null) {
|
||||
this.projectInfo.id = data[3];
|
||||
}
|
||||
|
||||
public parsingFunctions: ParsingFunctions;
|
||||
projectInfo: ProjectInfo;
|
||||
|
||||
getProjectInfo (id: string, properties:EnvProperties):any {
|
||||
|
||||
let url = properties.searchAPIURLLAst + 'projects/'+id+"?format=json";
|
||||
let key = url;
|
||||
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
//.map(res => <any> res.json())
|
||||
.pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project']))
|
||||
.pipe(map(res => [res,
|
||||
res['fundingtree'],
|
||||
res['rels']['rel']]))
|
||||
.pipe(map(res => this.parseProjectInfo(res, properties)));
|
||||
|
||||
}
|
||||
|
||||
getProjectInfoByGrantId (grant: string, funder:string, properties:EnvProperties):any {
|
||||
|
||||
let url =properties.searchAPIURLLAst+ 'resources?query=(oaftype exact project)'+
|
||||
'and (projectcode_nt exact "'+grant+'" ) and (fundershortname exact '+'"'+funder+ '"'+')'+"&format=json&size=1";
|
||||
|
||||
|
||||
let key = url;
|
||||
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
//.map(res => <any> res.json())
|
||||
.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[0],
|
||||
res[0]['fundingtree'],
|
||||
res[0]['rels']['rel'],res[1]]))
|
||||
.pipe(map(res => this.parseProjectInfo(res, properties)));
|
||||
|
||||
}
|
||||
/*
|
||||
get project strtDate and endDate
|
||||
*/
|
||||
getProjectDates (id: string, properties:EnvProperties):any {
|
||||
|
||||
let url = properties.searchAPIURLLAst+'projects/'+id+"?format=json";
|
||||
let key = url+'_projectDates';
|
||||
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
//.map(res => <any> res.json())
|
||||
.pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project']))
|
||||
.pipe(map(res => [res,
|
||||
res['fundingtree'],
|
||||
res['rels']['rel']]))
|
||||
.pipe(map(res => this.parseProjectDates(id,res)))
|
||||
|
||||
}
|
||||
|
||||
getHTMLInfo(id: string, properties:EnvProperties): any {
|
||||
let url = properties.searchAPIURLLAst + 'projects/'+id+"?format=json";
|
||||
let key = url;
|
||||
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
//.map(res => <any> res.json())
|
||||
.pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:project']))
|
||||
.pipe(map(res => this.parseHTMLInfo(res)));
|
||||
}
|
||||
|
||||
private handleError (error: HttpErrorResponse) {
|
||||
console.log(error);
|
||||
return throwError(error || 'Server error');
|
||||
}
|
||||
|
||||
parseHTMLInfo (data: any):any {
|
||||
let htmlInfo: {"title": string, "acronym": string, "callIdentifier": string};
|
||||
|
||||
if(data != null) {
|
||||
htmlInfo = {"title": data.title, "acronym": data.acronym, "callIdentifier": data.callidentifier};
|
||||
}
|
||||
return htmlInfo;
|
||||
}
|
||||
|
||||
parseProjectInfo (data: any, properties:EnvProperties):any {
|
||||
this.projectInfo = new ProjectInfo();
|
||||
this.projectInfo.funding = {funderName: "", funderShortName: "", code: "", callIdentifier: "",
|
||||
fundingStream: "", budget: "", contribution: "", currency: ""};
|
||||
|
||||
// ['result']['header']['dri:objIdentifier']
|
||||
if(data[3] != null) {
|
||||
this.projectInfo.id = data[3];
|
||||
}
|
||||
|
||||
// ['result']['metadata']['oaf:entity']['oaf:project']['fundingtree']
|
||||
if(data[1] != null) {
|
||||
let funding: {"funderName": string, "funderShortname": string, "stream": string};
|
||||
funding = this.parsingFunctions.parseFundingTrees(data[1]);
|
||||
if(funding.funderName) {
|
||||
this.projectInfo.funding.funderName = funding.funderName;
|
||||
}
|
||||
if(funding.funderShortname) {
|
||||
this.projectInfo.funding.funderShortName = funding.funderShortname;
|
||||
}
|
||||
if(funding.stream) {
|
||||
this.projectInfo.funding.fundingStream = funding.stream;
|
||||
}
|
||||
// ['result']['metadata']['oaf:entity']['oaf:project']['fundingtree']
|
||||
if (data[1] != null) {
|
||||
let funding: { "funderName": string, "funderShortname": string, "funderJurisdiction": string, "stream": string };
|
||||
funding = this.parsingFunctions.parseFundingTrees(data[1]);
|
||||
if (funding.funderName) {
|
||||
this.projectInfo.funding.funderName = funding.funderName;
|
||||
}
|
||||
|
||||
// ['result']['metadata']['oaf:entity']['oaf:project']
|
||||
if(data[0] != null) {
|
||||
this.projectInfo.acronym = data[0].acronym;
|
||||
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));
|
||||
} else {
|
||||
this.projectInfo.title = "";
|
||||
}
|
||||
this.projectInfo.funding.code = data[0].code;
|
||||
if(data[0].startdate) {
|
||||
let date: number = Date.parse(data[0].startdate);
|
||||
this.projectInfo.startDate = (date ? date : null);
|
||||
}
|
||||
if(data[0].enddate) {
|
||||
let date: number = Date.parse(data[0].enddate);
|
||||
this.projectInfo.endDate = (date ? date : null);
|
||||
}
|
||||
if(this.projectInfo.endDate || this.projectInfo.startDate) {
|
||||
let todayDate = Date.parse(new Date().toString());
|
||||
this.projectInfo.currentDate = todayDate;
|
||||
if(this.projectInfo.startDate) {
|
||||
let startDate = +(this.projectInfo.startDate);
|
||||
if (todayDate < startDate) {
|
||||
this.projectInfo.status = "Not started";
|
||||
}
|
||||
}
|
||||
if(this.projectInfo.endDate && !this.projectInfo.status) {
|
||||
let endDate = +(this.projectInfo.endDate);
|
||||
if (todayDate <= endDate) {
|
||||
this.projectInfo.status = "On going";
|
||||
} else {
|
||||
this.projectInfo.status = "Closed";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.projectInfo.funding) {
|
||||
if(this.projectInfo.funding.funderShortName == "EC") {
|
||||
this.projectInfo.openAccessMandatePublications = data[0].oamandatepublications;
|
||||
// this.projectInfo.specialClause39 = data[0].ecsc39;
|
||||
if(data[0].hasOwnProperty("projectoamandatedata")) {
|
||||
this.projectInfo.openAccessMandateDatasets = data[0].projectoamandatedata;
|
||||
} else if(data[0].hasOwnProperty("ecarticle29_3")) {
|
||||
this.projectInfo.openAccessMandateDatasets = data[0].ecarticle29_3;
|
||||
}
|
||||
this.projectInfo.funding.callIdentifier = data[0].callidentifier;
|
||||
}
|
||||
this.projectInfo.funding.budget = data[0].totalcost;//"10000";
|
||||
this.projectInfo.funding.contribution = data[0].fundedamount;//"200100";
|
||||
this.projectInfo.funding.currency = data[0].currency;//"EUR";
|
||||
}
|
||||
// if(!Array.isArray(data[0]['summary'])) {
|
||||
// this.projectInfo.description = (data[0]['summary']) ? String(data[0]['summary']) : "";
|
||||
// } else {
|
||||
// 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:[]);
|
||||
if (funding.funderShortname) {
|
||||
this.projectInfo.funding.funderShortName = funding.funderShortname;
|
||||
}
|
||||
if (funding.funderJurisdiction) {
|
||||
this.projectInfo.funding.funderJurisdiction = funding.funderJurisdiction;
|
||||
}
|
||||
if (funding.stream) {
|
||||
this.projectInfo.funding.fundingStream = funding.stream;
|
||||
}
|
||||
}
|
||||
|
||||
// ['result']['metadata']['oaf:entity']['oaf:project']['rels']['rel']
|
||||
if(data[2] != null) {
|
||||
this.projectInfo.organizations = [];//new Map<string, string>();
|
||||
// ['result']['metadata']['oaf:entity']['oaf:project']
|
||||
if (data[0] != null) {
|
||||
this.projectInfo.acronym = data[0].acronym;
|
||||
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));
|
||||
} else {
|
||||
this.projectInfo.title = "";
|
||||
}
|
||||
this.projectInfo.funding.code = data[0].code;
|
||||
if (data[0].startdate) {
|
||||
let date: number = Date.parse(data[0].startdate);
|
||||
this.projectInfo.startDate = (date ? date : null);
|
||||
}
|
||||
if (data[0].enddate) {
|
||||
let date: number = Date.parse(data[0].enddate);
|
||||
this.projectInfo.endDate = (date ? date : null);
|
||||
}
|
||||
if (this.projectInfo.endDate || this.projectInfo.startDate) {
|
||||
let todayDate = Date.parse(new Date().toString());
|
||||
this.projectInfo.currentDate = todayDate;
|
||||
if (this.projectInfo.startDate) {
|
||||
let startDate = +(this.projectInfo.startDate);
|
||||
if (todayDate < startDate) {
|
||||
this.projectInfo.status = "Not started";
|
||||
}
|
||||
}
|
||||
if (this.projectInfo.endDate && !this.projectInfo.status) {
|
||||
let endDate = +(this.projectInfo.endDate);
|
||||
if (todayDate <= endDate) {
|
||||
this.projectInfo.status = "On going";
|
||||
} else {
|
||||
this.projectInfo.status = "Closed";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.projectInfo.funding) {
|
||||
if (this.projectInfo.funding.funderShortName == "EC") {
|
||||
this.projectInfo.openAccessMandatePublications = data[0].oamandatepublications;
|
||||
// this.projectInfo.specialClause39 = data[0].ecsc39;
|
||||
if (data[0].hasOwnProperty("projectoamandatedata")) {
|
||||
this.projectInfo.openAccessMandateDatasets = data[0].projectoamandatedata;
|
||||
} else if (data[0].hasOwnProperty("ecarticle29_3")) {
|
||||
this.projectInfo.openAccessMandateDatasets = data[0].ecarticle29_3;
|
||||
}
|
||||
this.projectInfo.funding.callIdentifier = data[0].callidentifier;
|
||||
}
|
||||
this.projectInfo.funding.budget = data[0].totalcost;//"10000";
|
||||
this.projectInfo.funding.contribution = data[0].fundedamount;//"200100";
|
||||
this.projectInfo.funding.currency = data[0].currency;//"EUR";
|
||||
}
|
||||
// if(!Array.isArray(data[0]['summary'])) {
|
||||
// this.projectInfo.description = (data[0]['summary']) ? String(data[0]['summary']) : "";
|
||||
// } else {
|
||||
// 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 : []);
|
||||
}
|
||||
|
||||
if(!Array.isArray(data[2])) {
|
||||
if(data[2].hasOwnProperty("to") && data[2]['to'].class && data[2]['to'].class.toLowerCase() == "hasparticipant") {
|
||||
let acronym: string = "";
|
||||
let name: string = "";
|
||||
let id: string = "";
|
||||
if (data[2].hasOwnProperty("legalshortname")) {
|
||||
acronym = data[2].legalshortname;
|
||||
}
|
||||
if (data[2].hasOwnProperty("legalname")) {
|
||||
name = data[2].legalname;
|
||||
}
|
||||
if (!acronym && !name) {
|
||||
// acronym is displayed with link and name only in tooltip
|
||||
acronym = "[no title available]";
|
||||
}
|
||||
// ['result']['metadata']['oaf:entity']['oaf:project']['rels']['rel']
|
||||
if (data[2] != null) {
|
||||
this.projectInfo.organizations = [];
|
||||
|
||||
if (data[2].hasOwnProperty("to")) {
|
||||
id = data[2]['to'].content;
|
||||
}
|
||||
if (!Array.isArray(data[2])) {
|
||||
if (data[2].hasOwnProperty("to") && data[2]['to'].class && data[2]['to'].class.toLowerCase() == "hasparticipant") {
|
||||
let country: string = "";
|
||||
let acronym: string = "";
|
||||
let name: string = "";
|
||||
let id: string = "";
|
||||
if(data[2].hasOwnProperty("country")) {
|
||||
country = data[2].country.classname;
|
||||
}
|
||||
if (data[2].hasOwnProperty("legalshortname")) {
|
||||
acronym = data[2].legalshortname;
|
||||
}
|
||||
if (data[2].hasOwnProperty("legalname")) {
|
||||
name = data[2].legalname;
|
||||
}
|
||||
if (!acronym && !name) {
|
||||
// acronym is displayed with link and name only in tooltip
|
||||
acronym = "[no title available]";
|
||||
}
|
||||
|
||||
this.projectInfo.organizations.push({"acronym": acronym, "name": name, "id": id});
|
||||
}
|
||||
} else {
|
||||
for(let i=0; i<data[2].length; i++) {
|
||||
let acronym: string = "";
|
||||
let name: 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("legalshortname")) {
|
||||
acronym = data[2][i].legalshortname;
|
||||
}
|
||||
if(data[2][i].hasOwnProperty("legalname")) {
|
||||
name = data[2][i].legalname;
|
||||
}
|
||||
if(!acronym && !name){
|
||||
acronym = "[no title available]";
|
||||
}
|
||||
if (data[2].hasOwnProperty("to")) {
|
||||
id = data[2]['to'].content;
|
||||
}
|
||||
|
||||
if(data[2][i].hasOwnProperty("to")) {
|
||||
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});
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < data[2].length; i++) {
|
||||
let country: string = "";
|
||||
let acronym: string = "";
|
||||
let name: 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("country")) {
|
||||
country = data[2][i].country.classname;
|
||||
}
|
||||
if (data[2][i].hasOwnProperty("legalshortname")) {
|
||||
acronym = data[2][i].legalshortname;
|
||||
}
|
||||
if (data[2][i].hasOwnProperty("legalname")) {
|
||||
name = data[2][i].legalname;
|
||||
}
|
||||
if (!acronym && !name) {
|
||||
acronym = "[no title available]";
|
||||
}
|
||||
|
||||
if (data[2][i].hasOwnProperty("to")) {
|
||||
id = data[2][i]['to'].content;
|
||||
}
|
||||
|
||||
this.projectInfo.organizations.push({"country": country, "acronym": acronym, "name": name, "id": id});
|
||||
}
|
||||
}
|
||||
|
||||
if(this.projectInfo.funding && this.projectInfo.funding.funderShortName == "EC") {
|
||||
this.projectInfo.url = properties.cordisURL+this.projectInfo.funding.code;
|
||||
this.projectInfo.urlInfo = "Detailed project information (CORDIS)";
|
||||
}
|
||||
|
||||
if (data[0]?.measure) {
|
||||
this.projectInfo.measure = this.parsingFunctions.parseMeasures(data[0].measure);
|
||||
}
|
||||
|
||||
return this.projectInfo;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
parseProjectDates (id: string, data: any):any {
|
||||
let project = { id: id, startDate: "", endDate: ""};
|
||||
if(data[0] != null) {
|
||||
project.startDate = data[0].startdate;
|
||||
project.endDate = data[0].enddate;
|
||||
}
|
||||
return project;
|
||||
|
||||
if (this.projectInfo.funding && this.projectInfo.funding.funderShortName == "EC") {
|
||||
this.projectInfo.url = properties.cordisURL + this.projectInfo.funding.code;
|
||||
this.projectInfo.urlInfo = "Detailed project information (CORDIS)";
|
||||
}
|
||||
|
||||
if (data[0]?.measure) {
|
||||
this.projectInfo.measure = this.parsingFunctions.parseMeasures(data[0].measure);
|
||||
}
|
||||
|
||||
return this.projectInfo;
|
||||
|
||||
}
|
||||
|
||||
parseProjectDates(id: string, data: any): any {
|
||||
let project = {id: id, startDate: "", endDate: ""};
|
||||
if (data[0] != null) {
|
||||
project.startDate = data[0].startdate;
|
||||
project.endDate = data[0].enddate;
|
||||
}
|
||||
return project;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<schema2jsonld *ngIf="resultLandingInfo && resultLandingInfo.record"
|
||||
[data]=resultLandingInfo.record [URL]="canonicalUrl"
|
||||
[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 -->
|
||||
<div *ngIf="!isMobile" id="tm-main" class="landing uk-section uk-padding-remove tm-middle">
|
||||
<div class="tm-main">
|
||||
|
@ -1200,4 +1202,4 @@
|
|||
<fs-modal *ngIf="resultLandingInfo" #addThisFsModal classTitle="uk-tile-default uk-border-bottom" classBody="uk-flex uk-flex-center uk-flex-middle">
|
||||
<addThis *ngIf="addThisClicked"></addThis>
|
||||
</fs-modal>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
|
|
@ -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 {Meta, Title} from '@angular/platform-browser';
|
||||
|
||||
|
@ -43,6 +43,7 @@ export class ResultLandingComponent {
|
|||
@Input() type: string = "publication";
|
||||
|
||||
@Input() communityId = null;
|
||||
@Output() result: EventEmitter<ResultLandingInfo> = new EventEmitter<ResultLandingInfo>();
|
||||
enermapsId;
|
||||
// @ViewChild('linkModal') linkModal;
|
||||
@ViewChild('citeModal') citeModal;
|
||||
|
@ -154,8 +155,6 @@ export class ResultLandingComponent {
|
|||
@ViewChild("descriptionDiv") descriptionDiv: ElementRef;
|
||||
@ViewChild('descriptionModal') descriptionModal;
|
||||
|
||||
// public shouldSticky: boolean = true;
|
||||
|
||||
public mobileContent: "info" | "metrics" | "actions" = "info";
|
||||
public tabMobile: string = "";
|
||||
public viewAllMobile: string = "";
|
||||
|
@ -163,6 +162,7 @@ export class ResultLandingComponent {
|
|||
@ViewChild("sdgFosSuggest") sdgFosSuggest: SdgFosSuggestComponent;
|
||||
|
||||
public isMobile: boolean = false;
|
||||
public isBottomIntersecting: boolean = false;
|
||||
// Full screen modals for small screens (mobile)
|
||||
@ViewChild('summaryFsModal') summaryFsModal: FullScreenModalComponent;
|
||||
@ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent;
|
||||
|
@ -207,6 +207,11 @@ export class ResultLandingComponent {
|
|||
ngOnInit() {
|
||||
this.subscriptions.push(this.layoutService.isMobile.subscribe(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.isLoggedIn = !!user;
|
||||
|
@ -293,16 +298,6 @@ export class ResultLandingComponent {
|
|||
} else {
|
||||
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) {
|
||||
this.observeGraphAndFeedback();
|
||||
}
|
||||
|
@ -514,6 +509,9 @@ export class ResultLandingComponent {
|
|||
|
||||
this.resultLandingInfo = data;
|
||||
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
|
||||
// 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';
|
||||
|
@ -591,7 +589,6 @@ export class ResultLandingComponent {
|
|||
this.setActiveTab();
|
||||
|
||||
this.cdr.detectChanges();
|
||||
|
||||
if (contexts) {
|
||||
if (this.communityId && this.communityId == "enermaps" && properties.enermapsURL) {
|
||||
this.enermapsId = ParsingFunctions.getEnermapsConceptId(contexts);
|
||||
|
|
|
@ -221,6 +221,11 @@ export class COOKIE {
|
|||
}
|
||||
}
|
||||
|
||||
class Roles {
|
||||
manager = 'manager';
|
||||
member = 'member';
|
||||
}
|
||||
|
||||
export class Role {
|
||||
public static GROUP = '';
|
||||
public static PORTAL_ADMIN = 'PORTAL_ADMINISTRATOR';
|
||||
|
@ -228,6 +233,7 @@ export class Role {
|
|||
public static ANONYMOUS_USER = 'ROLE_ANONYMOUS';
|
||||
public static USER_MANAGER = 'USER_MANAGER';
|
||||
public static CURATOR_CLAIM = 'CURATOR_CLAIM';
|
||||
public static ROLES: Roles = new Roles();
|
||||
|
||||
public static roleName(type: string, id: string) {
|
||||
return this.GROUP + this.mapType(type) + '.' + id;
|
||||
|
@ -285,3 +291,10 @@ export class Role {
|
|||
return this.mapType(type, false).toUpperCase() + "_" + id.toUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
export class RoleUtils {
|
||||
|
||||
get roles() {
|
||||
return Role.ROLES;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,19 +181,6 @@
|
|||
class="uk-text-center uk-text-bold uk-margin-small-bottom">
|
||||
{{ indicator.name }}
|
||||
</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' &&
|
||||
safeUrls.get(indicatorUtils.getFullUrl(stakeholder, getActiveIndicatorPath(indicator)))"
|
||||
allowfullscreen="true" mozallowfullscreen="true"
|
||||
|
@ -213,6 +200,13 @@
|
|||
[ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')"
|
||||
[src]="getActiveIndicatorPath(indicator).url">
|
||||
</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>
|
||||
|
@ -483,7 +477,7 @@
|
|||
class="uk-visible-toggle uk-flex uk-margin-small-top" transition-group-item
|
||||
[class.uk-active]="(!indicator.activePath && i == 0) || indicator.activePath === 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>
|
||||
<span *ngIf="!indicator.defaultId && chartIndicatorPaths.length > 1"
|
||||
class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left"
|
||||
|
@ -522,7 +516,7 @@
|
|||
</div>
|
||||
</span>
|
||||
</li>
|
||||
<li class="uk-margin-small-top">
|
||||
<li *ngIf="!indicator.defaultId" class="uk-margin-small-top">
|
||||
<a (click)="activeChartIndicatorPath(chartIndicatorPaths.length); $event.preventDefault()"
|
||||
class="uk-flex uk-flex-middle">
|
||||
<icon name="add" [flex]="true"></icon>
|
||||
|
@ -548,6 +542,9 @@
|
|||
</div>
|
||||
<div class="uk-width-1-1" formArrayName="parameters">
|
||||
<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"
|
||||
[formInput]="getParameter(i, 'title').get('value')"
|
||||
placeholder="Chart Title"></div>
|
||||
|
|
|
@ -668,6 +668,9 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
|
|||
if(!indicatorPath.parameters.statsProfile) {
|
||||
indicatorPath.parameters.statsProfile = null;
|
||||
}
|
||||
if(!indicatorPath.parameters.tab) {
|
||||
indicatorPath.parameters.tab = indicatorPath.parameters.title;
|
||||
}
|
||||
Object.keys(indicatorPath.parameters).forEach(key => {
|
||||
if (this.indicatorUtils.ignoredParameters.indexOf(key) === -1) {
|
||||
if (this.indicatorUtils.parametersValidators.has(key)) {
|
||||
|
|
|
@ -15,11 +15,6 @@ import {Option} from "../../sharedComponents/input/input.component";
|
|||
import {Session} from "../../login/utils/helper.class";
|
||||
import {properties} from "src/environments/environment";
|
||||
|
||||
class Roles {
|
||||
manager = 'manager';
|
||||
member = 'member';
|
||||
}
|
||||
|
||||
class Entities {
|
||||
stakeholder = 'Dashboard';
|
||||
funder = 'Funder';
|
||||
|
@ -45,7 +40,7 @@ export interface OAIndicator {
|
|||
}
|
||||
|
||||
export class StakeholderConfiguration {
|
||||
public static ROLES: Roles = new Roles();
|
||||
|
||||
public static ENTITIES: Entities = new Entities();
|
||||
public static TYPES: Option[] = [
|
||||
{value: 'funder', label: StakeholderConfiguration.ENTITIES.funder},
|
||||
|
@ -70,10 +65,6 @@ export class StakeholderConfiguration {
|
|||
}
|
||||
|
||||
export class StakeholderUtils {
|
||||
get roles() {
|
||||
return StakeholderConfiguration.ROLES;
|
||||
}
|
||||
|
||||
get entities() {
|
||||
return StakeholderConfiguration.ENTITIES;
|
||||
}
|
||||
|
@ -996,6 +987,7 @@ export class IndicatorUtils {
|
|||
obj[this.getDescriptionObjectName(obj)]["options"]["title"] = ChartHelper.prefix + "title" + ChartHelper.suffix;
|
||||
}
|
||||
indicatorPath.parameters["title"] = title ? title : "";
|
||||
indicatorPath.parameters["tab"] = title ? title : "";
|
||||
}
|
||||
|
||||
private extractSubTitle(obj, indicatorPath: IndicatorPath) {
|
||||
|
|
|
@ -103,7 +103,7 @@ export class BrowseStakeholderBaseComponent<T> extends StakeholderBaseComponent
|
|||
}
|
||||
|
||||
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() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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 {UserManagementService} from "../services/user-management.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()"
|
||||
[okDisabled]="code.invalid || loading">
|
||||
<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
|
||||
your email, to accept the invitation request.
|
||||
</div>
|
||||
|
@ -38,7 +38,7 @@ import {StringUtils} from "../utils/string-utils.class";
|
|||
(alertOutput)="verifyMember()" [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.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
|
||||
to your email, to accept the invitation request.
|
||||
</div>
|
||||
|
@ -98,6 +98,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
|||
public error: string = null;
|
||||
public loading: boolean = false;
|
||||
public stakeholderUtils: StakeholderUtils = new StakeholderUtils();
|
||||
public roleUtils: RoleUtils = new RoleUtils();
|
||||
|
||||
constructor(protected _route: ActivatedRoute,
|
||||
protected _router: Router,
|
||||
|
@ -173,7 +174,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
|||
this.managerModal.okButtonText = 'Accept';
|
||||
this.managerModal.stayOpen = true;
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -184,7 +185,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
|
|||
this.memberModal.okButtonLeft = false;
|
||||
this.memberModal.stayOpen = true;
|
||||
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.memberModal.open();
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import {DatasourcesHelperClass} from "./searchUtils/datasourcesHelper.class";
|
|||
import {properties} from "../../../environments/environment";
|
||||
import {RefineResultsUtils} from "../services/servicesUtils/refineResults.class";
|
||||
import {RefineFieldResultsService} from "../services/refineFieldResults.service";
|
||||
import {zip} from "rxjs";
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -207,12 +208,28 @@ export class SearchDataProvidersComponent {
|
|||
parametersFull = parameters;
|
||||
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(
|
||||
.subscribe(
|
||||
|
||||
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._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 => {
|
||||
let totalResults = data[0];
|
||||
let filters = data[2];
|
||||
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 => {
|
||||
|
|
|
@ -10,6 +10,7 @@ import {EnvProperties} from '../utils/properties/env-properties';
|
|||
import {NewSearchPageComponent, SearchForm} from "./searchUtils/newSearchPage.component";
|
||||
import {properties} from "../../../environments/environment";
|
||||
import {RefineFieldResultsService} from "../services/refineFieldResults.service";
|
||||
import {zip} from "rxjs";
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -169,12 +170,28 @@ export class SearchOrganizationsComponent {
|
|||
this.searchUtils.refineStatus = this.errorCodes.LOADING;
|
||||
this.disableRefineForms = true;
|
||||
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(
|
||||
.subscribe(
|
||||
|
||||
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._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 => {
|
||||
let totalResults = data[0];
|
||||
let filters = data[2];
|
||||
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 => {
|
||||
|
|
|
@ -11,6 +11,7 @@ import {NewSearchPageComponent, SearchForm} from "./searchUtils/newSearchPage.co
|
|||
import {RangeFilter} from "../utils/rangeFilter/rangeFilterHelperClasses.class";
|
||||
import {properties} from "../../../environments/environment";
|
||||
import {RefineFieldResultsService} from "../services/refineFieldResults.service";
|
||||
import {zip} from "rxjs";
|
||||
|
||||
@Component({
|
||||
selector: 'search-projects',
|
||||
|
@ -174,30 +175,45 @@ export class SearchProjectsComponent {
|
|||
disableRefineForms: this.disableRefineForms,
|
||||
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);
|
||||
|
||||
},
|
||||
err => {
|
||||
this.filters = this.searchPage.prepareFiltersToShow([], 0);
|
||||
this.rangeFilters = this.searchPage.prepareRangeFiltersToShow();
|
||||
|
||||
this.handleError("Error getting refine filters for projects: ", err);
|
||||
this.searchUtils.refineStatus = this.errorMessages.getErrorCode(err.status);
|
||||
|
||||
this.disableRefineForms = false;
|
||||
this.searchPageUpdates.emit({
|
||||
disableForms: this.disableForms,
|
||||
disableRefineForms: this.disableRefineForms,
|
||||
searchUtils: this.searchUtils
|
||||
})
|
||||
}
|
||||
|
||||
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 => {
|
||||
this.filters = this.searchPage.prepareFiltersToShow([], 0);
|
||||
this.rangeFilters = this.searchPage.prepareRangeFiltersToShow();
|
||||
|
||||
this.handleError("Error getting refine filters for projects: ", err);
|
||||
this.searchUtils.refineStatus = this.errorMessages.getErrorCode(err.status);
|
||||
|
||||
this.disableRefineForms = false;
|
||||
this.searchPageUpdates.emit({
|
||||
disableForms: this.disableForms,
|
||||
disableRefineForms: this.disableRefineForms,
|
||||
searchUtils: this.searchUtils
|
||||
})
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import {ContextsService} from "../claims/claim-utils/service/contexts.service";
|
|||
import {StringUtils} from "../utils/string-utils.class";
|
||||
import {RefineResultsUtils} from "../services/servicesUtils/refineResults.class";
|
||||
import {RefineFieldResultsService} from "../services/refineFieldResults.service";
|
||||
import {zip} from "rxjs";
|
||||
|
||||
@Component({
|
||||
selector: 'search-research-results',
|
||||
|
@ -253,13 +254,27 @@ export class SearchResearchResultsComponent {
|
|||
this.searchUtils.refineStatus = this.errorCodes.LOADING;
|
||||
this.disableRefineForms = true;
|
||||
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)
|
||||
//.switchMap(
|
||||
.subscribe(
|
||||
|
||||
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._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 => {
|
||||
let totalResults = data[0];
|
||||
let filters = data[2];
|
||||
let totalResults = filterIds.length > 0 ? data[0][0] : data[0];
|
||||
let filters = filterIds.length > 0 ? data[0][2].concat(data[1][2]) : data[2];
|
||||
|
||||
// if (refine) {
|
||||
// this.filters = this.searchPage.prepareFiltersToShow(filters, totalResults);
|
||||
|
|
|
@ -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&...))
|
||||
*/
|
||||
public getRefineFieldsQuery(): string {
|
||||
|
||||
var fields: string[] = this.getFields();
|
||||
public getRefineFieldsQuery(fields: string[] = null): string {
|
||||
|
||||
if(!fields) {
|
||||
fields = this.getFields();
|
||||
}
|
||||
var fieldsStr = ""
|
||||
for (var i = 0; i < fields.length; i++) {
|
||||
fieldsStr += "&fields=" + fields[i];
|
||||
|
@ -1816,10 +1818,10 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
|||
this.showUnknownFilters = true;
|
||||
this.filters = filters;
|
||||
}
|
||||
|
||||
|
||||
this.buildPageURLParameters(this.URLCreatedFilters, this.URLCreatedRangeFilters, this.URLCreatedStaticFilters, true);
|
||||
//this.checkSelectedRangeFilters(this.rangeFilters);
|
||||
|
||||
|
||||
this.checkSelectedFilters(this.filters);
|
||||
this.countSelectedFilters(this.filters);
|
||||
this.updateMeta(this.pageTitle);
|
||||
|
|
|
@ -34,14 +34,15 @@ export class SearchProjectsService {
|
|||
}
|
||||
getProjectsforDataProvider (datasourceId: string, page: number, size: number, properties:EnvProperties ):any {
|
||||
let url = properties.searchResourcesAPIURL;
|
||||
var basicQuery = "(oaftype exact project) "
|
||||
var basicQuery = "(oaftype exact project) ";
|
||||
var filterQuery = "&fq=(projectcode<>\"unidentified\")";
|
||||
url += "?query=";
|
||||
if(datasourceId!= null && datasourceId != '' ) {
|
||||
url +=" ( "+basicQuery+ " ) " +" and (collectedfromdatasourceid exact \"" + datasourceId + "\" or resulthostingdatasourceid exact \""+ datasourceId + "\")";
|
||||
}else{
|
||||
url +=" ( "+basicQuery+ " ) ";
|
||||
}
|
||||
|
||||
url += filterQuery;
|
||||
url += "&page="+(page-1)+"&size="+size;
|
||||
url += "&format=json";
|
||||
|
||||
|
@ -53,6 +54,7 @@ export class SearchProjectsService {
|
|||
// &type=projects
|
||||
let url = properties.searchAPIURLLAst+"resources2/?format=json";
|
||||
// var basicQuery = "(oaftype exact project) "
|
||||
var basicQuery = "&fq=(projectcode<>\"unidentified\")";
|
||||
// url += "?query=";
|
||||
if(params!= null && params != '' ) {
|
||||
url +="&query=(" + params + ")";
|
||||
|
@ -66,6 +68,8 @@ export class SearchProjectsService {
|
|||
if(refineQuery) {
|
||||
url += "&" + refineQuery;
|
||||
}
|
||||
// url += "&fq="+basicQuery;
|
||||
url += basicQuery;
|
||||
url += "&page="+(page-1)+"&size="+size;
|
||||
url += minRef ? "&minRef=true" : "";
|
||||
|
||||
|
@ -80,11 +84,15 @@ export class SearchProjectsService {
|
|||
let url = properties.searchResourcesAPIURL;
|
||||
var basicQuery = "(oaftype exact project) "
|
||||
url += "?query=";
|
||||
if(filterquery!= null && filterquery != '' ) {
|
||||
url +="( ( "+basicQuery+ " ) and (relorganizationid exact \"" + organizationId + "\")"+" " + filterquery + ")";
|
||||
}else{
|
||||
// if(filterquery!= null && filterquery != '' ) {
|
||||
// url +="( ( "+basicQuery+ " ) and (relorganizationid exact \"" + organizationId + "\")"+" " + filterquery + ")";
|
||||
// }else{
|
||||
url +=" (( "+basicQuery+ " ) " +" and (relorganizationid exact \"" + organizationId + "\"))";
|
||||
// }
|
||||
if(filterquery) {
|
||||
url += "&fq=" + filterquery;
|
||||
}
|
||||
url += "&fq=(projectcode<>\"unidentified\")";
|
||||
if(refineFields!= null && refineFields.length > 0 ) {
|
||||
url +="&refine=true";
|
||||
for(let i=0; i< refineFields.length ; i++ ){
|
||||
|
@ -304,6 +312,8 @@ export class SearchProjectsService {
|
|||
if(refineParams!= null && refineParams != '' ) {
|
||||
url += refineParams;
|
||||
}
|
||||
url += "&fq=(projectcode<>\"unidentified\")";
|
||||
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.pipe(map(res => res['meta']['total']));
|
||||
}
|
||||
|
|
|
@ -829,7 +829,6 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
|
|||
|
||||
resetValue(event: any) {
|
||||
event.stopPropagation();
|
||||
console.log(1)
|
||||
this.formControl.setValue('');
|
||||
this.focus(true, event);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
export interface Icon {
|
||||
name?: string,
|
||||
svg?: string,
|
||||
class?: string
|
||||
class?: string,
|
||||
ratio?: number
|
||||
}
|
||||
|
||||
export class MenuItem {
|
||||
|
@ -90,4 +91,4 @@ export class SideMenuItem extends MenuItem {
|
|||
ukIcon: string = '';
|
||||
}
|
||||
|
||||
export enum MenuAlignment {LEFT = "LEFT", CENTER = "CENTER", RIGHT = "RIGHT"}
|
||||
export enum MenuAlignment {LEFT = "LEFT", CENTER = "CENTER", RIGHT = "RIGHT"}
|
||||
|
|
|
@ -9,7 +9,7 @@ export class SliderTabComponent {
|
|||
@Input("tabTitle")
|
||||
public title: string;
|
||||
@Input("tabId")
|
||||
public id: string;
|
||||
public id: string | number;
|
||||
@Input()
|
||||
public active: boolean = false;
|
||||
@Input()
|
||||
|
|
|
@ -143,7 +143,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
|
|||
/**
|
||||
* 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 subscriptions: any[] = [];
|
||||
private observer: IntersectionObserver;
|
||||
|
@ -235,7 +235,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
|
|||
});
|
||||
}, {threshold: 0.1});
|
||||
this.tabs.forEach(tab => {
|
||||
let element = document.getElementById(tab.id);
|
||||
let element = document.getElementById(tab.id.toString());
|
||||
if (element) {
|
||||
this.observer.observe(element);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {Email} from "./email";
|
||||
import {Body} from "./body";
|
||||
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";
|
||||
|
||||
export class Composer {
|
||||
|
@ -33,7 +33,7 @@ export class Composer {
|
|||
|
||||
email.subject = this.subjectPrefix + communityName + ": Welcome new manager";
|
||||
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. "
|
||||
+ "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."
|
||||
|
@ -329,9 +329,9 @@ export class Composer {
|
|||
'<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>' +
|
||||
(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>':
|
||||
'<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 +
|
||||
'</a> if you have any questions or concerns.</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.recipient = recipient;
|
||||
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>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>' +
|
||||
(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 ' + 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 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 ' + 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 +
|
||||
'</a> if you have any questions or concerns.</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>The verification code is <b>((__code__))</b>.</p>' +
|
||||
(role === 'manager'?
|
||||
'<p>As a manager of the OpenAIRE Research Community Dashboard, you will have access to the administration part of the dashboard, ' +
|
||||
'<p>As a ' + 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>':
|
||||
'<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 +
|
||||
'</a> if you have any questions or concerns.</p>' +
|
||||
'<p>Kind Regards<br>The OpenAIRE Team</p>' +
|
||||
|
|
|
@ -1,202 +1,216 @@
|
|||
import {properties} from "../../../../environments/environment";
|
||||
import {Measure} from "./resultLandingInfo";
|
||||
import {BelongsTo, Measure} from "./resultLandingInfo";
|
||||
|
||||
export class DataproviderProvenance {
|
||||
provenance: Map<string, {"urlPrefix": string, "name": string}>;
|
||||
provenance: Map<string, { "urlPrefix": string, "name": string }>;
|
||||
|
||||
constructor() {
|
||||
this.provenance = new Map();
|
||||
this.provenance.set("opendoar____::", {"urlPrefix": properties.openDoarURL, "name": "OpenDOAR"});//, "idRegexPrefix": ""});
|
||||
this.provenance.set("re3data_____::", {"urlPrefix": properties.r3DataURL, "name": "re3data.org"});
|
||||
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"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class DataProviderInfo {
|
||||
relcanId;
|
||||
objIdentifier: string;
|
||||
record;
|
||||
title: { "name": string, "url": string };
|
||||
officialName: string;
|
||||
type: string;
|
||||
registry: boolean;
|
||||
compatibility: { "info": string, "name": string, "id": string };
|
||||
oaiPmhURL: string;
|
||||
openDoarId: string;
|
||||
r3DataId: string;
|
||||
provenance: Map<string, {"url": string[]}>;
|
||||
originalId: string;
|
||||
countries: string[];
|
||||
journal: {"journal": "", "issn": string, "lissn": string, "eissn": string};
|
||||
description: string;
|
||||
subjects: string[];
|
||||
jurisdiction: string;
|
||||
thematic: boolean;
|
||||
contentpolicy: string;
|
||||
identifiers: Map<string, string[]>; //key is the classname
|
||||
relcanId;
|
||||
objIdentifier: string;
|
||||
record;
|
||||
title: { "name": string, "url": string };
|
||||
officialName: string;
|
||||
type: string;
|
||||
registry: boolean;
|
||||
compatibility: { "info": string, "name": string, "id": string };
|
||||
oaiPmhURL: string;
|
||||
openDoarId: string;
|
||||
r3DataId: string;
|
||||
provenance: Map<string, { "url": string[] }>;
|
||||
originalId: string;
|
||||
countries: string[];
|
||||
journal: { "journal": "", "issn": string, "lissn": string, "eissn": string };
|
||||
description: string;
|
||||
subjects: string[];
|
||||
jurisdiction: string;
|
||||
thematic: boolean;
|
||||
contentpolicy: string;
|
||||
identifiers: Map<string, string[]>; //key is the classname
|
||||
|
||||
fundedContent: string; // search query
|
||||
measure: Measure;
|
||||
|
||||
//collected from datasource api
|
||||
// aggregationStatus: {"fundedContent": string, "indexRecords": string, "fulltexts": string, "lastUpdateDate": string};
|
||||
aggregationStatus: {"fulltexts": string};
|
||||
aggregationStatus: { "fulltexts": string };
|
||||
|
||||
tabs: {"name": string, "content": string}[];
|
||||
tabs2: string[] =[];
|
||||
tabsInTypes = {
|
||||
"publicationsTab": new Set<string>(
|
||||
[ "aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"infospace",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"scholarcomminfra",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"orprepository"
|
||||
]),
|
||||
"datasetsTab": new Set<string>(
|
||||
[ "aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"infospace",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"scholarcomminfra",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"orprepository"
|
||||
]),
|
||||
"statisticsTab": new Set<string>(
|
||||
[ "aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"orprepository"
|
||||
]),
|
||||
// "organizationsTab": new Set<string>(
|
||||
// [ "entityregistry::projects",
|
||||
// "entityregistry::repositories"
|
||||
// ]),
|
||||
"projectsTab": new Set<string>(["entityregistry::projects"]),
|
||||
"datasourcesTab": new Set<string>(["entityregistry::repositories"]),
|
||||
"relatedDatasourcesTab": new Set<string>(
|
||||
[ "aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::datarepository"
|
||||
]),
|
||||
"softwareTab": new Set<string>(
|
||||
[
|
||||
"aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"infospace",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"scholarcomminfra",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"softwarerepository",
|
||||
"aggregator::softwarerepository",
|
||||
"orprepository"
|
||||
]),
|
||||
"orpsTab": new Set<string>(
|
||||
[
|
||||
"aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"infospace",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"scholarcomminfra",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"softwarerepository",
|
||||
"aggregator::softwarerepository",
|
||||
"orprepository"
|
||||
]),
|
||||
"metricsTab": new Set<string>(
|
||||
[ "aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"infospace",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"websource",
|
||||
"pubsrepository::unknown",
|
||||
"scholarcomminfra",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"softwarerepository",
|
||||
"aggregator::softwarerepository",
|
||||
"orprepository"
|
||||
])
|
||||
tabs: { "name": string, "content": string }[];
|
||||
tabs2: string[] = [];
|
||||
tabsInTypes = {
|
||||
"publicationsTab": new Set<string>(
|
||||
["aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"infospace",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"scholarcomminfra",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"orprepository"
|
||||
]),
|
||||
"datasetsTab": new Set<string>(
|
||||
["aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"infospace",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"scholarcomminfra",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"orprepository"
|
||||
]),
|
||||
"statisticsTab": new Set<string>(
|
||||
["aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"orprepository"
|
||||
]),
|
||||
// "organizationsTab": new Set<string>(
|
||||
// [ "entityregistry::projects",
|
||||
// "entityregistry::repositories"
|
||||
// ]),
|
||||
"projectsTab": new Set<string>(["entityregistry::projects"]),
|
||||
"datasourcesTab": new Set<string>(["entityregistry::repositories"]),
|
||||
"relatedDatasourcesTab": new Set<string>(
|
||||
["aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::datarepository"
|
||||
]),
|
||||
"softwareTab": new Set<string>(
|
||||
[
|
||||
"aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"infospace",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"scholarcomminfra",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"softwarerepository",
|
||||
"aggregator::softwarerepository",
|
||||
"orprepository"
|
||||
]),
|
||||
"orpsTab": new Set<string>(
|
||||
[
|
||||
"aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"infospace",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"scholarcomminfra",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"softwarerepository",
|
||||
"aggregator::softwarerepository",
|
||||
"orprepository"
|
||||
]),
|
||||
"metricsTab": new Set<string>(
|
||||
["aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"crissystem",
|
||||
"datarepository::unknown",
|
||||
"infospace",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"websource",
|
||||
"pubsrepository::unknown",
|
||||
"scholarcomminfra",
|
||||
"pubsrepository::thematic",
|
||||
"pubscatalogue::unknown",
|
||||
"softwarerepository",
|
||||
"aggregator::softwarerepository",
|
||||
"orprepository"
|
||||
])
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
resultsBy: string;
|
||||
resultTypes = {
|
||||
"collectedFrom": new Set<string>(
|
||||
[ "aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"entityregistry::projects",
|
||||
"entityregistry::repositories",
|
||||
"infospace",
|
||||
"scholarcomminfra",
|
||||
"pubscatalogue::unknown",
|
||||
"aggregator::softwarerepository"
|
||||
]),
|
||||
"hostedBy": new Set<string>(
|
||||
[ "crissystem",
|
||||
"datarepository::unknown",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"pubsrepository::thematic",
|
||||
"softwarerepository",
|
||||
"orprepository"
|
||||
])
|
||||
};
|
||||
resultsBy: string;
|
||||
resultTypes = {
|
||||
"collectedFrom": new Set<string>(
|
||||
["aggregator::datarepository",
|
||||
"aggregator::pubsrepository::institutional",
|
||||
"aggregator::pubsrepository::unknown",
|
||||
"aggregator::pubsrepository::journals",
|
||||
"entityregistry::projects",
|
||||
"entityregistry::repositories",
|
||||
"infospace",
|
||||
"scholarcomminfra",
|
||||
"pubscatalogue::unknown",
|
||||
"aggregator::softwarerepository"
|
||||
]),
|
||||
"hostedBy": new Set<string>(
|
||||
["crissystem",
|
||||
"datarepository::unknown",
|
||||
"pubsrepository::institutional",
|
||||
"pubsrepository::journal",
|
||||
"pubsrepository::unknown",
|
||||
"pubsrepository::thematic",
|
||||
"softwarerepository",
|
||||
"orprepository"
|
||||
])
|
||||
};
|
||||
|
||||
organizations: {"acronym": string, "name": string, "id": string}[] = [];
|
||||
//publications: any;
|
||||
//datasets: any;
|
||||
statistics: any;
|
||||
//projects: any;
|
||||
datasources: any;
|
||||
organizations: { "acronym": string, "name": string, "id": string }[] = [];
|
||||
//publications: any;
|
||||
//datasets: any;
|
||||
statistics: any;
|
||||
//projects: any;
|
||||
datasources: any;
|
||||
|
||||
//relatedDatasources: Map<string, {"name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string}>;
|
||||
relatedDatasources: {"id": string, "name": string, "count": number}[] = [];
|
||||
//relatedDatasources: Map<string, {"name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string}>;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import {BelongsTo} from "./resultLandingInfo";
|
||||
|
||||
export interface OrganizationProject {
|
||||
name: string;
|
||||
id: string;
|
||||
|
@ -27,4 +29,14 @@ export class OrganizationInfo {
|
|||
|
||||
deletedByInferenceIds: string[];
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
id:string;
|
||||
id: string;
|
||||
acronym: string;
|
||||
title: string;
|
||||
funding: {funderName: string, funderShortName: string, code: string, callIdentifier: string,
|
||||
fundingStream: string, budget: string, contribution: string, currency: string};
|
||||
funding: Funding;
|
||||
startDate: number;
|
||||
endDate: number;
|
||||
currentDate: number;
|
||||
|
@ -13,7 +31,7 @@ export class ProjectInfo {
|
|||
openAccessMandatePublications: string;
|
||||
openAccessMandateDatasets: string;
|
||||
// specialClause39: string;
|
||||
organizations: { "acronym": string, "name": string, "id": string }[];//Map<string, string>;
|
||||
organizations: ProjectOrganization[];
|
||||
url: string;
|
||||
urlInfo: string;
|
||||
description: string;
|
||||
|
@ -23,4 +41,14 @@ export class ProjectInfo {
|
|||
totalDatasets: number;
|
||||
publicationsStatus: any;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@ import {
|
|||
Project,
|
||||
RelationResult
|
||||
} 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 {
|
||||
type: "pmid" | "doi" | "pmc" | "handle" | "openaire" | "swhid";
|
||||
|
@ -30,18 +33,6 @@ export interface Context {
|
|||
}
|
||||
|
||||
export interface Measure {
|
||||
// /** @deprecated*/
|
||||
// downloads?: string;
|
||||
// /** @deprecated*/
|
||||
// views?: string;
|
||||
// /** @deprecated*/
|
||||
// influence?: string;
|
||||
// /** @deprecated*/
|
||||
// popularity?: string;
|
||||
// /** @deprecated*/
|
||||
// citations?: string;
|
||||
// /** @deprecated*/
|
||||
// impulse?: string;
|
||||
bip?: Metric[]
|
||||
counts?: Metric[]
|
||||
countsPerDatasource?: MetricPerDatasource[];
|
||||
|
@ -61,12 +52,45 @@ export interface Metric {
|
|||
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 {
|
||||
relcanId;
|
||||
objIdentifier: string;
|
||||
// PUBLICATION, DATASET, SOFTWARE, ORP
|
||||
record;
|
||||
resultType: "publication"|"dataset"|"other"|"software";
|
||||
resultType: "publication" | "dataset" | "other" | "software";
|
||||
// PUBLICATION, DATASET, SOFTWARE, ORP, DELETED_BY_INFERENCE
|
||||
title: string;
|
||||
accessMode: string;
|
||||
|
@ -79,26 +103,26 @@ export class ResultLandingInfo {
|
|||
languages: string[];
|
||||
countries: string[];
|
||||
description: string;
|
||||
|
||||
|
||||
hostedBy_collectedFrom: HostedByCollectedFrom[];
|
||||
|
||||
|
||||
// PUBLICATION, DATASET, SOFTWARE, ORP
|
||||
fundedByProjects: Project[];
|
||||
|
||||
|
||||
underCurationMessage: boolean;
|
||||
publisher: string;
|
||||
journal: Journal;
|
||||
|
||||
|
||||
subjects: string[];
|
||||
otherSubjects: Map<string, string[]>;
|
||||
classifiedSubjects: Map<string, string[]>; //<class of subject, subjects>
|
||||
fos: {"id": string, "label": string}[] = [];
|
||||
fos: { "id": string, "label": string }[] = [];
|
||||
sdg: string[];
|
||||
eoscSubjects: any[];
|
||||
|
||||
oaRoutes: OARoutes;
|
||||
publiclyFunded: boolean;
|
||||
|
||||
|
||||
// // percentage is for trust
|
||||
// relatedResearchResults: RelationResult[];
|
||||
// // percentage is for similarity
|
||||
|
@ -159,22 +183,35 @@ export class ResultLandingInfo {
|
|||
relatedClassFilters: Set<string> = new Set();
|
||||
|
||||
contexts: Context[];
|
||||
|
||||
|
||||
deletedByInferenceIds: string[];
|
||||
|
||||
|
||||
// PUBLICATION, DATASET, ORP
|
||||
references: Reference[];
|
||||
|
||||
|
||||
// PUBLICATION
|
||||
bioentities: Map<string, Map<string, string>>; //<site name, <>>
|
||||
organizations: Organization[];
|
||||
openCitations: { "url": string, "title": string, "year": string, "doi": string, "authors": string[] }[];
|
||||
|
||||
|
||||
// DATASET
|
||||
subtitle: string;
|
||||
|
||||
|
||||
// SOFTWARE
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ private fetch (link,id,oafEntityType,type, properties:EnvProperties ){
|
|||
if(keyword!= null && keyword != '' ) {
|
||||
if(type=="project") {
|
||||
//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") {
|
||||
//name fields
|
||||
url += "fq="+'(organizationlegalname="'+keyword+'" ) or (organizationlegalshortname='+'"'+keyword+ '")';
|
||||
|
|
|
@ -116,7 +116,7 @@ export let commonDev: EnvProperties = {
|
|||
cookieDomain: ".di.uoa.gr",
|
||||
feedbackmail: "kostis30fylloy@gmail.com",
|
||||
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/",
|
||||
datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/api/",
|
||||
contextsAPI: "https://dev-openaire.d4science.org/openaire/context",
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
<span *ngIf="result.acronym">
|
||||
{{result.acronym}}
|
||||
</span>
|
||||
<span *ngIf="result.acronym && (result.title)"> (</span>
|
||||
<span *ngIf="result.title" [innerHTML]="result.title"></span>
|
||||
<span *ngIf="result.acronym && result.title">)</span>
|
||||
<ng-container *ngIf="result.acronym != result.title">
|
||||
<span *ngIf="result.acronym && (result.title)"> (</span>
|
||||
<span *ngIf="result.title" [innerHTML]="result.title"></span>
|
||||
<span *ngIf="result.acronym && result.title">)</span>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div *ngIf="!result.title && !result.acronym">
|
||||
[no title available]
|
||||
|
@ -77,7 +79,8 @@
|
|||
</div>
|
||||
<!-- Metadata -->
|
||||
<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()"
|
||||
[year]="result.year?.toString()"
|
||||
[openAccessMandatePublications]="result.openAccessMandatePublications"
|
||||
|
|
|
@ -43,6 +43,7 @@ export interface Project {
|
|||
title: string;
|
||||
funderShortname: string;
|
||||
funderName: string;
|
||||
funderJurisdiction?: string
|
||||
funding?: string;
|
||||
code: string;
|
||||
validated?: boolean;
|
||||
|
|
|
@ -443,9 +443,13 @@ export class StringUtils {
|
|||
});
|
||||
return <string []>words;
|
||||
}
|
||||
|
||||
public static capitalizeAll(str: string): string {
|
||||
return str.split(' ').map(value => StringUtils.capitalize(value)).join(' ');
|
||||
}
|
||||
|
||||
public static capitalize(value: string): string {
|
||||
return value.charAt(0).toUpperCase() + value.slice(1);
|
||||
public static capitalize(str: string): string {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue