openaire-library/landingPages/dataProvider/datasourcesTab.component.ts

45 lines
1.6 KiB
TypeScript
Raw Normal View History

import {Component, Input} from '@angular/core';
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
import {ErrorCodes} from '../../utils/properties/errorCodes';
import{EnvProperties} from '../../utils/properties/env-properties';
@Component({
selector: 'datasourcesTab',
template: `
<errorMessages [status]="[fetchDataproviders.searchUtils.status]" [type]="'content providers'" tab_error_class=true></errorMessages>
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE">
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10">
<a [queryParams]="paramsForSearchLink"
routerLinkActive="router-link-active" [routerLink]="linkToSearchDataproviders" class="uk-button uk-button-text">
View all compatible results
</a>
</div>
<tab-result [(results)]="fetchDataproviders.results"
[(status)]= "fetchDataproviders.status"
type="dataprovider" urlParam="datasourceId"
lazy=false>
</tab-result>
</div>
`
})
export class DatasourcesTabComponent {
@Input() paramsForSearchLink = {};
@Input() fetchDataproviders : FetchDataproviders;
@Input() properties:EnvProperties ;
public linkToSearchDataproviders = "";
public errorCodes:ErrorCodes = new ErrorCodes();
constructor () {}
ngOnInit() {
this.linkToSearchDataproviders = this.properties.searchLinkToAdvancedDataProviders;
}
ngOnDestroy() {}
}