mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 11:38:32 -07:00
fix(request-list): 🐛 Fixed an issue where the request options were not appearing for Music requests
This commit is contained in:
parent
acc66fad49
commit
c0406a2dde
3 changed files with 9 additions and 5 deletions
|
@ -60,7 +60,7 @@
|
|||
<th mat-header-cell *matHeaderCellDef> </th>
|
||||
<td mat-cell *matCellDef="let element">
|
||||
<button mat-raised-button color="accent" [routerLink]="'/details/artist/' + element.foreignArtistId">{{ 'Requests.Details' | translate}}</button>
|
||||
<button mat-raised-button color="warn" (click)="openOptions(element)" *ngIf="isAdmin"> {{ 'Requests.Options' | translate}}</button>
|
||||
<button mat-raised-button color="warn" (click)="openOptions(element)" *ngIf="isAdmin || manageOwnRequests"> {{ 'Requests.Options' | translate}}</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ export class AlbumsGridComponent implements OnInit, AfterViewInit {
|
|||
public defaultSort: string = "requestedDate";
|
||||
public defaultOrder: string = "desc";
|
||||
public currentFilter: RequestFilterType = RequestFilterType.All;
|
||||
public manageOwnRequests: boolean;
|
||||
|
||||
public RequestFilter = RequestFilterType;
|
||||
|
||||
|
@ -46,6 +47,7 @@ export class AlbumsGridComponent implements OnInit, AfterViewInit {
|
|||
|
||||
public ngOnInit() {
|
||||
this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser");
|
||||
this.manageOwnRequests = this.auth.hasRole("ManageOwnRequests")
|
||||
|
||||
const defaultCount = this.storageService.get(this.storageKeyGridCount);
|
||||
const defaultSort = this.storageService.get(this.storageKey);
|
||||
|
@ -117,16 +119,17 @@ export class AlbumsGridComponent implements OnInit, AfterViewInit {
|
|||
|
||||
public openOptions(request: IAlbumRequest) {
|
||||
const filter = () => {
|
||||
this.dataSource = this.dataSource.filter((req) => {
|
||||
return req.id !== request.id;
|
||||
})
|
||||
this.dataSource = this.dataSource.filter((req) => {
|
||||
return req.id !== request.id;
|
||||
});
|
||||
};
|
||||
|
||||
const onChange = () => {
|
||||
this.ref.detectChanges();
|
||||
};
|
||||
|
||||
this.onOpenOptions.emit({ request: request, filter: filter, onChange: onChange });
|
||||
const data = { request: request, filter: filter, onChange: onChange, manageOwnRequests: this.manageOwnRequests, isAdmin: this.isAdmin };
|
||||
this.onOpenOptions.emit(data);
|
||||
}
|
||||
|
||||
public switchFilter(type: RequestFilterType) {
|
||||
|
|
|
@ -128,6 +128,7 @@ export class RequestService extends ServiceHelpers {
|
|||
public approveChild(child: ITvUpdateModel): Observable<IRequestEngineResult> {
|
||||
return this.http.post<IRequestEngineResult>(`${this.url}tv/approve`, JSON.stringify(child), {headers: this.headers});
|
||||
}
|
||||
|
||||
public deleteChild(childId: number): Observable<boolean> {
|
||||
return this.http.delete<boolean>(`${this.url}tv/child/${childId}`, {headers: this.headers});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue