diff --git a/angular.json b/angular.json index e5350e2f..15db1b74 100644 --- a/angular.json +++ b/angular.json @@ -2192,6 +2192,105 @@ } } } + }, + "form": { + "root": "steps/form/", + "sourceRoot": "steps/form/src", + "projectType": "application", + "prefix": "app", + "schematics": {}, + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/form", + "index": "steps/form/src/index.html", + "main": "steps/form/src/main.ts", + "polyfills": "steps/form/src/polyfills.ts", + "tsConfig": "steps/form/tsconfig.app.json", + "assets": [ + "steps/form/src/favicon.ico", + "steps/form/src/assets" + ], + "styles": [ + "steps/form/src/styles.css" + ], + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "steps/form/src/environments/environment.ts", + "with": "steps/form/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": "form:build" + }, + "configurations": { + "production": { + "browserTarget": "form:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "form:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "steps/form/src/test.ts", + "polyfills": "steps/form/src/polyfills.ts", + "tsConfig": "steps/form/tsconfig.spec.json", + "karmaConfig": "steps/form/karma.conf.js", + "styles": [ + "steps/form/src/styles.css" + ], + "scripts": [], + "assets": [ + "steps/form/src/favicon.ico", + "steps/form/src/assets" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "steps/form/tsconfig.app.json", + "steps/form/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } } }, "defaultProject": "angular-200", diff --git a/steps/form/browserslist b/steps/form/browserslist new file mode 100644 index 00000000..37371cb0 --- /dev/null +++ b/steps/form/browserslist @@ -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 \ No newline at end of file diff --git a/steps/form/src/app/_static/form.component.css b/steps/form/src/app/_static/form.component.css new file mode 100644 index 00000000..1e4f97a6 --- /dev/null +++ b/steps/form/src/app/_static/form.component.css @@ -0,0 +1,50 @@ + +mat-card, +mat-list-item { + color: rgba(0,0,0,0.87); + background-color: white; + margin: 10px; + width: 360px; +} + +mat-card:hover { + box-shadow: 0 11px 15px -7px rgba(0,0,0,.2), + 0 24px 38px 3px rgba(0,0,0,.14), + 0 9px 46px 8px rgba(0,0,0,.12); +} + +mat-list-item { + height: 22px; + padding: 0; + margin-left: -12px; + font-size: 14px; +} + +mat-card-title { + margin-bottom: 0; +} + +mat-card-title span { + font-size: 24px; + font-weight: 400; + line-height: 32px; +} + +mat-card-subtitle { + margin-top: -18px; + height: 17px; +} + +mat-card-title-group { + margin-bottom: 20px; +} + +img { + border-radius: 50%; + margin-right: 18px; + -webkit-filter: grayscale(100%); +} + +.align-right { + text-align: right; +} diff --git a/steps/form/src/app/_static/form.component.html b/steps/form/src/app/_static/form.component.html new file mode 100644 index 00000000..936c7bab --- /dev/null +++ b/steps/form/src/app/_static/form.component.html @@ -0,0 +1,69 @@ + + + + Create new person + + + +
+ +

+ + + +

+ + + + + + +
+ + + + + + + + + +
+ +

+ + + +

+ +

+ + + +

+ +

+ + + + + + +

+ +

+ + + +

+ +

+ Manager +

