From 67c7d73ca1cd839bc4c86d845d6cb1904e74ad3d Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 3 Mar 2021 21:28:37 +0000 Subject: [PATCH] think i've finished the new issues work --- src/Ombi.Core/Engine/V2/IssuesEngine.cs | 2 +- .../details-group.component.html | 53 ++++++++------- .../details-group.component.scss | 4 +- .../details-group/details-group.component.ts | 67 ++++++++++--------- .../components/details/details.component.html | 39 +++-------- .../components/details/details.component.ts | 2 +- .../src/app/issues/components/index.ts | 2 - .../issue-chat/issue-chat.component.ts | 2 +- .../src/app/media-details/components/index.ts | 1 + .../issues-panel/issues-panel.component.html | 7 +- .../shared/chat-box/chat-box.component.html | 2 +- .../shared/chat-box/chat-box.component.scss | 5 +- .../ClientApp/src/app/shared/shared.module.ts | 4 ++ src/Ombi/wwwroot/translations/en.json | 4 +- 14 files changed, 97 insertions(+), 97 deletions(-) diff --git a/src/Ombi.Core/Engine/V2/IssuesEngine.cs b/src/Ombi.Core/Engine/V2/IssuesEngine.cs index f938e8ec6..830dd4295 100644 --- a/src/Ombi.Core/Engine/V2/IssuesEngine.cs +++ b/src/Ombi.Core/Engine/V2/IssuesEngine.cs @@ -32,7 +32,7 @@ namespace Ombi.Core.Engine.V2 public async Task> 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(); diff --git a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html index 9738e24c7..c4906baac 100644 --- a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html +++ b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html @@ -1,26 +1,27 @@ -

Issues for {{data.title}}

-
-
-
- - - {{issue.subject}} - {{issue.userReported?.userName}} on {{issue.createdDate | date:short}} - - -

- {{issue.description}} -

-
- - - - -
-
-
-
-
- - -
+ + + {{issue.subject}} + {{issue.userReported?.userName}} on {{issue.createdDate | date:short}} + + +

+ {{issue.description}} +

+
+ + +
here is ignored
+ + + + + + + +
+
+ diff --git a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.scss b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.scss index d6dcd67de..c244fdd09 100644 --- a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.scss +++ b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.scss @@ -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 { diff --git a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.ts b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.ts index aea5eb123..4f7ddc612 100644 --- a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.ts +++ b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.ts @@ -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, - @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; + }); + } } diff --git a/src/Ombi/ClientApp/src/app/issues/components/details/details.component.html b/src/Ombi/ClientApp/src/app/issues/components/details/details.component.html index 08cb2dc44..bc0e8a794 100644 --- a/src/Ombi/ClientApp/src/app/issues/components/details/details.component.html +++ b/src/Ombi/ClientApp/src/app/issues/components/details/details.component.html @@ -1,39 +1,20 @@ -
+

Issues for {{details.title}}

- Has Request {{hasRequest}} - + {{'Issues.Requested' | translate}} + + + +
+ +
-
-
-
{{issue.subject}}
- {{issue.userReported?.userName}} on {{issue.createdDate | date:short}} -
-
-

- {{issue.description}} -

-
-
- - - - - - -
- -
+
-
-
\ No newline at end of file +
diff --git a/src/Ombi/ClientApp/src/app/issues/components/details/details.component.ts b/src/Ombi/ClientApp/src/app/issues/components/details/details.component.ts index accc99e60..4003acd40 100644 --- a/src/Ombi/ClientApp/src/app/issues/components/details/details.component.ts +++ b/src/Ombi/ClientApp/src/app/issues/components/details/details.component.ts @@ -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() { diff --git a/src/Ombi/ClientApp/src/app/issues/components/index.ts b/src/Ombi/ClientApp/src/app/issues/components/index.ts index 99a07492b..52e4ed03c 100644 --- a/src/Ombi/ClientApp/src/app/issues/components/index.ts +++ b/src/Ombi/ClientApp/src/app/issues/components/index.ts @@ -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, diff --git a/src/Ombi/ClientApp/src/app/issues/components/issue-chat/issue-chat.component.ts b/src/Ombi/ClientApp/src/app/issues/components/issue-chat/issue-chat.component.ts index a1ecf27f3..023fdbf12 100644 --- a/src/Ombi/ClientApp/src/app/issues/components/issue-chat/issue-chat.component.ts +++ b/src/Ombi/ClientApp/src/app/issues/components/issue-chat/issue-chat.component.ts @@ -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[] = []; diff --git a/src/Ombi/ClientApp/src/app/media-details/components/index.ts b/src/Ombi/ClientApp/src/app/media-details/components/index.ts index 240fba28a..e8cb89d4a 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/index.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/index.ts @@ -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, diff --git a/src/Ombi/ClientApp/src/app/media-details/components/shared/issues-panel/issues-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/shared/issues-panel/issues-panel.component.html index c4c05dff9..d71ca8fcd 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/shared/issues-panel/issues-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/shared/issues-panel/issues-panel.component.html @@ -13,6 +13,11 @@ + +
+ +
+
diff --git a/src/Ombi/ClientApp/src/app/shared/chat-box/chat-box.component.html b/src/Ombi/ClientApp/src/app/shared/chat-box/chat-box.component.html index 85463dea1..aa19bf1db 100644 --- a/src/Ombi/ClientApp/src/app/shared/chat-box/chat-box.component.html +++ b/src/Ombi/ClientApp/src/app/shared/chat-box/chat-box.component.html @@ -1,4 +1,4 @@ -
+

Users

diff --git a/src/Ombi/ClientApp/src/app/shared/chat-box/chat-box.component.scss b/src/Ombi/ClientApp/src/app/shared/chat-box/chat-box.component.scss index d64de471b..70f83b85f 100644 --- a/src/Ombi/ClientApp/src/app/shared/chat-box/chat-box.component.scss +++ b/src/Ombi/ClientApp/src/app/shared/chat-box/chat-box.component.scss @@ -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); diff --git a/src/Ombi/ClientApp/src/app/shared/shared.module.ts b/src/Ombi/ClientApp/src/app/shared/shared.module.ts index ed93fa375..afe27bb7e 100644 --- a/src/Ombi/ClientApp/src/app/shared/shared.module.ts +++ b/src/Ombi/ClientApp/src/app/shared/shared.module.ts @@ -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, diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 0efb3fe88..4b82d8224 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -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",