From c30745f342480b59fb0856a059c8c2fbffbcfc6a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 1 Dec 2017 17:38:26 +0100 Subject: Add account settings new design --- .../account-details/account-details.component.html | 16 ----- .../account-details/account-details.component.ts | 68 ---------------------- client/src/app/account/account-details/index.ts | 1 - 3 files changed, 85 deletions(-) delete mode 100644 client/src/app/account/account-details/account-details.component.html delete mode 100644 client/src/app/account/account-details/account-details.component.ts delete mode 100644 client/src/app/account/account-details/index.ts (limited to 'client/src/app/account/account-details') diff --git a/client/src/app/account/account-details/account-details.component.html b/client/src/app/account/account-details/account-details.component.html deleted file mode 100644 index 8f4f176af..000000000 --- a/client/src/app/account/account-details/account-details.component.html +++ /dev/null @@ -1,16 +0,0 @@ -
{{ error }}
- -
-
- - -
- {{ formErrors['displayNSFW'] }} -
-
- - -
diff --git a/client/src/app/account/account-details/account-details.component.ts b/client/src/app/account/account-details/account-details.component.ts deleted file mode 100644 index d7a6e6871..000000000 --- a/client/src/app/account/account-details/account-details.component.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core' -import { FormBuilder, FormGroup } from '@angular/forms' -import { Router } from '@angular/router' - -import { NotificationsService } from 'angular2-notifications' - -import { AuthService } from '../../core' -import { - FormReactive, - User, - UserService, - USER_PASSWORD -} from '../../shared' -import { UserUpdateMe } from '../../../../../shared' - -@Component({ - selector: 'my-account-details', - templateUrl: './account-details.component.html' -}) - -export class AccountDetailsComponent extends FormReactive implements OnInit { - @Input() user: User = null - - error: string = null - - form: FormGroup - formErrors = {} - validationMessages = {} - - constructor ( - private authService: AuthService, - private formBuilder: FormBuilder, - private notificationsService: NotificationsService, - private userService: UserService - ) { - super() - } - - buildForm () { - this.form = this.formBuilder.group({ - displayNSFW: [ this.user.displayNSFW ] - }) - - this.form.valueChanges.subscribe(data => this.onValueChanged(data)) - } - - ngOnInit () { - this.buildForm() - } - - updateDetails () { - const displayNSFW = this.form.value['displayNSFW'] - const details: UserUpdateMe = { - displayNSFW - } - - this.error = null - this.userService.updateMyDetails(details).subscribe( - () => { - this.notificationsService.success('Success', 'Information updated.') - - this.authService.refreshUserInformation() - }, - - err => this.error = err.message - ) - } -} diff --git a/client/src/app/account/account-details/index.ts b/client/src/app/account/account-details/index.ts deleted file mode 100644 index 4829f608a..000000000 --- a/client/src/app/account/account-details/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './account-details.component' -- cgit v1.2.3