import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { DmpListingModel } from '../../../../core/model/dmp/dmp-listing'; import { MatDialog } from '@angular/material'; import { DmpInvitationDialogComponent } from '../../invitation/dmp-invitation.component'; import { Router } from '@angular/router'; @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 = new EventEmitter(); isDraft: boolean; constructor(private router: Router, private dialog: MatDialog) { } ngOnInit() { if (this.dmp.status == 0) { this.isDraft = true } else { this.isDraft = false } } itemClicked() { this.onClick.emit(this.dmp); } 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 } }); } }