Compare commits

...

14 Commits

Author SHA1 Message Date
Konstantinos Triantafyllou 2b2aaed2b8 Merge branch 'develop' of code-repo.d4science.org:MaDgIK/openaire-library into develop 2024-05-31 13:59:35 +03:00
Konstantinos Triantafyllou df2516f8f7 [develop | DONE]: Add belongs to all entities and add message in html. 2024-05-31 13:59:23 +03:00
Konstantinos Triantafyllou 41b46b754e [develop | FIXED]: Add condition to add indicator path only if defaultId is null. 2024-05-31 11:36:57 +03:00
Konstantina Galouni 5db039ea0d [develop | DONE | FIXED]: [BUG] When selecting a filter value which is not in top 7, filters were not properly set - get 100 top values of filters with at least one selected value.
1. searchResearchResults.component.ts & searchProjects.component.ts & searchOrganizations.component.ts & searchDataProviders.component.ts: Check selected filter values from URL and query top 100 values for selected facets and top 7 for others.
2. newSearchPage.component.ts: In method "getRefineFieldsQuery()" added optional parameter fields: string[] = null, to not always get the full list of fields, but the ones provided (selected filters or not).
2024-05-30 16:33:43 +03:00
Konstantinos Triantafyllou ea5275da2d Merge branch 'develop' of code-repo.d4science.org:MaDgIK/openaire-library into develop 2024-05-30 13:59:14 +03:00
Konstantinos Triantafyllou 5197f88ade Add slider tabs in indicators multi chart. 2024-05-30 13:59:07 +03:00
Konstantinos Triantafyllou e9eb05de64 [develop]: Remove console log from input component 2024-05-29 19:39:08 +03:00
Konstantinos Triantafyllou 65a60ddad1 [Develop | ADDED]: Add belongsTo configuration for all entities and initialize it in results. 2024-05-29 13:05:04 +03:00
Konstantina Galouni 59fc73bf4d [develop | DONE | FIXED]: In search results, only 1000 relations are fetched and shown - show messages.
1. result-preview.component.html: Added input parameter "resultTitle" to <entity-metadata>.
2. entity-metadata.component.ts: Added @Input() resultTitle: string = null; | When more than 1000 projects or organizations, show +more projects/partners and in modal, show message "Only 1000 Projects/ Partners of {result title} are shown here."
2024-05-28 16:34:16 +03:00
Konstantina Galouni cc6b5aeffe [develop | DONE | CHANGED]: Excluded (filter out) unidentified projects from search.
1. searchProjects.service.ts: Added filter &fq=(projectcode<>"unidentified") in methods "getProjectsforDataProvider()", "advancedSearchProjects()", "getProjectsForOrganizations()", "numOfSearchProjects2()".
2. organization.component.ts: In method call "searchProjectsService.getProjectsForOrganizations()" updated parameter for funder to be in fq instead of keyword query.
3. projects-in-modal.component.ts: In method "updateFilters()", format filterQuery to be in fq instead of keyword query.
4. entitySearch.service.ts: In method "search()", for type "project", added in the query &fq=(projectcode<>"unidentified").
2024-05-28 15:27:33 +03:00
Konstantinos Triantafyllou 1ac4365e05 [develop | DONE]: Add Role Utils with naming variables for roles 2024-05-28 12:21:37 +03:00
argirok 5af682b1b6 [develop | DONE | CHANGED ] Claim funding: allow search for projects with no funder selected, exclde unidentified, give more space to form 2024-05-28 12:09:21 +03:00
Konstantina Galouni 9722024643 [develop | DONE | FIXED]: relatedDatasourcesTab.component.ts: Show "top 100" message only if results are more than 90 & [BUG FIX] Use "collectedFromName" input and not a predefined static data source name. 2024-05-27 11:20:24 +03:00
argirok 9fb155d95f [develop | DONE | FIXED ] Claims: remove unused import 2024-05-24 10:08:57 +03:00
39 changed files with 790 additions and 580 deletions

View File

