diff --git a/ng6-seed/src/app/app.module.ts b/ng6-seed/src/app/app.module.ts index 9f64fea..baefec1 100755 --- a/ng6-seed/src/app/app.module.ts +++ b/ng6-seed/src/app/app.module.ts @@ -40,7 +40,8 @@ import { AuthLayoutComponent } from './layouts/auth/auth-layout.component'; import { SharedModule } from './shared/shared.module'; import { AwsService } from './AwsService/aws.service'; import { TokenInterceptor } from './_guard/token.interceptor'; -import { NewPasswordDialog, ForgotPass } from './session/otp/otp.component'; +import { NewPasswordDialog, ForgotPass } from './session/login/login.component'; +import { NewPasswordDialog2,ForgotPass2 } from './session/otp/otp.component'; import { AuthGuard } from './_guard/auth.guard'; import { RoleMenuItemsPipe } from './layouts/role-menu-items.pipe'; import { ResizableModule } from 'angular-resizable-element'; @@ -73,7 +74,7 @@ export function createTranslateLoader(http: HttpClient) { AppComponent, AdminLayoutComponent, AuthLayoutComponent, - NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe, + NewPasswordDialog,ForgotPass,NewPasswordDialog2,ForgotPass2,ChangePasswordDialog, RoleMenuItemsPipe, HttpLoaderComponent, DialogOverviewExampleDialog,OtpComponent @@ -134,7 +135,7 @@ export function createTranslateLoader(http: HttpClient) { }, { provide:MAT_DATE_LOCALE, useValue: 'en-GB' } ], - entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,OtpComponent], + entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,OtpComponent,NewPasswordDialog2,ForgotPass2], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/ng6-seed/src/app/session/login/login.component.ts b/ng6-seed/src/app/session/login/login.component.ts index ab7057a..9a81efa 100755 --- a/ng6-seed/src/app/session/login/login.component.ts +++ b/ng6-seed/src/app/session/login/login.component.ts @@ -106,7 +106,7 @@ export class LoginComponent implements OnInit{ this.loaderService.closeMatSpinnerDialog(); }, err => { if (err.message == "New password is required.") { - // this.newpassopen(); + this.newpassopen(); } else { } @@ -114,27 +114,27 @@ export class LoginComponent implements OnInit{ //alert(err.message); }) } - // /** - // * New password set - // * Defalut aws function - // * @param email password,newpassword - // */ - // newpassopen() { - // const mailid = this.email.split(/\s/).join(''); - // const password = this.password.split(/\s/).join(''); - // let dialogRef = this.dialog.open(NewPasswordDialog, this.config); - // dialogRef.afterClosed().subscribe(result => { - // if (result !== undefined) { - // let auth = { 'Username': mailid, 'Password': password, 'newpassword': result }; - // this.aws.dologin(auth).subscribe(res => { - // this.getCommonSettings(); - // this.router.navigate(['/']); - // }, err => { - // // alert(err.message); - // }) - // } - // }); - // } + /** + * New password set + * Defalut aws function + * @param email password,newpassword + */ + newpassopen() { + const mailid = this.email.split(/\s/).join(''); + const password = this.password.split(/\s/).join(''); + let dialogRef = this.dialog.open(NewPasswordDialog, this.config); + dialogRef.afterClosed().subscribe(result => { + if (result !== undefined) { + let auth = { 'Username': mailid, 'Password': password, 'newpassword': result }; + this.aws.dologin(auth).subscribe(res => { + this.getCommonSettings(); + this.router.navigate(['/']); + }, err => { + // alert(err.message); + }) + } + }); + } forgotopen() { this.status = true; @@ -184,79 +184,82 @@ export class LoginComponent implements OnInit{ * New password Dialog */ -// const newpassword = new FormControl('', Validators.required); -// const confirmPassword = new FormControl('', CustomValidators.equalTo(newpassword)); +const newpassword = new FormControl('', Validators.required); +const confirmPassword = new FormControl('', CustomValidators.equalTo(newpassword)); -// @Component({ -// selector: 'app-jazz-dialog', -// template: ` -//
New Password Change.
+@Component({ + selector: 'app-jazz-dialog', + template: ` +
New Password Change.
-// -// - -// + + + {{hide1 ? 'visibility_off' : 'visibility'}} + -//
-// -// -// +
+ + + {{hide2 ? 'visibility_off' : 'visibility'}} + -// Passwords do not match. + Passwords do not match. -//
+
-// + -// ` -// }) -// export class NewPasswordDialog { + ` +}) +export class NewPasswordDialog { -// newpassword: any = newpassword; -// confirmPassword: any = confirmPassword; -// jazzMessage = 'Jazzy jazz jazz'; + newpassword: any = newpassword; + confirmPassword: any = confirmPassword; + jazzMessage = 'Jazzy jazz jazz'; + hide1: boolean = true; + hide2: boolean = true; -// constructor(public dialogRef: MatDialogRef) { + constructor(public dialogRef: MatDialogRef) { -// } + } -// } +} -// @Component({ -// selector: 'app-jazz-dialog', -// template: ` -//
Forgot Password
+@Component({ + selector: 'app-jazz-dialog', + template: ` +
Forgot Password
-// -// + + -// + -//
+
-// + -// ` -// }) -// export class ForgotPass { + ` +}) +export class ForgotPass { -// newpassword: any = newpassword; -// confirmPassword: any = confirmPassword; -// jazzMessage = 'Jazzy jazz jazz'; + newpassword: any = newpassword; + confirmPassword: any = confirmPassword; + jazzMessage = 'Jazzy jazz jazz'; -// constructor(public dialogRef: MatDialogRef) { + constructor(public dialogRef: MatDialogRef) { -// } + } -// } +} diff --git a/ng6-seed/src/app/session/otp/otp.component.html b/ng6-seed/src/app/session/otp/otp.component.html index edba7e8..f36134f 100644 --- a/ng6-seed/src/app/session/otp/otp.component.html +++ b/ng6-seed/src/app/session/otp/otp.component.html @@ -18,7 +18,7 @@ - + diff --git a/ng6-seed/src/app/session/otp/otp.component.ts b/ng6-seed/src/app/session/otp/otp.component.ts index 2389d26..a76c914 100644 --- a/ng6-seed/src/app/session/otp/otp.component.ts +++ b/ng6-seed/src/app/session/otp/otp.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, Inject } from '@angular/core'; -import { MatDialogRef, MatDialog, MAT_DIALOG_DATA, MatDialogConfig } from '@angular/material'; +import { MatDialogRef, MatDialog, MAT_DIALOG_DATA, MatDialogConfig, DialogPosition } from '@angular/material'; import { DashboardService } from 'app/dashboard/dashboard.service'; import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms'; import { CustomValidators } from 'ng2-validation'; @@ -100,7 +100,7 @@ export class OtpComponent implements OnInit { * @param email password,newpassword */ newpassopen(email) { - let dialogRef = this.dialog.open(NewPasswordDialog, this.config); + let dialogRef = this.dialog.open(NewPasswordDialog2, this.config); dialogRef.afterClosed().subscribe(result => { if (result !== undefined) { console.log(result); @@ -172,7 +172,7 @@ export class OtpComponent implements OnInit { ` }) - export class NewPasswordDialog { + export class NewPasswordDialog2 { newpassword: any = newpassword; confirmPassword: any = confirmPassword; @@ -180,7 +180,7 @@ export class OtpComponent implements OnInit { hide2: boolean = true; jazzMessage = 'Jazzy jazz jazz'; - constructor(public dialogRef: MatDialogRef) { } + constructor(public dialogRef: MatDialogRef) { } } /** ==================== New password Dialog Ends Here ======================== */ @@ -199,13 +199,13 @@ export class OtpComponent implements OnInit { ` }) -export class ForgotPass { +export class ForgotPass2 { newpassword: any = newpassword; confirmPassword: any = confirmPassword; jazzMessage = 'Jazzy jazz jazz'; - constructor(public dialogRef: MatDialogRef) {} + constructor(public dialogRef: MatDialogRef) {} } /** ==================== Forgot Password Dialog Ends Here =================== */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/users/users.module.ts b/ng6-seed/src/app/settings/users/users.module.ts index 8f45d72..3545717 100755 --- a/ng6-seed/src/app/settings/users/users.module.ts +++ b/ng6-seed/src/app/settings/users/users.module.ts @@ -21,7 +21,8 @@ import { RouterModule } from '@angular/router'; import { UserRoutes} from './users.routing'; import { UserProfileComponent, ChangePasswordDialog } from './user-profile/user-profile.component'; import { UserService } from './../service/user.service'; -import { NewPasswordDialog, ForgotPass } from '../../session/otp/otp.component'; +import { NewPasswordDialog, ForgotPass } from '../../session/login/login.component'; +import { NewPasswordDialog2, ForgotPass2 } from '../../session/otp/otp.component'; // import { HttpClientModule } from '@angular/common/http'; @NgModule({ imports: [