Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.
Merged

Dev #15

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
328bf3c
Refactor table
svitlanakalancha Jan 9, 2018
8cd6177
Change environment to BPT Lab
svitlanakalancha Jan 9, 2018
b65c35d
Add coveralls
Jan 10, 2018
86fd81d
Update travis.yml and package.json
Jan 10, 2018
8580642
Add coveralls badge to readme
fyndalf Jan 10, 2018
e8ff09a
Fix code style
feram-bot Jan 10, 2018
e25c25d
Add timespan setting to the linechart
svitlanakalancha Jan 10, 2018
888ff4d
Fix test error
svitlanakalancha Jan 10, 2018
a106f22
Import RouterModule
bisbaldi Jan 9, 2018
a6583b6
Add routing module
bisbaldi Jan 9, 2018
2df838c
Add landing component
bisbaldi Jan 9, 2018
88c5de3
Add not found component
bisbaldi Jan 9, 2018
21aa075
Define appRoutes
bisbaldi Jan 9, 2018
7654d83
Add dashboard module
bisbaldi Jan 9, 2018
e58c206
Add landing link to header
bisbaldi Jan 9, 2018
fca6364
Style landing page
bisbaldi Jan 9, 2018
abe6ead
Hide form and table once data to show is selected
bisbaldi Jan 9, 2018
e98d8ea
Add not found component
bisbaldi Jan 9, 2018
9207d02
Remove landing component
bisbaldi Jan 10, 2018
14b9aed
Add impressum component
bisbaldi Jan 10, 2018
28c36bf
Add impressum button
bisbaldi Jan 10, 2018
342d83a
Add update data button
bisbaldi Jan 10, 2018
c38b147
Include first draft of 404 page
bisbaldi Jan 10, 2018
199163a
Include customs element schema in not-found test
bisbaldi Jan 10, 2018
00ababa
Fix code style
feram-bot Jan 10, 2018
c6b2670
Create validation to data convertation
svitlanakalancha Jan 10, 2018
39e132b
Update max values for barcharts
bisbaldi Jan 10, 2018
84f6b95
Update query to include only 100 items
bisbaldi Jan 15, 2018
b3c5055
Remove helper arrays and frontend limitation to 50 items
bisbaldi Jan 15, 2018
d244a7d
Update query to only get 100 items as a response
bisbaldi Jan 16, 2018
5ba7613
Create Dockerfile and docker-compose.yml
Jan 16, 2018
4ac5425
Expose angular to external connections
Jan 16, 2018
d7f94ae
Exclude dockerfiles from coverage report
Jan 16, 2018
ebf1142
Add tests for date builder service
bisbaldi Jan 16, 2018
695aedf
Define public host to fix invalid host header error
fyndalf Jan 16, 2018
7947d4e
Add tests for public-statistics-service get method
bisbaldi Jan 16, 2018
f7ad469
Update tests for public-statistics-service get method
bisbaldi Jan 16, 2018
9106cf9
Add tests for public-statistics-service query method
bisbaldi Jan 16, 2018
680f352
Add tests for public-statistics-service query method without query pa…
bisbaldi Jan 17, 2018
06f8f67
Fix host settings
Jan 17, 2018
88ecd0e
Add tests for private-statistics-service
bisbaldi Jan 17, 2018
612c535
Fix linting
bisbaldi Jan 17, 2018
d3f0542
Add material module
bisbaldi Jan 17, 2018
451283b
Import material module in app module
bisbaldi Jan 17, 2018
e059f08
Add dashboard module
bisbaldi Jan 17, 2018
2ae5e27
Move dependencies from app to dashboard module
bisbaldi Jan 17, 2018
2b739e6
Add dashboard routing module
bisbaldi Jan 17, 2018
1613554
Add charts component
bisbaldi Jan 17, 2018
19851e0
Add child routes for dashboard component
bisbaldi Jan 17, 2018
8672b08
Define form submit action in form component to get rid off form errors
bisbaldi Jan 22, 2018
fcbdd9f
Merge pull request #16 from BPChain/refactor-module
bisbaldi Jan 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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", "--"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)</br>
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)</br>

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.4.

Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3.3"
services:
angular-frontend:
build: .
container_name: angular-frontend
ports:
- "4200:4200"
1 change: 1 addition & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = function (config) {
angularCli: {
environment: 'dev'
},
exclude: ['docker-compose.yml', 'Dockerfile'],
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
Expand Down
25 changes: 25 additions & 0 deletions package-lock.json

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

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
42 changes: 42 additions & 0 deletions src/app/app-material.module.ts
Original file line number Diff line number Diff line change
@@ -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 { }
26 changes: 26 additions & 0 deletions src/app/app-routing-module.ts
Original file line number Diff line number Diff line change
@@ -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 { }
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="page-wrap">
<app-header></app-header>
<main class="content">
<app-dashboard></app-dashboard>
<router-outlet></router-outlet>
</main>
<footer>
<app-footer></app-footer>
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
import {CUSTOM_ELEMENTS_SCHEMA} from "@angular/core";
import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';

describe('AppComponent', () => {
beforeEach(async(() => {
Expand Down
65 changes: 13 additions & 52 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,71 +1,32 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { AppComponent } from './app.component';
import { FooterComponent } from './menu/footer/footer.component';
import { HeaderComponent } from './menu/header/header.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { WelcomeComponent } from './dashboard/welcome/welcome.component';
import { FormComponent } from './dashboard/form/form.component';
import { MetricComponent } from './dashboard/metric/metric.component';
import {PublicChartsComponent} from "./dashboard/charts/public-charts/public-charts.component";
import {PrivateChartsComponent} from "./dashboard/charts/private-charts/private-charts.component";
import {BarchartComponent} from "./dashboard/charts/barchart/barchart.component";
import {LinechartComponent} from "./dashboard/charts/linechart/linechart.component";



import {
MatButtonModule, MatIconModule, MatToolbarModule, MatCardModule, MatCheckboxModule,
MatDatepickerModule, MatFormFieldModule, MatNativeDateModule, MatInputModule, MatSnackBarModule,
} from "@angular/material";
import {FormsModule, ReactiveFormsModule} from "@angular/forms";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {ChartsModule} from "ng2-charts";
import {HttpClientModule} from "@angular/common/http";
import {DatePipe} from "@angular/common";
import {FlexLayoutModule} from "@angular/flex-layout";



import { NotFoundComponent } from './not-found/not-found.component';
import { AppRoutingModule } from './app-routing-module';
import { ImpressumComponent } from './impressum/impressum.component';
import { AppMaterialModule } from './app-material.module';
import { DashboardModule } from './dashboard/dashboard.module';

@NgModule({
declarations: [
AppComponent,
FooterComponent,
HeaderComponent,
DashboardComponent,
WelcomeComponent,
FormComponent,
MetricComponent,
PublicChartsComponent,
PrivateChartsComponent,
BarchartComponent,
LinechartComponent,
FooterComponent,
NotFoundComponent,
ImpressumComponent,
],
imports: [
BrowserModule,
FormsModule,
ReactiveFormsModule,
BrowserAnimationsModule,
ChartsModule,
HttpClientModule,
FlexLayoutModule,
MatToolbarModule,
MatButtonModule,
MatIconModule,
MatCardModule,
MatCheckboxModule,
MatDatepickerModule,
MatNativeDateModule,
MatFormFieldModule,
MatInputModule,
MatSnackBarModule,
AppMaterialModule,
DashboardModule,
AppRoutingModule,

],
providers: [HttpClientModule, DatePipe],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class AppModule { }
4 changes: 2 additions & 2 deletions src/app/dashboard/charts/barchart/barchart.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { BarchartComponent } from './barchart.component';
import {ChartsModule} from "ng2-charts";
import {CUSTOM_ELEMENTS_SCHEMA} from "@angular/core";
import {ChartsModule} from 'ng2-charts';
import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';

describe('BarchartComponent', () => {
let component: BarchartComponent;
Expand Down
9 changes: 4 additions & 5 deletions src/app/dashboard/charts/barchart/barchart.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Component, Input, OnChanges, OnInit} from '@angular/core';
import {PrivateStatistics} from "../../../services/PrivateStatistics";

@Component({
selector: 'app-barchart',
Expand Down Expand Up @@ -40,19 +39,19 @@ export class BarchartComponent implements OnInit, OnChanges {

ngOnChanges() {
this.barChartData = [];
for(let i = 0; i < this.labels.length; i++){
for (let i = 0; i < this.labels.length; i++) {
this.barChartData.push(
{data: [this.statistics[this.labels[i]]], label: this.labels[i]}
)
);
}
}

// events
public chartClicked(e:any):void {
public chartClicked(e: any): void {
console.log(e);
}

public chartHovered(e:any):void {
public chartHovered(e: any): void {
console.log(e);
}

Expand Down
Loading