From 9c5fbda374a7a8a6162d22d93c4bb18c575163a5 Mon Sep 17 00:00:00 2001 From: shuaiplus <2327005759@qq.com> Date: Wed, 29 Apr 2026 15:28:23 +0800 Subject: [PATCH] feat: refactor vault component helpers to use dedicated functions for options retrieval --- webapp/src/components/vault/VaultDialogs.tsx | 5 +- webapp/src/components/vault/VaultEditor.tsx | 10 ++- .../src/components/vault/VaultListPanel.tsx | 10 ++- webapp/src/components/vault/VaultSidebar.tsx | 5 +- .../components/vault/vault-page-helpers.tsx | 75 +++++++++++-------- webapp/src/lib/api/auth.ts | 23 +++++- webapp/src/lib/app-auth.ts | 9 ++- webapp/src/styles/vault.css | 4 + 8 files changed, 93 insertions(+), 48 deletions(-) diff --git a/webapp/src/components/vault/VaultDialogs.tsx b/webapp/src/components/vault/VaultDialogs.tsx index b54a87f..a949c8c 100644 --- a/webapp/src/components/vault/VaultDialogs.tsx +++ b/webapp/src/components/vault/VaultDialogs.tsx @@ -1,6 +1,6 @@ import ConfirmDialog from '@/components/ConfirmDialog'; import type { CustomFieldType, Folder } from '@/lib/types'; -import { FIELD_TYPE_OPTIONS, toBooleanFieldValue } from '@/components/vault/vault-page-helpers'; +import { getFieldTypeOptions, toBooleanFieldValue } from '@/components/vault/vault-page-helpers'; import { t } from '@/lib/i18n'; interface VaultDialogsProps { @@ -61,6 +61,7 @@ interface VaultDialogsProps { } export default function VaultDialogs(props: VaultDialogsProps) { + const fieldTypeOptions = getFieldTypeOptions(); return ( <> {t('txt_field_type')}