1.0.0.rc1 #244

Merged
edraft merged 14 commits from 1.0.0.rc1 into 1.0.0 2023-03-11 01:12:31 +01:00
3 changed files with 11 additions and 7 deletions
Showing only changes of commit a701807831 - Show all commits

View File

@ -185,14 +185,14 @@
<td>
<div class="btn-wrapper">
<button *ngIf="!editing" pButton pInitEditableRow class="btn icon-btn" icon="pi pi-pencil"
(click)="onRowEditInit(dt, level, ri)"></button>
(click)="onRowEditInit(dt, level, ri)" [disabled]="!user || user.isModerator && !user.isAdmin"></button>
<button *ngIf="!editing" pButton class="btn icon-btn danger-icon-btn" icon="pi pi-trash"
(click)="deleteLevel(level)"></button>
(click)="deleteLevel(level)" [disabled]="!user || user.isModerator && !user.isAdmin"></button>
<button *ngIf="editing" pButton pSaveEditableRow class="btn icon-btn"
icon="pi pi-check-circle" (click)="onRowEditSave(dt, level, ri)"></button>
icon="pi pi-check-circle" (click)="onRowEditSave(dt, level, ri)" [disabled]="!user || user.isModerator && !user.isAdmin"></button>
<button *ngIf="editing" pButton pCancelEditableRow class="btn icon-btn danger-icon-btn"
icon="pi pi-times-circle" (click)="onRowEditCancel(ri)"></button>
icon="pi pi-times-circle" (click)="onRowEditCancel(ri)" [disabled]="!user || user.isModerator && !user.isAdmin"></button>
</div>
</td>
</tr>

View File

@ -21,6 +21,7 @@ import { LevelMutationResult, UpdateUserMutationResult } from "../../../../../..
import { Mutations } from "../../../../../../models/graphql/mutations.model";
import { Subject, throwError } from "rxjs";
import { Server } from "../../../../../../models/data/server.model";
import { UserDTO } from "../../../../../../models/auth/auth-user.dto";
@Component({
selector: "app-levels",
@ -58,6 +59,7 @@ export class LevelsComponent implements OnInit, OnDestroy {
private unsubscriber = new Subject<void>();
private server: Server = {};
public user: UserDTO | null = null;
public constructor(
private authService: AuthService,
@ -73,9 +75,11 @@ export class LevelsComponent implements OnInit, OnDestroy {
public ngOnInit(): void {
this.setFilterForm();
this.data.getServerFromRoute(this.route).then(server => {
this.data.getServerFromRoute(this.route).then(async server => {
this.server = server;
this.loadNextPage();
let authUser = await this.authService.getLoggedInUser();
this.user = authUser?.users?.find(u => u.server == this.server.id) ?? null;
});
}

View File

@ -140,8 +140,8 @@ export class SidebarService {
if (this.server$.value) {
this.serverMenu.visible = true;
this.serverMembers.visible = !!user?.isModerator;
this.serverAutoRoles.visible = !!user?.isAdmin;
this.serverLevels.visible = !!user?.isAdmin;
this.serverAutoRoles.visible = !!user?.isModerator;
this.serverLevels.visible = !!user?.isModerator;
} else {
this.serverMenu.visible = false;
}