Fully working with the rule no explicit any

This commit is contained in:
2020-11-25 09:27:42 +05:30
parent 84535ca9bb
commit b583b90756
27 changed files with 223 additions and 155 deletions

View File

@ -5,6 +5,7 @@ import { Observable } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { AuthService } from '../../auth/auth.service';
import { BillViewItem } from '../../core/bill-view-item';
import { Table } from '../../core/table';
import { ToasterService } from '../../core/toaster.service';
import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component';
@ -68,7 +69,7 @@ export class BillsComponent implements OnInit {
isAllSelected(kot: Kot) {
return this.bs.data
.filter((x) => x.kotId === kot.id)
.reduce((p: boolean, c: any) => p && this.bs.selection.isSelected(c), true);
.reduce((p: boolean, c: BillViewItem) => p && this.bs.selection.isSelected(c), true);
}
isAnySelected(kot: Kot) {
@ -76,7 +77,7 @@ export class BillsComponent implements OnInit {
let found = 0;
this.bs.data
.filter((x) => x.kotId === kot.id)
.forEach((c: any) => {
.forEach((c: BillViewItem) => {
total += 1;
if (this.bs.selection.isSelected(c)) {
found += 1;
@ -94,11 +95,11 @@ export class BillsComponent implements OnInit {
);
}
addOne(item: any): void {
addOne(item: BillViewItem): void {
this.bs.addOne(item);
}
quantity(item: any): void {
quantity(item: BillViewItem): void {
const dialogRef = this.dialog.open(QuantityComponent, {
// width: '750px',
data: item.quantity,
@ -123,16 +124,16 @@ export class BillsComponent implements OnInit {
});
}
subtractOne(item: any): void {
subtractOne(item: BillViewItem): void {
const canEdit = this.auth.allowed('edit-printed-product');
this.bs.subtractOne(item, canEdit);
}
removeItem(item: any): void {
removeItem(item: BillViewItem): void {
this.bs.removeItem(item);
}
modifier(item: any): void {
modifier(item: BillViewItem): void {
this.bs.modifier(item);
}
@ -202,7 +203,7 @@ export class BillsComponent implements OnInit {
);
}
rowQuantityDisabled(row: any) {
rowQuantityDisabled(row: BillViewItem) {
if (!row.isPrinted) {
return false;
}