+ + + + +
+
+
\ No newline at end of file diff --git a/steps/form/src/app/app.component.css b/steps/form/src/app/app.component.css new file mode 100644 index 00000000..df3c0b92 --- /dev/null +++ b/steps/form/src/app/app.component.css @@ -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; +} diff --git a/steps/form/src/app/app.component.html b/steps/form/src/app/app.component.html new file mode 100644 index 00000000..f5e90bf7 --- /dev/null +++ b/steps/form/src/app/app.component.html @@ -0,0 +1,16 @@ + + + + Sfeir + + + + + + + Maps + List + + + + \ No newline at end of file diff --git a/steps/form/src/app/app.component.ts b/steps/form/src/app/app.component.ts new file mode 100644 index 00000000..d9965162 --- /dev/null +++ b/steps/form/src/app/app.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'sfeir-app', + templateUrl: 'app.component.html', + styleUrls: ['app.component.css'] +}) +export class PeopleAppComponent { + constructor() {} +} diff --git a/steps/form/src/app/app.module.ts b/steps/form/src/app/app.module.ts new file mode 100644 index 00000000..1d8a6d01 --- /dev/null +++ b/steps/form/src/app/app.module.ts @@ -0,0 +1,60 @@ +// CORE DEPS +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { HttpClientModule, HttpClient } from '@angular/common/http'; +// MATERIAL DESIGN MODULES +import { + MatToolbarModule, + MatCardModule, + MatTabsModule, + MatButtonModule, + MatInputModule, + MatCheckboxModule, + MatRadioModule, + MatIconModule, + MatListModule, + MatDialogModule, +} from '@angular/material'; +import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; + +import { APP_ROUTES } from './app.routes'; + +import { PeopleAppComponent } from './app.component'; +import { HomeComponent } from './home'; +import { PeopleComponent } from './people'; +import { CardComponent } from './shared/card'; +import { AddDialogComponent } from 'app/people/add-dialog/add-dialog.component'; + +@NgModule({ + imports: [ + BrowserModule, + BrowserAnimationsModule, + MatToolbarModule, + MatCardModule, + MatTabsModule, + MatButtonModule, + MatInputModule, + MatCheckboxModule, + MatRadioModule, + MatIconModule, + MatListModule, + MatDialogModule, + HttpClientModule, + APP_ROUTES + ], + declarations: [ + PeopleAppComponent, + HomeComponent, + PeopleComponent, + CardComponent, + AddDialogComponent, + ], + entryComponents: [AddDialogComponent], + providers: [ + HttpClient, + ], + bootstrap: [ + PeopleAppComponent + ] +}) +export class AppModule { } diff --git a/steps/form/src/app/app.routes.ts b/steps/form/src/app/app.routes.ts new file mode 100644 index 00000000..509bb216 --- /dev/null +++ b/steps/form/src/app/app.routes.ts @@ -0,0 +1,13 @@ +import { RouterModule, Routes } from '@angular/router'; + +// APP COMPONENTS +import { HomeComponent } from './home/index'; +import { PeopleComponent } from './people/index'; + +const ROUTES: Routes = [ + {path: '', redirectTo: 'home', pathMatch: 'full'}, + {path: 'home', component: HomeComponent}, + {path: 'people', component: PeopleComponent} +]; + +export const APP_ROUTES = RouterModule.forRoot(ROUTES, {useHash: true}); diff --git a/steps/form/src/app/home/home.component.css b/steps/form/src/app/home/home.component.css new file mode 100644 index 00000000..f9428ad8 --- /dev/null +++ b/steps/form/src/app/home/home.component.css @@ -0,0 +1,10 @@ +h1 { + text-align: center; +} + +section { + display: flex; + flex-flow: row wrap; + align-items: center; + justify-content: center; +} diff --git a/steps/form/src/app/home/home.component.html b/steps/form/src/app/home/home.component.html new file mode 100644 index 00000000..9d0b2236 --- /dev/null +++ b/steps/form/src/app/home/home.component.html @@ -0,0 +1,7 @@ +
+ +
+ + diff --git a/steps/form/src/app/home/home.component.ts b/steps/form/src/app/home/home.component.ts new file mode 100644 index 00000000..d594123b --- /dev/null +++ b/steps/form/src/app/home/home.component.ts @@ -0,0 +1,32 @@ +import { Component, OnInit } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { environment } from '../../environments/environment'; + +const BASE_URL = 'http://localhost:9000'; + +@Component({ + selector: 'sfeir-home', + templateUrl: 'home.component.html', + styleUrls: ['home.component.css'] +}) +export class HomeComponent implements OnInit { + private person: any = {}; + + constructor(private _http: HttpClient) {} + + /** + * OnInit implementation + */ + ngOnInit() { + this._http.get(`${BASE_URL}/api/peoples/`) + .subscribe(people => this.person = people[0]); + } + + /** + * Returns random people + */ + random() { + this._http.get(`${BASE_URL}/api/peoples/random`) + .subscribe(person => this.person = person); + } +} diff --git a/steps/form/src/app/home/index.ts b/steps/form/src/app/home/index.ts new file mode 100644 index 00000000..e00834fc --- /dev/null +++ b/steps/form/src/app/home/index.ts @@ -0,0 +1 @@ +export * from './home.component'; \ No newline at end of file diff --git a/steps/form/src/app/index.ts b/steps/form/src/app/index.ts new file mode 100644 index 00000000..875bdb2f --- /dev/null +++ b/steps/form/src/app/index.ts @@ -0,0 +1,2 @@ +export * from './app.component'; +export * from './app.module'; diff --git a/steps/form/src/app/people/add-dialog/add-dialog.component.css b/steps/form/src/app/people/add-dialog/add-dialog.component.css new file mode 100644 index 00000000..e69de29b diff --git a/steps/form/src/app/people/add-dialog/add-dialog.component.html b/steps/form/src/app/people/add-dialog/add-dialog.component.html new file mode 100644 index 00000000..f0f90958 --- /dev/null +++ b/steps/form/src/app/people/add-dialog/add-dialog.component.html @@ -0,0 +1,3 @@ +

