diff options
author | Chocobozzz <me@florianbigard.com> | 2022-01-21 11:03:25 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-01-21 11:03:25 +0100 |
commit | d92d070c91ee73657f2e3a5756954ef63fdba306 (patch) | |
tree | 7948b03e025b8878d64c45b5a969871667dab5f1 /client/src/app/+signup/+register | |
parent | cce70ae5ca3a2bfd893a7a8c457086151470de70 (diff) | |
download | PeerTube-d92d070c91ee73657f2e3a5756954ef63fdba306.tar.gz PeerTube-d92d070c91ee73657f2e3a5756954ef63fdba306.tar.zst PeerTube-d92d070c91ee73657f2e3a5756954ef63fdba306.zip |
Split user service
Diffstat (limited to 'client/src/app/+signup/+register')
4 files changed, 13 insertions, 12 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' | |||
2 | import { pairwise } from 'rxjs/operators' | 2 | import { pairwise } from 'rxjs/operators' |
3 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 3 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
4 | import { FormGroup } from '@angular/forms' | 4 | import { FormGroup } from '@angular/forms' |
5 | import { UserService } from '@app/core' | ||
6 | import { VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR, VIDEO_CHANNEL_NAME_VALIDATOR } from '@app/shared/form-validators/video-channel-validators' | 5 | import { VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR, VIDEO_CHANNEL_NAME_VALIDATOR } from '@app/shared/form-validators/video-channel-validators' |
7 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | 6 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
7 | import { 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' | |||
2 | import { pairwise } from 'rxjs/operators' | 2 | import { pairwise } from 'rxjs/operators' |
3 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' | 3 | import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' |
4 | import { FormGroup } from '@angular/forms' | 4 | import { FormGroup } from '@angular/forms' |
5 | import { UserService } from '@app/core' | ||
6 | import { | 5 | import { |
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' |
12 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | 11 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
12 | import { 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 @@ | |||
1 | import { Component, OnInit } from '@angular/core' | 1 | import { Component, OnInit } from '@angular/core' |
2 | import { FormGroup } from '@angular/forms' | 2 | import { FormGroup } from '@angular/forms' |
3 | import { ActivatedRoute } from '@angular/router' | 3 | import { ActivatedRoute } from '@angular/router' |
4 | import { AuthService, UserService } from '@app/core' | 4 | import { AuthService } from '@app/core' |
5 | import { HooksService } from '@app/core/plugins/hooks.service' | 5 | import { HooksService } from '@app/core/plugins/hooks.service' |
6 | import { InstanceAboutAccordionComponent } from '@app/shared/shared-instance' | ||
7 | import { UserSignupService } from '@app/shared/shared-users' | ||
6 | import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap' | 8 | import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap' |
7 | import { UserRegister } from '@shared/models' | 9 | import { UserRegister } from '@shared/models' |
8 | import { ServerConfig } from '@shared/models/server' | 10 | import { ServerConfig } from '@shared/models/server' |
9 | import { 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 @@ | |||
1 | import { CdkStepperModule } from '@angular/cdk/stepper' | 1 | import { CdkStepperModule } from '@angular/cdk/stepper' |
2 | import { NgModule } from '@angular/core' | 2 | import { NgModule } from '@angular/core' |
3 | import { SignupSharedModule } from '@app/+signup/shared/signup-shared.module' | 3 | import { SharedSignupModule } from '@app/+signup/shared/shared-signup.module' |
4 | import { SharedInstanceModule } from '@app/shared/shared-instance' | 4 | import { SharedInstanceModule } from '@app/shared/shared-instance' |
5 | import { CustomStepperComponent } from './custom-stepper.component' | 5 | import { CustomStepperComponent } from './custom-stepper.component' |
6 | import { RegisterRoutingModule } from './register-routing.module' | 6 | import { 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 | ], |