Skip to content

Commit 291e4a8

Browse files
committed
Optimized alerts, contactform sending, phone signin update and updated dependencies
1 parent 6d079e5 commit 291e4a8

20 files changed

+113
-146
lines changed

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app
8484
* MD Icon
8585
* MD Progress spinner
8686
* MD Progress bar
87-
* MD Dialog
8887
* MD Tooltip
8988
* MD Snackbar
9089

@@ -94,16 +93,11 @@ Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app
9493
## To Finish List (known issues)
9594
### Auth
9695
* Cellphone authentication (optimizing)
97-
* Optimizing alerts
9896
* Google, Facebook, Twitter & Github signin/signup
9997
* Error messages: Email already exists, login failed, registration failed
10098

101-
### Sending
102-
* Contact form send
103-
10499
### Profile
105-
* Dialog component
106-
* File uploading
100+
* Profile image uploading
107101
* Change settings
108102
* Messaging layout and functionality
109103

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@
33
"version": "0.0.1",
44
"author": "Jeroen Ouwehand",
55
"description": "Full stack starter app with Angular 4, Material Design and Firebase.",
6-
"keywords": ["angular", "firebase", "material", "nosql", "oauth", "starter-template"],
6+
"keywords": [
7+
"angular",
8+
"firebase",
9+
"material",
10+
"nosql",
11+
"oauth",
12+
"starter-template",
13+
"ngx"
14+
],
715
"homepage": "https://github.com/jeroenouw/Angular4MaterialDesign",
816
"license": "MIT",
917
"angular-cli": {},
@@ -20,44 +28,44 @@
2028
"i18n": "ng-xi18n"
2129
},
2230
"dependencies": {
23-
"@angular/animations": "^4.3.1",
31+
"@angular/animations": "^4.3.2",
2432
"@angular/cdk": "^2.0.0-beta.8",
25-
"@angular/common": "^4.3.1",
26-
"@angular/compiler": "^4.3.1",
27-
"@angular/core": "^4.3.1",
28-
"@angular/forms": "^4.3.1",
29-
"@angular/http": "^4.3.1",
33+
"@angular/common": "^4.3.2",
34+
"@angular/compiler": "^4.3.2",
35+
"@angular/core": "^4.3.2",
36+
"@angular/forms": "^4.3.2",
37+
"@angular/http": "^4.3.2",
3038
"@angular/material": "^2.0.0-beta.8",
31-
"@angular/platform-browser": "^4.3.1",
32-
"@angular/platform-browser-dynamic": "^4.3.1",
33-
"@angular/platform-server": "^4.3.1",
34-
"@angular/router": "^4.3.1",
39+
"@angular/platform-browser": "^4.3.2",
40+
"@angular/platform-browser-dynamic": "^4.3.2",
41+
"@angular/platform-server": "^4.3.2",
42+
"@angular/router": "^4.3.2",
3543
"core-js": "^2.4.1",
36-
"firebase": "^4.1.3",
44+
"firebase": "^4.2.0",
3745
"hammerjs": "^2.0.8",
38-
"primeng": "^4.0.3",
46+
"primeng": "^4.1.2",
3947
"rxjs": "^5.4.2",
4048
"ts-helpers": "*",
41-
"zone.js": "^0.8.12"
49+
"zone.js": "^0.8.16"
4250
},
4351
"devDependencies": {
44-
"@angular/cli": "^1.2.1",
45-
"@angular/compiler-cli": "^4.3.1",
46-
"@types/jasmine": "^2.5.52",
47-
"@types/node": "^7.0.31",
48-
"codelyzer": "^3.0.1",
49-
"jasmine-core": "^2.6.3",
50-
"jasmine-spec-reporter": "^4.1.0",
52+
"@angular/cli": "^1.2.6",
53+
"@angular/compiler-cli": "^4.3.2",
54+
"@types/jasmine": "^2.5.53",
55+
"@types/node": "^8.0.17",
56+
"codelyzer": "^3.1.2",
57+
"jasmine-core": "^2.6.4",
58+
"jasmine-spec-reporter": "^4.1.1",
5159
"karma": "^1.7.0",
52-
"karma-chrome-launcher": "^2.1.1",
60+
"karma-chrome-launcher": "^2.2.0",
5361
"karma-cli": "^1.0.1",
5462
"karma-coverage-istanbul-reporter": "^1.3.0",
5563
"karma-jasmine": "^1.1.0",
5664
"karma-jasmine-html-reporter": "^0.2.2",
5765
"protractor": "^5.1.2",
58-
"ts-node": "^3.0.6",
66+
"ts-node": "^3.3.0",
5967
"tslint": "^5.5.0",
6068
"typescript": "^2.4.2",
61-
"webpack": "^3.3.0"
69+
"webpack": "^3.4.1"
6270
}
6371
}