@ -1,11 +1,11 @@
<div class="uk-width-xlarge@l uk-width-large" [ngClass]="centerAlign ? 'uk-align-center':''">
<div class="uk-width-expand" [ngClass]="centerAlign ? 'uk-align-center':''">
<advanced-search-input (searchEmitter)="search(page,size)">
<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"

View File

@ -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];

View File

@ -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"

View File

@ -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');

View File

@ -2,7 +2,9 @@
<schema2jsonld *ngIf="dataProviderInfo"
[data]=dataProviderInfo [URL]="canonicalUrl" type="datasource"
[otherURL]="(dataProviderInfo.provenance)?provenanceUrls:null"></schema2jsonld>
<div *ngIf="dataProviderInfo && !dataProviderInfo.belongsTo" [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">

View File

@ -389,6 +389,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));

View File

@ -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"

View File

@ -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[];

View File

@ -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);

View File

@ -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 + ' ) ';
}
}

View File

@ -3,7 +3,9 @@
[URL]="properties.domain + properties.baseLink+this.properties.searchLinkToOrganization+organizationInfo.relcanId"
type="organization">
</schema2jsonld>
<div *ngIf="organizationInfo && !organizationInfo.belongsTo" [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">

View File

@ -401,6 +401,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 +489,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++) {

View File

@ -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" [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">

View File

@ -466,6 +466,8 @@ export class ProjectComponent {
this.subscriptions.push(this._projectService.getProjectInfo(id, this.properties).subscribe(
data => {
this.projectInfo = data;
this.projectInfo.setBelongsTo(id);
console.log(this.projectInfo);
this.projectInfo.id = this.projectId;
this.actionsAfterGettingProjectInfo();

View File

@ -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;
}
}

View File

@ -2,7 +2,9 @@
<schema2jsonld *ngIf="resultLandingInfo && resultLandingInfo.record"
[data]=resultLandingInfo.record [URL]="canonicalUrl"
[searchActionRoute]="properties.searchLinkToResults"></schema2jsonld>
<div *ngIf="resultLandingInfo && !resultLandingInfo.belongsTo" [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>

View File

@ -1,4 +1,4 @@
import {ChangeDetectorRef, Component, ElementRef, Input, ViewChild} from '@angular/core';
import {ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Output, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {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;
@ -514,6 +515,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 +595,6 @@ export class ResultLandingComponent {
this.setActiveTab();
this.cdr.detectChanges();
if (contexts) {
if (this.communityId && this.communityId == "enermaps" && properties.enermapsURL) {
this.enermapsId = ParsingFunctions.getEnermapsConceptId(contexts);

View File

@ -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;
}
}

View File

@ -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>

View File

@ -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)) {

View File

@ -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) {

View File

@ -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();
}

View File

@ -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 => {

View File

@ -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 => {

View File

@ -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
})
}
);
}
}

View File

@ -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);

View File

@ -551,9 +551,11 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
/*
* Get a query string of all fields, that want to get from search (e.g. &fields=funderid&fields=projectstartyear&...))
*/
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);

View File

@ -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']));
}

View File

@ -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);
}

View File

@ -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()

View File

@ -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);
}

View File

@ -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>' +

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -1,11 +1,29 @@
import {Measure} from "./resultLandingInfo";
import {BelongsTo, Measure} from "./resultLandingInfo";
export interface Funding {
funderName: string,
funderShortName: string,
funderJurisdiction: string,
code: string,
callIdentifier: string,
fundingStream: string,
budget: string,
contribution: string,
currency: string
}
export interface ProjectOrganization {
acronym: string,
country: string,
name: string,
id: string
}
export class ProjectInfo {
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);
}
}
}

View File

@ -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) {
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.getEntityName(this.resultType));
this.message = this.message.replace('((type_id))', typeId);
this.message = this.message.replace('((id))', id);
}
}
}

View File

@ -148,7 +148,7 @@ private fetch (link,id,oafEntityType,type, properties:EnvProperties ){
if(keyword!= null && keyword != '' ) {
if(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+ '")';

View File

@ -77,7 +77,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"

View File

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