Chore:
Upgraded to Angular 14
This commit is contained in:
1 parent
f637f01954
commit
792ccf923f
46 files changed
+233
-179
No files matched your search
@@ -2,7 +2,7 @@
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.3.0
|
||||
rev: 22.6.0
|
||||
hooks:
|
||||
- id: black
|
||||
|
||||
|
||||
@@ -6,15 +6,15 @@ authors = ["tanshu <git@tanshu.com>"]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.10"
|
||||
uvicorn = {extras = ["standard"], version = "^0.17.6"}
|
||||
uvicorn = {extras = ["standard"], version = "^0.18.2"}
|
||||
fastapi = "^0.78.0"
|
||||
python-jose = {extras = ["cryptography"], version = "^3.3.0"}
|
||||
passlib = {extras = ["bcrypt"], version = "^1.7.4"}
|
||||
psycopg2-binary = "^2.9.3"
|
||||
SQLAlchemy = "^1.4.36"
|
||||
SQLAlchemy = "^1.4.39"
|
||||
python-multipart = "^0.0.5"
|
||||
PyJWT = "^2.4.0"
|
||||
alembic = "^1.7.7"
|
||||
alembic = "^1.8.0"
|
||||
itsdangerous = "^2.1.2"
|
||||
python-dotenv = "^0.20.0"
|
||||
pydantic = {extras = ["dotenv"], version = "^1.9.1"}
|
||||
@@ -26,10 +26,10 @@ gunicorn = "^20.1.0"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
flake8 = "^4.0.1"
|
||||
black = "^22.3.0"
|
||||
black = "^22.6.0"
|
||||
isort = {extras = ["toml"], version = "^5.10.1"}
|
||||
pre-commit = "^2.19.0"
|
||||
mypy = "^0.950"
|
||||
mypy = "^0.961"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
|
||||
+6
-3
@@ -128,7 +128,10 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "bookie",
|
||||
"cli": {
|
||||
"defaultCollection": "@angular-eslint/schematics"
|
||||
}}
|
||||
"schematicCollections": [
|
||||
"@angular-eslint/schematics"
|
||||
],
|
||||
"analytics": "7a673950-fc51-4020-ad5a-32644b126f14"
|
||||
}
|
||||
}
|
||||
+29
-29
@@ -14,39 +14,39 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^13.3.9",
|
||||
"@angular/cdk": "^13.3.7",
|
||||
"@angular/common": "^13.3.9",
|
||||
"@angular/compiler": "^13.3.9",
|
||||
"@angular/core": "^13.3.9",
|
||||
"@angular/flex-layout": "^13.0.0-beta.38",
|
||||
"@angular/forms": "^13.3.9",
|
||||
"@angular/material": "^13.3.7",
|
||||
"@angular/material-moment-adapter": "^13.3.7",
|
||||
"@angular/platform-browser": "^13.3.9",
|
||||
"@angular/platform-browser-dynamic": "^13.3.9",
|
||||
"@angular/router": "^13.3.9",
|
||||
"mathjs": "^10.5.3",
|
||||
"@angular/animations": "^14.0.4",
|
||||
"@angular/cdk": "^14.0.4",
|
||||
"@angular/common": "^14.0.4",
|
||||
"@angular/compiler": "^14.0.4",
|
||||
"@angular/core": "^14.0.4",
|
||||
"@angular/flex-layout": "^14.0.0-beta.40",
|
||||
"@angular/forms": "^14.0.4",
|
||||
"@angular/material": "^14.0.4",
|
||||
"@angular/material-moment-adapter": "^14.0.4",
|
||||
"@angular/platform-browser": "^14.0.4",
|
||||
"@angular/platform-browser-dynamic": "^14.0.4",
|
||||
"@angular/router": "^14.0.4",
|
||||
"mathjs": "^10.6.4",
|
||||
"moment": "^2.29.3",
|
||||
"rxjs": "^6.6.7",
|
||||
"tslib": "^2.2.0",
|
||||
"zone.js": "~0.11.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~13.3.6",
|
||||
"@angular-eslint/builder": "^13.2.1",
|
||||
"@angular-eslint/eslint-plugin": "^13.2.1",
|
||||
"@angular-eslint/eslint-plugin-template": "^13.2.1",
|
||||
"@angular-eslint/schematics": "^13.2.1",
|
||||
"@angular-eslint/template-parser": "^13.2.1",
|
||||
"@angular/cli": "^13.3.6",
|
||||
"@angular/compiler-cli": "^13.3.9",
|
||||
"@angular/language-service": "^13.3.9",
|
||||
"@angular-devkit/build-angular": "^14.0.4",
|
||||
"@angular-eslint/builder": "^14.0.0",
|
||||
"@angular-eslint/eslint-plugin": "^14.0.0",
|
||||
"@angular-eslint/eslint-plugin-template": "^14.0.0",
|
||||
"@angular-eslint/schematics": "^14.0.0",
|
||||
"@angular-eslint/template-parser": "^14.0.0",
|
||||
"@angular/cli": "^14.0.4",
|
||||
"@angular/compiler-cli": "^14.0.4",
|
||||
"@angular/language-service": "^14.0.4",
|
||||
"@types/jasmine": "~3.7.4",
|
||||
"@types/node": "^17.0.35",
|
||||
"@typescript-eslint/eslint-plugin": "5.25.0",
|
||||
"@typescript-eslint/parser": "5.25.0",
|
||||
"eslint": "^8.16.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.29.0",
|
||||
"@typescript-eslint/parser": "^5.29.0",
|
||||
"eslint": "^8.18.0",
|
||||
"@types/node": "^18.0.1",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"husky": "^8.0.1",
|
||||
"jasmine-core": "^3.7.1",
|
||||
@@ -56,11 +56,11 @@
|
||||
"karma-coverage-istanbul-reporter": "~3.0.2",
|
||||
"karma-jasmine": "^4.0.2",
|
||||
"karma-jasmine-html-reporter": "^1.7.0",
|
||||
"lint-staged": "^12.4.1",
|
||||
"prettier": "^2.6.2",
|
||||
"lint-staged": "^13.0.3",
|
||||
"prettier": "^2.7.1",
|
||||
"standard-version": "^9.5.0",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "~4.5.4"
|
||||
"typescript": "~4.7.4"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
import { ToasterService } from '../../core/toaster.service';
|
||||
@@ -13,7 +13,7 @@ import { AuthService } from '../auth.service';
|
||||
})
|
||||
export class LoginComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
hide: boolean;
|
||||
unregisteredDevice: boolean;
|
||||
deviceName: string;
|
||||
@@ -25,7 +25,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
|
||||
private router: Router,
|
||||
private toaster: ToasterService,
|
||||
private cs: CookieService,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
) {
|
||||
this.hide = true;
|
||||
this.unregisteredDevice = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@@ -17,7 +17,7 @@ import { BeerSaleReportDataSource } from './beer-sale-report-datasource';
|
||||
export class BeerSaleReportComponent implements OnInit {
|
||||
info: BeerSaleReport = new BeerSaleReport();
|
||||
dataSource: BeerSaleReportDataSource = new BeerSaleReportDataSource(this.info.data);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns: string[] = ['date'];
|
||||
@@ -25,7 +25,7 @@ export class BeerSaleReportComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
) {
|
||||
// Create form
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@@ -19,7 +19,7 @@ export class BillSettlementReportComponent implements OnInit {
|
||||
this.info.amounts,
|
||||
);
|
||||
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['date', 'billId', 'amount', 'settlement'];
|
||||
@@ -27,7 +27,7 @@ export class BillSettlementReportComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
) {
|
||||
// Create form
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@@ -20,7 +20,7 @@ export class CashierReportComponent implements OnInit {
|
||||
activeCashiers: User[] = [];
|
||||
info: CashierReport = new CashierReport();
|
||||
dataSource: CashierReportDataSource = new CashierReportDataSource(this.info.amounts);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'amount'];
|
||||
@@ -28,7 +28,7 @@ export class CashierReportComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
private toaster: ToasterService,
|
||||
private ser: CashierReportService,
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import {
|
||||
AbstractControl,
|
||||
UntypedFormArray,
|
||||
UntypedFormBuilder,
|
||||
UntypedFormGroup,
|
||||
} from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { round } from 'mathjs';
|
||||
@@ -16,14 +21,14 @@ import { CustomerService } from '../customer.service';
|
||||
})
|
||||
export class CustomerDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: Customer = new Customer();
|
||||
hide: boolean;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private dialog: MatDialog,
|
||||
private ser: CustomerService,
|
||||
@@ -115,7 +120,7 @@ export class CustomerDetailComponent implements OnInit, AfterViewInit {
|
||||
this.item.phone = formModel.phone;
|
||||
this.item.address = formModel.address;
|
||||
this.item.printInBill = formModel.printInBill;
|
||||
const array = this.form.get('discounts') as FormArray;
|
||||
const array = this.form.get('discounts') as UntypedFormArray;
|
||||
this.item.discounts.forEach((item, index) => {
|
||||
item.discount = Math.max(
|
||||
Math.min(round(array.controls[index].value.discount / 100, 5), 100),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -16,7 +16,7 @@ import { DeviceService } from '../device.service';
|
||||
})
|
||||
export class DeviceDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
sections: Section[] = [];
|
||||
item: Device = new Device();
|
||||
|
||||
@@ -24,7 +24,7 @@ export class DeviceDetailComponent implements OnInit, AfterViewInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: DeviceService,
|
||||
) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@@ -18,7 +18,7 @@ import { DiscountReportService } from './discount-report.service';
|
||||
export class DiscountReportComponent implements OnInit {
|
||||
info: DiscountReport = new DiscountReport();
|
||||
dataSource: DiscountReportDataSource = new DiscountReportDataSource(this.info.amounts);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'amount'];
|
||||
@@ -26,7 +26,7 @@ export class DiscountReportComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
private toaster: ToasterService,
|
||||
private ser: DiscountReportService,
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import {
|
||||
UntypedFormBuilder,
|
||||
UntypedFormControl,
|
||||
UntypedFormGroup,
|
||||
Validators,
|
||||
} from '@angular/forms';
|
||||
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
@@ -18,12 +23,12 @@ import { GuestBookService } from '../guest-book.service';
|
||||
})
|
||||
export class GuestBookDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('phone', { static: true }) phoneElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: GuestBook = new GuestBook();
|
||||
customers: Observable<Customer[]>;
|
||||
|
||||
constructor(
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private toaster: ToasterService,
|
||||
@@ -38,7 +43,7 @@ export class GuestBookDetailComponent implements OnInit, AfterViewInit {
|
||||
address: null,
|
||||
});
|
||||
// Setup Account Autocomplete
|
||||
this.customers = (this.form.get('phone') as FormControl).valueChanges.pipe(
|
||||
this.customers = (this.form.get('phone') as UntypedFormControl).valueChanges.pipe(
|
||||
startWith(null),
|
||||
map((x) => (x !== null && x.length >= 1 ? x : null)),
|
||||
debounceTime(150),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
@@ -22,14 +22,14 @@ import { GuestBookListDataSource } from './guest-book-list-datasource';
|
||||
export class GuestBookListComponent implements OnInit {
|
||||
data: BehaviorSubject<GuestBook[]> = new BehaviorSubject<GuestBook[]>([]);
|
||||
dataSource: GuestBookListDataSource = new GuestBookListDataSource(this.data);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['sno', 'name', 'phone', 'pax', 'date', 'action'];
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private dialog: MatDialog,
|
||||
private toaster: ToasterService,
|
||||
private ser: GuestBookService,
|
||||
@@ -42,7 +42,7 @@ export class GuestBookListComponent implements OnInit {
|
||||
}
|
||||
|
||||
listenToDateChange(): void {
|
||||
(this.form.get('date') as FormControl).valueChanges
|
||||
(this.form.get('date') as UntypedFormControl).valueChanges
|
||||
.pipe(map((x) => moment(x).format('DD-MMM-YYYY')))
|
||||
.subscribe((x) =>
|
||||
this.ser.list(x).subscribe((list: GuestBookList) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@@ -17,14 +17,14 @@ import { HeaderFooterService } from './header-footer.service';
|
||||
})
|
||||
export class HeaderFooterComponent implements OnInit {
|
||||
@ViewChild('section', { static: true }) sectionElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
list: HeaderFooter[] = [];
|
||||
id = '';
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private dialog: MatDialog,
|
||||
private ser: HeaderFooterService,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -15,14 +15,14 @@ import { MenuCategoryService } from '../menu-category.service';
|
||||
})
|
||||
export class MenuCategoryDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: MenuCategory = new MenuCategory();
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: MenuCategoryService,
|
||||
) {
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { NestedTreeControl } from '@angular/cdk/tree';
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatTreeNestedDataSource } from '@angular/material/tree';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@@ -21,7 +21,7 @@ import { NodeItem } from '../node-item';
|
||||
})
|
||||
export class ModifierCategoryDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: ModifierCategory = new ModifierCategory();
|
||||
treeControl = new NestedTreeControl<NodeItem>((node: NodeItem) => node.children);
|
||||
dataSource = new MatTreeNestedDataSource<NodeItem>();
|
||||
@@ -31,7 +31,7 @@ export class ModifierCategoryDetailComponent implements OnInit, AfterViewInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private dialog: MatDialog,
|
||||
private ser: ModifierCategoryService,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ModifierService } from '../modifier.service';
|
||||
})
|
||||
export class ModifierDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('name', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
modifierCategories: ModifierCategory[] = [];
|
||||
item: Modifier = new Modifier();
|
||||
|
||||
@@ -24,7 +24,7 @@ export class ModifierDetailComponent implements OnInit, AfterViewInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: ModifierService,
|
||||
) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import { MatTable } from '@angular/material/table';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@@ -20,13 +20,17 @@ export class ModifierListComponent implements OnInit {
|
||||
filter: BehaviorSubject<string> = new BehaviorSubject('');
|
||||
data: BehaviorSubject<Modifier[]> = new BehaviorSubject<Modifier[]>([]);
|
||||
dataSource: ModifierListDataSource = new ModifierListDataSource(this.filter, this.data);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
list: Modifier[] = [];
|
||||
modifierCategories: ModifierCategory[] = [];
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns: string[] = ['name', 'showInBill', 'price', 'isActive', 'modifierCategory'];
|
||||
|
||||
constructor(private route: ActivatedRoute, private fb: FormBuilder, private router: Router) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private fb: UntypedFormBuilder,
|
||||
private router: Router,
|
||||
) {
|
||||
this.form = this.fb.group({
|
||||
modifierCategory: '',
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -15,14 +15,14 @@ import { PrinterService } from '../printer.service';
|
||||
})
|
||||
export class PrinterDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: Printer = new Printer();
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: PrinterService,
|
||||
) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@@ -18,7 +18,7 @@ import { ProductSaleReportService } from './product-sale-report.service';
|
||||
export class ProductSaleReportComponent implements OnInit {
|
||||
info: ProductSaleReport = new ProductSaleReport();
|
||||
dataSource: ProductSaleReportDataSource = new ProductSaleReportDataSource(this.info.amounts);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'unbilled', 'sale', 'noCharge', 'staff', 'void'];
|
||||
@@ -26,7 +26,7 @@ export class ProductSaleReportComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
private toaster: ToasterService,
|
||||
private ser: ProductSaleReportService,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ProductUpdatesReportDataSource } from './product-updates-report-datasou
|
||||
export class ProductUpdatesReportComponent implements OnInit {
|
||||
info: ProductUpdatesReport = new ProductUpdatesReport();
|
||||
dataSource: ProductUpdatesReportDataSource = new ProductUpdatesReportDataSource(this.info.report);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['details'];
|
||||
@@ -24,7 +24,7 @@ export class ProductUpdatesReportComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
) {
|
||||
// Create form
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -17,7 +17,7 @@ import { ProductService } from '../product.service';
|
||||
})
|
||||
export class ProductDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('name', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
menuCategories: MenuCategory[] = [];
|
||||
saleCategories: SaleCategory[] = [];
|
||||
item: Product = new Product();
|
||||
@@ -26,7 +26,7 @@ export class ProductDetailComponent implements OnInit, AfterViewInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: ProductService,
|
||||
) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { Observable } from 'rxjs';
|
||||
@@ -29,7 +29,7 @@ export class ProductListComponent implements OnInit {
|
||||
this.data,
|
||||
);
|
||||
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
list: Product[] = [];
|
||||
menuCategories: MenuCategory[] = [];
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
@@ -44,7 +44,7 @@ export class ProductListComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private toCsv: ToCsvService,
|
||||
private ser: ProductService,
|
||||
@@ -56,7 +56,7 @@ export class ProductListComponent implements OnInit {
|
||||
this.data.subscribe((data: Product[]) => {
|
||||
this.list = data;
|
||||
});
|
||||
this.searchFilter = (this.form.get('filter') as FormControl).valueChanges.pipe(
|
||||
this.searchFilter = (this.form.get('filter') as UntypedFormControl).valueChanges.pipe(
|
||||
startWith(''),
|
||||
debounceTime(150),
|
||||
distinctUntilChanged(),
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import {
|
||||
UntypedFormArray,
|
||||
UntypedFormBuilder,
|
||||
UntypedFormControl,
|
||||
UntypedFormGroup,
|
||||
} from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -15,13 +20,13 @@ import { RoleService } from '../role.service';
|
||||
})
|
||||
export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: Role = new Role();
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private dialog: MatDialog,
|
||||
private ser: RoleService,
|
||||
@@ -37,7 +42,7 @@ export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { item: Role };
|
||||
this.item = data.item;
|
||||
(this.form.get('name') as FormControl).setValue(this.item.name);
|
||||
(this.form.get('name') as UntypedFormControl).setValue(this.item.name);
|
||||
this.form.setControl(
|
||||
'permissions',
|
||||
this.fb.array(
|
||||
@@ -99,7 +104,7 @@ export class RoleDetailComponent implements OnInit, AfterViewInit {
|
||||
getItem(): Role {
|
||||
const formModel = this.form.value;
|
||||
this.item.name = formModel.name;
|
||||
const array = this.form.get('permissions') as FormArray;
|
||||
const array = this.form.get('permissions') as UntypedFormArray;
|
||||
this.item.permissions.forEach((item, index) => {
|
||||
item.enabled = array.controls[index].value.permission;
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { round } from 'mathjs';
|
||||
@@ -21,7 +21,7 @@ import { SaleCategoryDetailDatasource } from './sale-category-detail-datasource'
|
||||
})
|
||||
export class SaleCategoryDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
taxes: Tax[] = [];
|
||||
item: SaleCategory = new SaleCategory();
|
||||
products: BehaviorSubject<Product[]> = new BehaviorSubject<Product[]>([]);
|
||||
@@ -32,7 +32,7 @@ export class SaleCategoryDetailComponent implements OnInit, AfterViewInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: SaleCategoryService,
|
||||
) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@@ -18,7 +18,7 @@ import { SaleReportService } from './sale-report.service';
|
||||
export class SaleReportComponent implements OnInit {
|
||||
info: SaleReport = new SaleReport();
|
||||
dataSource: SaleReportDatasource = new SaleReportDatasource(this.info.amounts);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'amount'];
|
||||
@@ -26,7 +26,7 @@ export class SaleReportComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
private toaster: ToasterService,
|
||||
private ser: SaleReportService,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
@@ -8,9 +8,9 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
styleUrls: ['./bill-number.component.css'],
|
||||
})
|
||||
export class BillNumberComponent implements OnInit {
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<BillNumberComponent>, private fb: FormBuilder) {
|
||||
constructor(public dialogRef: MatDialogRef<BillNumberComponent>, private fb: UntypedFormBuilder) {
|
||||
// Create form
|
||||
this.form = this.fb.group({
|
||||
billType: '',
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import {
|
||||
UntypedFormArray,
|
||||
UntypedFormBuilder,
|
||||
UntypedFormControl,
|
||||
UntypedFormGroup,
|
||||
} from '@angular/forms';
|
||||
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { round } from 'mathjs';
|
||||
@@ -15,14 +20,14 @@ import { CustomerService } from '../../customers/customer.service';
|
||||
styleUrls: ['./choose-customer.component.css'],
|
||||
})
|
||||
export class ChooseCustomerComponent {
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: Customer = new Customer();
|
||||
customers: Observable<Customer[]>;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ChooseCustomerComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: string | undefined,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private ser: CustomerService,
|
||||
) {
|
||||
// Create form
|
||||
@@ -34,7 +39,7 @@ export class ChooseCustomerComponent {
|
||||
discounts: this.fb.array([]),
|
||||
});
|
||||
// Setup Account Autocomplete
|
||||
this.customers = (this.form.get('phone') as FormControl).valueChanges.pipe(
|
||||
this.customers = (this.form.get('phone') as UntypedFormControl).valueChanges.pipe(
|
||||
startWith(null),
|
||||
map((x) => (x === this.item.phone ? '' : x)),
|
||||
map((x) => (x !== null && x.length >= 1 ? x : null)),
|
||||
@@ -93,7 +98,7 @@ export class ChooseCustomerComponent {
|
||||
this.item.phone = formModel.phone;
|
||||
this.item.address = formModel.address;
|
||||
this.item.printInBill = formModel.printInBill;
|
||||
const array = this.form.get('discounts') as FormArray;
|
||||
const array = this.form.get('discounts') as UntypedFormArray;
|
||||
this.item.discounts.forEach((item, index) => {
|
||||
item.discount = Math.max(
|
||||
Math.min(round(array.controls[index].value.discount / 100, 5), 100),
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import {
|
||||
UntypedFormArray,
|
||||
UntypedFormBuilder,
|
||||
UntypedFormControl,
|
||||
UntypedFormGroup,
|
||||
Validators,
|
||||
} from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { round } from 'mathjs';
|
||||
import { Observable } from 'rxjs';
|
||||
@@ -14,14 +20,14 @@ import { DiscountItem } from './discount-item';
|
||||
})
|
||||
export class DiscountComponent {
|
||||
list: DiscountItem[] = [];
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
dataSource: DiscountDataSource = new DiscountDataSource([]);
|
||||
|
||||
displayedColumns = ['name', 'discount'];
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<DiscountComponent>,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
public data: Observable<DiscountItem[]>,
|
||||
) {
|
||||
@@ -49,10 +55,11 @@ export class DiscountComponent {
|
||||
}
|
||||
|
||||
accept(): void {
|
||||
const array = this.form.get('discounts') as FormArray;
|
||||
const array = this.form.get('discounts') as UntypedFormArray;
|
||||
for (let i = this.list.length - 1; i >= 0; i--) {
|
||||
const item = this.list[i];
|
||||
const control = (array.controls[i] as FormGroup).controls.discount as FormControl;
|
||||
const control = (array.controls[i] as UntypedFormGroup).controls
|
||||
.discount as UntypedFormControl;
|
||||
if (
|
||||
control.value === null ||
|
||||
control.value === '' ||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
@@ -8,12 +8,12 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
styleUrls: ['./pax.component.css'],
|
||||
})
|
||||
export class PaxComponent implements OnInit {
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<PaxComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: number,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
) {
|
||||
// Create form
|
||||
this.form = this.fb.group({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
import { MathService } from '../../shared/math.service';
|
||||
@@ -10,12 +10,12 @@ import { MathService } from '../../shared/math.service';
|
||||
styleUrls: ['./quantity.component.css'],
|
||||
})
|
||||
export class QuantityComponent implements OnInit {
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<QuantityComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: number,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private math: MathService,
|
||||
) {
|
||||
// Create form
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, ElementRef, Inject, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
import { ReasonDatasource } from './reason-datasource';
|
||||
@@ -11,7 +11,7 @@ import { ReasonDatasource } from './reason-datasource';
|
||||
})
|
||||
export class ReasonComponent {
|
||||
@ViewChild('son', { static: true }) son?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
dataSource: ReasonDatasource;
|
||||
title: string;
|
||||
selected = '';
|
||||
@@ -21,7 +21,7 @@ export class ReasonComponent {
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ReasonComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) private data: { title: string; reasons: string[] },
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
) {
|
||||
this.reasons = data.reasons || [];
|
||||
this.title = data.title;
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { Component, ElementRef, Inject, ViewChild } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import {
|
||||
UntypedFormArray,
|
||||
UntypedFormBuilder,
|
||||
UntypedFormControl,
|
||||
UntypedFormGroup,
|
||||
} from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { distinctUntilChanged, map, tap } from 'rxjs/operators';
|
||||
|
||||
@@ -25,14 +30,14 @@ export class ReceivePaymentComponent {
|
||||
reason = '';
|
||||
displayReason: boolean;
|
||||
displayTable: boolean;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
dataSource: ReceivePaymentDatasource;
|
||||
|
||||
displayedColumns = ['name', 'amount'];
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ReceivePaymentComponent>,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private ser: SettleOptionService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: { type: VoucherType; amount: number },
|
||||
) {
|
||||
@@ -81,7 +86,7 @@ export class ReceivePaymentComponent {
|
||||
}
|
||||
|
||||
listenToAmountChange() {
|
||||
const array = this.form.get('amounts') as FormArray;
|
||||
const array = this.form.get('amounts') as UntypedFormArray;
|
||||
this.choices.forEach((z, i) =>
|
||||
array.controls[i].valueChanges.pipe(distinctUntilChanged()).subscribe((x) => {
|
||||
(this.choices.find((s) => s.name === x.name) as ReceivePaymentItem).amount =
|
||||
@@ -101,8 +106,8 @@ export class ReceivePaymentComponent {
|
||||
}
|
||||
|
||||
maxAmount(row: ReceivePaymentItem, index: number) {
|
||||
const array = this.form.get('amounts') as FormArray;
|
||||
const ctrl = array.controls[index].get('amount') as FormControl;
|
||||
const array = this.form.get('amounts') as UntypedFormArray;
|
||||
const ctrl = array.controls[index].get('amount') as UntypedFormControl;
|
||||
ctrl.setValue('' + (row.amount + this.balance));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@@ -10,11 +10,11 @@ import { Observable } from 'rxjs';
|
||||
})
|
||||
export class SplitBillComponent {
|
||||
list: { id: string; name: string; selected: boolean }[] = [];
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<SplitBillComponent>,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
@Inject(MAT_DIALOG_DATA)
|
||||
public data: Observable<{ id: string; name: string; selected: boolean }[]>,
|
||||
) {
|
||||
@@ -37,7 +37,7 @@ export class SplitBillComponent {
|
||||
}
|
||||
|
||||
accept(): void {
|
||||
const array = this.form.get('saleCategories') as FormArray;
|
||||
const array = this.form.get('saleCategories') as UntypedFormArray;
|
||||
this.list.forEach((item, index) => {
|
||||
item.selected = array.controls[index].value.saleCategory;
|
||||
});
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import {
|
||||
AbstractControl,
|
||||
UntypedFormArray,
|
||||
UntypedFormBuilder,
|
||||
UntypedFormGroup,
|
||||
} from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@@ -22,7 +27,7 @@ import { SectionPrinterService } from './section-printer.service';
|
||||
})
|
||||
export class SectionPrinterComponent implements OnInit {
|
||||
@ViewChild('section', { static: true }) sectionElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
public listObservable = new BehaviorSubject<SectionPrinter[]>([]);
|
||||
dataSource: SectionPrinterDataSource = new SectionPrinterDataSource(this.listObservable);
|
||||
list: SectionPrinter[] = [];
|
||||
@@ -34,7 +39,7 @@ export class SectionPrinterComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private dialog: MatDialog,
|
||||
private ser: SectionPrinterService,
|
||||
@@ -119,7 +124,7 @@ export class SectionPrinterComponent implements OnInit {
|
||||
getItem(): SectionPrinter[] {
|
||||
const formModel = this.form.value;
|
||||
this.sectionId = formModel.section;
|
||||
const array = this.form.get('saleCategories') as FormArray;
|
||||
const array = this.form.get('saleCategories') as UntypedFormArray;
|
||||
this.list.forEach((item, index) => {
|
||||
const cont = array.controls[index].value;
|
||||
if (cont.printer === null || cont.printer === undefined) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -15,14 +15,14 @@ import { SectionService } from '../section.service';
|
||||
})
|
||||
export class SectionDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: Section = new Section();
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: SectionService,
|
||||
) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
||||
import { UntypedFormBuilder, FormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -23,7 +23,7 @@ export class SettingsComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private dialog: MatDialog,
|
||||
private toaster: ToasterService,
|
||||
public auth: AuthService,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -17,7 +17,7 @@ import { SettleOptionService } from '../settle-option.service';
|
||||
})
|
||||
export class SettleOptionDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: SettleOption = new SettleOption();
|
||||
voucherTypes: { id: number; name: string }[];
|
||||
reportingLevel: { id: number; name: string }[];
|
||||
@@ -26,7 +26,7 @@ export class SettleOptionDetailComponent implements OnInit, AfterViewInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: SettleOptionService,
|
||||
) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -16,7 +16,7 @@ import { TableService } from '../table.service';
|
||||
})
|
||||
export class TableDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
sections: Section[] = [];
|
||||
item: Table = new Table();
|
||||
|
||||
@@ -24,7 +24,7 @@ export class TableDetailComponent implements OnInit, AfterViewInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: TableService,
|
||||
) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
|
||||
@@ -16,7 +16,7 @@ import { TaxReportDatasource } from './tax-report-datasource';
|
||||
export class TaxReportComponent implements OnInit {
|
||||
info: TaxReport = new TaxReport();
|
||||
dataSource: TaxReportDatasource = new TaxReportDatasource(this.info.amounts);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'taxRate', 'saleAmount', 'taxAmount'];
|
||||
@@ -24,7 +24,7 @@ export class TaxReportComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
) {
|
||||
// Create form
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { round } from 'mathjs';
|
||||
@@ -16,14 +16,14 @@ import { TaxService } from '../tax.service';
|
||||
})
|
||||
export class TaxDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: Tax = new Tax();
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: TaxService,
|
||||
) {
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
@@ -18,7 +18,7 @@ import { TemporalProductService } from '../temporal-product.service';
|
||||
})
|
||||
export class TemporalProductDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('name', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
menuCategories: MenuCategory[] = [];
|
||||
saleCategories: SaleCategory[] = [];
|
||||
item: Product = new Product();
|
||||
@@ -27,7 +27,7 @@ export class TemporalProductDetailComponent implements OnInit, AfterViewInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private ser: TemporalProductService,
|
||||
) {
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { Observable } from 'rxjs';
|
||||
@@ -28,7 +28,7 @@ export class TemporalProductListComponent implements OnInit {
|
||||
this.data,
|
||||
);
|
||||
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
list: Product[][] = [];
|
||||
menuCategories: MenuCategory[] = [];
|
||||
saleCategories: SaleCategory[] = [];
|
||||
@@ -42,7 +42,7 @@ export class TemporalProductListComponent implements OnInit {
|
||||
'quantity',
|
||||
];
|
||||
|
||||
constructor(private route: ActivatedRoute, private fb: FormBuilder) {
|
||||
constructor(private route: ActivatedRoute, private fb: UntypedFormBuilder) {
|
||||
this.form = this.fb.group({
|
||||
filter: '',
|
||||
menuCategory: '',
|
||||
@@ -51,7 +51,7 @@ export class TemporalProductListComponent implements OnInit {
|
||||
this.data.subscribe((data: Product[][]) => {
|
||||
this.list = data;
|
||||
});
|
||||
this.searchFilter = (this.form.get('filter') as FormControl).valueChanges.pipe(
|
||||
this.searchFilter = (this.form.get('filter') as UntypedFormControl).valueChanges.pipe(
|
||||
startWith(''),
|
||||
debounceTime(150),
|
||||
distinctUntilChanged(),
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import {
|
||||
AbstractControl,
|
||||
UntypedFormArray,
|
||||
UntypedFormBuilder,
|
||||
UntypedFormGroup,
|
||||
} from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
import { map } from 'rxjs/operators';
|
||||
@@ -20,7 +25,7 @@ import { UpdateProductPricesService } from './update-product-prices.service';
|
||||
export class UpdateProductPricesComponent implements OnInit {
|
||||
info: UpdateProductPrices = new UpdateProductPrices();
|
||||
dataSource: UpdateProductPricesDataSource = new UpdateProductPricesDataSource(this.info.items);
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
menuCategories: MenuCategory[] = [];
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
@@ -29,7 +34,7 @@ export class UpdateProductPricesComponent implements OnInit {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toCsv: ToCsvService,
|
||||
private toaster: ToasterService,
|
||||
private ser: UpdateProductPricesService,
|
||||
@@ -95,7 +100,7 @@ export class UpdateProductPricesComponent implements OnInit {
|
||||
|
||||
getInfo(): UpdateProductPrices {
|
||||
const formModel = this.form.value;
|
||||
const array = this.form.get('prices') as FormArray;
|
||||
const array = this.form.get('prices') as UntypedFormArray;
|
||||
this.info.items.forEach((item, index) => {
|
||||
item.newPrice = array.controls[index].value.newPrice;
|
||||
});
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { AbstractControl, FormArray, FormBuilder, FormGroup } from '@angular/forms';
|
||||
import {
|
||||
AbstractControl,
|
||||
UntypedFormArray,
|
||||
UntypedFormBuilder,
|
||||
UntypedFormGroup,
|
||||
} from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
@@ -15,14 +20,14 @@ import { UserService } from '../user.service';
|
||||
})
|
||||
export class UserDetailComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('nameElement', { static: true }) nameElement?: ElementRef;
|
||||
form: FormGroup;
|
||||
form: UntypedFormGroup;
|
||||
item: User = new User();
|
||||
hide: boolean;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder,
|
||||
private fb: UntypedFormBuilder,
|
||||
private toaster: ToasterService,
|
||||
private dialog: MatDialog,
|
||||
private ser: UserService,
|
||||
@@ -116,7 +121,7 @@ export class UserDetailComponent implements OnInit, AfterViewInit {
|
||||
this.item.name = formModel.name;
|
||||
this.item.password = formModel.password;
|
||||
this.item.lockedOut = formModel.lockedOut;
|
||||
const array = this.form.get('roles') as FormArray;
|
||||
const array = this.form.get('roles') as UntypedFormArray;
|
||||
if (this.item.roles !== undefined) {
|
||||
this.item.roles.forEach((item, index) => {
|
||||
item.enabled = array.controls[index].value.role;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"experimentalDecorators": true,
|
||||
"moduleResolution": "node",
|
||||
"importHelpers": true,
|
||||
"target": "es2015",
|
||||
"target": "es2020",
|
||||
"module": "es2020",
|
||||
"lib": [
|
||||
"es2018",
|
||||
|
||||
Reference in new issue
Block a user