diff --git a/locales/index.d.ts b/locales/index.d.ts index b7d670836f..e97f1aa286 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1109,7 +1109,8 @@ export interface Locale { "forExistingUsersDescription": string; "needConfirmationToRead": string; "needConfirmationToReadDescription": string; - "deactivate": string; + "end": string; + "tooManyActiveAnnouncementDescription": string; }; "_initialAccountSetting": { "accountCreated": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index dba4b4247a..dba8ceedb3 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1107,7 +1107,8 @@ _announcement: forExistingUsersDescription: "有効にすると、このお知らせ作成時点で存在するユーザーにのみお知らせが表示されます。無効にすると、このお知らせ作成後にアカウントを作成したユーザーにもお知らせが表示されます。" needConfirmationToRead: "既読にするのに確認が必要" needConfirmationToReadDescription: "有効にすると、このお知らせを既読にする際に確認ダイアログが表示されます。また、一括既読操作の対象になりません。" - deactivate: "お知らせを終了" + end: "お知らせを終了" + tooManyActiveAnnouncementDescription: "アクティブなお知らせが多いため、UXが低下する可能性があります。終了したお知らせはアーカイブすることを検討してください。" _initialAccountSetting: accountCreated: "アカウントの作成が完了しました!" diff --git a/packages/frontend/src/pages/admin/announcements.vue b/packages/frontend/src/pages/admin/announcements.vue index d31487376b..bb903af459 100644 --- a/packages/frontend/src/pages/admin/announcements.vue +++ b/packages/frontend/src/pages/admin/announcements.vue @@ -7,9 +7,20 @@ SPDX-License-Identifier: AGPL-3.0-only -
-
-
+
+ {{ i18n.ts._announcement.tooManyActiveAnnouncementDescription }} + + + + + + +
@@ -41,11 +52,11 @@ SPDX-License-Identifier: AGPL-3.0-only

{{ i18n.t('nUsersRead', { n: announcement.reads }) }}

{{ i18n.ts.save }} - {{ i18n.ts._announcement.deactivate }} - {{ i18n.ts.remove }} + {{ i18n.ts._announcement.end }} ({{ i18n.ts.archive }}) + {{ i18n.ts.delete }}
-
+
@@ -59,9 +70,11 @@ import MkInput from '@/components/MkInput.vue'; import MkTextarea from '@/components/MkTextarea.vue'; import MkSwitch from '@/components/MkSwitch.vue'; import MkRadios from '@/components/MkRadios.vue'; +import MkInfo from '@/components/MkInfo.vue'; import * as os from '@/os'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; +import MkFolder from '@/components/MkFolder.vue'; let announcements: any[] = $ref([]); @@ -73,7 +86,7 @@ function add() { announcements.unshift({ _id: Math.random().toString(36), id: null, - title: '', + title: 'New announcement', text: '', imageUrl: null, icon: 'info', @@ -83,10 +96,10 @@ function add() { }); } -function remove(announcement) { +function del(announcement) { os.confirm({ type: 'warning', - text: i18n.t('removeAreYouSure', { x: announcement.title }), + text: i18n.t('deleteAreYouSure', { x: announcement.title }), }).then(({ canceled }) => { if (canceled) return; announcements = announcements.filter(x => x !== announcement); @@ -94,7 +107,7 @@ function remove(announcement) { }); } -async function deactivate(announcement) { +async function archive(announcement) { await os.apiWithDialog('admin/announcements/update', { ...announcement, isActive: false,