Add customers gold credit menu with request and active tabs.
Gate the submenu on enable_gold_credit and wire settings UI for SuperAdmin and tenant credit options. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -21,7 +21,7 @@ import { computed } from 'vue'
|
||||
import BasicMenu from '@/components/BasicMenu/index.vue'
|
||||
import { useRouterStore } from '@core/stores/router'
|
||||
import { get } from 'lodash'
|
||||
import { customerSpecialPricingEnabledSetting, initWalletSettingsFromApi } from '@/utils/config'
|
||||
import { customerSpecialPricingEnabledSetting, goldCreditEnabledSetting, initWalletSettingsFromApi } from '@/utils/config'
|
||||
|
||||
initWalletSettingsFromApi()
|
||||
|
||||
@@ -33,10 +33,11 @@ const menu = computed(() => {
|
||||
meta?: { order?: number }
|
||||
}>
|
||||
return [...children]
|
||||
.filter(
|
||||
(child) =>
|
||||
child.name !== 'customerMain_specialPrice' || customerSpecialPricingEnabledSetting.value
|
||||
)
|
||||
.filter((child) => {
|
||||
if (child.name === 'customerMain_specialPrice') return customerSpecialPricingEnabledSetting.value
|
||||
if (child.name === 'customerMain_goldCredit') return goldCreditEnabledSetting.value
|
||||
return true
|
||||
})
|
||||
.sort((a, b) => (a.meta?.order ?? 99) - (b.meta?.order ?? 99))
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user