Skip to content

Commit 8b8f0b3

Browse files
committed
responsive header
1 parent b23d083 commit 8b8f0b3

44 files changed

Lines changed: 483 additions & 232 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ module.exports = defineConfig([
3131
style: "kebab-case",
3232
},
3333
],
34+
// eslint-disable-next-line
35+
"@angular-eslint/template/click-events-have-key-events": "off",
3436
},
3537
},
3638
{

src/app/components/cart/cart.component.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { Component, Input, Output, EventEmitter, signal } from "@angular/core";
1+
import {
2+
Component,
3+
Input,
4+
Output,
5+
EventEmitter,
6+
signal,
7+
inject,
8+
} from "@angular/core";
29
import { CommonModule } from "@angular/common";
310
import { TranslatePipe } from "../../pipes/translate.pipe";
411
import { CurrencyPipe } from "../../pipes/currency.pipe";
@@ -14,6 +21,8 @@ import { environment } from "@environments/environment";
1421
styleUrls: ["./cart.component.scss"],
1522
})
1623
export class CartComponent {
24+
cartService = inject(CartService);
25+
1726
@Input() cartItems: CartItem[] = [];
1827
@Input() salesTabs: { items: CartItem[] }[] = [];
1928
@Input() activeSaleTabIndex = 0;
@@ -34,7 +43,10 @@ export class CartComponent {
3443
@Output() internalSale = new EventEmitter<void>();
3544
@Output() closeMobileCart = new EventEmitter<void>();
3645

37-
constructor(public cartService: CartService) {}
46+
/** Inserted by Angular inject() migration for backwards compatibility */
47+
constructor(...args: unknown[]);
48+
49+
constructor() {}
3850

3951
getItemsBySupplier(): { supplier: string; items: CartItem[] }[] {
4052
const groups: Record<string, CartItem[]> = {};

src/app/components/cashier/cashier.component.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
ElementRef,
88
AfterViewInit,
99
OnInit,
10+
inject,
1011
} from "@angular/core";
1112
import { CommonModule } from "@angular/common";
1213
import { FormsModule } from "@angular/forms";
@@ -47,6 +48,16 @@ import { OpenRegisterComponent } from "../open-register/open-register.component"
4748
styleUrls: ["./cashier.component.scss"],
4849
})
4950
export class CashierComponent implements OnInit, AfterViewInit {
51+
private saleService = inject(SaleService);
52+
private cartService = inject(CartService);
53+
private authService = inject(AuthService);
54+
currencyService = inject(CurrencyService);
55+
private scaleService = inject(ScaleService);
56+
private receiptGeneratorService = inject(ReceiptGeneratorService);
57+
private registerService = inject(RegisterService);
58+
private toastService = inject(ToastService);
59+
private router = inject(Router);
60+
5061
@ViewChild(CalculatorComponent)
5162
calculator!: CalculatorComponent;
5263
@ViewChild("cashReceivedInput")
@@ -140,17 +151,10 @@ export class CashierComponent implements OnInit, AfterViewInit {
140151
});
141152
}
142153

