Lost Keys

This commit is contained in:
Bastian Wagner
2025-01-03 13:39:47 +01:00
parent c8c2ee18cb
commit 92f0c10bd8
35 changed files with 569 additions and 42 deletions

View File

@@ -1,3 +1,5 @@
<div class="handover icon-btn-sm" (click)="openHandoutDialog()" matTooltip="Schlüsselübergaben" [matTooltipShowDelay]="600"></div>
<div class="handover icon-btn-sm" (click)="openHandoutDialog()" matTooltip="Schlüsselübergaben" [matTooltipShowDelay]="400"></div>
<div class="delete icon-btn-sm" (click)="delete()" matTooltip="Löschen" [matTooltipShowDelay]="600"></div>
<div class="delete icon-btn-sm" (click)="delete()" matTooltip="Löschen" [matTooltipShowDelay]="400"></div>
<div class="magnifying-glass icon-btn-sm" (click)="openLostKeyDialog()" matTooltip="Verloren melden" [matTooltipShowDelay]="400"></div>

View File

@@ -5,7 +5,7 @@
justify-content: center;
width: 100%;
height: 100%;
gap: 12px;
gap: 6px;
}
.handover {

View File

@@ -8,6 +8,7 @@ import { DeleteKeyComponent } from '../../../../modules/keys/components/delete-k
import { HotToastService } from '@ngxpert/hot-toast';
import { HandoverDialogComponent } from '../../../../modules/keys/components/handover-dialog/handover-dialog.component';
import { MatTooltipModule } from '@angular/material/tooltip';
import { LostKeyComponent } from '../../../../modules/keys/components/lost-key/lost-key.component';
@Component({
selector: 'app-ag-delete-key',
@@ -86,4 +87,24 @@ export class AgDeleteKeyComponent implements ICellRendererAngularComp {
}
})
}
openLostKeyDialog() {
this.dialog.open(LostKeyComponent, {
data: this.key,
autoFocus: false,
maxWidth: '100vw',
maxHeight: '100vh'
}).afterClosed().subscribe({
next: n => {
if (n != null) {
if (n == "") {
n = null;
}
this.key.keyLost = n;
this.params.api.refreshCells();
this.api.updateKey(this.key).subscribe();
}
}
})
}
}

View File

@@ -30,6 +30,10 @@ export class ApiService {
return this.http.get<IKey[]>('api/key')
}
getLostKeys(): Observable<IKey[]> {
return this.http.get<IKey[]>('api/key/lost')
}
updateKey(key: IKey): Observable<IKey> {
return this.http.put<IKey>('api/key', key);
}