mirror of https://github.com/Ombi-app/Ombi
parent
b7bb0869da
commit
1289b840a0
@ -0,0 +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>
|
@ -0,0 +1,9 @@
|
||||
@import "~styles/variables.scss";
|
||||
|
||||
::ng-deep .mat-card {
|
||||
background: $ombi-background-primary-accent;
|
||||
}
|
||||
|
||||
.top-spacing {
|
||||
margin-top:2%;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
import { Component, Inject, OnInit } from "@angular/core";
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { AuthService } from "../../../auth/auth.service";
|
||||
import { IIssues, IIssueSettings, IssueStatus } from "../../../interfaces";
|
||||
import { SettingsService } from "../../../services";
|
||||
|
||||
|
||||
export interface IssuesDetailsGroupData {
|
||||
issues: IIssues[];
|
||||
title: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: "issues-details-group",
|
||||
templateUrl: "details-group.component.html",
|
||||
styleUrls: ["details-group.component.scss"],
|
||||
})
|
||||
export class DetailsGroupComponent implements OnInit {
|
||||
|
||||
public isAdmin: boolean;
|
||||
public IssueStatus = IssueStatus;
|
||||
public settings: IIssueSettings;
|
||||
public get hasRequest(): boolean {
|
||||
return this.data.issues.some(x => x.requestId);
|
||||
}
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<DetailsGroupComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: IssuesDetailsGroupData,
|
||||
private authService: AuthService, private settingsService: SettingsService) { }
|
||||
|
||||
public ngOnInit() {
|
||||
this.isAdmin = this.authService.hasRole("Admin") || this.authService.hasRole("PowerUser");
|
||||
this.settingsService.getIssueSettings().subscribe(x => this.settings = x);
|
||||
}
|
||||
|
||||
public close() {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
|
||||
public navToRequest() {
|
||||
var issue = this.data.issues.filter(x => {
|
||||
return x.requestId;
|
||||
})[0];
|
||||
|
||||
// close dialog and tell calling component to navigate
|
||||
}
|
||||
|
||||
}
|
@ -1,25 +1,19 @@
|
||||
<div class="small-middle-container">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="{{'Issues.PendingTitle' | translate}}">
|
||||
<ng-template matTabContent>
|
||||
<div *ngIf="pendingIssues">
|
||||
<issues-table [issues]="pendingIssues" (changePage)="changePagePending($event)" [totalRecords]="count.pending"></issues-table>
|
||||
</div>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
<mat-tab *ngIf="inProgressIssues.length > 0" label="{{'Issues.InProgressTitle' | translate}}">
|
||||
<ng-template matTabContent>
|
||||
<div *ngIf="inProgressIssues">
|
||||
<issues-table [issues]="inProgressIssues" (changePage)="changePageInProg($event)" [totalRecords]="count.inProgress"></issues-table>
|
||||
</div>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
<mat-tab label="{{'Issues.ResolvedTitle' | translate}}">
|
||||
<ng-template matTabContent>
|
||||
<div *ngIf="resolvedIssues">
|
||||
<issues-table [issues]="resolvedIssues" (changePage)="changePageResolved($event)" [totalRecords]="count.resolved"></issues-table>
|
||||
</div>
|
||||
</ng-template>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
<div class="row" *ngIf="count">
|
||||
|
||||
<div *ngIf="pendingIssues.length > 0" class="col-4">
|
||||
<h2>{{'Issues.PendingTitle' | translate}}</h2>
|
||||
<issues-table [issues]="pendingIssues" (changePage)="changePagePending($event)" [totalRecords]="count.pending"></issues-table>
|
||||
</div>
|
||||
|
||||
<div *ngIf="inProgressIssues.length > 0" class="col-4">
|
||||
<h2>{{'Issues.InProgressTitle' | translate}}</h2>
|
||||
<issues-table [issues]="inProgressIssues" (changePage)="changePageInProg($event)" [totalRecords]="count.inProgress"></issues-table>
|
||||
</div>
|
||||
|
||||
<div *ngIf="resolvedIssues.length > 0" class="col-4">
|
||||
<h2>{{'Issues.ResolvedTitle' | translate}}</h2>
|
||||
<issues-table [issues]="resolvedIssues" (changePage)="changePageResolved($event)" [totalRecords]="count.resolved"></issues-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in new issue