Skip to content

Commit 26ecd8a

Browse files
committed
Route animation.
1 parent 5d130f7 commit 26ecd8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1118
-843
lines changed

.vscode/settings.json

-2
This file was deleted.

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
install:
2+
yarn install
3+
4+
run:
5+
yarn start
6+
7+
deploy:

README.md

+13-44
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,22 @@
1-
# Frontend
1+
make install
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.2.1.
3+
make run
44

5-
## Development server
5+
make deploy
66

7-
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
7+
https://itnext.io/angular-animations-stagger-over-static-and-async-data-3907c4889479
8+
https://itnext.io/angular-animations-stagger-over-static-and-async-data-3907c4889479
9+
https://netbasal.com/creating-reusable-animations-in-angular-6a2350d6191a
810

9-
## Code scaffolding
11+
https://medium.com/@tanya/angular4-animated-route-transitions-b5b9667cd67c
12+
https://medium.freecodecamp.org/best-practices-for-a-clean-and-performant-angular-application-288e7b39eb6f
13+
https://tomastrajan.github.io/angular-ngrx-material-starter#/examples/stock-market https://medium.com/@asm/animated-slide-panel-with-angular-e985ad646f9 https://medium.com/google-developer-experts/angular-supercharge-your-router-transitions-using-new-animation-features-v4-3-3eb341ede6c8 https://stackblitz.com/edit/angular-motion-v6-c?file=app%2Fapp.module.ts
14+
https://stackblitz.com/edit/angular-child-route-animation?file=src%2Fapp%2Fanimations%2Frouter.animation.ts
1015

11-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
16+
toast HttpErroHandling Error handling dockerfile makefile
1217

13-
## Build
18+
aspnetcore-bootstrap users
1419

15-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
20+
ambiente-bootstrap aws kube api-gateway https://aws.amazon.com/pt/blogs/aws-brasil/autenticacao-e-controle-de-sessao-no-api-gateway-com-lambda-e-jwt/
1621

17-
## Running unit tests
18-
19-
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20-
21-
## Running end-to-end tests
22-
23-
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24-
25-
## Further help
26-
27-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
28-
29-
users page
30-
componente de filtro passando emitindo dictionary
31-
componente de lista recebendo dictonary
32-
componente de adicao
33-
componente de alteracao
34-
rota de alteracao direta no registro
35-
componente de formulario
36-
sessionstorage no http-backend-interceptor
37-
toast
38-
HttpErroHandling
39-
Error handling
40-
ui.module igual ao core.module
41-
dockerfile
42-
makefile
43-
44-
aspnetcore-bootstrap
45-
users
46-
47-
ambiente-bootstrap
48-
aws
49-
kube
50-
api-gateway
51-
https://aws.amazon.com/pt/blogs/aws-brasil/autenticacao-e-controle-de-sessao-no-api-gateway-com-lambda-e-jwt/
52-
5322
ci no github atraves do azure pipelines

angular.json

+16-12
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@
33
"version": 1,
44
"newProjectRoot": "projects",
55
"projects": {
6-
"frontend": {
6+
"angular-bootstrap": {
77
"root": "",
88
"sourceRoot": "src",
99
"projectType": "application",
1010
"prefix": "app",
11-
"schematics": {},
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"styleext": "scss"
14+
}
15+
},
1216
"targets": {
1317
"build": {
1418
"builder": "@angular-devkit/build-angular:browser",
1519
"options": {
16-
"outputPath": "dist/frontend",
20+
"outputPath": "dist/angular-bootstrap",
1721
"index": "src/index.html",
1822
"main": "src/main.ts",
1923
"polyfills": "src/polyfills.ts",
@@ -23,7 +27,7 @@
2327
"src/assets"
2428
],
2529
"styles": [
26-
"src/styles.css"
30+
"src/styles.scss"
2731
],
2832
"scripts": []
2933
},
@@ -50,18 +54,18 @@
5054
"serve": {
5155
"builder": "@angular-devkit/build-angular:dev-server",
5256
"options": {
53-
"browserTarget": "frontend:build"
57+
"browserTarget": "angular-bootstrap:build"
5458
},
5559
"configurations": {
5660
"production": {
57-
"browserTarget": "frontend:build:production"
61+
"browserTarget": "angular-bootstrap:build:production"
5862
}
5963
}
6064
},
6165
"extract-i18n": {
6266
"builder": "@angular-devkit/build-angular:extract-i18n",
6367
"options": {
64-
"browserTarget": "frontend:build"
68+
"browserTarget": "angular-bootstrap:build"
6569
}
6670
},
6771
"test": {
@@ -72,7 +76,7 @@
7276
"tsConfig": "src/tsconfig.spec.json",
7377
"karmaConfig": "src/karma.conf.js",
7478
"styles": [
75-
"src/styles.css"
79+
"src/styles.scss"
7680
],
7781
"scripts": [],
7882
"assets": [
@@ -95,19 +99,19 @@
9599
}
96100
}
97101
},
98-
"frontend-e2e": {
102+
"angular-bootstrap-e2e": {
99103
"root": "e2e/",
100104
"projectType": "application",
101105
"targets": {
102106
"e2e": {
103107
"builder": "@angular-devkit/build-angular:protractor",
104108
"options": {
105109
"protractorConfig": "e2e/protractor.conf.js",
106-
"devServerTarget": "frontend:serve"
110+
"devServerTarget": "angular-bootstrap:serve"
107111
},
108112
"configurations": {
109113
"production": {
110-
"devServerTarget": "frontend:serve:production"
114+
"devServerTarget": "angular-bootstrap:serve:production"
111115
}
112116
}
113117
},
@@ -123,5 +127,5 @@
123127
}
124128
}
125129
},
126-
"defaultProject": "frontend"
130+
"defaultProject": "angular-bootstrap"
127131
}

