Show results in Deposit Result Page (query for organization's name and url - query for data providers of this organization)
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@44274 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
8d34386a97
commit
f07a66d9bc
|
@ -47,7 +47,6 @@
|
|||
"bootstrap": "^4.0.0-alpha.4",
|
||||
"express": "^4.14.0",
|
||||
"methods": "~1.1.2",
|
||||
"ng2-webstorage": "^1.2.2",
|
||||
"preboot": "~4.5.2",
|
||||
"rxjs": "5.0.0-beta.12",
|
||||
"zone.js": "~0.6.25"
|
||||
|
|
|
@ -43,6 +43,7 @@ import {TestComponent} from './app/test/test.component';
|
|||
TestComponent
|
||||
],
|
||||
providers: [
|
||||
|
||||
]
|
||||
})
|
||||
export class MainModule {
|
||||
|
|
|
@ -44,6 +44,7 @@ import {TestComponent} from './app/test/test.component';
|
|||
TestComponent
|
||||
],
|
||||
providers: [
|
||||
|
||||
]
|
||||
})
|
||||
export class MainModule {
|
||||
|
|
|
@ -47,6 +47,7 @@ import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
|||
|
||||
export class DepositComponent {
|
||||
private keyword: string='';
|
||||
private organizationId: string='dedup_wf_001%3A%3A44cb3a714d104139c37beb7580070b96';
|
||||
private openAccess: string;
|
||||
private openAccessRepo: string;
|
||||
private fp7Guidlines: string;
|
||||
|
@ -55,6 +56,8 @@ export class DepositComponent {
|
|||
private helpdesk: string;
|
||||
|
||||
constructor (private _router: Router) {
|
||||
console.info("constructor deposit");
|
||||
|
||||
this.openAccess = OpenaireProperties.getOpenAccess();
|
||||
this.openAccessRepo = OpenaireProperties.getOpenAccessRepo();
|
||||
this.fp7Guidlines = OpenaireProperties.getFP7Guidlines();
|
||||
|
@ -65,7 +68,6 @@ export class DepositComponent {
|
|||
|
||||
keywordChanged() {
|
||||
console.info("keywordChanged: "+this.keyword);
|
||||
|
||||
this._router.navigate( ['deposit-results'] );//, {"name": this.keyword}] );
|
||||
this._router.navigate( ['deposit-results'], { queryParams: { "organizationId": this.organizationId } } );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ import { SearchDataprovidersComponent } from '../searchPages/searchDataproviders
|
|||
import { SearchDataprovidersService } from '../services/searchDataproviders.service';
|
||||
import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.component';
|
||||
|
||||
import {OrganizationService} from '../services/organization.service';
|
||||
|
||||
@Component({
|
||||
selector: 'depositResult',
|
||||
template: `
|
||||
|
@ -23,10 +25,7 @@ import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.c
|
|||
</a>
|
||||
<span *ngIf="organization['url']==''">{{organization['name']}}</span>
|
||||
</h2>
|
||||
<h2 *ngIf="organization == undefined && organizationId != undefined">
|
||||
<span>Data providers for institution with ID: </span>
|
||||
<a href="{{url}}">{{organizationId}}</a>
|
||||
</h2>
|
||||
|
||||
</div>
|
||||
|
||||
<div *ngIf="searchDataprovidersComponent.totalResults > 0">
|
||||
|
@ -37,6 +36,7 @@ import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.c
|
|||
</div>
|
||||
|
||||
<div *ngIf="searchDataprovidersComponent.totalResults == 0" class = "alert alert-warning">
|
||||
<div *ngIf="organization != undefined">
|
||||
No data providers found
|
||||
<span *ngIf="organization != undefined">
|
||||
for institution:
|
||||
|
@ -45,14 +45,12 @@ import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.c
|
|||
</a>
|
||||
<span *ngIf="organization['url']==''">{{organization['name']}}</span>
|
||||
</span>
|
||||
<span *ngIf="organization == undefined && organizationId != undefined">
|
||||
for institution with ID:
|
||||
<a href="{{url}}">
|
||||
<span>{{organizationId}}</span>
|
||||
</a>
|
||||
</span>
|
||||
.
|
||||
<br>
|
||||
</div>
|
||||
<div *ngIf="organization == undefined">
|
||||
No organization with ID: {{organizationId}} found.
|
||||
</div>
|
||||
|
||||
You can still deposit your publications and/or research data in
|
||||
<a href="{{zenodo}}">OpenAIRE's Zenodo catch-all repository </a>
|
||||
hosted by CERN.
|
||||
|
@ -62,10 +60,10 @@ import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.c
|
|||
})
|
||||
|
||||
export class DepositResultComponent {
|
||||
@Input() organization: {"name": string, "url": string};// = {"name": "NTUA", "url": OpenaireProperties.getsearchLinkToOrganization()+"dedup_wf_001%3A%3A44cb3a714d104139c37beb7580070b96"};
|
||||
@Input() organizationId: string;// = "dedup_wf_001%3A%3A44cb3a714d104139c37beb7580070b96";
|
||||
url: string;
|
||||
private organization: {"name": string, "url": string};
|
||||
private organizationId: string;
|
||||
|
||||
sub: any;
|
||||
subDataproviders: any;
|
||||
|
||||
private searchDataprovidersComponent : SearchDataprovidersComponent;
|
||||
|
@ -74,7 +72,8 @@ export class DepositResultComponent {
|
|||
private zenodo: string;
|
||||
|
||||
constructor (private route: ActivatedRoute,
|
||||
private _searchDataprovidersService: SearchDataprovidersService) {
|
||||
private _searchDataprovidersService: SearchDataprovidersService,
|
||||
private _organizationService: OrganizationService) {
|
||||
console.info("depositResult constructor");
|
||||
|
||||
this.zenodo = OpenaireProperties.getZenodoURL();
|
||||
|
@ -84,18 +83,21 @@ export class DepositResultComponent {
|
|||
ngOnInit() {
|
||||
console.info('depositResult init');
|
||||
|
||||
if(this.organizationId != undefined) {
|
||||
this.url = OpenaireProperties.getsearchLinkToOrganization()+this.organizationId;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.organizationId = params['organizationId'];
|
||||
console.info("Id is :"+this.organizationId);
|
||||
if(this.organizationId){
|
||||
this.getOrganizationInfo();
|
||||
}
|
||||
|
||||
this.subDataproviders = this.route.queryParams.subscribe(params => {
|
||||
this.searchDataproviders();
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.sub.unsubscribe();
|
||||
if(this.subDataproviders != undefined) {
|
||||
this.subDataproviders.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
private searchDataproviders() {
|
||||
if(this.organization != undefined) {
|
||||
|
@ -105,4 +107,21 @@ export class DepositResultComponent {
|
|||
}
|
||||
this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders();
|
||||
}
|
||||
|
||||
private getOrganizationInfo () {
|
||||
console.info("inside getOrganizationInfo of component");
|
||||
|
||||
this._organizationService.getOrganizationInfo(this.organizationId).subscribe(
|
||||
data => {
|
||||
this.organization = data.title;
|
||||
this.subDataproviders = this.route.queryParams.subscribe(params => {
|
||||
this.searchDataproviders();
|
||||
});
|
||||
},
|
||||
err => {
|
||||
console.error(err)
|
||||
console.info("error");
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ export class OrganizationComponent {
|
|||
if(this.organizationId){
|
||||
this.getOrganizationInfo();
|
||||
}else{
|
||||
this.warningMessage="No valid project id";
|
||||
this.warningMessage="No valid organization id";
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -63,7 +63,7 @@ export class OrganizationComponent {
|
|||
}
|
||||
|
||||
private getOrganizationInfo () {
|
||||
console.info("inside getProjectInfo of component");
|
||||
console.info("inside getOrganizationInfo of component");
|
||||
|
||||
this.warningMessage = '';
|
||||
this.errorMessage=""
|
||||
|
|
Loading…
Reference in New Issue