-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pmp-web): single user statistics component init with mocked data
- Loading branch information
1 parent
507b59b
commit 12023d1
Showing
12 changed files
with
183 additions
and
2 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
4 changes: 3 additions & 1 deletion
4
libs/pmp-web/user/shell/src/lib/containers/user/user.component.html
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,5 +1,7 @@ | ||
<div class="user-component__container"> | ||
<pmp-navbar class="navbar"></pmp-navbar> | ||
<pmp-sidebar class="sidebar"></pmp-sidebar> | ||
<router-outlet></router-outlet> | ||
<div class="router-outlet__wrapper"> | ||
<router-outlet></router-outlet> | ||
</div> | ||
</div> |
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
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 +1 @@ | ||
export * from './lib/pmp-web-user-single-user-statistics-feature'; | ||
export * from './lib/pmp-web-user-single-user-statistics-feature.module'; |
5 changes: 5 additions & 0 deletions
5
...s/feature/src/lib/containers/single-user-statistics/single-user-statistics.component.html
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,5 @@ | ||
<div class="user-statistics"> | ||
<div *ngFor="let repo of mockedData"> | ||
{{ repo.repository.name }} | ||
</div> | ||
</div> |
7 changes: 7 additions & 0 deletions
7
...s/feature/src/lib/containers/single-user-statistics/single-user-statistics.component.scss
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,7 @@ | ||
:host { | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} |
24 changes: 24 additions & 0 deletions
24
...eature/src/lib/containers/single-user-statistics/single-user-statistics.component.spec.ts
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,24 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { SingleUserStatisticsComponent } from './single-user-statistics.component'; | ||
|
||
describe('SingleUserStatisticsComponent', () => { | ||
let component: SingleUserStatisticsComponent; | ||
let fixture: ComponentFixture<SingleUserStatisticsComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [SingleUserStatisticsComponent] | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(SingleUserStatisticsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
101 changes: 101 additions & 0 deletions
101
...ics/feature/src/lib/containers/single-user-statistics/single-user-statistics.component.ts
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,101 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { first } from 'rxjs/operators'; | ||
|
||
const mockedData = [ | ||
{ | ||
repository: { name: 'java', picture: '' }, | ||
data: [ | ||
{ | ||
title: 'crud users', | ||
id: '#1', | ||
waitingTime: '35 hours', | ||
codeLines: 540, | ||
author: { name: 'Filip Chajzer', picture: '' }, | ||
comments: [] | ||
}, | ||
{ | ||
title: 'crud comments', | ||
id: '#3', | ||
waitingTime: '28 hours', | ||
codeLines: 20, | ||
author: { name: 'Filip Chajzer', picture: '' }, | ||
comments: [] | ||
}, | ||
{ | ||
title: 'unit tests for users', | ||
id: '#4', | ||
waitingTime: '4 hours', | ||
codeLines: 145, | ||
author: { name: 'Filip Chajzer', picture: '' }, | ||
comments: [] | ||
}, | ||
{ | ||
title: 'unit tests for comments', | ||
id: '#5', | ||
waitingTime: '34 minutes', | ||
codeLines: 4, | ||
author: { name: 'Filip Chajzer', picture: '' }, | ||
comments: [] | ||
} | ||
] | ||
}, | ||
{ | ||
repository: { name: 'php', picture: '' }, | ||
data: [ | ||
{ | ||
title: 'crud users', | ||
id: '#1', | ||
waitingTime: '35 hours', | ||
codeLines: 540, | ||
author: { name: 'Filip Chajzer', picture: '' }, | ||
comments: [] | ||
}, | ||
{ | ||
title: 'crud comments', | ||
id: '#3', | ||
waitingTime: '28 hours', | ||
codeLines: 20, | ||
author: { name: 'Filip Chajzer', picture: '' }, | ||
comments: [] | ||
}, | ||
{ | ||
title: 'unit tests for users', | ||
id: '#4', | ||
waitingTime: '4 hours', | ||
codeLines: 145, | ||
author: { name: 'Filip Chajzer', picture: '' }, | ||
comments: [] | ||
}, | ||
{ | ||
title: 'unit tests for comments', | ||
id: '#5', | ||
waitingTime: '34 minutes', | ||
codeLines: 4, | ||
author: { name: 'Filip Chajzer', picture: '' }, | ||
comments: [] | ||
} | ||
] | ||
} | ||
]; | ||
|
||
@Component({ | ||
// tslint:disable-next-line:component-selector | ||
selector: 'pimp-my-pr-single-user-statistics', | ||
templateUrl: './single-user-statistics.component.html', | ||
styleUrls: ['./single-user-statistics.component.scss'] | ||
}) | ||
export class SingleUserStatisticsComponent implements OnInit { | ||
mockedData = mockedData; | ||
user: string | null; | ||
|
||
constructor(private route: ActivatedRoute) {} | ||
|
||
ngOnInit(): void { | ||
this.readRouteUserId(); | ||
} | ||
|
||
private readRouteUserId(): void { | ||
this.route.params.pipe(first()).subscribe(params => (this.user = params.id)); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...gle-user-statistics/feature/src/lib/pmp-web-user-single-user-statistics-feature.module.ts
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,10 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { PmpWebUserSingleUserStatisticsRoutingModule } from './pmp-web-user-single-user-statistics-routing.module'; | ||
import { SingleUserStatisticsComponent } from './containers/single-user-statistics/single-user-statistics.component'; | ||
|
||
@NgModule({ | ||
imports: [CommonModule, PmpWebUserSingleUserStatisticsRoutingModule], | ||
declarations: [SingleUserStatisticsComponent] | ||
}) | ||
export class PmpWebUserSingleUserStatisticsFeatureModule {} |
Empty file.
17 changes: 17 additions & 0 deletions
17
...gle-user-statistics/feature/src/lib/pmp-web-user-single-user-statistics-routing.module.ts
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,17 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
|
||
import { SingleUserStatisticsComponent } from './containers/single-user-statistics/single-user-statistics.component'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: ':id', | ||
component: SingleUserStatisticsComponent | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class PmpWebUserSingleUserStatisticsRoutingModule {} |