Handout management

This commit is contained in:
Bastian Wagner
2024-10-20 14:49:42 +02:00
parent 5e2b900b18
commit aa9abdd512
37 changed files with 754 additions and 67 deletions

View File

@@ -0,0 +1 @@
<div class="handover icon-btn-sm" (click)="openDialog()"></div>

View File

@@ -0,0 +1,11 @@
:host {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
height: 100%;
}
.handover {
background-image: url('../../../../../assets/img/handover.svg');
}

View File

@@ -0,0 +1,44 @@
import { Component, HostBinding, inject } from '@angular/core';
import { ICellRendererAngularComp } from 'ag-grid-angular';
import { ICellRendererParams } from 'ag-grid-community';
import { IKey } from '../../../../model/interface/key.interface';
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
import { HandoverDialogComponent } from '../../../../modules/keys/components/handover-dialog/handover-dialog.component';
@Component({
selector: 'app-ag-open-handout',
standalone: true,
imports: [MatDialogModule],
templateUrl: './ag-open-handout.component.html',
styleUrl: './ag-open-handout.component.scss'
})
export class AgOpenHandoutComponent implements ICellRendererAngularComp {
private dialog: MatDialog = inject(MatDialog);
key!: IKey;
params!: ICellRendererParams<any, any, any>;
agInit(params: ICellRendererParams<any, any, any>): void {
this.params = params;
this.key = params.data;
}
refresh(params: ICellRendererParams<any, any, any>): boolean {
return false;
}
openDialog() {
this.dialog.open(HandoverDialogComponent, {
data: this.key,
autoFocus: false,
maxWidth: '100vw',
maxHeight: '100vh'
}).afterClosed().subscribe({
next: n => {
if (n != null) {
this.key.handedOut = n;
this.params.api.refreshCells();
}
}
})
}
}