-
Tifenn Guillas authoredTifenn Guillas authored
dataset-card.component.ts 1.13 KiB
/**
* This file is part of Anis Client.
*
* @copyright Laboratoire d'Astrophysique de Marseille / CNRS
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
import { Router } from '@angular/router';
import { Survey, Dataset } from 'src/app/metamodel/models';
/**
* @class
* @classdesc Search dataset card component.
*/
@Component({
selector: 'app-dataset-card',
templateUrl: 'dataset-card.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DatasetCardComponent {
@Input() survey: Survey;
@Input() dataset: Dataset;
@Input() instanceSelected: string;
@Input() datasetSelected: string;
constructor(private router: Router) { }
/**
* Navigates to search form corresponding to the given dataset.
*
* @param {string} datasetName - The dataset name.
*/
selectDataset(datasetName: string): void {
this.router.navigate([`/instance/${this.instanceSelected}/search/dataset/${datasetName}`]);
}
}