src/app/components/auth/phone-signin/phone-signin.component.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<md-card>
22
<div [hidden]="currentUser">
3-
<h3>Phone Number login</h3>
3+
<h3>Phone Number login</h3><h5>Currently only saving phonenumber to database, login in progress. (temporary place)</h5>
44

55
<br/>+
66
<md-input-container>
@@ -18,12 +18,14 @@ <h3>Phone Number login</h3>
1818

1919
<div id="recaptcha-container"></div><br/>
2020

21-
<button md-raised-button (click)="sendLoginCode()">SMS Text Login Code</button>
21+
<button md-raised-button (click)="sendLoginCode()">SMS me the text login code</button>
2222

2323
<div *ngIf="windowRef.confirmationResult">
2424
<hr>
25-
<label for="code">Enter your Verification Code Here</label><br>
26-
<input type="text" name="code" [(ngModel)]="verificationCode">
25+
<h4>Enter your verification code here</h4><br>
26+
<md-input-container>
27+
<input mdInput type="text" name="code" [(ngModel)]="verificationCode">
28+
</md-input-container>
2729

2830
<button md-raised-button (click)="verifyLoginCode()">Verify</button>
2931
</div>

src/app/components/auth/phone-signin/phone-signin.component.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,28 @@ import { Component, OnInit } from '@angular/core';
22
import { Router } from '@angular/router';
33
import * as firebase from 'firebase';
44

5-
import { WindowService, PhoneNumber } from '../../shared';
5+
import { WindowService, PhoneNumber, AuthService, AlertService } from '../../shared';
66

77
@Component({
88
selector: 'app-phone-signin',
99
templateUrl: './phone-signin.component.html',
1010
styleUrls: ['./phone-signin.component.scss']
1111
})
1212
export class PhoneSigninComponent implements OnInit {
13-
1413
phoneNumber = new PhoneNumber()
14+
isAuthenticated = false;
1515

1616
token: string;
1717
windowRef: any;
1818
verificationCode: string;
1919
currentUser: any;
2020

2121
constructor(private win: WindowService,
22-
private router: Router) { }
22+
private router: Router,
23+
private authService: AuthService,
24+
private alertService: AlertService) {
25+
this.isAuthenticated = this.authService.isAuthenticated()
26+
}
2327

2428
ngOnInit() {
2529
this.windowRef = this.win.windowRef
@@ -34,23 +38,25 @@ export class PhoneSigninComponent implements OnInit {
3438
firebase.auth().signInWithPhoneNumber(num, appVerifier)
3539
.then(result => {
3640
this.windowRef.confirmationResult = result;
41+
this.alertService.showToaster('Login code is send');
3742
})
3843
.catch( error => console.log(error) );
3944
}
4045

4146
verifyLoginCode() {
4247
this.windowRef.confirmationResult
4348
.confirm(this.verificationCode)
44-
.then( result => {
45-
this.currentUser = result.user;
46-
})
47-
.then(response => {
48-
this.router.navigate(['/']);
49-
firebase.auth().currentUser.getIdToken()
50-
.then(
51-
(token: string) => this.token = token
52-
);
53-
})
49+
.then((result) => {
50+
const currentUser = result.user;
51+
})
52+
.then(response => {
53+
this.router.navigate(['/']);
54+
firebase.auth().currentUser.getIdToken()
55+
.then(
56+
(token: string) => this.token = token
57+
);
58+
this.alertService.showToaster('Login code is entered');
59+
})
5460
.catch( error => console.log(error, "Incorrect code entered?"));
5561
}
5662
}

src/app/components/auth/signin.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
<!-- Progress bar -->
44
<md-progress-bar *ngIf="loading" mode="indeterminate"></md-progress-bar>
55

6-
<!-- TEMPORARY -->
7-
<app-phone-signin></app-phone-signin>
8-
96
<md-card>
107
<h3>Social login</h3>
118
<form (ngSubmit)="onSignInGoogle(g)" #g="ngForm">
@@ -46,7 +43,7 @@ <h3>Login</h3>
4643
<button md-raised-button class="primary" type="submit" [disabled]="!f.valid">Login</button>
4744
</md-card-actions>
4845
</form>
49-
<!-- TEMPORARY
46+
<!-- TEMPORARY DISABLED DUE PROFILE PROBLEMS
5047
<hr />
5148
5249
<h3>Anonymous login</h3>
@@ -56,3 +53,6 @@ <h3>Anonymous login</h3>
5653
</md-card-actions>
5754
-->
5855
</md-card>
56+
57+
<!-- TEMPORARY PLACE -->
58+
<app-phone-signin></app-phone-signin>

