feat: RefreshService zu UserAssignmentComponent hinzugefügt und integriert.
This commit is contained in:
parent
f625edfab0
commit
277472636a
@ -1,4 +1,4 @@
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { AfterViewInit, Component, ViewChild } from '@angular/core';
|
||||
import { GroupTableComponent } from '../../components/tables/group-table/group-table.component';
|
||||
import { RefreshService } from '../../services/refresh.service';
|
||||
|
||||
@ -9,7 +9,7 @@ import { RefreshService } from '../../services/refresh.service';
|
||||
templateUrl: './group.component.html',
|
||||
styleUrl: './group.component.css'
|
||||
})
|
||||
export class GroupComponent {
|
||||
export class GroupComponent implements AfterViewInit {
|
||||
constructor(private refreshService: RefreshService) { }
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
|
||||
@ -1 +1 @@
|
||||
<app-module-table></app-module-table>
|
||||
<app-module-table #moduleTable></app-module-table>
|
||||
@ -1,5 +1,6 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { AfterViewInit, Component, ViewChild } from '@angular/core';
|
||||
import { ModuleTableComponent } from '../../components/tables/module-table/module-table.component';
|
||||
import { RefreshService } from '../../services/refresh.service';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
@ -8,6 +9,15 @@ import { ModuleTableComponent } from '../../components/tables/module-table/modul
|
||||
templateUrl: './module.component.html',
|
||||
styleUrl: './module.component.css'
|
||||
})
|
||||
export class ModuleComponent {
|
||||
export class ModuleComponent implements AfterViewInit {
|
||||
constructor(private refreshService: RefreshService) { }
|
||||
|
||||
}
|
||||
ngAfterViewInit(): void {
|
||||
this.refreshService.removeAll()
|
||||
this.refreshService.add(() => {
|
||||
this.moduleTable.fetchData();
|
||||
});
|
||||
}
|
||||
|
||||
@ViewChild("moduleTable") moduleTable!: ModuleTableComponent;
|
||||
}
|
||||
@ -6,6 +6,7 @@ import { ModuleTableComponent } from '../tables/module-table/module-table.compon
|
||||
import { GroupTableComponent } from '../tables/group-table/group-table.component';
|
||||
import { User } from '../../models/user-management.api.models';
|
||||
import { MatTabsModule, MatTabGroup } from '@angular/material/tabs';
|
||||
import { RefreshService } from '../../services/refresh.service';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
@ -44,11 +45,20 @@ export class UserAssignmentComponent implements OnInit, AfterViewInit {
|
||||
mode: GuiRowSelectionMode.MULTIPLE
|
||||
}
|
||||
|
||||
private anySelected: boolean = false;
|
||||
|
||||
constructor(private refreshService: RefreshService) { }
|
||||
|
||||
ngOnInit(): void { }
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
//this.unassignedUsers.loading = false;
|
||||
//this.assignedUsers.loading = false;
|
||||
this.refreshService.removeAll()
|
||||
this.refreshService.add(() => {
|
||||
this.modules.fetchData();
|
||||
this.groups.fetchData();
|
||||
if(this.anySelected)
|
||||
this.updateUserTables();
|
||||
});
|
||||
}
|
||||
|
||||
createAssignDragMethod(target: string): (event: DragEvent) => void {
|
||||
@ -130,8 +140,8 @@ export class UserAssignmentComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
updateUserTables() {
|
||||
this.anySelected = true;
|
||||
this.unselectUserTables()
|
||||
|
||||
switch (this.target) {
|
||||
case Target.Module:
|
||||
this.assignedUsers.fetchDataByModuleId(this.targetId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user