mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 00:06:05 -07:00
fix(4k): Hide 'Has 4K Request' column list if 4k feature is disabled (#4521)
[skip ci]
This commit is contained in:
parent
d6ae79ce9e
commit
a9a60678e7
1 changed files with 11 additions and 4 deletions
|
@ -13,6 +13,7 @@ import { RequestServiceV2 } from "../../../services/requestV2.service";
|
||||||
import { SelectionModel } from "@angular/cdk/collections";
|
import { SelectionModel } from "@angular/cdk/collections";
|
||||||
import { StorageService } from "../../../shared/storage/storage-service";
|
import { StorageService } from "../../../shared/storage/storage-service";
|
||||||
import { TranslateService } from "@ngx-translate/core";
|
import { TranslateService } from "@ngx-translate/core";
|
||||||
|
import { FeaturesFacade } from "../../../state/features/features.facade";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "./movies-grid.component.html",
|
templateUrl: "./movies-grid.component.html",
|
||||||
|
@ -26,6 +27,7 @@ export class MoviesGridComponent implements OnInit, AfterViewInit {
|
||||||
public displayedColumns: string[] = ['title', 'requestedUser.requestedBy', 'status', 'requestStatus','requestedDate', 'actions'];
|
public displayedColumns: string[] = ['title', 'requestedUser.requestedBy', 'status', 'requestStatus','requestedDate', 'actions'];
|
||||||
public gridCount: string = "15";
|
public gridCount: string = "15";
|
||||||
public isAdmin: boolean;
|
public isAdmin: boolean;
|
||||||
|
public is4kEnabled = false;
|
||||||
public manageOwnRequests: boolean;
|
public manageOwnRequests: boolean;
|
||||||
public defaultSort: string = "requestedDate";
|
public defaultSort: string = "requestedDate";
|
||||||
public defaultOrder: string = "desc";
|
public defaultOrder: string = "desc";
|
||||||
|
@ -49,7 +51,8 @@ export class MoviesGridComponent implements OnInit, AfterViewInit {
|
||||||
constructor(private requestService: RequestServiceV2, private ref: ChangeDetectorRef,
|
constructor(private requestService: RequestServiceV2, private ref: ChangeDetectorRef,
|
||||||
private auth: AuthService, private storageService: StorageService,
|
private auth: AuthService, private storageService: StorageService,
|
||||||
private requestServiceV1: RequestService, private notification: NotificationService,
|
private requestServiceV1: RequestService, private notification: NotificationService,
|
||||||
private translateService: TranslateService) {
|
private translateService: TranslateService,
|
||||||
|
private featureFacade: FeaturesFacade) {
|
||||||
|
|
||||||
this.userName = auth.claims().name;
|
this.userName = auth.claims().name;
|
||||||
}
|
}
|
||||||
|
@ -59,10 +62,14 @@ export class MoviesGridComponent implements OnInit, AfterViewInit {
|
||||||
this.manageOwnRequests = this.auth.hasRole("ManageOwnRequests")
|
this.manageOwnRequests = this.auth.hasRole("ManageOwnRequests")
|
||||||
if (this.isAdmin) {
|
if (this.isAdmin) {
|
||||||
this.displayedColumns.unshift('select');
|
this.displayedColumns.unshift('select');
|
||||||
this.displayedColumns.splice(4,0,'has4kRequest');
|
|
||||||
} else if (this.auth.hasRole("Request4KMovie")) {
|
|
||||||
this.displayedColumns.splice(4,0,'has4kRequest');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.is4kEnabled = this.featureFacade.is4kEnabled();
|
||||||
|
if ((this.isAdmin || this.auth.hasRole("Request4KMovie"))
|
||||||
|
&& this.is4kEnabled) {
|
||||||
|
this.displayedColumns.splice(4, 0, 'has4kRequest');
|
||||||
|
}
|
||||||
|
|
||||||
const defaultCount = this.storageService.get(this.storageKeyGridCount);
|
const defaultCount = this.storageService.get(this.storageKeyGridCount);
|
||||||
const defaultSort = this.storageService.get(this.storageKey);
|
const defaultSort = this.storageService.get(this.storageKey);
|
||||||
const defaultOrder = this.storageService.get(this.storageKeyOrder);
|
const defaultOrder = this.storageService.get(this.storageKeyOrder);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue