From 07fc5126338ee0665fcafd3366912c0cf94ecadc Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 26 Jan 2024 12:11:20 +0100 Subject: [PATCH] Made levels & Achievements public --- .../achievement/achievement.component.html | 36 ++++++++++++------- .../components/levels/levels.component.html | 12 +++---- .../view/server/server-routing.module.ts | 9 ++--- .../app/services/sidebar/sidebar.service.ts | 4 +-- 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/web/src/app/modules/view/server/achievements/components/achievement/achievement.component.html b/web/src/app/modules/view/server/achievements/components/achievement/achievement.component.html index 45e43f36..bed61c7d 100644 --- a/web/src/app/modules/view/server/achievements/components/achievement/achievement.component.html +++ b/web/src/app/modules/view/server/achievements/components/achievement/achievement.component.html @@ -3,7 +3,8 @@
- @@ -17,17 +18,20 @@ {{'view.server.achievements.achievements' | translate}}
- +
-
@@ -179,7 +183,8 @@ {{'common.operator' | translate}}: - + {{achievement.operator}} @@ -200,7 +205,8 @@ - + {{achievement.value}} @@ -209,7 +215,8 @@ - + {{achievement.value}} @@ -241,16 +248,21 @@
- + + (click)="onRowEditInit(dt, achievement, ri)" + [disabled]="!user || !user.isModerator && !user.isAdmin"> + (click)="deleteAchievement(achievement)" + [disabled]="!user || !user.isModerator && !user.isAdmin"> + icon="pi pi-check-circle" (click)="onRowEditSave(achievement, ri)" + [disabled]="!user || !user.isModerator && !user.isAdmin"> + icon="pi pi-times-circle" (click)="onRowEditCancel(ri)" + [disabled]="!user || !user.isModerator && !user.isAdmin">
diff --git a/web/src/app/modules/view/server/levels/components/levels/levels.component.html b/web/src/app/modules/view/server/levels/components/levels/levels.component.html index 1668d850..3b9168cb 100644 --- a/web/src/app/modules/view/server/levels/components/levels/levels.component.html +++ b/web/src/app/modules/view/server/levels/components/levels/levels.component.html @@ -25,12 +25,12 @@
-
@@ -219,17 +219,17 @@ translationKey="view.server.levels.header"> + [disabled]="!user || !user.isModerator && !user.isAdmin"> + [disabled]="!user || !user.isModerator && !user.isAdmin"> + [disabled]="!user || !user.isModerator && !user.isAdmin"> + [disabled]="!user || !user.isModerator && !user.isAdmin"> diff --git a/web/src/app/modules/view/server/server-routing.module.ts b/web/src/app/modules/view/server/server-routing.module.ts index 732c1af8..512ea409 100644 --- a/web/src/app/modules/view/server/server-routing.module.ts +++ b/web/src/app/modules/view/server/server-routing.module.ts @@ -28,16 +28,11 @@ const routes: Routes = [ data: { memberRole: MemberRoles.Moderator } }, { - path: "levels", - loadChildren: () => import("./levels/levels.module").then(m => m.LevelsModule), - canActivate: [AuthGuard], - data: { memberRole: MemberRoles.Moderator } + path: "levels", loadChildren: () => import("./levels/levels.module").then(m => m.LevelsModule) }, { path: "achievements", - loadChildren: () => import("./achievements/achievements.module").then(m => m.AchievementsModule), - canActivate: [AuthGuard], - data: { memberRole: MemberRoles.Moderator } + loadChildren: () => import("./achievements/achievements.module").then(m => m.AchievementsModule) }, { path: "short-role-names", diff --git a/web/src/app/services/sidebar/sidebar.service.ts b/web/src/app/services/sidebar/sidebar.service.ts index 623a9118..4aa35ef5 100644 --- a/web/src/app/services/sidebar/sidebar.service.ts +++ b/web/src/app/services/sidebar/sidebar.service.ts @@ -203,8 +203,8 @@ export class SidebarService { this.serverMembers.visible = isTechnicianAndFullAccessActive || user?.isModerator; this.serverUserWarnings.visible = isTechnicianAndFullAccessActive || user?.isModerator; this.serverAutoRoles.visible = isTechnicianAndFullAccessActive || this.hasFeature("AutoRoleModule") && user?.isModerator; - this.serverLevels.visible = isTechnicianAndFullAccessActive || this.hasFeature("LevelModule") && user?.isModerator; - this.serverAchievements.visible = isTechnicianAndFullAccessActive || this.hasFeature("AchievementsModule") && user?.isModerator; + this.serverLevels.visible = true; + this.serverAchievements.visible = true; this.serverScheduledEvents.visible = isTechnicianAndFullAccessActive || this.hasFeature("ScheduledEvents") && user?.isModerator; this.serverShortRoleNames.visible = isTechnicianAndFullAccessActive || this.hasFeature("ShortRoleName") && user?.isAdmin;