+ add-dialog works! +

diff --git a/steps/form/src/app/people/add-dialog/add-dialog.component.spec.ts b/steps/form/src/app/people/add-dialog/add-dialog.component.spec.ts new file mode 100644 index 00000000..cc2637d4 --- /dev/null +++ b/steps/form/src/app/people/add-dialog/add-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AddDialogComponent } from './add-dialog.component'; + +describe('AddDialogComponent', () => { + let component: AddDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AddDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AddDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/steps/form/src/app/people/add-dialog/add-dialog.component.ts b/steps/form/src/app/people/add-dialog/add-dialog.component.ts new file mode 100644 index 00000000..6c6710f9 --- /dev/null +++ b/steps/form/src/app/people/add-dialog/add-dialog.component.ts @@ -0,0 +1,28 @@ +import { Component, OnInit } from '@angular/core'; +import { MatDialogRef } from '@angular/material'; + + +@Component({ + selector: 'sfeir-add-dialog', + templateUrl: './add-dialog.component.html', + styleUrls: ['./add-dialog.component.css'] +}) +export class AddDialogComponent implements OnInit { + + constructor(public dialogRef: MatDialogRef) { } + + closeDialog(result = null) { + this.dialogRef.close(result); + } + + ngOnInit() { + } + + onCancel() { + this.closeDialog(); + } + + onSave(person) { + this.closeDialog(person); + } +} diff --git a/steps/form/src/app/people/index.ts b/steps/form/src/app/people/index.ts new file mode 100644 index 00000000..1417d62f --- /dev/null +++ b/steps/form/src/app/people/index.ts @@ -0,0 +1 @@ +export * from './people.component'; \ No newline at end of file diff --git a/steps/form/src/app/people/people.component.css b/steps/form/src/app/people/people.component.css new file mode 100644 index 00000000..93913546 --- /dev/null +++ b/steps/form/src/app/people/people.component.css @@ -0,0 +1,29 @@ +h1 { + text-align: center; +} + +section { + display: flex; + flex-flow: row wrap; + align-items: center; + justify-content: center; +} + +.list { + padding-bottom: 100px; +} + +.dialog-modal { + top: 0; + position: fixed; + background: rgba(0,0,0,0.5); + height: 100%; + width: 100%; + display: flex; + flex-basis: auto; + visibility: hidden; + color: white; +} +.dialog-modal.active { + visibility: visible; +} diff --git a/steps/form/src/app/people/people.component.html b/steps/form/src/app/people/people.component.html new file mode 100644 index 00000000..dad25cb4 --- /dev/null +++ b/steps/form/src/app/people/people.component.html @@ -0,0 +1,8 @@ +
+ +
+ + + diff --git a/steps/form/src/app/people/people.component.ts b/steps/form/src/app/people/people.component.ts new file mode 100644 index 00000000..01aa2a93 --- /dev/null +++ b/steps/form/src/app/people/people.component.ts @@ -0,0 +1,52 @@ +import { Component, OnInit } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { AddDialogComponent } from './add-dialog/add-dialog.component'; + +const BASE_URL = 'http://localhost:9000'; + +@Component({ + selector: 'sfeir-people', + templateUrl: 'people.component.html', + styleUrls: ['people.component.css'] +}) +export class PeopleComponent implements OnInit { + + private addDialog: MatDialogRef; + people; + dialogStatus = 'inactive'; + + constructor(private _http: HttpClient, public dialog: MatDialog) {} + + + /** + * OnInit implementation + */ + ngOnInit() { + this._http.get(`${BASE_URL}/api/peoples/`) + .subscribe( (people) => this.people = people); + } + + delete(person: any) { + this._http.delete(`${BASE_URL}/api/peoples/${person.id}`) + .subscribe( (people) => this.people = people); + } + + showDialog() { + this.dialogStatus = 'active'; + this.addDialog = this.dialog.open(AddDialogComponent, { + width: '450px', + data: {} + }); + + this.addDialog.afterClosed().subscribe(result => { + this.dialogStatus = 'inactive'; + console.log('The dialog was closed'); + }); + } + + hideDialog() { + this.dialogStatus = 'inactive'; + this.addDialog.close(); + } +} diff --git a/steps/form/src/app/shared/card/card.component.css b/steps/form/src/app/shared/card/card.component.css new file mode 100644 index 00000000..ff81a94c --- /dev/null +++ b/steps/form/src/app/shared/card/card.component.css @@ -0,0 +1,140 @@ +@media (min-width: 768px) { + :host(.wide) mat-card, + :host(.wide) mat-list-item{ + width: 600px; + } +} + +mat-card, +mat-list-item { + color: rgba(0,0,0,0.87); + background-color: white; + margin: 10px; + width: 360px; +} + +mat-card:hover { + box-shadow: 0 11px 15px -7px rgba(0,0,0,.2), + 0 24px 38px 3px rgba(0,0,0,.14), + 0 9px 46px 8px rgba(0,0,0,.12); +} + +mat-list-item { + height: 22px; + padding: 0; + margin-left: -12px; + font-size: 14px; +} + +mat-card-title { + margin-bottom: 0; +} + +mat-card-title span { + font-size: 24px; + font-weight: 400; + line-height: 32px; +} + +mat-card-subtitle.contact-info { + margin-top: -7px; + height: 20px; +} + +mat-card-title-group { + margin-bottom: 20px; +} + +.contact-info mat-icon + a { + top: -8px; + position: relative; + height: 18px; +} + +.contact-info a:hover { + text-decoration: underline; +} + +.buttons-info { + float: right; + margin-top: -50px; +} + +@media (max-width: 412px) { + .buttons-info { + margin-top: -34px; + } +} + +.buttons-info [mat-button] { + min-width: 0px; + padding: 2px; + height: 40px; +} + +mat-icon { + color: rgba(0,0,0,0.54); + margin: 4px; +} + +a { + color: #337ab7; + text-decoration: none; +} + +mat-card-actions button[mat-raised-button] { + margin: 5px; +} + +.hl { + background-color: orange; + color: white; +} + +.skills { + padding: 10px; + background-color: #FAFAFA; +} + +a.truncate { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + width: 188px; +} + +@media (max-width: 600px) { + a.truncate { + width: 170px; + } +} + +@media (max-width: 768px) { + a.truncate { + width: 190px; + } +} + +.mat-whiteframe-2dp { + box-shadow: 0 1px 5px 0 rgba(0,0,0,.2), + 0 2px 2px 0 rgba(0,0,0,.14), + 0 3px 1px -2px rgba(0,0,0,.12); +} + +img { + border-radius: 50%; + margin-right: 18px; +} + +@media (max-width: 412px) { + img { + margin-right: 3px; + } +} + +@media (max-width: 600px) { + img { + margin-right: 5px; + } +} diff --git a/steps/form/src/app/shared/card/card.component.html b/steps/form/src/app/shared/card/card.component.html new file mode 100644 index 00000000..28b72b27 --- /dev/null +++ b/steps/form/src/app/shared/card/card.component.html @@ -0,0 +1,41 @@ + + + + + + {{ person.firstname }} {{ person.lastname }} + + + {{ person.entity }} + + email + {{ person.email }} + + + phone + {{ person.phone }} + + + + +
+ Manager :  + {{ person.manager }} +
+
+ Location : SFEIR +
+ +
+
diff --git a/steps/form/src/app/shared/card/card.component.ts b/steps/form/src/app/shared/card/card.component.ts new file mode 100644 index 00000000..66600365 --- /dev/null +++ b/steps/form/src/app/shared/card/card.component.ts @@ -0,0 +1,32 @@ +import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; + +@Component({ + selector: 'sfeir-card', + templateUrl: 'card.component.html', + styleUrls: ['card.component.css'] +}) +export class CardComponent implements OnInit { + + @Input() person: any; + @Output('personDelete') delete$: EventEmitter + + constructor() { + this.person = {}; + this.delete$= new EventEmitter(); + } + + /** + * OnInit implementation + */ + ngOnInit() { + } + + /** + * Function to emit event to delete current person + * + * @param person + */ + delete(person: any) { + this.delete$.emit(person); + } +} diff --git a/steps/form/src/app/shared/card/index.ts b/steps/form/src/app/shared/card/index.ts new file mode 100644 index 00000000..0904481d --- /dev/null +++ b/steps/form/src/app/shared/card/index.ts @@ -0,0 +1 @@ +export * from './card.component'; \ No newline at end of file diff --git a/steps/form/src/app/shared/index.ts b/steps/form/src/app/shared/index.ts new file mode 100644 index 00000000..8cc64555 --- /dev/null +++ b/steps/form/src/app/shared/index.ts @@ -0,0 +1 @@ +export * from './card/index'; \ No newline at end of file diff --git a/steps/form/src/assets/.gitkeep b/steps/form/src/assets/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/steps/form/src/assets/.npmignore b/steps/form/src/assets/.npmignore new file mode 100644 index 00000000..e69de29b diff --git a/steps/form/src/assets/images/bg_right.png b/steps/form/src/assets/images/bg_right.png new file mode 100644 index 00000000..449e4bc8 Binary files /dev/null and b/steps/form/src/assets/images/bg_right.png differ diff --git a/steps/form/src/assets/images/icon-delete.svg b/steps/form/src/assets/images/icon-delete.svg new file mode 100644 index 00000000..c665bde5 --- /dev/null +++ b/steps/form/src/assets/images/icon-delete.svg @@ -0,0 +1 @@ + diff --git a/steps/form/src/assets/images/icon-edit.svg b/steps/form/src/assets/images/icon-edit.svg new file mode 100644 index 00000000..bb07333e --- /dev/null +++ b/steps/form/src/assets/images/icon-edit.svg @@ -0,0 +1 @@ + diff --git a/steps/form/src/assets/images/icon-mail.svg b/steps/form/src/assets/images/icon-mail.svg new file mode 100644 index 00000000..040a7e7f --- /dev/null +++ b/steps/form/src/assets/images/icon-mail.svg @@ -0,0 +1 @@ + diff --git a/steps/form/src/assets/images/icon-maps.svg b/steps/form/src/assets/images/icon-maps.svg new file mode 100644 index 00000000..989697e2 --- /dev/null +++ b/steps/form/src/assets/images/icon-maps.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/steps/form/src/assets/images/icon-phone.svg b/steps/form/src/assets/images/icon-phone.svg new file mode 100644 index 00000000..15ac4a3e --- /dev/null +++ b/steps/form/src/assets/images/icon-phone.svg @@ -0,0 +1 @@ + diff --git a/steps/form/src/assets/images/logo-sfeir.svg b/steps/form/src/assets/images/logo-sfeir.svg new file mode 100644 index 00000000..9d6e4c3e --- /dev/null +++ b/steps/form/src/assets/images/logo-sfeir.svg @@ -0,0 +1,18 @@ + + + + + + + + + diff --git a/steps/form/src/assets/images/search-icon.svg b/steps/form/src/assets/images/search-icon.svg new file mode 100644 index 00000000..92e95a18 --- /dev/null +++ b/steps/form/src/assets/images/search-icon.svg @@ -0,0 +1,16 @@ + + + + + + + diff --git a/steps/form/src/environments/environment.prod.ts b/steps/form/src/environments/environment.prod.ts new file mode 100644 index 00000000..f2259a71 --- /dev/null +++ b/steps/form/src/environments/environment.prod.ts @@ -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' + } + } +}; diff --git a/steps/form/src/environments/environment.ts b/steps/form/src/environments/environment.ts new file mode 100644 index 00000000..a47a8518 --- /dev/null +++ b/steps/form/src/environments/environment.ts @@ -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' + } + } +}; diff --git a/steps/form/src/favicon.ico b/steps/form/src/favicon.ico new file mode 100644 index 00000000..8081c7ce Binary files /dev/null and b/steps/form/src/favicon.ico differ diff --git a/steps/form/src/index.html b/steps/form/src/index.html new file mode 100644 index 00000000..8ddebe30 --- /dev/null +++ b/steps/form/src/index.html @@ -0,0 +1,21 @@ + + + + + Angular2200 + + + + + + + + +
+ + + +
+
+ + diff --git a/steps/form/src/main.ts b/steps/form/src/main.ts new file mode 100644 index 00000000..c7b673cf --- /dev/null +++ b/steps/form/src/main.ts @@ -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)); diff --git a/steps/form/src/polyfills.ts b/steps/form/src/polyfills.ts new file mode 100644 index 00000000..ee8b84da --- /dev/null +++ b/steps/form/src/polyfills.ts @@ -0,0 +1,80 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; + +/** + * If the application will be indexed by Google Search, the following is required. + * Googlebot uses a renderer based on Chrome 41. + * https://developers.google.com/search/docs/guides/rendering + **/ +// import 'core-js/es6/array'; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** IE10 and IE11 requires the following for the Reflect API. */ +// import 'core-js/es6/reflect'; + +/** + * Web Animations `@angular/platform-browser/animations` + * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. + * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + */ + + // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + + /* + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + */ +// (window as any).__Zone_enable_cross_context_check = true; + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/steps/form/src/styles.css b/steps/form/src/styles.css new file mode 100644 index 00000000..15465c56 --- /dev/null +++ b/steps/form/src/styles.css @@ -0,0 +1,101 @@ +@import "~@angular/material/prebuilt-themes/indigo-pink.css"; + +body { + background: red; + padding: 0; + margin: 0; + font-family: 'Open Sans', sans-serif; + background-color: #FAFAFA; + -webkit-font-smoothing: antialiased; +} +* /deep/ * { + font-family: inherit; + font-size: 14px; + line-height: 1.42857143; + color: inherit; +} +h1, * /deep/ h1 { + font-size: 36px; + margin-top: 20px; + margin-bottom: 10px; +} + +button[mat-fab], a[mat-fab] { + position: fixed; + bottom: 20px; + right: 20px; +} + +[mat-fab] mat-icon { + font-size: 2em; + line-height: 18.6px; +} + +.loader { + position: relative; + margin: 0 auto; + width: 100px; + transform: scale(1.5); +} +.loader:before { + content: ''; + display: block; + padding-top: 100%; +} + +.circular { + animation: rotate 2s linear infinite; + height: 100%; + transform-origin: center center; + width: 100%; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: auto; +} + +.path { + stroke-dasharray: 1, 200; + stroke-dashoffset: 0; + animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite; + stroke-linecap: round; +} + +@keyframes rotate { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +@keyframes dash { + 0% { + stroke-dasharray: 1, 200; + stroke-dashoffset: 0; + } + 50% { + stroke-dasharray: 89, 200; + stroke-dashoffset: -35px; + } + 100% { + stroke-dasharray: 89, 200; + stroke-dashoffset: -124px; + } +} +@keyframes color { + 100%, + 0% { + stroke: #d62d20; + } + 40% { + stroke: #0057e7; + } + 66% { + stroke: #008744; + } + 80%, + 90% { + stroke: #ffa700; + } +} diff --git a/steps/form/tsconfig.app.json b/steps/form/tsconfig.app.json new file mode 100644 index 00000000..bb16c46a --- /dev/null +++ b/steps/form/tsconfig.app.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/app", + "types": [] + }, + "exclude": [ + "test.ts", + "**/*.spec.ts" + ] +}