From d1dd67aee7e2eaefcafe23cb36b275bf6a706d7f Mon Sep 17 00:00:00 2001 From: ahasani194 Date: Mon, 15 Jun 2026 21:36:09 +0330 Subject: [PATCH] feat: update branding and localization for various components and configurations --- src/app/core/state/global/global.store.ts | 11 +++++++--- .../consumer/constants/menuItems.const.ts | 4 ++-- .../latest-Invoices.component.ts | 12 ++++++++++- .../modules/saleInvoices/store/main.store.ts | 4 ++-- .../partner/constants/menuItems.const.ts | 15 +++++++------- .../layouts/pagesLayout/layout.component.html | 2 +- .../superAdmin/constants/menuItems.const.ts | 20 +++++++++---------- .../stockKeepingUnits/form.component.html | 5 ++--- .../stockKeepingUnits/list.component.html | 7 +++---- .../stockKeepingUnits/list.component.ts | 3 ++- .../constants/routes/stockKeepingUnits.ts | 4 ++-- .../guilds/views/single.component.html | 2 +- .../charge-license-form-dialog.component.html | 5 ++--- .../charge-license-form-dialog.component.ts | 3 ++- .../partners/views/list.component.html | 9 +++------ src/app/layout/service/layout.service.ts | 9 ++++++--- .../modules/auth/pages/auth.component.html | 2 +- src/app/modules/auth/pages/auth.component.ts | 3 +++ .../sale-invoice-single-view.component.html | 18 +++++++++-------- .../list-configs/category-list.const.ts | 3 ++- src/tenants/default/branding.config.ts | 2 +- src/tenants/sepehr/brandingAssets.ts | 4 ++-- 22 files changed, 84 insertions(+), 63 deletions(-) diff --git a/src/app/core/state/global/global.store.ts b/src/app/core/state/global/global.store.ts index de87c6e..1661d1f 100644 --- a/src/app/core/state/global/global.store.ts +++ b/src/app/core/state/global/global.store.ts @@ -1,5 +1,6 @@ import { inject, Injectable } from '@angular/core'; import { Router } from '@angular/router'; +import config from 'src/config'; import { AuthService } from '../../services/auth.service'; import { BaseState, BaseStore } from '../base-store'; @@ -123,7 +124,7 @@ export class GlobalStore extends BaseStore { readonly isOnline = this.computed((state) => state.isOnline); readonly notifications = this.computed((state) => state.notifications); readonly unreadNotifications = this.computed((state) => - state.notifications.filter((n) => !n.read), + state.notifications.filter((n) => !n.read) ); readonly breadcrumbs = this.computed((state) => state.breadcrumbs); readonly preferences = this.computed((state) => state.preferences); @@ -144,7 +145,11 @@ export class GlobalStore extends BaseStore { } // Load theme from localStorage - const savedTheme = localStorage.getItem('app_theme') as 'light' | 'dark'; + const savedTheme = config.isPosApplication + ? 'light' + : (localStorage.getItem('app_theme') as 'light' | 'dark'); + console.log('savedTheme', savedTheme); + if (savedTheme) { this.patchState({ theme: savedTheme }); } @@ -250,7 +255,7 @@ export class GlobalStore extends BaseStore { */ markNotificationRead(id: string): void { const notifications = this._state().notifications.map((n) => - n.id === id ? { ...n, read: true } : n, + n.id === id ? { ...n, read: true } : n ); this.patchState({ notifications }); } diff --git a/src/app/domains/consumer/constants/menuItems.const.ts b/src/app/domains/consumer/constants/menuItems.const.ts index 4b500a5..58a217b 100644 --- a/src/app/domains/consumer/constants/menuItems.const.ts +++ b/src/app/domains/consumer/constants/menuItems.const.ts @@ -18,12 +18,12 @@ export const CONSUMER_MENU_ITEMS = [ routerLink: ['/consumer/poses'], }, { - label: 'صورت‌حساب‌ها', + label: 'صورت‌حساب‌', icon: 'pi pi-fw pi-receipt', routerLink: ['/consumer/sale_invoices'], }, { - label: 'مشتری‌ها', + label: 'مشتری', icon: 'pi pi-fw pi-users', routerLink: ['/consumer/customers'], }, diff --git a/src/app/domains/consumer/modules/dashboard/components/statistics/latestInvoices/latest-Invoices.component.ts b/src/app/domains/consumer/modules/dashboard/components/statistics/latestInvoices/latest-Invoices.component.ts index 4f08fce..92ef09b 100644 --- a/src/app/domains/consumer/modules/dashboard/components/statistics/latestInvoices/latest-Invoices.component.ts +++ b/src/app/domains/consumer/modules/dashboard/components/statistics/latestInvoices/latest-Invoices.component.ts @@ -28,7 +28,17 @@ export class ConsumerStatisticsLatestInvoicesComponent extends AbstractList column.field !== 'created_at'); + this.columns = saleInvoiceListConfig.columns + .filter((column) => column.field !== 'created_at') + .map((header) => { + if (header.field === 'status') { + return { + ...header, + customDataModel: this.status, + }; + } + return header; + }); } override getDataRequest() { diff --git a/src/app/domains/consumer/modules/saleInvoices/store/main.store.ts b/src/app/domains/consumer/modules/saleInvoices/store/main.store.ts index 0332752..e876dca 100644 --- a/src/app/domains/consumer/modules/saleInvoices/store/main.store.ts +++ b/src/app/domains/consumer/modules/saleInvoices/store/main.store.ts @@ -35,7 +35,7 @@ export class ConsumerSaleInvoiceStore extends EntityStore< routerLink: consumerSaleInvoicesNamedRoutes.saleInvoices.meta.pagePath!(), }, { - title: this.entity()?.code, + title: `صورت‌حساب ${this.entity()?.invoice_number}`, routerLink: consumerSaleInvoicesNamedRoutes.saleInvoice.meta.pagePath!(invoiceId), }, ], @@ -53,7 +53,7 @@ export class ConsumerSaleInvoiceStore extends EntityStore< catchError((error) => { this.setError(error); throw error; - }), + }) ) .subscribe((entity) => { this.patchState({ entity }); diff --git a/src/app/domains/partner/constants/menuItems.const.ts b/src/app/domains/partner/constants/menuItems.const.ts index 828dc5c..f30b89d 100644 --- a/src/app/domains/partner/constants/menuItems.const.ts +++ b/src/app/domains/partner/constants/menuItems.const.ts @@ -8,20 +8,21 @@ export const PARTNER_MENU_ITEMS = [ routerLink: ['/partner'], }, { - label: 'حساب‌های کاربری', - icon: 'pi pi-fw pi-user', - routerLink: ['/partner/accounts'], - }, - { - label: 'مشتری‌ها', + label: 'مشتری', icon: 'pi pi-fw pi-users', routerLink: ['/partner/consumers'], }, { - label: 'لایسنس‌ها', + label: 'لایسنس', icon: 'pi pi-fw pi-key', routerLink: ['/partner/licenses'], }, + + { + label: 'حساب‌های کاربری', + icon: 'pi pi-fw pi-user', + routerLink: ['/partner/accounts'], + }, ], }, ] as MenuItem[]; diff --git a/src/app/domains/pos/layouts/pagesLayout/layout.component.html b/src/app/domains/pos/layouts/pagesLayout/layout.component.html index 86aa2a0..a685753 100644 --- a/src/app/domains/pos/layouts/pagesLayout/layout.component.html +++ b/src/app/domains/pos/layouts/pagesLayout/layout.component.html @@ -5,7 +5,7 @@ @if (posInfo()) { -
+
Logo + [closable]="true">
- + diff --git a/src/app/domains/superAdmin/modules/guilds/components/stockKeepingUnits/list.component.html b/src/app/domains/superAdmin/modules/guilds/components/stockKeepingUnits/list.component.html index b819c92..535065a 100644 --- a/src/app/domains/superAdmin/modules/guilds/components/stockKeepingUnits/list.component.html +++ b/src/app/domains/superAdmin/modules/guilds/components/stockKeepingUnits/list.component.html @@ -9,16 +9,15 @@ [fullHeight]="fullHeight" [showAdd]="true" [showEdit]="true" + [showAll]="showAllBtn" [allItemsPageRoute]="allItemsPageRoute()" (onEdit)="onEditClick($event)" (onAdd)="openAddForm()" - (onRefresh)="refresh()" -/> + (onRefresh)="refresh()" /> + (onSubmit)="refresh()" /> diff --git a/src/app/domains/superAdmin/modules/guilds/components/stockKeepingUnits/list.component.ts b/src/app/domains/superAdmin/modules/guilds/components/stockKeepingUnits/list.component.ts index c91a33e..679086e 100644 --- a/src/app/domains/superAdmin/modules/guilds/components/stockKeepingUnits/list.component.ts +++ b/src/app/domains/superAdmin/modules/guilds/components/stockKeepingUnits/list.component.ts @@ -19,13 +19,14 @@ import { StockKeepingUnitFormComponent } from './form.component'; export class GuildStockKeepingUnitsListComponent extends AbstractList { @Input() guildId!: string; @Input() fullHeight?: boolean; + @Input() showAllBtn?: boolean; @Input() header: IColumn[] = skuListConfig.columns; listConfig = skuListConfig; service = inject(StockKeepingUnitsService); allItemsPageRoute = computed(() => - stockKeepingUnitsNamedRoutes.stockKeepingUnits.meta.pagePath!(this.guildId), + stockKeepingUnitsNamedRoutes.stockKeepingUnits.meta.pagePath!(this.guildId) ); override setColumns(): void { diff --git a/src/app/domains/superAdmin/modules/guilds/constants/routes/stockKeepingUnits.ts b/src/app/domains/superAdmin/modules/guilds/constants/routes/stockKeepingUnits.ts index b150b5b..c4a43ae 100644 --- a/src/app/domains/superAdmin/modules/guilds/constants/routes/stockKeepingUnits.ts +++ b/src/app/domains/superAdmin/modules/guilds/constants/routes/stockKeepingUnits.ts @@ -8,11 +8,11 @@ export const stockKeepingUnitsNamedRoutes: NamedRoutes import('../../views/stockKeepingUnits/list.component').then( - (m) => m.GuildStockKeepingUnitsComponent, + (m) => m.GuildStockKeepingUnitsComponent ), meta: { title: 'شناسه کالاها', - pagePath: () => '/super_admin/guilds/:guildId/stock-keeping-units', + pagePath: (guildId: string) => `/super_admin/guilds/${guildId}/stock-keeping-units`, }, }, }; diff --git a/src/app/domains/superAdmin/modules/guilds/views/single.component.html b/src/app/domains/superAdmin/modules/guilds/views/single.component.html index e87fb4d..672f61b 100644 --- a/src/app/domains/superAdmin/modules/guilds/views/single.component.html +++ b/src/app/domains/superAdmin/modules/guilds/views/single.component.html @@ -15,7 +15,7 @@
- +
- + [min]="minDate" /> diff --git a/src/app/domains/superAdmin/modules/partners/components/charge-license-form-dialog.component.ts b/src/app/domains/superAdmin/modules/partners/components/charge-license-form-dialog.component.ts index a158b0c..4963b4b 100644 --- a/src/app/domains/superAdmin/modules/partners/components/charge-license-form-dialog.component.ts +++ b/src/app/domains/superAdmin/modules/partners/components/charge-license-form-dialog.component.ts @@ -3,6 +3,7 @@ import { InputComponent } from '@/shared/components'; import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component'; // import { UikitFlatpickrJalaliComponent } from '@/uikit'; import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component'; +import { DatepickerComponent } from '@/uikit'; import { nowJalali } from '@/utils'; import { Component, inject, Input } from '@angular/core'; import { ReactiveFormsModule, Validators } from '@angular/forms'; @@ -17,7 +18,7 @@ import { AdminPartnerChargeLicenseTransactionsService } from '../services/charge ReactiveFormsModule, InputComponent, FormFooterActionsComponent, - // UikitFlatpickrJalaliComponent, + DatepickerComponent, ], }) export class PartnerChargeLicenseFormDialogComponent extends AbstractFormDialog< diff --git a/src/app/domains/superAdmin/modules/partners/views/list.component.html b/src/app/domains/superAdmin/modules/partners/views/list.component.html index 7dd0852..d290035 100644 --- a/src/app/domains/superAdmin/modules/partners/views/list.component.html +++ b/src/app/domains/superAdmin/modules/partners/views/list.component.html @@ -13,8 +13,7 @@ (onAdd)="openAddForm()" (onDetails)="toSinglePage($event)" (onEdit)="onEditClick($event)" - (onRefresh)="refresh()" -> + (onRefresh)="refresh()">
+ size="large"> {{ item.name }}
@@ -51,5 +49,4 @@ [editMode]="editMode()" [partnerId]="selectedItemForEdit()?.id" [initialValues]="selectedItemForEdit() || undefined" - (onSubmit)="refresh()" -/> + (onSubmit)="refresh()" /> diff --git a/src/app/layout/service/layout.service.ts b/src/app/layout/service/layout.service.ts index 8cbe32c..1cbecc4 100644 --- a/src/app/layout/service/layout.service.ts +++ b/src/app/layout/service/layout.service.ts @@ -1,6 +1,7 @@ import { computed, effect, Injectable, signal, TemplateRef } from '@angular/core'; import { MenuItem } from 'primeng/api'; import { BehaviorSubject, Subject } from 'rxjs'; +import config from 'src/config'; export interface layoutConfig { preset?: string; @@ -39,7 +40,7 @@ export class LayoutService { preset: 'Aura', primary: 'surface', surface: null, - darkTheme: localStorage.getItem('isDarkTheme') === 'true', + darkTheme: config.isPosApplication ? false : localStorage.getItem('isDarkTheme') === 'true', menuMode: 'static', }; @@ -81,10 +82,12 @@ export class LayoutService { overlayOpen$ = this.overlayOpen.asObservable(); - theme = computed(() => (this.layoutConfig()?.darkTheme ? 'light' : 'dark')); + theme = computed(() => + config.isPosApplication ? 'light' : this.layoutConfig()?.darkTheme ? 'light' : 'dark' + ); isSidebarActive = computed( - () => this.layoutState().overlayMenuActive || this.layoutState().staticMenuMobileActive, + () => this.layoutState().overlayMenuActive || this.layoutState().staticMenuMobileActive ); isDarkTheme = computed(() => this.layoutConfig().darkTheme); diff --git a/src/app/modules/auth/pages/auth.component.html b/src/app/modules/auth/pages/auth.component.html index 54bd056..17cde19 100644 --- a/src/app/modules/auth/pages/auth.component.html +++ b/src/app/modules/auth/pages/auth.component.html @@ -7,7 +7,7 @@ class="bg-surface-card border-surface-border flex h-auto w-full max-w-md flex-col items-center justify-center rounded-lg border px-12 py-10 shadow">
مدیریت صورت‌حساب‌های مالیاتی - به پنل مدیریت صورت‌حساب‌های مالیاتی سپاس خوش آمدید. + {{ authTitle }}
diff --git a/src/app/modules/auth/pages/auth.component.ts b/src/app/modules/auth/pages/auth.component.ts index 52e83d4..f9deb7f 100644 --- a/src/app/modules/auth/pages/auth.component.ts +++ b/src/app/modules/auth/pages/auth.component.ts @@ -1,3 +1,4 @@ +import { brandingConfig } from '@/branding/branding.config'; import { IAuthResponse, TRoles } from '@/core'; import { AuthService } from '@/core/services/auth.service'; import { ToastService } from '@/core/services/toast.service'; @@ -34,6 +35,8 @@ export class AuthComponent { selectedRole = signal(this.role); accountRole = signal(''); + authTitle = `به پنل مدیریت صورت‌حساب‌های مالیاتی ${brandingConfig.title} خوش آمدید.`; + toSignUp = () => { this.activeStep.set('signup'); }; diff --git a/src/app/shared/components/invoices/sale-invoice-single-view.component.html b/src/app/shared/components/invoices/sale-invoice-single-view.component.html index b9d68b2..2159363 100644 --- a/src/app/shared/components/invoices/sale-invoice-single-view.component.html +++ b/src/app/shared/components/invoices/sale-invoice-single-view.component.html @@ -60,12 +60,14 @@
- + @if (showCorrectionPaymentDialog()) { + + } } diff --git a/src/app/shared/constants/list-configs/category-list.const.ts b/src/app/shared/constants/list-configs/category-list.const.ts index dbe0739..d6a2bf6 100644 --- a/src/app/shared/constants/list-configs/category-list.const.ts +++ b/src/app/shared/constants/list-configs/category-list.const.ts @@ -1,12 +1,13 @@ import { IListConfig } from './list-config.model'; export const categoryListConfig: IListConfig = { - pageTitle: 'مدیریت دسته‌بندی‌های کالا', + pageTitle: 'مدیریت دسته‌بندی‌ کالا', addNewCtaLabel: 'افزودن دسته‌بندی', emptyPlaceholderTitle: 'دسته‌بندی‌ یافت نشد', emptyPlaceholderDescription: 'برای افزودن دسته‌بندی، روی دکمهٔ بالا کلیک کنید.', columns: [ { field: 'image_url', header: 'تصویر', type: 'thumbnail' }, { field: 'name', header: 'عنوان' }, + { field: 'goods_count', header: 'تعداد کالاها' }, ], }; diff --git a/src/tenants/default/branding.config.ts b/src/tenants/default/branding.config.ts index 0630119..b170a4f 100644 --- a/src/tenants/default/branding.config.ts +++ b/src/tenants/default/branding.config.ts @@ -19,7 +19,7 @@ export const brandingConfig: BrandingConfig = { manifestPath: '/favicon/site.webmanifest', themeColor: '#ffffff', enableInstallPrompt: false, - title: 'پنل مدیریت', + title: 'سپاس', fullTitle: 'پنل مدیریت صورت‌حساب‌های مالیاتی', support: { phones: [ diff --git a/src/tenants/sepehr/brandingAssets.ts b/src/tenants/sepehr/brandingAssets.ts index 0bc58d1..fe4775e 100644 --- a/src/tenants/sepehr/brandingAssets.ts +++ b/src/tenants/sepehr/brandingAssets.ts @@ -1,5 +1,5 @@ -import login from 'src/tenants/tis/assets/images/login.jpg'; -import logo from 'src/tenants/tis/assets/images/logo.png'; +import login from 'src/tenants/sepehr/assets/images/login.jpg'; +import logo from 'src/tenants/sepehr/assets/images/logo.png'; export default { logo,