diff --git a/.vscode/launch.json b/.vscode/launch.json
index b6e3c66..88cd19c 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -29,9 +29,9 @@
"args": [
"barker.main:app",
"--host",
- "127.0.0.1",
+ "0.0.0.0",
"--port",
- "8000",
+ "9995",
"--reload"
],
"cwd": "${workspaceFolder}/barker",
diff --git a/bookie/src/app/beer-sale-report/beer-sale-report.component.html b/bookie/src/app/beer-sale-report/beer-sale-report.component.html
index 7909281..3b425b9 100644
--- a/bookie/src/app/beer-sale-report/beer-sale-report.component.html
+++ b/bookie/src/app/beer-sale-report/beer-sale-report.component.html
@@ -42,13 +42,13 @@
Sale Category
- @for (sc of saleCategories(); track sc) {
+ @for (sc of saleCategories(); track sc.id) {
{{ sc.name }}
}
- @for (error of form.saleCategory().errors(); track error) {
+ @for (error of form.saleCategory().errors(); track $index) {
{{ error.message }}
}
diff --git a/bookie/src/app/bundles/bundle-detail/bundle-detail-dialog.component.html b/bookie/src/app/bundles/bundle-detail/bundle-detail-dialog.component.html
index 4fb8d60..b10cccd 100644
--- a/bookie/src/app/bundles/bundle-detail/bundle-detail-dialog.component.html
+++ b/bookie/src/app/bundles/bundle-detail/bundle-detail-dialog.component.html
@@ -1,39 +1,33 @@
-@if (productsResource.isLoading()) {
-
-} @else if (productsResource.error()) {
-
-} @else {
-
Edit Bundle Item
+Edit Bundle Item
-
-
-
-
-
-
-}
+
+
+
+
diff --git a/bookie/src/app/bundles/bundle-detail/bundle-detail-dialog.component.ts b/bookie/src/app/bundles/bundle-detail/bundle-detail-dialog.component.ts
index a554f1d..7768279 100644
--- a/bookie/src/app/bundles/bundle-detail/bundle-detail-dialog.component.ts
+++ b/bookie/src/app/bundles/bundle-detail/bundle-detail-dialog.component.ts
@@ -10,8 +10,6 @@ import { MatInputModule } from '@angular/material/input';
import { ProductQuery } from '../../core/product-query';
import { ProductService } from '../../product/product.service';
-import { ErrorStateComponent } from '../../shared/error-state/error-state.component';
-import { SkeletonLoaderComponent } from '../../shared/skeleton-loader/skeleton-loader.component';
import { BundleItem } from '../bundle';
export interface BundleDetailDialogFormData {
@@ -35,8 +33,6 @@ export interface BundleDetailDialogFormData {
MatFormFieldModule,
MatInputModule,
FormField,
- ErrorStateComponent,
- SkeletonLoaderComponent,
],
})
export class BundleDetailDialogComponent {
@@ -62,12 +58,15 @@ export class BundleDetailDialogComponent {
return typeof p === 'string' ? p.trim() : '';
});
- debouncedProduct = debounced(this.productSignal, 150);
+ debouncedProduct = debounced(this.productSignal, 300);
productsResource = this.productSer.query(this.debouncedProduct.value);
- products = computed(() => {
- if (!this.debouncedProduct.value()) return [];
- return this.productsResource.value() ?? [];
+ products = linkedSignal({
+ source: () => this.productsResource.value(),
+ computation: (newVal, previous) => {
+ if (!this.debouncedProduct.value()) return [];
+ return newVal ?? previous?.value ?? [];
+ },
});
displayFn(product?: ProductQuery | string): string {
diff --git a/bookie/src/app/bundles/bundle-detail/bundle-detail.component.html b/bookie/src/app/bundles/bundle-detail/bundle-detail.component.html
index fc6af9a..aa7ba1d 100644
--- a/bookie/src/app/bundles/bundle-detail/bundle-detail.component.html
+++ b/bookie/src/app/bundles/bundle-detail/bundle-detail.component.html
@@ -28,7 +28,7 @@
Menu Category
- @for (mc of menuCategories(); track mc) {
+ @for (mc of menuCategories(); track mc.id) {
{{ mc.name }}
@@ -39,7 +39,7 @@
Sale Category
- @for (sc of saleCategories(); track sc) {
+ @for (sc of saleCategories(); track sc.id) {
{{ sc.name }}
@@ -71,7 +71,7 @@
[value]="displayFn(formModel().addRow.sku)"
/>
- @for (p of itemProducts(); track p) {
+ @for (p of itemProducts(); track p.id) {
{{ p.name }}
}
diff --git a/bookie/src/app/bundles/bundle-detail/bundle-detail.component.ts b/bookie/src/app/bundles/bundle-detail/bundle-detail.component.ts
index d09b66f..8c5abb7 100644
--- a/bookie/src/app/bundles/bundle-detail/bundle-detail.component.ts
+++ b/bookie/src/app/bundles/bundle-detail/bundle-detail.component.ts
@@ -109,11 +109,15 @@ export class BundleDetailComponent {
return typeof v === 'string' ? v : null;
});
- debouncedItemProduct = debounced(this.itemProductSearch, 150);
+ debouncedItemProduct = debounced(this.itemProductSearch, 300);
itemProductsResource = this.productSer.query(this.debouncedItemProduct.value);
- itemProducts = computed(() => {
- return this.itemProductsResource.value() ?? [];
+ itemProducts = linkedSignal({
+ source: () => this.itemProductsResource.value(),
+ computation: (newVal, previous) => {
+ if (!this.debouncedItemProduct.value()) return [];
+ return newVal ?? previous?.value ?? [];
+ },
});
displayedColumns = ['name', 'quantity', 'salePrice', 'printInBill', 'action'];
diff --git a/bookie/src/app/bundles/bundle-list/bundle-list.component.html b/bookie/src/app/bundles/bundle-list/bundle-list.component.html
index aa82bbc..07ca0ba 100644
--- a/bookie/src/app/bundles/bundle-list/bundle-list.component.html
+++ b/bookie/src/app/bundles/bundle-list/bundle-list.component.html
@@ -25,7 +25,7 @@
Menu Category
-- All Bundles --
- @for (mc of menuCategoriesResource.value(); track mc) {
+ @for (mc of menuCategoriesResource.value(); track mc.id) {
{{ mc.name }}
@@ -73,7 +73,7 @@
Items
- @for (item of row.items; track item) {
+ @for (item of row.items; track item.id) {
{{ item.printInBill ? 'visibility' : 'visibility_off' }}
diff --git a/bookie/src/app/cashier-report/cashier-report.component.html b/bookie/src/app/cashier-report/cashier-report.component.html
index 4ea8ec4..4a6bdf0 100644
--- a/bookie/src/app/cashier-report/cashier-report.component.html
+++ b/bookie/src/app/cashier-report/cashier-report.component.html
@@ -46,7 +46,7 @@
Cashier
-- Cashier --
- @for (ac of cashiers(); track ac) {
+ @for (ac of cashiers(); track ac.id) {
{{ ac.name }}
diff --git a/bookie/src/app/customers/customer-detail/customer-detail.component.html b/bookie/src/app/customers/customer-detail/customer-detail.component.html
index 121e94a..d7b2d7a 100644
--- a/bookie/src/app/customers/customer-detail/customer-detail.component.html
+++ b/bookie/src/app/customers/customer-detail/customer-detail.component.html
@@ -28,7 +28,7 @@
- @for (r of item().discounts; track r; let i = $index) {
+ @for (r of item().discounts; track r.id; let i = $index) {
Discount on {{ r.name }}
diff --git a/bookie/src/app/customers/customer-list/customer-list.component.html b/bookie/src/app/customers/customer-list/customer-list.component.html
index 3e4239b..279623b 100644
--- a/bookie/src/app/customers/customer-list/customer-list.component.html
+++ b/bookie/src/app/customers/customer-list/customer-list.component.html
@@ -50,7 +50,7 @@
Discounts
- @for (discount of row.discounts; track discount) {
+ @for (discount of row.discounts; track discount.id) {
- {{ discount.name }} - {{ discount.discount | percent: '1.2-2' }}
}
diff --git a/bookie/src/app/devices/device-detail/device-detail.component.html b/bookie/src/app/devices/device-detail/device-detail.component.html
index 7fe5021..1c1f324 100644
--- a/bookie/src/app/devices/device-detail/device-detail.component.html
+++ b/bookie/src/app/devices/device-detail/device-detail.component.html
@@ -15,7 +15,7 @@
Section
- @for (s of sections(); track s) {
+ @for (s of sections(); track s.id) {
{{ s.name }}
diff --git a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html
index 44f26c8..1fc6ecb 100644
--- a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html
+++ b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html
@@ -22,7 +22,7 @@
[displayWith]="displayFn"
(optionSelected)="selected($event)"
>
- @for (customer of customers(); track customer) {
+ @for (customer of customers(); track customer.id) {
{{ customer.name }} - {{ customer.phone }}
}
diff --git a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts
index 03d3bfd..5cfc2e5 100644
--- a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts
+++ b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts
@@ -95,12 +95,15 @@ export class GuestBookDetailComponent {
return typeof p === 'string' ? p.trim() : (p as Customer).phone;
});
- debouncedPhone = debounced(this.phoneSignal, 150);
+ debouncedPhone = debounced(this.phoneSignal, 300);
customersResource = this.customerService.autocomplete(computed(() => this.debouncedPhone.value()));
- customers = computed(() => {
- if (!this.debouncedPhone.value()) return [];
- return this.customersResource.value() ?? [];
+ customers = linkedSignal({
+ source: () => this.customersResource.value(),
+ computation: (newVal, previous) => {
+ if (!this.debouncedPhone.value()) return [];
+ return newVal ?? previous?.value ?? [];
+ },
});
constructor() {
diff --git a/bookie/src/app/header-footer/header-footer.component.html b/bookie/src/app/header-footer/header-footer.component.html
index 5220ccd..a408bd6 100644
--- a/bookie/src/app/header-footer/header-footer.component.html
+++ b/bookie/src/app/header-footer/header-footer.component.html
@@ -8,7 +8,7 @@
Header / Footer
- @for (s of list(); track s) {
+ @for (s of list(); track s.id) {
{{ s.name }}
diff --git a/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.html b/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.html
index caad6d2..e11696e 100644
--- a/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.html
+++ b/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.html
@@ -47,12 +47,12 @@
Products
- @for (mc of row.menuCategories; track mc) {
+ @for (mc of row.menuCategories; track mc.id) {
-
{{ mc.name }}
@if (!mc.enabled) {
- @for (p of mc.skus; track p) {
+ @for (p of mc.skus; track p.id) {
- {{ p.name }}
}
diff --git a/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.html b/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.html
index e0e95b8..c626e72 100644
--- a/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.html
+++ b/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.html
@@ -24,13 +24,13 @@
Category
- @for (mc of modifierCategories(); track mc) {
+ @for (mc of modifierCategories(); track mc.id) {
{{ mc.name }}
}
- @for (error of form.modifierCategory().errors(); track error) {
+ @for (error of form.modifierCategory().errors(); track $index) {
{{ error.message }}
}
diff --git a/bookie/src/app/product/product-detail/product-detail-dialog.component.html b/bookie/src/app/product/product-detail/product-detail-dialog.component.html
index a4ca500..49c219b 100644
--- a/bookie/src/app/product/product-detail/product-detail-dialog.component.html
+++ b/bookie/src/app/product/product-detail/product-detail-dialog.component.html
@@ -5,7 +5,7 @@
Units
- @for (error of form.units().errors(); track error) {
+ @for (error of form.units().errors(); track $index) {
{{ error.message }}
}
@@ -13,7 +13,7 @@
Fraction
- @for (error of form.fraction().errors(); track error) {
+ @for (error of form.fraction().errors(); track $index) {
{{ error.message }}
}
@@ -21,7 +21,7 @@
Yield
- @for (error of form.productYield().errors(); track error) {
+ @for (error of form.productYield().errors(); track $index) {
{{ error.message }}
}
@@ -29,7 +29,7 @@
Cost Price
- @for (error of form.costPrice().errors(); track error) {
+ @for (error of form.costPrice().errors(); track $index) {
{{ error.message }}
}
@@ -37,7 +37,7 @@
Sale Price
- @for (error of form.salePrice().errors(); track error) {
+ @for (error of form.salePrice().errors(); track $index) {
{{ error.message }}
}
@@ -45,7 +45,7 @@
Menu Category
- @for (mc of menuCategories; track mc) {
+ @for (mc of menuCategories; track mc.id) {
{{ mc.name }}
diff --git a/bookie/src/app/product/product-detail/product-detail.component.html b/bookie/src/app/product/product-detail/product-detail.component.html
index 945f6aa..3054943 100644
--- a/bookie/src/app/product/product-detail/product-detail.component.html
+++ b/bookie/src/app/product/product-detail/product-detail.component.html
@@ -19,7 +19,7 @@
Sale Category
- @for (sc of saleCategories(); track sc) {
+ @for (sc of saleCategories(); track sc.id) {
{{ sc.name }}
@@ -35,7 +35,7 @@
Units
- @for (error of form.addRow.units().errors(); track error) {
+ @for (error of form.addRow.units().errors(); track $index) {
{{ error.message }}
}
@@ -43,7 +43,7 @@
Fraction
- @for (error of form.addRow.fraction().errors(); track error) {
+ @for (error of form.addRow.fraction().errors(); track $index) {
{{ error.message }}
}
@@ -51,7 +51,7 @@
Yield
- @for (error of form.addRow.productYield().errors(); track error) {
+ @for (error of form.addRow.productYield().errors(); track $index) {
{{ error.message }}
}
@@ -59,7 +59,7 @@
Cost Price
- @for (error of form.addRow.costPrice().errors(); track error) {
+ @for (error of form.addRow.costPrice().errors(); track $index) {
{{ error.message }}
}
@@ -67,7 +67,7 @@
Sale Price
- @for (error of form.addRow.salePrice().errors(); track error) {
+ @for (error of form.addRow.salePrice().errors(); track $index) {
{{ error.message }}
}
@@ -75,13 +75,13 @@
Menu Category
- @for (mc of menuCategories(); track mc) {
+ @for (mc of menuCategories(); track mc.id) {
{{ mc.name }}
}
- @for (error of form.addRow.menuCategory().errors(); track error) {
+ @for (error of form.addRow.menuCategory().errors(); track $index) {
{{ error.message }}
}
diff --git a/bookie/src/app/product/product-list/product-list.component.html b/bookie/src/app/product/product-list/product-list.component.html
index af0cbce..6ae22dd 100644
--- a/bookie/src/app/product/product-list/product-list.component.html
+++ b/bookie/src/app/product/product-list/product-list.component.html
@@ -32,7 +32,7 @@
Menu Category
-- All Products --
- @for (mc of menuCategoriesResource.value(); track mc) {
+ @for (mc of menuCategoriesResource.value(); track mc.id) {
{{ mc.name }}
@@ -54,7 +54,7 @@
Name
- @for (sku of row.skus; track sku) {
+ @for (sku of row.skus; track sku.id) {
-
{{ row.name }} ({{ sku.units }})
@@ -68,7 +68,7 @@
Price
- @for (sku of row.skus; track sku) {
+ @for (sku of row.skus; track sku.id) {
-
{{ sku.salePrice | currency: 'INR' }}
@@ -82,7 +82,7 @@
Menu Category
- @for (sku of row.skus; track sku) {
+ @for (sku of row.skus; track sku.id) {
-
{{ sku.menuCategory.name }}
@@ -102,7 +102,7 @@
Details
- @for (sku of row.skus; track sku) {
+ @for (sku of row.skus; track sku.id) {
-
@@ -127,7 +127,7 @@
Quantity
- @for (sku of row.skus; track sku) {
+ @for (sku of row.skus; track sku.id) {
- {{ sku.fraction | number: '1.2-2' }}{{ row.fractionUnits }}
}
diff --git a/bookie/src/app/roles/role-detail/role-detail.component.html b/bookie/src/app/roles/role-detail/role-detail.component.html
index 57a0f9e..d48d89c 100644
--- a/bookie/src/app/roles/role-detail/role-detail.component.html
+++ b/bookie/src/app/roles/role-detail/role-detail.component.html
@@ -15,7 +15,7 @@
Permissions
- @for (p of form.permissions; track p; let i = $index) {
+ @for (p of form.permissions; track p.id().value() || i; let i = $index) {
Includes Roles
- @for (r of form.includedRoles; track r; let i = $index) {
+ @for (r of form.includedRoles; track r.id().value() || i; let i = $index) {
{{ r.name().value() }}
diff --git a/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.html b/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.html
index 6b0c351..c61c494 100644
--- a/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.html
+++ b/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.html
@@ -22,7 +22,7 @@
Tax
- @for (t of taxes(); track t) {
+ @for (t of taxes(); track t.id) {
{{ t.name }}
diff --git a/bookie/src/app/sales/bill-number/bill-number.component.html b/bookie/src/app/sales/bill-number/bill-number.component.html
index 6a5405d..adfabe2 100644
--- a/bookie/src/app/sales/bill-number/bill-number.component.html
+++ b/bookie/src/app/sales/bill-number/bill-number.component.html
@@ -4,7 +4,7 @@
Regime
- @for (r of regimes; track r) {
+ @for (r of regimes; track r.id) {
{{ r.name }}
diff --git a/bookie/src/app/sales/choose-customer/choose-customer.component.html b/bookie/src/app/sales/choose-customer/choose-customer.component.html
index 4598dee..853ca7b 100644
--- a/bookie/src/app/sales/choose-customer/choose-customer.component.html
+++ b/bookie/src/app/sales/choose-customer/choose-customer.component.html
@@ -19,7 +19,7 @@
[displayWith]="displayFn"
(optionSelected)="selected($event)"
>
- @for (customer of customers(); track customer) {
+ @for (customer of customers(); track customer.id) {
{{ customer.name }} - {{ customer.phone }}
}
diff --git a/bookie/src/app/sales/choose-customer/choose-customer.component.ts b/bookie/src/app/sales/choose-customer/choose-customer.component.ts
index 796d3aa..20681a7 100644
--- a/bookie/src/app/sales/choose-customer/choose-customer.component.ts
+++ b/bookie/src/app/sales/choose-customer/choose-customer.component.ts
@@ -66,11 +66,15 @@ export class ChooseCustomerComponent {
return typeof p === 'string' ? p.trim() : null;
});
- debouncedPhone = debounced(this.phoneSignal, 150);
+ debouncedPhone = debounced(this.phoneSignal, 300);
customersResource = this.ser.autocomplete(this.debouncedPhone.value);
- customers = computed(() => {
- return this.customersResource.value() ?? [];
+ customers = linkedSignal({
+ source: () => this.customersResource.value(),
+ computation: (newVal, previous) => {
+ if (!this.debouncedPhone.value()) return [];
+ return newVal ?? previous?.value ?? [];
+ },
});
save() {
diff --git a/bookie/src/app/sales/menu-categories/menu-categories.component.html b/bookie/src/app/sales/menu-categories/menu-categories.component.html
index 7d1fb89..2a2dae5 100644
--- a/bookie/src/app/sales/menu-categories/menu-categories.component.html
+++ b/bookie/src/app/sales/menu-categories/menu-categories.component.html
@@ -7,7 +7,7 @@
Back
- @for (item of list(); track item) {
+ @for (item of list(); track item.id) {
Back
- @for (item of list(); track item) {
+ @for (item of list(); track item.id) {
Running Tables
- @for (table of list(); track table) {
+ @for (table of list(); track table.id) {