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;
|
2019-06-07 17:21:09 +02:00
|
|
|
@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]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|