-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64faf07
commit db97c01
Showing
21 changed files
with
427 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/app/dialogs/report-details-dialog/report-details.dialog.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<div mat-dialog-title>Report</div> | ||
<div mat-dialog-content> | ||
|
||
<div class="flex-col gap-0 margin-top-5"> | ||
<mat-form-field appearance="outline" class="width-100 padding-top-10"> | ||
<mat-label>Comment</mat-label> | ||
<textarea matInput name="comment" cdkTextareaAutosize #autosize="cdkTextareaAutosize" cdkAutosizeMinRows="4" | ||
cdkAutosizeMaxRows="10" placeholder="Comment" #commentModel="ngModel" [(ngModel)]="comment" | ||
aria-label="Comment" disabled></textarea> | ||
</mat-form-field> | ||
|
||
<mat-form-field appearance="outline"> | ||
<mat-label>Category</mat-label> | ||
<mat-select [(value)]="category" disabled> | ||
<mat-option *ngFor="let item of categories" [value]="item">{{ item }}</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
|
||
<mat-form-field appearance="outline"> | ||
<mat-label>Server rules</mat-label> | ||
<mat-select [(value)]="ruleIds" multiple disabled> | ||
<mat-option *ngFor="let rule of rules" [value]="rule.id">{{ rule.text }}</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
|
||
<mat-checkbox *ngIf="data?.user?.isLocal === false" name="forward" color="primary" [disableRipple]="true" [(ngModel)]="forward" disabled> | ||
Should the report be forwarded to the remote admin? | ||
</mat-checkbox> | ||
</div> | ||
</div> | ||
<div mat-dialog-actions> | ||
<button mat-button type="button" (click)="onNoClick()">Close</button> | ||
</div> |
48 changes: 48 additions & 0 deletions
48
src/app/dialogs/report-details-dialog/report-details.dialog.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Component, Inject, OnInit } from '@angular/core'; | ||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; | ||
import { Rule } from 'src/app/models/rule'; | ||
import { Report } from 'src/app/models/report'; | ||
import { InstanceService } from 'src/app/services/http/instance.service'; | ||
|
||
@Component({ | ||
selector: 'report-details', | ||
templateUrl: 'report-details.dialog.html' | ||
}) | ||
export class ReportDetailsDialog implements OnInit { | ||
comment = ''; | ||
forward = false; | ||
category = ''; | ||
ruleIds: number[] = []; | ||
|
||
categories = [ | ||
"Abusive", | ||
"Copyright", | ||
"Impersonation", | ||
"Scam", | ||
"Sensitive", | ||
"Spam", | ||
"Terrorism", | ||
"Underage", | ||
"Violence" | ||
]; | ||
|
||
rules: Rule[] = [] | ||
|
||
constructor( | ||
private instanceService: InstanceService, | ||
public dialogRef: MatDialogRef<ReportDetailsDialog>, | ||
@Inject(MAT_DIALOG_DATA) public data?: Report) { | ||
} | ||
|
||
ngOnInit(): void { | ||
this.rules = this.instanceService.instance?.rules ?? []; | ||
this.comment = this.data?.comment ?? ''; | ||
this.forward = this.data?.forward ?? false; | ||
this.category = this.data?.category ?? ''; | ||
this.ruleIds = this.data?.ruleIds?.map(x => +x) ?? []; | ||
} | ||
|
||
onNoClick(): void { | ||
this.dialogRef.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Status } from "src/app/models/status"; | ||
import { User } from "src/app/models/user"; | ||
|
||
export class ReportData { | ||
public user?: User; | ||
public status?: Status; | ||
|
||
constructor(user?: User, status?: Status) { | ||
this.user = user; | ||
this.status = status; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export class PaginableResult<T> { | ||
public page = 0; | ||
public size = 0; | ||
public total = 0; | ||
public data: T[] = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Status } from "./status"; | ||
import { User } from "./user"; | ||
|
||
export class Report { | ||
public id: string = ''; | ||
public user?: User; | ||
public reportedUser?: User; | ||
public status?: Status; | ||
public comment?: string; | ||
public forward = false; | ||
public category?: string; | ||
public ruleIds?: number[]; | ||
public considerationDate?: Date; | ||
public considerationUser?: User; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.