Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland Sams committed Jan 22, 2024
1 parent ac0e43d commit 931a802
Show file tree
Hide file tree
Showing 34 changed files with 159 additions and 239 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component } from "@angular/core";
import { FormControl, FormGroup } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
import { Anschrift } from "src/app/models/Anschrift";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { AnschriftenApiService } from "src/app/services/api/anschriften-api.service";
import { InfoService } from "src/app/services/info.service";
import { AbstractFormComponent } from "src/app/utilities/form-components/_abstract-form-component.class";
Expand Down Expand Up @@ -36,7 +36,7 @@ export class AnschriftEditComponent extends AbstractFormComponent<Anschrift> {
label: "Adresse Löschen",
icon: "pi pi-trash",
click: () => this.delete(),
permissions: [PermissionMap.ANSCHRIFTEN_DELETE],
permissions: [PermissionKey.ANSCHRIFTEN_DELETE],
},
];
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { Anschrift } from "src/app/models/Anschrift";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { UserService } from "src/app/services/authentication/user.service";
import { AnschriftenListConfig } from "src/app/utilities/_list-configurations/anschriften-list-config.class";
import { AnschriftenListDatasource } from "src/app/utilities/_list-datasources/anschriften-list-datasource.class";
Expand Down Expand Up @@ -31,13 +31,13 @@ export class AnschriftenOverviewComponent {
this.router.navigate(["new"], {
relativeTo: this.route,
}),
permissions: [PermissionMap.ANSCHRIFTEN_SAVE],
permissions: [PermissionKey.ANSCHRIFTEN_SAVE],
},
];
}

