1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-26 18:24:36 +02:00

refactor(frontend): フロントエンドの型エラー解消(途中まで) (#16539)

* fix(frontend): FormLinkをボタンとして使用した際にエラーが出る問題を修正

* refactor(frontend): フロントエンドの型エラー解消

* remove unused ts-expect-error

* migrate

* remove unrelated changes

* fix lint

* more type fixes
This commit is contained in:
かっこかり
2025-09-13 08:33:14 +09:00
committed by GitHub
parent c174c5c144
commit 5b4115e21a
56 changed files with 316 additions and 236 deletions

View File

@@ -39,6 +39,7 @@ const props = defineProps<{
const emit = defineEmits<{
(ev: 'update:modelValue', value: Misskey.entities.PageBlock & { type: 'note' }): void;
(ev: 'remove'): void;
}>();
const id = ref(props.modelValue.note);

View File

@@ -71,7 +71,7 @@ async function add() {
title: i18n.ts._pages.chooseBlock,
items: getPageBlockList(),
});
if (canceled) return;
if (canceled || type == null) return;
const id = genId();
children.value.push({ id, type });

View File

@@ -27,6 +27,7 @@ const props = defineProps<{
const emit = defineEmits<{
(ev: 'update:modelValue', value: Misskey.entities.PageBlock & { type: 'text' }): void;
(ev: 'remove'): void;
}>();
let autocomplete: Autocomplete;
@@ -42,6 +43,7 @@ watch(text, () => {
});
onMounted(() => {
if (inputEl.value == null) return;
autocomplete = new Autocomplete(inputEl.value, text);
});

View File

@@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<PageWithHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs">
<div class="_spacer" style="--MI_SPACER-w: 700px;">
<div class="jqqmcavi">
<MkButton v-if="pageId" class="button" inline link :to="`/@${ author.username }/pages/${ currentName }`"><i class="ti ti-external-link"></i> {{ i18n.ts._pages.viewPage }}</MkButton>
<MkButton v-if="pageId && author != null" class="button" inline link :to="`/@${ author.username }/pages/${ currentName }`"><i class="ti ti-external-link"></i> {{ i18n.ts._pages.viewPage }}</MkButton>
<MkButton v-if="!readonly" inline primary class="button" @click="save"><i class="ti ti-device-floppy"></i> {{ i18n.ts.save }}</MkButton>
<MkButton v-if="pageId" inline class="button" @click="duplicate"><i class="ti ti-copy"></i> {{ i18n.ts.duplicate }}</MkButton>
<MkButton v-if="pageId && !readonly" inline class="button" danger @click="del"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
@@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkInput>
<MkInput v-model="name">
<template #prefix>{{ url }}/@{{ author.username }}/pages/</template>
<template #prefix>{{ url }}/@{{ author?.username ?? '???' }}/pages/</template>
<template #label>{{ i18n.ts._pages.url }}</template>
</MkInput>
@@ -85,7 +85,7 @@ const props = defineProps<{
}>();
const tab = ref('settings');
const author = ref($i);
const author = ref<Misskey.entities.User | null>($i);
const readonly = ref(false);
const page = ref<Misskey.entities.Page | null>(null);
const pageId = ref<string | null>(null);
@@ -202,11 +202,10 @@ async function duplicate() {
async function add() {
const { canceled, result: type } = await os.select({
type: null,
title: i18n.ts._pages.chooseBlock,
items: getPageBlockList(),
});
if (canceled) return;
if (canceled || type == null) return;
const id = genId();
content.value.push({ id, type });