Blacked and isorted the python files

Prettied and eslinted the typescript/html files
This commit is contained in:
tanshu committed 2020-10-11 10:56:29 +05:30
1 parent b31db593c2
commit d677cfb1ea
505 files changed
+7559 -5649

No files matched your search

@@ -1,17 +1,17 @@
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import { PrinterService } from '../printer.service';
import { Printer } from '../../core/printer';
import { ToasterService } from '../../core/toaster.service';
import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component';
import { PrinterService } from '../printer.service';
@Component({
selector: 'app-printer-detail',
templateUrl: './printer-detail.component.html',
styleUrls: ['./printer-detail.component.css']
styleUrls: ['./printer-detail.component.css'],
})
export class PrinterDetailComponent implements OnInit, AfterViewInit {
@ViewChild('nameElement', { static: true }) nameElement: ElementRef;
@@ -24,7 +24,7 @@ export class PrinterDetailComponent implements OnInit, AfterViewInit {
private dialog: MatDialog,
private fb: FormBuilder,
private toaster: ToasterService,
private ser: PrinterService
private ser: PrinterService,
) {
this.createForm();
}
@@ -33,15 +33,14 @@ export class PrinterDetailComponent implements OnInit, AfterViewInit {
this.form = this.fb.group({
name: '',
address: '',
cutCode: ''
cutCode: '',
});
}
ngOnInit() {
this.route.data
.subscribe((data: { item: Printer }) => {
this.showItem(data.item);
});
this.route.data.subscribe((data: { item: Printer }) => {
this.showItem(data.item);
});
}
showItem(item: Printer) {
@@ -49,7 +48,7 @@ export class PrinterDetailComponent implements OnInit, AfterViewInit {
this.form.setValue({
name: this.item.name || '',
address: this.item.address || '',
cutCode: this.item.cutCode || ''
cutCode: this.item.cutCode || '',
});
}
@@ -60,35 +59,33 @@ export class PrinterDetailComponent implements OnInit, AfterViewInit {
}
save() {
this.ser.saveOrUpdate(this.getItem())
.subscribe(
(result) => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/printers');
},
(error) => {
this.toaster.show('Danger', error.error);
}
);
this.ser.saveOrUpdate(this.getItem()).subscribe(
() => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/printers');
},
(error) => {
this.toaster.show('Danger', error.error);
},
);
}
delete() {
this.ser.delete(this.item.id)
.subscribe(
(result) => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/printers');
},
(error) => {
this.toaster.show('Danger', error.error);
}
);
this.ser.delete(this.item.id).subscribe(
() => {
this.toaster.show('Success', '');
this.router.navigateByUrl('/printers');
},
(error) => {
this.toaster.show('Danger', error.error);
},
);
}
confirmDelete(): void {
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
width: '250px',
data: {title: 'Delete Printer?', content: 'Are you sure? This cannot be undone.'}
data: { title: 'Delete Printer?', content: 'Are you sure? This cannot be undone.' },
});
dialogRef.afterClosed().subscribe((result: boolean) => {