2019-04-25 16:04:54 +02:00
|
|
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|
|
|
import { DmpListingModel } from '../../../../core/model/dmp/dmp-listing';
|
2019-05-08 10:37:44 +02:00
|
|
|
import { MatDialog } from '@angular/material';
|
|
|
|
import { DmpInvitationDialogComponent } from '../../invitation/dmp-invitation.component';
|
|
|
|
import { Router } from '@angular/router';
|
2019-05-14 13:35:02 +02:00
|
|
|
import { ProjectListingModel } from '../../../../core/model/project/project-listing';
|
2019-04-25 16:04:54 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-dmp-listing-item-component',
|
|
|
|
templateUrl: './dmp-listing-item.component.html',
|
|
|
|
styleUrls: ['./dmp-listing-item.component.scss'],
|
|
|
|
})
|
|
|
|
export class DmpListingItemComponent implements OnInit {
|
|
|
|
|
|
|
|
@Input() dmp: DmpListingModel;
|
|
|
|
@Input() showDivider: boolean = true;
|
|
|
|
@Output() onClick: EventEmitter<DmpListingModel> = new EventEmitter();
|
|
|
|
|
2019-05-09 15:30:39 +02:00
|
|
|
isDraft: boolean;
|
|
|
|
|
2019-05-08 10:37:44 +02:00
|
|
|
constructor(private router: Router, private dialog: MatDialog) { }
|
2019-04-25 16:04:54 +02:00
|
|
|
|
|
|
|
ngOnInit() {
|
2019-05-09 15:30:39 +02:00
|
|
|
if (this.dmp.status == 0) { this.isDraft = true }
|
|
|
|
else { this.isDraft = false }
|
2019-04-25 16:04:54 +02:00
|
|
|
}
|
|
|
|
|
2019-05-08 10:37:44 +02:00
|
|
|
openShareDialog(rowId: any, rowName: any) {
|
|
|
|
const dialogRef = this.dialog.open(DmpInvitationDialogComponent, {
|
|
|
|
// height: '250px',
|
|
|
|
// width: '700px',
|
|
|
|
data: {
|
|
|
|
dmpId: rowId,
|
|
|
|
dmpName: rowName
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
addDataset(rowId: String) {
|
|
|
|
this.router.navigate(['/datasets/new/' + rowId]);
|
|
|
|
}
|
|
|
|
|
|
|
|
showDatasets(rowId: String, rowLabel: String) {
|
|
|
|
this.router.navigate(['/datasets/dmp/' + rowId, { dmpLabel: rowLabel }]);
|
|
|
|
}
|
|
|
|
|
|
|
|
viewVersions(rowId: String, rowLabel: String) {
|
|
|
|
this.router.navigate(['/plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } });
|
|
|
|
}
|
2019-05-14 13:35:02 +02:00
|
|
|
|
|
|
|
itemClicked() {
|
|
|
|
this.onClick.emit(this.dmp);
|
|
|
|
}
|
|
|
|
|
|
|
|
projectClicked(projectId: String) {
|
|
|
|
this.router.navigate(['/projects/edit/' + projectId]);
|
|
|
|
}
|
2019-04-25 16:04:54 +02:00
|
|
|
}
|