143-
constructor(
144-
private saleService: SaleService,
145-
private cartService: CartService,
146-
private authService: AuthService,
147-
public currencyService: CurrencyService,
148-
private scaleService: ScaleService,
149-
private receiptGeneratorService: ReceiptGeneratorService,
150-
private registerService: RegisterService,
151-
private toastService: ToastService,
152-
private router: Router
153-
) {
154+
/** Inserted by Angular inject() migration for backwards compatibility */
155+
constructor(...args: unknown[]);
156+
157+
constructor() {
154158
// Subscribe to scale readings
155159
effect(() => {
156160
this.scaleService.currentWeight$.subscribe((reading) => {

src/app/components/client-screen/client-screen.component.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, OnDestroy, signal } from "@angular/core";
1+
import { Component, OnInit, OnDestroy, signal, inject } from "@angular/core";
22
import { CommonModule } from "@angular/common";
33
import { Router, ActivatedRoute } from "@angular/router";
44
import { CartService } from "../../services/cart.service";
@@ -15,6 +15,11 @@ import { environment } from "@environments/environment";
1515
styleUrls: ["./client-screen.component.scss"],
1616
})
1717
export class ClientScreenComponent implements OnInit, OnDestroy {
18+
private cartService = inject(CartService);
19+
private authService = inject(AuthService);
20+
private router = inject(Router);
21+
private route = inject(ActivatedRoute);
22+
1823
cartItems$ = this.cartService.cartItems$;
1924
// activeTab controls which panel is visible: 'fast' = Fast Cashier, 'pos' = POS Sales
2025
activeTab: "fast" | "pos" = "pos";
@@ -28,12 +33,10 @@ export class ClientScreenComponent implements OnInit, OnDestroy {
2833
private cartPollTimer: any;
2934

3035
apiUrl = environment.apiUrl;
31-
constructor(
32-
private cartService: CartService,
33-
private authService: AuthService,
34-
private router: Router,
35-
private route: ActivatedRoute
36-
) {}
36+
37+
/** Inserted by Angular inject() migration for backwards compatibility */
38+
constructor(...args: unknown[]);
39+
constructor() {}
3740

3841
ngOnInit(): void {
3942
const user = this.authService.getCurrentUser();

src/app/components/dashboard/dashboard.component.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, signal } from "@angular/core";
1+
import { Component, OnInit, signal, inject } from "@angular/core";
22
import { CommonModule } from "@angular/common";
33
import { Router } from "@angular/router";
44
import { TranslatePipe } from "../../pipes/translate.pipe";
@@ -49,6 +49,12 @@ interface DashboardStats {
4949
styleUrls: ["./dashboard.component.scss"],
5050
})
5151
export class DashboardComponent implements OnInit {
52+
private saleService = inject(SaleService);
53+
private productService = inject(ProductService);
54+
private userService = inject(UserService);
55+
private authService = inject(AuthService);
56+
private router = inject(Router);
57+
5258
stats = signal<DashboardStats>({
5359
totalSales: 0,
5460
totalRevenue: 0,
@@ -64,13 +70,10 @@ export class DashboardComponent implements OnInit {
6470
isLoading = signal<boolean>(true);
6571
currentUser = this.authService.getCurrentUser();
6672

67-
constructor(
68-
private saleService: SaleService,
69-
private productService: ProductService,
70-
private userService: UserService,
71-
private authService: AuthService,
72-
private router: Router
73-
) {}
73+
/** Inserted by Angular inject() migration for backwards compatibility */
74+
constructor(...args: unknown[]);
75+
76+
constructor() {}
7477

7578
ngOnInit(): void {
7679
this.loadDashboardData();

src/app/components/favorites/favorites.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
Output,
66
EventEmitter,
77
signal,
8+
inject,
89
} from "@angular/core";
910
import { CommonModule } from "@angular/common";
1011
import { Subject, takeUntil, timeout, catchError, of } from "rxjs";
@@ -22,14 +23,19 @@ import { environment } from "@environments/environment";
2223
styleUrls: ["./favorites.component.scss"],
2324
})
2425
export class FavoritesComponent implements OnInit, OnDestroy {
26+
private productService = inject(ProductService);
27+
2528
@Output() productSelected = new EventEmitter<Product>();
2629

2730
products: Product[] = [];
2831
isLoading = signal(false);
2932
loadError = signal(false);
3033
private destroy$ = new Subject<void>();
3134

32-
constructor(private productService: ProductService) {}
35+
/** Inserted by Angular inject() migration for backwards compatibility */
36+
constructor(...args: unknown[]);
37+
38+
constructor() {}
3339

3440
ngOnInit(): void {
3541
this.loadTopProducts();

src/app/components/global-search/global-search.component.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
(keypress)="onSearchKeyPress($event)"
1111
[placeholder]="'GLOBAL.SEARCH_PLACEHOLDER' | translate"
1212
/>
13-
<i
14-
*ngIf="searchQuery"
15-
class="fas fa-times clear-icon"
16-
(click)="searchQuery = ''"
17-
></i>
13+
@if (searchQuery) {
14+
<i class="fas fa-times clear-icon" (click)="searchQuery = ''"></i>
15+
}
1816
</div>
1917
</div>

src/app/components/global-search/global-search.component.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,16 @@
5757
// Responsive
5858
@media (max-width: $breakpoint-md) {
5959
.global-search {
60-
max-width: 100%;
60+
width: 100%;
6161

6262
.search-wrapper {
6363
.search-input {
6464
font-size: $font-size-sm;
65+
66+
padding-right: $spacing-sm;
67+
}
68+
.clear-icon {
69+
right: $spacing-sm;
6570
}
6671
}
6772
}

src/app/components/global-search/global-search.component.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ViewChild,
66
ElementRef,
77
HostListener,
8+
inject,
89
} from "@angular/core";
910
import { CommonModule } from "@angular/common";
1011
import { FormsModule } from "@angular/forms";
@@ -25,6 +26,12 @@ import { TranslatePipe } from "@app/pipes/translate.pipe";
2526
styleUrls: ["./global-search.component.scss"],
2627
})
2728
export class GlobalSearchComponent implements OnInit, OnDestroy {
29+
private productService = inject(ProductService);
30+
private cartService = inject(CartService);
31+
private searchStateService = inject(SearchStateService);
32+
private router = inject(Router);
33+
private toastService = inject(ToastService);
34+
2835
searchQuery = "";
2936
private searchSubject = new Subject<string>();
3037
private destroy$ = new Subject<void>();
@@ -34,13 +41,10 @@ export class GlobalSearchComponent implements OnInit, OnDestroy {
3441
@ViewChild("globalSearchInput")
3542
globalSearchInput!: ElementRef<HTMLInputElement>;
3643

37-
constructor(
38-
private productService: ProductService,
39-
private cartService: CartService,
40-
private searchStateService: SearchStateService,
41-
private router: Router,
42-
private toastService: ToastService
43-
) {}
44+
/** Inserted by Angular inject() migration for backwards compatibility */
45+
constructor(...args: unknown[]);
46+
47+
constructor() {}
4448

4549
ngOnInit(): void {
4650
// Setup search debouncing

src/app/components/inventory-session/inventory-session.component.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ViewChild,
66
ElementRef,
77
signal,
8+
inject,
89
} from "@angular/core";
910
import { CommonModule } from "@angular/common";
1011
import { FormsModule } from "@angular/forms";
@@ -52,6 +53,14 @@ interface InventorySession {
5253
styleUrls: ["./inventory-session.component.scss"],
5354
})
5455
export class InventorySessionComponent implements OnInit, OnDestroy {
56+
private productService = inject(ProductService);
57+
private authService = inject(AuthService);
58+
private toastService = inject(ToastService);
59+
private translation = inject(TranslationService);
60+
private router = inject(Router);
61+
private route = inject(ActivatedRoute);
62+
private searchStateService = inject(SearchStateService);
63+
5564
private destroy$ = new Subject<void>();
5665
currentUser: User | null = null;
5766

@@ -74,15 +83,10 @@ export class InventorySessionComponent implements OnInit, OnDestroy {
7483
return environment.apiUrl;
7584
}
7685

77-
constructor(
78-
private productService: ProductService,
79-
private authService: AuthService,
80-
private toastService: ToastService,
81-
private translation: TranslationService,
82-
private router: Router,
83-
private route: ActivatedRoute,
84-
private searchStateService: SearchStateService
85-
) {}
86+
/** Inserted by Angular inject() migration for backwards compatibility */
87+
constructor(...args: unknown[]);
88+
89+
constructor() {}
8690

8791
ngOnInit(): void {
8892
this.currentUser = this.authService.getCurrentUser();

0 commit comments

Comments
 (0)