Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
|
|
|
import {Title, Meta} from '@angular/platform-browser';
|
|
|
|
import {Observable} from 'rxjs/Observable';
|
|
|
|
|
|
|
|
import {EnvProperties} from '../../utils/properties/env-properties';
|
|
|
|
|
|
|
|
import {ClaimProject, ClaimResult} from '../claim-utils/claimEntities.class';
|
|
|
|
|
|
|
|
import {EntitiesSearchService} from '../../utils/entitiesAutoComplete/entitySearch.service';
|
|
|
|
import {SearchPublicationsService} from '../../services/searchPublications.service';
|
|
|
|
import {SearchDatasetsService} from '../../services/searchDatasets.service';
|
2018-02-05 14:14:59 +01:00
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
declare var UIkit:any;
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'linking-generic',
|
|
|
|
templateUrl: 'linkingGeneric.component.html'
|
|
|
|
|
|
|
|
})
|
|
|
|
export class LinkingGenericComponent {
|
|
|
|
|
|
|
|
@Input() bulkMode: boolean = false;
|
2018-07-06 15:35:03 +02:00
|
|
|
@Input() communityId:string= null;
|
2017-12-19 13:53:46 +01:00
|
|
|
sourceType:string;
|
|
|
|
targetType:string;
|
|
|
|
step:number = 1;
|
|
|
|
contexts=[];
|
|
|
|
projects=[];
|
|
|
|
results = [];
|
|
|
|
show = "project";
|
|
|
|
date='8-6-2016';
|
|
|
|
keyword: string = "";
|
|
|
|
linkType:string ="project"; // link type (selected in home page) : project, context, software, etc
|
|
|
|
/* url Parameters for inline linking */
|
|
|
|
id:string = null; //entity id
|
|
|
|
type:string = null; // entity type (publication or research data)
|
|
|
|
linkTo:string = null; // entity type (project or context or result)
|
|
|
|
|
|
|
|
entityTypes=["dataset", "publication", "project","context"];
|
|
|
|
inlineResult:ClaimResult =null;
|
|
|
|
sub:any =null;
|
2018-02-05 14:14:59 +01:00
|
|
|
properties:EnvProperties;
|
2018-07-25 15:56:02 +02:00
|
|
|
localStoragePrefix:string = "linking_";
|
2018-02-05 14:14:59 +01:00
|
|
|
|
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
|
|
|
constructor (private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
|
|
|
|
private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService,
|
2018-07-25 15:56:02 +02:00
|
|
|
private _meta: Meta, private _title: Title ) {
|
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
|
|
|
|
|
|
|
var title = "OpenAIRE | Linking";
|
|
|
|
this._meta.updateTag({content:title},"property='og:title'");
|
|
|
|
this._title.setTitle(title);
|
2018-07-25 15:56:02 +02:00
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
ngOnInit() {
|
2018-02-05 14:14:59 +01:00
|
|
|
this.route.data
|
|
|
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
|
|
|
this.properties = data.envSpecific;
|
|
|
|
|
|
|
|
});
|
2017-12-19 13:53:46 +01:00
|
|
|
if( typeof localStorage !== 'undefined') {
|
2018-07-25 15:56:02 +02:00
|
|
|
if(localStorage.getItem(this.localStoragePrefix + "projects")){
|
|
|
|
this.projects = JSON.parse(localStorage.getItem(this.localStoragePrefix + "projects"));
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
}
|
2018-07-25 15:56:02 +02:00
|
|
|
if(localStorage.getItem(this.localStoragePrefix + "contexts")){
|
|
|
|
this.contexts = JSON.parse(localStorage.getItem(this.localStoragePrefix + "contexts"));
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2018-07-25 15:56:02 +02:00
|
|
|
if(localStorage.getItem(this.localStoragePrefix + "results")){
|
|
|
|
this.results = JSON.parse(localStorage.getItem(this.localStoragePrefix + "results"));
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
next(){
|
|
|
|
|
|
|
|
if((this.show == 'result' && this.keyword == '')||(this.show == 'dataset' || this.show == 'publication')){
|
|
|
|
this.show='claim';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
prev(){
|
|
|
|
if(this.show == 'claim'){
|
|
|
|
this.show='result';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
resultsChange($event) {
|
|
|
|
this.results=$event.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
projectsChange($event) {
|
|
|
|
this.projects=$event.value;
|
|
|
|
}
|
|
|
|
|
|
|
|
linkTypeChange($event) {
|
|
|
|
|
|
|
|
this.linkType =$event.value;
|
|
|
|
this.show="result";
|
|
|
|
if(this.bulkMode){
|
|
|
|
this.show="claim";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
showChange($event) {
|
|
|
|
this.show=$event.value;
|
|
|
|
this.showChangedType($event.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
showChangedType(type:string) {
|
|
|
|
this.show=type;
|
|
|
|
if(this.show == 'project' || this.show == 'context' || this.show == 'software'){
|
|
|
|
this.linkType = this.show;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
canProceedToMetadata(){
|
|
|
|
if(this.results.length == 0){
|
|
|
|
|
|
|
|
UIkit.notification({
|
|
|
|
message : 'No research results selected!<br>Please select research results to link with projects and/ or ommunities.',
|
|
|
|
status : 'warning',
|
|
|
|
timeout : 1000,
|
|
|
|
pos : 'top-center'
|
|
|
|
});
|
|
|
|
}else{
|
|
|
|
this.show = 'claim';
|
|
|
|
this.step = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|