Umbenennung der Eigenschaft guid in id

This commit is contained in:
Developer 02 2024-07-03 16:40:14 +02:00
parent 5a6c2b5256
commit 542b2429e7
4 changed files with 22 additions and 22 deletions

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

@ -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

@ -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,