fixsome changes
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
export type SettingSubsectionDef = {
|
||||
id: string
|
||||
title: string
|
||||
match: (key: string) => boolean
|
||||
}
|
||||
|
||||
export type SettingGroupDef = {
|
||||
id: string
|
||||
title: string
|
||||
icon: string
|
||||
match: (key: string) => boolean
|
||||
/** زیربخشهای داخل گروه (مثلاً روشهای واریز) */
|
||||
subsections?: SettingSubsectionDef[]
|
||||
}
|
||||
|
||||
/** گروههای صفحه تنظیمات عادی (فقط can_edit=1) */
|
||||
@@ -81,6 +89,44 @@ export const EDITABLE_SETTING_GROUPS: SettingGroupDef[] = [
|
||||
icon: 'vuesax-linear:shop',
|
||||
match: (k) => /^external_order/.test(k)
|
||||
},
|
||||
{
|
||||
id: 'deposit_methods',
|
||||
title: 'روشهای واریز',
|
||||
icon: 'vuesax-linear:card-send',
|
||||
match: (k) =>
|
||||
k.startsWith('deposit_method_')
|
||||
|| k === 'deposit_account_holder'
|
||||
|| k === 'deposit_card_number'
|
||||
|| k === 'deposit_account_number'
|
||||
|| k === 'deposit_sheba',
|
||||
subsections: [
|
||||
{
|
||||
id: 'card_to_card',
|
||||
title: 'کارت به کارت',
|
||||
match: (k) =>
|
||||
k === 'deposit_method_card_to_card'
|
||||
|| k === 'deposit_account_holder'
|
||||
|| k === 'deposit_card_number'
|
||||
|| k === 'deposit_account_number'
|
||||
|| k === 'deposit_sheba',
|
||||
},
|
||||
{
|
||||
id: 'gateway',
|
||||
title: 'درگاه پرداخت',
|
||||
match: (k) => k === 'deposit_method_gateway',
|
||||
},
|
||||
{
|
||||
id: 'identified',
|
||||
title: 'شناسه واریز',
|
||||
match: (k) => k === 'deposit_method_identified',
|
||||
},
|
||||
{
|
||||
id: 'shetab',
|
||||
title: 'شبکه شتابی',
|
||||
match: (k) => k === 'deposit_method_shetab',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'support',
|
||||
title: 'پشتیبانی',
|
||||
@@ -89,7 +135,7 @@ export const EDITABLE_SETTING_GROUPS: SettingGroupDef[] = [
|
||||
k === 'support_messengers'
|
||||
|| k.startsWith('support_messenger_')
|
||||
|| k === 'deposit_sms_support_number'
|
||||
|| (k.startsWith('deposit_') && !k.startsWith('external_')),
|
||||
|| k === 'deposit_support_message_text',
|
||||
},
|
||||
{
|
||||
id: 'bots',
|
||||
@@ -181,12 +227,21 @@ export const SYSTEM_SETTING_GROUPS: SettingGroupDef[] = [
|
||||
match: (k) => /^node_/.test(k) || k === 'montify_name' || k === 'external_order_api_enabled'
|
||||
},
|
||||
{
|
||||
id: 'gateway',
|
||||
title: 'درگاه شارژ آنلاین',
|
||||
icon: 'vuesax-linear:card-pos',
|
||||
id: 'deposit_methods',
|
||||
title: 'روشهای واریز',
|
||||
icon: 'vuesax-linear:card-send',
|
||||
match: (k) =>
|
||||
k.startsWith('external_payment_')
|
||||
|| k === 'wallet_payment_provider'
|
||||
|| k === 'wallet_payment_provider',
|
||||
subsections: [
|
||||
{
|
||||
id: 'gateway',
|
||||
title: 'درگاه فروشگاه / پرداخت آنلاین',
|
||||
match: (k) =>
|
||||
k.startsWith('external_payment_')
|
||||
|| k === 'wallet_payment_provider',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'payping',
|
||||
@@ -245,3 +300,14 @@ export function getSettingGroupId(key: string, groups: SettingGroupDef[]): strin
|
||||
}
|
||||
return 'misc'
|
||||
}
|
||||
|
||||
export function getSettingSubsectionId(
|
||||
key: string,
|
||||
group: SettingGroupDef | undefined
|
||||
): string | null {
|
||||
if (!group?.subsections?.length) return null
|
||||
for (const sub of group.subsections) {
|
||||
if (sub.match(key)) return sub.id
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user