Commit ed160b93 authored by David Burke's avatar David Burke

Started reset password tns component

parent 9a2f7449
Pipeline #37854459 passed with stages
in 5 minutes and 44 seconds
......@@ -36,6 +36,8 @@ import {
} from "./change-password";
import { TNSLoginEffects } from "./login/tns-login-effects";
import { MobileMenuModule } from "../mobile-menu";
import { ResetPasswordContainer } from "./reset-password/reset-password.container";
import { ResetPasswordComponent } from "./reset-password/reset-password.component";
export const COMPONENTS = [
LoginContainer,
......@@ -47,6 +49,8 @@ export const COMPONENTS = [
BackupCodeComponent,
ChangePasswordComponent,
ChangePasswordContainer,
ResetPasswordComponent,
ResetPasswordContainer,
ErrorReportingComponent,
ErrorReportingContainer
];
......
import {
Component,
ChangeDetectionStrategy,
Input,
Output,
EventEmitter,
OnInit
} from "@angular/core";
import { FormGroupState } from "ngrx-forms";
import { IResetPasswordForm } from "./reset-password.reducer";
@Component({
selector: "app-reset-password",
templateUrl: "./reset-password.component.html",
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ResetPasswordComponent implements OnInit {
@Input()
isExtension: boolean;
@Input()
form: FormGroupState<IResetPasswordForm>;
@Input()
errorMessage: string;
@Input()
hasStarted: boolean;
@Input()
hasFinished: boolean;
@Output()
submitEmail = new EventEmitter();
@Output()
reset = new EventEmitter();
constructor() {}
ngOnInit() {}
onSubmit() {
if (this.form.isValid) {
this.submitEmail.emit();
// this.emailInput.nativeElement.blur();
}
}
onReset() {
this.reset.emit();
// setTimeout(() => this.emailInput.nativeElement.focus(), 0);
}
}
......@@ -12,6 +12,7 @@ import { ConfirmEmailContainer } from "./account/confirm-email";
import { ConfirmEmailGuard } from "./account/confirm-email/confirm-email.guard";
import { ErrorReportingContainer } from "./account/error-reporting/error-reporting.container";
import { ChangePasswordContainer } from "./account/change-password";
import { ResetPasswordContainer } from "./account/reset-password/reset-password.container";
export const routes: Routes = [
{
......@@ -37,6 +38,15 @@ export const routes: Routes = [
showNavBar: false
}
},
{
path: "reset-password",
component: ResetPasswordContainer,
canActivate: [AlreadyLoggedInGuard],
data: {
title: "Reset Password",
showNavBar: false
}
},
{
path: "account/error-reporting",
component: ErrorReportingContainer,
......
......@@ -8,6 +8,7 @@ import { HeadingComponent } from "./heading/heading.component";
import { DirectivesModule } from "../directives";
import { CheckboxComponent } from "./checkbox/checkbox.component";
import { AsideLinkComponent } from "./aside-link/aside-link.component";
import { NativeScriptRouterModule } from "nativescript-angular/router";
export const COMPONENTS = [
ButtonComponent,
......@@ -18,7 +19,12 @@ export const COMPONENTS = [
];
@NgModule({
imports: [NativeScriptCommonModule, NgrxFormsModule, DirectivesModule],
imports: [
NativeScriptCommonModule,
NgrxFormsModule,
DirectivesModule,
NativeScriptRouterModule
],
declarations: COMPONENTS,
exports: COMPONENTS,
schemas: [NO_ERRORS_SCHEMA]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment