From d627cdbf2c51d1c56747bae10ed60ec600de4890 Mon Sep 17 00:00:00 2001 From: NoriDev Date: Wed, 4 Oct 2023 16:05:56 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=82=AF=E3=83=A9=E3=82=A4=E3=82=A2?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=AE=E3=82=A2=E3=83=83=E3=83=97=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=83=88=E9=80=9A=E7=9F=A5=E3=83=81=E3=83=A3=E3=83=B3?= =?UTF-8?q?=E3=83=8D=E3=83=AB=E3=82=92=E9=81=B8=E6=8A=9E=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_CHERRYPICK.md | 1 + locales/en-US.yml | 1 + locales/index.d.ts | 1 + locales/ja-JP.yml | 1 + locales/ko-KR.yml | 1 + .../1696402675000-add-meta-options.js | 16 ++++++++ packages/backend/src/models/Meta.ts | 5 +++ .../src/server/api/endpoints/admin/meta.ts | 5 +++ .../server/api/endpoints/admin/update-meta.ts | 4 ++ packages/frontend/src/pages/admin/index.vue | 3 +- packages/frontend/src/pages/admin/update.vue | 39 +++++++++++++++++-- 11 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 packages/backend/migration/1696402675000-add-meta-options.js diff --git a/CHANGELOG_CHERRYPICK.md b/CHANGELOG_CHERRYPICK.md index 31af85d539..b79d7c1fc6 100644 --- a/CHANGELOG_CHERRYPICK.md +++ b/CHANGELOG_CHERRYPICK.md @@ -34,6 +34,7 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGE > 문제가 발생하면 '설정 - 캐시 비우기'를 진행하거나, 브라우저 캐시를 삭제하십시오. ### Client +- Feat: 클라이언트 업데이트 알림 채널을 선택할 수 있음 - Enhance: 그룹 대화에서 읽음 표시를 개선 - Fix: 서브 노트 기능 오류 - 서브 노트에서 더 보기 버튼을 사용할 수 없음 diff --git a/locales/en-US.yml b/locales/en-US.yml index a48f2214d2..8134ea8434 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1,5 +1,6 @@ --- _lang_: "English" +enableReceivePrerelease: "Get notified of pre-release versions" youAreRunningBetaClient: "Unreleased version of CherryPick in use!" cherrypickUpdate: "CherryPick Update" allMediaNoteCollapse: "Collapse all media notes" diff --git a/locales/index.d.ts b/locales/index.d.ts index 0cb435484a..8aed0c377b 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -3,6 +3,7 @@ // Do not edit this file directly. export interface Locale { "_lang_": string; + "enableReceivePrerelease": string; "youAreRunningBetaClient": string; "cherrypickUpdate": string; "allMediaNoteCollapse": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index f475fb51d6..637586ceba 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1,5 +1,6 @@ _lang_: "日本語" +enableReceivePrerelease: "プレリリース版の通知を受け取る" youAreRunningBetaClient: "未発売バージョンのCherryPickを利用しています!" cherrypickUpdate: "CherryPickアップデート" allMediaNoteCollapse: "すべてのメディアノートを省略して表示" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 6dfe2fbb57..58964e0abc 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -1,5 +1,6 @@ --- _lang_: "한국어" +enableReceivePrerelease: "출시 전 버전 알림 받기" youAreRunningBetaClient: "아직 출시되지 않은 버전의 CherryPick를 이용하고 있어요!" cherrypickUpdate: "CherryPick 업데이트" allMediaNoteCollapse: "모든 미디어 노트 간략화하기" diff --git a/packages/backend/migration/1696402675000-add-meta-options.js b/packages/backend/migration/1696402675000-add-meta-options.js new file mode 100644 index 0000000000..9941edc6ae --- /dev/null +++ b/packages/backend/migration/1696402675000-add-meta-options.js @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export class AddMetaOptions1696402675000 { + name = 'AddMetaOptions1696402675000' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "enableReceivePrerelease" boolean NOT NULL DEFAULT false`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableReceivePrerelease"`); + } +} diff --git a/packages/backend/src/models/Meta.ts b/packages/backend/src/models/Meta.ts index 04302ba58e..545be17da8 100644 --- a/packages/backend/src/models/Meta.ts +++ b/packages/backend/src/models/Meta.ts @@ -589,4 +589,9 @@ export class MiMeta { length: 1024, array: true, default: '{ "admin", "administrator", "root", "system", "maintainer", "host", "mod", "moderator", "owner", "superuser", "staff", "auth", "i", "me", "everyone", "all", "mention", "mentions", "example", "user", "users", "account", "accounts", "official", "help", "helps", "support", "supports", "info", "information", "informations", "announce", "announces", "announcement", "announcements", "notice", "notification", "notifications", "dev", "developer", "developers", "tech", "misskey", "cherrypick" }', }) public preservedUsernames: string[]; + + @Column('boolean', { + default: false, + }) + public enableReceivePrerelease: boolean; } diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index cbdc08890b..f9915c9f73 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -354,6 +354,10 @@ export const meta = { type: 'object', optional: false, nullable: false, }, + enableReceivePrerelease: { + type: 'boolean', + optional: false, nullable: false, + }, }, }, } as const; @@ -484,6 +488,7 @@ export default class extends Endpoint { // eslint- emailToReceiveAbuseReport: instance.emailToReceiveAbuseReport, policies: { ...DEFAULT_POLICIES, ...instance.policies }, manifestJsonOverride: instance.manifestJsonOverride, + enableReceivePrerelease: instance.enableReceivePrerelease, }; }); } diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index bc97224f88..fd2e6b4e60 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -553,6 +553,10 @@ export default class extends Endpoint { // eslint- set.manifestJsonOverride = ps.manifestJsonOverride; } + if (ps.enableReceivePrerelease !== undefined) { + set.enableReceivePrerelease = ps.enableReceivePrerelease; + } + const before = await this.metaService.fetch(true); await this.metaService.update(set); diff --git a/packages/frontend/src/pages/admin/index.vue b/packages/frontend/src/pages/admin/index.vue index 44c16b1f83..0bcbba07b7 100644 --- a/packages/frontend/src/pages/admin/index.vue +++ b/packages/frontend/src/pages/admin/index.vue @@ -77,7 +77,8 @@ fetch('https://api.github.com/repos/kokonect-link/cherrypick/releases', { method: 'GET', }).then(res => res.json()) .then(res => { - releasesCherryPick = res; + if (meta.enableReceivePrerelease) releasesMisskey = res.filter(x => x.prerelease === true); + else releasesMisskey = res.filter(x => x.prerelease === false); if (version < releasesCherryPick[0].tag_name) updateAvailable = true; }); diff --git a/packages/frontend/src/pages/admin/update.vue b/packages/frontend/src/pages/admin/update.vue index 9b24680d95..1be01905de 100644 --- a/packages/frontend/src/pages/admin/update.vue +++ b/packages/frontend/src/pages/admin/update.vue @@ -8,6 +8,12 @@ SPDX-License-Identifier: AGPL-3.0-only
+
+ + + +
+