feat: streamline routing and layout initialization for POS module

This commit is contained in:
2026-05-11 16:24:57 +03:30
parent 3e48e8fd5c
commit 88adb566eb
4 changed files with 13 additions and 14 deletions
+7 -7
View File
@@ -10,13 +10,13 @@ export const appRoutes: Routes = [
{ {
path: '', path: '',
loadComponent: () => import('@/layout/default/app.layout.component').then((m) => m.AppLayout), loadComponent: () => import('@/layout/default/app.layout.component').then((m) => m.AppLayout),
children: [ children: [SUPER_ADMIN_ROUTES, CONSUMER_ROUTES, PROVIDER_ROUTES, PARTNER_ROUTES],
SUPER_ADMIN_ROUTES, },
CONSUMER_ROUTES, {
PROVIDER_ROUTES, path: 'pos',
PARTNER_ROUTES, loadComponent: () =>
...POS_ROUTES.children!, import('@/domains/pos/layouts/layout.component').then((m) => m.PosLayoutComponent),
], children: [POS_ROUTES],
}, },
{ {
@@ -25,7 +25,6 @@
<!-- [ngStyle]="{ transform: 'scale(1.' + pullDistance() * 10 + ')' }" --> <!-- [ngStyle]="{ transform: 'scale(1.' + pullDistance() * 10 + ')' }" -->
</div> </div>
} }
{{ isAuth() }}
@if (isAuth()) { @if (isAuth()) {
@defer (when isAuth()) { @defer (when isAuth()) {
<router-outlet></router-outlet> <router-outlet></router-outlet>
@@ -116,6 +116,10 @@ export class PosPagesLayoutComponent implements AfterViewInit {
this.getData(); this.getData();
} }
ngOnInit() {
this.layoutService.changeIsFullPage(true);
}
ngAfterViewInit() { ngAfterViewInit() {
this.layoutService.setTopbarStartSlot(this.topbarStart); this.layoutService.setTopbarStartSlot(this.topbarStart);
this.layoutService.setTopbarCenterSlot(this.topbarCenter); this.layoutService.setTopbarCenterSlot(this.topbarCenter);
@@ -61,10 +61,6 @@
</div> </div>
</div> </div>
@defer (when isVisibleCustomerForm()) {
<pos-order-customer-dialog [(visible)]="isVisibleCustomerForm" (onSubmit)="submitCustomer()" /> <pos-order-customer-dialog [(visible)]="isVisibleCustomerForm" (onSubmit)="submitCustomer()" />
}
<!-- <pos-pre-invoice-dialog [(visible)]="isVisiblePreInvoiceForm" /> --> <!-- <pos-pre-invoice-dialog [(visible)]="isVisiblePreInvoiceForm" /> -->
@defer (when isVisiblePaymentForm()) {
<pos-payment-form-dialog [(visible)]="isVisiblePaymentForm" (onSubmit)="submitPayment($event)" /> <pos-payment-form-dialog [(visible)]="isVisiblePaymentForm" (onSubmit)="submitPayment($event)" />
}