Moved to Angular 6.0

----

Pending
* Table width for the points column in incentive
* Linting
* keyboard navigation where it was used earlier
* can remove the unused totals calculated serverside in productledger
* spinner and loading bars
* Activate Guard for Employee Function tabs
* Progress for Fingerprint uploads
* deleted reconcile and receipe features as they were not being used
* focus the right control on component load
This commit is contained in:
tanshu
2018-06-09 17:05:11 +05:30
parent b3cb01da02
commit 6be1dd5a3a
1380 changed files with 23914 additions and 18722 deletions
@@ -0,0 +1,71 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {FormBuilder, FormGroup} from '@angular/forms';
import {MatPaginator, MatSort} from '@angular/material';
import {ActivatedRoute, Router} from '@angular/router';
import * as moment from 'moment';
import {NetTransactionsDataSource} from './net-transactions-datasource';
import {NetTransactions} from './net-transactions';
import {NetTransactionsService} from './net-transactions.service';
@Component({
selector: 'app-net-transactions',
templateUrl: './net-transactions.component.html',
styleUrls: ['./net-transactions.component.css']
})
export class NetTransactionsComponent implements OnInit {
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
dataSource: NetTransactionsDataSource;
form: FormGroup;
info: NetTransactions;
selectedRowId: string;
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['type', 'name', 'debit', 'credit'];
constructor(
private route: ActivatedRoute,
private router: Router,
private fb: FormBuilder
) {
this.createForm();
}
ngOnInit() {
this.route.data
.subscribe((data: { info: NetTransactions }) => {
this.info = data.info;
this.form.setValue({
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate()
});
this.dataSource = new NetTransactionsDataSource(this.paginator, this.sort, this.info.body);
});
}
show() {
const l = this.prepareSubmit();
this.router.navigate(['NetTransactions'], {
queryParams: {
startDate: l.startDate,
finishDate: l.finishDate
}
});
}
createForm() {
this.form = this.fb.group({
startDate: '',
finishDate: '',
});
}
prepareSubmit(): NetTransactions {
const formModel = this.form.value;
return {
startDate: moment(formModel.startDate).format('DD-MMM-YYYY'),
finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'),
body: []
};
}
}