Lost Keys
This commit is contained in:
@@ -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>
|
||||
@@ -5,7 +5,7 @@
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
gap: 12px;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.handover {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user