diff options
| author | GrapeApple0 <84321396+GrapeApple0@users.noreply.github.com> | 2023-08-21 20:23:09 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-21 20:23:09 +0900 |
| commit | 70a78009270df3ff9a76e84a4e2dd0837a1b5f46 (patch) | |
| tree | 60440113ef1d45f2b30b2abf0711dec613ec2b6d /packages/frontend | |
| parent | Update CHANGELOG.md (diff) | |
| download | sharkey-70a78009270df3ff9a76e84a4e2dd0837a1b5f46.tar.gz sharkey-70a78009270df3ff9a76e84a4e2dd0837a1b5f46.tar.bz2 sharkey-70a78009270df3ff9a76e84a4e2dd0837a1b5f46.zip | |
プロフィールにその人が作った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>
Diffstat (limited to 'packages/frontend')
| -rw-r--r-- | packages/frontend/src/pages/flash/flash-edit.vue | 8 | ||||
| -rw-r--r-- | packages/frontend/src/pages/user/flashs.vue | 31 | ||||
| -rw-r--r-- | packages/frontend/src/pages/user/index.vue | 6 |
3 files changed, 45 insertions, 0 deletions
diff --git a/packages/frontend/src/pages/flash/flash-edit.vue b/packages/frontend/src/pages/flash/flash-edit.vue index fecf6edd0c..414fe4836c 100644 --- a/packages/frontend/src/pages/flash/flash-edit.vue +++ b/packages/frontend/src/pages/flash/flash-edit.vue @@ -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', { diff --git a/packages/frontend/src/pages/user/flashs.vue b/packages/frontend/src/pages/user/flashs.vue new file mode 100644 index 0000000000..b91ecb8de6 --- /dev/null +++ b/packages/frontend/src/pages/user/flashs.vue @@ -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> diff --git a/packages/frontend/src/pages/user/index.vue b/packages/frontend/src/pages/user/index.vue index 314548fee3..c014897a24 100644 --- a/packages/frontend/src/pages/user/index.vue +++ b/packages/frontend/src/pages/user/index.vue @@ -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<{ @@ -104,6 +106,10 @@ const headerTabs = $computed(() => user ? [{ title: i18n.ts.pages, icon: 'ti ti-news', }, { + key: 'flashs', + title: 'Play', + icon: 'ti ti-player-play', +}, { key: 'gallery', title: i18n.ts.gallery, icon: 'ti ti-icons', |