argos/dmp-frontend/src/app/ui/dmp/editor/datasets-tab/datasets-tab.component.ts

41 lines
974 B
TypeScript
Raw Normal View History

2019-05-28 11:59:23 +02:00
import { Component, OnInit, Input } from '@angular/core';
import { DmpEditorModel } from '../dmp-editor.model';
import { Router } from '@angular/router';
import { DatasetOverviewModel } from '../../../../core/model/dataset/dataset-overview';
@Component({
selector: 'app-datasets-tab',
templateUrl: './datasets-tab.component.html',
styleUrls: ['./datasets-tab.component.scss']
})
export class DatasetsTabComponent implements OnInit {
@Input() dmp: DmpEditorModel;
@Input() isPublic: boolean;
2019-05-28 11:59:23 +02:00
constructor(
private router: Router
) { }
ngOnInit() {
}
datasetClicked(datasetId: String) {
this.router.navigate(['/datasets/edit/' + datasetId]);
}
datasetsClicked(dmpId: String) {
this.router.navigate(['/datasets'], { queryParams: { dmpId: dmpId } });
}
isDraft(dataset: DatasetOverviewModel) {
if (dataset.status == 0) { return true }
else { return false }
}
addDataset(rowId: String) {
this.router.navigate(['/datasets/new/' + rowId]);
}
}