feat(user-update-form): erstellt, um Benutzer mit einem Pop-up nach dem Zeilen-Klick-Ereignis zu aktualisieren.
- integriert in die Benutzer-Seite anstelle der Benutzer-Zusammenfassung
This commit is contained in:
parent
76104b4976
commit
2b51fde1fe
@ -0,0 +1 @@
|
|||||||
|
<p>user-update-form works!</p>
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { UserUpdateFormComponent } from './user-update-form.component';
|
||||||
|
|
||||||
|
describe('UserUpdateFormComponent', () => {
|
||||||
|
let component: UserUpdateFormComponent;
|
||||||
|
let fixture: ComponentFixture<UserUpdateFormComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [UserUpdateFormComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(UserUpdateFormComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
import { Component, Inject } from '@angular/core';
|
||||||
|
import { User } from '../../../models/user-management.api.models';
|
||||||
|
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-user-update-form',
|
||||||
|
standalone: true,
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './user-update-form.component.html',
|
||||||
|
styleUrl: './user-update-form.component.scss'
|
||||||
|
})
|
||||||
|
export class UserUpdateFormComponent {
|
||||||
|
constructor(@Inject(MAT_DIALOG_DATA) data: User) {
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -10,10 +10,10 @@ import { User } from '../../models/user-management.api.models';
|
|||||||
import { firstValueFrom, forkJoin } from 'rxjs';
|
import { firstValueFrom, forkJoin } from 'rxjs';
|
||||||
import Swal from 'sweetalert2';
|
import Swal from 'sweetalert2';
|
||||||
import { env } from '../../../environments/environment'
|
import { env } from '../../../environments/environment'
|
||||||
|
|
||||||
import { UserSummaryComponent } from '../../components/summaries/user-summary/user-summary.component'
|
|
||||||
import { MatBottomSheet, MatBottomSheetModule } from '@angular/material/bottom-sheet';
|
import { MatBottomSheet, MatBottomSheetModule } from '@angular/material/bottom-sheet';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
|
import { UserUpdateFormComponent } from '../../components/forms/user-update-form/user-update-form.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@ -42,6 +42,8 @@ export class UserComponent extends BasePageComponent implements AfterViewInit {
|
|||||||
|
|
||||||
private _bottomSheet = inject(MatBottomSheet);
|
private _bottomSheet = inject(MatBottomSheet);
|
||||||
|
|
||||||
|
private readonly dialog: MatDialog = inject(MatDialog);
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
this.buttonVisibilityService.setVisibleOnly(this.refreshService, this.creationService, this.updateService)
|
this.buttonVisibilityService.setVisibleOnly(this.refreshService, this.creationService, this.updateService)
|
||||||
this.refreshService.removeAll()
|
this.refreshService.removeAll()
|
||||||
@ -69,7 +71,7 @@ export class UserComponent extends BasePageComponent implements AfterViewInit {
|
|||||||
if (this.sUsername != null) {
|
if (this.sUsername != null) {
|
||||||
this.groupTable.fetchDataByUsername(this.sUsername);
|
this.groupTable.fetchDataByUsername(this.sUsername);
|
||||||
this.moduleTable.fetchDataByUsername(this.sUsername)
|
this.moduleTable.fetchDataByUsername(this.sUsername)
|
||||||
this.openBottomSheet(rows[0].source);
|
this.openUpdateSheet(rows[0].source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -110,8 +112,9 @@ export class UserComponent extends BasePageComponent implements AfterViewInit {
|
|||||||
return env.columnNames.user.detailed
|
return env.columnNames.user.detailed
|
||||||
}
|
}
|
||||||
|
|
||||||
openBottomSheet(user: User): void {
|
openUpdateSheet(user: User): void {
|
||||||
this._bottomSheet.open(UserSummaryComponent, {
|
this.dialog.open(UserUpdateFormComponent, {
|
||||||
|
width: "50rem",
|
||||||
data: user
|
data: user
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user