diff --git a/ng6-seed/dist.zip b/ng6-seed/dist.zip new file mode 100644 index 000000000..54bc847b7 Binary files /dev/null and b/ng6-seed/dist.zip differ diff --git a/ng6-seed/src/app/app.module.ts b/ng6-seed/src/app/app.module.ts index cb7d5230c..d43467d2c 100755 --- a/ng6-seed/src/app/app.module.ts +++ b/ng6-seed/src/app/app.module.ts @@ -42,7 +42,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/login/login.component'; + // import { NewPasswordDialog2, ForgotPass } from './session/login/login.component'; +import { NewPasswordDialog,ForgotPass } 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'; @@ -65,6 +66,8 @@ import { PushNotifyService } from './shared/push-notify.service'; import { MatVideoModule } from 'mat-video'; import { ReqTokenInterceptor } from './_guard/req-token.interceptor'; import { DynamicNotifyComponent } from './layouts/dynamic-notify/dynamic-notify.component'; +import { OtpComponent } from './session/otp/otp.component'; +import { NotifierModule, NotifierOptions } from 'angular-notifier'; // import { SelectAllComponent } from './select-all/select-all.component'; // import { CustomNotificationComponent } from './layouts/custom-notification/custom-notification.component'; //import { SelectAllComponent } from './select-all/select-all.component'; @@ -85,12 +88,52 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { }; // const socketConfig: SocketIoConfig = { url: environment.socketServerUrl, options: {} }; - +const pdCustomNotifierOptions: NotifierOptions = { + position: { + horizontal: { + position: 'right', + distance: 12 + }, + vertical: { + position: 'top', + distance: 32, + gap: 10 + } + }, + theme: 'material', + behaviour: { + autoHide: 2000, + onClick: 'hide', + onMouseover: 'pauseAutoHide', + showDismissButton: true, + stacking: 4 + }, + animations: { + enabled: true, + show: { + preset: 'slide', + speed: 300, + easing: 'ease' + }, + hide: { + preset: 'fade', + speed: 300, + easing: 'ease', + offset: 50 + }, + shift: { + speed: 300, + easing: 'ease' + }, + overlap: 150 + } +}; @NgModule({ declarations: [ AppComponent, AdminLayoutComponent, AuthLayoutComponent, + OtpComponent, NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe, HttpLoaderComponent, IncomingCallComponent, VideoChatComponent, DynamicNotifyComponent, ], @@ -114,7 +157,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { MatCheckboxModule, MatProgressBarModule,MatProgressSpinnerModule, MatTooltipModule, - + NotifierModule.withConfig(pdCustomNotifierOptions), MatSelectModule, MatCardModule, MatBadgeModule, @@ -158,7 +201,8 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { }, MessagingService, AsyncPipe,LoaderService ], - entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,DynamicNotifyComponent] + // entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,DynamicNotifyComponent] + entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,OtpComponent,DynamicNotifyComponent] // IncomingCallComponent,VideoChatComponent,], ,bootstrap: [AppComponent] }) diff --git a/ng6-seed/src/app/session/login/login-component.html b/ng6-seed/src/app/session/login/login-component.html index a85f210a5..8bbb9d288 100755 --- a/ng6-seed/src/app/session/login/login-component.html +++ b/ng6-seed/src/app/session/login/login-component.html @@ -19,7 +19,8 @@ - + + {{hide ? 'visibility_off' : 'visibility'}}
@@ -49,5 +50,6 @@ + \ No newline at end of file diff --git a/ng6-seed/src/app/session/login/login-component.scss b/ng6-seed/src/app/session/login/login-component.scss index 0829347fd..989aae231 100755 --- a/ng6-seed/src/app/session/login/login-component.scss +++ b/ng6-seed/src/app/session/login/login-component.scss @@ -1,41 +1,91 @@ -.form-bg { -//background-image:url('http://www.ssa.sineedge.com/beta/assets/images/login.jpg') !important; -//background-image: url(../../../assets/images/login_o.jpg); -//background-color: #F44336; - background: url(../../../assets/images/bg.png) repeat-x 0 0 #ffffff; - //height: 100vh !important; - background-position: center !important; - min-height: calc(90vh + 90px) !important; -} +// .form-bg { +// //background-image:url('http://www.ssa.sineedge.com/beta/assets/images/login.jpg') !important; +// //background-image: url(../../../assets/images/login_o.jpg); +// //background-color: #F44336; +// background: url(../../../assets/images/bg.png) repeat-x 0 0 #ffffff; +// //height: 100vh !important; +// background-position: center !important; +// min-height: calc(90vh + 90px) !important; +// } -.signin-page{ - float: left; - width: 100%; - padding-bottom: 40px; -} - // .form-bg { - // float: left; - // width: 100%; - // background-color: repeat-x 0 0 #F44336; - // padding-bottom: 40px; - // } -.form-bg::before { - background-color: rgba(0, 0, 0, 0) !important; -} -.form-bg::after{ - background-color: #E00201; -} -.page-title{ - color:#E00201; - background-color:#ffffff; - font-weight: bold; -} -.page-footer{ - color:#E00201; - background-color:#ffffff; - font-size: 14px; -} -.bottom-sec,.mat-green{ - color:white !important; - font-weight: 700; -} \ No newline at end of file +// .signin-page{ +// float: left; +// width: 100%; +// padding-bottom: 40px; +// } +// // .form-bg { +// // float: left; +// // width: 100%; +// // background-color: repeat-x 0 0 #F44336; +// // padding-bottom: 40px; +// // } +// .form-bg::before { +// background-color: rgba(0, 0, 0, 0) !important; +// } +// .form-bg::after{ +// background-color: #E00201; +// } +// .page-title{ +// color:#E00201; +// background-color:#ffffff; +// font-weight: bold; +// } +// .page-footer{ +// color:#E00201; +// background-color:#ffffff; +// font-size: 14px; +// } +// .bottom-sec,.mat-green{ +// color:white !important; +// font-weight: 700; +// } +// .passwordIcon{ +// font-size: larger !important; +// color: #f34325 !important; +// } + +.form-bg { + //background-image:url('http://www.ssa.sineedge.com/beta/assets/images/login.jpg') !important; + //background-image: url(../../../assets/images/login_o.jpg); + //background-color: #F44336; + background: url(../../../assets/images/bg.png) repeat-x 0 0 #ffffff; + //height: 100vh !important; + background-position: center !important; + min-height: calc(90vh + 90px) !important; + } + + .signin-page{ + float: left; + width: 100%; + padding-bottom: 40px; + } + // .form-bg { + // float: left; + // width: 100%; + // background-color: repeat-x 0 0 #F44336; + // padding-bottom: 40px; + // } + .form-bg::before { + background-color: rgba(0, 0, 0, 0) !important; + } + .form-bg::after{ + background-color: #E00201; + } + .page-title{ + color:#E00201; + background-color:#ffffff; + font-weight: bold; + } + .page-footer{ + color:#E00201; + background-color:#ffffff; + font-size: 14px; + } + .bottom-sec,.mat-green{ + color:white !important; + font-weight: 700; + } + .passwordIcon{ + font-size: larger !important; + color: #f34325 !important; + } \ No newline at end of file diff --git a/ng6-seed/src/app/session/login/login.component.ts b/ng6-seed/src/app/session/login/login.component.ts index 452da0c92..ac55b59ac 100755 --- a/ng6-seed/src/app/session/login/login.component.ts +++ b/ng6-seed/src/app/session/login/login.component.ts @@ -45,12 +45,14 @@ export class LoginComponent implements OnInit{ }; commonDetails: any; dialogRef: MatDialogRef; + hide: boolean; constructor( private router: Router, public aws: AwsService, public dialog: MatDialog, public shared:CognitoService,private messagingService:MessagingService,private dashBoardService:DashboardService) { } ngOnInit(){ + this.hide = true; this.loggedInCheck(); } @@ -126,7 +128,7 @@ export class LoginComponent implements OnInit{ if (data.status == 200) { this.dialogRef = this.dialog.open(OtpComponent, { data: this.email, - width: '60%', + width: '40%', disableClose: true }); diff --git a/ng6-seed/src/app/session/otp/otp.component.html b/ng6-seed/src/app/session/otp/otp.component.html index dbe4e390b..78c2346cd 100644 --- a/ng6-seed/src/app/session/otp/otp.component.html +++ b/ng6-seed/src/app/session/otp/otp.component.html @@ -1,4 +1,4 @@ - + +
- + --> + + +

+
+ OTP +
+
+ + +
+

+ + + + + + + + + + + + +
+ + + + + +
+ +
+ + diff --git a/ng6-seed/src/app/session/otp/otp.component.scss b/ng6-seed/src/app/session/otp/otp.component.scss index e592fb882..517f9b461 100644 --- a/ng6-seed/src/app/session/otp/otp.component.scss +++ b/ng6-seed/src/app/session/otp/otp.component.scss @@ -1,18 +1,36 @@ +// mat-form-field { +// margin: 0 2%; +// } +// .paragraph_change { +// color: #fff !important; +// background-color: #e00201 !important; +// // padding: 10px !important; +// } +// .cdk-global-overlay-wrapper{ +// justify-content: center !important; +// } +// mat-dialog-actions{ +// border-top: 2px solid #e00201; +// } + +// .mat-form-field-appearance-legacy .mat-hint{ +// color:rgba(0, 0, 0, 0.8) !important; +// } mat-form-field { - margin: 0 2%; - } + margin: 0 2%; +} .paragraph_change { - color: #fff !important; - background-color: #e00201 !important; - // padding: 10px !important; +color: #fff !important; +background-color: #e00201 !important; +// padding: 10px !important; } - .cdk-global-overlay-wrapper{ - justify-content: center !important; +.cdk-global-overlay-wrapper{ + justify-content: center !important; +} +mat-dialog-actions{ + border-top: 2px solid #e00201; } - mat-dialog-actions{ - border-top: 2px solid #e00201; - } .mat-form-field-appearance-legacy .mat-hint{ - color:rgba(0, 0, 0, 0.8) !important; +color:rgba(0, 0, 0, 0.8) !important; } diff --git a/ng6-seed/src/app/session/otp/otp.component.ts b/ng6-seed/src/app/session/otp/otp.component.ts index 6f53e1896..64be181eb 100644 --- a/ng6-seed/src/app/session/otp/otp.component.ts +++ b/ng6-seed/src/app/session/otp/otp.component.ts @@ -1,7 +1,13 @@ import { Component, OnInit,Inject } from '@angular/core'; -import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition,MatDialogConfig} from '@angular/material'; import { DashboardService } from 'app/dashboard/dashboard.service'; import { NotifierService } from 'angular-notifier'; +import { FormControl, Validators } from '@angular/forms'; +import { CustomValidators } from 'ng2-validation'; +import { AwsService } from 'app/AwsService/aws.service'; +import { Router } from '@angular/router'; +import { LoaderService } from 'app/shared/loaderService/loader.service'; +import Swal from 'sweetalert2'; @Component({ selector: 'app-otp', templateUrl: './otp.component.html', @@ -9,10 +15,31 @@ import { NotifierService } from 'angular-notifier'; }) export class OtpComponent implements OnInit { //public notifier : NotifierService; - - constructor( private dialogRef: MatDialogRef,private dialog: MatDialog, @Inject(MAT_DIALOG_DATA) public data: any,private dashBoardService:DashboardService) + timeLeft: number = 0; + loggedEmailID:any=""; + interval; + config: MatDialogConfig = { + disableClose: false, + width: '', + height: '', + position: { + top: '', + bottom: '', + left: '', + right: '' + } + }; + constructor(private notifier: NotifierService,private dialogRef: MatDialogRef,private dialog: MatDialog, @Inject(MAT_DIALOG_DATA) public data: any,private dashBoardService:DashboardService,public aws: AwsService,private loaderService:LoaderService,private router: Router, ) { - + this.loggedEmailID = this.data; + this.timeLeft = 60; + this.interval = setInterval(() => { + if(this.timeLeft > 0) { + this.timeLeft--; + } else { + clearInterval(this.interval); + } + },1000) } ngOnInit() { @@ -20,22 +47,175 @@ export class OtpComponent implements OnInit { updatepassword(otp) { console.log('data'); - console.log(this.data); + console.log(this.data,otp); + this.dashBoardService.resetpassword(this.data,otp).subscribe( data => { - console.log('data'); - console.log(data) + console.log('resetpassword api res data',data); if (data.status == 200) { - alert('Password Reset Successfully'); - this.dialogRef.close(); + this.dialogRef.close(); + this.loggedEmailID = this.data; + // alert('Password Reset Successfully'); + this.newPasswordDialog(this.loggedEmailID); } - else - { - alert('OTP is invalid. Plesae enter correct OTP.!'); + else{ alert('OTP is invalid. Plesae enter correct OTP.!'); } + }); + +// this.dashBoardService.resetpassword(this.data,otp).subscribe( +// data => { +// console.log('data'); +// console.log(data) +// if (data.status == 200) { +// alert('Password Reset Successfully'); +// this.dialogRef.close(); +// } +// else +// { +// alert('OTP is invalid. Plesae enter correct OTP.!'); - } +// } +// }) +} + +newPasswordDialog(email) { + + let dialogRef = this.dialog.open(NewPasswordDialog, this.config); + + dialogRef.afterClosed().subscribe(result => { + if (result !== undefined) { + console.log(result); + Swal('Password Successfully Changed..!'); + + this.notifier.notify("success","Password Successfully Changed..") + let auth = { 'Username': email, 'Password': 'temp1234', 'newpassword': result }; + this.aws.dologin(auth).subscribe(res => { + + this.getCommonSettings(); + this.router.navigate(['authentication/login']); + // this.router.navigate(['personal_discussion/pdlist']); + // localStorage.setItem('user_role',res.idToken.payload["custom:role_id"]); + // //this.router.navigate(['/']); + // //alert(localStorage.getItem('user_role')) + // this.loaderService.closeMatSpinnerDialog(); + // if(res.idToken.payload["custom:role_id"]=='11') + // { + // this.router.navigate(['sales-pd-list/list-pd']); + // } + // else + // { + // this.router.navigate(['personal_discussion/pdlist']); + // } + + }, err => { + this.loaderService.closeMatSpinnerDialog(); + // alert(err.message); + }) + } + }); +} + + +commonDetails: any; +getCommonSettings(){ + this.dashBoardService.getCommonSettingsConfig().subscribe(res=>{ + this.commonDetails = res; + if(this.commonDetails.dataStatus == true){ + localStorage.setItem("commonSettings",JSON.stringify(this.commonDetails.records)); + } }) } +resendOTP() { + this.timeLeft = 60; + this.dashBoardService.generateotp(this.loggedEmailID.split(/\s/).join('')).subscribe( + response => { + // if(response.status == 200) + this.interval = setInterval(() => { + if(this.timeLeft > 0) { + this.timeLeft--; + } else { + clearInterval(this.interval); + // alert(response.msg);//comment this. + } + },1000) + }); } +} +/** ======================= OtpComponent Ends Here ============================== */ + +/** ==================== New password Dialog Starts Here ======================== */ + +const newpassword = new FormControl('', Validators.required); +const confirmPassword = new FormControl('', CustomValidators.equalTo(newpassword)); + +@Component({ + selector: 'app-jazz-dialog', + template: ` +
New Password Change.
+ + + + {{hide1 ? 'visibility_off' : 'visibility'}} + + +
+ + + {{hide2 ? 'visibility_off' : 'visibility'}} + + + Passwords do not match. + +
+ + + + ` +}) +export class NewPasswordDialog { + + newpassword: any = newpassword; + confirmPassword: any = confirmPassword; + hide1: boolean = true; + hide2: boolean = true; + jazzMessage = 'Jazzy jazz jazz'; + + constructor(public dialogRef: MatDialogRef) { + + } + + +} +/** ==================== New password Dialog Ends Here ======================== */ +/** ==================== Forgot Password Dialog Starts Here =================== */ + +@Component({ + selector: 'app-jazz-dialog', + template: ` +
Forgot Password
+ + + + + + +
+ + + + + ` +}) +export class ForgotPass { + + newpassword: any = newpassword; + confirmPassword: any = confirmPassword; + jazzMessage = 'Jazzy jazz jazz'; + + constructor(public dialogRef: MatDialogRef) { + + } + +} +/** ==================== Forgot Password Dialog Ends Here =================== */ diff --git a/ng6-seed/src/app/session/session.module.ts b/ng6-seed/src/app/session/session.module.ts index 7d6012178..7687062c4 100755 --- a/ng6-seed/src/app/session/session.module.ts +++ b/ng6-seed/src/app/session/session.module.ts @@ -17,7 +17,7 @@ import { ForgotPasswordComponent } from './forgot-password/forgot-password.compo import { LockScreenComponent } from './lockscreen/lockscreen.component'; import { SessionRoutes } from './session.routing'; -import { OtpComponent } from './otp/otp.component'; +import { NewPasswordDialog, OtpComponent } from './otp/otp.component'; @NgModule({ imports: [ @@ -32,6 +32,7 @@ import { OtpComponent } from './otp/otp.component'; MatButtonModule, MatProgressBarModule, MatToolbarModule, + FlexLayoutModule,MatDialogModule ], declarations: [ @@ -39,9 +40,9 @@ import { OtpComponent } from './otp/otp.component'; RegisterComponent, ForgotPasswordComponent, LockScreenComponent, - OtpComponent + ], - entryComponents:[OtpComponent] + // entryComponents:[NewPasswordDialog,OtpComponent] }) export class SessionModule {}