From 91c6b0ed47f8c8830c9d25178bb7b7d741fec88b Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Tue, 21 Feb 2017 15:52:31 +0000 Subject: [PATCH] Enable bulk claiming, insert/delete of claims | improve layout in linking git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@45975 d315682c-612b-4755-9ff5-7f18f6832af3 --- portal-2/src/app/app-routing.module.ts | 9 +++- .../displayClaims/displayClaims.component.ts | 6 +-- .../claimEntityFormatter.module.ts | 5 +- .../projectTitleFormatter.component.ts | 4 +- .../publicationTitleFormatter.component.ts | 2 +- .../linking/bulkClaim/bulkClaim.component.ts | 49 ++++++++++--------- .../linking/bulkLinking-routing.module.ts | 14 ++++++ .../app/claims/linking/bulkLinking.module.ts | 20 ++++++++ .../insertClaim/insertClaim.component.ts | 2 +- .../linking/linkingGeneric.component.ts | 48 ++++++++---------- .../claims/linking/linkingHome.component.ts | 47 +++++++++--------- .../selected/selectedContexts.component.ts | 2 +- .../selected/selectedDatasets.component.ts | 2 +- .../selected/selectedProjects.component.ts | 2 +- .../selectedPublications.component.ts | 46 ++++++++++------- .../simple/searchPublications.component.ts | 2 +- .../services/searchPublications.service.ts | 8 +-- .../navigationBar.component.ts | 12 +++++ .../fetchPublications.class.ts | 2 +- 19 files changed, 172 insertions(+), 110 deletions(-) create mode 100644 portal-2/src/app/claims/linking/bulkLinking-routing.module.ts create mode 100644 portal-2/src/app/claims/linking/bulkLinking.module.ts diff --git a/portal-2/src/app/app-routing.module.ts b/portal-2/src/app/app-routing.module.ts index df9cbd5f..ce5419e6 100644 --- a/portal-2/src/app/app-routing.module.ts +++ b/portal-2/src/app/app-routing.module.ts @@ -119,6 +119,10 @@ export function getLinkingModule() { return System.import('./claims/linking/linking.module' + (process.env.AOT ? '.ngfactory' : '')) .then(mod => mod[(process.env.AOT ? 'LinkingModuleNgFactory' : 'LinkingModule')]); } +export function getBulkLinkingModule() { + return System.import('./claims/linking/bulkLinking.module' + (process.env.AOT ? '.ngfactory' : '')) + .then(mod => mod[(process.env.AOT ? 'BulkLinkingModuleNgFactory' : 'BulkLinkingModule')]); +} @NgModule({ imports: [ RouterModule.forChild([ @@ -151,7 +155,10 @@ export function getLinkingModule() { { path: 'project-report', loadChildren: gethtmlProjectReportModule }, { path: 'myclaims', loadChildren: getMyClaimsModule }, { path: 'claims', loadChildren: getClaimsAdminModule }, - { path: 'linking', loadChildren: getLinkingModule } + { path: 'bulk-linking', loadChildren: getBulkLinkingModule }, + { path: 'linking', loadChildren: getLinkingModule }, + + diff --git a/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.component.ts b/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.component.ts index b7a78410..5ca26bf6 100644 --- a/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.component.ts +++ b/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.component.ts @@ -423,12 +423,12 @@ export class DisplayClaimsComponent { deleteById(id:string){ - console.warn("Deleting claim with id:"+id); + console.log("Deleting claim with id:"+id); // this._claimService.deleteClaimById(id); this._claimService.deleteClaimById(id).subscribe( res => { - console.info('Delete response'+res.code ); - console.warn("Deleted claim with id:"+ id); + console.log('Delete response'+res.code ); + console.log("Deleted claim with id:"+ id); //remove this claim from the let newClaims=this.claims; for (var _i = 0; _i < this.claims.length; _i++) { diff --git a/portal-2/src/app/claims/claim-utils/entityFormatter/claimEntityFormatter.module.ts b/portal-2/src/app/claims/claim-utils/entityFormatter/claimEntityFormatter.module.ts index 3053559e..01a1d0ac 100644 --- a/portal-2/src/app/claims/claim-utils/entityFormatter/claimEntityFormatter.module.ts +++ b/portal-2/src/app/claims/claim-utils/entityFormatter/claimEntityFormatter.module.ts @@ -1,14 +1,15 @@ import { NgModule} from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; - +import { RouterModule } from '@angular/router'; + import {ProjectTitleFormatter} from './projectTitleFormatter.component'; import {PublicationTitleFormatter} from './publicationTitleFormatter.component'; import {ClaimEntityFormatter} from './claimEntityFormatter.component'; @NgModule({ imports: [ - CommonModule + CommonModule, RouterModule ], declarations: [ ProjectTitleFormatter, PublicationTitleFormatter, ClaimEntityFormatter diff --git a/portal-2/src/app/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts b/portal-2/src/app/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts index 77f8e38f..a6c56ba6 100644 --- a/portal-2/src/app/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts +++ b/portal-2/src/app/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts @@ -1,5 +1,6 @@ import {Component, Input} from '@angular/core'; import {OpenaireProperties} from '../../../utils/properties/openaireProperties'; +import {RouterHelper} from '../../../utils/routerHelper.class'; //Usage Example " " @@ -7,7 +8,7 @@ import {OpenaireProperties} from '../../../utils/properties/openaireProperties'; selector: 'project-title', template: `
-
{{project['name']}} ({{project['funderName']}})
+
{{project['name']}} ({{project['funderName']}})
` }) @@ -15,6 +16,7 @@ import {OpenaireProperties} from '../../../utils/properties/openaireProperties'; export class ProjectTitleFormatter { @Input() project: string[]; public url:string; + public routerHelper:RouterHelper = new RouterHelper(); constructor () {} ngOnInit() { diff --git a/portal-2/src/app/claims/claim-utils/entityFormatter/publicationTitleFormatter.component.ts b/portal-2/src/app/claims/claim-utils/entityFormatter/publicationTitleFormatter.component.ts index 2c87c50a..f02d2226 100644 --- a/portal-2/src/app/claims/claim-utils/entityFormatter/publicationTitleFormatter.component.ts +++ b/portal-2/src/app/claims/claim-utils/entityFormatter/publicationTitleFormatter.component.ts @@ -6,7 +6,7 @@ import {Component, Input} from '@angular/core'; selector: 'publication-title', template: `
-
{{title}}
+
{{title}}
{{title}}
` diff --git a/portal-2/src/app/claims/linking/bulkClaim/bulkClaim.component.ts b/portal-2/src/app/claims/linking/bulkClaim/bulkClaim.component.ts index c312e7a7..e820374c 100644 --- a/portal-2/src/app/claims/linking/bulkClaim/bulkClaim.component.ts +++ b/portal-2/src/app/claims/linking/bulkClaim/bulkClaim.component.ts @@ -8,37 +8,38 @@ import {Dates, DOI} from '../../../utils/string-utils.class'; @Component({ selector: 'bulk-claim', template: ` -
-
- + + -
-
- -
-
-
Upload a csv file containing DOIs. For each DOI found in file, metadata will be fetched from CrossRef. - Available results can be linked with the selected Projects and Contexts. - More information -
- CSV format: -
    -
  • The format of CSV file should be "DOI","ACCESS_MODE","DATE".
  • -
  • Access mode column should have values: "OPEN","CLOSED" or "EMBARGO".
  • -
  • Date column valid format is YYYY-MM-DD and is required when access mode has value EMBARGO.
  • -
  • In case access mode is not available default value is "OPEN".
  • -
-
-
-