mirror of https://github.com/Ombi-app/Ombi
parent
f777e5d171
commit
67c7d73ca1
@ -1,26 +1,27 @@
|
|||||||
<h1 mat-dialog-title>Issues for {{data.title}}</h1>
|
<mat-card class="issue-card" *ngIf="!deleted">
|
||||||
<div mat-dialog-content>
|
<mat-card-header>
|
||||||
<div class="row">
|
<mat-card-title>{{issue.subject}}</mat-card-title>
|
||||||
<div class="col-6 top-spacing" *ngFor="let issue of data.issues">
|
<mat-card-subtitle>{{issue.userReported?.userName}} on {{issue.createdDate | date:short}}</mat-card-subtitle>
|
||||||
<mat-card color="accent">
|
</mat-card-header>
|
||||||
<mat-card-header>
|
<mat-card-content>
|
||||||
<mat-card-title>{{issue.subject}}</mat-card-title>
|
<p>
|
||||||
<mat-card-subtitle>{{issue.userReported?.userName}} on {{issue.createdDate | date:short}}</mat-card-subtitle>
|
{{issue.description}}
|
||||||
</mat-card-header>
|
</p>
|
||||||
<mat-card-content>
|
</mat-card-content>
|
||||||
<p>
|
<mat-card-actions>
|
||||||
{{issue.description}}
|
<button mat-raised-button (click)="openChat(issue)" color="accent"><i class="far fa-comments"></i> {{'Issues.Chat' | translate }}</button>
|
||||||
</p>
|
<div *ngIf="isAdmin && settings;then content else empty">here is ignored</div>
|
||||||
</mat-card-content>
|
<ng-template #content>
|
||||||
<mat-card-actions *ngIf="isAdmin && settings">
|
<button mat-raised-button color="accent"
|
||||||
<button mat-raised-button color="accent" *ngIf="issue.status === IssueStatus.Pending && settings.enableInProgress" >{{'Issues.MarkInProgress' | translate }}</button>
|
*ngIf="issue.status === IssueStatus.Pending && settings.enableInProgress"
|
||||||
<button mat-raised-button color="accent" *ngIf="issue.status === IssueStatus.Pending && !settings.enableInProgress || issue.status == IssueStatus.InProgress">{{'Issues.MarkResolved' | translate}}</button>
|
(click)="inProgress(issue)">{{'Issues.MarkInProgress' | translate }}</button>
|
||||||
</mat-card-actions>
|
|
||||||
</mat-card>
|
<button mat-raised-button color="accent"
|
||||||
</div>
|
*ngIf="issue.status === IssueStatus.Pending && !settings.enableInProgress || issue.status == IssueStatus.InProgress"
|
||||||
</div>
|
(click)="resolve(issue)">{{'Issues.MarkResolved' | translate}}</button>
|
||||||
</div>
|
|
||||||
<div mat-dialog-actions>
|
<button mat-raised-button color="warn" (click)="delete(issue)"><i class="far fa-times-circle"></i> {{'Issues.Delete' | translate}}</button></ng-template>
|
||||||
<button mat-raised-button color="warn" (click)="close()">Close</button>
|
<ng-template #empty></ng-template>
|
||||||
<button *ngIf="hasRequest" mat-raised-button color="accent" (click)="navToRequest()">View Media</button>
|
</mat-card-actions>
|
||||||
</div>
|
</mat-card>
|
||||||
|
|
||||||
|
@ -1,48 +1,55 @@
|
|||||||
import { Component, Inject, OnInit } from "@angular/core";
|
import { Component, Input } from "@angular/core";
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { AuthService } from "../../../auth/auth.service";
|
import { TranslateService } from "@ngx-translate/core";
|
||||||
import { IIssues, IIssueSettings, IssueStatus } from "../../../interfaces";
|
import { IIssues, IIssueSettings, IssueStatus } from "../../../interfaces";
|
||||||
import { SettingsService } from "../../../services";
|
import { IssuesService, NotificationService } from "../../../services";
|
||||||
|
import { IssueChatComponent } from "../issue-chat/issue-chat.component";
|
||||||
|
|
||||||
export interface IssuesDetailsGroupData {
|
|
||||||
issues: IIssues[];
|
|
||||||
title: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "issues-details-group",
|
selector: "issues-details-group",
|
||||||
templateUrl: "details-group.component.html",
|
templateUrl: "details-group.component.html",
|
||||||
styleUrls: ["details-group.component.scss"],
|
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 IssueStatus = IssueStatus;
|
||||||
public settings: IIssueSettings;
|
|
||||||
public get hasRequest(): boolean {
|
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>,
|
constructor(
|
||||||
@Inject(MAT_DIALOG_DATA) public data: IssuesDetailsGroupData,
|
private translateService: TranslateService, private issuesService: IssuesService,
|
||||||
private authService: AuthService, private settingsService: SettingsService) { }
|
private notificationService: NotificationService, private dialog: MatDialog) { }
|
||||||
|
|
||||||
public ngOnInit() {
|
public async delete(issue: IIssues) {
|
||||||
this.isAdmin = this.authService.hasRole("Admin") || this.authService.hasRole("PowerUser");
|
await this.issuesService.deleteIssue(issue.id);
|
||||||
this.settingsService.getIssueSettings().subscribe(x => this.settings = x);
|
this.notificationService.success(this.translateService.instant("Issues.DeletedIssue"));
|
||||||
|
this.deleted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public close() {
|
public openChat(issue: IIssues) {
|
||||||
this.dialogRef.close();
|
this.dialog.open(IssueChatComponent, { width: "100vh", data: { issueId: issue.id }, panelClass: 'modal-panel' })
|
||||||
}
|
}
|
||||||
|
|
||||||
public navToRequest() {
|
|
||||||
var issue = this.data.issues.filter(x => {
|
|
||||||
return x.requestId;
|
|
||||||
})[0];
|
|
||||||
|
|
||||||
// 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>
|
<h1>Issues for {{details.title}}</h1>
|
||||||
<div>
|
<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="row">
|
||||||
<div class="col-6 top-spacing" *ngFor="let issue of details.issues">
|
<div class="col-6 top-spacing" *ngFor="let issue of details.issues">
|
||||||
<div color="accent">
|
<issues-details-group [issue]="issue" [settings]="settings" [isAdmin]="isAdmin"></issues-details-group>
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<button mat-raised-button color="accent" (click)="navToMedia()">{{'Common.ViewDetails' | translate }}</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in new issue