From b7b632ae84d2676e683d7918fb394b2a8279d717 Mon Sep 17 00:00:00 2001 From: ItsasoAguirre Date: Sat, 1 Feb 2020 12:59:38 +0100 Subject: [PATCH] Seccion 13 terminada --- .vscode/launch.json | 15 + package-lock.json | 19 ++ package.json | 99 +++--- src/app/app.module.ts | 3 +- src/app/config/config.ts | 1 + src/app/login/login.component.html | 13 +- src/app/login/login.component.ts | 50 +++- src/app/login/register.component.html | 17 +- src/app/login/register.component.ts | 61 +++- src/app/models/usuario.model.ts | 12 + src/app/pages/pages-routing.module.ts | 3 + src/app/pages/pages.component.ts | 15 +- src/app/services/guards/login-guard.guard.ts | 21 ++ src/app/services/service.index.ts | 5 +- src/app/services/service.module.ts | 11 +- src/app/services/usuario/usuario.service.ts | 97 ++++++ src/app/shared/header/header.component.html | 2 +- src/app/shared/header/header.component.ts | 3 +- src/app/shared/sidebar/sidebar.component.html | 2 +- src/app/shared/sidebar/sidebar.component.ts | 4 +- src/assets/js/custom.js | 282 +++++++++--------- src/index.html | 5 +- src/styles.css | 4 + 23 files changed, 513 insertions(+), 231 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 src/app/config/config.ts create mode 100644 src/app/models/usuario.model.ts create mode 100644 src/app/services/guards/login-guard.guard.ts create mode 100644 src/app/services/usuario/usuario.service.ts diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..835ac29 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense para saber los atributos posibles. + // Mantenga el puntero para ver las descripciones de los existentes atributos. + // Para más información, visite: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:4200", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ebafeb9..1e64141 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4614,6 +4614,11 @@ "is-symbol": "^1.0.2" } }, + "es6-object-assign": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz", + "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=" + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -9015,6 +9020,11 @@ "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", "dev": true }, + "promise-polyfill": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-6.1.0.tgz", + "integrity": "sha1-36lpQ+qcEh/KTem1hoyznTRy4Fc=" + }, "promise-retry": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz", @@ -10890,6 +10900,15 @@ "has-flag": "^3.0.0" } }, + "sweetalert": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/sweetalert/-/sweetalert-2.1.2.tgz", + "integrity": "sha512-iWx7X4anRBNDa/a+AdTmvAzQtkN1+s4j/JJRWlHpYE8Qimkohs8/XnFcWeYHH2lMA8LRCa5tj2d244If3S/hzA==", + "requires": { + "es6-object-assign": "^1.1.0", + "promise-polyfill": "^6.0.2" + } + }, "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", diff --git a/package.json b/package.json index 7b1b2cb..e7c89a3 100644 --- a/package.json +++ b/package.json @@ -1,50 +1,51 @@ { - "name": "adminpro", - "version": "0.0.0", - "scripts": { - "ng": "ng", - "start": "ng serve", - "build": "ng build", - "test": "ng test", - "lint": "ng lint", - "e2e": "ng e2e" - }, - "private": true, - "dependencies": { - "@angular/animations": "~8.2.14", - "@angular/common": "~8.2.14", - "@angular/compiler": "~8.2.14", - "@angular/core": "~8.2.14", - "@angular/forms": "~8.2.14", - "@angular/platform-browser": "~8.2.14", - "@angular/platform-browser-dynamic": "~8.2.14", - "@angular/router": "~8.2.14", - "chart.js": "^2.9.3", - "jshint": "^2.11.0", - "ng2-charts": "^2.3.0", - "rxjs": "~6.4.0", - "tslib": "^1.10.0", - "zone.js": "~0.9.1" - }, - "devDependencies": { - "@angular-devkit/build-angular": "~0.803.22", - "@angular/cli": "~8.3.22", - "@angular/compiler-cli": "~8.2.14", - "@angular/language-service": "~8.2.14", - "@types/node": "~8.9.4", - "@types/jasmine": "~3.3.8", - "@types/jasminewd2": "~2.0.3", - "codelyzer": "^5.0.0", - "jasmine-core": "~3.4.0", - "jasmine-spec-reporter": "~4.2.1", - "karma": "~4.1.0", - "karma-chrome-launcher": "~2.2.0", - "karma-coverage-istanbul-reporter": "~2.0.1", - "karma-jasmine": "~2.0.1", - "karma-jasmine-html-reporter": "^1.4.0", - "protractor": "~5.4.0", - "ts-node": "~7.0.0", - "tslint": "~5.15.0", - "typescript": "~3.5.3" - } -} + "name": "adminpro", + "version": "0.0.0", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" + }, + "private": true, + "dependencies": { + "@angular/animations": "~8.2.14", + "@angular/common": "~8.2.14", + "@angular/compiler": "~8.2.14", + "@angular/core": "~8.2.14", + "@angular/forms": "~8.2.14", + "@angular/platform-browser": "~8.2.14", + "@angular/platform-browser-dynamic": "~8.2.14", + "@angular/router": "~8.2.14", + "chart.js": "^2.9.3", + "jshint": "^2.11.0", + "ng2-charts": "^2.3.0", + "rxjs": "~6.4.0", + "sweetalert": "^2.1.2", + "tslib": "^1.10.0", + "zone.js": "~0.9.1" + }, + "devDependencies": { + "@angular-devkit/build-angular": "~0.803.22", + "@angular/cli": "~8.3.22", + "@angular/compiler-cli": "~8.2.14", + "@angular/language-service": "~8.2.14", + "@types/jasmine": "~3.3.8", + "@types/jasminewd2": "~2.0.3", + "@types/node": "~8.9.4", + "codelyzer": "^5.0.0", + "jasmine-core": "~3.4.0", + "jasmine-spec-reporter": "~4.2.1", + "karma": "~4.1.0", + "karma-chrome-launcher": "~2.2.0", + "karma-coverage-istanbul-reporter": "~2.0.1", + "karma-jasmine": "~2.0.1", + "karma-jasmine-html-reporter": "^1.4.0", + "protractor": "~5.4.0", + "ts-node": "~7.0.0", + "tslint": "~5.15.0", + "typescript": "~3.5.3" + } +} \ No newline at end of file diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d76f966..5586dd5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -7,7 +7,7 @@ import { PagesModule } from './pages/pages.module'; import { AppRoutingModule } from './app-routing.module'; // Temporal -import { FormsModule } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; // Servicios import { ServiceModule } from './services/service.module'; @@ -30,6 +30,7 @@ import { RegisterComponent } from './login/register.component'; PagesModule, AppRoutingModule, FormsModule, + ReactiveFormsModule, ServiceModule ], providers: [], diff --git a/src/app/config/config.ts b/src/app/config/config.ts new file mode 100644 index 0000000..41f07c3 --- /dev/null +++ b/src/app/config/config.ts @@ -0,0 +1 @@ +export const URL_SERVICES = 'http://localhost:3000'; diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html index f08a950..4bff9c5 100644 --- a/src/app/login/login.component.html +++ b/src/app/login/login.component.html @@ -4,22 +4,22 @@