diff --git a/src/app/claimPages/inlineClaimContext/inlineClaimContext.component.ts b/src/app/claimPages/inlineClaimContext/inlineClaimContext.component.ts index d4f7fc83..38672061 100644 --- a/src/app/claimPages/inlineClaimContext/inlineClaimContext.component.ts +++ b/src/app/claimPages/inlineClaimContext/inlineClaimContext.component.ts @@ -1,4 +1,4 @@ -import {Component, Input} from '@angular/core'; +import {Component, Input, ViewChild, Output, EventEmitter} from '@angular/core'; import {JSONP_PROVIDERS} from '@angular/http'; import {Observable} from 'rxjs/Observable'; import { RouteParams, RouteConfig, ROUTER_DIRECTIVES, Router } from '@angular/router-deprecated'; @@ -12,28 +12,21 @@ import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component template: ` +
+
+ -
-
Find Context:
-
- - + (showChange)="showChange($event)" [inlineEntity]="inlineEntity" inline="true" [inlineType]="inlineType" >
-
- - -
- + + +
+ +// +// ` +// +// }) +// export class InlineClaimContextComponent { +// constructor ( private _router: Router ) { +// +// } +// +// @Input() public inlineEntity:any; +// @Input() public inlineType:string; +// +// +// contexts=[]; +// publications; +// datasets; +// show = "context"; +// keyword: string = ""; +// +// ngOnInit() { +// +// } +// next(){ +// if(this.inlineType === 'dataset'){ +// this.datasets = []; +// this.datasets.push(this.inlineEntity[0]); +// }else if(this.inlineType === 'publication'){ +// this.publications = []; +// this.publications.push(this.inlineEntity[0]); +// console.info(" result: :targetId: " +this.publications[0].id + "targetType :"+ this.publications[0].type+" targetCollectedFrom:"+ this.publications[0].source+ "targetAccessRights :"+this.publications[0].accessRights+ " targetEmbargoEndDate:"+this.publications[0].embargoEndDate); +// } +// if( this.show == 'context'){ +// this.show='claim'; +// } +// } +// prev(){ +// if(this.show == 'claim'){ +// this.show = 'context'; +// } +// } +// +// +// contextsChange($event) { +// this.contexts=$event.value; +// console.log($event.value); +// } +// +// showChange($event) { +// this.show=$event.value; +// if(this.show == "end"){ +// this.contexts = []; +// this.show = "context"; +// } +// } +// +// } diff --git a/src/app/claimPages/inlineClaimProject/inlineClaimProject.component.ts b/src/app/claimPages/inlineClaimProject/inlineClaimProject.component.ts index 614ba41e..4eae8400 100644 --- a/src/app/claimPages/inlineClaimProject/inlineClaimProject.component.ts +++ b/src/app/claimPages/inlineClaimProject/inlineClaimProject.component.ts @@ -13,49 +13,48 @@ import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component
-
Search for Projects:
-
+
- - - + + +
- ` @@ -93,13 +92,13 @@ import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component this.publications.push(this.inlineEntity[0]); console.info(" result: :targetId: " +this.publications[0].id + "targetType :"+ this.publications[0].type+" targetCollectedFrom:"+ this.publications[0].source+ "targetAccessRights :"+this.publications[0].accessRights+ " targetEmbargoEndDate:"+this.publications[0].embargoEndDate); } - if( this.show == 'context'){ + if( this.show == 'project'){ this.show='claim'; } } prev(){ if(this.show == 'claim'){ - this.show = 'context'; + this.show = 'project'; } } diff --git a/src/app/claimPages/linking/claimContext/claimContext.component.ts b/src/app/claimPages/linking/claimContext/claimContext.component.ts index 7d94dadc..d54dd180 100644 --- a/src/app/claimPages/linking/claimContext/claimContext.component.ts +++ b/src/app/claimPages/linking/claimContext/claimContext.component.ts @@ -8,8 +8,9 @@ import {ContextsService} from '../../../services/contexts.service'; @Component({ selector: 'claim-contexts', template: ` -
-
+
+ +
+
+
+ + +
+
+ + +
+
+ +
+
+ + + + + +
  • @@ -54,6 +113,9 @@ export class ClaimContextComponent { this.getCommunities(); } +@Input() public inline= 'false' ; // for claimed started from landing pages +@Input() public showComponent= 'true' ; // for claimed started from landing pages + public query = ''; public filteredList = []; @Input() public selectedList ; diff --git a/src/app/claimPages/linking/claimProject/claimProject.component.ts b/src/app/claimPages/linking/claimProject/claimProject.component.ts index 2aa35619..c37caa55 100644 --- a/src/app/claimPages/linking/claimProject/claimProject.component.ts +++ b/src/app/claimPages/linking/claimProject/claimProject.component.ts @@ -8,17 +8,17 @@ import {Loading} from '../../../common/modal/loading.component'; @Component({ selector: 'claim-projects', template: ` -
    +
    -
    -
    -
    -
    - - - + + +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    +
      diff --git a/src/app/claimPages/linking/insertClaim/insertClaim.component.ts b/src/app/claimPages/linking/insertClaim/insertClaim.component.ts index 17ac74c8..db461a00 100644 --- a/src/app/claimPages/linking/insertClaim/insertClaim.component.ts +++ b/src/app/claimPages/linking/insertClaim/insertClaim.component.ts @@ -34,7 +34,7 @@ export class ClaimInsertComponent { @Input() public projects; @Input() public publications; @Input() public datasets; - @Input() public showButton:string = 'false'; + @Input() public showButton:string = 'true'; @Input() show='claim'; @Input() inline='false'; @Output() showChange = new EventEmitter(); @@ -54,7 +54,7 @@ insert(){ this.showError("There are no publications or datasets selected."); }else if((!this.contexts|| this.contexts.length==0 )&&(!this.projects|| this.projects.length==0 )){ this.showError("There are no projects or concepts to link."); - }else if((!this.publications|| this.publications.length==0 )&&(!this.datasets|| this.datasets.length==0 )){ + }else if((!this.publications|| this.publications.length==0 )&&(!this.datasets|| this.datasets.length==0 )){ this.showError("There are no publications or datasets to link."); }else{ this.loading.open(); diff --git a/src/app/landingPages/publication/publication.component.ts b/src/app/landingPages/publication/publication.component.ts index ecacbb0e..4552c46a 100644 --- a/src/app/landingPages/publication/publication.component.ts +++ b/src/app/landingPages/publication/publication.component.ts @@ -205,11 +205,11 @@ import { InlineClaimProjectComponent} from '../../claimPages/inlineClaimProject/ - Add more Projects +
    • - Add more Contexts +
    • @@ -234,17 +234,13 @@ export class PublicationComponent { this.params = _routeParams; } ngOnInit() { - console.info('publication init'); - // let result_ = {id: this.params.get("articleId"), type :"publication", source : "openaire", title:"lalalla",url: null, result: null, accessRights:"OPEN", embargoEndDate: null}; - // this.result.push(result_); - this.getPublicationInfo(); + this.getPublicationInfo(); } publicationInfo: PublicationInfo; params: RouteParams; -//AK - For the claims private result ; private claimInline:string = "none" ; @@ -253,22 +249,22 @@ export class PublicationComponent { getPublicationInfo() { - console.info("inside getPublicationInfo of component"); - this._publicationService.getPublicationInfo(this.params.get("articleId")).subscribe( data => { this.publicationInfo = data; - //AK - For the claims - this.result = [] + this.result = [] let result_ ={id: this.params.get("articleId"), type :"publication", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestlicense, embargoEndDate: ''}; this.result.push(result_); }, err => console.error(err) ); } + + /* + ********* Methods for Inline Claim of project / publication ***** + */ toggleClaimProject(){ - console.info("TOOGLE "); - this.inlineClaimProject.toggle(); + this.inlineClaimProject.toggle(); } projectAdded($event){ var projects =$event.value; @@ -279,21 +275,32 @@ export class PublicationComponent { this.publicationInfo.fundedByProjects = new Map(); } var project =projects[i]; - // this.publicationInfo.fundedByProjects.set(mydata.code, new Array()); - // this.publicationInfo.fundedByProjects.get(mydata.code)[0] = mydata.acronym; - // this.publicationInfo.fundedByProjects.get(mydata.code)[1] = mydata.title; - // var project= { funderId: this.selectedFunderId,funderName: this.selectedFunderName, projectId: item.field[0]['@value'], projectName: item.field[3]['@value'] , projectAcronym: item.field[1]['@value'] }; - this.publicationInfo.fundedByProjects.set(project.projectId, new Array()); this.publicationInfo.fundedByProjects.get(project.projectId)[0] = project.projectAcronym; this.publicationInfo.fundedByProjects.get(project.projectId)[1] = project.projectName; + this.publicationInfo.fundedByProjects.get(project.projectId)[2] =project.selectedFunderId; + this.publicationInfo.fundedByProjects.get(project.projectId)[3] = project.selectedFunderName; + } + } + } + toggleClaimContext(){ + this.inlineClaimContext.toggle(); + } + contextAdded($event){ + var contexts =$event.value; + if(contexts){ + for(var i=0; i < contexts.length; i++){ - // this.publicationInfo.fundedByProjects.get(mydata.code)[2] = mydata['funding']['funder'].shortname; - // this.publicationInfo.fundedByProjects.get(mydata.code)[3] = mydata['funding']['funder'].name; - this.publicationInfo.fundedByProjects.get(project.projectId)[2] =project.selectedFunderId; - this.publicationInfo.fundedByProjects.get(project.projectId)[3] = project.selectedFunderName; - + // if(this.publicationInfo.fundedByProjects == undefined) { + // this.publicationInfo.fundedByProjects = new Map(); + // } + // var context =contexts[i]; + // this.publicationInfo.fundedByProjects.set(project.projectId, new Array()); + // this.publicationInfo.fundedByProjects.get(project.projectId)[0] = project.projectAcronym; + // this.publicationInfo.fundedByProjects.get(project.projectId)[1] = project.projectName; + // this.publicationInfo.fundedByProjects.get(project.projectId)[2] =project.selectedFunderId; + // this.publicationInfo.fundedByProjects.get(project.projectId)[3] = project.selectedFunderName; + } + } } - } - } }