Skip to content

Commit

Permalink
feat: add disallow tooltip for editor provider selector component (#5070
Browse files Browse the repository at this point in the history
)

#### What type of PR is this?

/area console
/kind improvement
/milestone 2.12.x

#### What this PR does / why we need it:

当编辑器切换组件中有不可用编辑器时,添加提示。

<img width="304" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/a5da0549-dfd6-4392-9375-16ddf2a57517">

#### Which issue(s) this PR fixes:

Fixes #5059 

#### Special notes for your reviewer:

测试方式:

1. 安装若干不同类型的编辑器,并创建文章。
2. 修改文章时尝试选择不同类型的编辑器,观察是否有提示。

#### Does this PR introduce a user-facing change?

```release-note
当编辑器切换组件中有不可用编辑器时,添加提示。
```
  • Loading branch information
ruibaby authored Dec 21, 2023
1 parent 61c4a22 commit 2402013
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ const { editorProviders } = useEditorExtensionPoints();
<VDropdownItem
v-for="(editorProvider, index) in editorProviders"
:key="index"
v-tooltip="{
disabled:
allowForcedSelect ||
provider?.rawType.toLowerCase() ===
editorProvider.rawType.toLowerCase(),
content: $t(
'core.components.editor_provider_selector.tooltips.disallow'
),
}"
:selected="provider?.name === editorProvider.name"
:disabled="
!allowForcedSelect &&
Expand Down
3 changes: 3 additions & 0 deletions console/src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,9 @@ core:
flip_horizontal: Flip Horizontal
flip_vertical: Flip Vertical
reset: Reset
editor_provider_selector:
tooltips:
disallow: The content format is different and cannot be switched
composables:
content_cache:
toast_recovered: Recovered unsaved content from cache
Expand Down
3 changes: 3 additions & 0 deletions console/src/locales/zh-CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,9 @@ core:
flip_horizontal: 水平翻转
flip_vertical: 垂直翻转
reset: 重置
editor_provider_selector:
tooltips:
disallow: 内容格式不同,无法切换
composables:
content_cache:
toast_recovered: 已从缓存中恢复未保存的内容
Expand Down
3 changes: 3 additions & 0 deletions console/src/locales/zh-TW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,9 @@ core:
flip_horizontal: 水平翻轉
flip_vertical: 垂直翻轉
reset: 重置
editor_provider_selector:
tooltips:
disallow: 內容格式不同,無法切換
composables:
content_cache:
toast_recovered: 已從緩存中恢復未保存的內容
Expand Down

0 comments on commit 2402013

Please sign in to comment.