From 1942f11d5ee6926ad93dc1b79fae18325ba5de18 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 Jun 2020 14:49:20 +0200 Subject: Lazy load all routes --- client/src/app/reset-password/index.ts | 3 -- .../reset-password-routing.module.ts | 23 -------- .../reset-password/reset-password.component.html | 31 ----------- .../reset-password/reset-password.component.scss | 12 ----- .../app/reset-password/reset-password.component.ts | 61 ---------------------- .../app/reset-password/reset-password.module.ts | 26 --------- 6 files changed, 156 deletions(-) delete mode 100644 client/src/app/reset-password/index.ts delete mode 100644 client/src/app/reset-password/reset-password-routing.module.ts delete mode 100644 client/src/app/reset-password/reset-password.component.html delete mode 100644 client/src/app/reset-password/reset-password.component.scss delete mode 100644 client/src/app/reset-password/reset-password.component.ts delete mode 100644 client/src/app/reset-password/reset-password.module.ts (limited to 'client/src/app/reset-password') diff --git a/client/src/app/reset-password/index.ts b/client/src/app/reset-password/index.ts deleted file mode 100644 index 438dc576a..000000000 --- a/client/src/app/reset-password/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './reset-password-routing.module' -export * from './reset-password.component' -export * from './reset-password.module' diff --git a/client/src/app/reset-password/reset-password-routing.module.ts b/client/src/app/reset-password/reset-password-routing.module.ts deleted file mode 100644 index d443b51d6..000000000 --- a/client/src/app/reset-password/reset-password-routing.module.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { NgModule } from '@angular/core' -import { RouterModule, Routes } from '@angular/router' -import { MetaGuard } from '@ngx-meta/core' -import { ResetPasswordComponent } from './reset-password.component' - -const resetPasswordRoutes: Routes = [ - { - path: 'reset-password', - component: ResetPasswordComponent, - canActivate: [ MetaGuard ], - data: { - meta: { - title: 'Reset password' - } - } - } -] - -@NgModule({ - imports: [ RouterModule.forChild(resetPasswordRoutes) ], - exports: [ RouterModule ] -}) -export class ResetPasswordRoutingModule {} diff --git a/client/src/app/reset-password/reset-password.component.html b/client/src/app/reset-password/reset-password.component.html deleted file mode 100644 index af30af4a0..000000000 --- a/client/src/app/reset-password/reset-password.component.html +++ /dev/null @@ -1,31 +0,0 @@ -
-
- Reset my password -
- -
-
- - -
- {{ formErrors.password }} -
-
- -
- - -
- {{ formErrors['password-confirm'] }} -
-
- - -
-
diff --git a/client/src/app/reset-password/reset-password.component.scss b/client/src/app/reset-password/reset-password.component.scss deleted file mode 100644 index efec6b706..000000000 --- a/client/src/app/reset-password/reset-password.component.scss +++ /dev/null @@ -1,12 +0,0 @@ -@import '_variables'; -@import '_mixins'; - -input:not([type=submit]) { - @include peertube-input-text(340px); - display: block; -} - -input[type=submit] { - @include peertube-button; - @include orange-button; -} diff --git a/client/src/app/reset-password/reset-password.component.ts b/client/src/app/reset-password/reset-password.component.ts deleted file mode 100644 index 8d50e9839..000000000 --- a/client/src/app/reset-password/reset-password.component.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Component, OnInit } from '@angular/core' -import { ActivatedRoute, Router } from '@angular/router' -import { Notifier, UserService } from '@app/core' -import { FormReactive, FormValidatorService, ResetPasswordValidatorsService, UserValidatorsService } from '@app/shared/shared-forms' -import { I18n } from '@ngx-translate/i18n-polyfill' - -@Component({ - selector: 'my-login', - templateUrl: './reset-password.component.html', - styleUrls: [ './reset-password.component.scss' ] -}) - -export class ResetPasswordComponent extends FormReactive implements OnInit { - private userId: number - private verificationString: string - - constructor ( - protected formValidatorService: FormValidatorService, - private resetPasswordValidatorsService: ResetPasswordValidatorsService, - private userValidatorsService: UserValidatorsService, - private userService: UserService, - private notifier: Notifier, - private router: Router, - private route: ActivatedRoute, - private i18n: I18n - ) { - super() - } - - ngOnInit () { - this.buildForm({ - password: this.userValidatorsService.USER_PASSWORD, - 'password-confirm': this.resetPasswordValidatorsService.RESET_PASSWORD_CONFIRM - }) - - this.userId = this.route.snapshot.queryParams['userId'] - this.verificationString = this.route.snapshot.queryParams['verificationString'] - - if (!this.userId || !this.verificationString) { - this.notifier.error(this.i18n('Unable to find user id or verification string.')) - this.router.navigate([ '/' ]) - } - } - - resetPassword () { - this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password) - .subscribe( - () => { - this.notifier.success(this.i18n('Your password has been successfully reset!')) - this.router.navigate([ '/login' ]) - }, - - err => this.notifier.error(err.message) - ) - } - - isConfirmedPasswordValid () { - const values = this.form.value - return values.password === values['password-confirm'] - } -} diff --git a/client/src/app/reset-password/reset-password.module.ts b/client/src/app/reset-password/reset-password.module.ts deleted file mode 100644 index c77f1c4b0..000000000 --- a/client/src/app/reset-password/reset-password.module.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { NgModule } from '@angular/core' -import { SharedFormModule } from '@app/shared/shared-forms' -import { SharedMainModule } from '@app/shared/shared-main' -import { ResetPasswordRoutingModule } from './reset-password-routing.module' -import { ResetPasswordComponent } from './reset-password.component' - -@NgModule({ - imports: [ - ResetPasswordRoutingModule, - - SharedMainModule, - SharedFormModule - ], - - declarations: [ - ResetPasswordComponent - ], - - exports: [ - ResetPasswordComponent - ], - - providers: [ - ] -}) -export class ResetPasswordModule { } -- cgit v1.2.3