feat: enhance order submission flow and UI improvements

- Updated categories component to improve loading state and category display.
- Modified order section to handle payment submission with event payload.
- Refactored payment form dialog to emit order response on successful payment.
- Adjusted order response model to enforce required fields.
- Improved root component layout and added success dialog for order submission.
- Enhanced sale invoice card component to use new TSP API methods.
- Updated API routes for sale invoices to reflect TSP changes.
- Improved user interface for business activities and partners sections.
- Added card shadow styling for better visual hierarchy.
- Introduced new order submitted dialog component for post-order actions.
- Cleaned up console logs and improved code readability across components.
This commit is contained in:
2026-05-08 18:08:57 +03:30
parent ce40bd8c75
commit a138034c06
40 changed files with 375 additions and 212 deletions
@@ -237,8 +237,6 @@ export class InputComponent {
value = this.applyFixed(value);
}
console.log(value);
if (this.preparedMaxLength && value.length > this.preparedMaxLength) {
value = value.slice(0, this.preparedMaxLength);
}
@@ -277,7 +275,6 @@ export class InputComponent {
this.control.setValue(isIdentifierField ? value : value === '' ? '' : numericValue);
const viewValue = isPriceFormat && value !== '' ? numericValue.toLocaleString('en-US') : value;
console.log('viewValue', viewValue);
target.value = viewValue;
if (
@@ -1,4 +1,4 @@
<div class="h-full overflow-auto">
<div class="h-full overflow-auto border border-surface-border cardShadow">
<div
[ngClass]="{
'px-4': captionBox,
@@ -13,14 +13,14 @@
}
<div class="grid grid-cols-1 gap-3" [ngClass]="{ 'pt-4': captionBox }">
@for (item of items; track `gridView_${$index}`) {
<div class="card border border-surface-border bg-surface-50! mb-0! rounded-2xl p-4!">
<div class="card border border-surface-border bg-surface-0! mb-0! rounded-2xl p-4!">
<div class="listKeyValue">
@for (col of columns; track `gridView_${col.field.toString()}_${$index}`) {
@if (col.type !== "index") {
<app-key-value [label]="col.header" [variant]="col.variant">
@if (col.type === "thumbnail") {
<div
class="w-20 h-20 rounded-2xl overflow-hidden bg-surface-50 cursor-pointer"
class="w-20 h-20 rounded-2xl overflow-hidden bg-surface-100 cursor-pointer"
(click)="openThumbnailModal(item)"
>
@if (item && col?.field && item[col!.field!]) {
@@ -46,16 +46,33 @@
}
</div>
@if (showEdit || showDelete || showDetails) {
<hr />
<div class="flex justify-center gap-2 mt-2">
<hr class="my-2" />
<div class="flex justify-center gap-2 mt-4">
@if (showEdit) {
<p-button icon="pi pi-pencil" label="ویرایش" size="small" outlined (click)="edit(item)"> </p-button>
<p-button
icon="pi pi-pencil"
label="ویرایش"
size="small"
outlined
severity="secondary"
(click)="edit(item)"
>
</p-button>
}
@if (showDelete) {
<p-button icon="pi pi-trash" label="حذف" size="small" outlined (click)="remove(item)"> </p-button>
<p-button icon="pi pi-trash" label="حذف" size="small" outlined severity="danger" (click)="remove(item)">
</p-button>
}
@if (showDetails) {
<p-button icon="pi pi-eye" label="مشاهده" size="small" outlined (click)="details(item)"> </p-button>
<p-button
icon="pi pi-eye"
label="مشاهده"
size="small"
outlined
severity="primary"
(click)="details(item)"
>
</p-button>
}
</div>
}
@@ -1,4 +1,4 @@
<div class="h-full flex flex-col gap-4">
<div class="h-full flex flex-col gap-4 cardShadow">
<p-table
[columns]="columns"
[scrollable]="true"
@@ -52,7 +52,7 @@
<td>
@if (col.type === "thumbnail") {
<div
class="w-20 h-20 rounded-2xl overflow-hidden bg-surface-50 cursor-pointer"
class="w-20 h-20 rounded-2xl overflow-hidden bg-surface-100 cursor-pointer"
(click)="openThumbnailModal(item)"
>
@if (item[col.field]) {
@@ -40,6 +40,9 @@
@if (showRefresh) {
<p-button icon="pi pi-refresh" outlined size="small" (click)="refresh()"></p-button>
}
@if (showAll && allItemsPageRoute) {
<a routerLink pButton [routerLink]="allItemsPageRoute" outlined size="small">نمایش همه</a>
}
@if (showAdd) {
<p-button
label="{{ addNewCtaLabel }}"
@@ -113,15 +116,11 @@
@if (showRefresh) {
<p-button icon="pi pi-refresh" outlined size="small" (click)="refresh()"></p-button>
}
@if (showAll && allItemsPageRoute) {
<a routerLink pButton [routerLink]="allItemsPageRoute" icon="pi pi-eye" outlined size="small"></a>
}
@if (showAdd) {
<p-button
label="{{ addNewCtaLabel }}"
icon="pi pi-plus"
size="small"
class="max-sm:hidden"
(click)="openAddForm()"
></p-button>
<p-button icon="pi pi-plus" size="small" class="sm:hidden" (click)="openAddForm()"></p-button>
<p-button icon="pi pi-plus" size="small" (click)="openAddForm()"></p-button>
}
</div>
}
@@ -14,6 +14,7 @@ import {
signal,
TemplateRef,
} from '@angular/core';
import { RouterLink } from '@angular/router';
import { ButtonModule } from 'primeng/button';
import { DrawerModule } from 'primeng/drawer';
import { PaginatorModule } from 'primeng/paginator';
@@ -85,6 +86,7 @@ export interface IColumn<T = any> {
AppPageDataListTableView,
AppPageDataListGridView,
UikitEmptyStateComponent,
RouterLink,
],
})
export class PageDataListComponent<I = any> {
@@ -117,6 +119,8 @@ export class PageDataListComponent<I = any> {
@Input() expandColumns?: Maybe<IColumn[]> = null;
@Input() dataKey?: string = 'items';
@Input() showIndex?: boolean = true;
@Input() showAll?: boolean = false;
@Input() allItemsPageRoute?: string;
@ContentChild('filter', { static: true }) filter!: TemplateRef<any> | null;
@ContentChild('caption', { static: true }) caption!: TemplateRef<any> | null;
@@ -42,7 +42,6 @@ export class SharedUploadFileComponent implements OnChanges, OnDestroy {
ngAfterViewInit() {
this.revokeObjectUrl();
console.log('first');
if (this.initial_file_url && !this.objectUrl) {
this.filePreview = this.initial_file_url;