From 99e726b08b49611b517053e3a7d14ba942390cf0 Mon Sep 17 00:00:00 2001 From: parsa aghaei Date: Sat, 5 Sep 2026 09:09:36 +0330 Subject: [PATCH] fix(admin,sms,ui): resolve LTR input icon overlap, clarify melipayamak pulses credit and update UI texts --- backend/src/common/services/sms.service.ts | 23 +- frontend/admin-panel/src/pages/Login.tsx | 24 +- .../admin-panel/src/pages/SmsSettingsPage.tsx | 83 +++- frontend/admin-panel/src/pages/UITexts.tsx | 403 ++++-------------- frontend/admin-panel/src/pages/Users.tsx | 12 +- frontend/application/app/HomeClient.tsx | 14 +- frontend/application/app/favicon.ico | Bin 25931 -> 15406 bytes frontend/application/app/page.tsx | 5 +- .../application/components/ArchivePage.tsx | 19 +- .../application/components/SmartAdvisor.tsx | 24 +- frontend/application/lib/seo.ts | 2 +- .../favicons/android-chrome-192x192.png | Bin 0 -> 62883 bytes .../favicons/android-chrome-512x512.png | Bin 0 -> 395793 bytes .../images/favicons/apple-touch-icon.png | Bin 0 -> 56230 bytes .../public/images/favicons/favicon-16x16.png | Bin 0 -> 943 bytes .../public/images/favicons/favicon-32x32.png | Bin 0 -> 2797 bytes .../public/images/favicons/favicon.ico | Bin 0 -> 15406 bytes .../public/images/favicons/site.webmanifest | 1 + 18 files changed, 220 insertions(+), 390 deletions(-) create mode 100644 frontend/application/public/images/favicons/android-chrome-192x192.png create mode 100644 frontend/application/public/images/favicons/android-chrome-512x512.png create mode 100644 frontend/application/public/images/favicons/apple-touch-icon.png create mode 100644 frontend/application/public/images/favicons/favicon-16x16.png create mode 100644 frontend/application/public/images/favicons/favicon-32x32.png create mode 100644 frontend/application/public/images/favicons/favicon.ico create mode 100644 frontend/application/public/images/favicons/site.webmanifest diff --git a/backend/src/common/services/sms.service.ts b/backend/src/common/services/sms.service.ts index fc7af3c1..bc8ed180 100644 --- a/backend/src/common/services/sms.service.ts +++ b/backend/src/common/services/sms.service.ts @@ -690,14 +690,27 @@ export class SmsService { }); } - // Mark current bindings + // Mark current bindings (both legacy bodyIds and dynamic scenario rules) const result = Array.from(map.values()).map((p) => { const assigned: string[] = []; if (p.id === config.otpBodyId) assigned.push('کد تایید OTP'); - if (p.id === config.orderBodyId) assigned.push('تایید سفارش'); - if (p.id === config.shippingBodyId) assigned.push('کد رهگیری پست'); - if (p.id === config.b2bBodyId) assigned.push('همکاران B2B'); - if (p.id === config.petCareBodyId) assigned.push('یادآور سلامت پت'); + if (p.id === config.orderBodyId) assigned.push('پترن پیش‌فرض سفارش'); + if (p.id === config.shippingBodyId) assigned.push('پترن پیش‌فرض پست'); + if (p.id === config.b2bBodyId) assigned.push('پترن پیش‌فرض B2B'); + if (p.id === config.petCareBodyId) assigned.push('پترن پیش‌فرض یادآور پت'); + + // Check dynamic scenario rules + if (Array.isArray(config.rules)) { + for (const r of config.rules) { + if (Number(r.patternId) === p.id) { + const ruleTag = `سناریو: ${r.title}`; + if (!assigned.includes(ruleTag)) { + assigned.push(ruleTag); + } + } + } + } + return { ...p, assignedTo: assigned }; }); diff --git a/frontend/admin-panel/src/pages/Login.tsx b/frontend/admin-panel/src/pages/Login.tsx index e412daeb..aa572e8a 100644 --- a/frontend/admin-panel/src/pages/Login.tsx +++ b/frontend/admin-panel/src/pages/Login.tsx @@ -123,15 +123,15 @@ export default function Login() {
-
- +
+
setEmail(e.target.value)} - className="block w-full pl-3 pr-10 py-3 border border-gray-200 rounded-xl focus:ring-purple-500 focus:border-purple-500 sm:text-sm bg-gray-50 font-bold transition-all" + className="block w-full pr-11 pl-4 py-3 border border-gray-200 rounded-xl focus:ring-purple-500 focus:border-purple-500 sm:text-sm bg-gray-50 font-mono font-bold transition-all text-left" placeholder="admin@canina.ir" dir="ltr" /> @@ -141,15 +141,15 @@ export default function Login() {
-
- +
+
setPassword(e.target.value)} - className="block w-full pl-3 pr-10 py-3 border border-gray-200 rounded-xl focus:ring-purple-500 focus:border-purple-500 sm:text-sm bg-gray-50 font-bold transition-all text-left" + className="block w-full pr-11 pl-4 py-3 border border-gray-200 rounded-xl focus:ring-purple-500 focus:border-purple-500 sm:text-sm bg-gray-50 font-mono font-bold transition-all text-left" placeholder="••••••••" dir="ltr" /> @@ -174,15 +174,15 @@ export default function Login() {
-
- +
+
setPhoneNumber(e.target.value)} - className="block w-full pl-3 pr-10 py-3 border border-gray-200 rounded-xl focus:ring-purple-500 focus:border-purple-500 sm:text-sm bg-gray-50 font-bold transition-all text-left" + className="block w-full pr-11 pl-4 py-3 border border-gray-200 rounded-xl focus:ring-purple-500 focus:border-purple-500 sm:text-sm bg-gray-50 font-mono font-bold transition-all text-left" placeholder="09123456789" dir="ltr" /> @@ -212,8 +212,8 @@ export default function Login() {
-
- +
+
setOtpCode(e.target.value)} - className="block w-full pl-3 pr-10 py-3 border border-gray-200 rounded-xl focus:ring-purple-500 focus:border-purple-500 sm:text-sm bg-gray-50 font-bold transition-all text-center tracking-widest text-lg" + className="block w-full pr-11 pl-4 py-3 border border-gray-200 rounded-xl focus:ring-purple-500 focus:border-purple-500 sm:text-sm bg-gray-50 font-bold transition-all text-center tracking-widest text-lg" placeholder="12345" dir="ltr" /> diff --git a/frontend/admin-panel/src/pages/SmsSettingsPage.tsx b/frontend/admin-panel/src/pages/SmsSettingsPage.tsx index 59caf6fe..2a6cf777 100644 --- a/frontend/admin-panel/src/pages/SmsSettingsPage.tsx +++ b/frontend/admin-panel/src/pages/SmsSettingsPage.tsx @@ -354,14 +354,14 @@ export default function SmsSettingsPage() { }; // Rule Handlers - const handleOpenAddRuleModal = () => { + const handleOpenAddRuleModal = (initialPatternId?: number, initialEvent?: string, initialTitle?: string) => { setEditingRule(null); - setRuleFormTitle(''); - setRuleFormEvent('ORDER_PAID'); + setRuleFormTitle(initialTitle || ''); + setRuleFormEvent(initialEvent || 'ORDER_PAID'); setRuleFormEnabled(true); setRuleFormRecipientType('customer'); setRuleFormCustomPhone(''); - setRuleFormPatternId(String(config.orderBodyId || '')); + setRuleFormPatternId(initialPatternId ? String(initialPatternId) : String(config.orderBodyId || '')); setRuleFormVariables(['customerName', 'orderNumber', 'amount']); setRuleFormDescription(''); setIsRuleModalOpen(true); @@ -848,13 +848,14 @@ export default function SmsSettingsPage() { value={config.password} onChange={(e) => setConfig({ ...config, password: e.target.value })} placeholder="••••••••••••" - className="w-full border border-gray-200 rounded-xl p-3 pr-10 outline-none focus:ring-2 focus:ring-purple-500 text-sm font-mono font-bold bg-white" + className="w-full border border-gray-200 rounded-xl p-3 pl-11 pr-4 outline-none focus:ring-2 focus:ring-purple-500 text-sm font-mono font-bold bg-white text-left" dir="ltr" /> @@ -1052,7 +1053,7 @@ export default function SmsSettingsPage() {

