Merge remote-tracking branch 'origin/develop' into plugins-functionality

# Conflicts:
#	utils/properties/environments/environment.ts
This commit is contained in:
argirok 2024-06-10 09:11:08 +03:00
commit 4fffa9f06c
35 changed files with 483 additions and 392 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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 && !isBottomIntersecting" [innerHTML]="dataProviderInfo.message"
class="uk-alert uk-alert-warning uk-position-fixed uk-position-bottom-center uk-text-small" style="z-index: 1000;">
</div>
<!-- Desktop view -->
<div class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
<div *ngIf="!isMobile" class="tm-main">

View File

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

View File

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

View File

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

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 && !isBottomIntersecting" [innerHTML]="projectInfo.message"
class="uk-alert uk-alert-warning uk-position-fixed uk-position-bottom-center uk-text-small" style="z-index: 1000;">
</div>
<!-- Desktop view -->
<div class=" uk-visible@m landing uk-section uk-padding-remove tm-middle">
<div *ngIf="!isMobile" class="tm-main">

View File

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

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,7 @@
<schema2jsonld *ngIf="resultLandingInfo && resultLandingInfo.record"
[data]=resultLandingInfo.record [URL]="canonicalUrl"
[searchActionRoute]="properties.searchLinkToResults"></schema2jsonld>
<div *ngIf="resultLandingInfo && !resultLandingInfo.belongsTo" [innerHTML]="resultLandingInfo.message"
<div *ngIf="resultLandingInfo && !resultLandingInfo.belongsTo && !isBottomIntersecting" [innerHTML]="resultLandingInfo.message"
class="uk-alert uk-alert-warning uk-position-fixed uk-position-bottom-center uk-text-small" style="z-index: 1000;">
</div>
<!-- Desktop view -->

View File

@ -155,8 +155,6 @@ export class ResultLandingComponent {
@ViewChild("descriptionDiv") descriptionDiv: ElementRef;
@ViewChild('descriptionModal') descriptionModal;
// public shouldSticky: boolean = true;
public mobileContent: "info" | "metrics" | "actions" = "info";
public tabMobile: string = "";
public viewAllMobile: string = "";
@ -164,6 +162,7 @@ export class ResultLandingComponent {
@ViewChild("sdgFosSuggest") sdgFosSuggest: SdgFosSuggestComponent;
public isMobile: boolean = false;
public isBottomIntersecting: boolean = false;
// Full screen modals for small screens (mobile)
@ViewChild('summaryFsModal') summaryFsModal: FullScreenModalComponent;
@ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent;
@ -208,6 +207,11 @@ export class ResultLandingComponent {
ngOnInit() {
this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
this.isMobile = isMobile;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.isBottomIntersecting.subscribe(isBottomIntersecting => {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.isLoggedIn = !!user;
@ -294,16 +298,6 @@ export class ResultLandingComponent {
} else {
this.offset = 0;
}
// let bottom = document.getElementById('bottom');
// if(bottom) {
// let observer = new IntersectionObserver(entries => {
// entries.forEach(entry => {
// this.shouldSticky = !entry.isIntersecting;
// })
// });
// this.subscriptions.push(observer);
// observer.observe(bottom);
// }
if(this.graph_and_feedback) {
this.observeGraphAndFeedback();
}

View File

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

View File

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

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

@ -1,7 +1,8 @@
export interface Icon {
name?: string,
svg?: string,
class?: string
class?: string,
ratio?: number
}
export class MenuItem {
@ -90,4 +91,4 @@ export class SideMenuItem extends MenuItem {
ukIcon: string = '';
}
export enum MenuAlignment {LEFT = "LEFT", CENTER = "CENTER", RIGHT = "RIGHT"}
export enum MenuAlignment {LEFT = "LEFT", CENTER = "CENTER", RIGHT = "RIGHT"}

View File

@ -202,4 +202,15 @@ export class DataProviderInfo {
//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

@ -29,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,12 +1,29 @@
import {BelongsTo, Measure} from "./resultLandingInfo";
import {StringUtils} from "../string-utils.class";
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;
@ -14,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;
@ -29,8 +46,8 @@ export class ProjectInfo {
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.belongsTo ? BelongsTo.project.message : null;
if (this.message) {
this.message = this.message.replace('((id))', id);
}
}

View File

@ -70,7 +70,7 @@ export class BelongsTo {
if (field) {
field = Object.assign({}, field);
let json: any = element;
if (field.path.length > 0) {
if (field.path.length > 0 && json) {
if (Array.isArray(json)) {
return json.findIndex(value => BelongsTo.check(value, field)) != -1;
} else {
@ -79,7 +79,6 @@ export class BelongsTo {
return BelongsTo.check(json, field);
}
}
console.log(json, field.value)
return json == field.value;
}
return false;
@ -210,7 +209,7 @@ export class ResultLandingInfo {
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('((result))', StringUtils.capitalizeAll(StringUtils.getEntityName(this.resultType)));
this.message = this.message.replace('((type_id))', typeId);
this.message = this.message.replace('((id))', id);
}

View File

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

View File

@ -3,9 +3,11 @@
<span *ngIf="result.acronym">
{{result.acronym}}
</span>
<span *ngIf="result.acronym && (result.title)"> (</span>
<span *ngIf="result.title" [innerHTML]="result.title"></span>
<span *ngIf="result.acronym && result.title">)</span>
<ng-container *ngIf="result.acronym != result.title">
<span *ngIf="result.acronym && (result.title)"> (</span>
<span *ngIf="result.title" [innerHTML]="result.title"></span>
<span *ngIf="result.acronym && result.title">)</span>
</ng-container>
</div>
<div *ngIf="!result.title && !result.acronym">
[no title available]

View File

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