diff --git a/claims/claim-utils/claimHelper.class.ts b/claims/claim-utils/claimHelper.class.ts index 74349800..d3fb38f4 100644 --- a/claims/claim-utils/claimHelper.class.ts +++ b/claims/claim-utils/claimHelper.class.ts @@ -28,6 +28,7 @@ export class ClaimResult { export class ClaimProject { public funderId: string; + public funderShortname: string; public funderName: string; public acronym: string; public startDate: string; diff --git a/claims/claim-utils/claimProjectSearchForm.component.ts b/claims/claim-utils/claimProjectSearchForm.component.ts index 01e6d8c0..70b154e6 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.ts +++ b/claims/claim-utils/claimProjectSearchForm.component.ts @@ -65,35 +65,36 @@ export class ClaimProjectsSearchFormComponent { } search(page,size) { - if(this.keyword.length == 0){ - this.showResults =false; + if (this.keyword.length == 0) { + this.showResults = false; return; } - this.showResults =true; + this.showResults = true; this.openaireResults = []; this.openaireResultsStatus = this.errorCodes.LOADING; this.prevFilters = this.filters; //searchProjects (params: string, refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any { - this.sub = this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe( + this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, (page == 1) ? this.refineFieldsQuery : null, (page == 1) ? this.refineFields : [], this.createOpenaireRefineQuery()).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) { - this.openaireResultsPage=page; - this.openaireResultsNum = data[0]; - this.openaireResults =ClaimProjectsSearchFormComponent.openaire2ClaimEntity(data[1], this.properties); - if(data[2] && data[2].length > 0){ - this.filters = this.checkSelectedFilters( data[2], this.prevFilters); - } - - this.openaireResultsStatus = this.errorCodes.DONE; - if(this.openaireResultsNum == 0){ - this.openaireResultsStatus = this.errorCodes.NONE; - this.filters = this.checkSelectedFilters( [], this.prevFilters); - } - }else { - this.openaireResultsStatus = this.errorCodes.ERROR; + if (data != null) { + this.openaireResultsPage = page; + this.openaireResultsNum = data[0]; + this.openaireResults = ClaimProjectsSearchFormComponent.openaire2ClaimEntity(data[1], this.properties); + if (data[2] && data[2].length > 0) { + this.filters = this.checkSelectedFilters(data[2], this.prevFilters); } - }, + + this.openaireResultsStatus = this.errorCodes.DONE; + if (this.openaireResultsNum == 0) { + this.openaireResultsStatus = this.errorCodes.NONE; + this.filters = this.checkSelectedFilters([], this.prevFilters); + } + } else { + this.openaireResultsStatus = this.errorCodes.ERROR; + } + }, err => { this.openaireResultsStatus = this.errorCodes.ERROR; //console.log(err.status); @@ -177,9 +178,10 @@ export class ClaimProjectsSearchFormComponent { const entity: ClaimEntity = new ClaimEntity(); entity.project = new ClaimProject(); entity.project.funderId = item.funderId; - entity.project.funderName = item.funderShortname; + entity.project.funderShortname = item.funderShortname?item.funderShortname:(entity.project.funderId.split("::")[1]); + entity.project.funderName = item.funderName; entity.id = item.id; - entity.project.url = properties.searchLinkToProject + entity.id; + entity.project.url = (item.code !="unidentified") ? properties.searchLinkToProject + entity.id : null; entity.title = item.title.name; entity.project.acronym = item.acronym; entity.project.startDate = item.startYear; @@ -202,12 +204,16 @@ export class ClaimProjectsSearchFormComponent { } - createOpenaireQueryParams():string { + createOpenaireQueryParams(): string { let query = ""; - if(this.keyword.length > 0){ - query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword)); + if (this.keyword.length > 0) { + // query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword)); + query += StringUtils.quote(StringUtils.URIEncode(this.keyword)); } + return query; + } + createOpenaireRefineQuery(): string { /*if(this.startYear.length > 0 ){ query+='&fq=projectstartyear exact \"'+this.startYear+'\"' } @@ -215,30 +221,30 @@ export class ClaimProjectsSearchFormComponent { query+='&fq=projectendyear exact \"'+this.endYear+'\"' }*/ let allFqs = ""; - for (let filter of this.filters){ - if(filter.countSelectedValues > 0){ - let count_selected=0; + for (let filter of this.filters) { + if (filter.countSelectedValues > 0) { + let count_selected = 0; let fq = ""; - for (let value of filter.values){ - if(value.selected == true){ + for (let value of filter.values) { + if (value.selected == true) { count_selected++; - fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + (StringUtils.quote(value.id)); + fq += (fq.length > 0 ? " " + filter.filterOperator + " " : "") + filter.filterId + " exact " + (StringUtils.quote(value.id)); } } - if(count_selected > 0){ - fq="&fq="+StringUtils.URIEncode(fq); + if (count_selected > 0) { + fq = "&fq=" + StringUtils.URIEncode(fq); allFqs += fq; } } } - for (let i=0; i=" ,"<=", "and" ) + allFqs += NewSearchPageComponent.createRangeFilterQuery(this.rangeFields[i], filter.selectedFromValue, filter.selectedToValue, " within ", ">=", "<=", "and") } - return query+allFqs; - + return allFqs + "&type=projects"; } + public yearChanged() { this.search(this.page, this.size); @@ -273,20 +279,21 @@ export class ClaimProjectsSearchFormComponent { } } - + filter.countAllValues = filter.values.length; } if(filters.length == 0 ){ - for(let j=0; j< prevFilters.length ; j++){ - let filter = Object.assign({}, prevFilters[j]); - filter.values = []; - for(let filterValue of prevFilters[j].values) { - if(filterValue.selected){ - filterValue.number = 0; - filter.values.push(filterValue); - } - } - filters.push(filter) + for(let j=0; j< prevFilters.length ; j++) { + let filter = Object.assign({}, prevFilters[j]); + filter.values = []; + for (let filterValue of prevFilters[j].values) { + if (filterValue.selected) { + filterValue.number = 0; + filter.values.push(filterValue); } + } + filter.countAllValues = filter.values.length; + filters.push(filter) + } } return filters; } diff --git a/claims/directLinking/directLinking.component.ts b/claims/directLinking/directLinking.component.ts index 3fcd7537..70d46032 100644 --- a/claims/directLinking/directLinking.component.ts +++ b/claims/directLinking/directLinking.component.ts @@ -156,6 +156,7 @@ export class DirectLinkingComponent { entity.project.code = project.code; entity.project.endDate = project.endDate; entity.project.funderId = project.funderId; + entity.project.funderShortname = project.funderShortName?project.funderShortName:(entity.project.funderId.split("::")[1]); entity.project.funderName = project.funderName; entity.project.fundingLevel0 = project.fundingLevel0; entity.project.jurisdiction = project.jurisdiction; diff --git a/claims/linking/insertClaim/insertClaim.component.ts b/claims/linking/insertClaim/insertClaim.component.ts index 05615ba9..0cf983e5 100644 --- a/claims/linking/insertClaim/insertClaim.component.ts +++ b/claims/linking/insertClaim/insertClaim.component.ts @@ -508,7 +508,7 @@ export class ClaimInsertComponent { entity["linksToProjects"] = []; } let project: ClaimEntity = results[i]; - entity["linksToProjects"].push("info:eu-repo/grantAgreement/" + project.project.funderName + "/" + project.project.fundingLevel0 + "/" + project.project.code + "/" + project.project.jurisdiction + "/" + project.title + "/" + project.project.acronym); + entity["linksToProjects"].push("info:eu-repo/grantAgreement/" + project.project.funderShortname + "/" + project.project.fundingLevel0 + "/" + project.project.code + "/" + project.project.jurisdiction + "/" + project.title + "/" + project.project.acronym); } else if (results[i].context) { diff --git a/claims/linking/selected/ClaimEntityProjectMetadata.component.ts b/claims/linking/selected/ClaimEntityProjectMetadata.component.ts index 0b90acc6..229ebeca 100644 --- a/claims/linking/selected/ClaimEntityProjectMetadata.component.ts +++ b/claims/linking/selected/ClaimEntityProjectMetadata.component.ts @@ -16,10 +16,10 @@ import {ClaimEntity} from '../../claim-utils/claimHelper.class';
-
- Funder: {{entity.project.funderName}} +
+ Funder: {{entity.project.funderName?entity.project.funderName:entity.project.funderShortname}}
-
+
Project Code: {{entity.project.code}}
diff --git a/fos/fos.component.html b/fos/fos.component.html index 5121aa2f..1d0c8bf5 100644 --- a/fos/fos.component.html +++ b/fos/fos.component.html @@ -32,7 +32,7 @@
- + FoS logo
diff --git a/landingPages/landing-utils/entity-metadata.component.ts b/landingPages/landing-utils/entity-metadata.component.ts index 0378f127..d27eb26e 100644 --- a/landingPages/landing-utils/entity-metadata.component.ts +++ b/landingPages/landing-utils/entity-metadata.component.ts @@ -89,7 +89,7 @@ import {RouterHelper} from "../../utils/routerHelper.class"; - {{status}} + {{status}} (M{{calcCurrentMonth}}) {{date | date: 'dd MMM yyyy': 'UTC'}} @@ -295,7 +295,7 @@ export class EntityMetadataComponent { return this.projects.map(project => { let value = project.funderShortname ? project.funderShortname : project.funderName; if (project.acronym || project.title) { - value = value + ' | ' + (project.acronym ? project.acronym : + value = (value ? value + ' | ' : '') + (project.acronym ? project.acronym : (project.title.length > 25 ? (project.title.slice(0, 25) + '...'): project.title)); } // if(project.code) { @@ -364,4 +364,18 @@ export class EntityMetadataComponent { this.projectsModal.open(); } } + + public get calcCurrentMonth() { + let currentDate = new Date(this.currentDate); + let startDate = new Date(this.startDate); + + var months; + months = (currentDate.getFullYear() - startDate.getFullYear()) * 12; + months -= startDate.getMonth(); + months += currentDate.getMonth(); + if(startDate.getDate() > currentDate.getDate()) { + months--; + } + return months <= 0 ? 0 : months+1; + } } \ No newline at end of file diff --git a/landingPages/landing-utils/landing.module.ts b/landingPages/landing-utils/landing.module.ts index 3eedae91..d97b32a0 100644 --- a/landingPages/landing-utils/landing.module.ts +++ b/landingPages/landing-utils/landing.module.ts @@ -5,7 +5,6 @@ import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; -import {TabPagingComponent} from './tabPaging.component'; import {ShowTitleComponent} from './showTitle.component'; import {AddThisComponent} from './addThis.component'; @@ -14,11 +13,11 @@ import {AddThisComponent} from './addThis.component'; CommonModule, FormsModule, RouterModule ], declarations: [ - TabPagingComponent, ShowTitleComponent, AddThisComponent + ShowTitleComponent, AddThisComponent ], providers:[], exports: [ - TabPagingComponent, ShowTitleComponent, AddThisComponent + ShowTitleComponent, AddThisComponent ] }) export class LandingModule { } diff --git a/landingPages/landing-utils/tabPaging.component.ts b/landingPages/landing-utils/tabPaging.component.ts deleted file mode 100644 index 1eb6bd08..00000000 --- a/landingPages/landing-utils/tabPaging.component.ts +++ /dev/null @@ -1,24 +0,0 @@ -import {Component, Input, Output, EventEmitter} from '@angular/core'; - -@Component({ - selector: 'tabPaging', - template: ` - - ` - }) - -export class TabPagingComponent { - @Input() showAll: boolean; - @Input() length: number; - @Output() changeShowAll: EventEmitter = new EventEmitter(); - - constructor () { - } - - ngOnInit() { - } -} diff --git a/landingPages/organization/deletedByInference/deletedByInference.module.ts b/landingPages/organization/deletedByInference/deletedByInference.module.ts index c327c902..eb09712b 100644 --- a/landingPages/organization/deletedByInference/deletedByInference.module.ts +++ b/landingPages/organization/deletedByInference/deletedByInference.module.ts @@ -18,7 +18,7 @@ import {ResultPreviewModule} from "../../../utils/result-preview/result-preview. @NgModule({ imports: [ CommonModule, FormsModule, ResultLandingUtilsModule, - PagingModule, ErrorMessagesModule, ShowAuthorsModule, LandingModule, NoLoadPaging, ResultPreviewModule + PagingModule, ErrorMessagesModule, ShowAuthorsModule, NoLoadPaging, ResultPreviewModule ], declarations: [ OrganizationsDeletedByInferenceComponent diff --git a/landingPages/result/deletedByInference/deletedByInference.service.ts b/landingPages/result/deletedByInference/deletedByInference.service.ts index 5b812e8f..f3b3754c 100644 --- a/landingPages/result/deletedByInference/deletedByInference.service.ts +++ b/landingPages/result/deletedByInference/deletedByInference.service.ts @@ -145,8 +145,7 @@ export class DeletedByInferenceService { if(author.orcid_pending) { author.orcid_pending = author.orcid_pending.toUpperCase(); } - - if(result['authors'][author.rank] && results['authors'][author.rank].fullName == author.content) { + if(result['authors'][author.rank] && result['authors'][author.rank].fullName == author.content) { if(!author.orcid && result['authors'][author.rank].orcid) { author.orcid = result['authors'][author.rank].orcid; } else if(!author.orcid_pending && result['authors'][author.rank].orcid_pending) { diff --git a/landingPages/result/resultLanding.module.ts b/landingPages/result/resultLanding.module.ts index 2d7dfc11..d1792e55 100644 --- a/landingPages/result/resultLanding.module.ts +++ b/landingPages/result/resultLanding.module.ts @@ -38,6 +38,7 @@ import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; import {ResultLandingRoutingModule} from "./resultLanding-routing.module"; import {OrcidCoreModule} from "../../orcid/orcid-core.module"; +import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module"; @NgModule({ imports: [ diff --git a/monitor-admin/general/edit-stakeholder/edit-stakeholder.component.ts b/monitor-admin/general/edit-stakeholder/edit-stakeholder.component.ts index 72be3c8a..05eafbd5 100644 --- a/monitor-admin/general/edit-stakeholder/edit-stakeholder.component.ts +++ b/monitor-admin/general/edit-stakeholder/edit-stakeholder.component.ts @@ -20,7 +20,7 @@ import {StakeholderBaseComponent} from "../../utils/stakeholder-base.component"; template: `
-
+
@@ -126,6 +126,19 @@ import {StakeholderBaseComponent} from "../../utils/stakeholder-base.component";
+
+
Instance Type
+
+ + +
+
{ this.user = user; if (this.isCurator) { @@ -220,6 +235,7 @@ export class EditStakeholderComponent extends StakeholderBaseComponent { funderType: this.fb.control(this.stakeholder.funderType), topics: this.fb.control(this.stakeholder.topics), isUpload: this.fb.control(this.stakeholder.isUpload), + copy: this.fb.control(this.stakeholder.copy), logoUrl: this.fb.control(this.stakeholder.logoUrl), }); if (this.stakeholder.isUpload) { @@ -246,7 +262,7 @@ export class EditStakeholderComponent extends StakeholderBaseComponent { this.subscriptions.push(this.stakeholderFb.get('type').valueChanges.subscribe(value => { this.onTypeChange(value, defaultStakeholders); })); - this.stakeholderFb.setControl('defaultId', this.fb.control(stakeholder.defaultId, (this.isDefault && !this.isNew) ? [] : Validators.required)); + this.stakeholderFb.setControl('defaultId', this.fb.control(this.stakeholder.defaultId, (this.isDefault && !this.isNew) ? [] : Validators.required)); if (!this.isNew) { this.notification = NotificationUtils.editStakeholder(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name); this.notify.reset(this.notification.message); @@ -304,6 +320,13 @@ export class EditStakeholderComponent extends StakeholderBaseComponent { return this.isNew && this.stakeholderFb.get('type').valid && !!this.defaultStakeholdersOptions; } + public get canChangeCopy(): boolean { + return this.isCurator && + !this.stakeholderFb.get('isDefault').getRawValue() && + this.stakeholderFb.get('defaultId').getRawValue() && + this.stakeholderFb.get('defaultId').getRawValue() !== '-1'; + } + reset() { this.uploadError = null; this.stakeholderFb = null; @@ -350,15 +373,15 @@ export class EditStakeholderComponent extends StakeholderBaseComponent { public saveStakeholder(callback: Function, errorCallback: Function = null) { if (this.isNew) { - let defaultStakeholder = this.defaultStakeholders.find(value => value._id === this.stakeholderFb.getRawValue().defaultId); - this.stakeholderFb.setValue(this.stakeholderUtils.createFunderFromDefaultProfile(this.stakeholderFb.getRawValue(), - (defaultStakeholder ? defaultStakeholder.topics : []), this.stakeholderFb.getRawValue().isDefault)); - this.removePhoto(); + let copyId = null; if (this.stakeholderFb.getRawValue().isDefault) { + copyId = this.stakeholderFb.getRawValue().defaultId !== '-1'?this.stakeholderFb.getRawValue().defaultId:null; this.stakeholderFb.get('defaultId').setValue(null); + this.stakeholderFb.removeControl('isDefault'); } + this.removePhoto(); this.subscriptions.push(this.stakeholderService.buildStakeholder(this.properties.monitorServiceAPIURL, - this.stakeholderFb.getRawValue()).subscribe(stakeholder => { + this.stakeholderFb.getRawValue(), copyId).subscribe(stakeholder => { this.notification.entity = stakeholder._id; this.notification.stakeholder = stakeholder.alias; this.notification.stakeholderType = stakeholder.type; @@ -375,7 +398,7 @@ export class EditStakeholderComponent extends StakeholderBaseComponent { this.loading = false; })); } else { - this.subscriptions.push(this.stakeholderService.saveElement(this.properties.monitorServiceAPIURL, this.stakeholderFb.getRawValue()).subscribe(stakeholder => { + this.subscriptions.push(this.stakeholderService.saveElement(this.properties.monitorServiceAPIURL, this.stakeholderFb.getRawValue(), [], this.isFull).subscribe(stakeholder => { this.notification.entity = stakeholder._id; this.notification.stakeholder = stakeholder.alias; this.notification.stakeholderType = stakeholder.type; diff --git a/monitor-admin/general/edit-stakeholder/edit-stakeholder.module.ts b/monitor-admin/general/edit-stakeholder/edit-stakeholder.module.ts index 0ebec4d3..5e325317 100644 --- a/monitor-admin/general/edit-stakeholder/edit-stakeholder.module.ts +++ b/monitor-admin/general/edit-stakeholder/edit-stakeholder.module.ts @@ -5,9 +5,10 @@ import {InputModule} from "../../../sharedComponents/input/input.module"; import {ReactiveFormsModule} from "@angular/forms"; import {IconsModule} from "../../../utils/icons/icons.module"; import {NotifyFormModule} from "../../../notifications/notify-form/notify-form.module"; +import {MatSlideToggleModule} from "@angular/material/slide-toggle"; @NgModule({ - imports: [CommonModule, InputModule, ReactiveFormsModule, IconsModule, NotifyFormModule], + imports: [CommonModule, InputModule, ReactiveFormsModule, IconsModule, NotifyFormModule, MatSlideToggleModule], declarations: [EditStakeholderComponent], exports: [EditStakeholderComponent] }) diff --git a/monitor-admin/general/general.component.ts b/monitor-admin/general/general.component.ts index fda34d94..2f28f504 100644 --- a/monitor-admin/general/general.component.ts +++ b/monitor-admin/general/general.component.ts @@ -48,7 +48,7 @@ export class GeneralComponent extends BaseComponent implements OnInit { } public reset() { - this.editStakeholderComponent.init(this.stakeholder, this.alias, this.defaultStakeholders, this.stakeholder.defaultId == null, false) + this.editStakeholderComponent.init(this.stakeholder, this.alias, this.defaultStakeholders, this.stakeholder.defaultId == null, false, true) } public save() { diff --git a/monitor-admin/manageStakeholders/manageStakeholders.component.html b/monitor-admin/manageStakeholders/manageStakeholders.component.html index a876d32a..c96d3f63 100644 --- a/monitor-admin/manageStakeholders/manageStakeholders.component.html +++ b/monitor-admin/manageStakeholders/manageStakeholders.component.html @@ -31,7 +31,7 @@
-
+

Profile Templates

-
+
@@ -59,7 +58,7 @@
-
+

Profiles

-
+
- @@ -17,25 +17,27 @@
-
+
{{numberSections.at(i).get('title').value}}
+ [attr.uk-sortable]="isEditable ? 'group: number': null" uk-grid>
- - + + + -
    @@ -79,7 +81,7 @@
-
+
-
+
@@ -106,9 +108,9 @@
-
+
- @@ -120,25 +122,27 @@
-
+
{{chartSections.at(i).get('title').value}}
+ [attr.uk-sortable]="isEditable ? 'group: chart': null" uk-grid>
- - + + + -
    @@ -214,7 +218,7 @@
-
+
-
+
@@ -272,7 +276,7 @@
-