refactor: Ändere die Variable sGroupId zu sGroup und passe die Methode groupsOnSelectedRows an, um das sGroup-Objekt zu verarbeiten.
This commit is contained in:
parent
91b78f4b59
commit
5f4a8e373c
@ -33,15 +33,15 @@ export class GroupComponent extends BasePageComponent implements AfterViewInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private sGroupId = null;
|
private sGroup: Group | null = null;
|
||||||
|
|
||||||
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()
|
||||||
this.refreshService.add(() => {
|
this.refreshService.add(() => {
|
||||||
this.groupTable.fetchData();
|
this.groupTable.fetchData();
|
||||||
if (this.sGroupId)
|
if (this.sGroup)
|
||||||
this.userTable.fetchDataByGroupId(this.sGroupId);
|
this.userTable.fetchDataByGroupId(this.sGroup.id!);
|
||||||
});
|
});
|
||||||
this.creationService.component = GroupFormComponent
|
this.creationService.component = GroupFormComponent
|
||||||
|
|
||||||
@ -53,9 +53,12 @@ export class GroupComponent extends BasePageComponent implements AfterViewInit {
|
|||||||
|
|
||||||
groupsOnSelectedRows = (rows: GuiSelectedRow[]) => {
|
groupsOnSelectedRows = (rows: GuiSelectedRow[]) => {
|
||||||
if (rows.length > 0) {
|
if (rows.length > 0) {
|
||||||
this.sGroupId = rows[0].source.id;
|
this.sGroup = rows[0].source;
|
||||||
if (this.sGroupId)
|
if (this.sGroup)
|
||||||
this.userTable.fetchDataByGroupId(this.sGroupId);
|
this.userTable.fetchDataByGroupId(this.sGroup.id!);
|
||||||
|
}
|
||||||
|
else if (rows.length == 0 && this.sGroup?.name != null) {
|
||||||
|
this.openUpdateSheet(this.sGroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,4 +98,12 @@ export class GroupComponent extends BasePageComponent implements AfterViewInit {
|
|||||||
get complete_group_cols() {
|
get complete_group_cols() {
|
||||||
return env.columnNames.group.complete
|
return env.columnNames.group.complete
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openUpdateSheet(user: Group): void {
|
||||||
|
/* this.dialog.open(UserUpdateFormComponent, {
|
||||||
|
width: "50rem",
|
||||||
|
data: user
|
||||||
|
}); */
|
||||||
|
alert(JSON.stringify(user))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -40,8 +40,6 @@ export class UserComponent extends BasePageComponent implements AfterViewInit {
|
|||||||
|
|
||||||
private sUser: any = null;
|
private sUser: any = null;
|
||||||
|
|
||||||
private _bottomSheet = inject(MatBottomSheet);
|
|
||||||
|
|
||||||
private readonly dialog: MatDialog = inject(MatDialog);
|
private readonly dialog: MatDialog = inject(MatDialog);
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user