feat(gift-card): show admin menu from has_page_gift_card
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+3
-3
@@ -2,7 +2,7 @@
|
||||
//import router from '@/core/router/index'
|
||||
import { useRouterStore } from '@core/stores/router'
|
||||
import type { Router, RouteRecordRaw } from 'vue-router'
|
||||
import { getConfigApp, isStoreApp } from '@/utils/config'
|
||||
import { getConfigApp, giftCardEnabledSetting, isStoreApp } from '@/utils/config'
|
||||
import { isDeployAdmin } from '@/utils/deployAdmin'
|
||||
import { hasSmsPanelAccess, isSmsBillingEnabled } from '@/utils/smsPanelAccess'
|
||||
import { useUserStore } from '@/store/userStore'
|
||||
@@ -42,7 +42,7 @@ function applyAppModeMeta(route: RouteRecordRaw, appName: string | null) {
|
||||
for (const child of route.children) {
|
||||
if (child.name === 'giftCardMain' && child.meta) {
|
||||
child.meta.title = store ? 'کارت هدیه و تخفیف' : 'کارت هدیه'
|
||||
child.meta.hideMenu = !store && appName !== 'garoosi'
|
||||
child.meta.hideMenu = !giftCardEnabledSetting.value
|
||||
}
|
||||
if (child.name === 'discounts' && child.meta) {
|
||||
child.meta.hideMenu = store || appName !== 'goldsun'
|
||||
@@ -60,7 +60,7 @@ function filterRoutesByApp(routes: RouteRecordRaw, appName: string | null) {
|
||||
routes.children = routes.children.filter((item) => {
|
||||
if (item.name === 'discounts' && (isStoreApp() || appName !== 'goldsun')) return false
|
||||
if (item.name === 'authentication' && appName !== 'garoosi') return false
|
||||
if (item.name === 'giftCardMain' && !isStoreApp() && appName !== 'garoosi') return false
|
||||
if (item.name === 'giftCardMain' && !giftCardEnabledSetting.value) return false
|
||||
|
||||
return true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user