diff --git a/.travis.yml b/.travis.yml
index 428a222..3c1cbeb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,16 +1,12 @@
-# Force sudo due to issue in travis
-sudo: required
addons:
chrome: stable
language: node_js
node_js:
- - 8
+ - node
before_install:
- - openssl aes-256-cbc -K $encrypted_9d2af3734b6c_key -iv $encrypted_9d2af3734b6c_iv -in src/environments/environments.tar.enc -out src/environments/environments.tar -d
+ - openssl aes-256-cbc -K $encrypted_17157b34afc7_key -iv $encrypted_17157b34afc7_iv -in src/environments/environments.tar.enc -out src/environments/environments.tar -d
- tar xf src/environments/environments.tar -C src/environments
before_script:
- - export DISPLAY=:99.0
- - sh -e /etc/init.d/xvfb start
- npm config set spin false
install:
- npm install
diff --git a/bin/build-releases b/bin/build-releases
index f7f5334..bb16744 100755
--- a/bin/build-releases
+++ b/bin/build-releases
@@ -12,13 +12,13 @@ echo "Building releases for $VERSION"
echo "Building Prod Release..."
-ng build --prod
+ng build --configuration=prod
tar -czf ../WebApp-Releases/LocalLoop-Web-prod-$VERSION.tar.gz dist
echo "Building Dev Release..."
-ng build --dev
+ng build --configuration=dev
tar -czf ../WebApp-Releases/LocalLoop-Web-dev-$VERSION.tar.gz dist
diff --git a/karma.conf.js b/karma.conf.js
index 02b3582..3c0a8cb 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -7,7 +7,6 @@ module.exports = function (config) {
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
- require("readable-stream");
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
diff --git a/package.json b/package.json
index d5348ee..a37905e 100644
--- a/package.json
+++ b/package.json
@@ -9,10 +9,12 @@
"ng": "ng",
"start": "ng serve",
"start:dev": "ng serve --optimization=false --configuration=dev",
+ "start:prod": "ng serve --optimization=false --configuration=prod",
"start:local": "ng serve --optimization=false --configuration=local",
- "build": "ng build",
+ "build:dev": "ng build --configuration=dev",
+ "build:prod": "ng build --configuration=prod",
"test": "ng test",
- "test:ci": "ng test --watch=false",
+ "test:ci": "ng test --watch=false --browsers=ChromeHeadless",
"lint": "ng lint",
"e2e": "ng e2e",
"e2e:ci": "ng e2e --configuration=ci",
@@ -75,6 +77,7 @@
"karma-cli": "2.0.0",
"karma-coverage-istanbul-reporter": "^2.0.5",
"karma-jasmine": "^2.0.1",
+ "readable-stream": "latest",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "^5.4.2",
"ts-node": "^8.3.0",
diff --git a/protractor.conf.js b/protractor.conf.js
index 1c5e1e5..7775398 100644
--- a/protractor.conf.js
+++ b/protractor.conf.js
@@ -9,7 +9,10 @@ exports.config = {
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
- 'browserName': 'chrome'
+ 'browserName': 'chrome',
+ chromeOptions: {
+ args: [ "--headless" ]
+ }
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
diff --git a/src/app/dashboard/more-graphs-and-tables.component.ts b/src/app/dashboard/more-graphs-and-tables.component.ts
index 1e41ad8..2de09b7 100644
--- a/src/app/dashboard/more-graphs-and-tables.component.ts
+++ b/src/app/dashboard/more-graphs-and-tables.component.ts
@@ -38,7 +38,7 @@ export class MoreStuffComponent implements OnInit {
this.loadData();
}
- private loadData() {
+ public loadData() {
this.tableSummary();
this.loadYearSpend();
this.loadSupplierBubble();
@@ -284,8 +284,8 @@ export class MoreStuffComponent implements OnInit {
private _supplierHistoryData: any[];
private _supplierHistoryPerPage: number = 15;
- private _supplierHistoryPage: number = 1;
- private _supplierHistoryPages: number = 1;
+ public _supplierHistoryPage: number = 1;
+ public _supplierHistoryPages: number = 1;
public supplierMonthChartData: any[] = [
{
data: [],
diff --git a/src/app/panels/candlestick.component.html b/src/app/panels/candlestick.component.html
deleted file mode 100644
index 9aa9cb5..0000000
--- a/src/app/panels/candlestick.component.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
\ No newline at end of file
diff --git a/src/app/panels/candlestick.component.ts b/src/app/panels/candlestick.component.ts
deleted file mode 100644
index 4f8d3c0..0000000
--- a/src/app/panels/candlestick.component.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-import { Component, OnInit, ViewChild } from '@angular/core';
-import 'dist/chartjs-chart-financial/chartjs-chart-financial';
-import * as luxon from 'luxon';
-import 'chartjs-adapter-luxon';
-import { ChartOptions } from 'chart.js';
-import { Color, BaseChartDirective } from 'ng2-charts';
-
-@Component({
- selector: 'app-financial-chart',
- templateUrl: './financial-chart.component.html',
- styleUrls: ['./financial-chart.component.css']
-})
-export class FinancialChartComponent implements OnInit {
- barCount = 60;
- initialDateStr = '01 Apr 2017 00:00 Z';
-
- public financialChartData = [
- {
- label: 'CHRT - Chart.js Corporation',
- data: this.getRandomData(this.initialDateStr, this.barCount)
- },
- ];
- public financialChartOptions: ChartOptions = {
- responsive: true,
- maintainAspectRatio: false,
- };
- public financialChartColors: Color[] = [
- {
- borderColor: 'black',
- backgroundColor: 'rgba(255,0,0,0.3)',
- },
- ];
- public financialChartLegend : Boolean;
- public chartLegend : Boolean;
- public financialChartType = 'candlestick';
- public chartType : string;
- public financialChartPlugins = [];
-
- @ViewChild(BaseChartDirective, { static: true }) chart: BaseChartDirective;
-
- constructor() { }
-
- ngOnInit() {
- this.financialChartType = 'candlestick';
- this.chartType=this.financialChartType;
-
- this.financialChartLegend = this.chartLegend;
- }
-
- randomNumber(min: number, max: number) {
- return Math.random() * (max - min) + min;
- }
-
- randomBar(date: luxon.DateTime, lastClose: number) {
- const open = this.randomNumber(lastClose * 0.95, lastClose * 1.05);
- const close = this.randomNumber(open * 0.95, open * 1.05);
- const high = this.randomNumber(Math.max(open, close), Math.max(open, close) * 1.1);
- const low = this.randomNumber(Math.min(open, close) * 0.9, Math.min(open, close));
- return {
- t: date.valueOf(),
- o: open,
- h: high,
- l: low,
- c: close
- };
- }
-
- getRandomData(dateStr: string, count: number) {
- let date = luxon.DateTime.fromRFC2822(dateStr);
- const data = [this.randomBar(date, 30)];
- while (data.length < count) {
- date = date.plus({ days: 1 });
- if (date.weekday <= 5) {
- data.push(this.randomBar(date, data[data.length - 1].c));
- }
- }
- return data;
- }
-
- update() {
- // candlestick vs ohlc
- this.financialChartType = this.financialChartType === 'candlestick' ? 'ohlc' : 'candlestick';
- }
-}
\ No newline at end of file
diff --git a/src/app/panels/polar-panel.component.html b/src/app/panels/polar-panel.component.html
deleted file mode 100644
index 9aa9cb5..0000000
--- a/src/app/panels/polar-panel.component.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
\ No newline at end of file
diff --git a/src/app/panels/polar-panel.component.ts b/src/app/panels/polar-panel.component.ts
deleted file mode 100644
index e698fb4..0000000
--- a/src/app/panels/polar-panel.component.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
-import { SingleDataSet, Label } from 'ng2-charts';
-import { ChartType } from 'chart.js';
-import { ApiService } from '../providers/api-service';
-import { CustPiesService } from '../providers/cust-pies.service';
-import { DataType } from '../shared/data-types.enum';
-import { ChartData } from '../_interfaces/chart-data';
-
-@Component({
- selector: 'polar-area',
- templateUrl: 'polar-panel.component.html',
-})
-
-export class PolarAreaChartComponent implements OnInit {
- // PolarArea
-
- public chartType : 'polar-area';
- public polarAreaChartLabels: Label[];
- public polarAreaChartData: SingleDataSet;
- public chartLegend : Boolean;
- public polarAreaLegend : Boolean;
-
- public polarChartLabelsLocal: string[] = [];
- public polarChartDataLocal: number[] = [];
-
- public polarAreaChartType: ChartType = 'polarArea';
-
- constructor(
- private api: ApiService,
- private pieService: CustPiesService,
- ) {
- this.pieService.getPie().subscribe(
- result => {
- this.setChartData(result.local_all);
- },
- error => {
- console.log('Retrieval Error');
- console.log( error._body );
- }
- );
- }
-
- ngOnInit() {
- this.polarAreaLegend = this.chartLegend;
- this.polarAreaLegend = true;
- }
-
- private setChartData(dataLocal: any) {
- this.polarChartDataLocal = Object.keys(dataLocal).map(key => dataLocal[key]);
- // setTimeout is currently a workaround for ng2-charts labels
- setTimeout(() => this.polarChartLabelsLocal = Object.keys(dataLocal), 0);
- }
-
- public convertHex(hex: string, opacity: number) {
- hex = hex.replace('#', '');
- const r = parseInt(hex.substring(0, 2), 16);
- const g = parseInt(hex.substring(2, 4), 16);
- const b = parseInt(hex.substring(4, 6), 16);
-
- const rgba = 'rgba(' + r + ', ' + g + ', ' + b + ', ' + opacity / 100 + ')';
- return rgba;
- }
-
- // events
- public chartClicked({ event, active }: { event: MouseEvent, active: {}[] }): void {
- console.log(event, active);
- }
-
- public chartHovered({ event, active }: { event: MouseEvent, active: {}[] }): void {
- console.log(event, active);
- }
-}
\ No newline at end of file
diff --git a/src/app/panels/stacked-bar.component.html.broken b/src/app/panels/stacked-bar.component.html.broken
deleted file mode 100644
index 8a95a2e..0000000
--- a/src/app/panels/stacked-bar.component.html.broken
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
\ No newline at end of file
diff --git a/src/app/panels/stacked-bar.component.ts.broken b/src/app/panels/stacked-bar.component.ts.broken
deleted file mode 100644
index 3987dc5..0000000
--- a/src/app/panels/stacked-bar.component.ts.broken
+++ /dev/null
@@ -1,68 +0,0 @@
-import { NgModule, enableProdMode } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
-import { ApiService } from '../providers/api-service';
-import { CustPiesService } from '../providers/cust-pies.service';
-import { DataType } from '../shared/data-types.enum';
-import { ChartData } from '../_interfaces/chart-data';
-import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
-
-import { DxChartModule } from 'devextreme-angular';
-
-if(!/localhost/.test(document.location.host)) {
- enableProdMode();
-}
-
-@Component({
- selector: 'stacked-bar',
- templateUrl: 'stacked-bar.component.html',
-})
-@NgModule({
- imports: [
- BrowserModule,
- DxChartModule
- ],
- declarations: [StackedBarChartComponent],
- bootstrap: [StackedBarChartComponent]
-})
-export class StackedBarChartComponent {
-
- public chartType: 'stacked-bar';
- public chartLegend = true;
- public stackedBarChartDataLocal : number[] = [];
- public stackedBarChartLabelsLocal : string[] = [];
-
- constructor(
- private api: ApiService,
- private pieService: CustPiesService,
- ) {
- this.pieService.getPie().subscribe(
- result => {
- this.setChartData(result.local_all);
- },
- error => {
- console.log('Retrieval Error');
- console.log( error._body );
- }
- );
- }
-
- public ngOnInit(): void {
- console.log("stacked bar graph tried to initialise");
- }
-
- private setChartData(dataLocal: any) {
- this.stackedBarChartDataLocal = Object.keys(dataLocal).map(key => dataLocal[key]);
- // setTimeout is currently a workaround for ng2-charts labels
- setTimeout(() => this.stackedBarChartLabelsLocal = Object.keys(dataLocal), 0);
- }
-
- customizeTooltip(arg: any) {
- return {
- text: arg.percentText + ' - ' + arg.valueText
- };
- }
-}
-
-
-platformBrowserDynamic().bootstrapModule(StackedBarChartComponent);
\ No newline at end of file
diff --git a/src/environments/environments.tar.enc b/src/environments/environments.tar.enc
index ebe8734..166b4e8 100644
Binary files a/src/environments/environments.tar.enc and b/src/environments/environments.tar.enc differ