From aab828c8e9ff84bfd379ec66ffdf60ccb3515123 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Sun, 5 Mar 2017 18:50:52 +0000 Subject: [PATCH] minor Login improvements (#1685) - replace inline SVG with the md-icon component - own validation/error style classes for theming purposes --- demo-shell-ng2/app/app.module.ts | 2 ++ ng2-components/ng2-alfresco-login/index.ts | 4 ++- .../components/alfresco-login.component.css | 25 +++++++++++++++++-- .../components/alfresco-login.component.html | 25 ++++++------------- 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/demo-shell-ng2/app/app.module.ts b/demo-shell-ng2/app/app.module.ts index 7a09e8d4f4..0cc24ac864 100644 --- a/demo-shell-ng2/app/app.module.ts +++ b/demo-shell-ng2/app/app.module.ts @@ -36,6 +36,7 @@ import { AppComponent } from './app.component'; import { routing } from './app.routes'; import { CustomEditorsModule } from './components/activiti/custom-editor/custom-editor.component'; import { Editor3DModule } from 'ng2-3d-editor'; +import { MaterialModule } from '@angular/material'; import { ChartsModule } from 'ng2-charts'; import { @@ -59,6 +60,7 @@ import { imports: [ BrowserModule, routing, + MaterialModule.forRoot(), CoreModule.forRoot(), LoginModule.forRoot(), SearchModule.forRoot(), diff --git a/ng2-components/ng2-alfresco-login/index.ts b/ng2-components/ng2-alfresco-login/index.ts index 5dd029984f..01872db735 100644 --- a/ng2-components/ng2-alfresco-login/index.ts +++ b/ng2-components/ng2-alfresco-login/index.ts @@ -17,6 +17,7 @@ import { NgModule, ModuleWithProviders } from '@angular/core'; import { CoreModule } from 'ng2-alfresco-core'; +import { MaterialModule } from '@angular/material'; import { LoginHeaderDirective } from './src/directives/login-header.directive'; import { LoginFooterDirective } from './src/directives/login-footer.directive'; @@ -35,7 +36,8 @@ export const ALFRESCO_LOGIN_DIRECTIVES: any[] = [ @NgModule({ imports: [ - CoreModule + CoreModule, + MaterialModule ], declarations: [ ...ALFRESCO_LOGIN_DIRECTIVES diff --git a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.css b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.css index ae4c9dccf4..550a7c6a59 100644 --- a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.css +++ b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.css @@ -192,11 +192,32 @@ padding-right: 25px; } -.alfresco-login__password .icon-inline { - left: 90%; +.alfresco-login__password-icon { + float: right; + margin-right: -24px; + cursor: pointer; + + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; } .alfresco-login__container { background-size: cover; background-position: center; } + +.alfresco-login__validation { + background-color: transparent; + color: red; + font-size: 12px; +} + +.alfresco-login__error { + color: #d50000; + position: absolute; + font-size: 12px; + margin-top: 5px; + display: block; +} diff --git a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.html b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.html index 30fb12a4e6..a6b6011ac9 100644 --- a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.html +++ b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.html @@ -23,10 +23,9 @@
{{'LOGIN.MESSAGES.LOGIN-SUCCESS' | translate }}
-
+ class="center mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> - - {{formError.username | translate }} +
- - - - - - - - - - + + - - {{formError.password | translate }} +