Skip to content
This repository was archived by the owner on Jan 23, 2022. It is now read-only.

Commit 8a9f030

Browse files
committed
Merge branch 'release/1.0.7'
2 parents 8e5d117 + b487815 commit 8a9f030

18 files changed

+324
-183
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ npm install -g generator-angular2-firebase-bootstrap
1313
Then generate your new project:
1414

1515
```bash
16-
yo angular-2-firebase-bootstrap
16+
yo angular2-firebase-bootstrap
1717
```
1818

1919
## Features

generators/app/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ module.exports = yeoman.Base.extend({
7272
"./e2e/tsconfig.json",
7373
"./karma.conf.js",
7474
"./protractor.conf.js",
75+
"./src/app/display-user/display-user.component.css",
76+
"./src/app/display-user/display-user.component.html",
77+
"./src/app/display-user/display-user.component.spec.ts",
78+
"./src/app/display-user/display-user.component.ts",
79+
"./src/app/login-user/login-user.component.css",
80+
"./src/app/login-user/login-user.component.html",
81+
"./src/app/login-user/login-user.component.spec.ts",
82+
"./src/app/login-user/login-user.component.ts",
7583
"./src/app/app.component.css",
7684
"./src/app/app.component.html",
7785
"./src/app/app.module.ts",

generators/app/templates/package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@
1212
},
1313
"private": true,
1414
"dependencies": {
15-
"@angular/common": "^2.4.1",
16-
"@angular/compiler": "^2.4.1",
17-
"@angular/core": "^2.4.1",
18-
"@angular/forms": "^2.4.1",
19-
"@angular/http": "^2.4.1",
20-
"@angular/platform-browser": "^2.4.1",
21-
"@angular/platform-browser-dynamic": "^2.4.1",
22-
"@angular/router": "^3.4.1",
15+
"@angular/common": "^2.4.3",
16+
"@angular/compiler": "^2.4.3",
17+
"@angular/core": "^2.4.3",
18+
"@angular/forms": "^2.4.3",
19+
"@angular/http": "^2.4.3",
20+
"@angular/platform-browser": "^2.4.3",
21+
"@angular/platform-browser-dynamic": "^2.4.3",
22+
"@angular/router": "^3.4.3",
2323
"angularfire2": "^2.0.0-beta.7",
2424
"firebase": "^3.6.5",
2525
"bootstrap": "^3.3.7",
2626
"core-js": "^2.4.1",
27-
"ng2-bootstrap": "^1.1.16-9",
28-
"rxjs": "^5.0.2",
29-
"ts-helpers": "^1.1.1",
30-
"zone.js": "0.7.2"
27+
"ng2-bootstrap": "^1.2.2",
28+
"rxjs": "^5.0.3",
29+
"ts-helpers": "^1.1.2",
30+
"zone.js": "^0.7.6"
3131
},
3232
"devDependencies": {
33-
"@angular/compiler-cli": "^2.4.1",
33+
"@angular/compiler-cli": "^2.4.3",
3434
"@types/jasmine": "2.5.38",
35-
"@types/node": "^6.0.42",
35+
"@types/node": "^6.0.60",
3636
"angular-cli": "1.0.0-beta.24",
3737
"codelyzer": "~1.0.0-beta.3",
3838
"jasmine-core": "2.5.2",
@@ -45,6 +45,6 @@
4545
"protractor": "4.0.13",
4646
"ts-node": "1.2.1",
4747
"tslint": "^4.2.0",
48-
"typescript": "~2.0.3"
48+
"typescript": "~2.0.10"
4949
}
5050
}
Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +0,0 @@
1-
.main {
2-
max-width: 320px;
3-
margin: 0 auto;
4-
}
5-
6-
.login-or {
7-
position: relative;
8-
font-size: 18px;
9-
color: #aaa;
10-
margin-top: 10px;
11-
margin-bottom: 10px;
12-
padding-top: 10px;
13-
padding-bottom: 10px;
14-
}
15-
16-
.span-or {
17-
display: block;
18-
position: absolute;
19-
left: 50%;
20-
top: -2px;
21-
margin-left: -25px;
22-
background-color: #fff;
23-
width: 50px;
24-
text-align: center;
25-
}
26-
27-
.hr-or {
28-
background-color: #cdcdcd;
29-
height: 1px;
30-
margin-top: 0px !important;
31-
margin-bottom: 0px !important;
32-
}
33-
34-
h3 {
35-
text-align: center;
36-
line-height: 300%;
37-
}