e2e/src/app.e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ describe('workspace-project App', () => {
99

1010
it('should display welcome message', () => {
1111
page.navigateTo();
12-
expect(page.getParagraphText()).toEqual('Welcome to frontend!');
12+
expect(page.getParagraphText()).toEqual('Welcome to angular-bootstrap!');
1313
});
1414
});

package.json

+13-11
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@
1111
},
1212
"private": true,
1313
"dependencies": {
14-
"@angular/animations": "^6.1.0",
15-
"@angular/common": "^6.1.0",
16-
"@angular/compiler": "^6.1.0",
17-
"@angular/core": "^6.1.0",
18-
"@angular/forms": "^6.1.0",
19-
"@angular/http": "^6.1.0",
20-
"@angular/platform-browser": "^6.1.0",
21-
"@angular/platform-browser-dynamic": "^6.1.0",
22-
"@angular/router": "^6.1.0",
14+
"@angular/animations": "^6.1.8",
15+
"@angular/common": "^6.1.8",
16+
"@angular/compiler": "^6.1.8",
17+
"@angular/core": "^6.1.8",
18+
"@angular/forms": "^6.1.8",
19+
"@angular/http": "^6.1.8",
20+
"@angular/platform-browser": "^6.1.8",
21+
"@angular/platform-browser-dynamic": "^6.1.8",
22+
"@angular/router": "^6.1.8",
23+
"@fortawesome/angular-fontawesome": "^0.2.0",
24+
"@fortawesome/fontawesome-svg-core": "^1.2.4",
25+
"@fortawesome/free-solid-svg-icons": "^5.3.1",
2326
"bootstrap": "^4.1.3",
2427
"core-js": "^2.5.4",
25-
"font-awesome": "^4.7.0",
2628
"rxjs": "~6.2.0",
2729
"zone.js": "~0.8.26"
2830
},
@@ -47,4 +49,4 @@
4749
"tslint": "~5.11.0",
4850
"typescript": "~2.9.2"
4951
}
50-
}
52+
}

src/app/app.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<app-layout>
2-
<router-outlet></router-outlet>
1+
<app-layout [@route-transition]="state(outlet)">
2+
<router-outlet #outlet="outlet"></router-outlet>
33
</app-layout>

src/app/app.component.scss

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
:host {
2+
/deep/ router-outlet ~ * {
3+
position: absolute;
4+
width: 100%;
5+
}
6+
}

src/app/app.component.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import { Component } from '@angular/core';
2+
import { RouterAnimation } from './modules/animations/route.animation';
23

34
@Component({
45
selector: 'app-root',
56
templateUrl: './app.component.html',
6-
styleUrls: ['./app.component.css']
7+
styleUrls: ['./app.component.scss'],
8+
animations: [ RouterAnimation ],
79
})
810
export class AppComponent {
911
title = 'frontend';
10-
}
12+
13+
state(outlet) {
14+
return outlet.isActivated ? outlet.activatedRoute : '';
15+
}
16+
}

