Revision 45683
Added by Argiro Kokogiannaki over 7 years ago
depositResult.component.ts | ||
---|---|---|
3 | 3 |
import {OpenaireProperties, ErrorCodes} from '../utils/properties/openaireProperties'; |
4 | 4 |
import { Router } from '@angular/router'; |
5 | 5 |
import { ActivatedRoute } from '@angular/router'; |
6 |
import { SearchDataprovidersComponent } from '../searchPages/simple/searchDataproviders.component';
|
|
6 |
import { FetchDataproviders } from '../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
|
7 | 7 |
import { SearchDataprovidersService } from '../services/searchDataproviders.service'; |
8 | 8 |
import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.component'; |
9 | 9 |
|
10 |
import {OrganizationService} from '../services/organization.service';
|
|
10 |
import {OrganizationService} from '../landingPages/organization/organization.service';
|
|
11 | 11 |
|
12 | 12 |
@Component({ |
13 | 13 |
selector: 'deposit-result', |
... | ... | |
17 | 17 |
<h2>Deposit {{requestFor}}</h2> |
18 | 18 |
</div> |
19 | 19 |
|
20 |
<div *ngIf="status == errorCodes.LOADING || (status == errorCodes.LOADING && searchDataprovidersComponent.searchUtils.status == errorCodes.LOADING)"
|
|
20 |
<div *ngIf="status == errorCodes.LOADING || (status == errorCodes.LOADING && fetchDataproviders.searchUtils.status == errorCodes.LOADING)"
|
|
21 | 21 |
class="uk-alert uk-alert-primary" role="alert"> |
22 | 22 |
Loading... |
23 | 23 |
</div> |
24 | 24 |
|
25 |
<div *ngIf="searchDataprovidersComponent.searchUtils.totalResults > 0">
|
|
25 |
<div *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
|
|
26 | 26 |
<h2 *ngIf="organization != undefined"> |
27 | 27 |
<span>Data providers for institution: </span> |
28 | 28 |
<a *ngIf="organization['url']!=''" href="{{organization.url}}" target="_blank"> |
... | ... | |
33 | 33 |
|
34 | 34 |
</div> |
35 | 35 |
|
36 |
<div *ngIf="searchDataprovidersComponent.searchUtils.totalResults > 0">
|
|
36 |
<div *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
|
|
37 | 37 |
<p>Please use the information/contacts shown below to deposit your {{requestFor}}.</p> |
38 | 38 |
<!--showDataProviders [dataProviders]=dataProviders></showDataProviders--> |
39 |
<div class = "uk-text-right" *ngIf = "searchDataprovidersComponent.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{searchDataprovidersComponent.searchUtils.totalResults}} results</a></div>
|
|
40 |
<!--search-result [(results)]="searchDataprovidersComponent.results" [(status)]= "searchDataprovidersComponent.searchUtils.status"></search-result-->
|
|
39 |
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div>
|
|
40 |
<!--search-result [(results)]="fetchDataproviders.results" [(status)]= "fetchDataproviders.searchUtils.status"></search-result-->
|
|
41 | 41 |
</div> |
42 | 42 |
|
43 |
<div *ngIf="(searchDataprovidersComponent.searchUtils.totalResults == 0 && status == errorCodes.DONE)
|
|
43 |
<div *ngIf="(fetchDataproviders.searchUtils.totalResults == 0 && status == errorCodes.DONE)
|
|
44 | 44 |
|| status == errorCodes.NONE || status == errorCodes.ERROR" class = "alert alert-warning"> |
45 | 45 |
<div *ngIf="organization != undefined"> |
46 | 46 |
No data providers found |
... | ... | |
82 | 82 |
sub: any; |
83 | 83 |
subDataproviders: any; |
84 | 84 |
|
85 |
public searchDataprovidersComponent : SearchDataprovidersComponent;
|
|
85 |
public fetchDataproviders : FetchDataproviders;
|
|
86 | 86 |
public linkToSearchDataproviders = ""; |
87 | 87 |
public zenodo: string; |
88 | 88 |
@Input() compatibility: string = ''; |
... | ... | |
95 | 95 |
console.info("depositResult constructor"); |
96 | 96 |
|
97 | 97 |
this.zenodo = OpenaireProperties.getZenodoURL(); |
98 |
this.searchDataprovidersComponent = new SearchDataprovidersComponent(this.route, this._searchDataprovidersService);
|
|
98 |
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
|
99 | 99 |
|
100 | 100 |
this.status = this.errorCodes.LOADING; |
101 | 101 |
console.info("loading"); |
... | ... | |
129 | 129 |
|
130 | 130 |
private searchDataproviders() { |
131 | 131 |
// if(this.organization != undefined) { |
132 |
// this.searchDataprovidersComponent.getResults(this.organization.name, false, 1, 10);
|
|
132 |
// this.fetchDataproviders.getResults(this.organization.name, false, 1, 10);
|
|
133 | 133 |
// } else if(this.organizationId != undefined) { |
134 |
this.searchDataprovidersComponent.getResultsForDeposit( this.organizationId,this.requestFor, 1, 10);
|
|
134 |
this.fetchDataproviders.getResultsForDeposit( this.organizationId,this.requestFor, 1, 10);
|
|
135 | 135 |
//} |
136 | 136 |
this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders(); |
137 | 137 |
} |
Also available in: Unified diff
Landing seems to work properly| working on deposit Pages