From e1863ec9fae15a19d90296b99e07fafa41d04b9a Mon Sep 17 00:00:00 2001 From: Dmitry Nehaychik <4dmitr@gmail.com> Date: Wed, 1 Aug 2018 12:21:57 +0300 Subject: [PATCH] refactor(auth): make components CD=OnPush, use `nbInput`, `nbButton` (#595) BREAKING CHANGE: possibly a breaking change since we don't use bootstrap inputs and buttons anymore and use Nebular components instead also OnPush added to the components --- src/framework/auth/auth.module.ts | 12 ++- .../auth/components/login/login.component.ts | 45 +++++++---- .../components/register/register.component.ts | 75 +++++++++++++------ .../request-password.component.ts | 39 ++++++---- .../reset-password.component.ts | 54 +++++++++---- .../components/button/_button-sizes.scss | 4 +- .../button/_button.component.theme.scss | 2 +- .../global/bootstrap/_default-buttons.scss | 2 +- 8 files changed, 160 insertions(+), 73 deletions(-) diff --git a/src/framework/auth/auth.module.ts b/src/framework/auth/auth.module.ts index a337249ed8..a73eaa7a30 100644 --- a/src/framework/auth/auth.module.ts +++ b/src/framework/auth/auth.module.ts @@ -4,7 +4,14 @@ import { RouterModule } from '@angular/router'; import { FormsModule } from '@angular/forms'; import { HttpClientModule } from '@angular/common/http'; -import { NbCardModule, NbCheckboxModule, NbLayoutModule } from '@nebular/theme'; +import { + NbAlertModule, + NbButtonModule, + NbCardModule, + NbCheckboxModule, + NbInputModule, + NbLayoutModule, +} from '@nebular/theme'; import { NB_AUTH_FALLBACK_TOKEN, @@ -78,6 +85,9 @@ export function nbOptionsFactory(options) { NbLayoutModule, NbCardModule, NbCheckboxModule, + NbAlertModule, + NbInputModule, + NbButtonModule, RouterModule.forChild(routes), FormsModule, HttpClientModule, diff --git a/src/framework/auth/components/login/login.component.ts b/src/framework/auth/components/login/login.component.ts index ab7aecffcb..495c701296 100644 --- a/src/framework/auth/components/login/login.component.ts +++ b/src/framework/auth/components/login/login.component.ts @@ -3,7 +3,7 @@ * Copyright Akveo. All Rights Reserved. * Licensed under the MIT License. See License.txt in the project root for license information. */ -import { Component, Inject } from '@angular/core'; +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject } from '@angular/core'; import { Router } from '@angular/router'; import { NB_AUTH_OPTIONS, NbAuthSocialLink } from '../../auth.options'; import { getDeepFromObject } from '../../helpers'; @@ -20,23 +20,28 @@ import { NbAuthResult } from '../../services/auth-result';