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';
|
2019-06-25 11:16:37 +02:00
|
|
|
import { DatasetStatus } from '../../../../core/common/enum/dataset-status';
|
2019-05-28 11:59:23 +02:00
|
|
|
|
|
|
|
@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-06-25 15:02:54 +02:00
|
|
|
@Input() isFinalized: boolean;
|
2019-05-28 11:59:23 +02:00
|
|
|
|
|
|
|
constructor(
|
|
|
|
private router: Router
|
|
|
|
) { }
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
}
|
|
|
|
|
|
|
|
datasetClicked(datasetId: String) {
|
2020-04-01 17:16:06 +02:00
|
|
|
this.router.navigate(this.isPublic ? ['/datasets/publicEdit/' + datasetId] : ['/datasets/edit/' + datasetId]);
|
2019-05-28 11:59:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
datasetsClicked(dmpId: String) {
|
|
|
|
this.router.navigate(['/datasets'], { queryParams: { dmpId: dmpId } });
|
|
|
|
}
|
|
|
|
|
|
|
|
isDraft(dataset: DatasetOverviewModel) {
|
2019-06-25 11:16:37 +02:00
|
|
|
if (dataset.status == DatasetStatus.Draft) { return true }
|
2019-05-28 11:59:23 +02:00
|
|
|
else { return false }
|
|
|
|
}
|
|
|
|
|
|
|
|
addDataset(rowId: String) {
|
|
|
|
this.router.navigate(['/datasets/new/' + rowId]);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|