generators/app/templates/src/app/app.component.html

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,6 @@
22
<h1>
33
{{title}}
44
</h1>
5-
<div class="row" *ngIf="isLoggedIn()|async">
6-
<div class="row">
7-
<div class="col-md-6 col-md-offset-3">
8-
<div class="panel panel-default">
9-
<div class="panel-heading">User Information</div>
10-
<ul class="list-group">
11-
<li class="list-group-item">Email: {{(currentUser()|async).email}}</li>
12-
<li class="list-group-item">Display Name: {{(currentUser()|async).displayName}}</li>
13-
<li class="list-group-item">Uid: {{(currentUser()|async).uid}}</li>
14-
<li class="list-group-item">Provider Id: {{(currentUser()|async).providerId}}</li>
15-
<li class="list-group-item" *ngIf="(currentUser()|async).photoURL"><img [src]="(currentUser()|async).photoURL"/></li>
16-
</ul>
17-
</div>
18-
</div>
19-
<div class="row">
20-
<div class="col-md-3 col-md-offset-5">
21-
<a href="#" class="btn btn-lg btn-primary btn-block" (click)="logout()">Log out</a>
22-
</div>
23-
</div>
24-
</div>
25-
</div>
26-
<div class="row">
27-
<div class="main" *ngIf="!(isLoggedIn()|async)">
28-
29-
<h3>Please Log In
30-
<!--, or <a href="#">Sign Up</a>-->
31-
</h3>
32-
<div class="row">
33-
<div class="col-xs-6 col-sm-6 col-md-6">
34-
<a href="#" class="btn btn-lg btn-primary btn-block" (click)="loginVia('twitter')">Twitter</a>
35-
</div>
36-
<div class="col-xs-6 col-sm-6 col-md-6">
37-
<a href="#" class="btn btn-lg btn-info btn-block" (click)="loginVia('google')">Google</a>
38-
</div>
39-
</div>
40-
<div class="login-or">
41-
<hr class="hr-or">
42-
<span class="span-or">or</span>
43-
</div>
44-
45-
<form role="form">
46-
<div class="form-group">
47-
<label for="email">Email</label>
48-
<input required type="text" class="form-control" id="email" name="email" [(ngModel)]="email">
49-
</div>
50-
<div class="form-group">
51-
<label for="password">Password</label>
52-
<input type="password" class="form-control" id="password" name="password" [(ngModel)]="password">
53-
</div>
54-
<button class="btn btn btn-primary" (click)="login()">
55-
Log In
56-
</button>
57-
</form>
58-
59-
</div>
60-
</div>
5+
<app-display-user></app-display-user>
6+
<app-login-user></app-login-user>
617
</div>
Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,34 @@
11
/* tslint:disable:no-unused-variable */
2-
3-
import { TestBed, async } from '@angular/core/testing';
4-
import { AppComponent } from './app.component';
5-
import { AuthService } from './shared/auth.service';
6-
import { FormsModule } from '@angular/forms';
7-
import {AsyncSubject} from "rxjs";
2+
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3+
import {TestBed, async} from "@angular/core/testing";
4+
import {AppComponent} from "./app.component";
85

