From 0d4f30d31f7539e9aaefd901ce2d9d19692bbc7c Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Fri, 22 Apr 2016 11:49:01 +0100 Subject: [PATCH] #17 removed login component --- .../app/components/login/login.component.css | 92 ------------------- .../app/components/login/login.component.html | 33 ------- .../app/components/login/login.component.ts | 46 ---------- 3 files changed, 171 deletions(-) delete mode 100644 demo-shell-ng2/app/components/login/login.component.css delete mode 100644 demo-shell-ng2/app/components/login/login.component.html delete mode 100644 demo-shell-ng2/app/components/login/login.component.ts diff --git a/demo-shell-ng2/app/components/login/login.component.css b/demo-shell-ng2/app/components/login/login.component.css deleted file mode 100644 index 30d931a564..0000000000 --- a/demo-shell-ng2/app/components/login/login.component.css +++ /dev/null @@ -1,92 +0,0 @@ -.login-card-wide.mdl-card { - width: 512px; - margin: auto; -} -.login-card-wide > .mdl-card__menu { - color: #000; -} - - - -.ng-invalid.ng-invalid.ng-touched { - border-color: rgb(222, 50, 38); - box-shadow: none; -} - -.ng-invalid.ng-invalid.ng-touched + label { - color: rgb(222, 50, 38); - font-size: 12px; -} - -.ng-invalid.ng-invalid.ng-touched + label:after { - background-color: rgb(222, 50, 38); -} - -.ng-invalid.ng-invalid.ng-touched ~ .mdl-tooltip--validation { - background-color: rgb(222, 50, 38); -} - - -.ng-invalid.ng-touched:not(:focus) + label::before { - font-family: 'Material Icons'; - font-weight: normal; - font-style: normal; - font-size: 24px; - /* Preferred icon size */ - - display: inline-block; - width: 1em; - height: 1em; - line-height: 1; - text-transform: none; - letter-spacing: normal; - word-wrap: normal; - /* Support for all WebKit browsers. */ - - -webkit-font-smoothing: antialiased; - /* Support for Safari and Chrome. */ - - text-rendering: optimizeLegibility; - /* Support for Firefox. */ - - -moz-osx-font-smoothing: grayscale; - /* Support for IE. */ - - font-feature-settings: 'liga'; - content: "warning"; - position: absolute; - right: 0; - bottom: 20px; -} - -.ng-valid.ng-touched:not(:focus) + label::before { - font-family: 'Material Icons'; - font-weight: normal; - font-style: normal; - font-size: 24px; - /* Preferred icon size */ - - display: inline-block; - width: 1em; - height: 1em; - line-height: 1; - text-transform: none; - letter-spacing: normal; - word-wrap: normal; - /* Support for all WebKit browsers. */ - - -webkit-font-smoothing: antialiased; - /* Support for Safari and Chrome. */ - - text-rendering: optimizeLegibility; - /* Support for Firefox. */ - - -moz-osx-font-smoothing: grayscale; - /* Support for IE. */ - - font-feature-settings: 'liga'; - content: "done"; - position: absolute; - right: 0; - bottom: 20px; -} \ No newline at end of file diff --git a/demo-shell-ng2/app/components/login/login.component.html b/demo-shell-ng2/app/components/login/login.component.html deleted file mode 100644 index 41944c2474..0000000000 --- a/demo-shell-ng2/app/components/login/login.component.html +++ /dev/null @@ -1,33 +0,0 @@ -
-
-
-

Login

-
-
-
- - - - Required. - - - Your username needs to be at least 4 characters. - -
- -
- - - - Required. - -
-
-
- -
-
-
-
-
-
\ No newline at end of file diff --git a/demo-shell-ng2/app/components/login/login.component.ts b/demo-shell-ng2/app/components/login/login.component.ts deleted file mode 100644 index e88d5e003f..0000000000 --- a/demo-shell-ng2/app/components/login/login.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -import {Component} from 'angular2/core'; -import {Router, ROUTER_DIRECTIVES} from 'angular2/router'; -import {FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators} from 'angular2/common'; -import {Authentication} from 'ng2-alfresco-login/ng2-alfresco-login'; -declare let componentHandler; - -@Component({ - selector: 'login-component', - moduleId: 'app/components/login/login', - directives: [ROUTER_DIRECTIVES, FORM_DIRECTIVES], - templateUrl: 'login.component.html', - styleUrls: ['login.component.css'], -}) -export class LoginComponent { - form:ControlGroup; - error:boolean = false; - - isErrorStyle(field:ControlGroup) { - componentHandler.upgradeAllRegistered(); - if (field.valid) { - return false; - } else { - return true; - } - } - - constructor(fb:FormBuilder, public auth:Authentication, public router:Router) { - this.form = fb.group({ - username: ['', Validators.compose([Validators.required, Validators.minLength(4)])], - password: ['', Validators.required] - }); - } - - onSubmit(value:any, event) { - if (event) { - event.preventDefault(); - } - this.auth.login('POST', value.username, value.password) - .subscribe( - (token:any) => this.router.navigate(['Files']), - () => { - this.error = true; - } - ); - } -}