اعتبار باقی‌مانده در درگاه ملی پیامک:

-
+
{isLoadingCredit ? (
@@ -1060,10 +1061,20 @@ export default function SmsSettingsPage() {
) : credit !== null ? ( <> - - {toPersianDigits(credit.toLocaleString())} - - ریال / پالس +
+ + {toPersianDigits(Math.floor(credit).toLocaleString())} + + پالس (تعداد پیامک قابل ارسال) +
+
+ + + + + معادل تقریبی: {toPersianDigits(Math.round(credit * 292.7).toLocaleString())} تومان موجودی کیف‌پول پنل + +
) : ( اطلاعات شارژ دریافت نشد @@ -1383,6 +1394,31 @@ export default function SmsSettingsPage() { ) : activeTab === 'patterns' ? ( /* Patterns Management Tab */
+ {/* Guide Banner for Multi-Pattern Scenarios */} +
+
+
+ +
+
+

+ ارسال چند پیامک همزمان با الگوهای مختلف روی یک رویداد +

+

+ برای یک رویداد (مانند «تایید و ثبت سفارش»)، می‌توانید نامحدود الگوی پیامکی مجزا تعریف کنید: مثلاً یک پیامک به خریدار، یک پیامک اختصاصی به مدیر فروشگاه، و یک پیامک به شرکت حمل‌ونقل با شماره دلخواه! کافیست از دکمه «افزودن به سناریوها» در جلوی هر الگو استفاده نمایید. +

+
+
+ +
+ {/* Action Bar */}
@@ -1501,6 +1537,18 @@ export default function SmsSettingsPage() {
+ +
- - {/* Main Version Switcher: v2 (New Structure) vs v1 (Legacy) */} -
-
- - - -
- -
- {versionTab === 'v2' ? 'نسخه مدرن آکاردئونی تفکیک‌شده به همراه Google SERP' : 'نسخه پشتیبان فهرستی'} -
-
- - {versionTab === 'v2' ? ( -
+ {/* Modern Page Builder Interface */} +
{/* Sub Tabs: Header, Footer, Site Pages */}
- ) : ( - /* Legacy v1 Interface */ -
- {/* Search */} -
- - setSearch(e.target.value)} - className="w-full bg-transparent border-none text-xs focus:outline-none font-bold" - /> -
- - {/* Section Tabs v1 */} -
- {V1_PAGE_TABS.map((tab) => { - const Icon = tab.icon; - const isActive = v1ActiveTab === tab.id; - return ( - - ); - })} -
- - {/* Content Groups v1 */} -
- {Object.entries(V1_GROUPS).map(([groupTitle, keys]) => { - const mappedTab = V1_GROUP_PAGE_MAP[groupTitle] || 'other'; - if (v1ActiveTab !== 'all' && mappedTab !== v1ActiveTab) return null; - - const filteredKeys = keys.filter((key) => { - if (!search) return true; - const currentVal = edits[key] ?? texts[key] ?? ''; - return key.toLowerCase().includes(search.toLowerCase()) || currentVal.includes(search); - }); - - if (filteredKeys.length === 0) return null; - - return ( -
-

- - {groupTitle} -

- -
- {filteredKeys.map((key) => { - const val = edits[key] ?? texts[key] ?? ''; - const isImg = isImageKey(key); - - return ( -
- - -
- {val.length > 60 && !isImg ? ( -