think i've finished the new issues work

pull/4083/head
tidusjar 4 years ago
parent f777e5d171
commit 67c7d73ca1

@ -32,7 +32,7 @@ namespace Ombi.Core.Engine.V2
public async Task<IEnumerable<IssuesSummaryModel>> GetIssues(int position, int take, IssueStatus status, CancellationToken token)
{
var issues = await _issues.GetAll().Where(x => x.Status == status).Skip(position).Take(take).OrderBy(x => x.Title).ToListAsync(token);
var issues = await _issues.GetAll().Where(x => x.Status == status && x.ProviderId != null).Skip(position).Take(take).OrderBy(x => x.Title).ToListAsync(token);
var grouped = issues.GroupBy(x => x.Title, (key, g) => new { Title = key, Issues = g });
var model = new List<IssuesSummaryModel>();

@ -1,26 +1,27 @@
<h1 mat-dialog-title>Issues for {{data.title}}</h1>
<div mat-dialog-content>
<div class="row">
<div class="col-6 top-spacing" *ngFor="let issue of data.issues">
<mat-card color="accent">
<mat-card-header>
<mat-card-title>{{issue.subject}}</mat-card-title>
<mat-card-subtitle>{{issue.userReported?.userName}} on {{issue.createdDate | date:short}}</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<p>
{{issue.description}}
</p>
</mat-card-content>
<mat-card-actions *ngIf="isAdmin && settings">
<button mat-raised-button color="accent" *ngIf="issue.status === IssueStatus.Pending && settings.enableInProgress" >{{'Issues.MarkInProgress' | translate }}</button>
<button mat-raised-button color="accent" *ngIf="issue.status === IssueStatus.Pending && !settings.enableInProgress || issue.status == IssueStatus.InProgress">{{'Issues.MarkResolved' | translate}}</button>
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
<div mat-dialog-actions>
<button mat-raised-button color="warn" (click)="close()">Close</button>
<button *ngIf="hasRequest" mat-raised-button color="accent" (click)="navToRequest()">View Media</button>
</div>
<mat-card class="issue-card" *ngIf="!deleted">
<mat-card-header>
<mat-card-title>{{issue.subject}}</mat-card-title>
<mat-card-subtitle>{{issue.userReported?.userName}} on {{issue.createdDate | date:short}}</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<p>
{{issue.description}}
</p>
</mat-card-content>
<mat-card-actions>
<button mat-raised-button (click)="openChat(issue)" color="accent"><i class="far fa-comments"></i> {{'Issues.Chat' | translate }}</button>
<div *ngIf="isAdmin && settings;then content else empty">here is ignored</div>
<ng-template #content>
<button mat-raised-button color="accent"
*ngIf="issue.status === IssueStatus.Pending && settings.enableInProgress"
(click)="inProgress(issue)">{{'Issues.MarkInProgress' | translate }}</button>
<button mat-raised-button color="accent"
*ngIf="issue.status === IssueStatus.Pending && !settings.enableInProgress || issue.status == IssueStatus.InProgress"
(click)="resolve(issue)">{{'Issues.MarkResolved' | translate}}</button>
<button mat-raised-button color="warn" (click)="delete(issue)"><i class="far fa-times-circle"></i> {{'Issues.Delete' | translate}}</button></ng-template>
<ng-template #empty></ng-template>
</mat-card-actions>
</mat-card>

@ -1,7 +1,7 @@
@import "~styles/variables.scss";
::ng-deep .mat-card {
background: $ombi-background-primary-accent;
::ng-deep .issue-card {
border: 3px solid $ombi-background-primary-accent;
}
.top-spacing {

@ -1,48 +1,55 @@
import { Component, Inject, OnInit } from "@angular/core";
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { AuthService } from "../../../auth/auth.service";
import { Component, Input } from "@angular/core";
import { MatDialog } from '@angular/material/dialog';
import { TranslateService } from "@ngx-translate/core";
import { IIssues, IIssueSettings, IssueStatus } from "../../../interfaces";
import { SettingsService } from "../../../services";
export interface IssuesDetailsGroupData {
issues: IIssues[];
title: string;
}
import { IssuesService, NotificationService } from "../../../services";
import { IssueChatComponent } from "../issue-chat/issue-chat.component";
@Component({
selector: "issues-details-group",
templateUrl: "details-group.component.html",
styleUrls: ["details-group.component.scss"],
})
export class DetailsGroupComponent implements OnInit {
export class DetailsGroupComponent {
public isAdmin: boolean;
@Input() public issue: IIssues;
@Input() public isAdmin: boolean;
@Input() public settings: IIssueSettings;
public deleted: boolean;
public IssueStatus = IssueStatus;
public settings: IIssueSettings;
public get hasRequest(): boolean {
return this.data.issues.some(x => x.requestId);
if (this.issue.requestId) {
return true;
}
return false;
}
constructor(public dialogRef: MatDialogRef<DetailsGroupComponent>,
@Inject(MAT_DIALOG_DATA) public data: IssuesDetailsGroupData,
private authService: AuthService, private settingsService: SettingsService) { }
constructor(
private translateService: TranslateService, private issuesService: IssuesService,
private notificationService: NotificationService, private dialog: MatDialog) { }
public ngOnInit() {
this.isAdmin = this.authService.hasRole("Admin") || this.authService.hasRole("PowerUser");
this.settingsService.getIssueSettings().subscribe(x => this.settings = x);
public async delete(issue: IIssues) {
await this.issuesService.deleteIssue(issue.id);
this.notificationService.success(this.translateService.instant("Issues.DeletedIssue"));
this.deleted = true;
}
public close() {
this.dialogRef.close();
}
public navToRequest() {
var issue = this.data.issues.filter(x => {
return x.requestId;
})[0];
public openChat(issue: IIssues) {
this.dialog.open(IssueChatComponent, { width: "100vh", data: { issueId: issue.id }, panelClass: 'modal-panel' })
}
// close dialog and tell calling component to navigate
}
public resolve(issue: IIssues) {
this.issuesService.updateStatus({issueId: issue.id, status: IssueStatus.Resolved}).subscribe(() => {
this.notificationService.success(this.translateService.instant("Issues.MarkedAsResolved"));
issue.status = IssueStatus.Resolved;
});
}
public inProgress(issue: IIssues) {
this.issuesService.updateStatus({issueId: issue.id, status: IssueStatus.InProgress}).subscribe(() => {
this.notificationService.success(this.translateService.instant("Issues.MarkedAsInProgress"));
issue.status = IssueStatus.InProgress;
});
}
}

@ -1,39 +1,20 @@
<div *ngIf="details">
<div class="container top-spacing" *ngIf="details">
<h1>Issues for {{details.title}}</h1>
<div>
<span>Has Request {{hasRequest}}</span>
<span>{{'Issues.Requested' | translate}}
<i *ngIf="!hasRequest" class="far fa-times-circle"></i>
<i *ngIf="hasRequest" class="far fa-check-circle"></i>
</span>
<div>
<button mat-raised-button color="accent" (click)="navToMedia()"><i class="far fa-eye"></i> {{'Common.ViewDetails' | translate }}</button>
</div>
<div class="row">
<div class="col-6 top-spacing" *ngFor="let issue of details.issues">
<div color="accent">
<div>
<div>{{issue.subject}}</div>
<span>{{issue.userReported?.userName}} on {{issue.createdDate | date:short}}</span>
</div>
<div>
<p>
{{issue.description}}
</p>
</div>
<div>
<button mat-raised-button (click)="openChat(issue)" color="accent">{{'Issues.Chat' | translate }}</button>
<span *ngIf="isAdmin && settings">
<button mat-raised-button color="accent"
*ngIf="issue.status === IssueStatus.Pending && settings.enableInProgress"
(click)="inProgress(issue)">{{'Issues.MarkInProgress' | translate }}</button>
<button mat-raised-button color="accent"
*ngIf="issue.status === IssueStatus.Pending && !settings.enableInProgress || issue.status == IssueStatus.InProgress"
(click)="resolve(issue)">{{'Issues.MarkResolved' | translate}}</button>
<button mat-raised-button color="warn" (click)="delete(issue)">{{'Issues.Delete' | translate}}</button>
</span>
</div>
</div>
<issues-details-group [issue]="issue" [settings]="settings" [isAdmin]="isAdmin"></issues-details-group>
</div>
</div>
</div>
<div class="row">
<button mat-raised-button color="accent" (click)="navToMedia()">{{'Common.ViewDetails' | translate }}</button>
</div>
</div>
</div>

@ -70,7 +70,7 @@ export class IssuesDetailsComponent implements OnInit {
}
public openChat(issue: IIssues) {
this.dialog.open(IssueChatComponent, { width: "80vh", data: { issueId: issue.id }, panelClass: 'modal-panel' })
this.dialog.open(IssueChatComponent, { width: "100vh", data: { issueId: issue.id }, panelClass: 'modal-panel' })
}
public navToMedia() {

@ -1,6 +1,5 @@
import { IssuesV2Service } from "../../services/issuesv2.service";
import { IdentityService, SearchService } from "../../services";
import { DetailsGroupComponent } from "./details-group/details-group.component";
import { IssuesDetailsComponent } from "./details/details.component";
import { IssueChatComponent } from "./issue-chat/issue-chat.component";
import { ChatBoxComponent } from "../../shared/chat-box/chat-box.component";
@ -8,7 +7,6 @@ import { ChatBoxComponent } from "../../shared/chat-box/chat-box.component";
export const components: any[] = [
DetailsGroupComponent,
IssuesDetailsComponent,
IssueChatComponent,
ChatBoxComponent,

@ -20,7 +20,7 @@ export interface ChatData {
export class IssueChatComponent implements OnInit {
public isAdmin: boolean;
public comments: IIssuesChat[];
public comments: IIssuesChat[] = [];
public IssueStatus = IssueStatus;
public settings: IIssueSettings;
public messages: ChatMessages[] = [];

@ -20,6 +20,7 @@ import { IssuesPanelComponent } from "./shared/issues-panel/issues-panel.compone
import { TvAdvancedOptionsComponent } from "./tv/panels/tv-advanced-options/tv-advanced-options.component";
import { RequestBehalfComponent } from "./shared/request-behalf/request-behalf.component";
import { TvRequestGridComponent } from "./tv/panels/tv-request-grid/tv-request-grid.component";
import { DetailsGroupComponent } from "../../issues/components/details-group/details-group.component";
export const components: any[] = [
MovieDetailsComponent,

@ -13,6 +13,11 @@
<!-- content start -->
<mat-accordion class="mat-elevation-z8">
<div *ngFor="let issue of issues">
<issues-details-group [issue]="issue" [settings]="settings" [isAdmin]="isAdmin"></issues-details-group>
</div>
<!--
<mat-expansion-panel *ngFor="let issue of issues">
<mat-expansion-panel-header>
<mat-panel-title>
@ -54,7 +59,7 @@
<button mat-raised-button color="warn" (click)="delete(issue)"> {{ 'Issues.Delete' | translate }}</button>
</div>
</div>
</mat-expansion-panel>
</mat-expansion-panel> -->
</mat-accordion>
<!-- content end -->

@ -1,4 +1,4 @@
<div class='container' *ngIf="messages.length > 0">
<div class='container'>
<div class='chatbox'>
<div class='chatbox__user-list'>
<h1>Users</h1>

@ -49,6 +49,7 @@ html,body {
align-items: center;
flex-direction: column;
height: 70vh;
width: 100%;
h1 {
margin: 0.5em auto;
color: #FFF;
@ -58,8 +59,8 @@ html,body {
.chatbox {
background: rgba(255, 255, 255, 0.05);
width: 600px;
height: 75%;
width: 85%;
height: 100%;
border-radius: 0.2em;
position: relative;
box-shadow: 1px 1px 12px rgba(0, 0, 0, 0.1);

@ -36,11 +36,13 @@ import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
import { MatSlideToggleModule } from "@angular/material/slide-toggle";
import { MatTabsModule } from "@angular/material/tabs";
import { EpisodeRequestComponent } from "./episode-request/episode-request.component";
import { DetailsGroupComponent } from "../issues/components/details-group/details-group.component";
@NgModule({
declarations: [
IssuesReportComponent,
EpisodeRequestComponent,
DetailsGroupComponent,
],
imports: [
SidebarModule,
@ -76,6 +78,7 @@ import { EpisodeRequestComponent } from "./episode-request/episode-request.compo
],
entryComponents: [
EpisodeRequestComponent,
DetailsGroupComponent,
],
exports: [
TranslateModule,
@ -86,6 +89,7 @@ import { EpisodeRequestComponent } from "./episode-request/episode-request.compo
MatProgressSpinnerModule,
IssuesReportComponent,
EpisodeRequestComponent,
DetailsGroupComponent,
TruncateModule,
InputSwitchModule,
MatTreeModule,

@ -216,7 +216,9 @@
"MarkedAsResolved": "This issue has now been marked as resolved!",
"MarkedAsInProgress": "This issue has now been marked as in progress!",
"Delete": "Delete issue",
"DeletedIssue": "Issue has been deleted"
"DeletedIssue": "Issue has been deleted",
"Chat":"Chat",
"Requested":"Requested"
},
"Filter": {
"ClearFilter": "Clear Filter",

Loading…
Cancel
Save