public navigateToEdit(item: Anschrift): void {
if (this.userServie.hasPermission(PermissionMap.ANSCHRIFTEN_SAVE)) {
if (this.userServie.hasPermission(PermissionKey.ANSCHRIFTEN_SAVE)) {
this.router.navigate([item.id], {
relativeTo: this.route,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ActivatedRoute, Router } from "@angular/router";
import { UiDropdownOption } from "src/app/interfaces/UiConfigurations";
import { Instrument } from "src/app/models/Instrument";
import { Mitglied } from "src/app/models/Mitglied";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { GruppenApiService } from "src/app/services/api/gruppen-api.service";
import { InstrumenteApiService } from "src/app/services/api/instrumente-api.service";
import { InfoService } from "src/app/services/info.service";
Expand Down Expand Up @@ -67,7 +67,7 @@ export class InstrumenteEditorComponent
label: "Instrument Löschen",
icon: "pi pi-trash",
click: () => this.delete(),
permissions: [PermissionMap.INSTRUMENTE_DELETE],
permissions: [PermissionKey.INSTRUMENTE_DELETE],
},
];
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { Instrument } from "src/app/models/Instrument";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { AppConfigService } from "src/app/services/app-config.service";
import { UserService } from "src/app/services/authentication/user.service";
import { InstrumenteListConfig } from "src/app/utilities/_list-configurations/instrumente-list-config.class";
Expand All @@ -24,19 +24,19 @@ export class InstrumenteOverviewComponent {
toolbarService: MkjToolbarService,
configService: AppConfigService
) {
toolbarService.header = configService.appNaming.Instrumente;
toolbarService.header = configService.uiNaming.Instrumente;
toolbarService.buttons = [
{
icon: "pi pi-plus",
label: "Neu",
permissions: [PermissionMap.INSTRUMENTE_SAVE],
permissions: [PermissionKey.INSTRUMENTE_SAVE],
click: () => this.navigateEditor(),
},
];
}

public navigateEditor(instrument?: Instrument): void {
if (!this.userService.hasPermission(PermissionMap.INSTRUMENTE_SAVE))
if (!this.userService.hasPermission(PermissionKey.INSTRUMENTE_SAVE))
return;
this.router.navigate([instrument?.id ?? "new"], {
relativeTo: this.route,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component } from "@angular/core";
import { FormControl, FormGroup, Validators } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
import { Noten, NotenGattungMap } from "src/app/models/Noten";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { NotenApiService } from "src/app/services/api/noten-api.service";
import { InfoService } from "src/app/services/info.service";
import { AbstractFormComponent } from "src/app/utilities/form-components/_abstract-form-component.class";
Expand Down Expand Up @@ -40,7 +40,7 @@ export class NotenEditorComponent extends AbstractFormComponent<Noten> {
label: "Mappe Löschen",
icon: "pi pi-trash",
click: () => this.delete(),
permissions: [PermissionMap.NOTEN_DELETE],
permissions: [PermissionKey.NOTEN_DELETE],
},
];
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { Noten } from "src/app/models/Noten";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { AppConfigService } from "src/app/services/app-config.service";
import { UserService } from "src/app/services/authentication/user.service";
import { NotenListConfig } from "src/app/utilities/_list-configurations/noten-list-config.class";
Expand All @@ -15,7 +15,7 @@ import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.ser
providers: [NotenListDatasource, NotenListConfig],
})
export class NotenOverviewComponent {
public readonly PermissionMap = PermissionMap;
public readonly PermissionMap = PermissionKey;

constructor(
public datasource: NotenListDatasource,
Expand All @@ -26,19 +26,19 @@ export class NotenOverviewComponent {
private namingService: AppConfigService,
private userService: UserService
) {
this.toolbarService.header = this.namingService.appNaming.Noten;
this.toolbarService.header = this.namingService.uiNaming.Noten;
this.toolbarService.buttons = [
{
icon: "pi pi-plus",
label: "Neu",
permissions: [PermissionMap.NOTEN_SAVE],
permissions: [PermissionKey.NOTEN_SAVE],
click: () => this.navigateToEditView(),
},
];
}

public navigateToEditView(noten?: Noten) {
if (!this.userService.hasPermission(PermissionMap.NOTEN_SAVE)) {
if (!this.userService.hasPermission(PermissionKey.NOTEN_SAVE)) {
return;
}
this.router.navigate([noten?.id ?? "new"], { relativeTo: this.route });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component } from "@angular/core";
import { FormControl, FormGroup, Validators } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
import { Notenmappe } from "src/app/models/Noten";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { NotenmappenApiService } from "src/app/services/api/notenmappen-api.service";
import { InfoService } from "src/app/services/info.service";
import { AbstractFormComponent } from "src/app/utilities/form-components/_abstract-form-component.class";
Expand All @@ -13,7 +13,7 @@ import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.ser
templateUrl: "./notenmappe-edit.component.html",
})
export class NotenmappeEditComponent extends AbstractFormComponent<Notenmappe> {
public readonly Permission = PermissionMap;
public readonly Permission = PermissionKey;
public editMode: boolean = false;

constructor(
Expand Down Expand Up @@ -54,16 +54,16 @@ export class NotenmappeEditComponent extends AbstractFormComponent<Notenmappe> {
this.toolbarService.buttons[0].highlighted = this.editMode;
},
permissions: [
PermissionMap.NOTENMAPPE_SAVE,
PermissionMap.NOTENMAPPE_ASSIGN,
PermissionKey.NOTENMAPPE_SAVE,
PermissionKey.NOTENMAPPE_ASSIGN,
],
},
{
label: "Mappe Löschen",
icon: "pi pi-trash",
hidden: this.getId() === "new",
click: () => this.delete(),
permissions: [PermissionMap.NOTENMAPPE_DELETE],
permissions: [PermissionKey.NOTENMAPPE_DELETE],
},
];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Input, OnChanges, SimpleChanges } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { Noten } from "src/app/models/Noten";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { NotenmappenApiService } from "src/app/services/api/notenmappen-api.service";
import { AppConfigService } from "src/app/services/app-config.service";
import { UserService } from "src/app/services/authentication/user.service";
Expand Down Expand Up @@ -31,7 +31,7 @@ export class NotenmappeNotenListComponent implements OnChanges {
public readonly hasAssignPermission: boolean = false;
public readonly hasSavePermission: boolean = false;

public readonly PermissionMap = PermissionMap;
public readonly PermissionMap = PermissionKey;

public selectedNoten: Noten;
public listDatasource: MappeNotenListDatasource;
Expand All @@ -49,10 +49,10 @@ export class NotenmappeNotenListComponent implements OnChanges {
private route: ActivatedRoute
) {
this.hasAssignPermission = this.userService.hasPermission(
PermissionMap.NOTENMAPPE_ASSIGN
PermissionKey.NOTENMAPPE_ASSIGN
);
this.hasSavePermission = this.userService.hasPermission(
PermissionMap.NOTEN_SAVE
PermissionKey.NOTEN_SAVE
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { Notenmappe } from "src/app/models/Noten";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { AppConfigService } from "src/app/services/app-config.service";
import { NotenmappeListDatasource } from "src/app/utilities/_list-datasources/notenmappe-list-datasource.class";
import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.service";
Expand All @@ -19,13 +19,13 @@ export class NotenmappenOverviewComponent {
private toolbarService: MkjToolbarService,
configService: AppConfigService
) {
this.toolbarService.header = configService.appNaming.Notenmappen;
this.toolbarService.header = configService.uiNaming.Notenmappen;
this.toolbarService.buttons = [
{
icon: "pi pi-plus",
click: () => this.navigateToNotenmappe(),
label: "Neue Mappe",
permissions: [PermissionMap.NOTENMAPPE_SAVE],
permissions: [PermissionKey.NOTENMAPPE_SAVE],
},
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { AppConfigService } from "src/app/services/app-config.service";
styleUrls: ["./ui-naming-config.component.scss"],
})
export class UiNamingConfigComponent {
public readonly appNaming = _.cloneDeep(this.configService.appNaming);
public readonly editNaming = _.cloneDeep(this.configService.appNaming);
public readonly appNaming = _.cloneDeep(this.configService.uiNaming);
public readonly editNaming = _.cloneDeep(this.configService.uiNaming);

constructor(private configService: AppConfigService) {}

public updateNaming(): void {
this.configService.updateAppNamingConfig(this.editNaming);
this.configService.saveUiNamingConfig(this.editNaming);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfirmationService } from "primeng/api";
import { Permission, PermissionMap, Role } from "../../../models/User";
import { Permission, PermissionKey, Role } from "../../../models/User";
import { RolesApiService } from "../../../services/api/roles-api.service";
import { Component, OnInit } from "@angular/core";
import { UserService } from "src/app/services/authentication/user.service";
Expand Down Expand Up @@ -42,7 +42,7 @@ export class RollenEditComponent implements OnInit {
this.addDialogVisible = true;
},
icon: "pi pi-plus",
permissions: [PermissionMap.ROLE_SAVE],
permissions: [PermissionKey.ROLE_SAVE],
},
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, OnInit } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { BehaviorSubject } from "rxjs";
import { Kassabuch } from "src/app/models/Kassabuch";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { KassabuchApiService } from "src/app/services/api/kassabuch-api.service";
import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.service";

Expand Down Expand Up @@ -37,7 +37,7 @@ export class KassabuchDetailsComponent implements OnInit {
],
{ relativeTo: this.route }
),
permissions: [PermissionMap.KASSABUCH_SAVE],
permissions: [PermissionKey.KASSABUCH_SAVE],
},
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FormControl, FormGroup } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
import { UiDropdownOption } from "src/app/interfaces/UiConfigurations";
import { Kassabuch } from "src/app/models/Kassabuch";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { GruppenApiService } from "src/app/services/api/gruppen-api.service";
import { KassabuchApiService } from "src/app/services/api/kassabuch-api.service";
import { InfoService } from "src/app/services/info.service";
Expand Down Expand Up @@ -49,7 +49,7 @@ export class KassabuchEditComponent extends AbstractFormComponent<Kassabuch> {
click: () => {
this.delete();
},
permissions: [PermissionMap.KASSABUCH_DELETE],
permissions: [PermissionKey.KASSABUCH_DELETE],
},
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { ActivatedRoute, Router } from "@angular/router";
import { UtilFunctions } from "src/app/helpers/util-functions";
import { Kassabuchung, KassabuchungTyp } from "src/app/models/Kassabuch";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { KassabuchungenApiService } from "src/app/services/api/kassabuchungen-api.service";
import { InfoService } from "src/app/services/info.service";
import { AbstractFormComponent } from "src/app/utilities/form-components/_abstract-form-component.class";
Expand Down Expand Up @@ -58,7 +58,7 @@ export class KassabuchungEditComponent extends AbstractFormComponent<Kassabuchun
click: () => {
this.delete();
},
permissions: [PermissionMap.KASSABUCHUNG_DELETE],
permissions: [PermissionKey.KASSABUCHUNG_DELETE],
},
];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from "@angular/core";
import { ActivatedRoute, Router } from "@angular/router";
import { Kassabuch } from "src/app/models/Kassabuch";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { KassabuchListDatasource } from "src/app/utilities/_list-datasources/kassabuch-list-datasource";
import { MkjToolbarService } from "src/app/utilities/mkj-toolbar/mkj-toolbar.service";

