diff options
author | Chocobozzz <me@florianbigard.com> | 2019-05-29 14:39:49 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-05-29 14:39:49 +0200 |
commit | b247a132709eb212fef4f77c4912dc0ec108f36b (patch) | |
tree | b2700e6ed55e00cd213c44e8afdeea4c327ae904 /client/src/app | |
parent | 1d5342abc43df02cf0bd69b1e865c0f179182eef (diff) | |
download | PeerTube-b247a132709eb212fef4f77c4912dc0ec108f36b.tar.gz PeerTube-b247a132709eb212fef4f77c4912dc0ec108f36b.tar.zst PeerTube-b247a132709eb212fef4f77c4912dc0ec108f36b.zip |
Add success icon on registration
Diffstat (limited to 'client/src/app')
33 files changed, 178 insertions, 125 deletions
diff --git a/client/src/app/signup/custom-stepper.component.html b/client/src/app/+signup/+register/custom-stepper.component.html index bf507fc4f..bf507fc4f 100644 --- a/client/src/app/signup/custom-stepper.component.html +++ b/client/src/app/+signup/+register/custom-stepper.component.html | |||
diff --git a/client/src/app/signup/custom-stepper.component.scss b/client/src/app/+signup/+register/custom-stepper.component.scss index 2371c8ae5..2371c8ae5 100644 --- a/client/src/app/signup/custom-stepper.component.scss +++ b/client/src/app/+signup/+register/custom-stepper.component.scss | |||
diff --git a/client/src/app/signup/custom-stepper.component.ts b/client/src/app/+signup/+register/custom-stepper.component.ts index 2ae40f3a9..2ae40f3a9 100644 --- a/client/src/app/signup/custom-stepper.component.ts +++ b/client/src/app/+signup/+register/custom-stepper.component.ts | |||
diff --git a/client/src/app/signup/signup-routing.module.ts b/client/src/app/+signup/+register/register-routing.module.ts index 820d16d4d..e3a5001dc 100644 --- a/client/src/app/signup/signup-routing.module.ts +++ b/client/src/app/+signup/+register/register-routing.module.ts | |||
@@ -1,17 +1,18 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouterModule, Routes } from '@angular/router' | 2 | import { RouterModule, Routes } from '@angular/router' |
3 | import { MetaGuard } from '@ngx-meta/core' | 3 | import { MetaGuard } from '@ngx-meta/core' |
4 | import { SignupComponent } from './signup.component' | 4 | import { RegisterComponent } from './register.component' |
5 | import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.service' | 5 | import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.service' |
6 | import { UnloggedGuard } from '@app/core/routing/unlogged-guard.service' | ||
6 | 7 | ||
7 | const signupRoutes: Routes = [ | 8 | const registerRoutes: Routes = [ |
8 | { | 9 | { |
9 | path: 'signup', | 10 | path: '', |
10 | component: SignupComponent, | 11 | component: RegisterComponent, |
11 | canActivate: [ MetaGuard ], | 12 | canActivate: [ MetaGuard, UnloggedGuard ], |
12 | data: { | 13 | data: { |
13 | meta: { | 14 | meta: { |
14 | title: 'Signup' | 15 | title: 'Register' |
15 | } | 16 | } |
16 | }, | 17 | }, |
17 | resolve: { | 18 | resolve: { |
@@ -21,7 +22,7 @@ const signupRoutes: Routes = [ | |||
21 | ] | 22 | ] |
22 | 23 | ||
23 | @NgModule({ | 24 | @NgModule({ |
24 | imports: [ RouterModule.forChild(signupRoutes) ], | 25 | imports: [ RouterModule.forChild(registerRoutes) ], |
25 | exports: [ RouterModule ] | 26 | exports: [ RouterModule ] |
26 | }) | 27 | }) |
27 | export class SignupRoutingModule {} | 28 | export class RegisterRoutingModule {} |
diff --git a/client/src/app/signup/signup-step-channel.component.html b/client/src/app/+signup/+register/register-step-channel.component.html index 68ea4473a..68ea4473a 100644 --- a/client/src/app/signup/signup-step-channel.component.html +++ b/client/src/app/+signup/+register/register-step-channel.component.html | |||
diff --git a/client/src/app/signup/signup-step-channel.component.ts b/client/src/app/+signup/+register/register-step-channel.component.ts index a49b7f36f..9e13f75b3 100644 --- a/client/src/app/signup/signup-step-channel.component.ts +++ b/client/src/app/+signup/+register/register-step-channel.component.ts | |||
@@ -1,15 +1,15 @@ | |||
1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
2 | import { AuthService } from '@app/core' | 2 | import { AuthService } from '@app/core' |
3 | import { FormReactive, VideoChannelValidatorsService } from '../shared' | 3 | import { FormReactive, VideoChannelValidatorsService } from '@app/shared' |
4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
5 | import { FormGroup } from '@angular/forms' | 5 | import { FormGroup } from '@angular/forms' |
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | selector: 'my-signup-step-channel', | 8 | selector: 'my-register-step-channel', |
9 | templateUrl: './signup-step-channel.component.html', | 9 | templateUrl: './register-step-channel.component.html', |
10 | styleUrls: [ './signup.component.scss' ] | 10 | styleUrls: [ './register.component.scss' ] |
11 | }) | 11 | }) |
12 | export class SignupStepChannelComponent extends FormReactive implements OnInit { | 12 | export class RegisterStepChannelComponent extends FormReactive implements OnInit { |
13 | @Input() username: string | 13 | @Input() username: string |
14 | @Output() formBuilt = new EventEmitter<FormGroup>() | 14 | @Output() formBuilt = new EventEmitter<FormGroup>() |
15 | 15 | ||
diff --git a/client/src/app/signup/signup-step-user.component.html b/client/src/app/+signup/+register/register-step-user.component.html index cd0c78bfa..cd0c78bfa 100644 --- a/client/src/app/signup/signup-step-user.component.html +++ b/client/src/app/+signup/+register/register-step-user.component.html | |||
diff --git a/client/src/app/signup/signup-step-user.component.ts b/client/src/app/+signup/+register/register-step-user.component.ts index 54855d8a7..3825ae371 100644 --- a/client/src/app/signup/signup-step-user.component.ts +++ b/client/src/app/+signup/+register/register-step-user.component.ts | |||
@@ -1,15 +1,15 @@ | |||
1 | import { Component, EventEmitter, OnInit, Output } from '@angular/core' | 1 | import { Component, EventEmitter, OnInit, Output } from '@angular/core' |
2 | import { AuthService } from '@app/core' | 2 | import { AuthService } from '@app/core' |
3 | import { FormReactive, UserValidatorsService } from '../shared' | 3 | import { FormReactive, UserValidatorsService } from '@app/shared' |
4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' | 4 | import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' |
5 | import { FormGroup } from '@angular/forms' | 5 | import { FormGroup } from '@angular/forms' |
6 | 6 | ||
7 | @Component({ | 7 | @Component({ |
8 | selector: 'my-signup-step-user', | 8 | selector: 'my-register-step-user', |
9 | templateUrl: './signup-step-user.component.html', | 9 | templateUrl: './register-step-user.component.html', |
10 | styleUrls: [ './signup.component.scss' ] | 10 | styleUrls: [ './register.component.scss' ] |
11 | }) | 11 | }) |
12 | export class SignupStepUserComponent extends FormReactive implements OnInit { | 12 | export class RegisterStepUserComponent extends FormReactive implements OnInit { |
13 | @Output() formBuilt = new EventEmitter<FormGroup>() | 13 | @Output() formBuilt = new EventEmitter<FormGroup>() |
14 | 14 | ||
15 | constructor ( | 15 | constructor ( |
diff --git a/client/src/app/signup/signup.component.html b/client/src/app/+signup/+register/register.component.html index ae3a595e9..24def68c1 100644 --- a/client/src/app/signup/signup.component.html +++ b/client/src/app/+signup/+register/register.component.html | |||
@@ -4,22 +4,20 @@ | |||
4 | Create an account | 4 | Create an account |
5 | </div> | 5 | </div> |
6 | 6 | ||
7 | 7 | <my-signup-success *ngIf="signupDone" [message]="success"></my-signup-success> | |
8 | <my-success *ngIf="signupDone"></my-success> | ||
9 | <div *ngIf="info" class="alert alert-info">{{ info }}</div> | 8 | <div *ngIf="info" class="alert alert-info">{{ info }}</div> |
10 | <div *ngIf="success" class="alert alert-success">{{ success }}</div> | ||
11 | 9 | ||
12 | <div class="wrapper" *ngIf="!signupDone"> | 10 | <div class="wrapper" *ngIf="!signupDone"> |
13 | <div> | 11 | <div> |
14 | <my-custom-stepper linear *ngIf="!signupDone"> | 12 | <my-custom-stepper linear *ngIf="!signupDone"> |
15 | <cdk-step [stepControl]="formStepUser" i18n-label label="User information"> | 13 | <cdk-step [stepControl]="formStepUser" i18n-label label="User information"> |
16 | <my-signup-step-user (formBuilt)="onUserFormBuilt($event)"></my-signup-step-user> | 14 | <my-register-step-user (formBuilt)="onUserFormBuilt($event)"></my-register-step-user> |
17 | 15 | ||
18 | <button i18n cdkStepperNext [disabled]="!formStepUser || !formStepUser.valid">Next</button> | 16 | <button i18n cdkStepperNext [disabled]="!formStepUser || !formStepUser.valid">Next</button> |
19 | </cdk-step> | 17 | </cdk-step> |
20 | 18 | ||
21 | <cdk-step [stepControl]="formStepChannel" i18n-label label="Channel information"> | 19 | <cdk-step [stepControl]="formStepChannel" i18n-label label="Channel information"> |
22 | <my-signup-step-channel (formBuilt)="onChannelFormBuilt($event)" [username]="getUsername()"></my-signup-step-channel> | 20 | <my-register-step-channel (formBuilt)="onChannelFormBuilt($event)" [username]="getUsername()"></my-register-step-channel> |
23 | 21 | ||
24 | <button i18n cdkStepperNext (click)="signup()" | 22 | <button i18n cdkStepperNext (click)="signup()" |
25 | [disabled]="!formStepChannel || !formStepChannel.valid || hasSameChannelAndAccountNames()" | 23 | [disabled]="!formStepChannel || !formStepChannel.valid || hasSameChannelAndAccountNames()" |
diff --git a/client/src/app/signup/signup.component.scss b/client/src/app/+signup/+register/register.component.scss index 6f61b78f7..6f61b78f7 100644 --- a/client/src/app/signup/signup.component.scss +++ b/client/src/app/+signup/+register/register.component.scss | |||
diff --git a/client/src/app/signup/signup.component.ts b/client/src/app/+signup/+register/register.component.ts index 11eaa8521..cd6059728 100644 --- a/client/src/app/signup/signup.component.ts +++ b/client/src/app/+signup/+register/register.component.ts | |||
@@ -1,16 +1,16 @@ | |||
1 | import { Component } from '@angular/core' | 1 | import { Component } from '@angular/core' |
2 | import { AuthService, Notifier, RedirectService, ServerService } from '@app/core' | 2 | import { AuthService, Notifier, RedirectService, ServerService } from '@app/core' |
3 | import { UserService, UserValidatorsService } from '../shared' | 3 | import { UserService, UserValidatorsService } from '@app/shared' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | 4 | import { I18n } from '@ngx-translate/i18n-polyfill' |
5 | import { UserRegister } from '@shared/models/users/user-register.model' | 5 | import { UserRegister } from '@shared/models/users/user-register.model' |
6 | import { FormGroup } from '@angular/forms' | 6 | import { FormGroup } from '@angular/forms' |
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
9 | selector: 'my-signup', | 9 | selector: 'my-register', |
10 | templateUrl: './signup.component.html', | 10 | templateUrl: './register.component.html', |
11 | styleUrls: [ './signup.component.scss' ] | 11 | styleUrls: [ './register.component.scss' ] |
12 | }) | 12 | }) |
13 | export class SignupComponent { | 13 | export class RegisterComponent { |
14 | info: string = null | 14 | info: string = null |
15 | error: string = null | 15 | error: string = null |
16 | success: string = null | 16 | success: string = null |
@@ -61,7 +61,7 @@ export class SignupComponent { | |||
61 | signup () { | 61 | signup () { |
62 | this.error = null | 62 | this.error = null |
63 | 63 | ||
64 | const body: UserRegister = Object.assign(this.formStepUser.value, this.formStepChannel.value) | 64 | const body: UserRegister = Object.assign(this.formStepUser.value, { channel: this.formStepChannel.value }) |
65 | 65 | ||
66 | this.userService.signup(body).subscribe( | 66 | this.userService.signup(body).subscribe( |
67 | () => { | 67 | () => { |
diff --git a/client/src/app/+signup/+register/register.module.ts b/client/src/app/+signup/+register/register.module.ts new file mode 100644 index 000000000..46336cbd0 --- /dev/null +++ b/client/src/app/+signup/+register/register.module.ts | |||
@@ -0,0 +1,33 @@ | |||
1 | import { NgModule } from '@angular/core' | ||
2 | import { RegisterRoutingModule } from './register-routing.module' | ||
3 | import { RegisterComponent } from './register.component' | ||
4 | import { SharedModule } from '@app/shared' | ||
5 | import { CdkStepperModule } from '@angular/cdk/stepper' | ||
6 | import { RegisterStepChannelComponent } from './register-step-channel.component' | ||
7 | import { RegisterStepUserComponent } from './register-step-user.component' | ||
8 | import { CustomStepperComponent } from './custom-stepper.component' | ||
9 | import { SignupSharedModule } from '@app/+signup/shared/signup-shared.module' | ||
10 | |||
11 | @NgModule({ | ||
12 | imports: [ | ||
13 | RegisterRoutingModule, | ||
14 | SharedModule, | ||
15 | CdkStepperModule, | ||
16 | SignupSharedModule | ||
17 | ], | ||
18 | |||
19 | declarations: [ | ||
20 | RegisterComponent, | ||
21 | CustomStepperComponent, | ||
22 | RegisterStepChannelComponent, | ||
23 | RegisterStepUserComponent | ||
24 | ], | ||
25 | |||
26 | exports: [ | ||
27 | RegisterComponent | ||
28 | ], | ||
29 | |||
30 | providers: [ | ||
31 | ] | ||
32 | }) | ||
33 | export class RegisterModule { } | ||
diff --git a/client/src/app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.html b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.html index 2e4180632..2e4180632 100644 --- a/client/src/app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.html +++ b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.html | |||
diff --git a/client/src/app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.scss b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.scss index efec6b706..efec6b706 100644 --- a/client/src/app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.scss +++ b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.scss | |||
diff --git a/client/src/app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts index cfd471fa4..cfd471fa4 100644 --- a/client/src/app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts +++ b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts | |||
diff --git a/client/src/app/+verify-account/verify-account-email/verify-account-email.component.html b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.html index a83d4a3c2..728709ca6 100644 --- a/client/src/app/+verify-account/verify-account-email/verify-account-email.component.html +++ b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.html | |||
@@ -3,9 +3,9 @@ | |||
3 | Verify account email confirmation | 3 | Verify account email confirmation |
4 | </div> | 4 | </div> |
5 | 5 | ||
6 | <div i18n *ngIf="success; else verificationError"> | 6 | <my-signup-success i18n *ngIf="success; else verificationError" message="Your email has been verified and you may now login."> |
7 | Your email has been verified and you may now login. Redirecting... | 7 | </my-signup-success> |
8 | </div> | 8 | |
9 | <ng-template #verificationError> | 9 | <ng-template #verificationError> |
10 | <div> | 10 | <div> |
11 | <span i18n>An error occurred. </span> | 11 | <span i18n>An error occurred. </span> |
diff --git a/client/src/app/+verify-account/verify-account-email/verify-account-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts index f9ecf664b..3fb2d1cd8 100644 --- a/client/src/app/+verify-account/verify-account-email/verify-account-email.component.ts +++ b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts | |||
@@ -40,9 +40,6 @@ export class VerifyAccountEmailComponent implements OnInit { | |||
40 | .subscribe( | 40 | .subscribe( |
41 | () => { | 41 | () => { |
42 | this.success = true | 42 | this.success = true |
43 | setTimeout(() => { | ||
44 | this.router.navigate([ '/login' ]) | ||
45 | }, 2000) | ||
46 | }, | 43 | }, |
47 | 44 | ||
48 | err => { | 45 | err => { |
diff --git a/client/src/app/+verify-account/verify-account-routing.module.ts b/client/src/app/+signup/+verify-account/verify-account-routing.module.ts index a038f0336..16d5fe0d0 100644 --- a/client/src/app/+verify-account/verify-account-routing.module.ts +++ b/client/src/app/+signup/+verify-account/verify-account-routing.module.ts | |||
@@ -1,12 +1,8 @@ | |||
1 | import { NgModule } from '@angular/core' | 1 | import { NgModule } from '@angular/core' |
2 | import { RouterModule, Routes } from '@angular/router' | 2 | import { RouterModule, Routes } from '@angular/router' |
3 | |||
4 | import { MetaGuard } from '@ngx-meta/core' | 3 | import { MetaGuard } from '@ngx-meta/core' |
5 | 4 | import { VerifyAccountEmailComponent } from './verify-account-email/verify-account-email.component' | |
6 | import { VerifyAccountEmailComponent } from '@app/+verify-account/verify-account-email/verify-account-email.component' | 5 | import { VerifyAccountAskSendEmailComponent } from './verify-account-ask-send-email/verify-account-ask-send-email.component' |
7 | import { | ||
8 | VerifyAccountAskSendEmailComponent | ||
9 | } from '@app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component' | ||
10 | 6 | ||
11 | const verifyAccountRoutes: Routes = [ | 7 | const verifyAccountRoutes: Routes = [ |
12 | { | 8 | { |
diff --git a/client/src/app/+signup/+verify-account/verify-account.module.ts b/client/src/app/+signup/+verify-account/verify-account.module.ts new file mode 100644 index 000000000..9fe14e81e --- /dev/null +++ b/client/src/app/+signup/+verify-account/verify-account.module.ts | |||
@@ -0,0 +1,25 @@ | |||
1 | import { NgModule } from '@angular/core' | ||
2 | import { VerifyAccountRoutingModule } from './verify-account-routing.module' | ||
3 | import { VerifyAccountEmailComponent } from './verify-account-email/verify-account-email.component' | ||
4 | import { VerifyAccountAskSendEmailComponent } from './verify-account-ask-send-email/verify-account-ask-send-email.component' | ||
5 | import { SharedModule } from '@app/shared' | ||
6 | import { SignupSharedModule } from '@app/+signup/shared/signup-shared.module' | ||
7 | |||
8 | @NgModule({ | ||
9 | imports: [ | ||
10 | VerifyAccountRoutingModule, | ||
11 | SharedModule, | ||
12 | SignupSharedModule | ||
13 | ], | ||
14 | |||
15 | declarations: [ | ||
16 | VerifyAccountEmailComponent, | ||
17 | VerifyAccountAskSendEmailComponent | ||
18 | ], | ||
19 | |||
20 | exports: [], | ||
21 | |||
22 | providers: [] | ||
23 | }) | ||
24 | export class VerifyAccountModule { | ||
25 | } | ||
diff --git a/client/src/app/+signup/shared/signup-shared.module.ts b/client/src/app/+signup/shared/signup-shared.module.ts new file mode 100644 index 000000000..cd21fdef3 --- /dev/null +++ b/client/src/app/+signup/shared/signup-shared.module.ts | |||
@@ -0,0 +1,21 @@ | |||
1 | import { NgModule } from '@angular/core' | ||
2 | import { SignupSuccessComponent } from '../shared/signup-success.component' | ||
3 | import { SharedModule } from '@app/shared' | ||
4 | |||
5 | @NgModule({ | ||
6 | imports: [ | ||
7 | SharedModule | ||
8 | ], | ||
9 | |||
10 | declarations: [ | ||
11 | SignupSuccessComponent | ||
12 | ], | ||
13 | |||
14 | exports: [ | ||
15 | SignupSuccessComponent | ||
16 | ], | ||
17 | |||
18 | providers: [ | ||
19 | ] | ||
20 | }) | ||
21 | export class SignupSharedModule { } | ||
diff --git a/client/src/app/signup/success.component.html b/client/src/app/+signup/shared/signup-success.component.html index 68eb72b61..e35f858c6 100644 --- a/client/src/app/signup/success.component.html +++ b/client/src/app/+signup/shared/signup-success.component.html | |||
@@ -5,4 +5,12 @@ | |||
5 | <polyline class="path check" fill="none" stroke="#73AF55" stroke-width="6" stroke-linecap="round" stroke-miterlimit="10" points="100.2,40.2 51.5,88.8 29.8,67.5 "/> | 5 | <polyline class="path check" fill="none" stroke="#73AF55" stroke-width="6" stroke-linecap="round" stroke-miterlimit="10" points="100.2,40.2 51.5,88.8 29.8,67.5 "/> |
6 | </svg> | 6 | </svg> |
7 | 7 | ||
8 | <p class="success">Welcome on PeerTube!</p> | 8 | <p class="bottom-message">Welcome on PeerTube!</p> |
9 | |||
10 | <div *ngIf="message" class="alert alert-success"> | ||
11 | <p>{{ message }}</p> | ||
12 | |||
13 | <p i18n> | ||
14 | If you need help to use PeerTube, you can take a look to the <a href="https://docs.joinpeertube.org/#/use-setup-account" target="_blank" rel="noopener noreferrer">documentation</a>. | ||
15 | </p> | ||
16 | </div> | ||
diff --git a/client/src/app/signup/success.component.scss b/client/src/app/+signup/shared/signup-success.component.scss index 7c66e08cf..fbc27c8bc 100644 --- a/client/src/app/signup/success.component.scss +++ b/client/src/app/+signup/shared/signup-success.component.scss | |||
@@ -26,14 +26,16 @@ svg { | |||
26 | } | 26 | } |
27 | } | 27 | } |
28 | 28 | ||
29 | p { | 29 | .bottom-message { |
30 | text-align: center; | 30 | text-align: center; |
31 | margin: 20px 0 60px; | 31 | margin: 20px 0 60px; |
32 | font-size: 1.25em; | 32 | font-size: 1.25em; |
33 | color: #73AF55; | ||
34 | } | ||
33 | 35 | ||
34 | &.success { | 36 | .alert { |
35 | color: #73AF55; | 37 | font-size: 15px; |
36 | } | 38 | text-align: center; |
37 | } | 39 | } |
38 | 40 | ||
39 | 41 | ||
diff --git a/client/src/app/+signup/shared/signup-success.component.ts b/client/src/app/+signup/shared/signup-success.component.ts new file mode 100644 index 000000000..19fb5922a --- /dev/null +++ b/client/src/app/+signup/shared/signup-success.component.ts | |||
@@ -0,0 +1,10 @@ | |||
1 | import { Component, Input } from '@angular/core' | ||
2 | |||
3 | @Component({ | ||
4 | selector: 'my-signup-success', | ||
5 | templateUrl: './signup-success.component.html', | ||
6 | styleUrls: [ './signup-success.component.scss' ] | ||
7 | }) | ||
8 | export class SignupSuccessComponent { | ||
9 | @Input() message: string | ||
10 | } | ||
diff --git a/client/src/app/+verify-account/index.ts b/client/src/app/+verify-account/index.ts deleted file mode 100644 index 733f5ba77..000000000 --- a/client/src/app/+verify-account/index.ts +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | export * from '@app/+verify-account/verify-account-routing.module' | ||
2 | export * from '@app/+verify-account/verify-account.module' | ||
diff --git a/client/src/app/+verify-account/verify-account.module.ts b/client/src/app/+verify-account/verify-account.module.ts deleted file mode 100644 index 9092c6b4f..000000000 --- a/client/src/app/+verify-account/verify-account.module.ts +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | import { NgModule } from '@angular/core' | ||
2 | |||
3 | import { VerifyAccountRoutingModule } from '@app/+verify-account/verify-account-routing.module' | ||
4 | import { VerifyAccountEmailComponent } from '@app/+verify-account/verify-account-email/verify-account-email.component' | ||
5 | import { | ||
6 | VerifyAccountAskSendEmailComponent | ||
7 | } from '@app/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component' | ||
8 | import { SharedModule } from '@app/shared' | ||
9 | |||
10 | @NgModule({ | ||
11 | imports: [ | ||
12 | VerifyAccountRoutingModule, | ||
13 | SharedModule | ||
14 | ], | ||
15 | |||
16 | declarations: [ | ||
17 | VerifyAccountEmailComponent, | ||
18 | VerifyAccountAskSendEmailComponent | ||
19 | ], | ||
20 | |||
21 | exports: [ | ||
22 | ], | ||
23 | |||
24 | providers: [ | ||
25 | ] | ||
26 | }) | ||
27 | export class VerifyAccountModule { } | ||
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index db8888dba..7ca51f226 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts | |||
@@ -16,7 +16,7 @@ const routes: Routes = [ | |||
16 | }, | 16 | }, |
17 | { | 17 | { |
18 | path: 'verify-account', | 18 | path: 'verify-account', |
19 | loadChildren: './+verify-account/verify-account.module#VerifyAccountModule' | 19 | loadChildren: './+signup/+verify-account/verify-account.module#VerifyAccountModule' |
20 | }, | 20 | }, |
21 | { | 21 | { |
22 | path: 'accounts', | 22 | path: 'accounts', |
@@ -31,6 +31,10 @@ const routes: Routes = [ | |||
31 | loadChildren: './+about/about.module#AboutModule' | 31 | loadChildren: './+about/about.module#AboutModule' |
32 | }, | 32 | }, |
33 | { | 33 | { |
34 | path: 'signup', | ||
35 | loadChildren: './+signup/+register/register.module#RegisterModule' | ||
36 | }, | ||
37 | { | ||
34 | path: '', | 38 | path: '', |
35 | component: AppComponent // Avoid 404, app component will redirect dynamically | 39 | component: AppComponent // Avoid 404, app component will redirect dynamically |
36 | }, | 40 | }, |
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts index 0bbc2e08b..1e2936a37 100644 --- a/client/src/app/app.module.ts +++ b/client/src/app/app.module.ts | |||
@@ -14,7 +14,6 @@ import { HeaderComponent } from './header' | |||
14 | import { LoginModule } from './login' | 14 | import { LoginModule } from './login' |
15 | import { AvatarNotificationComponent, LanguageChooserComponent, MenuComponent } from './menu' | 15 | import { AvatarNotificationComponent, LanguageChooserComponent, MenuComponent } from './menu' |
16 | import { SharedModule } from './shared' | 16 | import { SharedModule } from './shared' |
17 | import { SignupModule } from './signup' | ||
18 | import { VideosModule } from './videos' | 17 | import { VideosModule } from './videos' |
19 | import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '../../../shared/models/i18n' | 18 | import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '../../../shared/models/i18n' |
20 | import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' | 19 | import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' |
@@ -53,7 +52,6 @@ export function metaFactory (serverService: ServerService): MetaLoader { | |||
53 | CoreModule, | 52 | CoreModule, |
54 | LoginModule, | 53 | LoginModule, |
55 | ResetPasswordModule, | 54 | ResetPasswordModule, |
56 | SignupModule, | ||
57 | SearchModule, | 55 | SearchModule, |
58 | SharedModule, | 56 | SharedModule, |
59 | VideosModule, | 57 | VideosModule, |
diff --git a/client/src/app/core/core.module.ts b/client/src/app/core/core.module.ts index d3e72afb4..06fa8fcf1 100644 --- a/client/src/app/core/core.module.ts +++ b/client/src/app/core/core.module.ts | |||
@@ -20,6 +20,7 @@ import { Notifier } from './notification' | |||
20 | import { MessageService } from 'primeng/api' | 20 | import { MessageService } from 'primeng/api' |
21 | import { UserNotificationSocket } from '@app/core/notification/user-notification-socket.service' | 21 | import { UserNotificationSocket } from '@app/core/notification/user-notification-socket.service' |
22 | import { ServerConfigResolver } from './routing/server-config-resolver.service' | 22 | import { ServerConfigResolver } from './routing/server-config-resolver.service' |
23 | import { UnloggedGuard } from '@app/core/routing/unlogged-guard.service' | ||
23 | 24 | ||
24 | @NgModule({ | 25 | @NgModule({ |
25 | imports: [ | 26 | imports: [ |
@@ -58,6 +59,8 @@ import { ServerConfigResolver } from './routing/server-config-resolver.service' | |||
58 | ThemeService, | 59 | ThemeService, |
59 | LoginGuard, | 60 | LoginGuard, |
60 | UserRightGuard, | 61 | UserRightGuard, |
62 | UnloggedGuard, | ||
63 | |||
61 | RedirectService, | 64 | RedirectService, |
62 | Notifier, | 65 | Notifier, |
63 | MessageService, | 66 | MessageService, |
diff --git a/client/src/app/core/routing/redirect.service.ts b/client/src/app/core/routing/redirect.service.ts index e1db4097b..571822b76 100644 --- a/client/src/app/core/routing/redirect.service.ts +++ b/client/src/app/core/routing/redirect.service.ts | |||
@@ -42,7 +42,14 @@ export class RedirectService { | |||
42 | } | 42 | } |
43 | 43 | ||
44 | redirectToPreviousRoute () { | 44 | redirectToPreviousRoute () { |
45 | if (this.previousUrl) return this.router.navigateByUrl(this.previousUrl) | 45 | const exceptions = [ |
46 | '/verify-account' | ||
47 | ] | ||
48 | |||
49 | if (this.previousUrl) { | ||
50 | const isException = exceptions.find(e => this.previousUrl.startsWith(e)) | ||
51 | if (!isException) return this.router.navigateByUrl(this.previousUrl) | ||
52 | } | ||
46 | 53 | ||
47 | return this.redirectToHomepage() | 54 | return this.redirectToHomepage() |
48 | } | 55 | } |
diff --git a/client/src/app/core/routing/unlogged-guard.service.ts b/client/src/app/core/routing/unlogged-guard.service.ts new file mode 100644 index 000000000..3132a1a77 --- /dev/null +++ b/client/src/app/core/routing/unlogged-guard.service.ts | |||
@@ -0,0 +1,25 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot } from '@angular/router' | ||
3 | import { AuthService } from '../auth/auth.service' | ||
4 | import { RedirectService } from './redirect.service' | ||
5 | |||
6 | @Injectable() | ||
7 | export class UnloggedGuard implements CanActivate, CanActivateChild { | ||
8 | |||
9 | constructor ( | ||
10 | private router: Router, | ||
11 | private auth: AuthService, | ||
12 | private redirectService: RedirectService | ||
13 | ) {} | ||
14 | |||
15 | canActivate (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { | ||
16 | if (this.auth.isLoggedIn() === false) return true | ||
17 | |||
18 | this.redirectService.redirectToHomepage() | ||
19 | return false | ||
20 | } | ||
21 | |||
22 | canActivateChild (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) { | ||
23 | return this.canActivate(route, state) | ||
24 | } | ||
25 | } | ||
diff --git a/client/src/app/signup/index.ts b/client/src/app/signup/index.ts deleted file mode 100644 index b0aca9723..000000000 --- a/client/src/app/signup/index.ts +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | export * from './signup-routing.module' | ||
2 | export * from './signup.component' | ||
3 | export * from './signup.module' | ||
diff --git a/client/src/app/signup/signup.module.ts b/client/src/app/signup/signup.module.ts deleted file mode 100644 index fccaf7ce1..000000000 --- a/client/src/app/signup/signup.module.ts +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | import { NgModule } from '@angular/core' | ||
2 | import { SignupRoutingModule } from './signup-routing.module' | ||
3 | import { SignupComponent } from './signup.component' | ||
4 | import { SharedModule } from '../shared' | ||
5 | import { CdkStepperModule } from '@angular/cdk/stepper' | ||
6 | import { SignupStepChannelComponent } from '@app/signup/signup-step-channel.component' | ||
7 | import { SignupStepUserComponent } from '@app/signup/signup-step-user.component' | ||
8 | import { CustomStepperComponent } from '@app/signup/custom-stepper.component' | ||
9 | import { SuccessComponent } from '@app/signup/success.component' | ||
10 | |||
11 | @NgModule({ | ||
12 | imports: [ | ||
13 | SignupRoutingModule, | ||
14 | SharedModule, | ||
15 | CdkStepperModule | ||
16 | ], | ||
17 | |||
18 | declarations: [ | ||
19 | SignupComponent, | ||
20 | CustomStepperComponent, | ||
21 | SuccessComponent, | ||
22 | SignupStepChannelComponent, | ||
23 | SignupStepUserComponent | ||
24 | ], | ||
25 | |||
26 | exports: [ | ||
27 | SignupComponent | ||
28 | ], | ||
29 | |||
30 | providers: [ | ||
31 | ] | ||
32 | }) | ||
33 | export class SignupModule { } | ||
diff --git a/client/src/app/signup/success.component.ts b/client/src/app/signup/success.component.ts deleted file mode 100644 index 2674e1e30..000000000 --- a/client/src/app/signup/success.component.ts +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | import { Component } from '@angular/core' | ||
2 | |||
3 | @Component({ | ||
4 | selector: 'my-success', | ||
5 | templateUrl: './success.component.html', | ||
6 | styleUrls: [ './success.component.scss' ] | ||
7 | }) | ||
8 | export class SuccessComponent { | ||
9 | |||
10 | } | ||