feat: website settings menu gated by has_landing
Add تنظیمات وبسایت before پیکربندی with landing_* subsections, and show unit addon on numeric setting fields. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+17
-1
@@ -86,6 +86,9 @@ export const supportChatMenuEnabledSetting = ref(false)
|
||||
/** reactive — سوییچ دیپلوی show_to_users_chat (برای مخفی کردن has_chat در تنظیمات عادی) */
|
||||
export const showToUsersChatSetting = ref(false)
|
||||
|
||||
/** reactive — منوی تنظیمات وبسایت وقتی has_landing روشن است */
|
||||
export const hasLandingSetting = ref(false)
|
||||
|
||||
/** reactive — سوییچ دیپلوی price_channel_access (گروه کانال در تنظیمات عادی) */
|
||||
export const priceChannelAccessSetting = ref(false)
|
||||
|
||||
@@ -215,6 +218,10 @@ export function setShowToUsersChatFromSettings(value: boolean): void {
|
||||
showToUsersChatSetting.value = value
|
||||
}
|
||||
|
||||
export function setHasLandingFromSettings(value: boolean): void {
|
||||
hasLandingSetting.value = value
|
||||
}
|
||||
|
||||
export function setPriceChannelAccessFromSettings(value: boolean): void {
|
||||
priceChannelAccessSetting.value = value
|
||||
}
|
||||
@@ -313,7 +320,7 @@ export function invalidateSettingsBootstrap(): void {
|
||||
}
|
||||
|
||||
/**
|
||||
* اعمال مستقیم ۱۵ دسترسی سوپرادمین روی فلگهای منو/UI
|
||||
* اعمال مستقیم ۱۶ دسترسی سوپرادمین روی فلگهای منو/UI
|
||||
* (پاسخ refresh-superadmin.items یا ردیفهای get_settings).
|
||||
*/
|
||||
export function applySuperAdminAccessFlagsFromItems(
|
||||
@@ -333,6 +340,7 @@ export function applySuperAdminAccessFlagsFromItems(
|
||||
applyPriceTriggerEnabledFromRows(rows)
|
||||
applyAppNotificationEnabledFromRows(rows)
|
||||
applySupportChatMenuEnabledFromRows(rows)
|
||||
applyHasLandingFromRows(rows)
|
||||
}
|
||||
|
||||
export function applyConditionalOrderEnabledFromRows(
|
||||
@@ -377,6 +385,13 @@ export function applyAppNotificationEnabledFromRows(
|
||||
if (row) setAppNotificationEnabledFromSettings(isSwitchOn(row.value))
|
||||
}
|
||||
|
||||
export function applyHasLandingFromRows(
|
||||
rows: Array<{ key?: string; value?: string | null }>
|
||||
) {
|
||||
const row = rows.find((item) => item.key === 'has_landing')
|
||||
if (row) setHasLandingFromSettings(isSwitchOn(row.value))
|
||||
}
|
||||
|
||||
export function applyPriceProviderFromRows(
|
||||
rows: Array<{ key?: string; value?: string | null }>
|
||||
) {
|
||||
@@ -419,6 +434,7 @@ async function bootstrapSettingsFromApi(): Promise<void> {
|
||||
applyPriceTriggerEnabledFromRows(list)
|
||||
applyAppNotificationEnabledFromRows(list)
|
||||
applySupportChatMenuEnabledFromRows(list)
|
||||
applyHasLandingFromRows(list)
|
||||
applyPriceProviderFromRows(list)
|
||||
applyPriceChannelAccessFromRows(list)
|
||||
setCachedMainMetal(mainMetalRow?.value)
|
||||
|
||||
Reference in New Issue
Block a user