From ae274db893e8c359bf04b8e2762e391f26f376f0 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Sun, 31 Mar 2024 22:20:06 +0800 Subject: [PATCH] refactor: hide the custom annotations form by defaults (#5595) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /area ui /kind improvement /milestone 2.14.x #### What this PR does / why we need it: 默认隐藏自定义元数据表单,通常这不会让用户自行修改,默认显示反而会给使用者造成心智负担。 image #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/5439 #### Does this PR introduce a user-facing change? ```release-note 默认隐藏文章设置等界面的自定义元数据表单。 ``` --- ui/src/components/form/AnnotationsForm.vue | 100 +++++++++++++++------ ui/src/locales/en.yaml | 3 + ui/src/locales/zh-CN.yaml | 3 + ui/src/locales/zh-TW.yaml | 3 + 4 files changed, 83 insertions(+), 26 deletions(-) diff --git a/ui/src/components/form/AnnotationsForm.vue b/ui/src/components/form/AnnotationsForm.vue index 49cb13e4f..75912ca4a 100644 --- a/ui/src/components/form/AnnotationsForm.vue +++ b/ui/src/components/form/AnnotationsForm.vue @@ -1,11 +1,14 @@ - + +
+ {{ + $t( + showCustomForm + ? "core.components.annotations_form.buttons.collapse" + : "core.components.annotations_form.buttons.expand" + ) + }} +
+
+ +
+
+ - + v-model="customAnnotationsState" + type="repeater" + :label="$t('core.components.annotations_form.custom_fields.label')" + > + + +
- + + + diff --git a/ui/src/locales/en.yaml b/ui/src/locales/en.yaml index 795cd856d..05647d270 100644 --- a/ui/src/locales/en.yaml +++ b/ui/src/locales/en.yaml @@ -1375,6 +1375,9 @@ core: custom_fields: label: Custom validation: The current Key is already in use + buttons: + expand: View more + collapse: Collapse default_editor: tabs: toc: diff --git a/ui/src/locales/zh-CN.yaml b/ui/src/locales/zh-CN.yaml index 60d8344b5..4b3821e9e 100644 --- a/ui/src/locales/zh-CN.yaml +++ b/ui/src/locales/zh-CN.yaml @@ -1329,6 +1329,9 @@ core: custom_fields: label: 自定义 validation: 当前 Key 已被占用 + buttons: + expand: 查看更多 + collapse: 收起 default_editor: tabs: toc: diff --git a/ui/src/locales/zh-TW.yaml b/ui/src/locales/zh-TW.yaml index 92225acff..f2a77ee99 100644 --- a/ui/src/locales/zh-TW.yaml +++ b/ui/src/locales/zh-TW.yaml @@ -1295,6 +1295,9 @@ core: custom_fields: label: 自定義 validation: 當前 Key 已被占用 + buttons: + expand: 查看更多 + collapse: 收起 default_editor: tabs: toc: