Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monobranch - steps 14 to 21 #103

Merged
merged 24 commits into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
491c0fe
feat(form-validation): create project from branch step-14
nlm-pro Nov 26, 2018
075676a
feat(form-validation-solution): create project from branch step-14-so…
nlm-pro Nov 26, 2018
67d7080
feat(form-model-driven): create project from branch step-15
nlm-pro Nov 26, 2018
de5869b
feat(form-model-driven-solution): create project from branch step-15-…
nlm-pro Nov 26, 2018
eab265e
feat(form-custom-validator): create project from branch step-16
nlm-pro Nov 26, 2018
16bba3f
feat(form-custom-validator-solution): create project from branch step…
nlm-pro Nov 26, 2018
90136db
feat(service): create project from branch step-17
nlm-pro Nov 26, 2018
70ea51a
feat(service-solution): create project from branch step-17-solution
nlm-pro Nov 26, 2018
9e8f08a
fix(service): bad import
nlm-pro Nov 26, 2018
d95ae9d
feat(pipe): create project from branch step-18
nlm-pro Nov 26, 2018
072db0b
feat(pipe-solution): create project from branch step-18-solution
nlm-pro Nov 26, 2018
8ba41d7
fix(pipe): bad import
nlm-pro Nov 26, 2018
47b2639
feat(pipe-b): create project from branch step-19
nlm-pro Nov 26, 2018
d885174
feat(pipe-b-solution): create project from branch step-19-solution
nlm-pro Nov 26, 2018
e2c7306
fix(pipe-b): bad import
nlm-pro Nov 26, 2018
dae2033
feat(directive-use): create project from branch step-20
nlm-pro Nov 26, 2018
f553d1a
feat(directive-use-solution): create project from branch step-20-solu…
nlm-pro Nov 26, 2018
9be8c13
fix(directive-use): bad import
nlm-pro Nov 26, 2018
93d2664
feat(directive-create): create project from branch step-21
nlm-pro Nov 26, 2018
52d8a92
feat(directive-create-solution): create project from branch step-21-s…
nlm-pro Nov 26, 2018
5969995
fix(directive-create): bad import
nlm-pro Nov 26, 2018
499caf4
fix: replace Angular2 by Angular in remaining titles
nlm-pro Nov 26, 2018
48f73fb
refactor: use rxjs-tslint
nlm-pro Nov 26, 2018
4220154
build: remove rxjs-compat
nlm-pro Nov 26, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,586 changes: 1,585 additions & 1 deletion angular.json

Large diffs are not rendered by default.

33 changes: 7 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"express": "4.16.4",
"hammerjs": "2.0.8",
"rxjs": "6.3.3",
"rxjs-compat": "6.3.3",
"underscore": "1.9.1",
"zone.js": "~0.8.26"
},
Expand Down
11 changes: 11 additions & 0 deletions steps/directive-create-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/directive-create-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, 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;
}
11 changes: 11 additions & 0 deletions steps/directive-create-solution/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<mat-toolbar class="extend-toolbar">
<span>
<a [routerLink]="['/']"> <img src="assets/images/logo-sfeir.svg" aria-label="sfeir" alt="Sfeir" /> </a>
</span>

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

<span> <a href="javascript:void(0);">Maps</a> <a [routerLink]="['/people']">List</a> </span>
</mat-toolbar>

<router-outlet></router-outlet>
10 changes: 10 additions & 0 deletions steps/directive-create-solution/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -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() {}
}
67 changes: 67 additions & 0 deletions steps/directive-create-solution/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// CORE DEPS
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { ReactiveFormsModule } from '@angular/forms';
// 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 './people/add-dialog/add-dialog.component';
import { FormComponent } from './shared/form';
import { UpdateComponent } from './update/update.component';
import { PeopleService } from './shared/people-service';
import { NaPipe } from './shared/na-pipe';
import { SfeirBadgeDirective } from './shared/badge';

@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
MatToolbarModule,
MatCardModule,
MatTabsModule,
MatButtonModule,
MatInputModule,
MatCheckboxModule,
MatRadioModule,
MatIconModule,
MatListModule,
MatDialogModule,
APP_ROUTES,
HttpClientModule,
ReactiveFormsModule
],
declarations: [
PeopleAppComponent,
HomeComponent,
PeopleComponent,
CardComponent,
AddDialogComponent,
FormComponent,
UpdateComponent,
NaPipe,
SfeirBadgeDirective
],
entryComponents: [AddDialogComponent],
providers: [HttpClient, PeopleService],
bootstrap: [PeopleAppComponent]
})
export class AppModule {}
15 changes: 15 additions & 0 deletions steps/directive-create-solution/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { RouterModule, Routes } from '@angular/router';

// APP COMPONENTS
import { HomeComponent } from './home/index';
import { PeopleComponent } from './people/index';
import { UpdateComponent } from './update/index';

const ROUTES: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: 'people', component: PeopleComponent },
{ path: 'edit/:id', component: UpdateComponent }
];

export const APP_ROUTES = RouterModule.forRoot(ROUTES, { useHash: true });
10 changes: 10 additions & 0 deletions steps/directive-create-solution/src/app/home/home.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
h1 {
text-align: center;
}

section {
display: flex;
flex-flow: row wrap;
align-items: center;
justify-content: center;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<section><sfeir-card [person]="person" (personDelete)="random()"></sfeir-card></section>

<button mat-fab (click)="random()"><i class="material-icons">autorenew</i></button>
30 changes: 30 additions & 0 deletions steps/directive-create-solution/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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));
}
}
1 change: 1 addition & 0 deletions steps/directive-create-solution/src/app/home/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './home.component';
2 changes: 2 additions & 0 deletions steps/directive-create-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';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<sfeir-form (submit)="onSave($event)" (cancel)="onCancel()"></sfeir-form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { AddDialogComponent } from './add-dialog.component';

describe('AddDialogComponent', () => {
let component: AddDialogComponent;
let fixture: ComponentFixture<AddDialogComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [AddDialogComponent]
}).compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(AddDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading