mirror of https://github.com/halo-dev/halo
refactor: ignore case when matching editor raw types (#5602)
#### What type of PR is this? /area ui /kind improvement /milestone 2.14.x #### What this PR does / why we need it: 编辑文章匹配编辑器类型时,忽略大小写。 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/5597 #### Does this PR introduce a user-facing change? ```release-note None ```pull/5599/head^2
parent
1a19bdcb54
commit
c2a71545aa
|
@ -1,26 +1,26 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {
|
import {
|
||||||
VPageHeader,
|
|
||||||
IconPages,
|
|
||||||
IconSettings,
|
|
||||||
IconSendPlaneFill,
|
|
||||||
VSpace,
|
|
||||||
VButton,
|
|
||||||
IconSave,
|
|
||||||
Toast,
|
|
||||||
Dialog,
|
Dialog,
|
||||||
IconEye,
|
IconEye,
|
||||||
|
IconPages,
|
||||||
|
IconSave,
|
||||||
|
IconSendPlaneFill,
|
||||||
|
IconSettings,
|
||||||
|
Toast,
|
||||||
|
VButton,
|
||||||
|
VPageHeader,
|
||||||
|
VSpace,
|
||||||
} from "@halo-dev/components";
|
} from "@halo-dev/components";
|
||||||
import SinglePageSettingModal from "./components/SinglePageSettingModal.vue";
|
import SinglePageSettingModal from "./components/SinglePageSettingModal.vue";
|
||||||
import type { SinglePage, SinglePageRequest } from "@halo-dev/api-client";
|
import type { SinglePage, SinglePageRequest } from "@halo-dev/api-client";
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
|
type ComputedRef,
|
||||||
nextTick,
|
nextTick,
|
||||||
onMounted,
|
onMounted,
|
||||||
provide,
|
provide,
|
||||||
ref,
|
ref,
|
||||||
toRef,
|
toRef,
|
||||||
type ComputedRef,
|
|
||||||
watch,
|
watch,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import { apiClient } from "@/utils/api-client";
|
import { apiClient } from "@/utils/api-client";
|
||||||
|
@ -271,7 +271,8 @@ const handleFetchContent = async () => {
|
||||||
const provider =
|
const provider =
|
||||||
preferredEditor ||
|
preferredEditor ||
|
||||||
editorProviders.value.find(
|
editorProviders.value.find(
|
||||||
(provider) => provider.rawType === data.rawType
|
(provider) =>
|
||||||
|
provider.rawType.toLowerCase() === data.rawType?.toLowerCase()
|
||||||
);
|
);
|
||||||
if (provider) {
|
if (provider) {
|
||||||
currentEditorProvider.value = provider;
|
currentEditorProvider.value = provider;
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {
|
import {
|
||||||
|
Dialog,
|
||||||
IconBookRead,
|
IconBookRead,
|
||||||
|
IconEye,
|
||||||
IconSave,
|
IconSave,
|
||||||
IconSettings,
|
|
||||||
IconSendPlaneFill,
|
IconSendPlaneFill,
|
||||||
|
IconSettings,
|
||||||
|
Toast,
|
||||||
VButton,
|
VButton,
|
||||||
VPageHeader,
|
VPageHeader,
|
||||||
VSpace,
|
VSpace,
|
||||||
Toast,
|
|
||||||
Dialog,
|
|
||||||
IconEye,
|
|
||||||
} from "@halo-dev/components";
|
} from "@halo-dev/components";
|
||||||
import PostSettingModal from "./components/PostSettingModal.vue";
|
import PostSettingModal from "./components/PostSettingModal.vue";
|
||||||
import type { Post, PostRequest } from "@halo-dev/api-client";
|
import type { Post, PostRequest } from "@halo-dev/api-client";
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
|
type ComputedRef,
|
||||||
nextTick,
|
nextTick,
|
||||||
onMounted,
|
onMounted,
|
||||||
provide,
|
provide,
|
||||||
ref,
|
ref,
|
||||||
toRef,
|
toRef,
|
||||||
type ComputedRef,
|
|
||||||
watch,
|
watch,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import { apiClient } from "@/utils/api-client";
|
import { apiClient } from "@/utils/api-client";
|
||||||
|
@ -291,7 +291,8 @@ const handleFetchContent = async () => {
|
||||||
const provider =
|
const provider =
|
||||||
preferredEditor ||
|
preferredEditor ||
|
||||||
editorProviders.value.find(
|
editorProviders.value.find(
|
||||||
(provider) => provider.rawType === data.rawType
|
(provider) =>
|
||||||
|
provider.rawType.toLowerCase() === data.rawType?.toLowerCase()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (provider) {
|
if (provider) {
|
||||||
|
|
|
@ -234,7 +234,8 @@ async function handleSetEditorProviderFromRemote() {
|
||||||
const provider =
|
const provider =
|
||||||
preferredEditor ||
|
preferredEditor ||
|
||||||
editorProviders.value.find(
|
editorProviders.value.find(
|
||||||
(provider) => provider.rawType === content.value.rawType
|
(provider) =>
|
||||||
|
provider.rawType.toLowerCase() === content.value.rawType?.toLowerCase()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (provider) {
|
if (provider) {
|
||||||
|
|
Loading…
Reference in New Issue