Browse Source

fix: remove comment lines

pull/1584/head
mehmet-erim 7 years ago
parent
commit
12bd3244d9
  1. 12
      npm/ng-packs/packages/account/src/lib/components/register/register.component.ts
  2. 11
      npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts
  3. 13
      npm/ng-packs/packages/theme-basic/src/lib/components/change-password/change-password.component.ts

12
npm/ng-packs/packages/account/src/lib/components/register/register.component.ts

@ -1,13 +1,11 @@
import { ToasterService } from '@abp/ng.theme.shared'; import { ToasterService } from '@abp/ng.theme.shared';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { validatePassword } from '@ngx-validate/core';
import { throwError } from 'rxjs'; import { throwError } from 'rxjs';
import { catchError, finalize, take } from 'rxjs/operators'; import { catchError, finalize, take } from 'rxjs/operators';
import snq from 'snq'; import snq from 'snq';
import { RegisterRequest } from '../../models'; import { RegisterRequest } from '../../models';
import { AccountService } from '../../services/account.service'; import { AccountService } from '../../services/account.service';
const { maxLength, minLength, required, email } = Validators; const { maxLength, minLength, required, email } = Validators;
@Component({ @Component({
@ -22,15 +20,7 @@ export class RegisterComponent {
constructor(private fb: FormBuilder, private accountService: AccountService, private toasterService: ToasterService) { constructor(private fb: FormBuilder, private accountService: AccountService, private toasterService: ToasterService) {
this.form = this.fb.group({ this.form = this.fb.group({
username: ['', [required, maxLength(255)]], username: ['', [required, maxLength(255)]],
password: [ password: ['', [required, maxLength(32)]],
'',
[
required,
maxLength(32),
// minLength(6),
// validatePassword(['small', 'capital', 'number', 'special']),
],
],
email: ['', [required, email]], email: ['', [required, email]],
}); });
} }

11
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 { ConfirmationService, Toaster } from '@abp/ng.theme.shared';
import { Component, OnInit, TemplateRef, TrackByFunction, ViewChild } from '@angular/core'; import { Component, OnInit, TemplateRef, TrackByFunction, ViewChild } from '@angular/core';
import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { validatePassword } from '@ngx-validate/core';
import { Select, Store } from '@ngxs/store'; import { Select, Store } from '@ngxs/store';
import { combineLatest, Observable, Subject } from 'rxjs'; import { combineLatest, Observable, Subject } from 'rxjs';
import { debounceTime, filter, map, pluck, take } from 'rxjs/operators'; 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.roles = this.store.selectSnapshot(IdentityState.getRoles);
this.form = this.fb.group({ this.form = this.fb.group({
password: [ password: ['', [Validators.required, Validators.maxLength(32)]],
'',
[
Validators.required,
Validators.maxLength(32),
// Validators.minLength(6),
// validatePassword(['small', 'capital', 'number', 'special']),
],
],
userName: [this.selected.userName || '', [Validators.required, Validators.maxLength(256)]], userName: [this.selected.userName || '', [Validators.required, Validators.maxLength(256)]],
email: [this.selected.email || '', [Validators.required, Validators.email, Validators.maxLength(256)]], email: [this.selected.email || '', [Validators.required, Validators.email, Validators.maxLength(256)]],
name: [this.selected.name || '', [Validators.maxLength(64)]], name: [this.selected.name || '', [Validators.maxLength(64)]],

13
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 { ProfileChangePassword } from '@abp/ng.core';
import { ToasterService } from '@abp/ng.theme.shared';
import { import {
Component, Component,
EventEmitter, EventEmitter,
@ -11,10 +12,9 @@ import {
ViewChild, ViewChild,
} from '@angular/core'; } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 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 { Store } from '@ngxs/store';
import snq from 'snq'; import snq from 'snq';
import { ToasterService } from '@abp/ng.theme.shared';
const { minLength, required } = Validators; const { minLength, required } = Validators;
@ -48,12 +48,9 @@ export class ChangePasswordComponent implements OnInit, OnChanges {
ngOnInit(): void { ngOnInit(): void {
this.form = this.fb.group( this.form = this.fb.group(
{ {
password: ['', [required /* minLength(6), validatePassword(['small', 'capital', 'number', 'special']) */]], password: ['', required],
newPassword: ['', [required /* minLength(6), validatePassword(['small', 'capital', 'number', 'special']) */]], newPassword: ['', required],
repeatNewPassword: [ repeatNewPassword: ['', required],
'',
[required /* minLength(6), validatePassword(['small', 'capital', 'number', 'special']) */],
],
}, },
{ {
validators: [comparePasswords(['newPassword', 'repeatNewPassword'])], validators: [comparePasswords(['newPassword', 'repeatNewPassword'])],

Loading…
Cancel
Save