From 88f45eee389164c96054a164d139e3485399efad Mon Sep 17 00:00:00 2001 From: ahasani194 Date: Tue, 9 Jun 2026 13:31:48 +0330 Subject: [PATCH] refactor: update labels and translations in various components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed 'تغییر گذرواژه' to 'تغییر رمز عبور' in layout.component.ts - Updated HTML structure in list.component.html and saleInvoices components for consistency and improved styling. - Modified sale-invoice-card.component.html to enhance the display of invoice details. - Adjusted sale-invoice-card.component.ts to handle customer types more effectively. - Enhanced the handling of invoice statuses in saleInvoices components. - Improved layout and styling in shop components for better user experience. - Refactored key-value component for better readability and maintainability. - Updated upload file component to streamline file selection process. - Added new styles in customize.scss and psp.scss for consistent UI. - Adjusted environment configuration for better API endpoint management. --- angular.json | 8 ++ .../accounts/components/form.component.html | 2 +- .../salesInvoices/list.component.html | 2 +- .../reset-password-card.component.html | 11 +- .../reset-password-card.component.ts | 4 +- .../components/list.component.html | 2 +- .../accounts/components/form.component.html | 2 +- .../reset-password-card.component.html | 11 +- .../reset-password-card.component.ts | 4 +- .../components/change-password.component.ts | 2 +- .../layouts/pagesLayout/layout.component.ts | 2 +- .../components/list.component.html | 2 +- .../components/list.component.html | 10 +- .../sale-invoice-card.component.html | 12 +- .../components/sale-invoice-card.component.ts | 24 ++-- .../pos/modules/saleInvoices/models/io.d.ts | 23 ++-- .../saleInvoices/views/single.component.html | 2 + .../saleInvoices/views/single.component.ts | 7 +- .../order/order-card-template.component.html | 32 +++-- .../views/categories.component.html | 19 +-- .../components/views/list-view.component.html | 2 +- .../modules/shop/views/root.component.html | 2 +- .../pos/modules/shop/views/root.component.ts | 2 +- .../invoice-type-card.component.html | 2 +- .../statistics/views/root.component.html | 110 +++++++++--------- .../layout/default/app.layout.component.html | 26 ++--- .../saleInvoices/views/single.component.html | 2 +- .../change-password-form-dialog.component.ts | 13 ++- .../confirmation-dialog.component.html | 2 +- .../correctionForm/form.component.html | 2 +- .../sale-invoice-single-view.component.html | 11 +- .../sale-invoice-single-view.component.ts | 25 ++-- .../key-value.component.html | 21 ++-- .../uploadFile/upload-file.component.html | 12 +- .../uploadFile/upload-file.component.ts | 23 +++- .../datepicker/datepicker.component.html | 2 +- src/assets/customize.scss | 4 +- src/assets/layout/_core.scss | 6 - src/assets/layout/_main.scss | 18 +-- src/assets/psp.scss | 7 ++ src/environments/environment.tis.ts | 5 +- 41 files changed, 240 insertions(+), 238 deletions(-) create mode 100644 src/assets/psp.scss diff --git a/angular.json b/angular.json index 2d9b2f2..ec228eb 100644 --- a/angular.json +++ b/angular.json @@ -100,6 +100,10 @@ "input": "public-tis" } ], + "styles": [ + "src/assets/styles.scss", + "src/assets/psp.scss" + ], "budgets": [ { "maximumError": "3MB", @@ -144,6 +148,10 @@ "input": "public-tis" } ], + "styles": [ + "src/assets/styles.scss", + "src/assets/psp.scss" + ], "budgets": [ { "maximumError": "2.5MB", diff --git a/src/app/domains/consumer/modules/accounts/components/form.component.html b/src/app/domains/consumer/modules/accounts/components/form.component.html index 203ddde..bd0d79f 100644 --- a/src/app/domains/consumer/modules/accounts/components/form.component.html +++ b/src/app/domains/consumer/modules/accounts/components/form.component.html @@ -1,5 +1,5 @@ -
+ + -
diff --git a/src/app/domains/consumer/modules/profile/components/reset-password-card.component.ts b/src/app/domains/consumer/modules/profile/components/reset-password-card.component.ts index 114f35b..03ee30b 100644 --- a/src/app/domains/consumer/modules/profile/components/reset-password-card.component.ts +++ b/src/app/domains/consumer/modules/profile/components/reset-password-card.component.ts @@ -25,7 +25,7 @@ export class ConsumerResetPasswordCardComponent { password: fieldControl.password(), confirmPassword: fieldControl.confirmPassword(), }, - { validators: [MustMatch('password', 'confirmPassword')] }, + { validators: [MustMatch('password', 'confirmPassword')] } ); submit() { @@ -40,7 +40,7 @@ export class ConsumerResetPasswordCardComponent { .pipe(finalize(() => this.loading.set(false))) .subscribe(() => { this.form.reset(); - this.toastService.success({ text: 'گذرواژه با موفقیت به‌روز شد.' }); + this.toastService.success({ text: 'رمز عبور با موفقیت به‌روز شد.' }); }); } } diff --git a/src/app/domains/consumer/modules/saleInvoices/components/list.component.html b/src/app/domains/consumer/modules/saleInvoices/components/list.component.html index 023f4ac..ae9dfe6 100644 --- a/src/app/domains/consumer/modules/saleInvoices/components/list.component.html +++ b/src/app/domains/consumer/modules/saleInvoices/components/list.component.html @@ -1,5 +1,5 @@ -
+ + -
diff --git a/src/app/domains/partner/modules/profile/components/reset-password-card.component.ts b/src/app/domains/partner/modules/profile/components/reset-password-card.component.ts index 2ac8dd8..46f7cc8 100644 --- a/src/app/domains/partner/modules/profile/components/reset-password-card.component.ts +++ b/src/app/domains/partner/modules/profile/components/reset-password-card.component.ts @@ -25,7 +25,7 @@ export class PartnerResetPasswordCardComponent { password: fieldControl.password(), confirmPassword: fieldControl.confirmPassword(), }, - { validators: [MustMatch('password', 'confirmPassword')] }, + { validators: [MustMatch('password', 'confirmPassword')] } ); submit() { @@ -40,7 +40,7 @@ export class PartnerResetPasswordCardComponent { .pipe(finalize(() => this.loading.set(false))) .subscribe(() => { this.form.reset(); - this.toastService.success({ text: 'گذرواژه با موفقیت به‌روز شد.' }); + this.toastService.success({ text: 'رمز عبور با موفقیت به‌روز شد.' }); }); } } diff --git a/src/app/domains/pos/components/change-password.component.ts b/src/app/domains/pos/components/change-password.component.ts index 5bbb080..7532d02 100644 --- a/src/app/domains/pos/components/change-password.component.ts +++ b/src/app/domains/pos/components/change-password.component.ts @@ -27,7 +27,7 @@ export class PosChangePasswordComponent extends AbstractDialog { .pipe(finalize(() => this.submitLoading.set(false))) .subscribe(() => { this.toastService.success({ - text: 'تغییر گذرواژه با موفقیت انجام شد.', + text: 'تغییر رمز عبور با موفقیت انجام شد.', }); this.submitLoading.set(false); this.close(); diff --git a/src/app/domains/pos/layouts/pagesLayout/layout.component.ts b/src/app/domains/pos/layouts/pagesLayout/layout.component.ts index 7352374..80650c0 100644 --- a/src/app/domains/pos/layouts/pagesLayout/layout.component.ts +++ b/src/app/domains/pos/layouts/pagesLayout/layout.component.ts @@ -81,7 +81,7 @@ export class PosPagesLayoutComponent { disabled: true, }, { - label: 'تغییر گذرواژه', + label: 'تغییر رمز عبور', icon: 'pi pi-key', command: this.showChangePasswordDialog, }, diff --git a/src/app/domains/pos/modules/goodsManagement/components/list.component.html b/src/app/domains/pos/modules/goodsManagement/components/list.component.html index 2830339..4eecf17 100644 --- a/src/app/domains/pos/modules/goodsManagement/components/list.component.html +++ b/src/app/domains/pos/modules/goodsManagement/components/list.component.html @@ -16,7 +16,7 @@ } } @else { @for (good of items(); track good.id) { -
+
- +
@for (filter of activeFilters(); track filter.key) { @if (filter.key !== 'page') { - + + {{ filter.label }}: {{ filter.value }} + } }
diff --git a/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.html b/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.html index 5adea42..fe8e1b7 100644 --- a/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.html +++ b/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.html @@ -1,18 +1,18 @@
- {{ saleInvoice.invoice_number }} - {{ saleInvoice.code }} + {{ saleInvoice.invoice_number }}

-
- - {{ preparedInvoiceType() }} - +
+ - + + {{ preparedInvoiceType() }} +

diff --git a/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.ts b/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.ts index aca79d6..574a57a 100644 --- a/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.ts +++ b/src/app/domains/pos/modules/saleInvoices/components/sale-invoice-card.component.ts @@ -50,20 +50,20 @@ export class SaleInvoiceCardComponent { ); preparedInvoiceType = computed(() => { if (!this.saleInvoice) return ''; - const { customer } = this.saleInvoice; + const { customer, unknown_customer } = this.saleInvoice; - if (customer) { - const { legal, individual } = customer; - let text = 'نوع اول - '; - if (legal) { - text += `حقوقی (${legal.company_name})`; + if (unknown_customer?.name || unknown_customer?.national_code) { + return `${unknown_customer.name || unknown_customer?.national_code || 'رهگذر'} (نوع دوم)`; + } else if (customer) { + const { legal, individual, type } = customer; + switch (type) { + case 'INDIVIDUAL': + return `${individual ? individual.first_name + ' ' + individual.last_name : '-----'} (نوع اول)`; + case 'LEGAL': + return `${legal?.name || '-----'} (نوع اول)`; } - if (individual) { - text += `حقیقی (${individual.first_name} ${individual.last_name})`; - } - return text; } - return 'نوع دوم (بدون اطلاعات خریدار)'; + return 'رهگذر (نوع دوم)'; }); sendInvoice() { @@ -103,7 +103,7 @@ export class SaleInvoiceCardComponent { .retrySendToTsp(this.saleInvoice.id) .pipe(finalize(() => this.resendingLoading.set(false))) .subscribe((res) => { - if (res.status === 'FAILURE') { + if (res.status === 'SEND_FAILURE') { this.toastService.error({ text: res.message || 'خطا در ارسال مجدد صورت‌حساب‌ رخ داده است.', }); diff --git a/src/app/domains/pos/modules/saleInvoices/models/io.d.ts b/src/app/domains/pos/modules/saleInvoices/models/io.d.ts index b20d1c4..49c8b0b 100644 --- a/src/app/domains/pos/modules/saleInvoices/models/io.d.ts +++ b/src/app/domains/pos/modules/saleInvoices/models/io.d.ts @@ -2,6 +2,7 @@ import { Maybe } from '@/core'; import ISummary from '@/core/models/summary'; import { InvoiceTypes, TspProviderResponseStatus } from '@/shared/catalog'; import { IEnumTranslate } from '@/shared/models/enum_translate.type'; +import { IIndividualCustomer, ILegalCustomer } from '../../shop/models'; export interface IPosSaleInvoicesSummaryRawResponse { id: string; @@ -10,6 +11,7 @@ export interface IPosSaleInvoicesSummaryRawResponse { invoice_date: string; created_at: string; total_amount: string; + unknown_customer: Partial; customer: Maybe; status: IEnumTranslate; type: IEnumTranslate; @@ -30,6 +32,10 @@ export interface IPosSaleInvoicesRawResponse extends IPosSaleInvoicesSummaryRawR export interface IPosSaleInvoicesResponse extends IPosSaleInvoicesRawResponse {} +interface UnknownCoustomer { + name?: string; + national_code?: string; +} interface ConsumerAccount { role: string; account: Account; @@ -55,19 +61,6 @@ interface Payments { interface Customer { type: string; - individual: Individual; - legal: Legal; -} - -interface Individual { - first_name: string; - last_name: string; - national_code: string; - mobile_number: string; -} - -interface Legal { - company_name: string; - economic_code: string; - registration_number: string; + individual: IIndividualCustomer; + legal: ILegalCustomer; } diff --git a/src/app/domains/pos/modules/saleInvoices/views/single.component.html b/src/app/domains/pos/modules/saleInvoices/views/single.component.html index b92f920..548fa4d 100644 --- a/src/app/domains/pos/modules/saleInvoices/views/single.component.html +++ b/src/app/domains/pos/modules/saleInvoices/views/single.component.html @@ -4,7 +4,9 @@ [backRoute]="backRoute()" [sendToTspLoading]="sendToTspLoading()" [inquiryLoading]="inquiryLoading()" + [resendToTspLoading]="resendToTspLoading()" (onSendToTsp)="sendToTsp()" + (onResendToTsp)="resendToTsp()" (onInquiry)="inquiry()" (onCorrection)="correction($event)" (onReturnFromSale)="returnFromSale($event)" diff --git a/src/app/domains/pos/modules/saleInvoices/views/single.component.ts b/src/app/domains/pos/modules/saleInvoices/views/single.component.ts index f81c7ed..2d11ba1 100644 --- a/src/app/domains/pos/modules/saleInvoices/views/single.component.ts +++ b/src/app/domains/pos/modules/saleInvoices/views/single.component.ts @@ -78,7 +78,12 @@ export class PosSaleInvoiceComponent { this.resendToTspLoading.set(false); }) ) - .subscribe(); + .subscribe((res) => { + this.toastService.success({ + text: res.message || 'ارسال مجدد صورت‌حساب با موفقیت انجام شد.', + }); + this.store.updateStatus(res.status); + }); } correction(data: IPosCorrectionRequest) { this.correctionLoading.set(true); diff --git a/src/app/domains/pos/modules/shop/components/order/order-card-template.component.html b/src/app/domains/pos/modules/shop/components/order/order-card-template.component.html index 04eda23..58a6264 100644 --- a/src/app/domains/pos/modules/shop/components/order/order-card-template.component.html +++ b/src/app/domains/pos/modules/shop/components/order/order-card-template.component.html @@ -1,21 +1,20 @@ -
-
+
+
-
-
-
-
-
- + class="bg-surface-100 border-surface-border h-24 w-24 shrink-0 rounded-md border object-cover" /> +
+
+
+
+
+ {{ inOrderGood.good.name }}
- + {{ inOrderGood.quantity }} {{ inOrderGood.good.measure_unit.name }}
@@ -23,7 +22,7 @@ } @else {
- +
} @@ -36,8 +35,7 @@ size="small" severity="secondary" class="ms-auto" - (click)="editOrderItem()" - > + (click)="editOrderItem()"> + (click)="removeGoodFromOrder()">
@@ -58,6 +55,5 @@ [(visible)]="visible" [good]="inOrderGood.good" [initialValues]="inOrderGood" - [orderItemId]="inOrderGood.id" - /> + [orderItemId]="inOrderGood.id" /> } diff --git a/src/app/domains/pos/modules/shop/components/views/categories.component.html b/src/app/domains/pos/modules/shop/components/views/categories.component.html index df83d2f..ef31be1 100644 --- a/src/app/domains/pos/modules/shop/components/views/categories.component.html +++ b/src/app/domains/pos/modules/shop/components/views/categories.component.html @@ -1,31 +1,32 @@
-
+
@if (loading()) { @for (i of [1, 2, 3, 4, 5]; track i) { - +
+ +
} } @else { @for (category of categories(); track category.id) {
- {{ category.name }} + (click)="changeSelectedCategory(category)"> + {{ category.name }}
+ "> {{ category.goods_count }}
} + }
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 d120125..bb6d471 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 @@ -7,7 +7,7 @@ } } @else { @for (good of visibleGoods(); track good.id) { -
+
diff --git a/src/app/domains/pos/modules/shop/views/root.component.ts b/src/app/domains/pos/modules/shop/views/root.component.ts index 574824a..3f36bf8 100644 --- a/src/app/domains/pos/modules/shop/views/root.component.ts +++ b/src/app/domains/pos/modules/shop/views/root.component.ts @@ -17,7 +17,7 @@ import { PosLandingStore } from '../store/main.store'; @Component({ selector: 'pos-shop', templateUrl: './root.component.html', - host: { class: 'grow overflow-hidden' }, + host: { class: 'grow' }, changeDetection: ChangeDetectionStrategy.OnPush, imports: [ diff --git a/src/app/domains/pos/modules/statistics/components/invoice-type-card.component.html b/src/app/domains/pos/modules/statistics/components/invoice-type-card.component.html index 517d36b..444006c 100644 --- a/src/app/domains/pos/modules/statistics/components/invoice-type-card.component.html +++ b/src/app/domains/pos/modules/statistics/components/invoice-type-card.component.html @@ -1,5 +1,5 @@
diff --git a/src/app/domains/pos/modules/statistics/views/root.component.html b/src/app/domains/pos/modules/statistics/views/root.component.html index e981588..8cc3501 100644 --- a/src/app/domains/pos/modules/statistics/views/root.component.html +++ b/src/app/domains/pos/modules/statistics/views/root.component.html @@ -1,57 +1,59 @@ -
- -
- @if (loading()) { - @for (_ of [0, 1, 2, 3, 4, 5]; track $index) { -
- -
- } - } @else { - - - - - - - } -
-
+
+
+ +
+
+ @if (loading()) { + @for (_ of [0, 1, 2, 3, 4, 5]; track $index) { +
+ +
+ } + } @else { + + + + + + + } +
+
diff --git a/src/app/layout/default/app.layout.component.html b/src/app/layout/default/app.layout.component.html index 87bd206..633b784 100644 --- a/src/app/layout/default/app.layout.component.html +++ b/src/app/layout/default/app.layout.component.html @@ -1,29 +1,27 @@ -
+
@if (!fullPageLoading()) { + [endTemplate]="topBarEndAction || topBarMoreAction" /> } @if (showMenu()) { } -
-
+
+
@if (showBreadcrumb) { - + } -
+
-
- @if (content) { - - } @else { - - } -
+ @if (content) { + + } @else { + + }
diff --git a/src/app/modules/saleInvoices/views/single.component.html b/src/app/modules/saleInvoices/views/single.component.html index c0d837f..eda4480 100644 --- a/src/app/modules/saleInvoices/views/single.component.html +++ b/src/app/modules/saleInvoices/views/single.component.html @@ -1,3 +1,3 @@ -
+
diff --git a/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.ts b/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.ts index 5a2a7ac..27b1619 100644 --- a/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.ts +++ b/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.ts @@ -1,10 +1,10 @@ import { MustMatch, password } from '@/core/validators'; import { AbstractDialog } from '@/shared/abstractClasses/abstract-dialog'; +import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component'; import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component'; import { Component, EventEmitter, Output, input } from '@angular/core'; import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms'; import { SharedPasswordInputComponent } from '../passwordInput/password-input.component'; -import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component'; export interface IChangePasswordSubmitPayload { password: string; @@ -14,7 +14,12 @@ export interface IChangePasswordSubmitPayload { @Component({ selector: 'shared-change-password-form-dialog', templateUrl: './change-password-form-dialog.component.html', - imports: [ReactiveFormsModule, SharedDialogComponent, FormFooterActionsComponent, SharedPasswordInputComponent], + imports: [ + ReactiveFormsModule, + SharedDialogComponent, + FormFooterActionsComponent, + SharedPasswordInputComponent, + ], }) export class ChangePasswordFormDialogComponent extends AbstractDialog { title = input(''); @@ -31,11 +36,11 @@ export class ChangePasswordFormDialogComponent extends AbstractDialog { }, { validators: [MustMatch('password', 'confirmPassword')], - }, + } ); get dialogHeader() { - return this.title() ? `تغییر گذرواژه ${this.title()}` : 'تغییر گذرواژه'; + return this.title() ? `تغییر رمز عبور ${this.title()}` : 'تغییر رمز عبور'; } submit() { diff --git a/src/app/shared/components/confirmationDialog/confirmation-dialog.component.html b/src/app/shared/components/confirmationDialog/confirmation-dialog.component.html index badad39..9cea5b0 100644 --- a/src/app/shared/components/confirmationDialog/confirmation-dialog.component.html +++ b/src/app/shared/components/confirmationDialog/confirmation-dialog.component.html @@ -4,7 +4,7 @@
- +
{{ message.header }}

{{ message.message }}

diff --git a/src/app/shared/components/invoices/correctionForm/form.component.html b/src/app/shared/components/invoices/correctionForm/form.component.html index f4001d2..4243126 100644 --- a/src/app/shared/components/invoices/correctionForm/form.component.html +++ b/src/app/shared/components/invoices/correctionForm/form.component.html @@ -3,7 +3,7 @@
@for (item of initialValues || []; track item.id) { -
+
} @else { - -
- - در حال ارسال درخواست شما... -
-
- + @@ -18,7 +12,6 @@
- @@ -117,9 +110,9 @@ pButton [label]="action.label || ''" [icon]="action.icon || ''" - size="small" [severity]="$any(action).severity || 'secondary'" [outlined]="$any(action).severity === 'secondary'" + [loading]="actionLoading" (click)="action.command()"> }
diff --git a/src/app/shared/components/invoices/sale-invoice-single-view.component.ts b/src/app/shared/components/invoices/sale-invoice-single-view.component.ts index a3c77a8..aea40ea 100644 --- a/src/app/shared/components/invoices/sale-invoice-single-view.component.ts +++ b/src/app/shared/components/invoices/sale-invoice-single-view.component.ts @@ -110,17 +110,6 @@ export class SharedSaleInvoiceSingleViewComponent { showCorrectionForm = signal(false); showReturnFromSaleForm = signal(false); - constructor() { - this.showErrors = this.showErrors.bind(this); - this.showRevokeConfirmation = this.showRevokeConfirmation.bind(this); - this.showCorrection = this.showCorrection.bind(this); - this.showReturnFromSale = this.showReturnFromSale.bind(this); - this.printInvoice = this.printInvoice.bind(this); - this.send = this.send.bind(this); - this.resend = this.resend.bind(this); - this.inquiry = this.inquiry.bind(this); - } - showErrors = () => {}; inquiry = () => { this.onInquiry.emit(); @@ -150,49 +139,49 @@ export class SharedSaleInvoiceSingleViewComponent { icon: 'pi pi-send', neededStatus: TspProviderResponseStatus.SEND_FAILURE, severity: 'info', - command: this.resend, + command: () => this.resend(), }, { label: 'ارسال صورت‌حساب', icon: 'pi pi-send', neededStatus: TspProviderResponseStatus.NOT_SEND, severity: 'info', - command: this.send, + command: () => this.send(), }, { label: 'استعلام وضعیت', icon: 'pi pi-info', neededStatus: TspProviderResponseStatus.FISCAL_QUEUED, severity: 'info', - command: this.inquiry, + command: () => this.inquiry(), }, { label: 'دلایل خطا', icon: 'pi pi-question', neededStatus: TspProviderResponseStatus.FAILURE, severity: 'danger', - command: this.showErrors, + command: () => this.showErrors(), }, { label: 'ابطال', icon: 'pi pi-eraser', neededStatus: TspProviderResponseStatus.SUCCESS, severity: 'danger', - command: this.showRevokeConfirmation, + command: () => this.showRevokeConfirmation(), }, { label: 'اصلاح', icon: 'pi pi-file-edit', neededStatus: TspProviderResponseStatus.SUCCESS, severity: 'warn', - command: this.showCorrection, + command: () => this.showCorrection(), }, { label: 'برگشت از فروش', icon: 'pi pi-cart-minus', neededStatus: TspProviderResponseStatus.SUCCESS, severity: 'warn', - command: this.showReturnFromSale, + command: () => this.showReturnFromSale(), }, ]; diff --git a/src/app/shared/components/key-value.component/key-value.component.html b/src/app/shared/components/key-value.component/key-value.component.html index aad9ec2..97d35ee 100644 --- a/src/app/shared/components/key-value.component/key-value.component.html +++ b/src/app/shared/components/key-value.component/key-value.component.html @@ -1,25 +1,24 @@ -
-
- {{ label }}: +
+
+ {{ label }}:
+ }"> - @if (type === "thumbnail") { -
+ @if (type === 'thumbnail') { +
@if (valueToShow()) { - + }
- } @else if (valueType() === "tag") { + } @else if (valueType() === 'tag') { } @else { - {{ valueToShow() }} + {{ valueToShow() }} }
diff --git a/src/app/shared/components/uploadFile/upload-file.component.html b/src/app/shared/components/uploadFile/upload-file.component.html index f01a3b0..2c6c5dc 100644 --- a/src/app/shared/components/uploadFile/upload-file.component.html +++ b/src/app/shared/components/uploadFile/upload-file.component.html @@ -15,6 +15,14 @@ [style]="{ display: 'none' }" > +
} @else { -
+

فایل مورد نظر خود را در اینجا رها کنید

diff --git a/src/app/shared/components/uploadFile/upload-file.component.ts b/src/app/shared/components/uploadFile/upload-file.component.ts index 93325cc..89cda7a 100644 --- a/src/app/shared/components/uploadFile/upload-file.component.ts +++ b/src/app/shared/components/uploadFile/upload-file.component.ts @@ -1,6 +1,7 @@ import { Maybe } from '@/core'; import { Component, + ElementRef, EventEmitter, Input, OnChanges, @@ -22,6 +23,7 @@ export class SharedUploadFileComponent implements OnChanges, OnDestroy { @Input() loading: boolean = false; @Input() name: string = 'file'; @Input() accept: string = 'image/*'; + @Input() cameraCapture: 'user' | 'environment' = 'environment'; @Input() maxSize: Maybe = 5 * 1024 * 1024; @Input() error: Maybe = null; @Input() hint: Maybe = null; @@ -30,6 +32,7 @@ export class SharedUploadFileComponent implements OnChanges, OnDestroy { @Output() onSelect = new EventEmitter(); @ViewChild(FileUpload) uploader?: FileUpload; + @ViewChild('cameraInput') cameraInput?: ElementRef; filePreview: Maybe = null; private objectUrl: Maybe = null; @@ -63,8 +66,26 @@ export class SharedUploadFileComponent implements OnChanges, OnDestroy { this.onSelect.emit({ data: payload, file }); } + openFilePicker() { + this.cameraInput?.nativeElement.click(); + } + + onNativeFileSelected(event: Event) { + const input = event.target as HTMLInputElement; + const file = input.files?.[0]; + if (!file) { + return; + } + + this.setPreviewFromFile(file); + const payload = new FormData(); + payload.append(this.name, file, file.name); + this.onSelect.emit({ data: payload, file }); + input.value = ''; + } + onEditFile() { - this.uploader?.choose(); + this.openFilePicker(); } onDeleteFilePreview() { diff --git a/src/app/uikit/datepicker/datepicker.component.html b/src/app/uikit/datepicker/datepicker.component.html index f22730d..d141e34 100644 --- a/src/app/uikit/datepicker/datepicker.component.html +++ b/src/app/uikit/datepicker/datepicker.component.html @@ -2,7 +2,7 @@ -
+
diff --git a/src/assets/customize.scss b/src/assets/customize.scss index 9a2c342..62ba38b 100644 --- a/src/assets/customize.scss +++ b/src/assets/customize.scss @@ -3,7 +3,7 @@ } .listKeyValue { - @apply grid md:grid-cols-3 sm:grid-cols-2 sm:gap-4 gap-3 items-center; + @apply grid items-center gap-3 sm:grid-cols-2 sm:gap-4 md:grid-cols-3; } .cardShadow { @@ -11,7 +11,7 @@ } .summaryList { - @apply max-h-125 flex; + @apply flex max-h-125; > * { @apply w-full; } diff --git a/src/assets/layout/_core.scss b/src/assets/layout/_core.scss index 405db59..c44ecc6 100644 --- a/src/assets/layout/_core.scss +++ b/src/assets/layout/_core.scss @@ -13,12 +13,6 @@ a { text-decoration: none; } -.layout-wrapper { - min-height: 100vh; - display: flex; - flex-direction: column; -} - html { scroll-behavior: smooth; font-size: 14px; diff --git a/src/assets/layout/_main.scss b/src/assets/layout/_main.scss index 6f20ca1..53e35c2 100644 --- a/src/assets/layout/_main.scss +++ b/src/assets/layout/_main.scss @@ -1,23 +1,7 @@ .layout-main-container { - display: flex; - flex-direction: column; - // height: 100vh; - // overflow: hidden; - justify-content: space-between; - padding: 2rem 1rem 2rem 2rem; + // padding: 2rem 1rem 2rem 2rem; transition: margin-inline-start var(--layout-section-transition-duration); &.hideMenu { - margin: 0 !important; transform: translateX(0) !important; - padding-inline-start: 2rem !important; - } - &.isFullPage { - padding-inline-start: 0 !important; - padding: 0 !important; } } - -.layout-main { - flex: 1 1 auto; - // overflow: auto; -} diff --git a/src/assets/psp.scss b/src/assets/psp.scss new file mode 100644 index 0000000..2bf5f27 --- /dev/null +++ b/src/assets/psp.scss @@ -0,0 +1,7 @@ +.p-inputtext { + box-shadow: none !important; +} + +* { + box-shadow: none !important; +} diff --git a/src/environments/environment.tis.ts b/src/environments/environment.tis.ts index 914a195..612d694 100644 --- a/src/environments/environment.tis.ts +++ b/src/environments/environment.tis.ts @@ -1,9 +1,10 @@ // TIS tenant environment configuration export const environment = { production: true, - // apiBaseUrl: 'https://psp-api.shift-am.ir', + apiBaseUrl: 'https://psp-api.shift-am.ir', // apiBaseUrl: 'http://192.168.128.73:5002', - apiBaseUrl: 'http://localhost:5002', + // apiBaseUrl: 'http://192.168.0.162:5002', + // apiBaseUrl: 'http://localhost:5002', host: 'localhost', port: 5000, enableLogging: false,