diff --git a/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.html b/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.html index 454874490..29ac3699e 100644 --- a/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.html +++ b/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.html @@ -22,7 +22,23 @@

{{request.title}}

- +
+ + +
diff --git a/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.scss b/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.scss index 3580331a3..7dd442aa4 100644 --- a/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.scss +++ b/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.scss @@ -50,5 +50,9 @@ position: absolute; } } + + .action-items button { + margin: 4px; + } } diff --git a/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.ts b/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.ts index 1a66516fd..b0b3154a4 100644 --- a/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.ts +++ b/src/Ombi/ClientApp/src/app/components/detailed-card/detailed-card.component.ts @@ -22,6 +22,7 @@ export class DetailedCardComponent implements OnInit, OnDestroy { @Input() public isAdmin: boolean = false; @Output() public onClick: EventEmitter = new EventEmitter(); @Output() public onApprove: EventEmitter = new EventEmitter(); + @Output() public onDeny: EventEmitter = new EventEmitter(); public RequestType = RequestType; public loading: false; @@ -65,6 +66,10 @@ export class DetailedCardComponent implements OnInit, OnDestroy { this.onApprove.emit(); } + public deny() { + this.onDeny.emit(); + } + public getClass(request: IRecentlyRequested) { if (request.denied) { return "danger"; diff --git a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html index f73b74752..21af026f0 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.html @@ -3,9 +3,14 @@ - + + - \ No newline at end of file + diff --git a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.ts b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.ts index e869abc13..d30b4b66d 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/recently-requested-list/recently-requested-list.component.ts @@ -8,6 +8,8 @@ import { Router } from "@angular/router"; import { AuthService } from "app/auth/auth.service"; import { NotificationService, RequestService } from "app/services"; import { TranslateService } from "@ngx-translate/core"; +import { DenyDialogComponent } from '../../../media-details/components/shared/deny-dialog/deny-dialog.component'; +import { MatDialog } from "@angular/material/dialog"; export enum DiscoverType { Upcoming, @@ -42,7 +44,8 @@ export class RecentlyRequestedListComponent implements OnInit, OnDestroy { private router: Router, private authService: AuthService, private notificationService: NotificationService, - private translateService: TranslateService) { + private translateService: TranslateService, + public dialog: MatDialog) { Carousel.prototype.onTouchMove = () => {}; this.responsiveOptions = ResponsiveOptions; } @@ -81,6 +84,20 @@ export class RecentlyRequestedListComponent implements OnInit, OnDestroy { } } + public deny(request: IRecentlyRequested) { + const dialogRef = this.dialog.open(DenyDialogComponent, { + width: '250px', + data: { requestId: request.requestId, is4K: false, requestType: request.type } + }); + + dialogRef.afterClosed().subscribe(result => { + if (result) { + this.notificationService.success(this.translateService.instant("Requests.SuccessfullyDenied")); + request.denied = true; + } + }); + } + private handleApproval(result: IRequestEngineResult, request: IRecentlyRequested) { if (result.result) { this.notificationService.success(this.translateService.instant("Requests.SuccessfullyApproved")); diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index f3e2813a9..01d80059e 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -221,6 +221,7 @@ "Denied": "Successfully denied selected items" }, "SuccessfullyApproved": "Successfully Approved", + "SuccessfullyDenied": "Successfully Denied", "SuccessfullyDeleted": "Request successfully deleted", "NowAvailable": "Request is now available", "NowUnavailable": "Request is now unavailable",