From 12bd3244d91637ada5e427f17b0c3891095c5d6c Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Mon, 5 Aug 2019 17:40:02 +0300 Subject: [PATCH] fix: remove comment lines --- .../lib/components/register/register.component.ts | 12 +----------- .../src/lib/components/users/users.component.ts | 11 +---------- .../change-password/change-password.component.ts | 13 +++++-------- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/npm/ng-packs/packages/account/src/lib/components/register/register.component.ts b/npm/ng-packs/packages/account/src/lib/components/register/register.component.ts index 6f0aa106a1..8b47ed16a9 100644 --- a/npm/ng-packs/packages/account/src/lib/components/register/register.component.ts +++ b/npm/ng-packs/packages/account/src/lib/components/register/register.component.ts @@ -1,13 +1,11 @@ import { ToasterService } from '@abp/ng.theme.shared'; import { Component } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { validatePassword } from '@ngx-validate/core'; import { throwError } from 'rxjs'; import { catchError, finalize, take } from 'rxjs/operators'; import snq from 'snq'; import { RegisterRequest } from '../../models'; import { AccountService } from '../../services/account.service'; - const { maxLength, minLength, required, email } = Validators; @Component({ @@ -22,15 +20,7 @@ export class RegisterComponent { constructor(private fb: FormBuilder, private accountService: AccountService, private toasterService: ToasterService) { this.form = this.fb.group({ username: ['', [required, maxLength(255)]], - password: [ - '', - [ - required, - maxLength(32), - // minLength(6), - // validatePassword(['small', 'capital', 'number', 'special']), - ], - ], + password: ['', [required, maxLength(32)]], email: ['', [required, email]], }); } diff --git a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts index 21b5e4b673..1bfa9a5b93 100644 --- a/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts +++ b/npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts @@ -2,7 +2,6 @@ import { ABP } from '@abp/ng.core'; import { ConfirmationService, Toaster } from '@abp/ng.theme.shared'; import { Component, OnInit, TemplateRef, TrackByFunction, ViewChild } from '@angular/core'; import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { validatePassword } from '@ngx-validate/core'; import { Select, Store } from '@ngxs/store'; import { combineLatest, Observable, Subject } from 'rxjs'; import { debounceTime, filter, map, pluck, take } from 'rxjs/operators'; @@ -72,15 +71,7 @@ export class UsersComponent implements OnInit { this.roles = this.store.selectSnapshot(IdentityState.getRoles); this.form = this.fb.group({ - password: [ - '', - [ - Validators.required, - Validators.maxLength(32), - // Validators.minLength(6), - // validatePassword(['small', 'capital', 'number', 'special']), - ], - ], + password: ['', [Validators.required, Validators.maxLength(32)]], userName: [this.selected.userName || '', [Validators.required, Validators.maxLength(256)]], email: [this.selected.email || '', [Validators.required, Validators.email, Validators.maxLength(256)]], name: [this.selected.name || '', [Validators.maxLength(64)]], diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/change-password/change-password.component.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/change-password/change-password.component.ts index fbc2619e00..d26d81ef65 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/change-password/change-password.component.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/change-password/change-password.component.ts @@ -1,4 +1,5 @@ import { ProfileChangePassword } from '@abp/ng.core'; +import { ToasterService } from '@abp/ng.theme.shared'; import { Component, EventEmitter, @@ -11,10 +12,9 @@ import { ViewChild, } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { comparePasswords, validatePassword, Validation } from '@ngx-validate/core'; +import { comparePasswords } from '@ngx-validate/core'; import { Store } from '@ngxs/store'; import snq from 'snq'; -import { ToasterService } from '@abp/ng.theme.shared'; const { minLength, required } = Validators; @@ -48,12 +48,9 @@ export class ChangePasswordComponent implements OnInit, OnChanges { ngOnInit(): void { this.form = this.fb.group( { - password: ['', [required /* minLength(6), validatePassword(['small', 'capital', 'number', 'special']) */]], - newPassword: ['', [required /* minLength(6), validatePassword(['small', 'capital', 'number', 'special']) */]], - repeatNewPassword: [ - '', - [required /* minLength(6), validatePassword(['small', 'capital', 'number', 'special']) */], - ], + password: ['', required], + newPassword: ['', required], + repeatNewPassword: ['', required], }, { validators: [comparePasswords(['newPassword', 'repeatNewPassword'])],