Skip to content

Commit

Permalink
Add option for redirecting grief reports to photos
Browse files Browse the repository at this point in the history
Required change for LittleBigRefresh/Refresh#199
  • Loading branch information
jvyden committed Oct 17, 2023
1 parent f3422d5 commit 0fe0dd8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/app/api/types/extended-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export interface ExtendedUser extends User {
rpcnAuthenticationAllowed: boolean;
psnAuthenticationAllowed: boolean;

redirectGriefReportsToPhotos: boolean;

emailAddress: string | undefined;
emailAddressVerified: boolean;
}
2 changes: 2 additions & 0 deletions src/app/api/types/user-update-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ export interface UserUpdateRequest {
psnAuthenticationAllowed: boolean | undefined;
rpcnAuthenticationAllowed: boolean | undefined;

redirectGriefReportsToPhotos: boolean | undefined;

emailAddress: string | undefined;
}
1 change: 1 addition & 0 deletions src/app/pages/settings/settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<form-checkbox [icon]="faKey" name="Allow IP Authentication" [(value)]="allowIpAuth"></form-checkbox>
<form-checkbox [icon]="faGamepad" name="Allow PSN (PS3/Vita/PSP) Authentication" [(value)]="allowPsnAuth"></form-checkbox>
<form-checkbox [icon]="faDesktop" name="Allow RPCS3 Authentication" [(value)]="allowRpcnAuth"></form-checkbox>
<form-checkbox [icon]="faCamera" name="Redirect Grief Reports to Photos" [(value)]="redirectGriefReportsToPhotos"></form-checkbox>

<form-input [icon]="faPencil" name="Biography" [(value)]="description"></form-input>
<form-input [icon]="faEnvelope" name="Email Address" [(value)]="email"></form-input>
Expand Down
11 changes: 7 additions & 4 deletions src/app/pages/settings/settings.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Component, OnInit} from '@angular/core';
import {ApiClient} from "../../api/api-client";
import {UserUpdateRequest} from "../../api/types/user-update-request";
import {faDesktop, faEnvelope, faGamepad, faKey, faTrash, faPencil} from "@fortawesome/free-solid-svg-icons";
import {faDesktop, faEnvelope, faGamepad, faKey, faTrash, faPencil, faCamera} from "@fortawesome/free-solid-svg-icons";
import {ExtendedUser} from "../../api/types/extended-user";
import {startWith} from "rxjs";

Expand All @@ -16,9 +16,7 @@ export class SettingsComponent implements OnInit {
allowIpAuth: boolean = false;
allowPsnAuth: boolean = false;
allowRpcnAuth: boolean = false;

protected readonly faPencil = faPencil;
protected readonly faKey = faKey;
redirectGriefReportsToPhotos: boolean = false;

constructor(private apiClient: ApiClient) {
}
Expand All @@ -36,6 +34,7 @@ export class SettingsComponent implements OnInit {
this.allowIpAuth = data?.allowIpAuthentication ?? false;
this.allowPsnAuth = data?.psnAuthenticationAllowed ?? false;
this.allowRpcnAuth = data?.rpcnAuthenticationAllowed ?? false;
this.redirectGriefReportsToPhotos = data?.redirectGriefReportsToPhotos ?? false;
}

saveChanges() {
Expand All @@ -46,13 +45,17 @@ export class SettingsComponent implements OnInit {
allowIpAuthentication: this.allowIpAuth,
psnAuthenticationAllowed: this.allowPsnAuth,
rpcnAuthenticationAllowed: this.allowRpcnAuth,
redirectGriefReportsToPhotos: this.redirectGriefReportsToPhotos,
};

this.apiClient.UpdateUser(request);
}

protected readonly faPencil = faPencil;
protected readonly faKey = faKey;
protected readonly faDesktop = faDesktop;
protected readonly faGamepad = faGamepad;
protected readonly faEnvelope = faEnvelope;
protected readonly faTrash = faTrash;
protected readonly faCamera = faCamera;
}

0 comments on commit 0fe0dd8

Please sign in to comment.