diff --git a/.travis.yml b/.travis.yml index f58dbf6..27da11b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,4 +22,5 @@ before_install: - sudo apt-get install -y libappindicator1 fonts-liberation - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - sudo dpkg -i google-chrome*.deb - +after_success: + - npm run coveralls diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..41ed062 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM node:8.4 + +ENV HOME=/home/app +WORKDIR $HOME + +COPY package.json package.json +COPY package-lock.json package-lock.json + +RUN npm install + +COPY tsconfig.json tsconfig.json +COPY tslint.json tslint.json +COPY protractor.conf.js protractor.conf.js +COPY karma.conf.js karma.conf.js +COPY .angular-cli.json .angular-cli.json + +COPY e2e e2e +COPY src src + +EXPOSE 4200:4200 + +ENTRYPOINT ["npm", "start", "--"] diff --git a/README.md b/README.md index a74deb8..4c2f777 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # AngularFrontend -Master-Branch: [![Build Status](https://travis-ci.org/BPChain/angular-frontend.svg?branch=master)](https://travis-ci.org/BPChain/angular-frontend) -Dev-Branch: [![Build Status](https://travis-ci.org/BPChain/angular-frontend.svg?branch=dev)](https://travis-ci.org/BPChain/angular-frontend) +Master-Branch: [![Build Status](https://travis-ci.org/BPChain/angular-frontend.svg?branch=master)](https://travis-ci.org/BPChain/angular-frontend) [![Coverage Status](https://coveralls.io/repos/github/BPChain/angular-frontend/badge.svg?branch=master)](https://coveralls.io/github/BPChain/angular-frontend?branch=master)
+Dev-Branch: [![Build Status](https://travis-ci.org/BPChain/angular-frontend.svg?branch=dev)](https://travis-ci.org/BPChain/angular-frontend) [![Coverage Status](https://coveralls.io/repos/github/BPChain/angular-frontend/badge.svg?branch=dev)](https://coveralls.io/github/BPChain/angular-frontend?branch=dev)
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.4. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..91b331a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: "3.3" +services: + angular-frontend: + build: . + container_name: angular-frontend + ports: + - "4200:4200" diff --git a/karma.conf.js b/karma.conf.js index 8893c95..7cbbd87 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -22,6 +22,7 @@ module.exports = function (config) { angularCli: { environment: 'dev' }, + exclude: ['docker-compose.yml', 'Dockerfile'], reporters: ['progress', 'kjhtml'], port: 9876, colors: true, diff --git a/package-lock.json b/package-lock.json index 4c60841..18b1bf1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1707,6 +1707,19 @@ "require-from-string": "1.2.1" } }, + "coveralls": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.0.tgz", + "integrity": "sha512-ZppXR9y5PraUOrf/DzHJY6gzNUhXYE3b9D43xEXs4QYZ7/Oe0Gy0CS+IPKWFfvQFXB3RG9QduaQUFehzSpGAFw==", + "dev": true, + "requires": { + "js-yaml": "3.7.0", + "lcov-parse": "0.0.10", + "log-driver": "1.2.5", + "minimist": "1.2.0", + "request": "2.81.0" + } + }, "create-ecdh": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", @@ -5544,6 +5557,12 @@ "invert-kv": "1.0.0" } }, + "lcov-parse": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", + "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", + "dev": true + }, "less": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/less/-/less-2.7.3.tgz", @@ -5692,6 +5711,12 @@ "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", "dev": true }, + "log-driver": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", + "integrity": "sha1-euTsJXMC/XkNVXyxDJcQDYV7AFY=", + "dev": true + }, "log4js": { "version": "0.6.38", "resolved": "https://registry.npmjs.org/log4js/-/log4js-0.6.38.tgz", diff --git a/package.json b/package.json index 5aee2be..6209932 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,12 @@ "license": "MIT", "scripts": { "ng": "ng", - "start": "ng serve", + "start": "ng serve --host=0.0.0.0 --port=4200 --disable-host-check", "build": "ng build", - "test": "ng test", + "test": "npm run lint && ng test --code-cover", "lint": "ng lint", - "e2e": "ng e2e" + "e2e": "ng e2e", + "coveralls": "cat ./coverage/lcov.info | coveralls && rm -rf ./coverage" }, "private": true, "dependencies": { @@ -38,6 +39,7 @@ "@types/jasminewd2": "~2.0.2", "@types/node": "^6.0.96", "codelyzer": "^4.0.1", + "coveralls": "^3.0.0", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", diff --git a/src/app/app-material.module.ts b/src/app/app-material.module.ts new file mode 100644 index 0000000..7e40862 --- /dev/null +++ b/src/app/app-material.module.ts @@ -0,0 +1,42 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { + MatButtonModule, MatCardModule, MatCheckboxModule, MatDatepickerModule, MatFormFieldModule, MatIconModule, + MatInputModule, + MatNativeDateModule, MatSelectModule, MatSnackBarModule, + MatToolbarModule +} from '@angular/material'; +import {FlexLayoutModule} from '@angular/flex-layout'; + +@NgModule({ + imports: [ + CommonModule, + FlexLayoutModule, + MatToolbarModule, + MatButtonModule, + MatIconModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatNativeDateModule, + MatFormFieldModule, + MatInputModule, + MatSnackBarModule, + MatSelectModule, + ], + exports: [ + FlexLayoutModule, + MatToolbarModule, + MatButtonModule, + MatIconModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatNativeDateModule, + MatFormFieldModule, + MatInputModule, + MatSnackBarModule, + MatSelectModule, + ], +}) +export class AppMaterialModule { } diff --git a/src/app/app-routing-module.ts b/src/app/app-routing-module.ts new file mode 100644 index 0000000..40ba6ba --- /dev/null +++ b/src/app/app-routing-module.ts @@ -0,0 +1,26 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterModule } from '@angular/router'; + +import { NotFoundComponent } from './not-found/not-found.component'; +import {DashboardComponent} from './dashboard/dashboard.component'; +import {ImpressumComponent} from './impressum/impressum.component'; + +export const appRoutes = [ + { path: 'impressum', component: ImpressumComponent }, + { path: 'dashboard', component: DashboardComponent }, + { path: '', pathMatch: 'full', redirectTo: '/dashboard' }, + { path: '**', component: NotFoundComponent } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forRoot(appRoutes) + ], + declarations: [], + exports: [ + RouterModule + ] +}) +export class AppRoutingModule { } diff --git a/src/app/app.component.html b/src/app/app.component.html index 4d105e8..44314b4 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,7 +1,7 @@
- +