プロフィールにその人が作ったPlayの一覧出せるように (#11445)
* プロフィールにその人が作ったPlayの一覧出せるように * Update CHANGELOG.md * playの公開範囲を設定できるように * 間違えて変更してしまったのを修正 * Update packages/frontend/src/pages/flash/flash-edit.vue * Update packages/frontend/src/pages/flash/flash-edit.vue * tweak * Update packages/backend/migration/1690796169261-play-visibility.js * Update packages/backend/src/models/entities/Flash.ts * Update packages/backend/src/models/entities/Flash.ts * Update Flash.ts --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
parent
77f18f4250
commit
70a7800927
14 changed files with 143 additions and 0 deletions
|
@ -23,6 +23,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkButton @click="show"><i class="ti ti-eye"></i> {{ i18n.ts.show }}</MkButton>
|
||||
<MkButton v-if="flash" danger @click="del"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
|
||||
</div>
|
||||
<MkSelect v-model="visibility">
|
||||
<template #label>{{ i18n.ts.visibility }}</template>
|
||||
<option :key="'public'" :value="'public'">{{ i18n.ts.public }}</option>
|
||||
<option :key="'private'" :value="'private'">{{ i18n.ts.private }}</option>
|
||||
</MkSelect>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
|
@ -36,6 +41,7 @@ import { i18n } from '@/i18n';
|
|||
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
import { useRouter } from '@/router';
|
||||
|
||||
const PRESET_DEFAULT = `/// @ 0.15.0
|
||||
|
@ -358,6 +364,7 @@ const props = defineProps<{
|
|||
}>();
|
||||
|
||||
let flash = $ref(null);
|
||||
let visibility = $ref('public');
|
||||
|
||||
if (props.id) {
|
||||
flash = await os.api('flash/show', {
|
||||
|
@ -402,6 +409,7 @@ async function save() {
|
|||
summary,
|
||||
permissions,
|
||||
script,
|
||||
visibility,
|
||||
});
|
||||
} else {
|
||||
const created = await os.apiWithDialog('flash/create', {
|
||||
|
|
31
packages/frontend/src/pages/user/flashs.vue
Normal file
31
packages/frontend/src/pages/user/flashs.vue
Normal file
|
@ -0,0 +1,31 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<MkSpacer :contentMax="700">
|
||||
<MkPagination v-slot="{items}" ref="list" :pagination="pagination">
|
||||
<MkFlashPreview v-for="flash in items" :key="flash.id" :flash="flash" class="_margin"/>
|
||||
</MkPagination>
|
||||
</MkSpacer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import * as misskey from 'misskey-js';
|
||||
import MkFlashPreview from '@/components/MkFlashPreview.vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
|
||||
const props = defineProps<{
|
||||
user: misskey.entities.User;
|
||||
}>();
|
||||
|
||||
const pagination = {
|
||||
endpoint: 'users/flashs' as const,
|
||||
limit: 20,
|
||||
params: computed(() => ({
|
||||
userId: props.user.id,
|
||||
})),
|
||||
};
|
||||
</script>
|
|
@ -16,6 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<XClips v-else-if="tab === 'clips'" :user="user"/>
|
||||
<XLists v-else-if="tab === 'lists'" :user="user"/>
|
||||
<XPages v-else-if="tab === 'pages'" :user="user"/>
|
||||
<XFlashs v-else-if="tab === 'flashs'" :user="user"/>
|
||||
<XGallery v-else-if="tab === 'gallery'" :user="user"/>
|
||||
</div>
|
||||
<MkError v-else-if="error" @retry="fetchUser()"/>
|
||||
|
@ -42,6 +43,7 @@ const XReactions = defineAsyncComponent(() => import('./reactions.vue'));
|
|||
const XClips = defineAsyncComponent(() => import('./clips.vue'));
|
||||
const XLists = defineAsyncComponent(() => import('./lists.vue'));
|
||||
const XPages = defineAsyncComponent(() => import('./pages.vue'));
|
||||
const XFlashs = defineAsyncComponent(() => import('./flashs.vue'));
|
||||
const XGallery = defineAsyncComponent(() => import('./gallery.vue'));
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
|
@ -103,6 +105,10 @@ const headerTabs = $computed(() => user ? [{
|
|||
key: 'pages',
|
||||
title: i18n.ts.pages,
|
||||
icon: 'ti ti-news',
|
||||
}, {
|
||||
key: 'flashs',
|
||||
title: 'Play',
|
||||
icon: 'ti ti-player-play',
|
||||
}, {
|
||||
key: 'gallery',
|
||||
title: i18n.ts.gallery,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue