-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
614 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<a name="1.0.0"></a> | ||
# 1.0.0 (2016-10-10) | ||
|
||
|
||
### Features | ||
|
||
* **jwt:** provide login, home and shared module cb72080 | ||
* **routing:** provide app routing module 57bc688 | ||
* **styling:** configure bootstrap 6449ddd | ||
* **styling:** configure font-awesome 4c496bc | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<h1> | ||
{{title}} | ||
</h1> | ||
<div class="container"> | ||
<cru-navigation></cru-navigation> | ||
<router-outlet></router-outlet> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { environment } from '../environments/environment'; | ||
|
||
@Component({ | ||
selector: 'cru-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'] | ||
}) | ||
export class AppComponent { | ||
title = 'cru works!'; | ||
|
||
constructor() { | ||
console.log(JSON.stringify(environment)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
import { HomeRoutes } from './home/'; | ||
import { LoginRoutes } from './login/'; | ||
|
||
const AppRoutes: Routes = [ | ||
...HomeRoutes, | ||
...LoginRoutes | ||
]; | ||
|
||
/** | ||
* This module provides all the routes of the application. Any feature routes are imported through their respective | ||
* module and added to the `AppRoutes` array. | ||
*/ | ||
@NgModule({ | ||
imports: [RouterModule.forRoot(AppRoutes)], | ||
exports: [RouterModule], | ||
providers: [] | ||
}) | ||
export class AppRoutingModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="card"> | ||
<div class="card-header"> | ||
<h2><i class="fa fa-flask" aria-hidden="true"></i> Hello.</h2> | ||
</div> | ||
<div class="card-block"> | ||
<h4 class="card-title">Good day to you {{ user }}</h4> | ||
<p class="card-text"><i class="fa fa-ticket" aria-hidden="true"></i> Your encoded token is:</p> | ||
<div class="jumbotron"> | ||
<p id="wordwrap"> | ||
{{ token }} | ||
</p> | ||
</div> | ||
<a href="https://jwt.io/#debugger"><img src="http://jwt.io/assets/badge.svg" /></a> | ||
</div> | ||
<div class="card-footer"> | ||
<p><i class="fa fa-github" aria-hidden="true"></i> <a href="https://github.com/thedondope/crudular">TheDonDope/crudular</a></p> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#wordwrap { | ||
word-wrap: break-word; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* tslint:disable:no-unused-variable */ | ||
|
||
import { TestBed, async } from '@angular/core/testing'; | ||
import { HomeComponent } from './home.component'; | ||
|
||
describe('Component: Home', () => { | ||
it('should create an instance', () => { | ||
let component = new HomeComponent(); | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
import { AuthenticationService } from '../shared/'; | ||
|
||
/** | ||
* This class represents the lazy loaded HomeComponent. | ||
*/ | ||
@Component({ | ||
selector: 'cru-home', | ||
templateUrl: './home.component.html', | ||
styleUrls: ['./home.component.scss'] | ||
}) | ||
export class HomeComponent implements OnInit { | ||
|
||
currentUser: any; | ||
user: string; | ||
token: string; | ||
|
||
/** | ||
* Creates a new LoginComponent with the injected AuthenticationService. | ||
* @param {AuthenticationService} authenticationService - The injected AuthenticationService. | ||
* @constructor | ||
*/ | ||
constructor(private authenticationService: AuthenticationService) { } | ||
|
||
/** | ||
* Initialises the component. | ||
*/ | ||
ngOnInit() { | ||
this.currentUser = JSON.parse(this.authenticationService.getCurrentUser()); | ||
this.user = this.currentUser.username; | ||
this.token = this.currentUser.token; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { SharedModule } from '../shared/shared.module'; | ||
import { HomeComponent } from './index'; | ||
|
||
@NgModule({ | ||
imports: [CommonModule, SharedModule], | ||
declarations: [HomeComponent], | ||
exports: [HomeComponent] | ||
}) | ||
export class HomeModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Routes } from '@angular/router'; | ||
|
||
import { AuthenticationGuard } from '../shared/'; | ||
import { HomeComponent } from './home.component'; | ||
|
||
export const HomeRoutes: Routes = [ | ||
{ path: '', component: HomeComponent, canActivate: [AuthenticationGuard] } | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './home.component'; | ||
export * from './home.routing'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './login.component'; | ||
export * from './login.routing'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<div class="card"> | ||
<div class="card-header"> | ||
<h2><i class="fa fa-sign-in" aria-hidden="true"></i> Login.</h2> | ||
</div> | ||
<div class="card-block"> | ||
<div class="alert alert-danger" role="alert" [hidden]="!canShowLoginFailedMessage"> | ||
{{ loginFailedMessage }} | ||
</div> | ||
<form (ngSubmit)="login()" #loginForm="ngForm"> | ||
<fieldset class="form-group"> | ||
<label class="form-control-label" for="username">Username</label> | ||
<div class="input-group"> | ||
<div class="input-group-addon"> | ||
<i class="fa fa-fw fa-user"></i> | ||
</div> | ||
<input autofocus class="form-control" name="username" placeholder="Username" required type="text" | ||
[(ngModel)]="user.username" #username="ngModel"/> | ||
</div> | ||
<div [hidden]="username.valid || username.pristine"> | ||
<small class="text-help has-danger">Username is required</small> | ||
</div> | ||
</fieldset> | ||
<fieldset class="form-group"> | ||
<label class="form-control-label" for="password">Password</label> | ||
<div class="input-group"> | ||
<div class="input-group-addon"> | ||
<i class="fa fa-fw fa-lock" aria-hidden="true"></i> | ||
</div> | ||
<input class="form-control" name="password" placeholder="Password" required type="password" | ||
[(ngModel)]="user.password" #password="ngModel"/> | ||
</div> | ||
<div [hidden]="password.valid || password.pristine"> | ||
<small class="text-help has-danger">Password is required</small> | ||
</div> | ||
</fieldset> | ||
<button class="btn btn-primary" type="submit" [disabled]="!loginForm.form.valid"><i class="fa fa-fw fa-unlock" aria-hidden="true"></i> Login</button> | ||
</form> | ||
</div> | ||
<div class="card-footer"> | ||
<p><i class="fa fa-github" aria-hidden="true"></i> <a href="https://github.com/thedondope/crudular">TheDonDope/crudular</a></p> | ||
</div> | ||
</div> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* tslint:disable:no-unused-variable */ | ||
|
||
import { TestBed, async } from '@angular/core/testing'; | ||
import { LoginComponent } from './login.component'; | ||
|
||
describe('Component: Login', () => { | ||
it('should create an instance', () => { | ||
let component = new LoginComponent(); | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.