mirror of
https://github.com/fabioformosa/quartz-manager.git
synced 2025-12-25 11:53:14 +09:00
upgraded frontend to angular ver 7
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"project": {
|
||||
"name": "angular-spring-starter"
|
||||
},
|
||||
"apps": [
|
||||
{
|
||||
"root": "src",
|
||||
"outDir": "../server/src/main/resources/static",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"project": "src/tsconfig.spec.json"
|
||||
},
|
||||
{
|
||||
"project": "e2e/tsconfig.e2e.json"
|
||||
}
|
||||
],
|
||||
"test": {
|
||||
"karma": {
|
||||
"config": "./karma.conf.js"
|
||||
}
|
||||
},
|
||||
"defaults": {
|
||||
"styleExt": "css",
|
||||
"component": {}
|
||||
}
|
||||
}
|
||||
128
quartz-manager-frontend/angular.json
Normal file
128
quartz-manager-frontend/angular.json
Normal file
@@ -0,0 +1,128 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"angular-spring-starter": {
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"projectType": "application",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"outputPath": "../server/src/main/resources/static",
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
"tsConfig": "src/tsconfig.app.json",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"assets": [
|
||||
"src/assets",
|
||||
"src/favicon.ico"
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.css"
|
||||
],
|
||||
"scripts": []
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
"extractCss": true,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true,
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "angular-spring-starter:build"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "angular-spring-starter:build:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "angular-spring-starter:build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "src/test.ts",
|
||||
"karmaConfig": "./karma.conf.js",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.spec.json",
|
||||
"scripts": [],
|
||||
"styles": [
|
||||
"src/styles.css"
|
||||
],
|
||||
"assets": [
|
||||
"src/assets",
|
||||
"src/favicon.ico"
|
||||
]
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"src/tsconfig.app.json",
|
||||
"src/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": []
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"angular-spring-starter-e2e": {
|
||||
"root": "e2e",
|
||||
"sourceRoot": "e2e",
|
||||
"projectType": "application",
|
||||
"architect": {
|
||||
"e2e": {
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "./protractor.conf.js",
|
||||
"devServerTarget": "angular-spring-starter:serve"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"e2e/tsconfig.e2e.json"
|
||||
],
|
||||
"exclude": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "angular-spring-starter",
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
"prefix": "app",
|
||||
"styleext": "css"
|
||||
},
|
||||
"@schematics/angular:directive": {
|
||||
"prefix": "app"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,33 +4,31 @@
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular/cli'],
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular/cli/plugins/karma')
|
||||
require('@angular-devkit/build-angular/plugins/karma')
|
||||
],
|
||||
client:{
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
files: [
|
||||
{ pattern: './src/test.ts', watched: false }
|
||||
|
||||
],
|
||||
preprocessors: {
|
||||
'./src/test.ts': ['@angular/cli']
|
||||
|
||||
},
|
||||
mime: {
|
||||
'text/x-typescript': ['ts','tsx']
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
reports: [ 'html', 'lcovonly' ],
|
||||
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
|
||||
fixWebpackSourcePaths: true
|
||||
},
|
||||
angularCli: {
|
||||
environment: 'dev'
|
||||
},
|
||||
|
||||
reporters: config.angularCli && config.angularCli.codeCoverage
|
||||
? ['progress', 'coverage-istanbul']
|
||||
: ['progress', 'kjhtml'],
|
||||
|
||||
@@ -12,34 +12,37 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "5.2.8",
|
||||
"@angular/cdk": "5.2.4",
|
||||
"@angular/common": "5.2.8",
|
||||
"@angular/compiler": "5.2.8",
|
||||
"@angular/core": "5.2.8",
|
||||
"@angular/flex-layout": "5.0.0-beta.13",
|
||||
"@angular/forms": "5.2.8",
|
||||
"@angular/http": "5.2.8",
|
||||
"@angular/material": "5.2.4",
|
||||
"@angular/platform-browser": "5.2.8",
|
||||
"@angular/platform-browser-dynamic": "5.2.8",
|
||||
"@angular/platform-server": "5.2.8",
|
||||
"@angular/router": "5.2.8",
|
||||
"@angular/animations": "7.2.13",
|
||||
"@angular/cdk": "7.3.7",
|
||||
"@angular/common": "7.2.13",
|
||||
"@angular/compiler": "7.2.13",
|
||||
"@angular/core": "7.2.13",
|
||||
"@angular/flex-layout": "7.0.0-beta.24",
|
||||
"@angular/forms": "7.2.13",
|
||||
"@angular/http": "7.2.13",
|
||||
"@angular/material": "7.3.7",
|
||||
"@angular/platform-browser": "7.2.13",
|
||||
"@angular/platform-browser-dynamic": "7.2.13",
|
||||
"@angular/platform-server": "7.2.13",
|
||||
"@angular/router": "7.2.13",
|
||||
"@fortawesome/fontawesome": "^1.1.4",
|
||||
"@fortawesome/fontawesome-free-regular": "^5.0.8",
|
||||
"@fortawesome/fontawesome-free-solid": "^5.0.8",
|
||||
"@stomp/ng2-stompjs": "^0.6.3",
|
||||
"core-js": "2.5.1",
|
||||
"hammerjs": "2.0.8",
|
||||
"rxjs": "5.5.2",
|
||||
"net": "^1.0.2",
|
||||
"rxjs": "6.4.0",
|
||||
"stompjs": "^2.3.3",
|
||||
"tslib": "^1.9.0",
|
||||
"zone.js": "0.8.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.13.0",
|
||||
"@angular-devkit/core": "^0.2.0",
|
||||
"@angular/cli": "1.5.3",
|
||||
"@angular/compiler-cli": "5.2.8",
|
||||
"@angular/language-service": "5.2.8",
|
||||
"@angular/cli": "7.3.7",
|
||||
"@angular/compiler-cli": "7.2.13",
|
||||
"@angular/language-service": "7.2.13",
|
||||
"@types/hammerjs": "2.0.34",
|
||||
"@types/jasmine": "2.5.54",
|
||||
"@types/jasminewd2": "2.0.3",
|
||||
@@ -56,6 +59,6 @@
|
||||
"protractor": "5.1.2",
|
||||
"ts-node": "3.0.6",
|
||||
"tslint": "5.7.0",
|
||||
"typescript": "2.4.2"
|
||||
"typescript": "3.2.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
<p [class]="notification.msgType" *ngIf="notification">{{notification.msgBody}}</p>
|
||||
<mat-card-content>
|
||||
<form *ngIf="!submitted" [formGroup]="form" (ngSubmit)="onSubmit()" #changePasswordForm="ngForm">
|
||||
<mat-input-container>
|
||||
<mat-form-field>
|
||||
<input matInput formControlName="oldPassword" required type="password" placeholder="old password">
|
||||
</mat-input-container>
|
||||
<mat-input-container>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput formControlName="newPassword" required type="password" placeholder="new password">
|
||||
</mat-input-container>
|
||||
</mat-form-field>
|
||||
<button type="submit" [disabled]="!changePasswordForm.form.valid" mat-raised-button color="primary">Change Password</button>
|
||||
</form>
|
||||
<mat-spinner *ngIf="submitted" mode="indeterminate"></mat-spinner>
|
||||
|
||||
@@ -11,7 +11,7 @@ mat-card {
|
||||
-webkit-animation: fadein 1s; /* Safari and Chrome */
|
||||
}
|
||||
|
||||
mat-input-container {
|
||||
mat-form-field {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@ import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { AuthService } from 'app/service';
|
||||
import { Router } from '@angular/router';
|
||||
import { DisplayMessage } from '../shared/models/display-message';
|
||||
|
||||
import { delay, mergeMap } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'app-change-password',
|
||||
templateUrl: './change-password.component.html',
|
||||
@@ -50,9 +51,7 @@ export class ChangePasswordComponent implements OnInit {
|
||||
this.submitted = true;
|
||||
|
||||
this.authService.changePassowrd(this.form.value)
|
||||
// show me the animation
|
||||
.delay(1000)
|
||||
.mergeMap(() => this.authService.logout())
|
||||
.pipe(delay(1000), mergeMap(() => this.authService.logout()))
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['/login', { msgType: 'success', msgBody: 'Success! Please sign in with your new password.'}]);
|
||||
}, error => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
||||
|
||||
import { LogsWebsocketService, ApiService } from '../../service';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'logs-panel',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
|
||||
import { ProgressWebsocketService } from '../../service';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
// import {Message} from '@stomp/stompjs';
|
||||
|
||||
// import { Subscription } from 'rxjs/Subscription';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
||||
import { UserService } from '../service';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
export class AdminGuard implements CanActivate {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router, CanActivate } from '@angular/router';
|
||||
import { UserService } from '../service';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
export class GuestGuard implements CanActivate {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Router, CanActivate } from '@angular/router';
|
||||
import { UserService } from '../service';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
export class LoginGuard implements CanActivate {
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
<p [class]="notification.msgType" *ngIf="notification">{{notification.msgBody}}</p>
|
||||
|
||||
<form *ngIf="!submitted" [formGroup]="form" (ngSubmit)="onSubmit()" #loginForm="ngForm">
|
||||
<mat-input-container>
|
||||
<mat-form-field>
|
||||
<input matInput formControlName="username" required placeholder="user">
|
||||
</mat-input-container>
|
||||
<mat-input-container>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput formControlName="password" required type="password" placeholder="password">
|
||||
</mat-input-container>
|
||||
</mat-form-field>
|
||||
<button type="submit" [disabled]="!loginForm.form.valid" mat-raised-button color="primary">Login</button>
|
||||
</form>
|
||||
<!-- <br>
|
||||
|
||||
@@ -12,7 +12,7 @@ mat-card {
|
||||
|
||||
}
|
||||
|
||||
mat-input-container {
|
||||
mat-form-field {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,16 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { DisplayMessage } from '../shared/models/display-message';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { takeUntil, delay } from 'rxjs/operators'
|
||||
|
||||
import {
|
||||
UserService,
|
||||
AuthService
|
||||
} from '../service';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Subject } from 'rxjs/SUbject';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@@ -50,7 +52,7 @@ export class LoginComponent implements OnInit, OnDestroy {
|
||||
|
||||
ngOnInit() {
|
||||
this.route.params
|
||||
.takeUntil(this.ngUnsubscribe)
|
||||
.pipe(takeUntil(this.ngUnsubscribe))
|
||||
.subscribe((params: DisplayMessage) => {
|
||||
this.notification = params;
|
||||
});
|
||||
@@ -92,7 +94,7 @@ export class LoginComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.authService.login(this.form.value)
|
||||
// show me the animation
|
||||
.delay(1000)
|
||||
.pipe(delay(1000))
|
||||
.subscribe(data => {
|
||||
this.userService.getMyInfo().subscribe();
|
||||
this.router.navigate([this.returnUrl]);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { HttpClient, HttpHeaders, HttpResponse, HttpRequest, HttpEventType, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/Rx';
|
||||
import 'rxjs/add/observable/throw';
|
||||
import { Observable } from 'rxjs';
|
||||
import { catchError, map, filter } from 'rxjs/operators'
|
||||
import { serialize } from 'app/shared/utilities/serialize';
|
||||
|
||||
export enum RequestMethod {
|
||||
@@ -36,7 +35,7 @@ export class ApiService {
|
||||
}
|
||||
|
||||
return this.http.get(path, options)
|
||||
.catch(this.checkError.bind(this));
|
||||
.pipe(catchError(this.checkError.bind(this)));
|
||||
}
|
||||
|
||||
post(path: string, body: any, customHeaders?: HttpHeaders): Observable<any> {
|
||||
@@ -58,9 +57,11 @@ export class ApiService {
|
||||
});
|
||||
|
||||
return this.http.request(req)
|
||||
.filter(response => response instanceof HttpResponse)
|
||||
.map((response: HttpResponse<any>) => response.body)
|
||||
.catch(error => this.checkError(error));
|
||||
.pipe(
|
||||
filter(response => response instanceof HttpResponse),
|
||||
map((response: HttpResponse<any>) => response.body),
|
||||
catchError(error => this.checkError(error))
|
||||
)
|
||||
}
|
||||
|
||||
// Display error if logged in, otherwise redirect to IDP
|
||||
|
||||
@@ -3,7 +3,8 @@ import { HttpHeaders } from '@angular/common/http';
|
||||
import { ApiService } from './api.service';
|
||||
import { UserService } from './user.service';
|
||||
import { ConfigService } from './config.service';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class AuthService {
|
||||
@@ -20,10 +21,10 @@ export class AuthService {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
});
|
||||
const body = `username=${user.username}&password=${user.password}`;
|
||||
return this.apiService.post(this.config.login_url, body, loginHeaders).map(() => {
|
||||
return this.apiService.post(this.config.login_url, body, loginHeaders).pipe(map(() => {
|
||||
console.log("Login success");
|
||||
this.userService.getMyInfo().subscribe();
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
signup(user){
|
||||
@@ -31,16 +32,16 @@ export class AuthService {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
});
|
||||
return this.apiService.post(this.config.signup_url, JSON.stringify(user), signupHeaders).map(() =>{
|
||||
return this.apiService.post(this.config.signup_url, JSON.stringify(user), signupHeaders).pipe(map(() =>{
|
||||
console.log("Sign up success");
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
logout() {
|
||||
return this.apiService.post(this.config.logout_url, {})
|
||||
.map(() => {
|
||||
.pipe(map(() => {
|
||||
this.userService.currentUser = null;
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
changePassowrd(passwordChanger) {
|
||||
|
||||
@@ -3,6 +3,8 @@ import { Headers } from '@angular/http';
|
||||
import { ApiService } from './api.service';
|
||||
import { ConfigService } from './config.service';
|
||||
|
||||
import { map } from 'rxjs/operators'
|
||||
|
||||
@Injectable()
|
||||
export class UserService {
|
||||
|
||||
@@ -41,7 +43,7 @@ export class UserService {
|
||||
}
|
||||
|
||||
getMyInfo() {
|
||||
return this.apiService.get(this.config.whoami_url).map(user => this.currentUser = user);
|
||||
return this.apiService.get(this.config.whoami_url).pipe(map(user => this.currentUser = user));
|
||||
}
|
||||
|
||||
getAll() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable, OnInit } from '@angular/core';
|
||||
import { Headers } from '@angular/http';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { ApiService } from './api.service';
|
||||
|
||||
|
||||
@@ -15,22 +15,22 @@
|
||||
<p [class]="notification.msgType" *ngIf="notification">{{notification.msgBody}}</p>
|
||||
|
||||
<form *ngIf="!submitted" [formGroup]="form" (ngSubmit)="onSubmit()" #signupForm="ngForm">
|
||||
<mat-input-container>
|
||||
<mat-form-field>
|
||||
<label>Username: </label>
|
||||
<input matInput formControlName="username" required>
|
||||
</mat-input-container>
|
||||
<mat-input-container>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<label>Password: </label>
|
||||
<input matInput formControlName="password" required type="password">
|
||||
</mat-input-container>
|
||||
<mat-input-container>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<label>First Name: </label>
|
||||
<input matInput formControlName="firstname">
|
||||
</mat-input-container>
|
||||
<mat-input-container>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<label>Last Name: </label>
|
||||
<input matInput formControlName="lastname">
|
||||
</mat-input-container>
|
||||
</mat-form-field>
|
||||
<button type="submit" [disabled]="!signupForm.form.valid" mat-raised-button color="primary">Sign up</button>
|
||||
</form>
|
||||
<br>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
}
|
||||
|
||||
mat-input-container {
|
||||
mat-form-field {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,15 @@ import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { DisplayMessage } from '../shared/models/display-message';
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { takeUntil, delay } from 'rxjs/operators'
|
||||
import {
|
||||
UserService,
|
||||
AuthService
|
||||
} from '../service';
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Subject } from 'rxjs/SUbject';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-signup',
|
||||
@@ -49,8 +50,9 @@ export class SignupComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.params
|
||||
.takeUntil(this.ngUnsubscribe)
|
||||
this.route.params.pipe(
|
||||
takeUntil(this.ngUnsubscribe)
|
||||
)
|
||||
.subscribe((params: DisplayMessage) => {
|
||||
this.notification = params;
|
||||
});
|
||||
@@ -82,7 +84,7 @@ export class SignupComponent implements OnInit, OnDestroy {
|
||||
|
||||
this.authService.signup(this.form.value)
|
||||
// show me the animation
|
||||
.delay(1000)
|
||||
.pipe(delay(1000))
|
||||
.subscribe(data => {
|
||||
console.log(data);
|
||||
this.authService.login(this.form.value).subscribe(data =>{
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
|
||||
/** Evergreen browsers require these. **/
|
||||
import 'core-js/es6/reflect';
|
||||
import 'core-js/es7/reflect';
|
||||
|
||||
|
||||
|
||||
@@ -56,6 +55,8 @@ import 'core-js/es7/reflect';
|
||||
*/
|
||||
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
||||
|
||||
(window as any).global = window
|
||||
|
||||
|
||||
|
||||
/***************************************************************************************************
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"test.ts"
|
||||
"test.ts",
|
||||
"polyfills.ts"
|
||||
],
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"importHelpers": true,
|
||||
"outDir": "./dist/out-tsc",
|
||||
"baseUrl": "src",
|
||||
"sourceMap": true,
|
||||
@@ -15,6 +16,7 @@
|
||||
"lib": [
|
||||
"es2016",
|
||||
"dom"
|
||||
]
|
||||
],
|
||||
"module": "es2015"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
"curly": true,
|
||||
"eofline": true,
|
||||
"forin": true,
|
||||
"import-blacklist": [true, "rxjs"],
|
||||
"import-blacklist": [true],
|
||||
"import-spacing": true,
|
||||
"indent": [
|
||||
true,
|
||||
|
||||
Reference in New Issue
Block a user