From 81c83f921f7f2d1ef1361c7618104bd54fdfb4fb Mon Sep 17 00:00:00 2001 From: byronkamal Date: Thu, 5 Apr 2018 22:14:42 -0300 Subject: [PATCH 01/16] Creating login form component and routes --- .angular-cli.json | 60 +++++++++++++++++++ .editorconfig | 13 ++++ .gitignore | 44 ++++++++++++++ src/app/app.component.html | 3 + src/app/app.module.ts | 9 ++- src/app/app.routes.ts | 10 ++++ src/app/login-form/login-form.component.css | 0 src/app/login-form/login-form.component.html | 3 + .../login-form/login-form.component.spec.ts | 25 ++++++++ src/app/login-form/login-form.component.ts | 15 +++++ 10 files changed, 179 insertions(+), 3 deletions(-) create mode 100644 .angular-cli.json create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 src/app/app.routes.ts create mode 100644 src/app/login-form/login-form.component.css create mode 100644 src/app/login-form/login-form.component.html create mode 100644 src/app/login-form/login-form.component.spec.ts create mode 100644 src/app/login-form/login-form.component.ts diff --git a/.angular-cli.json b/.angular-cli.json new file mode 100644 index 0000000..65b50c2 --- /dev/null +++ b/.angular-cli.json @@ -0,0 +1,60 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "project": { + "name": "inclu-care" + }, + "apps": [ + { + "root": "src", + "outDir": "dist", + "assets": [ + "assets", + "favicon.ico" + ], + "index": "index.html", + "main": "main.ts", + "polyfills": "polyfills.ts", + "test": "test.ts", + "tsconfig": "tsconfig.app.json", + "testTsconfig": "tsconfig.spec.json", + "prefix": "app", + "styles": [ + "styles.css" + ], + "scripts": [], + "environmentSource": "environments/environment.ts", + "environments": { + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } + } + ], + "e2e": { + "protractor": { + "config": "./protractor.conf.js" + } + }, + "lint": [ + { + "project": "src/tsconfig.app.json", + "exclude": "**/node_modules/**" + }, + { + "project": "src/tsconfig.spec.json", + "exclude": "**/node_modules/**" + }, + { + "project": "e2e/tsconfig.e2e.json", + "exclude": "**/node_modules/**" + } + ], + "test": { + "karma": { + "config": "./karma.conf.js" + } + }, + "defaults": { + "styleExt": "css", + "component": {} + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6e87a00 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eabf65e --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/dist-server +/tmp +/out-tsc + +# dependencies +/node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings + +# e2e +/e2e/*.js +/e2e/*.map + +# System Files +.DS_Store +Thumbs.db diff --git a/src/app/app.component.html b/src/app/app.component.html index fa2706a..71c4b8c 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,4 +1,6 @@ + + diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 926975a..94d9cf4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,14 +3,17 @@ import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; - +import { LoginFormComponent } from './login-form/login-form.component'; +import { routing } from './app.routes'; @NgModule({ declarations: [ - AppComponent + AppComponent, + LoginFormComponent ], imports: [ - BrowserModule + BrowserModule, + routing ], providers: [], bootstrap: [AppComponent] diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts new file mode 100644 index 0000000..10a31a3 --- /dev/null +++ b/src/app/app.routes.ts @@ -0,0 +1,10 @@ +import { Routes, RouterModule } from '@angular/router'; +import { ModuleWithProviders } from '@angular/core'; +import { LoginFormComponent } from './login-form/login-form.component'; + +const APP_ROUTES: Routes = [ + + { path: 'userLogin', component: LoginFormComponent } +] + +export const routing: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); diff --git a/src/app/login-form/login-form.component.css b/src/app/login-form/login-form.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/login-form/login-form.component.html b/src/app/login-form/login-form.component.html new file mode 100644 index 0000000..018df30 --- /dev/null +++ b/src/app/login-form/login-form.component.html @@ -0,0 +1,3 @@ +

+ login-form works! +

diff --git a/src/app/login-form/login-form.component.spec.ts b/src/app/login-form/login-form.component.spec.ts new file mode 100644 index 0000000..c5f08d4 --- /dev/null +++ b/src/app/login-form/login-form.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoginFormComponent } from './login-form.component'; + +describe('LoginFormComponent', () => { + let component: LoginFormComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LoginFormComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LoginFormComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/login-form/login-form.component.ts b/src/app/login-form/login-form.component.ts new file mode 100644 index 0000000..8295aec --- /dev/null +++ b/src/app/login-form/login-form.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-login-form', + templateUrl: './login-form.component.html', + styleUrls: ['./login-form.component.css'] +}) +export class LoginFormComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} From defb8649a567b43a93f52cb3321a85d12843562b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Arag=C3=A3o?= Date: Thu, 5 Apr 2018 23:45:15 -0300 Subject: [PATCH 02/16] Adding Materialize CSS to project --- .angular-cli.json | 7 +- package-lock.json | 1421 ++++++++++++++++++++++++++++++++++------- package.json | 4 + src/app/app.module.ts | 7 +- src/app/app.routes.ts | 2 +- src/index.html | 1 + 6 files changed, 1193 insertions(+), 249 deletions(-) diff --git a/.angular-cli.json b/.angular-cli.json index 65b50c2..f318163 100644 --- a/.angular-cli.json +++ b/.angular-cli.json @@ -19,9 +19,14 @@ "testTsconfig": "tsconfig.spec.json", "prefix": "app", "styles": [ + "../node_modules/materialize-css/dist/css/materialize.css", "styles.css" ], - "scripts": [], + "scripts": [ + "../node_modules/jquery/dist/jquery.js", + "../node_modules/hammerjs/hammer.js", + "../node_modules/materialize-css/dist/js/materialize.js" + ], "environmentSource": "environments/environment.ts", "environments": { "dev": "environments/environment.ts", diff --git a/package-lock.json b/package-lock.json index 18ece98..b725772 100644 --- a/package-lock.json +++ b/package-lock.json @@ -494,6 +494,11 @@ } } }, + "angular2-materialize": { + "version": "15.1.10", + "resolved": "https://registry.npmjs.org/angular2-materialize/-/angular2-materialize-15.1.10.tgz", + "integrity": "sha1-d17LSgs5tXieOkAOYMZ7xIyFNN8=" + }, "ansi-html": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", @@ -1670,6 +1675,7 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", + "fsevents": "1.1.3", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -3661,269 +3667,1178 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.2" - } - }, - "ftp": { - "version": "0.3.10", - "resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz", - "integrity": "sha1-kZfYYa2BQvPmPVqDv+TFn3MwiF0=", + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", "dev": true, "optional": true, "requires": { - "readable-stream": "1.1.14", - "xregexp": "2.0.0" + "nan": "2.10.0", + "node-pre-gyp": "0.6.39" }, "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "abbrev": { + "version": "1.1.0", + "bundled": true, "dev": true, "optional": true }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "ajv": { + "version": "4.11.8", + "bundled": true, "dev": true, "optional": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" + "co": "4.6.0", + "json-stable-stringify": "1.0.1" } }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true, - "optional": true - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "gaze": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.2.tgz", - "integrity": "sha1-hHIkZ3rbiHDWeSV+0ziP22HkAQU=", - "dev": true, - "optional": true, - "requires": { - "globule": "1.2.0" - } - }, - "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", - "dev": true, - "optional": true - }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", - "dev": true, - "optional": true, - "requires": { - "is-property": "1.0.2" - } - }, - "get-caller-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", - "dev": true - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "get-uri": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-2.0.1.tgz", - "integrity": "sha512-7aelVrYqCLuVjq2kEKRTH8fXPTC0xKTkM+G7UlFkEwCXY3sFbSxvY375JoFowOAYbkaU47SrBvOefUlLZZ+6QA==", - "dev": true, - "optional": true, - "requires": { - "data-uri-to-buffer": "1.2.0", - "debug": "2.6.9", - "extend": "3.0.1", - "file-uri-to-path": "1.0.0", - "ftp": "0.3.10", - "readable-stream": "2.3.6" - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "2.0.1" - } - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - }, - "globby": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz", - "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", - "dev": true, - "requires": { - "array-union": "1.0.2", - "dir-glob": "2.0.0", - "glob": "7.1.2", - "ignore": "3.3.7", - "pify": "3.0.0", - "slash": "1.0.0" - } - }, - "globule": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.0.tgz", - "integrity": "sha1-HcScaCLdnoovoAuiopUAboZkvQk=", - "dev": true, - "optional": true, - "requires": { - "glob": "7.1.2", - "lodash": "4.17.5", - "minimatch": "3.0.4" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "handle-thing": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", - "integrity": "sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=", - "dev": true - }, - "handlebars": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", - "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", - "dev": true, - "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "ansi-regex": { + "version": "2.1.1", + "bundled": true, "dev": true }, - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "aproba": { + "version": "1.1.1", + "bundled": true, "dev": true, "optional": true }, - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true, + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true, + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true, + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "dev": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true, + "dev": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + } + } + }, + "fstream": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.2" + } + }, + "ftp": { + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/ftp/-/ftp-0.3.10.tgz", + "integrity": "sha1-kZfYYa2BQvPmPVqDv+TFn3MwiF0=", + "dev": true, + "optional": true, + "requires": { + "readable-stream": "1.1.14", + "xregexp": "2.0.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true, + "optional": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "optional": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true, + "optional": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "gaze": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.2.tgz", + "integrity": "sha1-hHIkZ3rbiHDWeSV+0ziP22HkAQU=", + "dev": true, + "optional": true, + "requires": { + "globule": "1.2.0" + } + }, + "generate-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "dev": true, + "optional": true + }, + "generate-object-property": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", + "dev": true, + "optional": true, + "requires": { + "is-property": "1.0.2" + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "get-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-2.0.1.tgz", + "integrity": "sha512-7aelVrYqCLuVjq2kEKRTH8fXPTC0xKTkM+G7UlFkEwCXY3sFbSxvY375JoFowOAYbkaU47SrBvOefUlLZZ+6QA==", + "dev": true, + "optional": true, + "requires": { + "data-uri-to-buffer": "1.2.0", + "debug": "2.6.9", + "extend": "3.0.1", + "file-uri-to-path": "1.0.0", + "ftp": "0.3.10", + "readable-stream": "2.3.6" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz", + "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "dir-glob": "2.0.0", + "glob": "7.1.2", + "ignore": "3.3.7", + "pify": "3.0.0", + "slash": "1.0.0" + } + }, + "globule": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.0.tgz", + "integrity": "sha1-HcScaCLdnoovoAuiopUAboZkvQk=", + "dev": true, + "optional": true, + "requires": { + "glob": "7.1.2", + "lodash": "4.17.5", + "minimatch": "3.0.4" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "hammerjs": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz", + "integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE=" + }, + "handle-thing": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", + "integrity": "sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=", + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", "dev": true, "optional": true, "requires": { @@ -5122,6 +6037,11 @@ "integrity": "sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4=", "dev": true }, + "jquery": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-2.2.4.tgz", + "integrity": "sha1-LInWiJterFIqfuoywUUhVZxsvwI=" + }, "js-base64": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.3.tgz", @@ -5868,6 +6788,15 @@ "object-visit": "1.0.1" } }, + "materialize-css": { + "version": "0.100.2", + "resolved": "https://registry.npmjs.org/materialize-css/-/materialize-css-0.100.2.tgz", + "integrity": "sha512-Bf4YeoJCIdk4dlpnmVX+DIOJBbqOKwfBPD+tT5bxwXNFMLk649CGbldqtnctkkfMp+fGgSAsdYu9lo1ZolZqgA==", + "requires": { + "hammerjs": "2.0.8", + "jquery": "2.2.4" + } + }, "md5.js": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", @@ -10343,6 +11272,7 @@ "anymatch": "2.0.0", "async-each": "1.0.1", "braces": "2.3.1", + "fsevents": "1.1.3", "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -11090,6 +12020,7 @@ "anymatch": "2.0.0", "async-each": "1.0.1", "braces": "2.3.1", + "fsevents": "1.1.3", "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", diff --git a/package.json b/package.json index 42160a9..e668eae 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,11 @@ "@angular/platform-browser": "^5.2.0", "@angular/platform-browser-dynamic": "^5.2.0", "@angular/router": "^5.2.0", + "angular2-materialize": "^15.1.10", "core-js": "^2.4.1", + "hammerjs": "^2.0.8", + "jquery": "^2.2.4", + "materialize-css": "^0.100.2", "rxjs": "^5.5.6", "zone.js": "^0.8.19" }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 94d9cf4..937b3e4 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,10 +1,12 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; +import { Routing } from './app.routes'; +import { MaterializeModule } from 'angular2-materialize'; import { AppComponent } from './app.component'; import { LoginFormComponent } from './login-form/login-form.component'; -import { routing } from './app.routes'; + @NgModule({ declarations: [ @@ -13,7 +15,8 @@ import { routing } from './app.routes'; ], imports: [ BrowserModule, - routing + Routing, + MaterializeModule ], providers: [], bootstrap: [AppComponent] diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 10a31a3..10232d4 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -7,4 +7,4 @@ const APP_ROUTES: Routes = [ { path: 'userLogin', component: LoginFormComponent } ] -export const routing: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); +export const Routing: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); diff --git a/src/index.html b/src/index.html index 49a2662..e21f989 100644 --- a/src/index.html +++ b/src/index.html @@ -7,6 +7,7 @@ + From f3d3c401c66bb5e62d9e7d9a7f4666b5d9db8ea9 Mon Sep 17 00:00:00 2001 From: IgorVeludo Date: Mon, 9 Apr 2018 17:34:02 -0300 Subject: [PATCH 03/16] creating team member component --- src/app/app.module.ts | 4 ++- src/app/app.routes.ts | 9 ++++++- src/app/team-member/team-member.component.css | 0 .../team-member/team-member.component.html | 3 +++ .../team-member/team-member.component.spec.ts | 25 +++++++++++++++++++ src/app/team-member/team-member.component.ts | 15 +++++++++++ 6 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 src/app/team-member/team-member.component.css create mode 100644 src/app/team-member/team-member.component.html create mode 100644 src/app/team-member/team-member.component.spec.ts create mode 100644 src/app/team-member/team-member.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 495bff5..729ae02 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -5,11 +5,13 @@ import { Routing } from './app.routes'; import { MaterializeModule } from 'angular2-materialize'; import { AppComponent } from './app.component'; +import { TeamMemberComponent } from './team-member/team-member.component'; @NgModule({ declarations: [ - AppComponent + AppComponent, + TeamMemberComponent ], imports: [ BrowserModule, diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 8895ca1..cc27450 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -1,6 +1,13 @@ import { Routes, RouterModule } from '@angular/router'; import { ModuleWithProviders } from '@angular/core'; +import { TeamMemberComponent } from './team-member/team-member.component'; + +const APP_ROUTES: Routes = [ + + { path: 'teamMember', component: TeamMemberComponent } + +] + -const APP_ROUTES: Routes = [] export const Routing: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); diff --git a/src/app/team-member/team-member.component.css b/src/app/team-member/team-member.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/team-member/team-member.component.html b/src/app/team-member/team-member.component.html new file mode 100644 index 0000000..cdc52c9 --- /dev/null +++ b/src/app/team-member/team-member.component.html @@ -0,0 +1,3 @@ +

+ team-member works! +

diff --git a/src/app/team-member/team-member.component.spec.ts b/src/app/team-member/team-member.component.spec.ts new file mode 100644 index 0000000..be363f7 --- /dev/null +++ b/src/app/team-member/team-member.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TeamMemberComponent } from './team-member.component'; + +describe('TeamMemberComponent', () => { + let component: TeamMemberComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TeamMemberComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TeamMemberComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/team-member/team-member.component.ts b/src/app/team-member/team-member.component.ts new file mode 100644 index 0000000..b5ddb08 --- /dev/null +++ b/src/app/team-member/team-member.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-team-member', + templateUrl: './team-member.component.html', + styleUrls: ['./team-member.component.css'] +}) +export class TeamMemberComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} From f652bfd1121726dcbe399625be71bad2b550e5a0 Mon Sep 17 00:00:00 2001 From: Gabriel Alves Date: Sat, 14 Apr 2018 03:02:49 -0300 Subject: [PATCH 04/16] Create component 'Students' --- src/app/app.module.ts | 4 +++- src/app/students/students.component.css | 0 src/app/students/students.component.html | 3 +++ src/app/students/students.component.spec.ts | 25 +++++++++++++++++++++ src/app/students/students.component.ts | 15 +++++++++++++ 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/app/students/students.component.css create mode 100644 src/app/students/students.component.html create mode 100644 src/app/students/students.component.spec.ts create mode 100644 src/app/students/students.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 495bff5..37e3dc3 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -5,11 +5,13 @@ import { Routing } from './app.routes'; import { MaterializeModule } from 'angular2-materialize'; import { AppComponent } from './app.component'; +import { StudentsComponent } from './students/students.component'; @NgModule({ declarations: [ - AppComponent + AppComponent, + StudentsComponent ], imports: [ BrowserModule, diff --git a/src/app/students/students.component.css b/src/app/students/students.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/students/students.component.html b/src/app/students/students.component.html new file mode 100644 index 0000000..ca271fd --- /dev/null +++ b/src/app/students/students.component.html @@ -0,0 +1,3 @@ +

+ students works! +

diff --git a/src/app/students/students.component.spec.ts b/src/app/students/students.component.spec.ts new file mode 100644 index 0000000..7982c07 --- /dev/null +++ b/src/app/students/students.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { StudentsComponent } from './students.component'; + +describe('StudentsComponent', () => { + let component: StudentsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ StudentsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(StudentsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/students/students.component.ts b/src/app/students/students.component.ts new file mode 100644 index 0000000..80e03df --- /dev/null +++ b/src/app/students/students.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-students', + templateUrl: './students.component.html', + styleUrls: ['./students.component.css'] +}) +export class StudentsComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} From d1b4a6906285f82f57113e3ba5833703c7562392 Mon Sep 17 00:00:00 2001 From: William Almeida Date: Mon, 16 Apr 2018 15:33:55 -0300 Subject: [PATCH 05/16] Adding student component methods and attributes --- src/app/app.component.html | 26 ++--------- src/app/app.module.ts | 18 +++++--- src/app/app.routes.ts | 15 +++++-- src/app/students/students.component.html | 55 +++++++++++++++++++++++- src/app/students/students.component.ts | 20 ++++++++- 5 files changed, 100 insertions(+), 34 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 2567c95..28110d5 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,23 +1,5 @@ +

+ IncluCare +

+
- - - diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 37e3dc3..e64ee5b 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,24 +1,28 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; - -import { Routing } from './app.routes'; -import { MaterializeModule } from 'angular2-materialize'; +import { FormsModule } from '@angular/forms'; +import { HttpModule } from '@angular/http'; import { AppComponent } from './app.component'; import { StudentsComponent } from './students/students.component'; +import { routes } from './app.routes'; +import { StudentFormComponent } from './students/student-form/student-form.component'; +import { StudentService } from './students/shared/student.service'; @NgModule({ declarations: [ AppComponent, - StudentsComponent + StudentsComponent, + StudentFormComponent ], imports: [ BrowserModule, - Routing, - MaterializeModule + FormsModule, + HttpModule, + routes ], - providers: [], + providers: [StudentService], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 8895ca1..85fe289 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -1,6 +1,15 @@ -import { Routes, RouterModule } from '@angular/router'; import { ModuleWithProviders } from '@angular/core'; -const APP_ROUTES: Routes = [] +import { Routes, RouterModule } from '@angular/router'; -export const Routing: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); +import { StudentsComponent } from './students/students.component'; +import { StudentFormComponent } from './students/student-form/student-form.component'; + +const APP_ROUTES: Routes = [ + { path: '', pathMatch: 'full', component: StudentsComponent }, + { path: 'students/new', component: StudentFormComponent}, + { path: 'students/:id', component: StudentFormComponent}, + { path: 'students/:id/edit', component: StudentFormComponent} +]; + +export const routes: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); diff --git a/src/app/students/students.component.html b/src/app/students/students.component.html index ca271fd..227d5ea 100644 --- a/src/app/students/students.component.html +++ b/src/app/students/students.component.html @@ -1,3 +1,56 @@

- students works! + Mostrando {{ students.length }} estudantes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NomeData de nascimentoIdadeNacionalidadeAnoTurmaTurnoNome da mãeNome do paiEndereçoTelefone do responsávelEmail do responsável
{{ s.name }}{{ s.birth_date }}{{ s.age }}{{ s.nationality }}{{ s.year }}{{ s.student_class }}{{ s.shift }}{{ s.father_name }}{{ s.mother_name }}{{ s.address }}{{ s.parent_telephone }}{{ s.parent_email }} + + Editar + + + + Deletar + +
+ + diff --git a/src/app/students/students.component.ts b/src/app/students/students.component.ts index 80e03df..f3e4028 100644 --- a/src/app/students/students.component.ts +++ b/src/app/students/students.component.ts @@ -1,5 +1,9 @@ import { Component, OnInit } from '@angular/core'; +import { StudentService } from './shared/student.service'; + +import {Student} from "./shared/student"; + @Component({ selector: 'app-students', templateUrl: './students.component.html', @@ -7,9 +11,23 @@ import { Component, OnInit } from '@angular/core'; }) export class StudentsComponent implements OnInit { - constructor() { } + private students: Student[] = []; + + constructor(private studentService: StudentService) { } ngOnInit() { + this.studentService.getStudents() + .subscribe(data => this.students = data); + } + + deleteStudent(students) { + if (confirm("Você tem certeza que quer deletar o estudante " + students.name + "?")) { + var index = this.students.indexOf(students); + this.students.splice(index, 1); + + this.studentService.deleteStudent(students.id) + .subscribe(null); + } } } From f00062bb59ffc38c92f0b0d68f4eb7b2aa70b327 Mon Sep 17 00:00:00 2001 From: William Almeida Date: Mon, 16 Apr 2018 15:34:58 -0300 Subject: [PATCH 06/16] Adding Student Service --- .../students/shared/student.service.spec.ts | 15 +++++++ src/app/students/shared/student.service.ts | 41 +++++++++++++++++++ src/app/students/shared/student.ts | 15 +++++++ 3 files changed, 71 insertions(+) create mode 100644 src/app/students/shared/student.service.spec.ts create mode 100644 src/app/students/shared/student.service.ts create mode 100644 src/app/students/shared/student.ts diff --git a/src/app/students/shared/student.service.spec.ts b/src/app/students/shared/student.service.spec.ts new file mode 100644 index 0000000..606cdba --- /dev/null +++ b/src/app/students/shared/student.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { StudentService } from './student.service'; + +describe('StudentService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [StudentService] + }); + }); + + it('should be created', inject([StudentService], (service: StudentService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/src/app/students/shared/student.service.ts b/src/app/students/shared/student.service.ts new file mode 100644 index 0000000..5c5386e --- /dev/null +++ b/src/app/students/shared/student.service.ts @@ -0,0 +1,41 @@ +import { Injectable } from '@angular/core'; +import { Http } from '@angular/http'; + +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/do'; +import 'rxjs/add/operator/catch'; +import { Observable } from 'rxjs/Rx'; + +@Injectable() +export class StudentService { + + private url: string = "http://localhost:3000/students"; + + constructor(private http: Http) { } + + getStudents(){ + return this.http.get(this.url) + .map(res => res.json()); + } + + getStudent(id){ + return this.http.get(this.url + '/' + id) + .map(res => res.json()); + } + + addStudent(student){ + return this.http.post(this.url, {'student': student}) + .map(res => res.json()); + } + + updateStudent(student){ + return this.http.put(this.url + '/' + student.id, {'student': student}) + .map(res => res.json()); + } + + deleteStudent(id){ + return this.http.delete(this.url + '/' + id) + .map(res => res.json()); + } + +} diff --git a/src/app/students/shared/student.ts b/src/app/students/shared/student.ts new file mode 100644 index 0000000..4324112 --- /dev/null +++ b/src/app/students/shared/student.ts @@ -0,0 +1,15 @@ +export class Student { + id: number; + name: string; + birth_date: any; + age: number; + nationality: string; + year: number; + student_class: string; + shift: string; + father_name: string; + mother_name: string; + address: string; + parent_telephone: number; + parent_email: string; +} From b2d1ba95299f2cf6310f0ae95214aa99041d6e3f Mon Sep 17 00:00:00 2001 From: William Almeida Date: Mon, 16 Apr 2018 15:35:29 -0300 Subject: [PATCH 07/16] Adding Student form --- .../student-form/student-form.component.css | 0 .../student-form/student-form.component.html | 56 +++++++++++++++++++ .../student-form.component.spec.ts | 25 +++++++++ .../student-form/student-form.component.ts | 55 ++++++++++++++++++ 4 files changed, 136 insertions(+) create mode 100644 src/app/students/student-form/student-form.component.css create mode 100644 src/app/students/student-form/student-form.component.html create mode 100644 src/app/students/student-form/student-form.component.spec.ts create mode 100644 src/app/students/student-form/student-form.component.ts diff --git a/src/app/students/student-form/student-form.component.css b/src/app/students/student-form/student-form.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/students/student-form/student-form.component.html b/src/app/students/student-form/student-form.component.html new file mode 100644 index 0000000..2393e39 --- /dev/null +++ b/src/app/students/student-form/student-form.component.html @@ -0,0 +1,56 @@ +
+

{{ name }}

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ Voltar +
diff --git a/src/app/students/student-form/student-form.component.spec.ts b/src/app/students/student-form/student-form.component.spec.ts new file mode 100644 index 0000000..5ca952e --- /dev/null +++ b/src/app/students/student-form/student-form.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { StudentFormComponent } from './student-form.component'; + +describe('StudentFormComponent', () => { + let component: StudentFormComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ StudentFormComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(StudentFormComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/students/student-form/student-form.component.ts b/src/app/students/student-form/student-form.component.ts new file mode 100644 index 0000000..8bdc40b --- /dev/null +++ b/src/app/students/student-form/student-form.component.ts @@ -0,0 +1,55 @@ +import { Component, OnInit } from '@angular/core'; + +import { StudentService } from '../shared/student.service'; + +import {Student} from "../shared/student"; + +import { Router, ActivatedRoute } from '@angular/router'; + + +@Component({ + selector: 'app-student-form', + templateUrl: './student-form.component.html', + styleUrls: ['./student-form.component.css'] +}) +export class StudentFormComponent implements OnInit { + + name: string; + student: Student = new Student(); + + constructor( + + private studentService: StudentService, + private router: Router, + private route: ActivatedRoute + ) { } + + ngOnInit() { + var id = this.route.params.subscribe(params => { + var id = params['id']; + + this.name = id ? 'Editar Estudante' : 'Criar Estudante'; + + if (!id) + return; + + this.studentService.getStudent(id) + .subscribe( + student => this.student = student, + response => {}); + }); + } + + save() { + var result; + + if (this.student.id){ + result = this.studentService.updateStudent(this.student); + } else { + result = this.studentService.addStudent(this.student); + } + + result.subscribe(data => this.router.navigate(['/'])); + } + +} From 66852cd62d238946cc7086f613e419e20fa0284d Mon Sep 17 00:00:00 2001 From: William Almeida Date: Mon, 16 Apr 2018 15:57:16 -0300 Subject: [PATCH 08/16] Creating the get method for Student component --- src/app/students/students.component.html | 4 ++-- src/app/students/students.component.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/students/students.component.html b/src/app/students/students.component.html index 227d5ea..b9f84d5 100644 --- a/src/app/students/students.component.html +++ b/src/app/students/students.component.html @@ -1,5 +1,5 @@

- Mostrando {{ students.length }} estudantes. + Mostrando {{ getStudents().length }} estudantes.

@@ -21,7 +21,7 @@ - + diff --git a/src/app/students/students.component.ts b/src/app/students/students.component.ts index f3e4028..899054f 100644 --- a/src/app/students/students.component.ts +++ b/src/app/students/students.component.ts @@ -30,4 +30,8 @@ export class StudentsComponent implements OnInit { } } + getStudents() { + return this.students; + } + } From 31ff2bbce44379255acefd8a3399ffbfd6e65761 Mon Sep 17 00:00:00 2001 From: IgorVeludo Date: Mon, 16 Apr 2018 22:37:28 -0300 Subject: [PATCH 09/16] developing team member and creating the comunication front-back end --- src/app/app.module.ts | 10 ++- .../service/register/register.service.spec.ts | 15 +++++ src/app/service/register/register.service.ts | 16 +++++ .../team-member/team-member.component.html | 62 ++++++++++++++++++- src/app/team-member/team-member.component.ts | 29 ++++++++- 5 files changed, 127 insertions(+), 5 deletions(-) create mode 100644 src/app/service/register/register.service.spec.ts create mode 100644 src/app/service/register/register.service.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 729ae02..0ee7222 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,11 +1,16 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { HttpModule } from '@angular/http'; import { Routing } from './app.routes'; import { MaterializeModule } from 'angular2-materialize'; import { AppComponent } from './app.component'; import { TeamMemberComponent } from './team-member/team-member.component'; +import { RegisterService } from './service/register/register.service'; + + @NgModule({ @@ -14,11 +19,14 @@ import { TeamMemberComponent } from './team-member/team-member.component'; TeamMemberComponent ], imports: [ + FormsModule, + HttpModule, + ReactiveFormsModule, BrowserModule, Routing, MaterializeModule ], - providers: [], + providers: [RegisterService], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/src/app/service/register/register.service.spec.ts b/src/app/service/register/register.service.spec.ts new file mode 100644 index 0000000..b6352c2 --- /dev/null +++ b/src/app/service/register/register.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { RegisterService } from './register.service'; + +describe('RegisterService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [RegisterService] + }); + }); + + it('should be created', inject([RegisterService], (service: RegisterService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/src/app/service/register/register.service.ts b/src/app/service/register/register.service.ts new file mode 100644 index 0000000..4f23744 --- /dev/null +++ b/src/app/service/register/register.service.ts @@ -0,0 +1,16 @@ +import { Injectable } from '@angular/core'; +import { Http, Headers, Response, RequestOptions } from '@angular/http'; + +@Injectable() +export class RegisterService { + + constructor(private http: Http) { } + + registerTeamMember(teamMember: any){ + let team_member = {email: teamMember.email, password: teamMember.password} + return this.http.post('http://localhost:3000/team_members', team_member).map( + (response: Response) => {return response.json() + }); + } + +} diff --git a/src/app/team-member/team-member.component.html b/src/app/team-member/team-member.component.html index cdc52c9..b4d48d8 100644 --- a/src/app/team-member/team-member.component.html +++ b/src/app/team-member/team-member.component.html @@ -1,3 +1,59 @@ -

- team-member works! -

+ + + + + +
+
+
+
+
+ + +
+
+
+
+
+ diff --git a/src/app/team-member/team-member.component.ts b/src/app/team-member/team-member.component.ts index b5ddb08..bd5cfb8 100644 --- a/src/app/team-member/team-member.component.ts +++ b/src/app/team-member/team-member.component.ts @@ -1,4 +1,7 @@ import { Component, OnInit } from '@angular/core'; +import { FormGroup, FormBuilder, FormsModule, ReactiveFormsModule, FormControl, Validators } from '@angular/forms'; +import 'rxjs/Rx'; +import { RegisterService } from '../service/register/register.service' @Component({ selector: 'app-team-member', @@ -7,9 +10,33 @@ import { Component, OnInit } from '@angular/core'; }) export class TeamMemberComponent implements OnInit { - constructor() { } + registerForm: FormGroup; + email: FormControl; + password: FormControl; + constructor(private fb:FormBuilder, private teamMemberService: RegisterService) { + this.buildFormControl(); + this.registerForm = fb.group({ + email: this.email, + password: this.password + }); + } ngOnInit() { + + } + + registerTeamMember(user: any){ + console.log(user) + this.teamMemberService.registerTeamMember(user).subscribe( + success => {console.log(success)}, + error => {} + ) + } + + buildFormControl(){ + this.email = new FormControl(null, Validators.compose([Validators.required, Validators.email])); + this.password = new FormControl(null, Validators.compose([Validators.required])); + } } From bad2b48b7cacfc45a48d64fea457a3edc7dbe1a8 Mon Sep 17 00:00:00 2001 From: William Almeida Date: Tue, 17 Apr 2018 19:57:53 -0300 Subject: [PATCH 10/16] Fixing students route --- src/app/app.routes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 85fe289..68aa502 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -6,7 +6,7 @@ import { StudentsComponent } from './students/students.component'; import { StudentFormComponent } from './students/student-form/student-form.component'; const APP_ROUTES: Routes = [ - { path: '', pathMatch: 'full', component: StudentsComponent }, + { path: 'students', pathMatch: 'full', component: StudentsComponent }, { path: 'students/new', component: StudentFormComponent}, { path: 'students/:id', component: StudentFormComponent}, { path: 'students/:id/edit', component: StudentFormComponent} From fec3bf0365bdbc32262b6c75b862c67df1a649cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Arag=C3=A3o?= Date: Tue, 17 Apr 2018 23:38:00 -0300 Subject: [PATCH 11/16] Setting environment for Devise Token Auth --- .angular-cli.json | 3 ++- package-lock.json | 10 ++++++++ package.json | 2 ++ src/app/app.component.ts | 19 +++++++++++++++ src/app/app.module.ts | 24 ++++++++++++------- src/app/app.routes.ts | 2 ++ src/app/environments/environment.prod.ts | 3 +++ src/app/environments/environment.ts | 11 +++++++++ src/app/login-form/login-form.component.html | 3 --- src/app/login-form/login-form.component.ts | 15 ------------ .../login.component.css} | 0 src/app/login/login.component.html | 3 +++ .../login.component.spec.ts} | 12 +++++----- src/app/login/login.component.ts | 15 ++++++++++++ 14 files changed, 88 insertions(+), 34 deletions(-) create mode 100644 src/app/environments/environment.prod.ts create mode 100644 src/app/environments/environment.ts delete mode 100644 src/app/login-form/login-form.component.html delete mode 100644 src/app/login-form/login-form.component.ts rename src/app/{login-form/login-form.component.css => login/login.component.css} (100%) create mode 100644 src/app/login/login.component.html rename src/app/{login-form/login-form.component.spec.ts => login/login.component.spec.ts} (55%) create mode 100644 src/app/login/login.component.ts diff --git a/.angular-cli.json b/.angular-cli.json index f318163..2ad5dbb 100644 --- a/.angular-cli.json +++ b/.angular-cli.json @@ -19,8 +19,9 @@ "testTsconfig": "tsconfig.spec.json", "prefix": "app", "styles": [ + "styles.css", "../node_modules/materialize-css/dist/css/materialize.css", - "styles.css" + "../node_modules/font-awesome/css/font-awesome.css" ], "scripts": [ "../node_modules/jquery/dist/jquery.js", diff --git a/package-lock.json b/package-lock.json index 3baee69..98c76dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -499,6 +499,11 @@ "resolved": "https://registry.npmjs.org/angular2-materialize/-/angular2-materialize-15.1.10.tgz", "integrity": "sha1-d17LSgs5tXieOkAOYMZ7xIyFNN8=" }, + "angular2-token": { + "version": "0.2.0-beta.14", + "resolved": "https://registry.npmjs.org/angular2-token/-/angular2-token-0.2.0-beta.14.tgz", + "integrity": "sha512-ISN8BsARTmcSL9Mp/QGzBRa8tD4bR/hJdgcrCe8/Jen9aXA2SVi1Ymz1+MuDLN6tZqaR0OV02099jEvHpDDNPg==" + }, "ansi-html": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", @@ -3573,6 +3578,11 @@ "debug": "2.6.9" } }, + "font-awesome": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz", + "integrity": "sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM=" + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", diff --git a/package.json b/package.json index 0572f8e..34da28a 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,9 @@ "@angular/platform-browser-dynamic": "^5.2.10", "@angular/router": "^5.2.10", "angular2-materialize": "^15.1.10", + "angular2-token": "^0.2.0-beta.14", "core-js": "^2.5.5", + "font-awesome": "^4.7.0", "hammerjs": "^2.0.8", "jquery": "^2.2.4", "materialize-css": "^0.100.2", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7b0f672..a81a8f0 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,5 +1,9 @@ import { Component } from '@angular/core'; +import { Angular2TokenService } from "angular2-token"; + +import { environment } from "./environments/environment"; + @Component({ selector: 'app-root', templateUrl: './app.component.html', @@ -7,4 +11,19 @@ import { Component } from '@angular/core'; }) export class AppComponent { title = 'app'; + + constructor(private authToken: Angular2TokenService){ + this.authToken.init(environment.token_auth_config); + + this.authToken.signIn({email: "example@example.com", password: "12345678"}).subscribe( + res => { + console.log('auth response:', res); + console.log('auth response headers:', res.headers.toJSON()); //log the response header to show the auth token + console.log('auth response body:', res.json()); //log the response body to show the user + }, + err => { + console.error('auth error:', err); + } + ) + } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 832e1a0..4175609 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,23 +3,27 @@ import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; -import { AppComponent } from './app.component'; -import { StudentsComponent } from './students/students.component'; -import { routes } from './app.routes'; - import { MaterializeModule } from 'angular2-materialize'; +import { Angular2TokenService } from 'angular2-token'; -import { TeamMemberComponent } from './team-member/team-member.component'; -import { RegisterService } from './service/register/register.service'; +import { routes } from './app.routes'; +import { AppComponent } from './app.component'; +import { StudentsComponent } from './students/students.component'; import { StudentFormComponent } from './students/student-form/student-form.component'; +import { RegisterService } from './service/register/register.service'; import { StudentService } from './students/shared/student.service'; +import { TeamMemberComponent } from './team-member/team-member.component'; +import { LoginComponent } from './login/login.component'; + + @NgModule({ declarations: [ AppComponent, StudentsComponent, StudentFormComponent, - TeamMemberComponent + TeamMemberComponent, + LoginComponent ], imports: [ FormsModule, @@ -28,12 +32,14 @@ import { StudentService } from './students/shared/student.service'; BrowserModule, FormsModule, HttpModule, + MaterializeModule, routes ], providers: [ StudentService, - RegisterService + RegisterService, + Angular2TokenService ], - bootstrap: [AppComponent] + bootstrap: [ AppComponent ] }) export class AppModule { } diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 1578dac..e880f3d 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -4,8 +4,10 @@ import { Routes, RouterModule } from '@angular/router'; import { StudentsComponent } from './students/students.component'; import { StudentFormComponent } from './students/student-form/student-form.component'; +import { LoginComponent } from "./login/login.component"; const APP_ROUTES: Routes = [ + { path: 'login', component: LoginComponent}, { path: 'students', pathMatch: 'full', component: StudentsComponent }, { path: 'students/new', component: StudentFormComponent}, { path: 'students/:id', component: StudentFormComponent}, diff --git a/src/app/environments/environment.prod.ts b/src/app/environments/environment.prod.ts new file mode 100644 index 0000000..3612073 --- /dev/null +++ b/src/app/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/src/app/environments/environment.ts b/src/app/environments/environment.ts new file mode 100644 index 0000000..b3a2a4b --- /dev/null +++ b/src/app/environments/environment.ts @@ -0,0 +1,11 @@ +// The file contents for the current environment will overwrite these during build. +// The build system defaults to the dev environment which uses `environment.ts`, but if you do +// `ng build --env=prod` then `environment.prod.ts` will be used instead. +// The list of which env maps to which file can be found in `.angular-cli.json`. + +export const environment = { + production: false, + token_auth_config: { + apiBase: 'http://localhost:3000' + } +}; diff --git a/src/app/login-form/login-form.component.html b/src/app/login-form/login-form.component.html deleted file mode 100644 index 018df30..0000000 --- a/src/app/login-form/login-form.component.html +++ /dev/null @@ -1,3 +0,0 @@ -

- login-form works! -

diff --git a/src/app/login-form/login-form.component.ts b/src/app/login-form/login-form.component.ts deleted file mode 100644 index 8295aec..0000000 --- a/src/app/login-form/login-form.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-login-form', - templateUrl: './login-form.component.html', - styleUrls: ['./login-form.component.css'] -}) -export class LoginFormComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/src/app/login-form/login-form.component.css b/src/app/login/login.component.css similarity index 100% rename from src/app/login-form/login-form.component.css rename to src/app/login/login.component.css diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html new file mode 100644 index 0000000..cbdfa13 --- /dev/null +++ b/src/app/login/login.component.html @@ -0,0 +1,3 @@ +

+ login works! +

diff --git a/src/app/login-form/login-form.component.spec.ts b/src/app/login/login.component.spec.ts similarity index 55% rename from src/app/login-form/login-form.component.spec.ts rename to src/app/login/login.component.spec.ts index c5f08d4..d6d85a8 100644 --- a/src/app/login-form/login-form.component.spec.ts +++ b/src/app/login/login.component.spec.ts @@ -1,20 +1,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { LoginFormComponent } from './login-form.component'; +import { LoginComponent } from './login.component'; -describe('LoginFormComponent', () => { - let component: LoginFormComponent; - let fixture: ComponentFixture; +describe('LoginComponent', () => { + let component: LoginComponent; + let fixture: ComponentFixture; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoginFormComponent ] + declarations: [ LoginComponent ] }) .compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(LoginFormComponent); + fixture = TestBed.createComponent(LoginComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts new file mode 100644 index 0000000..5701fa2 --- /dev/null +++ b/src/app/login/login.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-login', + templateUrl: './login.component.html', + styleUrls: ['./login.component.css'] +}) +export class LoginComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} From e360c6184d25ceac60f5a1d79e8442d164d7316f Mon Sep 17 00:00:00 2001 From: Gabriel Alves Date: Wed, 18 Apr 2018 13:08:32 -0300 Subject: [PATCH 12/16] update table style --- src/app/app.component.html | 4 ---- .../student-form/student-form.component.html | 2 +- .../student-form/student-form.component.ts | 2 +- src/app/students/students.component.html | 18 +++++++++--------- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 28110d5..0680b43 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,5 +1 @@ -

- IncluCare -

-
diff --git a/src/app/students/student-form/student-form.component.html b/src/app/students/student-form/student-form.component.html index 2393e39..06c99f0 100644 --- a/src/app/students/student-form/student-form.component.html +++ b/src/app/students/student-form/student-form.component.html @@ -52,5 +52,5 @@

{{ name }}


- Voltar + Voltar diff --git a/src/app/students/student-form/student-form.component.ts b/src/app/students/student-form/student-form.component.ts index 8bdc40b..f729c89 100644 --- a/src/app/students/student-form/student-form.component.ts +++ b/src/app/students/student-form/student-form.component.ts @@ -49,7 +49,7 @@ export class StudentFormComponent implements OnInit { result = this.studentService.addStudent(this.student); } - result.subscribe(data => this.router.navigate(['/'])); + result.subscribe(data => this.router.navigate(['/students'])); } } diff --git a/src/app/students/students.component.html b/src/app/students/students.component.html index b9f84d5..868d523 100644 --- a/src/app/students/students.component.html +++ b/src/app/students/students.component.html @@ -1,39 +1,39 @@ -

+ -

{{ s.name }} {{ s.birth_date }} {{ s.age }}
+
- + + - + +
NomeData de nascimentoTurma
{{ s.name }}{{ s.birth_date }}{{ s.student_class }} From 2b38153efec4dc6570f2ce68eaf7ceb247195fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Arag=C3=A3o?= Date: Wed, 18 Apr 2018 15:06:48 -0300 Subject: [PATCH 13/16] Implementing TeamMemberAuth --- src/app/app.component.html | 10 ++-- src/app/app.component.ts | 15 +---- src/app/app.module.ts | 20 ++++++- src/app/app.routes.ts | 7 ++- src/app/auth-dialog/auth-dialog.component.css | 0 .../auth-dialog/auth-dialog.component.html | 43 ++++++++++++++ .../auth-dialog/auth-dialog.component.spec.ts | 25 ++++++++ src/app/auth-dialog/auth-dialog.component.ts | 46 +++++++++++++++ src/app/environments/environment.prod.ts | 3 - src/app/environments/environment.ts | 11 ---- src/app/guards/auth.guard.ts | 22 +++++++ src/app/login-form/login-form.component.css | 0 src/app/login-form/login-form.component.html | 39 ++++++++++++ .../login-form/login-form.component.spec.ts | 25 ++++++++ src/app/login-form/login-form.component.ts | 38 ++++++++++++ src/app/login/login.component.html | 11 +++- src/app/profile/profile.component.css | 2 + src/app/profile/profile.component.html | 41 +++++++++++++ src/app/profile/profile.component.spec.ts | 25 ++++++++ src/app/profile/profile.component.ts | 25 ++++++++ .../register-form/register-form.component.css | 0 .../register-form.component.html | 59 +++++++++++++++++++ .../register-form.component.spec.ts | 25 ++++++++ .../register-form/register-form.component.ts | 36 +++++++++++ src/app/services/auth.service.spec.ts | 15 +++++ src/app/services/auth.service.ts | 45 ++++++++++++++ src/app/toolbar/toolbar.component.css | 0 src/app/toolbar/toolbar.component.html | 25 ++++++++ src/app/toolbar/toolbar.component.spec.ts | 25 ++++++++ src/app/toolbar/toolbar.component.ts | 27 +++++++++ src/environments/environment.ts | 5 +- 31 files changed, 630 insertions(+), 40 deletions(-) create mode 100644 src/app/auth-dialog/auth-dialog.component.css create mode 100644 src/app/auth-dialog/auth-dialog.component.html create mode 100644 src/app/auth-dialog/auth-dialog.component.spec.ts create mode 100644 src/app/auth-dialog/auth-dialog.component.ts delete mode 100644 src/app/environments/environment.prod.ts delete mode 100644 src/app/environments/environment.ts create mode 100644 src/app/guards/auth.guard.ts create mode 100644 src/app/login-form/login-form.component.css create mode 100644 src/app/login-form/login-form.component.html create mode 100644 src/app/login-form/login-form.component.spec.ts create mode 100644 src/app/login-form/login-form.component.ts create mode 100644 src/app/profile/profile.component.css create mode 100644 src/app/profile/profile.component.html create mode 100644 src/app/profile/profile.component.spec.ts create mode 100644 src/app/profile/profile.component.ts create mode 100644 src/app/register-form/register-form.component.css create mode 100644 src/app/register-form/register-form.component.html create mode 100644 src/app/register-form/register-form.component.spec.ts create mode 100644 src/app/register-form/register-form.component.ts create mode 100644 src/app/services/auth.service.spec.ts create mode 100644 src/app/services/auth.service.ts create mode 100644 src/app/toolbar/toolbar.component.css create mode 100644 src/app/toolbar/toolbar.component.html create mode 100644 src/app/toolbar/toolbar.component.spec.ts create mode 100644 src/app/toolbar/toolbar.component.ts diff --git a/src/app/app.component.html b/src/app/app.component.html index 28110d5..c2194d5 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,5 +1,5 @@ -

- IncluCare -

-
- + + +
+ +
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a81a8f0..8e9e9c4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { Angular2TokenService } from "angular2-token"; -import { environment } from "./environments/environment"; +import {environment} from "../environments/environment"; @Component({ selector: 'app-root', @@ -10,20 +10,9 @@ import { environment } from "./environments/environment"; styleUrls: ['./app.component.css'] }) export class AppComponent { - title = 'app'; + title = 'app works!'; constructor(private authToken: Angular2TokenService){ this.authToken.init(environment.token_auth_config); - - this.authToken.signIn({email: "example@example.com", password: "12345678"}).subscribe( - res => { - console.log('auth response:', res); - console.log('auth response headers:', res.headers.toJSON()); //log the response header to show the auth token - console.log('auth response body:', res.json()); //log the response body to show the user - }, - err => { - console.error('auth error:', err); - } - ) } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 4175609..4f02bed 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,7 +1,7 @@ import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { HttpModule } from '@angular/http'; +import { NgModule } from '@angular/core'; +import { HttpModule } from '@angular/http' import { MaterializeModule } from 'angular2-materialize'; import { Angular2TokenService } from 'angular2-token'; @@ -12,9 +12,16 @@ import { StudentsComponent } from './students/students.component'; import { StudentFormComponent } from './students/student-form/student-form.component'; import { RegisterService } from './service/register/register.service'; import { StudentService } from './students/shared/student.service'; +import { AuthService } from "./services/auth.service"; import { TeamMemberComponent } from './team-member/team-member.component'; import { LoginComponent } from './login/login.component'; +import { ToolbarComponent } from './toolbar/toolbar.component'; +import { AuthDialogComponent } from './auth-dialog/auth-dialog.component'; +import { LoginFormComponent } from './login-form/login-form.component'; +import { RegisterFormComponent } from './register-form/register-form.component'; +import { ProfileComponent } from './profile/profile.component'; +import { AuthGuard } from "./guards/auth.guard"; @NgModule({ @@ -23,7 +30,12 @@ import { LoginComponent } from './login/login.component'; StudentsComponent, StudentFormComponent, TeamMemberComponent, - LoginComponent + LoginComponent, + ToolbarComponent, + AuthDialogComponent, + LoginFormComponent, + RegisterFormComponent, + ProfileComponent ], imports: [ FormsModule, @@ -36,6 +48,8 @@ import { LoginComponent } from './login/login.component'; routes ], providers: [ + AuthGuard, + AuthService, StudentService, RegisterService, Angular2TokenService diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index e880f3d..0b033f8 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -1,13 +1,18 @@ import { ModuleWithProviders } from '@angular/core'; -import { TeamMemberComponent } from './team-member/team-member.component'; import { Routes, RouterModule } from '@angular/router'; +import { AuthGuard } from "./guards/auth.guard"; + +import { TeamMemberComponent } from './team-member/team-member.component'; import { StudentsComponent } from './students/students.component'; import { StudentFormComponent } from './students/student-form/student-form.component'; import { LoginComponent } from "./login/login.component"; +import { ProfileComponent } from "./profile/profile.component"; const APP_ROUTES: Routes = [ + { path: '', component: LoginComponent, pathMatch: 'full'}, { path: 'login', component: LoginComponent}, + { path: 'profile', component: ProfileComponent, canActivate: [AuthGuard]}, { path: 'students', pathMatch: 'full', component: StudentsComponent }, { path: 'students/new', component: StudentFormComponent}, { path: 'students/:id', component: StudentFormComponent}, diff --git a/src/app/auth-dialog/auth-dialog.component.css b/src/app/auth-dialog/auth-dialog.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/auth-dialog/auth-dialog.component.html b/src/app/auth-dialog/auth-dialog.component.html new file mode 100644 index 0000000..6d35b27 --- /dev/null +++ b/src/app/auth-dialog/auth-dialog.component.html @@ -0,0 +1,43 @@ + +
diff --git a/src/app/auth-dialog/auth-dialog.component.spec.ts b/src/app/auth-dialog/auth-dialog.component.spec.ts new file mode 100644 index 0000000..8319a22 --- /dev/null +++ b/src/app/auth-dialog/auth-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AuthDialogComponent } from './auth-dialog.component'; + +describe('AuthDialogComponent', () => { + let component: AuthDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AuthDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AuthDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/auth-dialog/auth-dialog.component.ts b/src/app/auth-dialog/auth-dialog.component.ts new file mode 100644 index 0000000..ac33968 --- /dev/null +++ b/src/app/auth-dialog/auth-dialog.component.ts @@ -0,0 +1,46 @@ +import { Component, OnInit, Input, EventEmitter } from '@angular/core'; +import { MaterializeAction } from "angular2-materialize"; + +@Component({ + selector: 'app-auth-dialog', + templateUrl: './auth-dialog.component.html', + styleUrls: ['./auth-dialog.component.css'] +}) +export class AuthDialogComponent implements OnInit { + + @Input('auth-mode') authMode: 'login' | 'register' = 'login'; + modalActions = new EventEmitter(); + + constructor() {} + + onLoginFormResult(e){ + if(e.signedIn) + this.closeDialog(); + else{ + alert(e.err.json().errors[0]) + } + } + + onRegisterFormResult(e){ + if(e.signedUp) + this.closeDialog(); + else{ + alert(e.err.json().errors.full_messages[0]) + } + } + + openDialog(mode: 'login' | 'register' = 'login'){ + this.authMode = mode; + this.modalActions.emit({action:"modal", params:['open']}); + } + + closeDialog(){ + this.modalActions.emit({action:"modal", params:['close']}); + } + + ngOnInit() {} + + isLoginMode(){return this.authMode == 'login'} + isRegisterMode(){return this.authMode == 'register'} + +} diff --git a/src/app/environments/environment.prod.ts b/src/app/environments/environment.prod.ts deleted file mode 100644 index 3612073..0000000 --- a/src/app/environments/environment.prod.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const environment = { - production: true -}; diff --git a/src/app/environments/environment.ts b/src/app/environments/environment.ts deleted file mode 100644 index b3a2a4b..0000000 --- a/src/app/environments/environment.ts +++ /dev/null @@ -1,11 +0,0 @@ -// The file contents for the current environment will overwrite these during build. -// The build system defaults to the dev environment which uses `environment.ts`, but if you do -// `ng build --env=prod` then `environment.prod.ts` will be used instead. -// The list of which env maps to which file can be found in `.angular-cli.json`. - -export const environment = { - production: false, - token_auth_config: { - apiBase: 'http://localhost:3000' - } -}; diff --git a/src/app/guards/auth.guard.ts b/src/app/guards/auth.guard.ts new file mode 100644 index 0000000..6abc957 --- /dev/null +++ b/src/app/guards/auth.guard.ts @@ -0,0 +1,22 @@ +import { Injectable } from '@angular/core'; +import {CanActivate, Router} from "@angular/router"; +import {Angular2TokenService} from "angular2-token"; + +@Injectable() +export class AuthGuard implements CanActivate { + + constructor(private authTokenService:Angular2TokenService, + private router:Router){} + + canActivate() { + if(this.authTokenService.userSignedIn()){ + return true; + } + else + { + this.router.navigate(['/']); + return false; + } + } + +} diff --git a/src/app/login-form/login-form.component.css b/src/app/login-form/login-form.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/login-form/login-form.component.html b/src/app/login-form/login-form.component.html new file mode 100644 index 0000000..e28aa7d --- /dev/null +++ b/src/app/login-form/login-form.component.html @@ -0,0 +1,39 @@ +
+
+ +
+ + + +
+ + +
+ + + +
+ +
+ +
+ + +
+ +
diff --git a/src/app/login-form/login-form.component.spec.ts b/src/app/login-form/login-form.component.spec.ts new file mode 100644 index 0000000..c5f08d4 --- /dev/null +++ b/src/app/login-form/login-form.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoginFormComponent } from './login-form.component'; + +describe('LoginFormComponent', () => { + let component: LoginFormComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LoginFormComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LoginFormComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/login-form/login-form.component.ts b/src/app/login-form/login-form.component.ts new file mode 100644 index 0000000..8ebbe51 --- /dev/null +++ b/src/app/login-form/login-form.component.ts @@ -0,0 +1,38 @@ +import { Component, OnInit, Output, EventEmitter } from '@angular/core'; +import { AuthService } from "../services/auth.service"; + +@Component({ + selector: 'app-login-form', + templateUrl: './login-form.component.html', + styleUrls: ['./login-form.component.css'] +}) +export class LoginFormComponent implements OnInit { + + signInUser = { + email: '', + password: '' + }; + + @Output() onFormResult = new EventEmitter(); + + constructor(public authService:AuthService) { } + + ngOnInit() {} + + onSignInSubmit(){ + + this.authService.logInUser(this.signInUser).subscribe( + res => { + if(res.status == 200){ + this.onFormResult.emit({signedIn: true, res}); + } + }, + err => { + console.log('err:', err); + this.onFormResult.emit({signedIn: false, err}); + } + ); + + } + +} diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html index cbdfa13..e6721bc 100644 --- a/src/app/login/login.component.html +++ b/src/app/login/login.component.html @@ -1,3 +1,8 @@ -

- login works! -

+
+
+

Login Test Page

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi feugiat, dolor a aliquam ultrices, turpis nisl maximus justo, nec semper augue dolor vitae orci. Curabitur egestas posuere mauris. Quisque varius erat ac pharetra posuere. Nulla faucibus, ex in dictum porta, dui sapien vehicula nulla, nec venenatis enim purus quis justo. Sed luctus luctus aliquet. Etiam tristique feugiat risus in hendrerit. Mauris lobortis dui nec blandit fermentum. Pellentesque placerat, nunc pellentesque fringilla convallis, elit elit ultricies urna, in vehicula arcu metus efficitur metus. Integer efficitur ipsum sit amet risus tristique, congue molestie massa euismod. +

+
+
diff --git a/src/app/profile/profile.component.css b/src/app/profile/profile.component.css new file mode 100644 index 0000000..db76001 --- /dev/null +++ b/src/app/profile/profile.component.css @@ -0,0 +1,2 @@ +.clearfix + overflow: auto diff --git a/src/app/profile/profile.component.html b/src/app/profile/profile.component.html new file mode 100644 index 0000000..679bbc8 --- /dev/null +++ b/src/app/profile/profile.component.html @@ -0,0 +1,41 @@ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
    +
  • Email: {{authTokenService.currentUserData.email}}
  • +
  • Name: {{authTokenService.currentUserData.name}}
  • +
  • Username: @{{authTokenService.currentUserData.nickname}}
  • + +
+
+
+ +
+ +
+ + + +
+ +
+ +
+
diff --git a/src/app/profile/profile.component.spec.ts b/src/app/profile/profile.component.spec.ts new file mode 100644 index 0000000..692b234 --- /dev/null +++ b/src/app/profile/profile.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProfileComponent } from './profile.component'; + +describe('ProfileComponent', () => { + let component: ProfileComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ProfileComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProfileComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/profile/profile.component.ts b/src/app/profile/profile.component.ts new file mode 100644 index 0000000..59aa726 --- /dev/null +++ b/src/app/profile/profile.component.ts @@ -0,0 +1,25 @@ +import { Component, OnInit } from '@angular/core'; + +import {Router} from "@angular/router"; +import {AuthService} from "../services/auth.service"; +import {Angular2TokenService} from "angular2-token"; + +@Component({ + selector: 'app-profile', + templateUrl: './profile.component.html', + styleUrls: ['./profile.component.css'] +}) +export class ProfileComponent implements OnInit { + + constructor(public authTokenService:Angular2TokenService, + public authService:AuthService, + private router:Router) {} + + logOut(){ + this.authService.logOutUser().subscribe(() => this.router.navigate(['/'])); + } + + ngOnInit() { + } + + } diff --git a/src/app/register-form/register-form.component.css b/src/app/register-form/register-form.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/register-form/register-form.component.html b/src/app/register-form/register-form.component.html new file mode 100644 index 0000000..94e4e2b --- /dev/null +++ b/src/app/register-form/register-form.component.html @@ -0,0 +1,59 @@ +
+ + +
+ +
+ + +
+ + + +
+ + +
+ + + +
+ + +
+ + + Passwords must match + + + +
+ + + +
+ +
+ + +
diff --git a/src/app/register-form/register-form.component.spec.ts b/src/app/register-form/register-form.component.spec.ts new file mode 100644 index 0000000..caa8e72 --- /dev/null +++ b/src/app/register-form/register-form.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RegisterFormComponent } from './register-form.component'; + +describe('RegisterFormComponent', () => { + let component: RegisterFormComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RegisterFormComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RegisterFormComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/register-form/register-form.component.ts b/src/app/register-form/register-form.component.ts new file mode 100644 index 0000000..69b826b --- /dev/null +++ b/src/app/register-form/register-form.component.ts @@ -0,0 +1,36 @@ +import { Component, OnInit, Output, EventEmitter } from '@angular/core'; +import { AuthService } from "../services/auth.service"; + +@Component({ + selector: 'app-register-form', + templateUrl: './register-form.component.html', + styleUrls: ['./register-form.component.css'] +}) +export class RegisterFormComponent implements OnInit { + + signUpUser = { + email: '', + password: '', + passwordConfirmation: '' + }; + + @Output() onFormResult = new EventEmitter(); + + constructor(public authService:AuthService) { } + + ngOnInit() {} + + onSignUpSubmit(){ + this.authService.registerUser(this.signUpUser).subscribe( + (res) => { + if (res.status == 200){ + this.onFormResult.emit({signedUp: true, res}) + } + }, + (err) => { + console.log(err.json()) + this.onFormResult.emit({signedUp: false, err}) + } + ) + } +} diff --git a/src/app/services/auth.service.spec.ts b/src/app/services/auth.service.spec.ts new file mode 100644 index 0000000..bd98634 --- /dev/null +++ b/src/app/services/auth.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { AuthService } from './auth.service'; + +describe('AuthService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [AuthService] + }); + }); + + it('should be created', inject([AuthService], (service: AuthService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts new file mode 100644 index 0000000..d6ca253 --- /dev/null +++ b/src/app/services/auth.service.ts @@ -0,0 +1,45 @@ +import { Injectable } from '@angular/core'; +import { Angular2TokenService } from "angular2-token"; +import { Subject, Observable } from "rxjs"; +import { Response } from "@angular/http"; +import 'rxjs/add/operator/map'; + +@Injectable() +export class AuthService { + + userSignedIn$:Subject = new Subject(); + + constructor(public authService:Angular2TokenService) { + this.authService.validateToken().subscribe( + res => res.status == 200 ? this.userSignedIn$.next(res.json().success) : this.userSignedIn$.next(false) + ) + } + + logOutUser():Observable{ + + return this.authService.signOut().map( + res => { + this.userSignedIn$.next(false); + return res; + } + ); + } + + registerUser(signUpData: {email:string, password:string, passwordConfirmation:string}):Observable{ + return this.authService.registerAccount(signUpData).map( + res => { + this.userSignedIn$.next(true); + return res + } + ); + } + + logInUser(signInData: {email:string, password:string}):Observable{ + return this.authService.signIn(signInData).map( + res => { + this.userSignedIn$.next(true); + return res + } + ); + } +} diff --git a/src/app/toolbar/toolbar.component.css b/src/app/toolbar/toolbar.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/toolbar/toolbar.component.html b/src/app/toolbar/toolbar.component.html new file mode 100644 index 0000000..2d97afa --- /dev/null +++ b/src/app/toolbar/toolbar.component.html @@ -0,0 +1,25 @@ + + + + diff --git a/src/app/toolbar/toolbar.component.spec.ts b/src/app/toolbar/toolbar.component.spec.ts new file mode 100644 index 0000000..e01f9a8 --- /dev/null +++ b/src/app/toolbar/toolbar.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ToolbarComponent } from './toolbar.component'; + +describe('ToolbarComponent', () => { + let component: ToolbarComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ToolbarComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ToolbarComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/toolbar/toolbar.component.ts b/src/app/toolbar/toolbar.component.ts new file mode 100644 index 0000000..70f463c --- /dev/null +++ b/src/app/toolbar/toolbar.component.ts @@ -0,0 +1,27 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { AuthDialogComponent } from "../auth-dialog/auth-dialog.component"; +import { AuthService } from "../services/auth.service"; +import { Router } from "@angular/router"; + +@Component({ + selector: 'app-toolbar', + templateUrl: './toolbar.component.html', + styleUrls: ['./toolbar.component.css'] +}) +export class ToolbarComponent implements OnInit { + @ViewChild('authDialog') authDialog: AuthDialogComponent; + + constructor(public authService:AuthService, private router:Router) { } + + ngOnInit() { + } + + logOut(){ + this.authService.logOutUser().subscribe(() => this.router.navigate(['/'])); + } + + presentAuthDialog(mode?: 'login'| 'register'){ + this.authDialog.openDialog(mode); + } + +} diff --git a/src/environments/environment.ts b/src/environments/environment.ts index b7f639a..b3a2a4b 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,5 +4,8 @@ // The list of which env maps to which file can be found in `.angular-cli.json`. export const environment = { - production: false + production: false, + token_auth_config: { + apiBase: 'http://localhost:3000' + } }; From 9fb67274c7958a4e3a0acbc1742c4c7d869f7904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Arag=C3=A3o?= Date: Wed, 18 Apr 2018 20:21:34 -0300 Subject: [PATCH 14/16] Fixing production environment --- src/app/app.component.ts | 4 +- src/app/app.routes.ts | 3 +- .../auth-dialog/auth-dialog.component.html | 19 ++------- src/app/guards/auth.guard.ts | 10 ++--- src/app/login-form/login-form.component.html | 28 ++----------- src/app/login/login.component.html | 4 +- src/app/profile/profile.component.html | 24 ++--------- src/app/profile/profile.component.ts | 21 +++++----- .../register-form.component.html | 41 +++---------------- src/app/service/register/register.service.ts | 5 +-- src/app/toolbar/toolbar.component.html | 9 +--- src/app/toolbar/toolbar.component.ts | 3 +- src/environments/environment.prod.ts | 5 ++- 13 files changed, 43 insertions(+), 133 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 8e9e9c4..8ef53b2 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { Angular2TokenService } from "angular2-token"; -import {environment} from "../environments/environment"; +import { environment } from "../environments/environment"; @Component({ selector: 'app-root', @@ -10,8 +10,6 @@ import {environment} from "../environments/environment"; styleUrls: ['./app.component.css'] }) export class AppComponent { - title = 'app works!'; - constructor(private authToken: Angular2TokenService){ this.authToken.init(environment.token_auth_config); } diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 0b033f8..8836080 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -16,8 +16,7 @@ const APP_ROUTES: Routes = [ { path: 'students', pathMatch: 'full', component: StudentsComponent }, { path: 'students/new', component: StudentFormComponent}, { path: 'students/:id', component: StudentFormComponent}, - { path: 'students/:id/edit', component: StudentFormComponent}, - { path: 'teamMember', component: TeamMemberComponent } + { path: 'students/:id/edit', component: StudentFormComponent} ]; export const routes: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); diff --git a/src/app/auth-dialog/auth-dialog.component.html b/src/app/auth-dialog/auth-dialog.component.html index 6d35b27..0f48eae 100644 --- a/src/app/auth-dialog/auth-dialog.component.html +++ b/src/app/auth-dialog/auth-dialog.component.html @@ -1,13 +1,8 @@ -