fix(#4345): 🐛 Fixed the issue where denied requests we not appearing correctly

angular-upgrade-proxy
tidusjar 3 years ago
parent cd5532fa8f
commit 5a2f652a28

@ -75,6 +75,7 @@ namespace Ombi.Core.Rule.Rules.Search
episodeSearching.Requested = true;
episodeSearching.Available = ep.Available;
episodeSearching.Approved = ep.Season.ChildRequest.Approved;
episodeSearching.Denied = request.Denied;
}
}
}

@ -30,6 +30,35 @@ namespace Ombi.Store.Entities.Requests
public List<Issues> Issues { get; set; }
public List<SeasonRequests> SeasonRequests { get; set; }
[NotMapped]
public string RequestStatus
{
get
{
if (Available)
{
return "Common.Available";
}
if (Denied ?? false)
{
return "Common.Denied";
}
if (Approved & !Available)
{
return "Common.ProcessingRequest";
}
if (!Approved && !Available)
{
return "Common.PendingApproval";
}
return string.Empty;
}
}
}
public enum SeriesType

@ -29,6 +29,8 @@ namespace Ombi.Store.Repository.Requests
public bool Available { get; set; }
public bool Approved { get; set; }
public bool Requested { get; set; }
[NotMapped]
public bool? Denied { get; set; }
public int SeasonId { get; set; }
[ForeignKey(nameof(SeasonId))]
@ -46,12 +48,17 @@ namespace Ombi.Store.Repository.Requests
return "Common.Available";
}
if (Denied ?? false)
{
return "Common.Denied";
}
if (Approved & !Available)
{
return "Common.ProcessingRequest";
}
if (!Approved && !Available && Requested)
if (!Approved && !Available)
{
return "Common.PendingApproval";
}

@ -130,6 +130,7 @@ export interface IChildRequests extends IBaseRequest {
parentRequest: ITvRequests;
subscribed: boolean;
showSubscribe: boolean;
requestStatus: string;
}
export interface ITvUpdateModel {
@ -168,6 +169,7 @@ export interface IEpisodesRequests {
requested: boolean;
approved: boolean;
requestStatus: string;
denied: boolean;
selected: boolean; // This is for the UI only
}

@ -41,4 +41,9 @@
.top-right.requested span:before{
display: inline-block;
background-color: #ffd740;
}
.top-right.denied span:before{
display: inline-block;
background-color: #ff4040;
}

@ -191,6 +191,13 @@ export class TvRequestGridComponent {
return "available";
}
const allDenied = season.episodes.every((ep) => {
return ep.denied;
});
if (allDenied) {
return "denied";
}
const seasonPending = season.episodes.some((ep) => {
return ep.requested && !ep.approved
});
@ -212,6 +219,10 @@ export class TvRequestGridComponent {
return "available";
}
if (ep.denied) {
return "denied";
}
if (ep.requested && !ep.approved) {
return "requested";
}

@ -2,16 +2,7 @@
<mat-expansion-panel *ngFor="let request of tvRequest">
<mat-expansion-panel-header>
<mat-panel-title>
<div *ngIf="request.approved && !request.available && !request.denied">{{'Common.ProcessingRequest' | translate}}</div>
<div *ngIf="request.denied && !request.available">{{'Common.Denied' | translate}}</div>
<div *ngIf="request.requested && !request.approved && !request.available">
{{'Common.PendingApproval' | translate}}
</div>
<div *ngIf="!request.requested && !request.available && !request.approved">
{{'Common.NotRequested' | translate}}
</div>
<div *ngIf="request.available">{{'Common.Available' | translate}}
</div>
<div> {{ request.requestStatus | translate }}</div>
</mat-panel-title>
<mat-panel-description>
{{'Requests.RequestedBy' | translate}} '{{request.requestedUser.userAlias}}' on
@ -45,15 +36,7 @@
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef> {{ 'Requests.GridStatus' | translate }} </th>
<td mat-cell *matCellDef="let ep">
<span *ngIf="request.denied" id="deniedLabel" [translate]="'Common.Denied'">
</span>
<span *ngIf="!request.denied && ep.available" id="availableLabel" [translate]="'Common.Available'"></span>
<span *ngIf="!request.denied && ep.approved && !ep.available" class="label label-info" id="processingRequestLabel"
[translate]="'Common.ProcessingRequest'"></span>
<div *ngIf="!request.denied && !ep.approved">
<div *ngIf="!ep.available"><span class="label label-warning" id="pendingApprovalLabel" [translate]="'Common.PendingApproval'"></span></div>
</div>
<span> {{ request.requestStatus | translate }} </span>
</td>
</ng-container>

@ -50,12 +50,7 @@
<ng-container matColumnDef="requestStatus">
<th mat-header-cell *matHeaderCellDef> {{'Requests.RequestStatus' | translate}} </th>
<td mat-cell id="requestedStatus{{element.id}}" *matCellDef="let element">
<div *ngIf="element.approved && !element.available">{{'Common.ProcessingRequest' | translate}}</div>
<div *ngIf="!element.approved && !element.available">{{'Common.PendingApproval' |translate}}</div>
<div *ngIf="element.available">{{'Common.Available' | translate}}</div>
</td>
<td mat-cell id="requestedStatus{{element.id}}" *matCellDef="let element"> {{element.requestStatus | translate}} </td>
</ng-container>
<ng-container matColumnDef="status">

Loading…
Cancel
Save