src/app/components/auth/signin.component.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,33 @@ export class SigninComponent implements OnInit {
2323
onSignInGoogle(form: NgForm) {
2424
this.loading = true;
2525
this.authService.signInWithGoogle();
26-
this.alertService.showToaster('Google login succesful');
2726
}
2827

2928
onSignInTwitter(form: NgForm) {
3029
this.loading = true;
3130
this.authService.signInWithTwitter();
32-
this.alertService.showToaster('Twitter login succesful');
3331
}
3432

3533
onSignInFacebook(form: NgForm) {
3634
this.loading = true;
3735
this.authService.signInWithFacebook();
38-
this.alertService.showToaster('Facebook login succesful');
3936
}
4037

4138
onSignInGithub(form: NgForm) {
4239
this.loading = true;
4340
this.authService.signInWithGithub();
44-
this.alertService.showToaster('Github login succesful');
4541
}
4642

4743
onSignin(form: NgForm) {
4844
this.loading = true;
4945
const email = form.value.email;
5046
const password = form.value.password;
5147
this.authService.signinUser(email, password);
52-
this.alertService.showToaster('Login succesful');
5348
}
5449

5550
onSigninAnonymous(form: NgForm) {
5651
this.loading = true;
5752
this.authService.signInAnonymous();
58-
this.alertService.showToaster('Anonymous login succesful');
5953
}
6054

6155
}

src/app/components/auth/signup.component.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,26 @@ export class SignupComponent implements OnInit {
2424
const email = form.value.email;
2525
const password = form.value.password;
2626
this.authService.signupUser(email, password);
27-
this.alertService.showToaster('Verification email is sent to you.');
28-
// this.alertService.signUpToaster;
2927
}
3028

3129
onSignupGoogle(form: NgForm) {
3230
this.loading = true;
3331
this.authService.signUpWithGoogle();
34-
this.alertService.showToaster('Your Google registration is completed.');
3532
}
3633

3734
onSignupTwitter(form: NgForm) {
3835
this.loading = true;
3936
this.authService.signUpWithTwitter();
40-
this.alertService.showToaster('Your Twitter registration is completed.');
4137
}
4238

4339
onSignupFacebook(form: NgForm) {
4440
this.loading = true;
4541
this.authService.signUpWithFacebook();
46-
this.alertService.showToaster('Your Facebook registration is completed.');
4742
}
4843

4944
onSignupGithub(form: NgForm) {
5045
this.loading = true;
5146
this.authService.signUpWithGithub();
52-
this.alertService.showToaster('Your Github registration is completed.');
5347
}
5448

55-
/* onSignupCellphone(form: NgForm) {
56-
const phoneNumber = form.value.phoneNumber;
57-
const appVerifier = form.value.appVerifier;
58-
const code = form.value.code;
59-
this.authService.signUpWithCellPhone(phoneNumber, appVerifier, code);
60-
this.alertService.showToaster('Verification SMS is sent to you.');
61-
}*/
62-
6349
}

src/app/components/contact/contact.component.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
<div id="content">
22
<md-card>
33
<h1>Contact us</h1>
4-
<form class="form" >
4+
<form class="form" (ngSubmit)="onSubmit(c)" #c="ngForm" >
55
<md-input-container class="full-width">
6-
<input mdInput placeholder="Company" value="Google">
6+
<input mdInput placeholder="Company" id="company" name="company" value="Google" ngModel required>
77
</md-input-container>
88

99
<table class="full-width" cellspacing="0"><tr>
1010
<td><md-input-container class="full-width">
11-
<input mdInput placeholder="First name" required>
11+
<input mdInput placeholder="First name" id="firstname" name="firstname" ngModel required>
1212
</md-input-container></td>
1313
<td><md-input-container class="full-width">
14-
<input mdInput placeholder="Last name" required>
14+
<input mdInput placeholder="Last name" id="lastname" name="lastname" ngModel required>
1515
</md-input-container></td>
1616
</tr></table>
1717

1818
<p>
1919
<md-input-container class="full-width">
20-
<textarea mdInput placeholder="Address" value="Streetname 12a"></textarea>
20+
<textarea mdInput placeholder="Address" value="Streetname 12a" id="address" name="address" ngModel required></textarea>
2121
</md-input-container>
2222
</p>
2323

2424
<table class="full-width" cellspacing="0"><tr>
2525
<td><md-input-container class="full-width">
26-
<input mdInput placeholder="City">
26+
<input mdInput placeholder="City" id="city" name="city" ngModel required>
2727
</md-input-container></td>
2828
<td><md-input-container class="full-width">
29-
<input mdInput #postalCode maxlength="6" placeholder="Zip Code" value="2900TY">
29+
<input mdInput #postalCode maxlength="6" id="postal" name="postal" placeholder="Zip Code" value="2900TY" ngModel required>
3030
<md-hint align="end">{{postalCode.value.length}} / 6</md-hint>
3131
</md-input-container></td>
3232
</tr></table>
@@ -36,7 +36,7 @@ <h1>Contact us</h1>
3636
</md-input-container>
3737
</p>
3838
<br />
39-
<button md-raised-button action="mailto:[email protected]">Submit</button>
39+
<button md-raised-button type="submit" [disabled]="c.invalid">Submit</button>
4040

4141
</form>
4242
</md-card>

0 commit comments

Comments
 (0)