1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-27 14:28:49 +09:00

fix(general): flash/createでPlayの公開範囲を指定できない問題の修正と編集画面の調整 (#13574)

* fix(backend): param `visibility` wasn't included in `flash/create`

* fix(frontend): tweak flash editor ui

* Update CHANGELOG.md
This commit is contained in:
zyoshoka 2024-03-15 22:02:57 +09:00 committed by GitHub
parent 71d0538647
commit 4b1ca9ef61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 21 additions and 7 deletions

View File

@ -1,7 +1,7 @@
## Unreleased
### General
-
- Fix: Play作成時に設定した公開範囲が機能していない問題を修正
### Client
- Enhance: 自分のノートの添付ファイルから直接ファイルの詳細ページに飛べるように

4
locales/index.d.ts vendored
View File

@ -8635,6 +8635,10 @@ export interface Locale extends ILocale {
*
*/
"summary": string;
/**
* URLを知っている人は引き続きアクセスできます
*/
"visibilityDescription": string;
};
"_pages": {
/**

View File

@ -2280,6 +2280,7 @@ _play:
title: "タイトル"
script: "スクリプト"
summary: "説明"
visibilityDescription: "非公開に設定するとプロフィールに表示されなくなりますが、URLを知っている人は引き続きアクセスできます。"
_pages:
newPage: "ページの作成"

View File

@ -44,6 +44,7 @@ export const paramDef = {
permissions: { type: 'array', items: {
type: 'string',
} },
visibility: { type: 'string', enum: ['public', 'private'], default: 'public' },
},
required: ['title', 'summary', 'script', 'permissions'],
} as const;
@ -66,6 +67,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
summary: ps.summary,
script: ps.script,
permissions: ps.permissions,
visibility: ps.visibility,
}).then(x => this.flashsRepository.findOneByOrFail(x.identifiers[0]));
return await this.flashEntityService.pack(flash);

View File

@ -18,16 +18,17 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkCodeEditor v-model="script" lang="is">
<template #label>{{ i18n.ts._play.script }}</template>
</MkCodeEditor>
<MkSelect v-model="visibility">
<template #label>{{ i18n.ts.visibility }}</template>
<template #caption>{{ i18n.ts._play.visibilityDescription }}</template>
<option :key="'public'" :value="'public'">{{ i18n.ts.public }}</option>
<option :key="'private'" :value="'private'">{{ i18n.ts.private }}</option>
</MkSelect>
<div class="_buttons">
<MkButton primary @click="save"><i class="ti ti-check"></i> {{ i18n.ts.save }}</MkButton>
<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>
@ -367,7 +368,7 @@ const props = defineProps<{
}>();
const flash = ref<Misskey.entities.Flash | null>(null);
const visibility = ref<Misskey.entities.FlashUpdateRequest['visibility']>('public');
const visibility = ref<'private' | 'public'>('public');
if (props.id) {
flash.value = await misskeyApi('flash/show', {
@ -420,6 +421,7 @@ async function save() {
summary: summary.value,
permissions: permissions.value,
script: script.value,
visibility: visibility.value,
});
router.push('/play/' + created.id + '/edit');
}

View File

@ -22686,6 +22686,11 @@ export type operations = {
summary: string;
script: string;
permissions: string[];
/**
* @default public
* @enum {string}
*/
visibility?: 'public' | 'private';
};
};
};