96
describe('AppComponent', () => {
10-
beforeEach(() => {
11-
let authServiceStub = {
12-
login: function () { return true },
13-
logout: function () { return true },
14-
isLoggedIn: function () {
15-
return new AsyncSubject<boolean>();
16-
}
17-
};
18-
19-
TestBed.configureTestingModule({
20-
imports: [ FormsModule ],
21-
declarations: [
22-
AppComponent
23-
],
24-
providers: [
25-
{ provide: AuthService, useValue: authServiceStub }
26-
]
7+
beforeEach(() => {
8+
TestBed.configureTestingModule({
9+
declarations: [
10+
AppComponent
11+
],
12+
schemas: [CUSTOM_ELEMENTS_SCHEMA]
13+
});
2714
});
28-
});
2915

30-
it('should create the app', async(() => {
31-
let fixture = TestBed.createComponent(AppComponent);
32-
let app = fixture.debugElement.componentInstance;
33-
expect(app).toBeTruthy();
34-
}));
16+
it('should create the app', async(() => {
17+
let fixture = TestBed.createComponent(AppComponent);
18+
let app = fixture.debugElement.componentInstance;
19+
expect(app).toBeTruthy();
20+
}));
3521

36-
it(`should have as title 'app works!'`, async(() => {
37-
let fixture = TestBed.createComponent(AppComponent);
38-
let app = fixture.debugElement.componentInstance;
39-
expect(app.title).toEqual('app works! - <%= name %>');
40-
}));
22+
it(`should have as title 'app works!'`, async(() => {
23+
let fixture = TestBed.createComponent(AppComponent);
24+
let app = fixture.debugElement.componentInstance;
25+
expect(app.title).toEqual('app works! - <%= name %>');
26+
}));
4127

42-
it('should render title in a h1 tag', async(() => {
43-
let fixture = TestBed.createComponent(AppComponent);
44-
fixture.detectChanges();
45-
let compiled = fixture.debugElement.nativeElement;
46-
expect(compiled.querySelector('h1').textContent).toContain('app works! - <%= name %>');
47-
}));
28+
it('should render title in a h1 tag', async(() => {
29+
let fixture = TestBed.createComponent(AppComponent);
30+
fixture.detectChanges();
31+
let compiled = fixture.debugElement.nativeElement;
32+
expect(compiled.querySelector('h1').textContent).toContain('app works! - <%= name %>');
33+
}));
4834
});
Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import {Component} from "@angular/core";
2-
import {AuthService} from "app/shared/auth.service";
3-
import {Observable} from "rxjs";
4-
import {UserInfo} from "app/shared/user-info";
52

63
@Component({
74
selector: 'app-root',
@@ -11,28 +8,6 @@ import {UserInfo} from "app/shared/user-info";
118
export class AppComponent {
129
title = 'app works! - <%= name %>';
1310

14-
email: string;
15-
password: string;
16-
17-
constructor(private authService: AuthService) {}
18-
19-
login() {
20-
this.authService.login(this.email, this.password);
21-
}
22-
23-
loginVia(provider: string) {
24-
this.authService.loginViaProvider(provider);
25-
}
26-
27-
logout() {
28-
this.authService.logout();
29-
}
30-
31-
isLoggedIn(): Observable<boolean> {
32-
return this.authService.isLoggedIn();
33-
}
34-
35-
currentUser(): Observable<UserInfo> {
36-
return this.authService.currentUser();
11+
constructor() {
3712
}
3813
}

generators/app/templates/src/app/app.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ import { AppComponent } from './app.component';
77
import {authConfig, firebaseConfig} from "environments/firebaseConfig";
88
import {AngularFireModule} from "angularfire2";
99
import {AuthService} from "app/shared/auth.service";
10+
import {LoginUserComponent} from "app/login-user/login-user.component";
11+
import {DisplayUserComponent} from "app/display-user/display-user.component";
1012

1113
@NgModule({
1214
declarations: [
13-
AppComponent
15+
AppComponent,
16+
DisplayUserComponent,
17+
LoginUserComponent
1418
],
1519
imports: [
1620
BrowserModule,

generators/app/templates/src/app/display-user/display-user.component.css

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div class="row" *ngIf="isLoggedIn()|async">
2+
<div class="row">
3+
<div class="col-md-6 col-md-offset-3">
4+
<div class="panel panel-default">
5+
<div class="panel-heading">User Information</div>
6+
<ul class="list-group">
7+
<li class="list-group-item">Email: {{(currentUser()|async).email}}</li>
8+
<li class="list-group-item">Display Name: {{(currentUser()|async).displayName}}</li>
9+
<li class="list-group-item">Uid: {{(currentUser()|async).uid}}</li>
10+
<li class="list-group-item">Provider Id: {{(currentUser()|async).providerId}}</li>
11+
<li class="list-group-item" *ngIf="(currentUser()|async).photoURL"><img [src]="(currentUser()|async).photoURL"/></li>
12+
</ul>
13+
</div>
14+
</div>
15+
<div class="row">
16+
<div class="col-md-3 col-md-offset-5">
17+
<a href="#" class="btn btn-lg btn-primary btn-block" (click)="logout()">Log out</a>
18+
</div>
19+
</div>
20+
</div>
21+
</div>

0 commit comments

Comments
 (0)