Expand All @@ -27,7 +27,7 @@ export class KassabuecherComponent {
relativeTo: this.route,
});
},
permissions: [PermissionMap.KASSABUCH_SAVE],
permissions: [PermissionKey.KASSABUCH_SAVE],
},
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component } from "@angular/core";
import { FormControl, FormGroup, Validators } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
import { Gruppe } from "src/app/models/Gruppe";
import { PermissionMap } from "src/app/models/User";
import { PermissionKey } from "src/app/models/User";
import { GruppenApiService } from "src/app/services/api/gruppen-api.service";
import { InfoService } from "src/app/services/info.service";
import { MitgliedAutoCompleteConfigiguration } from "src/app/utilities/_autocomplete-configurations/mitglied-autocomplete-config.class";
Expand Down Expand Up @@ -52,7 +52,7 @@ export class GruppeEditComponent extends AbstractFormComponent<Gruppe> {
icon: "pi pi-trash",
hidden: this.getId() === "new",
click: () => this.delete(),
permissions: [PermissionMap.GRUPPEN_DELETE],
permissions: [PermissionKey.GRUPPEN_DELETE],
},
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class GruppeMitgliederListComponent implements OnChanges {
public gruppeId: string;

public listDatasource: GruppeMitgliederListDatasource;
public listConfig = new GruppeMitgliederListConfig();
public readonly listConfig = new GruppeMitgliederListConfig();

public selectedMitglied: Mitglied;
public tableLocked: boolean = false;
Expand Down
Loading

0 comments on commit 931a802

Please sign in to comment.