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 <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
353508a091
commit
a7950f1f13
@@ -244,6 +244,7 @@ export function BusinessesPage() {
|
||||
const [domainId, setDomainId] = useState<number | null>(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}
|
||||
</p>
|
||||
) : null}
|
||||
{domainSubmitting && domainGitRepoUrl.trim() ? (
|
||||
{domainSubmitting && (domainGitRepoUrl.trim() || domainUpdateDns) ? (
|
||||
<p className={styles.helperText} role="status">
|
||||
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…'}
|
||||
</p>
|
||||
) : null}
|
||||
<div className={styles.field}>
|
||||
@@ -1489,6 +1497,21 @@ export function BusinessesPage() {
|
||||
</p>
|
||||
</div>
|
||||
<div style={{ height: 12 }} />
|
||||
<label className={styles.entityCheck} htmlFor="domain-update-dns">
|
||||
<input
|
||||
id="domain-update-dns"
|
||||
type="checkbox"
|
||||
checked={domainUpdateDns}
|
||||
onChange={(e) => setDomainUpdateDns(e.target.checked)}
|
||||
disabled={domainSubmitting}
|
||||
/>
|
||||
<span>Update DNS records</span>
|
||||
</label>
|
||||
<p className={styles.subText} style={{ marginTop: 6 }}>
|
||||
When checked, upserts Arvan records: @ ANAME → ns.meshkee.com, plus www,
|
||||
business, customer, and api CNAMEs.
|
||||
</p>
|
||||
<div style={{ height: 12 }} />
|
||||
<div className={styles.actionsRow}>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user