Skip to content

Commit

Permalink
feat(pmp-web): shared navbar component
Browse files Browse the repository at this point in the history
  • Loading branch information
wjanaszek committed Dec 24, 2019
1 parent a0cec3b commit 394958d
Show file tree
Hide file tree
Showing 20 changed files with 230 additions and 61 deletions.
81 changes: 41 additions & 40 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
"polyfills": "apps/pmp-web/src/polyfills.ts",
"tsConfig": "apps/pmp-web/tsconfig.app.json",
"aot": false,
"assets": [
"apps/pmp-web/src/favicon.ico",
"apps/pmp-web/src/assets"
],
"assets": ["apps/pmp-web/src/favicon.ico", "apps/pmp-web/src/assets"],
"styles": ["apps/pmp-web/src/styles.scss"],
"scripts": []
},
Expand Down Expand Up @@ -82,10 +79,7 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"apps/pmp-web/tsconfig.app.json",
"apps/pmp-web/tsconfig.spec.json"
],
"tsConfig": ["apps/pmp-web/tsconfig.app.json", "apps/pmp-web/tsconfig.spec.json"],
"exclude": ["**/node_modules/**", "!apps/pmp-web/**"]
}
},
Expand Down Expand Up @@ -164,10 +158,7 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"apps/pmp-api/tsconfig.app.json",
"apps/pmp-api/tsconfig.spec.json"
],
"tsConfig": ["apps/pmp-api/tsconfig.app.json", "apps/pmp-api/tsconfig.spec.json"],
"exclude": ["**/node_modules/**", "!apps/pmp-api/**"]
}
},
Expand Down Expand Up @@ -224,10 +215,7 @@
"libs/pmp-api/api-service/repository/api/tsconfig.lib.json",
"libs/pmp-api/api-service/repository/api/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"!libs/pmp-api/api-service/repository/api/**"
]
"exclude": ["**/node_modules/**", "!libs/pmp-api/api-service/repository/api/**"]
}
},
"test": {
Expand All @@ -252,10 +240,7 @@
"libs/pmp-api/api-service/shell/tsconfig.lib.json",
"libs/pmp-api/api-service/shell/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"!libs/pmp-api/api-service/shell/**"
]
"exclude": ["**/node_modules/**", "!libs/pmp-api/api-service/shell/**"]
}
},
"test": {
Expand All @@ -280,10 +265,7 @@
"libs/pmp-api/api-service/repository/core/tsconfig.lib.json",
"libs/pmp-api/api-service/repository/core/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"!libs/pmp-api/api-service/repository/core/**"
]
"exclude": ["**/node_modules/**", "!libs/pmp-api/api-service/repository/core/**"]
}
},
"test": {
Expand All @@ -308,10 +290,7 @@
"libs/pmp-api/api-service/repository/data-access/tsconfig.lib.json",
"libs/pmp-api/api-service/repository/data-access/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"!libs/pmp-api/api-service/repository/data-access/**"
]
"exclude": ["**/node_modules/**", "!libs/pmp-api/api-service/repository/data-access/**"]
}
},
"test": {
Expand All @@ -336,10 +315,7 @@
"libs/pmp-api/api-service/repository/domain/tsconfig.lib.json",
"libs/pmp-api/api-service/repository/domain/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"!libs/pmp-api/api-service/repository/domain/**"
]
"exclude": ["**/node_modules/**", "!libs/pmp-api/api-service/repository/domain/**"]
}
},
"test": {
Expand Down Expand Up @@ -464,10 +440,7 @@
"libs/pmp-web/repository/users/shell/tsconfig.lib.json",
"libs/pmp-web/repository/users/shell/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"!libs/pmp-web/repository/users/shell/**"
]
"exclude": ["**/node_modules/**", "!libs/pmp-web/repository/users/shell/**"]
}
},
"test": {
Expand Down Expand Up @@ -498,10 +471,7 @@
"libs/pmp-web/repository/shell/tsconfig.lib.json",
"libs/pmp-web/repository/shell/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"!libs/pmp-web/repository/shell/**"
]
"exclude": ["**/node_modules/**", "!libs/pmp-web/repository/shell/**"]
}
},
"test": {
Expand All @@ -518,6 +488,37 @@
"styleext": "scss"
}
}
},
"pmp-web-shared-ui-navbar": {
"projectType": "library",
"root": "libs/pmp-web/shared/ui/navbar",
"sourceRoot": "libs/pmp-web/shared/ui/navbar/src",
"prefix": "pimp-my-pr",
"architect": {
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/pmp-web/shared/ui/navbar/tsconfig.lib.json",
"libs/pmp-web/shared/ui/navbar/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**", "!libs/pmp-web/shared/ui/navbar/**"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/pmp-web/shared/ui/navbar/jest.config.js",
"tsConfig": "libs/pmp-web/shared/ui/navbar/tsconfig.spec.json",
"setupFile": "libs/pmp-web/shared/ui/navbar/src/test-setup.ts"
}
}
},
"schematics": {
"@nrwl/angular:component": {
"styleext": "scss"
}
}
}
},
"cli": {
Expand Down
4 changes: 2 additions & 2 deletions libs/pmp-web/repository/shell/tslint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../../../tslint.json",
"rules": {
"directive-selector": [true, "attribute", "pimpMyPr", "camelCase"],
"component-selector": [true, "element", "pimp-my-pr", "kebab-case"]
"directive-selector": [true, "attribute", "pmp", "camelCase"],
"component-selector": [true, "element", "pmp", "kebab-case"]
}
}
4 changes: 2 additions & 2 deletions libs/pmp-web/repository/users/shell/tslint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../../../../tslint.json",
"rules": {
"directive-selector": [true, "attribute", "pimpMyPr", "camelCase"],
"component-selector": [true, "element", "pimp-my-pr", "kebab-case"]
"directive-selector": [true, "attribute", "pmp", "camelCase"],
"component-selector": [true, "element", "pmp", "kebab-case"]
}
}
7 changes: 7 additions & 0 deletions libs/pmp-web/shared/ui/navbar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# pmp-web-shared-ui-navbar

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test pmp-web-shared-ui-navbar` to execute the unit tests.
9 changes: 9 additions & 0 deletions libs/pmp-web/shared/ui/navbar/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
name: 'pmp-web-shared-ui-navbar',
preset: '../../../../../jest.config.js',
coverageDirectory: '../../../../../coverage/libs/pmp-web/shared/ui/navbar',
snapshotSerializers: [
'jest-preset-angular/AngularSnapshotSerializer.js',
'jest-preset-angular/HTMLCommentSerializer.js'
]
};
1 change: 1 addition & 0 deletions libs/pmp-web/shared/ui/navbar/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/pmp-web-shared-ui-navbar.module';
12 changes: 12 additions & 0 deletions libs/pmp-web/shared/ui/navbar/src/lib/navbar.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="navbar__container">
<div class="navbar__title">
<span>
pull request analyzer
</span>
</div>
<div class="navbar__user-info">
<div class="navbar__empty-line"></div>
<span>{{ 'Essie Vasquez' }}</span>
<mat-icon>input</mat-icon>
</div>
</div>
40 changes: 40 additions & 0 deletions libs/pmp-web/shared/ui/navbar/src/lib/navbar.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.navbar__container {
background: #17304e;
color: #ffffff;
font-family: 'Roboto', sans-serif;

display: flex;
justify-content: space-between;
padding: 16px;
}

.navbar__title {
text-transform: uppercase;
font-size: 20px;

display: flex;
align-items: center;
}

.navbar__user-info {
display: flex;

span {
display: flex;
align-items: center;
margin: 0 40px 0 20px;
}

mat-icon {
width: 32px;
height: 32px;
font-size: 32px;
}
}

.navbar__empty-line {
width: 32px;
height: 32px;
background: gray;
border-radius: 50%;
}
26 changes: 26 additions & 0 deletions libs/pmp-web/shared/ui/navbar/src/lib/navbar.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { NavbarComponent } from './navbar.component';
import { MatIconModule } from '@angular/material';

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

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [NavbarComponent],
imports: [MatIconModule]
}).compileComponents();
}));

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
9 changes: 9 additions & 0 deletions libs/pmp-web/shared/ui/navbar/src/lib/navbar.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
selector: 'pmp-shared-ui-navbar',
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class NavbarComponent {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { async, TestBed } from '@angular/core/testing';
import { PmpWebSharedUiNavbarModule } from './pmp-web-shared-ui-navbar.module';

describe('PmpWebSharedUiNavbarModule', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [PmpWebSharedUiNavbarModule]
}).compileComponents();
}));

it('should create', () => {
expect(PmpWebSharedUiNavbarModule).toBeDefined();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NavbarComponent } from './navbar.component';
import { MatIconModule } from '@angular/material';

@NgModule({
imports: [CommonModule, MatIconModule],
declarations: [NavbarComponent],
exports: [NavbarComponent]
})
export class PmpWebSharedUiNavbarModule {}
1 change: 1 addition & 0 deletions libs/pmp-web/shared/ui/navbar/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'jest-preset-angular';
7 changes: 7 additions & 0 deletions libs/pmp-web/shared/ui/navbar/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../../../../tsconfig.json",
"compilerOptions": {
"types": ["node", "jest"]
},
"include": ["**/*.ts"]
}
20 changes: 20 additions & 0 deletions libs/pmp-web/shared/ui/navbar/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../../../../dist/out-tsc",
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
},
"exclude": ["src/test-setup.ts", "**/*.spec.ts"]
}
10 changes: 10 additions & 0 deletions libs/pmp-web/shared/ui/navbar/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../../../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}
7 changes: 7 additions & 0 deletions libs/pmp-web/shared/ui/navbar/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../../../../tslint.json",
"rules": {
"directive-selector": [true, "attribute", "pmp", "camelCase"],
"component-selector": [true, "element", "pmp", "kebab-case"]
}
}
4 changes: 2 additions & 2 deletions libs/pmp-web/shell/tslint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../../tslint.json",
"rules": {
"directive-selector": [true, "attribute", "pimpMyPr", "camelCase"],
"component-selector": [true, "element", "pimp-my-pr", "kebab-case"]
"directive-selector": [true, "attribute", "pmp", "camelCase"],
"component-selector": [true, "element", "pmp", "kebab-case"]
}
}
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
},
"pmp-web-repository-shell": {
"tags": ["scope:pmp-web-repository", "type:shell"]
},
"pmp-web-shared-ui-navbar": {
"tags": ["scope:pmp-web", "type:ui"]
}
}
}
Loading

0 comments on commit 394958d

Please sign in to comment.