From a7950f1f13578e05a0c088d485418ef986f63a0a Mon Sep 17 00:00:00 2001 From: Alireza Hassani Date: Thu, 20 Aug 2026 11:50:57 +0330 Subject: [PATCH] Add bilingual user names and optional DNS updates in super-admin. Edit user now has FA/EN first and last names, and domain save only upserts Arvan records when Update DNS is checked. Co-authored-by: Cursor --- apps/super-admin/src/pages/BusinessesPage.tsx | 27 +++++++++- apps/super-admin/src/pages/UsersPage.tsx | 49 +++++++++++++++++-- apps/super-admin/src/pages/WebsitesPage.tsx | 36 ++++++++++++-- .../src/services/businessService.ts | 4 ++ .../super-admin/src/services/domainService.ts | 2 + apps/super-admin/src/services/userService.ts | 2 + apps/super-admin/src/types/user.ts | 2 + docs/PROJECT_CONTEXT.md | 6 +-- 8 files changed, 116 insertions(+), 12 deletions(-) diff --git a/apps/super-admin/src/pages/BusinessesPage.tsx b/apps/super-admin/src/pages/BusinessesPage.tsx index b4cf6f8..5e5d700 100644 --- a/apps/super-admin/src/pages/BusinessesPage.tsx +++ b/apps/super-admin/src/pages/BusinessesPage.tsx @@ -244,6 +244,7 @@ export function BusinessesPage() { const [domainId, setDomainId] = useState(null) const [domainHost, setDomainHost] = useState('') const [domainGitRepoUrl, setDomainGitRepoUrl] = useState('') + const [domainUpdateDns, setDomainUpdateDns] = useState(false) const [domainSubmitting, setDomainSubmitting] = useState(false) const [domainError, setDomainError] = useState('') @@ -635,6 +636,7 @@ export function BusinessesPage() { setDomainId(b.domainId) setDomainHost(b.domain ?? '') setDomainGitRepoUrl(b.gitRepoUrl ?? '') + setDomainUpdateDns(!b.domainId) setDomainError('') setDomainOpen(true) } @@ -827,6 +829,7 @@ export function BusinessesPage() { setDomainId(null) setDomainHost('') setDomainGitRepoUrl('') + setDomainUpdateDns(false) setDomainError('') } @@ -844,6 +847,7 @@ export function BusinessesPage() { if (domainId) { const updated = (await updateBusinessDomain(businessId, domainId, { host, + updateDns: domainUpdateDns, ...(gitRepoUrl ? { gitRepoUrl } : {}), })) as { id: number @@ -892,6 +896,7 @@ export function BusinessesPage() { const created = (await addBusinessDomain(businessId, { host, isPrimary: true, + updateDns: domainUpdateDns, ...(gitRepoUrl ? { gitRepoUrl } : {}), })) as { id: number @@ -946,6 +951,7 @@ export function BusinessesPage() { setDomainId(null) setDomainHost('') setDomainGitRepoUrl('') + setDomainUpdateDns(false) setDomainError('') } catch (err) { if (submitId !== domainSubmitGenRef.current) return @@ -1456,9 +1462,11 @@ export function BusinessesPage() { {domainError}

) : null} - {domainSubmitting && domainGitRepoUrl.trim() ? ( + {domainSubmitting && (domainGitRepoUrl.trim() || domainUpdateDns) ? (

- Saving domain and setting up storefront on the websites server… + {domainGitRepoUrl.trim() + ? 'Saving domain and setting up storefront on the websites server…' + : 'Saving domain and updating Arvan DNS…'}

) : null}
@@ -1489,6 +1497,21 @@ export function BusinessesPage() {

+ +

+ When checked, upserts Arvan records: @ ANAME → ns.meshkee.com, plus www, + business, customer, and api CNAMEs. +

+