feat(gift-card): show admin menu from has_page_gift_card

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-07 09:36:10 +03:30
co-authored by Cursor
parent 0f60c1e1a5
commit 2d5e8da2cb
3 changed files with 25 additions and 4 deletions
+3 -3
View File
@@ -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
})