src/app/app.module.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { BrowserModule } from '@angular/platform-browser';
22
import { NgModule } from '@angular/core';
33
import { Routes, RouterModule } from '@angular/router';
44
import { HttpClientModule } from '@angular/common/http';
5+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
56

67
import { AppComponent } from './app.component';
78

@@ -16,11 +17,18 @@ import { HomePageComponent } from './routes/home/home-page.component';
1617
export const appRoutes: Routes = [
1718
{
1819
path: 'identity',
19-
loadChildren: './routes/identity/identity.module#IdentityModule'
20+
loadChildren: './routes/identity/identity.module#IdentityModule',
21+
data: { state: 'identity' }
2022
},
2123
{
2224
path: 'dot',
23-
loadChildren: './routes/dot/dot.module#DotModule'
25+
loadChildren: './routes/dot/dot.module#DotModule',
26+
data: { state: 'dot' }
27+
},
28+
{
29+
path: 'users',
30+
loadChildren: './routes/users/users.module#UsersModule',
31+
data: { state: 'users' }
2432
},
2533
{ path: '', component: HomePageComponent },
2634
{ path: 'not-found', component: NotFoundComponent },
@@ -34,6 +42,7 @@ export const appRoutes: Routes = [
3442
],
3543
imports: [
3644
BrowserModule,
45+
BrowserAnimationsModule,
3746
HttpClientModule,
3847
UIModule,
3948
CoreModule.forRoot(),

src/app/domain/User.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
export class User {
2+
Name: String;
23
Email: String;
3-
Password: String;
4+
Document: String;
5+
Birthday: Date;
6+
Progress: Number;
47
}

src/app/modules/animations/list.animation.ts

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { trigger,animate, style, query, transition, keyframes } from '@angular/animations';
2+
3+
export const RouterAnimation = trigger('route-transition', [
4+
transition( '* => *', [
5+
query(':enter',
6+
[
7+
style({ opacity: 0 })
8+
],
9+
{ optional: true }
10+
),
11+
query(':leave',
12+
[
13+
style({ opacity: 1 }),
14+
animate('0.2s', style({ opacity: 0 }))
15+
],
16+
{ optional: true }
17+
),
18+
query(':enter',
19+
[
20+
style({ opacity: 0 }),
21+
animate(
22+
'0.2s 0s',
23+
keyframes([
24+
style({
25+
opacity: 0,
26+
transform: 'translate3d(0, -5%, 0)',
27+
offset: 0
28+
}),
29+
style({
30+
opacity: 1,
31+
transform: 'translate3d(0, 0, 0)',
32+
offset: 1
33+
})
34+
])
35+
)
36+
],
37+
{ optional: true }
38+
)
39+
])
40+
]);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import {trigger, animate, style, transition, state} from '@angular/animations';
2+
3+
export const SlidePanelAnimation = trigger('slide-transition', [
4+
state('left', style({
5+
transform: 'translateX(0)'
6+
})),
7+
state('right', style({
8+
transform: 'translateX(-50%)'
9+
})),
10+
transition('* => *', animate(300))
11+
])

src/app/modules/core/http-backend.interceptor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
22
import { HttpRequest, HttpResponse, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
33
import { Observable, of, throwError } from 'rxjs';
44
import { delay, mergeMap, materialize, dematerialize } from 'rxjs/operators';
5-
import { Jwt } from '../../domain/jwt';
5+
import { Jwt } from './../../domain/Jwt';
66

77
@Injectable()
88
export class HttpBackendInterceptor implements HttpInterceptor {

src/app/modules/ui/.ui.module.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { HeaderComponent } from './header.component';
77
import { FooterComponent } from './footer.component';
88
import { BreadcrumbComponent } from './breadcrumb.component';
99
import { NotFoundComponent } from './not-found.component';
10+
import { SlidePanelComponent } from './slide-panel.component';
1011

1112
@NgModule({
1213
imports: [
@@ -18,14 +19,16 @@ import { NotFoundComponent } from './not-found.component';
1819
HeaderComponent,
1920
FooterComponent,
2021
BreadcrumbComponent,
21-
NotFoundComponent
22+
NotFoundComponent,
23+
SlidePanelComponent
2224
],
2325
exports: [
2426
LayoutComponent,
2527
HeaderComponent,
2628
FooterComponent,
2729
BreadcrumbComponent,
28-
NotFoundComponent
30+
NotFoundComponent,
31+
SlidePanelComponent
2932
]
3033
})
3134
export class UIModule { }

0 commit comments

Comments
 (0)