summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzyoshoka <107108195+zyoshoka@users.noreply.github.com>2024-03-15 22:02:57 +0900
committerGitHub <noreply@github.com>2024-03-15 22:02:57 +0900
commit4b1ca9ef619903e9ff1de10101c18569efbe099c (patch)
tree4c24347cf9db75936507e0afa7c0f055c699ab73
parentfix(frontend): update locales/index.d.ts (diff)
downloadmisskey-4b1ca9ef619903e9ff1de10101c18569efbe099c.tar.gz
misskey-4b1ca9ef619903e9ff1de10101c18569efbe099c.tar.bz2
misskey-4b1ca9ef619903e9ff1de10101c18569efbe099c.zip
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
-rw-r--r--CHANGELOG.md2
-rw-r--r--locales/index.d.ts4
-rw-r--r--locales/ja-JP.yml1
-rw-r--r--packages/backend/src/server/api/endpoints/flash/create.ts2
-rw-r--r--packages/frontend/src/pages/flash/flash-edit.vue14
-rw-r--r--packages/misskey-js/src/autogen/types.ts5
6 files changed, 21 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f1e863a8f2..fa56f1a268 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,7 @@
## Unreleased
### General
--
+- Fix: Play作成時に設定した公開範囲が機能していない問題を修正
### Client
- Enhance: 自分のノートの添付ファイルから直接ファイルの詳細ページに飛べるように
diff --git a/locales/index.d.ts b/locales/index.d.ts
index 87065e1d37..7f4ec7ecb0 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -8635,6 +8635,10 @@ export interface Locale extends ILocale {
* 説明
*/
"summary": string;
+ /**
+ * 非公開に設定するとプロフィールに表示されなくなりますが、URLを知っている人は引き続きアクセスできます。
+ */
+ "visibilityDescription": string;
};
"_pages": {
/**
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index f42fd6587a..8b44ac2121 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -2280,6 +2280,7 @@ _play:
title: "タイトル"
script: "スクリプト"
summary: "説明"
+ visibilityDescription: "非公開に設定するとプロフィールに表示されなくなりますが、URLを知っている人は引き続きアクセスできます。"
_pages:
newPage: "ページの作成"
diff --git a/packages/backend/src/server/api/endpoints/flash/create.ts b/packages/backend/src/server/api/endpoints/flash/create.ts
index 584d167a29..361496e17e 100644
--- a/packages/backend/src/server/api/endpoints/flash/create.ts
+++ b/packages/backend/src/server/api/endpoints/flash/create.ts
@@ -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);
diff --git a/packages/frontend/src/pages/flash/flash-edit.vue b/packages/frontend/src/pages/flash/flash-edit.vue
index 4418172e62..3625bc1164 100644
--- a/packages/frontend/src/pages/flash/flash-edit.vue
+++ b/packages/frontend/src/pages/flash/flash-edit.vue
@@ -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>
- <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>
+ <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>
</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');
}
diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts
index be3e86bd78..3c862f690e 100644
--- a/packages/misskey-js/src/autogen/types.ts
+++ b/packages/misskey-js/src/autogen/types.ts
@@ -22686,6 +22686,11 @@ export type operations = {
summary: string;
script: string;
permissions: string[];
+ /**
+ * @default public
+ * @enum {string}
+ */
+ visibility?: 'public' | 'private';
};
};
};