aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+signup
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-21 11:03:25 +0100
committerChocobozzz <me@florianbigard.com>2022-01-21 11:03:25 +0100
commitd92d070c91ee73657f2e3a5756954ef63fdba306 (patch)
tree7948b03e025b8878d64c45b5a969871667dab5f1 /client/src/app/+signup
parentcce70ae5ca3a2bfd893a7a8c457086151470de70 (diff)
downloadPeerTube-d92d070c91ee73657f2e3a5756954ef63fdba306.tar.gz
PeerTube-d92d070c91ee73657f2e3a5756954ef63fdba306.tar.zst
PeerTube-d92d070c91ee73657f2e3a5756954ef63fdba306.zip
Split user service
Diffstat (limited to 'client/src/app/+signup')
-rw-r--r--client/src/app/+signup/+register/register-step-channel.component.ts6
-rw-r--r--client/src/app/+signup/+register/register-step-user.component.ts6
-rw-r--r--client/src/app/+signup/+register/register.component.ts9
-rw-r--r--client/src/app/+signup/+register/register.module.ts4
-rw-r--r--client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts7
-rw-r--r--client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts7
-rw-r--r--client/src/app/+signup/+verify-account/verify-account.module.ts4
-rw-r--r--client/src/app/+signup/shared/shared-signup.module.ts (renamed from client/src/app/+signup/shared/signup-shared.module.ts)10
8 files changed, 29 insertions, 24 deletions
diff --git a/client/src/app/+signup/+register/register-step-channel.component.ts b/client/src/app/+signup/+register/register-step-channel.component.ts
index d965a7865..1bc0ccfd3 100644
--- a/client/src/app/+signup/+register/register-step-channel.component.ts
+++ b/client/src/app/+signup/+register/register-step-channel.component.ts
@@ -2,9 +2,9 @@ import { concat, of } from 'rxjs'
2import { pairwise } from 'rxjs/operators' 2import { pairwise } from 'rxjs/operators'
3import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' 3import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
4import { FormGroup } from '@angular/forms' 4import { FormGroup } from '@angular/forms'
5import { UserService } from '@app/core'
6import { VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR, VIDEO_CHANNEL_NAME_VALIDATOR } from '@app/shared/form-validators/video-channel-validators' 5import { VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR, VIDEO_CHANNEL_NAME_VALIDATOR } from '@app/shared/form-validators/video-channel-validators'
7import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 6import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
7import { UserSignupService } from '@app/shared/shared-users'
8 8
9@Component({ 9@Component({
10 selector: 'my-register-step-channel', 10 selector: 'my-register-step-channel',
@@ -17,7 +17,7 @@ export class RegisterStepChannelComponent extends FormReactive implements OnInit
17 17
18 constructor ( 18 constructor (
19 protected formValidatorService: FormValidatorService, 19 protected formValidatorService: FormValidatorService,
20 private userService: UserService 20 private userSignupService: UserSignupService
21 ) { 21 ) {
22 super() 22 super()
23 } 23 }
@@ -48,7 +48,7 @@ export class RegisterStepChannelComponent extends FormReactive implements OnInit
48 private onDisplayNameChange (oldDisplayName: string, newDisplayName: string) { 48 private onDisplayNameChange (oldDisplayName: string, newDisplayName: string) {
49 const name = this.form.value['name'] || '' 49 const name = this.form.value['name'] || ''
50 50
51 const newName = this.userService.getNewUsername(oldDisplayName, newDisplayName, name) 51 const newName = this.userSignupService.getNewUsername(oldDisplayName, newDisplayName, name)
52 this.form.patchValue({ name: newName }) 52 this.form.patchValue({ name: newName })
53 } 53 }
54} 54}
diff --git a/client/src/app/+signup/+register/register-step-user.component.ts b/client/src/app/+signup/+register/register-step-user.component.ts
index 716cd8c78..92ddfca2e 100644
--- a/client/src/app/+signup/+register/register-step-user.component.ts
+++ b/client/src/app/+signup/+register/register-step-user.component.ts
@@ -2,7 +2,6 @@ import { concat, of } from 'rxjs'
2import { pairwise } from 'rxjs/operators' 2import { pairwise } from 'rxjs/operators'
3import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' 3import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
4import { FormGroup } from '@angular/forms' 4import { FormGroup } from '@angular/forms'
5import { UserService } from '@app/core'
6import { 5import {
7 USER_DISPLAY_NAME_REQUIRED_VALIDATOR, 6 USER_DISPLAY_NAME_REQUIRED_VALIDATOR,
8 USER_EMAIL_VALIDATOR, 7 USER_EMAIL_VALIDATOR,
@@ -10,6 +9,7 @@ import {
10 USER_USERNAME_VALIDATOR 9 USER_USERNAME_VALIDATOR
11} from '@app/shared/form-validators/user-validators' 10} from '@app/shared/form-validators/user-validators'
12import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 11import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
12import { UserSignupService } from '@app/shared/shared-users'
13 13
14@Component({ 14@Component({
15 selector: 'my-register-step-user', 15 selector: 'my-register-step-user',
@@ -23,7 +23,7 @@ export class RegisterStepUserComponent extends FormReactive implements OnInit {
23 23
24 constructor ( 24 constructor (
25 protected formValidatorService: FormValidatorService, 25 protected formValidatorService: FormValidatorService,
26 private userService: UserService 26 private userSignupService: UserSignupService
27 ) { 27 ) {
28 super() 28 super()
29 } 29 }
@@ -52,7 +52,7 @@ export class RegisterStepUserComponent extends FormReactive implements OnInit {
52 private onDisplayNameChange (oldDisplayName: string, newDisplayName: string) { 52 private onDisplayNameChange (oldDisplayName: string, newDisplayName: string) {
53 const username = this.form.value['username'] || '' 53 const username = this.form.value['username'] || ''
54 54
55 const newUsername = this.userService.getNewUsername(oldDisplayName, newDisplayName, username) 55 const newUsername = this.userSignupService.getNewUsername(oldDisplayName, newDisplayName, username)
56 this.form.patchValue({ username: newUsername }) 56 this.form.patchValue({ username: newUsername })
57 } 57 }
58} 58}
diff --git a/client/src/app/+signup/+register/register.component.ts b/client/src/app/+signup/+register/register.component.ts
index bb7276459..b4a7c0d0e 100644
--- a/client/src/app/+signup/+register/register.component.ts
+++ b/client/src/app/+signup/+register/register.component.ts
@@ -1,12 +1,13 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { FormGroup } from '@angular/forms' 2import { FormGroup } from '@angular/forms'
3import { ActivatedRoute } from '@angular/router' 3import { ActivatedRoute } from '@angular/router'
4import { AuthService, UserService } from '@app/core' 4import { AuthService } from '@app/core'
5import { HooksService } from '@app/core/plugins/hooks.service' 5import { HooksService } from '@app/core/plugins/hooks.service'
6import { InstanceAboutAccordionComponent } from '@app/shared/shared-instance'
7import { UserSignupService } from '@app/shared/shared-users'
6import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap' 8import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap'
7import { UserRegister } from '@shared/models' 9import { UserRegister } from '@shared/models'
8import { ServerConfig } from '@shared/models/server' 10import { ServerConfig } from '@shared/models/server'
9import { InstanceAboutAccordionComponent } from '@app/shared/shared-instance'
10 11
11@Component({ 12@Component({
12 selector: 'my-register', 13 selector: 'my-register',
@@ -49,7 +50,7 @@ export class RegisterComponent implements OnInit {
49 constructor ( 50 constructor (
50 private route: ActivatedRoute, 51 private route: ActivatedRoute,
51 private authService: AuthService, 52 private authService: AuthService,
52 private userService: UserService, 53 private userSignupService: UserSignupService,
53 private hooks: HooksService 54 private hooks: HooksService
54 ) { } 55 ) { }
55 56
@@ -128,7 +129,7 @@ export class RegisterComponent implements OnInit {
128 'filter:api.signup.registration.create.params' 129 'filter:api.signup.registration.create.params'
129 ) 130 )
130 131
131 this.userService.signup(body).subscribe({ 132 this.userSignupService.signup(body).subscribe({
132 next: () => { 133 next: () => {
133 this.signupDone = true 134 this.signupDone = true
134 135
diff --git a/client/src/app/+signup/+register/register.module.ts b/client/src/app/+signup/+register/register.module.ts
index c36da53d5..52cdb33bc 100644
--- a/client/src/app/+signup/+register/register.module.ts
+++ b/client/src/app/+signup/+register/register.module.ts
@@ -1,6 +1,6 @@
1import { CdkStepperModule } from '@angular/cdk/stepper' 1import { CdkStepperModule } from '@angular/cdk/stepper'
2import { NgModule } from '@angular/core' 2import { NgModule } from '@angular/core'
3import { SignupSharedModule } from '@app/+signup/shared/signup-shared.module' 3import { SharedSignupModule } from '@app/+signup/shared/shared-signup.module'
4import { SharedInstanceModule } from '@app/shared/shared-instance' 4import { SharedInstanceModule } from '@app/shared/shared-instance'
5import { CustomStepperComponent } from './custom-stepper.component' 5import { CustomStepperComponent } from './custom-stepper.component'
6import { RegisterRoutingModule } from './register-routing.module' 6import { RegisterRoutingModule } from './register-routing.module'
@@ -15,7 +15,7 @@ import { RegisterComponent } from './register.component'
15 15
16 CdkStepperModule, 16 CdkStepperModule,
17 17
18 SignupSharedModule, 18 SharedSignupModule,
19 19
20 SharedInstanceModule 20 SharedInstanceModule
21 ], 21 ],
diff --git a/client/src/app/+signup/+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 83c24a251..a0ed66a3a 100644
--- a/client/src/app/+signup/+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
@@ -1,7 +1,8 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Notifier, RedirectService, ServerService, UserService } from '@app/core' 2import { Notifier, RedirectService, ServerService } from '@app/core'
3import { USER_EMAIL_VALIDATOR } from '@app/shared/form-validators/user-validators' 3import { USER_EMAIL_VALIDATOR } from '@app/shared/form-validators/user-validators'
4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
5import { UserSignupService } from '@app/shared/shared-users'
5 6
6@Component({ 7@Component({
7 selector: 'my-verify-account-ask-send-email', 8 selector: 'my-verify-account-ask-send-email',
@@ -14,7 +15,7 @@ export class VerifyAccountAskSendEmailComponent extends FormReactive implements
14 15
15 constructor ( 16 constructor (
16 protected formValidatorService: FormValidatorService, 17 protected formValidatorService: FormValidatorService,
17 private userService: UserService, 18 private userSignupService: UserSignupService,
18 private serverService: ServerService, 19 private serverService: ServerService,
19 private notifier: Notifier, 20 private notifier: Notifier,
20 private redirectService: RedirectService 21 private redirectService: RedirectService
@@ -33,7 +34,7 @@ export class VerifyAccountAskSendEmailComponent extends FormReactive implements
33 34
34 askSendVerifyEmail () { 35 askSendVerifyEmail () {
35 const email = this.form.value['verify-email-email'] 36 const email = this.form.value['verify-email-email']
36 this.userService.askSendVerifyEmail(email) 37 this.userSignupService.askSendVerifyEmail(email)
37 .subscribe({ 38 .subscribe({
38 next: () => { 39 next: () => {
39 this.notifier.success($localize`An email with verification link will be sent to ${email}.`) 40 this.notifier.success($localize`An email with verification link will be sent to ${email}.`)
diff --git a/client/src/app/+signup/+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 827ec7652..88efce4a1 100644
--- a/client/src/app/+signup/+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
@@ -1,6 +1,7 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute } from '@angular/router' 2import { ActivatedRoute } from '@angular/router'
3import { AuthService, Notifier, UserService } from '@app/core' 3import { AuthService, Notifier } from '@app/core'
4import { UserSignupService } from '@app/shared/shared-users'
4 5
5@Component({ 6@Component({
6 selector: 'my-verify-account-email', 7 selector: 'my-verify-account-email',
@@ -16,7 +17,7 @@ export class VerifyAccountEmailComponent implements OnInit {
16 private verificationString: string 17 private verificationString: string
17 18
18 constructor ( 19 constructor (
19 private userService: UserService, 20 private userSignupService: UserSignupService,
20 private authService: AuthService, 21 private authService: AuthService,
21 private notifier: Notifier, 22 private notifier: Notifier,
22 private route: ActivatedRoute 23 private route: ActivatedRoute
@@ -37,7 +38,7 @@ export class VerifyAccountEmailComponent implements OnInit {
37 } 38 }
38 39
39 verifyEmail () { 40 verifyEmail () {
40 this.userService.verifyEmail(this.userId, this.verificationString, this.isPendingEmail) 41 this.userSignupService.verifyEmail(this.userId, this.verificationString, this.isPendingEmail)
41 .subscribe({ 42 .subscribe({
42 next: () => { 43 next: () => {
43 if (this.authService.isLoggedIn()) { 44 if (this.authService.isLoggedIn()) {
diff --git a/client/src/app/+signup/+verify-account/verify-account.module.ts b/client/src/app/+signup/+verify-account/verify-account.module.ts
index 7255605d4..ec342df8d 100644
--- a/client/src/app/+signup/+verify-account/verify-account.module.ts
+++ b/client/src/app/+signup/+verify-account/verify-account.module.ts
@@ -1,5 +1,5 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { SignupSharedModule } from '../shared/signup-shared.module' 2import { SharedSignupModule } from '../shared/shared-signup.module'
3import { VerifyAccountAskSendEmailComponent } from './verify-account-ask-send-email/verify-account-ask-send-email.component' 3import { VerifyAccountAskSendEmailComponent } from './verify-account-ask-send-email/verify-account-ask-send-email.component'
4import { VerifyAccountEmailComponent } from './verify-account-email/verify-account-email.component' 4import { VerifyAccountEmailComponent } from './verify-account-email/verify-account-email.component'
5import { VerifyAccountRoutingModule } from './verify-account-routing.module' 5import { VerifyAccountRoutingModule } from './verify-account-routing.module'
@@ -8,7 +8,7 @@ import { VerifyAccountRoutingModule } from './verify-account-routing.module'
8 imports: [ 8 imports: [
9 VerifyAccountRoutingModule, 9 VerifyAccountRoutingModule,
10 10
11 SignupSharedModule 11 SharedSignupModule
12 ], 12 ],
13 13
14 declarations: [ 14 declarations: [
diff --git a/client/src/app/+signup/shared/signup-shared.module.ts b/client/src/app/+signup/shared/shared-signup.module.ts
index 56b0b3bae..f8b224c71 100644
--- a/client/src/app/+signup/shared/signup-shared.module.ts
+++ b/client/src/app/+signup/shared/shared-signup.module.ts
@@ -1,14 +1,16 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { SharedMainModule } from '@app/shared/shared-main'
3import { SignupSuccessComponent } from './signup-success.component'
4import { SharedFormModule } from '@app/shared/shared-forms' 2import { SharedFormModule } from '@app/shared/shared-forms'
5import { SharedGlobalIconModule } from '@app/shared/shared-icons' 3import { SharedGlobalIconModule } from '@app/shared/shared-icons'
4import { SharedMainModule } from '@app/shared/shared-main'
5import { SharedUsersModule } from '@app/shared/shared-users'
6import { SignupSuccessComponent } from './signup-success.component'
6 7
7@NgModule({ 8@NgModule({
8 imports: [ 9 imports: [
9 SharedMainModule, 10 SharedMainModule,
10 SharedFormModule, 11 SharedFormModule,
11 SharedGlobalIconModule 12 SharedGlobalIconModule,
13 SharedUsersModule
12 ], 14 ],
13 15
14 declarations: [ 16 declarations: [
@@ -26,4 +28,4 @@ import { SharedGlobalIconModule } from '@app/shared/shared-icons'
26 providers: [ 28 providers: [
27 ] 29 ]
28}) 30})
29export class SignupSharedModule { } 31export class SharedSignupModule { }