From 1f9166bed38062d12a5f254561ad4c25a5801c8e Mon Sep 17 00:00:00 2001 From: ahasani194 Date: Tue, 2 Jun 2026 12:22:32 +0330 Subject: [PATCH] some ui fix and debug input field, separate price field --- agents.md | 1 + pnpm-lock.yaml | 33 +--- src/app/core/services/toast.service.ts | 8 + .../components/goldPrice/form.component.html | 3 +- .../components/goldPrice/form.component.ts | 4 +- .../components/filter-drawer.component.html | 4 +- .../components/filter-drawer.component.ts | 2 + .../components/list.component.html | 2 +- .../saleInvoices/components/list.component.ts | 12 +- .../customers/unknown/form.component.html | 2 +- .../payment/form-dialog.component.html | 13 +- .../payment/form-dialog.component.ts | 5 +- .../components/views/grid-view.component.html | 10 +- .../components/views/grid-view.component.ts | 3 +- .../components/views/list-view.component.html | 6 +- .../components/views/list-view.component.ts | 3 +- .../amount-percentage-input.component.html | 18 +- .../amount-percentage-input.component.ts | 32 +++- .../components/fields/cash.component.ts | 13 -- src/app/shared/components/fields/index.ts | 4 - .../components/fields/set_off.component.ts | 13 -- .../components/fields/terminal.component.ts | 13 -- .../components/fields/unit_price.component.ts | 20 --- .../form-footer-actions.component.html | 2 +- .../components/input/input.component.html | 64 +++---- .../components/input/input.component.ts | 166 +++++++++--------- .../input/price-input.component.html | 28 +++ .../components/input/price-input.component.ts | 107 +++++++++++ .../posPayment/gold-form.component.html | 2 +- .../posPayment/gold-form.component.ts | 2 + .../posPayment/standard-form.component.html | 2 +- .../posPayment/standard-form.component.ts | 2 + .../season-picker-dialog.component.html | 11 +- .../season-picker-dialog.component.ts | 7 +- 34 files changed, 335 insertions(+), 282 deletions(-) delete mode 100644 src/app/shared/components/fields/cash.component.ts delete mode 100644 src/app/shared/components/fields/set_off.component.ts delete mode 100644 src/app/shared/components/fields/terminal.component.ts delete mode 100644 src/app/shared/components/fields/unit_price.component.ts create mode 100644 src/app/shared/components/input/price-input.component.html create mode 100644 src/app/shared/components/input/price-input.component.ts diff --git a/agents.md b/agents.md index d15f868..71c5d66 100644 --- a/agents.md +++ b/agents.md @@ -202,6 +202,7 @@ Never output: - "I wonder..." - "Maybe..." - implementation deliberation +- "It sounds..." Never explain alternative approaches unless requested. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 486ace2..b7e585c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44,9 +44,6 @@ importers: '@tailwindcss/postcss': specifier: ^4.2.3 version: 4.2.3 - '@zoomit/dayjs-jalali-plugin': - specifier: ^0.1.11 - version: 0.1.11 angularx-qrcode: specifier: 20.0.0 version: 20.0.0(@angular/core@20.3.19(@angular/compiler@20.3.19)(rxjs@7.8.2)) @@ -56,12 +53,6 @@ importers: dayjs: specifier: ^1.11.20 version: 1.11.20 - flatpickr: - specifier: ^4.6.13 - version: 4.6.13 - flatpickr-wrap: - specifier: ^1.0.0 - version: 1.0.0 jalaliday: specifier: ^3.1.1 version: 3.1.1(dayjs@1.11.20) @@ -2817,9 +2808,6 @@ packages: '@yarnpkg/lockfile@1.1.0': resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==} - '@zoomit/dayjs-jalali-plugin@0.1.11': - resolution: {integrity: sha512-xqbrBPRoBhbaAWeLbqq9QERZwj+h2KuJMehpOQrlT4y980oA+rdiF/YzXlzVaIvc845UYDrsTp8IDwttWyV/xg==} - abbrev@4.0.0: resolution: {integrity: sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==} engines: {node: ^20.17.0 || >=22.9.0} @@ -3956,12 +3944,6 @@ packages: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true - flatpickr-wrap@1.0.0: - resolution: {integrity: sha512-ctthNBZyDJe1P2fpLF7N7ivwDQGkWAAr7R5BLZ2BSlz9O+w4NEc68M7FNvK/UPUPNj3FQ2pGV8UNZV/9WBU9/Q==} - - flatpickr@4.6.13: - resolution: {integrity: sha512-97PMG/aywoYpB4IvbvUJi0RQi8vearvU0oov1WW3k0WZPBMrTQVqekSX5CjSG/M4Q3i6A/0FKXC7RyAoAUUSPw==} - flatted@3.4.2: resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==} @@ -4229,7 +4211,7 @@ packages: engines: {node: '>=0.10.0'} iconv-lite@0.7.2: - resolution: {integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==} + resolution: {integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==, tarball: https://hub.megan.ir/repository/npm/iconv-lite/-/iconv-lite-0.7.2.tgz} engines: {node: '>=0.10.0'} icss-utils@5.1.0: @@ -5085,9 +5067,6 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - native-date-adapter@1.0.3: - resolution: {integrity: sha512-WXA6496dHy79BS35CWbeBha1A1QV5LjezaTA5bFWV3LXrwiRT9YXE5LJc+SSEgbN7QHz++xJnjhMHZAXMKIqAg==} - natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -9450,8 +9429,6 @@ snapshots: '@yarnpkg/lockfile@1.1.0': {} - '@zoomit/dayjs-jalali-plugin@0.1.11': {} - abbrev@4.0.0: {} abort-controller@3.0.0: @@ -10884,12 +10861,6 @@ snapshots: flat@5.0.2: {} - flatpickr-wrap@1.0.0: - dependencies: - native-date-adapter: 1.0.3 - - flatpickr@4.6.13: {} - flatted@3.4.2: {} follow-redirects@1.16.0(debug@4.4.3): @@ -12106,8 +12077,6 @@ snapshots: nanoid@3.3.11: {} - native-date-adapter@1.0.3: {} - natural-compare@1.4.0: {} needle@3.5.0: diff --git a/src/app/core/services/toast.service.ts b/src/app/core/services/toast.service.ts index 415c2bd..20e79a7 100644 --- a/src/app/core/services/toast.service.ts +++ b/src/app/core/services/toast.service.ts @@ -10,10 +10,18 @@ interface IToast extends Pick { providedIn: 'root', }) export class ToastService { + private readonly dedupeWindowMs = 2000; + private readonly recentMessages = new Map(); + constructor(private messageService: MessageService) {} add(message: ToastMessageOptions) { if (!message.detail) return; + const dedupeKey = `${message.severity ?? ''}|${message.summary ?? ''}|${message.detail}`; + const now = Date.now(); + const lastShownAt = this.recentMessages.get(dedupeKey); + if (lastShownAt && now - lastShownAt < this.dedupeWindowMs) return; + this.recentMessages.set(dedupeKey, now); this.messageService.add(message); } diff --git a/src/app/domains/pos/modules/configs/components/goldPrice/form.component.html b/src/app/domains/pos/modules/configs/components/goldPrice/form.component.html index a4e2707..9b43158 100644 --- a/src/app/domains/pos/modules/configs/components/goldPrice/form.component.html +++ b/src/app/domains/pos/modules/configs/components/goldPrice/form.component.html @@ -1,7 +1,6 @@ - diff --git a/src/app/domains/pos/modules/configs/components/goldPrice/form.component.ts b/src/app/domains/pos/modules/configs/components/goldPrice/form.component.ts index eba001b..e5d1a69 100644 --- a/src/app/domains/pos/modules/configs/components/goldPrice/form.component.ts +++ b/src/app/domains/pos/modules/configs/components/goldPrice/form.component.ts @@ -1,4 +1,4 @@ -import { InputComponent } from '@/shared/components'; +import { PriceInputComponent } from '@/shared/components/input/price-input.component'; import { Component, inject } from '@angular/core'; import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { debounce, timer } from 'rxjs'; @@ -7,7 +7,7 @@ import { PosConfigGoldPriceService } from './services/main.service'; @Component({ selector: 'pos-config-gold-price-form', templateUrl: 'form.component.html', - imports: [ReactiveFormsModule, InputComponent], + imports: [ReactiveFormsModule, PriceInputComponent], }) export class PosConfigGoldPriceFormComponent { private readonly service = inject(PosConfigGoldPriceService); diff --git a/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.html b/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.html index 3e868c6..97ac7b7 100644 --- a/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.html +++ b/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.html @@ -48,8 +48,8 @@ -->
- - + +
diff --git a/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.ts b/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.ts index 8bb2ce6..382d477 100644 --- a/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.ts +++ b/src/app/domains/pos/modules/saleInvoices/components/filter-drawer.component.ts @@ -2,6 +2,7 @@ import { Maybe } from '@/core'; import { EnumSelectComponent } from '@/shared/apiEnum/select.component'; import { TspProviderResponseStatus } from '@/shared/catalog'; import { InputComponent } from '@/shared/components'; +import { PriceInputComponent } from '@/shared/components/input/price-input.component'; import { DatepickerComponent } from '@/uikit'; import { nowGregorian } from '@/utils'; import { @@ -32,6 +33,7 @@ import { IPosSaleInvoicesFilterDto } from '../models'; EnumSelectComponent, InputComponent, DatepickerComponent, + PriceInputComponent, ], }) export class PosSaleInvoicesFilterDrawerComponent implements OnChanges { diff --git a/src/app/domains/pos/modules/saleInvoices/components/list.component.html b/src/app/domains/pos/modules/saleInvoices/components/list.component.html index d2d6da3..f8ee6de 100644 --- a/src/app/domains/pos/modules/saleInvoices/components/list.component.html +++ b/src/app/domains/pos/modules/saleInvoices/components/list.component.html @@ -54,4 +54,4 @@ [visible]="filterVisible()" [value]="filters()" (visibleChange)="filterVisible.set($event)" - (apply)="onFilterApply($event)" /> + (apply)="changeFilter($event)" /> diff --git a/src/app/domains/pos/modules/saleInvoices/components/list.component.ts b/src/app/domains/pos/modules/saleInvoices/components/list.component.ts index 34cd190..7c7a375 100644 --- a/src/app/domains/pos/modules/saleInvoices/components/list.component.ts +++ b/src/app/domains/pos/modules/saleInvoices/components/list.component.ts @@ -112,6 +112,12 @@ export class PosSaleInvoiceListComponent { this.filterVisible.update((v) => !v); } + changeFilter(query: IPosSaleInvoicesFilterDto) { + const { page, ...rest } = query; + this.resetPage(); + this.onFilterApply(rest); + } + onFilterApply(query: IPosSaleInvoicesFilterDto) { this.filters.set(query); this.syncFiltersToQueryParams(); @@ -119,6 +125,7 @@ export class PosSaleInvoiceListComponent { } removeFilter(key: keyof IPosSaleInvoicesFilterDto) { + this.resetPage(); const next = { ...this.filters() }; delete next[key]; this.filters.set(next); @@ -126,6 +133,10 @@ export class PosSaleInvoiceListComponent { this.getData(); } + resetPage() { + this.filters.update((val) => ({ ...val, page: 1 })); + } + toSinglePage(item: IPosSaleInvoicesResponse) { this.router.navigateByUrl(posSaleInvoicesNamedRoutes.saleInvoice.meta.pagePath!(item.id)); } @@ -160,7 +171,6 @@ export class PosSaleInvoiceListComponent { } private syncFiltersToQueryParams() { - this.filters.update((val) => ({ ...val, page: 1 })); const queryParams = Object.entries(this.filters()).reduce>( (acc, [key, value]) => { if (value !== undefined && value !== null && value !== '') { diff --git a/src/app/domains/pos/modules/shop/components/customers/unknown/form.component.html b/src/app/domains/pos/modules/shop/components/customers/unknown/form.component.html index be9cf3a..62f7bd5 100644 --- a/src/app/domains/pos/modules/shop/components/customers/unknown/form.component.html +++ b/src/app/domains/pos/modules/shop/components/customers/unknown/form.component.html @@ -1,5 +1,5 @@
- + diff --git a/src/app/domains/pos/modules/shop/components/payment/form-dialog.component.html b/src/app/domains/pos/modules/shop/components/payment/form-dialog.component.html index e92f1d7..50f7312 100644 --- a/src/app/domains/pos/modules/shop/components/payment/form-dialog.component.html +++ b/src/app/domains/pos/modules/shop/components/payment/form-dialog.component.html @@ -36,7 +36,7 @@ (onChange)="changePayByTerminalSteps($event.value)" /> @for (terminalControl of terminalControls; track $index) { - - + }
- - + @if (isGoldGuild()) { - + - + } +
+ @if (!good.is_default_guild_good) { +
+ +
+ } {{ good.name }} - @if (!good.is_default_guild_good) { - * - }
diff --git a/src/app/domains/pos/modules/shop/components/views/grid-view.component.ts b/src/app/domains/pos/modules/shop/components/views/grid-view.component.ts index ecde740..b177172 100644 --- a/src/app/domains/pos/modules/shop/components/views/grid-view.component.ts +++ b/src/app/domains/pos/modules/shop/components/views/grid-view.component.ts @@ -11,6 +11,7 @@ import { } from '@angular/core'; import { ButtonDirective } from 'primeng/button'; import { Skeleton } from 'primeng/skeleton'; +import { Tag } from 'primeng/tag'; import images from 'src/assets/images'; import { PosLandingStore } from '../../store/main.store'; import { FavoriteCTAComponent } from './favorite-CTA.component'; @@ -19,7 +20,7 @@ import { FavoriteCTAComponent } from './favorite-CTA.component'; selector: 'pos-good-grid-view', templateUrl: './grid-view.component.html', changeDetection: ChangeDetectionStrategy.OnPush, - imports: [ButtonDirective, Skeleton, FavoriteCTAComponent], + imports: [ButtonDirective, Skeleton, FavoriteCTAComponent, Tag], }) export class PosGoodsGridViewComponent { @Output() onAdd = new EventEmitter(); diff --git a/src/app/domains/pos/modules/shop/components/views/list-view.component.html b/src/app/domains/pos/modules/shop/components/views/list-view.component.html index 90e41d1..d120125 100644 --- a/src/app/domains/pos/modules/shop/components/views/list-view.component.html +++ b/src/app/domains/pos/modules/shop/components/views/list-view.component.html @@ -17,9 +17,9 @@
{{ good.name }} - @if (!good.is_default_guild_good) { - * - } + {{ good.sku.code }} diff --git a/src/app/domains/pos/modules/shop/components/views/list-view.component.ts b/src/app/domains/pos/modules/shop/components/views/list-view.component.ts index 5eb016a..736d262 100644 --- a/src/app/domains/pos/modules/shop/components/views/list-view.component.ts +++ b/src/app/domains/pos/modules/shop/components/views/list-view.component.ts @@ -11,6 +11,7 @@ import { } from '@angular/core'; import { ButtonDirective } from 'primeng/button'; import { Skeleton } from 'primeng/skeleton'; +import { Tag } from 'primeng/tag'; import images from 'src/assets/images'; import { PosLandingStore } from '../../store/main.store'; import { FavoriteCTAComponent } from './favorite-CTA.component'; @@ -19,7 +20,7 @@ import { FavoriteCTAComponent } from './favorite-CTA.component'; selector: 'pos-goods-list-view', templateUrl: './list-view.component.html', changeDetection: ChangeDetectionStrategy.OnPush, - imports: [ButtonDirective, Skeleton, FavoriteCTAComponent], + imports: [ButtonDirective, Skeleton, FavoriteCTAComponent, Tag], }) export class PosGoodsListViewComponent { private readonly store = inject(PosLandingStore); diff --git a/src/app/shared/components/amountPercentageInput/amount-percentage-input.component.html b/src/app/shared/components/amountPercentageInput/amount-percentage-input.component.html index fae0144..f3722bd 100644 --- a/src/app/shared/components/amountPercentageInput/amount-percentage-input.component.html +++ b/src/app/shared/components/amountPercentageInput/amount-percentage-input.component.html @@ -3,10 +3,9 @@ [name]="name" [control]="selectedType.value === 'amount' ? amountControl : percentageControl" [showLabel]="!!label" - [showErrors]="showErrors" -> + [showErrors]="showErrors"> -
+
{{ preparedLabel() }} @@ -17,7 +16,7 @@ - @if (selectedType.value === "amount") { + @if (selectedType.value === 'amount') { + [invalid]="amountControl.invalid && (amountControl.touched || amountControl.dirty)" /> } @else { + [invalid]="percentageControl.invalid && (percentageControl.touched || percentageControl.dirty)" /> } @@ -60,8 +57,7 @@ tabindex="-1" optionValue="value" size="small" - class="border-none! shadow-none! w-full!" - /> + class="w-full! border-none! shadow-none!" /> @if (hint) { diff --git a/src/app/shared/components/amountPercentageInput/amount-percentage-input.component.ts b/src/app/shared/components/amountPercentageInput/amount-percentage-input.component.ts index 4fdd4a8..011681f 100644 --- a/src/app/shared/components/amountPercentageInput/amount-percentage-input.component.ts +++ b/src/app/shared/components/amountPercentageInput/amount-percentage-input.component.ts @@ -97,10 +97,32 @@ export class AmountPercentageInputComponent { private lastValidAmount = 0; private lastValidPercentage = 0; - private parseValue(value: Maybe) { - const normalized = `${value ?? ''}`.replace(/,/g, ''); - const parsed = parseFloat(normalized); - return Number.isFinite(parsed) ? parsed : 0; + private toEnglishDigits(value: string): string { + return value + .replace(/[۰-۹]/g, (digit) => String(digit.charCodeAt(0) - 1776)) + .replace(/[٠-٩]/g, (digit) => String(digit.charCodeAt(0) - 1632)); + } + + private sanitizeNumericValue(value: string, allowDecimal: boolean): string { + const normalized = this.toEnglishDigits(value).replace(/,/g, ''); + + const cleaned = normalized.replace(allowDecimal ? /[^0-9.]/g : /[^0-9]/g, ''); + if (!allowDecimal) return cleaned; + + const [integerPart = '', ...decimalParts] = cleaned.split('.'); + const mergedDecimals = decimalParts.join(''); + return decimalParts.length ? `${integerPart}.${mergedDecimals}` : integerPart; + } + + private parseValue(value: Maybe) { + const cleanedValue = this.sanitizeNumericValue( + value || '', + this.selectedType.value === 'percentage' + ); + + console.log('cleaned', cleanedValue); + + return Number.isFinite(cleanedValue) ? Number(cleanedValue) : 0; } private getRangeLabel(value: number, isPercentageType: boolean) { @@ -115,7 +137,7 @@ export class AmountPercentageInputComponent { value: number, isPercentageType: boolean, min = 0, - max = Number.MAX_SAFE_INTEGER, + max = Number.MAX_SAFE_INTEGER ) { if (value < min) { this.toastService.warn({ diff --git a/src/app/shared/components/fields/cash.component.ts b/src/app/shared/components/fields/cash.component.ts deleted file mode 100644 index eb64b4b..0000000 --- a/src/app/shared/components/fields/cash.component.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { FormControl, ReactiveFormsModule } from '@angular/forms'; -import { InputComponent } from '../input/input.component'; - -@Component({ - selector: 'field-cash', - template: ``, - imports: [ReactiveFormsModule, InputComponent], -}) -export class CashComponent { - @Input({ required: true }) control = new FormControl(''); - @Input() name = 'cash'; -} diff --git a/src/app/shared/components/fields/index.ts b/src/app/shared/components/fields/index.ts index 8b44f74..4e60196 100644 --- a/src/app/shared/components/fields/index.ts +++ b/src/app/shared/components/fields/index.ts @@ -1,6 +1,5 @@ export * from './address.component'; export * from './branch_code.component'; -export * from './cash.component'; export * from './code.component'; export * from './company_name.component'; export * from './description.component'; @@ -28,10 +27,7 @@ export * from './quantity.component'; export * from './registration_code.component'; export * from './registration_number.component'; export * from './serial_number.component'; -export * from './set_off.component'; export * from './sku.component'; export * from './sku_type.component'; -export * from './terminal.component'; -export * from './unit_price.component'; export * from './username.component'; export * from './vat.component'; diff --git a/src/app/shared/components/fields/set_off.component.ts b/src/app/shared/components/fields/set_off.component.ts deleted file mode 100644 index e5d28a0..0000000 --- a/src/app/shared/components/fields/set_off.component.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { FormControl, ReactiveFormsModule } from '@angular/forms'; -import { InputComponent } from '../input/input.component'; - -@Component({ - selector: 'field-set-off', - template: ``, - imports: [ReactiveFormsModule, InputComponent], -}) -export class SetOffComponent { - @Input({ required: true }) control = new FormControl(''); - @Input() name = 'set_off'; -} diff --git a/src/app/shared/components/fields/terminal.component.ts b/src/app/shared/components/fields/terminal.component.ts deleted file mode 100644 index fe22b34..0000000 --- a/src/app/shared/components/fields/terminal.component.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { FormControl, ReactiveFormsModule } from '@angular/forms'; -import { InputComponent } from '../input/input.component'; - -@Component({ - selector: 'field-terminal', - template: ``, - imports: [ReactiveFormsModule, InputComponent], -}) -export class TerminalComponent { - @Input({ required: true }) control = new FormControl(''); - @Input() name = 'terminal'; -} diff --git a/src/app/shared/components/fields/unit_price.component.ts b/src/app/shared/components/fields/unit_price.component.ts deleted file mode 100644 index ec1b8ce..0000000 --- a/src/app/shared/components/fields/unit_price.component.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { FormControl, ReactiveFormsModule } from '@angular/forms'; -import { InputComponent } from '../input/input.component'; - -@Component({ - selector: 'field-unit-price', - template: ``, - imports: [ReactiveFormsModule, InputComponent], -}) -export class UnitPriceComponent { - @Input({ required: true }) control = new FormControl(''); - @Input() name = 'unit_price'; - @Input() hint = ''; -} diff --git a/src/app/shared/components/formFooterActions/form-footer-actions.component.html b/src/app/shared/components/formFooterActions/form-footer-actions.component.html index 35f487a..5f79c53 100644 --- a/src/app/shared/components/formFooterActions/form-footer-actions.component.html +++ b/src/app/shared/components/formFooterActions/form-footer-actions.component.html @@ -1,5 +1,5 @@
- + + (click)="selectSeason(seasonItem)"> }
- -
- -
diff --git a/src/app/shared/components/seasonPicker/season-picker-dialog.component.ts b/src/app/shared/components/seasonPicker/season-picker-dialog.component.ts index 5a47396..98bea63 100644 --- a/src/app/shared/components/seasonPicker/season-picker-dialog.component.ts +++ b/src/app/shared/components/seasonPicker/season-picker-dialog.component.ts @@ -5,7 +5,6 @@ import { Component, computed, EventEmitter, Input, Output, signal } from '@angul import { FormsModule } from '@angular/forms'; import { ButtonDirective, ButtonSeverity } from 'primeng/button'; import { SharedLightBottomsheetComponent } from '../dialog/light-bottomsheet.component'; -import { FormFooterActionsComponent } from '../formFooterActions/form-footer-actions.component'; type SeasonKey = 0 | 1 | 2 | 3; @@ -22,7 +21,6 @@ interface SeasonItem { CommonModule, FormsModule, SharedLightBottomsheetComponent, - FormFooterActionsComponent, ButtonDirective, UikitLabelComponent, ], @@ -40,10 +38,11 @@ export class SeasonPickerDialogComponent extends AbstractDialog { isSeasonDisabled = computed(() => this.selectedYear >= this.selectedYearDraft()); - onSubmit(): void { + selectSeason(season: SeasonItem) { + this.selectedSeasonDraft.set(season.key); this.submit.emit({ year: this.selectedYearDraft(), - season: this.selectedSeasonDraft(), + season: season.key, }); this.close(); }