This commit is contained in:
2026-04-23 01:22:44 +03:30
parent e027b89173
commit 57f333f5b8
43 changed files with 16222 additions and 2847 deletions
@@ -18,7 +18,7 @@
<div class="">
<p-menu #menu [model]="profileMenuItems" [popup]="true" />
<button pButton (click)="menu.toggle($event)" icon="pi pi-user" severity="contrast">
{{ userInfo()?.username }}
{{ posProfile()?.account?.username }}
</button>
</div>
</div>
@@ -8,7 +8,8 @@ import { ButtonDirective } from 'primeng/button';
import { Card } from 'primeng/card';
import { Menu } from 'primeng/menu';
import images from 'src/assets/images';
import { PosStore } from '../pos.store';
import { PosProfileStore } from '../store';
import { PosStore } from '../store/pos.store';
import { PosChooseCardsComponent } from './choose-pos.component';
@Component({
@@ -27,13 +28,19 @@ import { PosChooseCardsComponent } from './choose-pos.component';
export class PosLayoutComponent {
constructor() {}
private readonly store = inject(PosStore);
private readonly posInfoStore = inject(PosStore);
private readonly posProfileStore = inject(PosProfileStore);
private readonly authService = inject(AuthService);
readonly loading = computed(() => this.store.loading());
readonly posInfo = computed(() => this.store.entity());
readonly error = computed(() => this.store.error());
readonly userInfo = computed(() => this.authService.currentAccount());
readonly posInfoLoading = computed(() => this.posInfoStore.loading());
readonly posInfo = computed(() => this.posInfoStore.entity());
readonly posInfoError = computed(() => this.posInfoStore.error());
readonly posProfileLoading = computed(() => this.posProfileStore.loading());
readonly posProfile = computed(() => this.posProfileStore.entity());
readonly posProfileError = computed(() => this.posProfileStore.error());
readonly loading = computed(() => this.posInfoLoading() || this.posProfileLoading());
readonly error = computed(() => this.posInfoError() || this.posProfileError());
logout = () => {
this.authService.logout();
@@ -57,7 +64,8 @@ export class PosLayoutComponent {
now = new Date();
getData() {
this.store.getData().subscribe();
this.posProfileStore.getData().subscribe();
this.posInfoStore.getData().subscribe();
}
onChoosePos() {