Project

General

Profile

1
import {Component, Input} from '@angular/core';
2
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
3

    
4
import {ErrorCodes} from '../../utils/properties/errorCodes';
5
import{EnvProperties} from '../../utils/properties/env-properties';
6

    
7
@Component({
8
    selector: 'datasourcesTab',
9
    template: `
10
        <errorMessages [status]="[fetchDataproviders.searchUtils.status]" [type]="'content providers'" tab_error_class=true></errorMessages>
11

    
12
        <div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE">
13
            <div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10">
14
                <a  [queryParams]="paramsForSearchLink"
15
                    routerLinkActive="router-link-active" [routerLink]="linkToSearchDataproviders" class="uk-button uk-button-text">
16
                    View all {{fetchDataproviders.searchUtils.totalResults | number}} results
17
                </a>
18
            </div>
19
            <tab-result  [(results)]="fetchDataproviders.results"
20
                            [(status)]= "fetchDataproviders.status"
21
                            type="dataprovider" urlParam="datasourceId"
22
                            lazy=false>
23
            </tab-result>
24
        </div>
25
    `
26
})
27

    
28
export class DatasourcesTabComponent {
29

    
30
    @Input() paramsForSearchLink = {};
31
    @Input() fetchDataproviders : FetchDataproviders;
32
    @Input() properties:EnvProperties ;
33

    
34
    public linkToSearchDataproviders = "";
35
    public errorCodes:ErrorCodes = new ErrorCodes();
36

    
37
    constructor () {}
38

    
39
    ngOnInit() {
40
        this.linkToSearchDataproviders = this.properties.searchLinkToAdvancedDataProviders;
41
    }
42

    
43
    ngOnDestroy() {}
44
}
(7-7/13)