feat(user): gate menus by SuperAdmin flags and show physical delivery
Hide fund/earn/gift entries when access is off, add matching route guards, and surface physical delivery instead of price alert on mobile profile. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -50,6 +50,7 @@ import { useTrackingSystemsFeature } from '@/composables/useTrackingSystemsFeatu
|
||||
import { useSettingsStore } from '@/store/settingsStore'
|
||||
import { getPrimaryNavItems, getSecondaryNavItems } from '../config/navigation'
|
||||
import { useAppNavigation } from '../composables/useAppNavigation'
|
||||
import { featureSettingForRoute } from '@/utils/superAdminMenuGates'
|
||||
import DesktopNavItem from './DesktopNavItem.vue'
|
||||
import AppCreditLink from '@/components/AppCreditLink.vue'
|
||||
|
||||
@@ -58,7 +59,13 @@ const authenticated = computed(() => isToken())
|
||||
const navLogo = logoFull
|
||||
const { trackingSystemsEnabled } = useTrackingSystemsFeature()
|
||||
const settingsStore = useSettingsStore()
|
||||
const primaryItems = computed(() => getPrimaryNavItems(authenticated.value))
|
||||
const primaryItems = computed(() =>
|
||||
getPrimaryNavItems(authenticated.value).filter((item) => {
|
||||
const featureKey = featureSettingForRoute(item.routeName)
|
||||
if (featureKey) return settingsStore.isSettingTruthy(featureKey)
|
||||
return true
|
||||
}),
|
||||
)
|
||||
/** «لیست دریافتیها» فقط در موبایل نمایش داده میشود */
|
||||
const DESKTOP_HIDDEN_NAV_IDS = ['list']
|
||||
const secondaryItems = computed(() =>
|
||||
@@ -66,12 +73,8 @@ const secondaryItems = computed(() =>
|
||||
includeRecoverySites: trackingSystemsEnabled.value,
|
||||
}).filter((item) => {
|
||||
if (DESKTOP_HIDDEN_NAV_IDS.includes(item.id)) return false
|
||||
if (item.id === 'notifyTrigger') {
|
||||
return settingsStore.isSettingTruthy('has_page_price_trigger')
|
||||
}
|
||||
if (item.id === 'giftCard') {
|
||||
return settingsStore.isSettingTruthy('has_page_gift_card')
|
||||
}
|
||||
const featureKey = featureSettingForRoute(item.routeName)
|
||||
if (featureKey) return settingsStore.isSettingTruthy(featureKey)
|
||||
return true
|
||||
}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user