...
This commit is contained in:
@@ -1 +1,3 @@
|
||||
<div class="delete icon-btn-sm" (click)="delete()" ></div>
|
||||
<div class="handover icon-btn-sm" (click)="openHandoutDialog()" matTooltip="Schlüsselübergaben" [matTooltipShowDelay]="600"></div>
|
||||
|
||||
<div class="delete icon-btn-sm" (click)="delete()" matTooltip="Löschen" [matTooltipShowDelay]="600"></div>
|
||||
@@ -1,8 +1,13 @@
|
||||
:host {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.handover {
|
||||
background-image: url('../../../../../assets/img/key_2.svg');
|
||||
}
|
||||
@@ -6,11 +6,13 @@ import { ApiService } from '../../../api.service';
|
||||
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { DeleteKeyComponent } from '../../../../modules/keys/components/delete-key/delete-key.component';
|
||||
import { HotToastService } from '@ngxpert/hot-toast';
|
||||
import { HandoverDialogComponent } from '../../../../modules/keys/components/handover-dialog/handover-dialog.component';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
|
||||
@Component({
|
||||
selector: 'app-ag-delete-key',
|
||||
standalone: true,
|
||||
imports: [MatDialogModule],
|
||||
imports: [MatDialogModule, MatTooltipModule],
|
||||
templateUrl: './ag-delete-key.component.html',
|
||||
styleUrl: './ag-delete-key.component.scss'
|
||||
})
|
||||
@@ -66,4 +68,20 @@ export class AgDeleteKeyComponent implements ICellRendererAngularComp {
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
openHandoutDialog() {
|
||||
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();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<div class="handover icon-btn-sm" (click)="openDialog()" matTooltip="Schlüsselübergaben" [matTooltipShowDelay]="600"></div>
|
||||
@@ -1,11 +0,0 @@
|
||||
:host {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.handover {
|
||||
background-image: url('../../../../../assets/img/key_2.svg');
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
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';
|
||||
import {MatTooltipModule} from '@angular/material/tooltip';
|
||||
|
||||
@Component({
|
||||
selector: 'app-ag-open-handout',
|
||||
standalone: true,
|
||||
imports: [MatDialogModule, MatTooltipModule],
|
||||
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();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,8 @@ export class HELPER {
|
||||
rowData: [],
|
||||
columnDefs: [],
|
||||
loading: true,
|
||||
loadingOverlayComponent: AgLoadingComponent
|
||||
loadingOverlayComponent: AgLoadingComponent,
|
||||
rowHeight: 54,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user