Compare commits

...

2 Commits

Author SHA1 Message Date
Developer 02
542b2429e7 Umbenennung der Eigenschaft guid in id 2024-07-03 16:40:14 +02:00
Developer 02
5a6c2b5256 AfterViewInit-Implementierungen entfernen 2024-07-03 16:24:30 +02:00
7 changed files with 28 additions and 34 deletions

View File

@@ -13,7 +13,7 @@ import { DirGroup } from '../../models/user-management.api.models';
templateUrl: './group-dir-import.component.html',
styleUrl: './group-dir-import.component.css'
})
export class GroupDirImportComponent implements OnInit, AfterViewInit {
export class GroupDirImportComponent implements OnInit {
initWithoutData = () => { }
@@ -26,9 +26,6 @@ export class GroupDirImportComponent implements OnInit, AfterViewInit {
@ViewChild('dirGroups') dirGroups!: DirGroupTableComponent;
ngAfterViewInit(): void {
}
dirGroupsRowSelection: GuiRowSelection = {
enabled: true,
type: GuiRowSelectionType.CHECKBOX,

View File

@@ -9,7 +9,7 @@ import { ColorModeService, Theme } from '../../../services/color-mode.service';
templateUrl: './base-table.component.html',
styleUrl: './base-table.component.css'
})
export class BaseTableComponent<TModel, TApiService extends ApiService<TModel>> implements OnInit, AfterViewInit, OnDestroy {
export class BaseTableComponent<TModel, TApiService extends ApiService<TModel>> implements OnInit, OnDestroy {
service: TApiService;
@@ -23,7 +23,7 @@ export class BaseTableComponent<TModel, TApiService extends ApiService<TModel>>
enabled: true,
multiSorting: true
};
loading: boolean = true;
loading: boolean = false;
autoResizeWidth: boolean = true;
rowDetail: GuiRowDetail = {
enabled: true,
@@ -145,9 +145,6 @@ export class BaseTableComponent<TModel, TApiService extends ApiService<TModel>>
this.themeSubscription.unsubscribe();
}
ngAfterViewInit(): void {
}
fetchData(): void {
this.service.getAll().subscribe({
next: (response) => {

View File

@@ -47,24 +47,24 @@ export class UserTableComponent extends BaseTableComponent<User, UserService> {
async createModuleOfUsers(moduleId: number, users: User[]): Promise<any[]> {
const creationPromises = users
.filter(user => user.guid && user.guid != null)
.map(user => this.mosService.create({ moduleId: moduleId, userId: user.guid ?? -1, addedWho: "DEFAULT" }).toPromise());
.filter(user => user.id && user.id != null)
.map(user => this.mosService.create({ moduleId: moduleId, userId: user.id ?? -1, addedWho: "DEFAULT" }).toPromise());
return Promise.all(creationPromises);
}
async createGroupOfUsers(groupId: number, users: User[]): Promise<any[]> {
const creationPromises = users
.filter(user => user.guid && user.guid != null)
.map(user => this.gosService.create({ groupId: groupId, userId: user.guid ?? -1, addedWho: "DEFAULT" }).toPromise());
.filter(user => user.id && user.id != null)
.map(user => this.gosService.create({ groupId: groupId, userId: user.id ?? -1, addedWho: "DEFAULT" }).toPromise());
return Promise.all(creationPromises);
}
async deleteModuleOfUsers(moduleId: number, users: User[]): Promise<void> {
const deletionPromises = users
.filter(user => user.guid)
.map(user => this.mosService.deleteByModuleGroupId(moduleId, user.guid ?? -1).toPromise());
.filter(user => user.id)
.map(user => this.mosService.deleteByModuleGroupId(moduleId, user.id ?? -1).toPromise());
try {
const responses = await Promise.all(deletionPromises);
@@ -74,8 +74,8 @@ export class UserTableComponent extends BaseTableComponent<User, UserService> {
async deleteGroupOfUsers(groupId: number, users: User[]): Promise<void> {
const deletionPromises = users
.filter(user => user.guid)
.map(user => this.gosService.deleteByGroupUserId(groupId, user.guid ?? -1).toPromise());
.filter(user => user.id)
.map(user => this.gosService.deleteByGroupUserId(groupId, user.id ?? -1).toPromise());
try {
const responses = await Promise.all(deletionPromises);

View File

@@ -44,8 +44,8 @@ export class UserAssignmentComponent implements OnInit, AfterViewInit {
ngOnInit(): void {}
ngAfterViewInit(): void {
this.unassignedUsers.loading = false;
this.assignedUsers.loading = false;
//this.unassignedUsers.loading = false;
//this.assignedUsers.loading = false;
}
createAssignDragMethod(target: string): (event: DragEvent) => void {
@@ -146,7 +146,7 @@ export class UserAssignmentComponent implements OnInit, AfterViewInit {
this.modules.safelyUnselectAll();
this.userInLabel = `Benutzer in Module ${rows[0].source?.name}`
this.target = Target.Module;
this.targetId = rows[0].source.guid;
this.targetId = rows[0].source.id;
this.updateUserTables();
}
}
@@ -156,7 +156,7 @@ export class UserAssignmentComponent implements OnInit, AfterViewInit {
this.groups.safelyUnselectAll();
this.userInLabel = `Benutzer in Gruppe ${rows[0].source?.name}`
this.target = Target.Group;
this.targetId = rows[0].source.guid;
this.targetId = rows[0].source.id;
this.updateUserTables();
}
}

View File

@@ -28,7 +28,7 @@ export class UserGroupDirImportComponent implements OnInit, AfterViewInit {
@ViewChild('dirUsers') dirUsers!: DirUserTableComponent;
ngAfterViewInit(): void {
this.dirUsers.loading = false;
//this.dirUsers.loading = false;
}
dirGroupsRowSelection: GuiRowSelection = {

View File

@@ -41,14 +41,14 @@ export class UserRepresentationComponent {
if (rows.length > 0) {
this.users.safelyUnselectAll();
this.useRepLabel = `Repräsentationen von ${rows[0].source?.username}`
this.userReps.fetchData(rows[0].source?.guid)
this.slUserId = rows[0].source?.guid
this.userReps.fetchData(rows[0].source?.id)
this.slUserId = rows[0].source?.id
}
}
rightGroupOnSelectedRows = (rows: GuiSelectedRow[]) => {
if (rows.length > 0) {
this.slRightGroupId = rows[0].source?.guid
this.slRightGroupId = rows[0].source?.id
} else {
this.slRightGroupId = null;
}
@@ -105,7 +105,7 @@ export class UserRepresentationComponent {
this.slRepUserId = null;
}
else if(rows.length > 0) {
this.slRepUserId = rows[0].source?.guid;
this.slRepUserId = rows[0].source?.id;
}
}
@@ -160,7 +160,7 @@ export class UserRepresentationComponent {
this.slRepGroupId = null;
}
else if(rows.length > 0) {
this.slRepGroupId = rows[0].source?.guid;
this.slRepGroupId = rows[0].source?.id;
}
}
@@ -186,7 +186,7 @@ export class UserRepresentationComponent {
})
}
else if(rows.length > 0) {
this.slUserRepId = rows[0].source?.guid;
this.slUserRepId = rows[0].source?.id;
}
}
}

View File

@@ -1,5 +1,5 @@
export interface User {
guid?: number;
id?: number;
prename: string;
name?: string;
username: string;
@@ -16,7 +16,7 @@ export interface User {
export interface Group {
guid?: number;
id?: number;
name?: string;
adSync?: boolean;
internal?: boolean;
@@ -27,13 +27,13 @@ export interface Group {
}
export interface Module {
guid: number;
id: number;
name?: string;
shortName?: string;
}
export interface ModuleOfUser {
guid?: number;
id?: number;
userId: number;
moduleId: number;
isAdmin?: boolean;
@@ -43,7 +43,7 @@ export interface ModuleOfUser {
}
export interface GroupOfUser {
guid?: number;
id?: number;
userId: number;
groupId: number;
comment?: string;
@@ -54,7 +54,7 @@ export interface GroupOfUser {
}
export interface UserRep {
guid?: number,
id?: number,
userId: number,
repGroupId?: number,
rightGroupId: number,