Remove unused event and logger.

This commit is contained in:
Alexis Lahouze 2018-06-10 18:39:12 +02:00
parent f913d52842
commit 9b9a64fb52

View File

@ -9,18 +9,12 @@ import {
} from '@angular/core';
import { ActivatedRoute, Router, ParamMap } from '@angular/router';
import { Logger } from '@nsalaun/ng-logger';
import { jqxChartComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxchart';
import { Account } from '../accounts/account';
import { DailyBalance } from './dailyBalance';
import { DailyBalanceService } from '../accounts/dailyBalance.service';
class DateRange {
minDate: Date;
maxDate: Date;
}
@Component({
selector: 'balance-chart',
template: `
@ -39,7 +33,6 @@ class DateRange {
})
export class BalanceChartComponent implements OnInit, OnChanges {
@Input() account: Account;
@Output() onUpdate: EventEmitter<DateRange> = new EventEmitter<DateRange>();
@ViewChild('balanceChart') chart: jqxChartComponent;
public data;
@ -129,7 +122,6 @@ export class BalanceChartComponent implements OnInit, OnChanges {
constructor(
private router: Router,
private activatedRoute: ActivatedRoute,
private logger: Logger,
private dailyBalanceService: DailyBalanceService,
) {
this.data = [];
@ -146,11 +138,6 @@ export class BalanceChartComponent implements OnInit, OnChanges {
let lastResult = results[results.length -1];
this.updateXBands(results[0].operation_date, lastResult.operation_date);
this.onUpdate.emit({
minDate: moment(results[0].operation_date).toDate(),
maxDate: moment(lastResult.operation_date).toDate()
});
});
}
@ -166,13 +153,10 @@ export class BalanceChartComponent implements OnInit, OnChanges {
let fromDay = params.get('from');
let toDay = params.get('to');
this.logger.info('Setting from and to', fromDay, toDay);
this.xAxis.minValue = moment(fromDay).toDate();
this.xAxis.maxValue = moment(toDay).toDate();
if(this.chart && this.chart.host) {
this.logger.info('Chart', this.chart);
this.chart.refresh();
}
});
@ -202,8 +186,6 @@ export class BalanceChartComponent implements OnInit, OnChanges {
this.updateXBands(args.minValue, args.maxValue);
this.onUpdate.emit({minDate: args.minValue, maxDate: args.maxValue});
let accountId = this.activatedRoute.snapshot.paramMap.get('accountId');
this.router.navigate(['account', accountId, 'operations'], {