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', templateUrl: './group-dir-import.component.html',
styleUrl: './group-dir-import.component.css' styleUrl: './group-dir-import.component.css'
}) })
export class GroupDirImportComponent implements OnInit, AfterViewInit { export class GroupDirImportComponent implements OnInit {
initWithoutData = () => { } initWithoutData = () => { }
@@ -26,9 +26,6 @@ export class GroupDirImportComponent implements OnInit, AfterViewInit {
@ViewChild('dirGroups') dirGroups!: DirGroupTableComponent; @ViewChild('dirGroups') dirGroups!: DirGroupTableComponent;
ngAfterViewInit(): void {
}
dirGroupsRowSelection: GuiRowSelection = { dirGroupsRowSelection: GuiRowSelection = {
enabled: true, enabled: true,
type: GuiRowSelectionType.CHECKBOX, type: GuiRowSelectionType.CHECKBOX,

View File

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

View File

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

View File

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

View File

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

View File

@@ -41,14 +41,14 @@ export class UserRepresentationComponent {
if (rows.length > 0) { if (rows.length > 0) {
this.users.safelyUnselectAll(); this.users.safelyUnselectAll();
this.useRepLabel = `Repräsentationen von ${rows[0].source?.username}` this.useRepLabel = `Repräsentationen von ${rows[0].source?.username}`
this.userReps.fetchData(rows[0].source?.guid) this.userReps.fetchData(rows[0].source?.id)
this.slUserId = rows[0].source?.guid this.slUserId = rows[0].source?.id
} }
} }
rightGroupOnSelectedRows = (rows: GuiSelectedRow[]) => { rightGroupOnSelectedRows = (rows: GuiSelectedRow[]) => {
if (rows.length > 0) { if (rows.length > 0) {
this.slRightGroupId = rows[0].source?.guid this.slRightGroupId = rows[0].source?.id
} else { } else {
this.slRightGroupId = null; this.slRightGroupId = null;
} }
@@ -105,7 +105,7 @@ export class UserRepresentationComponent {
this.slRepUserId = null; this.slRepUserId = null;
} }
else if(rows.length > 0) { 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; this.slRepGroupId = null;
} }
else if(rows.length > 0) { 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) { 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 { export interface User {
guid?: number; id?: number;
prename: string; prename: string;
name?: string; name?: string;
username: string; username: string;
@@ -16,7 +16,7 @@ export interface User {
export interface Group { export interface Group {
guid?: number; id?: number;
name?: string; name?: string;
adSync?: boolean; adSync?: boolean;
internal?: boolean; internal?: boolean;
@@ -27,13 +27,13 @@ export interface Group {
} }
export interface Module { export interface Module {
guid: number; id: number;
name?: string; name?: string;
shortName?: string; shortName?: string;
} }
export interface ModuleOfUser { export interface ModuleOfUser {
guid?: number; id?: number;
userId: number; userId: number;
moduleId: number; moduleId: number;
isAdmin?: boolean; isAdmin?: boolean;
@@ -43,7 +43,7 @@ export interface ModuleOfUser {
} }
export interface GroupOfUser { export interface GroupOfUser {
guid?: number; id?: number;
userId: number; userId: number;
groupId: number; groupId: number;
comment?: string; comment?: string;
@@ -54,7 +54,7 @@ export interface GroupOfUser {
} }
export interface UserRep { export interface UserRep {
guid?: number, id?: number,
userId: number, userId: number,
repGroupId?: number, repGroupId?: number,
rightGroupId: number, rightGroupId: number,