Skip to content

Commit

Permalink
feat(hands-on): create solution project from branch
Browse files Browse the repository at this point in the history
  • Loading branch information
nlm-pro committed Nov 25, 2018
1 parent 18dfef9 commit 7863ea1
Show file tree
Hide file tree
Showing 27 changed files with 661 additions and 5 deletions.
101 changes: 100 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,105 @@
}
}
}
},
"hands-on-solution": {
"root": "steps/hands-on-solution/",
"sourceRoot": "steps/hands-on-solution/src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/hands-on-solution",
"index": "steps/hands-on-solution/src/index.html",
"main": "steps/hands-on-solution/src/main.ts",
"polyfills": "steps/hands-on-solution/src/polyfills.ts",
"tsConfig": "steps/hands-on-solution/tsconfig.app.json",
"assets": [
"steps/hands-on-solution/src/favicon.ico",
"steps/hands-on-solution/src/assets"
],
"styles": [
"steps/hands-on-solution/src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "steps/hands-on-solution/src/environments/environment.ts",
"with": "steps/hands-on-solution/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "hands-on-solution:build"
},
"configurations": {
"production": {
"browserTarget": "hands-on-solution:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "hands-on-solution:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "steps/hands-on-solution/src/test.ts",
"polyfills": "steps/hands-on-solution/src/polyfills.ts",
"tsConfig": "steps/hands-on-solution/tsconfig.spec.json",
"karmaConfig": "steps/hands-on-solution/karma.conf.js",
"styles": [
"steps/hands-on-solution/src/styles.css"
],
"scripts": [],
"assets": [
"steps/hands-on-solution/src/favicon.ico",
"steps/hands-on-solution/src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"steps/hands-on-solution/tsconfig.app.json",
"steps/hands-on-solution/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "angular-200",
Expand All @@ -224,4 +323,4 @@
"prefix": "sfeir"
}
}
}
}
11 changes: 11 additions & 0 deletions steps/hands-on-solution/browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
#
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11
46 changes: 46 additions & 0 deletions steps/hands-on-solution/src/app/app.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
mat-toolbar.extend-toolbar {
background-color: #0168AB;
background-image: url('/assets/images/bg_right.png');
background-repeat: no-repeat;
background-position: right;
top: 0px;
box-shadow: 0 2px 5px 0 rgba(0,0,0,.26);
width: 100%;
z-index: 1;
color: white;
margin-bottom: 10px;
}

mat-toolbar .flex {
flex: 1 1 auto;
}

mat-toolbar a {
color: inherit;
text-decoration: none;
height: 100%;
margin: 0px 10px 0px 10px;
border-bottom: 2px solid transparent;
font-size: 1.1em;
font-weight: normal;
font-family: 'Open Sans', sans-serif;
}

mat-toolbar a:not(.active):hover {
border-bottom: 2px solid white;
}

mat-toolbar a img {
height: 100%;
margin-left: -60px;
}

mat-toolbar-row:nth-child(1) {
margin-bottom: 66px;
}
mat-toolbar-row:nth-child(2) {
padding-left: 30px;
text-align: center;
height: 56px;
margin-top: 56px;
}
18 changes: 18 additions & 0 deletions steps/hands-on-solution/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<mat-toolbar class="extend-toolbar">
<span>
<a href="#/home">
<img src="assets/images/logo-sfeir.svg" aria-label="sfeir" alt="Sfeir">
</a>
</span>

<span class="flex"></span>

<span>
<a href="#/locator">Maps</a>
<a href="#/people">List</a>
</span>
</mat-toolbar>

<mat-card align="center">
Hello {{ name }}
</mat-card>
14 changes: 14 additions & 0 deletions steps/hands-on-solution/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Component } from '@angular/core';

@Component({
selector: 'sfeir-app',
templateUrl: 'app.component.html',
styleUrls: ['app.component.css']
})
export class PeopleAppComponent {
name: string;

constructor() {
this.name = 'Angular 2';
}
}
42 changes: 42 additions & 0 deletions steps/hands-on-solution/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// CORE DEPS
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
// MATERIAL DESIGN MODULES
import {
MatToolbarModule,
MatCardModule,
MatTabsModule,
MatButtonModule,
MatInputModule,
MatCheckboxModule,
MatRadioModule,
MatIconModule,
MatListModule
} from '@angular/material';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';

import { PeopleAppComponent } from './app.component';

@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
MatToolbarModule,
MatCardModule,
MatTabsModule,
MatButtonModule,
MatInputModule,
MatCheckboxModule,
MatRadioModule,
MatIconModule,
MatListModule
],
declarations: [
PeopleAppComponent
],
providers: [ ],
bootstrap: [
PeopleAppComponent
]
})
export class AppModule { }
2 changes: 2 additions & 0 deletions steps/hands-on-solution/src/app/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './app.component';
export * from './app.module';
Empty file.
Empty file.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions steps/hands-on-solution/src/assets/images/icon-delete.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions steps/hands-on-solution/src/assets/images/icon-edit.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions steps/hands-on-solution/src/assets/images/icon-mail.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions steps/hands-on-solution/src/assets/images/icon-maps.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions steps/hands-on-solution/src/assets/images/icon-phone.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions steps/hands-on-solution/src/assets/images/logo-sfeir.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions steps/hands-on-solution/src/assets/images/search-icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions steps/hands-on-solution/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const environment = {
production: true,
backend: {
protocol: 'http',
host: '127.0.0.1',
port: '9000',
endpoints: {
allPeople: '/api/peoples',
onePeople: '/api/peoples/:id',
randomPeople: '/api/peoples/random'
}
}
};
18 changes: 18 additions & 0 deletions steps/hands-on-solution/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `angular-cli.json`.

export const environment = {
production: false,
backend: {
protocol: 'http',
host: '127.0.0.1',
port: '9000',
endpoints: {
allPeople: '/api/peoples',
onePeople: '/api/peoples/:id',
randomPeople: '/api/peoples/random'
}
}
};
Binary file added steps/hands-on-solution/src/favicon.ico
Binary file not shown.
21 changes: 21 additions & 0 deletions steps/hands-on-solution/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Angular200</title>
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<sfeir-app>
<div class="loader">
<svg class="circular">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10"/>
</svg>
</div>
</sfeir-app>
</body>
</html>
12 changes: 12 additions & 0 deletions steps/hands-on-solution/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));

0 comments on commit 7863ea1

Please sign in to comment.