-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GENERAL: Initializing the project and adding authentification
- Loading branch information
Showing
57 changed files
with
880 additions
and
256 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
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,14 +1,14 @@ | ||
import { AppPage } from './app.po'; | ||
|
||
describe('workspace-project App', () => { | ||
let page: AppPage; | ||
|
||
beforeEach(() => { | ||
page = new AppPage(); | ||
}); | ||
|
||
it('should display welcome message', () => { | ||
page.navigateTo(); | ||
expect(page.getParagraphText()).toEqual('Welcome to nearby-shops-front!'); | ||
}); | ||
}); | ||
import { AppPage } from './app.po'; | ||
|
||
describe('workspace-project App', () => { | ||
let page: AppPage; | ||
|
||
beforeEach(() => { | ||
page = new AppPage(); | ||
}); | ||
|
||
it('should display welcome message', () => { | ||
page.navigateTo(); | ||
expect(page.getParagraphText()).toEqual('Welcome to nearby-shops-front!'); | ||
}); | ||
}); |
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,11 +1,11 @@ | ||
import { browser, by, element } from 'protractor'; | ||
|
||
export class AppPage { | ||
navigateTo() { | ||
return browser.get('/'); | ||
} | ||
|
||
getParagraphText() { | ||
return element(by.css('app-root h1')).getText(); | ||
} | ||
} | ||
import { browser, by, element } from 'protractor'; | ||
|
||
export class AppPage { | ||
navigateTo() { | ||
return browser.get('/'); | ||
} | ||
|
||
getParagraphText() { | ||
return element(by.css('app-root h1')).getText(); | ||
} | ||
} |
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,10 +1,36 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
|
||
const routes: Routes = []; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forRoot(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class AppRoutingModule { } | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
import { AuthComponent } from './components/layouts/auth/auth.component'; | ||
import { AppComponent } from './components/layouts/app/app.component'; | ||
import { PublicGuard, ProtectedGuard } from 'ngx-auth'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'auth', | ||
component: AuthComponent, | ||
canActivate: [PublicGuard], | ||
children: [ | ||
{ | ||
path: '', | ||
loadChildren: './modules/auth/auth.module#AuthModule' | ||
} | ||
], | ||
}, | ||
{ | ||
path: 'shops', | ||
component: AppComponent, // The layout AppComponent | ||
canActivate: [ProtectedGuard], | ||
children: [ | ||
{ | ||
path: '', | ||
loadChildren: './modules/shops/shops.module#ShopsModule', | ||
} | ||
] | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forRoot(routes)], | ||
exports: [RouterModule] | ||
}) | ||
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 |
---|---|---|
@@ -1,21 +1 @@ | ||
<!--The content below is only a placeholder and can be replaced.--> | ||
<div style="text-align:center"> | ||
<h1> | ||
Welcome to {{ title }}! | ||
</h1> | ||
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="> | ||
</div> | ||
<h2>Here are some links to help you start: </h2> | ||
<ul> | ||
<li> | ||
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2> | ||
</li> | ||
<li> | ||
<h2><a target="_blank" rel="noopener" href="https://github.com/angular/angular-cli/wiki">CLI Documentation</a></h2> | ||
</li> | ||
<li> | ||
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2> | ||
</li> | ||
</ul> | ||
|
||
<router-outlet></router-outlet> |
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,31 +1,31 @@ | ||
import { TestBed, async } from '@angular/core/testing'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
import { AppComponent } from './app.component'; | ||
describe('AppComponent', () => { | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
RouterTestingModule | ||
], | ||
declarations: [ | ||
AppComponent | ||
], | ||
}).compileComponents(); | ||
})); | ||
it('should create the app', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
expect(app).toBeTruthy(); | ||
})); | ||
it(`should have as title 'nearby-shops-front'`, async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
expect(app.title).toEqual('nearby-shops-front'); | ||
})); | ||
it('should render title in a h1 tag', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
fixture.detectChanges(); | ||
const compiled = fixture.debugElement.nativeElement; | ||
expect(compiled.querySelector('h1').textContent).toContain('Welcome to nearby-shops-front!'); | ||
})); | ||
}); | ||
import { TestBed, async } from '@angular/core/testing'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
import { AppComponent } from './app.component'; | ||
describe('AppComponent', () => { | ||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
RouterTestingModule | ||
], | ||
declarations: [ | ||
AppComponent | ||
], | ||
}).compileComponents(); | ||
})); | ||
it('should create the app', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
expect(app).toBeTruthy(); | ||
})); | ||
it(`should have as title 'nearby-shops-front'`, async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
const app = fixture.debugElement.componentInstance; | ||
expect(app.title).toEqual('nearby-shops-front'); | ||
})); | ||
it('should render title in a h1 tag', async(() => { | ||
const fixture = TestBed.createComponent(AppComponent); | ||
fixture.detectChanges(); | ||
const compiled = fixture.debugElement.nativeElement; | ||
expect(compiled.querySelector('h1').textContent).toContain('Welcome to nearby-shops-front!'); | ||
})); | ||
}); |
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,9 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.css'] | ||
}) | ||
export class AppComponent { | ||
title = 'nearby-shops-front'; | ||
} | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.css'] | ||
}) | ||
export class AppComponent { | ||
} |
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,18 +1,46 @@ | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { AppRoutingModule } from './app-routing.module'; | ||
import { AppComponent } from './app.component'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
AppComponent | ||
], | ||
imports: [ | ||
BrowserModule, | ||
AppRoutingModule | ||
], | ||
providers: [], | ||
bootstrap: [AppComponent] | ||
}) | ||
export class AppModule { } | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { AppRoutingModule } from './app-routing.module'; | ||
import { AppComponent } from './app.component'; | ||
import { CardComponent } from './components/card/card.component'; | ||
import { CardListComponent } from './components/card-list/card-list.component'; | ||
import { AuthModule as AppAuthModule } from './modules/auth/auth.module'; | ||
import { ShopsModule } from './modules/shops/shops.module'; | ||
import { AuthComponent } from './components/layouts/auth/auth.component'; | ||
import { AppComponent as LayoutAppComponent } from './components/layouts/app/app.component'; | ||
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http'; | ||
import { TokenInterceptor } from './interceptors/token.interceptors'; | ||
import {ProtectedGuard, PublicGuard, AuthModule, PROTECTED_FALLBACK_PAGE_URI, PUBLIC_FALLBACK_PAGE_URI, AUTH_SERVICE} from 'ngx-auth'; | ||
import {AuthenticationService} from './services/authentication.service'; | ||
import {HttpModule} from '@angular/http'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
AppComponent, | ||
CardComponent, | ||
CardListComponent, | ||
AuthComponent, | ||
LayoutAppComponent | ||
], | ||
imports: [ | ||
BrowserModule, | ||
AppRoutingModule, | ||
HttpModule, | ||
HttpClientModule, | ||
AppAuthModule, | ||
AuthModule, | ||
ShopsModule | ||
], | ||
providers: [{ | ||
provide: HTTP_INTERCEPTORS, | ||
useClass: TokenInterceptor, | ||
multi: true | ||
}, | ||
{ provide: PROTECTED_FALLBACK_PAGE_URI, useValue: '/' }, | ||
{ provide: PUBLIC_FALLBACK_PAGE_URI, useValue: '/login' }, | ||
{ provide: AUTH_SERVICE, useClass: AuthenticationService } | ||
], | ||
bootstrap: [AppComponent] | ||
}) | ||
export class AppModule { } |
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,3 @@ | ||
<p> | ||
card-list works! | ||
</p> |
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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { CardListComponent } from './card-list.component'; | ||
|
||
describe('CardListComponent', () => { | ||
let component: CardListComponent; | ||
let fixture: ComponentFixture<CardListComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [CardListComponent] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(CardListComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
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,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-card-list', | ||
templateUrl: './card-list.component.html', | ||
styleUrls: ['./card-list.component.css'] | ||
}) | ||
export class CardListComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
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,3 @@ | ||
<p> | ||
card works! | ||
</p> |
Oops, something went wrong.