Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ignore case when matching editor raw types #5602

Merged
merged 1 commit into from Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 10 additions & 9 deletions ui/console-src/modules/contents/pages/SinglePageEditor.vue
@@ -1,26 +1,26 @@
<script lang="ts" setup>
import {
VPageHeader,
Dialog,
IconEye,
IconPages,
IconSettings,
IconSendPlaneFill,
VSpace,
VButton,
IconSave,
IconSendPlaneFill,
IconSettings,
Toast,
Dialog,
IconEye,
VButton,
VPageHeader,
VSpace,
} from "@halo-dev/components";
import SinglePageSettingModal from "./components/SinglePageSettingModal.vue";
import type { SinglePage, SinglePageRequest } from "@halo-dev/api-client";
import {
computed,
type ComputedRef,
nextTick,
onMounted,
provide,
ref,
toRef,
type ComputedRef,
watch,
} from "vue";
import { apiClient } from "@/utils/api-client";
Expand Down Expand Up @@ -271,7 +271,8 @@ const handleFetchContent = async () => {
const provider =
preferredEditor ||
editorProviders.value.find(
(provider) => provider.rawType === data.rawType
(provider) =>
provider.rawType.toLowerCase() === data.rawType?.toLowerCase()
);
if (provider) {
currentEditorProvider.value = provider;
Expand Down
13 changes: 7 additions & 6 deletions ui/console-src/modules/contents/posts/PostEditor.vue
@@ -1,26 +1,26 @@
<script lang="ts" setup>
import {
Dialog,
IconBookRead,
IconEye,
IconSave,
IconSettings,
IconSendPlaneFill,
IconSettings,
Toast,
VButton,
VPageHeader,
VSpace,
Toast,
Dialog,
IconEye,
} from "@halo-dev/components";
import PostSettingModal from "./components/PostSettingModal.vue";
import type { Post, PostRequest } from "@halo-dev/api-client";
import {
computed,
type ComputedRef,
nextTick,
onMounted,
provide,
ref,
toRef,
type ComputedRef,
watch,
} from "vue";
import { apiClient } from "@/utils/api-client";
Expand Down Expand Up @@ -291,7 +291,8 @@ const handleFetchContent = async () => {
const provider =
preferredEditor ||
editorProviders.value.find(
(provider) => provider.rawType === data.rawType
(provider) =>
provider.rawType.toLowerCase() === data.rawType?.toLowerCase()
);

if (provider) {
Expand Down
3 changes: 2 additions & 1 deletion ui/uc-src/modules/contents/posts/PostEditor.vue
Expand Up @@ -234,7 +234,8 @@ async function handleSetEditorProviderFromRemote() {
const provider =
preferredEditor ||
editorProviders.value.find(
(provider) => provider.rawType === content.value.rawType
(provider) =>
provider.rawType.toLowerCase() === content.value.rawType?.toLowerCase()
);

if (provider) {
Expand Down