refactor: Spaltennamen-Injektion durch Environment-Variablen ersetzt
This commit is contained in:
parent
3cbd0523eb
commit
2212ebfc45
@ -2,10 +2,11 @@ import { Component, Inject } from '@angular/core';
|
|||||||
import { BaseTableComponent } from '../base-table/base-table.component';
|
import { BaseTableComponent } from '../base-table/base-table.component';
|
||||||
import { DirGroupService } from '../../../services/dir-group.service';
|
import { DirGroupService } from '../../../services/dir-group.service';
|
||||||
import { DirGroup } from '../../../models/user-management.api.models';
|
import { DirGroup } from '../../../models/user-management.api.models';
|
||||||
import { GuiColumn, GuiGridModule } from '@generic-ui/ngx-grid';
|
import { GuiGridModule } from '@generic-ui/ngx-grid';
|
||||||
import { ColorModeService } from '../../../services/color-mode.service';
|
import { ColorModeService } from '../../../services/color-mode.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { env } from '../../../../environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@ -15,7 +16,7 @@ import { FormsModule } from '@angular/forms';
|
|||||||
styleUrl: './dir-group-table.component.css'
|
styleUrl: './dir-group-table.component.css'
|
||||||
})
|
})
|
||||||
export class DirGroupTableComponent extends BaseTableComponent<DirGroup, DirGroupService> {
|
export class DirGroupTableComponent extends BaseTableComponent<DirGroup, DirGroupService> {
|
||||||
constructor(service: DirGroupService, @Inject('DIR_GROUP_TABLE_COLUMNS') columns: Array<GuiColumn>, cModeService: ColorModeService) {
|
constructor(service: DirGroupService, cModeService: ColorModeService) {
|
||||||
super(service, columns, cModeService)
|
super(service, env.columnNames.dirGroup, cModeService)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6,6 +6,7 @@ import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';
|
|||||||
import { ColorModeService } from '../../../services/color-mode.service';
|
import { ColorModeService } from '../../../services/color-mode.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { env } from '../../../../environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@ -15,8 +16,8 @@ import { FormsModule } from '@angular/forms';
|
|||||||
styleUrl: './dir-user-table.component.css'
|
styleUrl: './dir-user-table.component.css'
|
||||||
})
|
})
|
||||||
export class DirUserTableComponent extends BaseTableComponent<DirUser, DirUserService> {
|
export class DirUserTableComponent extends BaseTableComponent<DirUser, DirUserService> {
|
||||||
constructor(service: DirUserService, @Inject('DIR_USER_TABLE_COLUMNS') columns: Array<GuiColumn>, cModeService: ColorModeService) {
|
constructor(service: DirUserService, cModeService: ColorModeService) {
|
||||||
super(service, columns, cModeService)
|
super(service, env.columnNames.dirUser, cModeService)
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchDataByGroupName(groupName: string): void {
|
fetchDataByGroupName(groupName: string): void {
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import { BaseTableComponent } from '../base-table/base-table.component';
|
|||||||
import { ColorModeService } from '../../../services/color-mode.service';
|
import { ColorModeService } from '../../../services/color-mode.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { env } from '../../../../environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@ -16,7 +17,7 @@ import { FormsModule } from '@angular/forms';
|
|||||||
})
|
})
|
||||||
export class GroupTableComponent extends BaseTableComponent<Group, GroupService> {
|
export class GroupTableComponent extends BaseTableComponent<Group, GroupService> {
|
||||||
constructor(
|
constructor(
|
||||||
service: GroupService, @Inject('GROUP_COMPLETE_TABLE_COLUMNS') columns: Array<GuiColumn>, cModeService: ColorModeService) {
|
service: GroupService, cModeService: ColorModeService) {
|
||||||
super(service, columns, cModeService)
|
super(service, env.columnNames.group.complete, cModeService)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6,6 +6,7 @@ import { BaseTableComponent } from '../base-table/base-table.component';
|
|||||||
import { ColorModeService } from '../../../services/color-mode.service';
|
import { ColorModeService } from '../../../services/color-mode.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { env } from '../../../../environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@ -15,8 +16,8 @@ import { FormsModule } from '@angular/forms';
|
|||||||
styleUrl: './group-user-table.component.css'
|
styleUrl: './group-user-table.component.css'
|
||||||
})
|
})
|
||||||
export class GroupUserTableComponent extends BaseTableComponent<GroupOfUser, GroupOfUserService> {
|
export class GroupUserTableComponent extends BaseTableComponent<GroupOfUser, GroupOfUserService> {
|
||||||
constructor(service: GroupOfUserService, @Inject('GROUP_USER_TABLE_COLUMNS') columns: Array<GuiColumn>, cModeService: ColorModeService) {
|
constructor(service: GroupOfUserService, cModeService: ColorModeService) {
|
||||||
super(service, columns, cModeService)
|
super(service, env.columnNames.groupOfUser, cModeService)
|
||||||
this.initData = () => this.fetchDataWith(true,true);
|
this.initData = () => this.fetchDataWith(true,true);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
import { Component, Inject } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Module } from '../../../models/user-management.api.models';
|
import { Module } from '../../../models/user-management.api.models';
|
||||||
import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';
|
import { GuiGridModule } from '@generic-ui/ngx-grid';
|
||||||
import { BaseTableComponent } from '../base-table/base-table.component';
|
import { BaseTableComponent } from '../base-table/base-table.component';
|
||||||
import { ModuleService } from '../../../services/module.service'
|
import { ModuleService } from '../../../services/module.service'
|
||||||
import { ColorModeService } from '../../../services/color-mode.service';
|
import { ColorModeService } from '../../../services/color-mode.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { env } from '../../../../environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@ -16,7 +17,7 @@ import { FormsModule } from '@angular/forms';
|
|||||||
})
|
})
|
||||||
export class ModuleTableComponent extends BaseTableComponent<Module, ModuleService> {
|
export class ModuleTableComponent extends BaseTableComponent<Module, ModuleService> {
|
||||||
constructor(
|
constructor(
|
||||||
service: ModuleService, @Inject('MODULE_TABLE_COLUMNS') columns: Array<GuiColumn>, cModeService: ColorModeService) {
|
service: ModuleService, cModeService: ColorModeService) {
|
||||||
super(service, columns, cModeService)
|
super(service, env.columnNames.module, cModeService)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6,6 +6,7 @@ import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';
|
|||||||
import { ColorModeService } from '../../../services/color-mode.service';
|
import { ColorModeService } from '../../../services/color-mode.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { env } from '../../../../environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@ -16,8 +17,8 @@ import { FormsModule } from '@angular/forms';
|
|||||||
})
|
})
|
||||||
export class UserRepTableComponent extends BaseTableComponent<UserRep, UserRepService> {
|
export class UserRepTableComponent extends BaseTableComponent<UserRep, UserRepService> {
|
||||||
|
|
||||||
constructor(service: UserRepService, @Inject('USER_REP_TABLE_COLUMNS') columns: Array<GuiColumn>, cModeService: ColorModeService) {
|
constructor(service: UserRepService, cModeService: ColorModeService) {
|
||||||
super(service, columns, cModeService)
|
super(service, env.columnNames.userRep, cModeService)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import { BaseTableComponent } from '../base-table/base-table.component';
|
|||||||
import { ColorModeService } from '../../../services/color-mode.service'
|
import { ColorModeService } from '../../../services/color-mode.service'
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { env } from '../../../../environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: true,
|
standalone: true,
|
||||||
@ -24,9 +25,8 @@ export class UserTableComponent extends BaseTableComponent<User, UserService> {
|
|||||||
constructor(mosService: ModuleOfUserService,
|
constructor(mosService: ModuleOfUserService,
|
||||||
gosService: GroupOfUserService,
|
gosService: GroupOfUserService,
|
||||||
service: UserService,
|
service: UserService,
|
||||||
@Inject('USER_TABLE_COLUMNS') columns: Array<GuiColumn>,
|
|
||||||
cModeService: ColorModeService) {
|
cModeService: ColorModeService) {
|
||||||
super(service, columns, cModeService)
|
super(service, env.columnNames.user, cModeService)
|
||||||
this.mosService = mosService;
|
this.mosService = mosService;
|
||||||
this.gosService = gosService;
|
this.gosService = gosService;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export class NavMenuComponent {
|
|||||||
isExpanded = false;
|
isExpanded = false;
|
||||||
|
|
||||||
constructor(public dialog: MatDialog, private authService: AuthenticationService) {
|
constructor(public dialog: MatDialog, private authService: AuthenticationService) {
|
||||||
this.authService.isAuthenticated().then(console.log).catch(console.log)
|
this.authService.isAuthenticated().then().catch()
|
||||||
}
|
}
|
||||||
|
|
||||||
get isDarkTheme(): boolean {
|
get isDarkTheme(): boolean {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user