From 652403ca3b9d3971785eb0ab23a9c06b9b91c5f7 Mon Sep 17 00:00:00 2001 From: NoriDev Date: Thu, 31 Oct 2024 17:41:02 +0900 Subject: [PATCH] =?UTF-8?q?enhance(frontend):=20=EC=83=81=EB=8C=80?= =?UTF-8?q?=EB=B0=A9=EC=9D=B4=20=EB=82=98=EB=A5=BC=20=EC=B0=A8=EB=8B=A8?= =?UTF-8?q?=ED=95=9C=20=EA=B2=BD=EC=9A=B0=20=EC=B0=A8=EB=8B=A8=EB=90=98?= =?UTF-8?q?=EC=97=88=EC=9D=8C=EC=9D=84=20=EC=95=8C=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EA=B0=9C=EC=84=A0=ED=95=A8=20=20=20-=20?= =?UTF-8?q?=EC=B0=A8=EB=8B=A8=EB=90=98=EB=A9=B4=20=EB=8B=A4=EC=9D=8C=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=EB=93=A4=EC=9D=B4=20=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=EC=83=81=EC=97=90=EC=84=9C=20=EC=82=AC=EB=9D=BC=EC=A7=80?= =?UTF-8?q?=EA=B3=A0=20=EC=82=AC=EC=9A=A9=EC=9D=B4=20=EC=A0=9C=ED=95=9C?= =?UTF-8?q?=EB=90=A9=EB=8B=88=EB=8B=A4.=20=20=20=20=20-=20=ED=8C=94?= =?UTF-8?q?=EB=A1=9C=EC=9A=B0=20=EB=B2=84=ED=8A=BC=20=20=20=20=20-=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EA=B8=B0=EB=B3=B8=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=99=B8=20=EB=8B=A4=EB=A5=B8=20=EB=AA=A8=EB=93=A0=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=EB=8A=94=20=EC=97=B4=EB=9E=8C=ED=95=A0=20=EC=88=98=20?= =?UTF-8?q?=EC=97=86=EC=9D=8C=20=20=20=20=20-=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=9E=90=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=9A=94=EC=95=BD=20=ED=83=AD=20=EC=99=B8=EC=97=90=20=EB=AA=A8?= =?UTF-8?q?=EB=93=A0=20=ED=83=AD=EC=9D=B4=20=EC=82=AC=EC=9A=A9=ED=95=A0=20?= =?UTF-8?q?=EC=88=98=20=EC=97=86=EA=B2=8C=EB=90=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_CHERRYPICK.md | 5 +++++ locales/en-US.yml | 2 ++ locales/index.d.ts | 8 ++++++++ locales/ja-JP.yml | 2 ++ locales/ko-KR.yml | 6 ++++-- .../1730364663000-youBlockedImageUrl.js | 16 ++++++++++++++++ .../src/core/entities/MetaEntityService.ts | 1 + packages/backend/src/models/Meta.ts | 6 ++++++ packages/backend/src/models/json-schema/meta.ts | 4 ++++ .../src/server/api/endpoints/admin/meta.ts | 5 +++++ .../server/api/endpoints/admin/update-meta.ts | 5 +++++ .../src/server/web/ClientServerService.ts | 1 + packages/cherrypick-js/src/autogen/types.ts | 3 +++ packages/frontend-shared/js/const.ts | 1 + .../frontend/src/components/MkFollowButton.vue | 2 +- packages/frontend/src/components/MkUserInfo.vue | 2 +- packages/frontend/src/components/MkUserPopup.vue | 16 +++++++++++++--- .../src/components/global/CPPageHeader.vue | 3 ++- .../src/components/global/MkPageHeader.vue | 3 ++- packages/frontend/src/instance.ts | 4 +++- packages/frontend/src/pages/admin/branding.vue | 8 ++++++++ packages/frontend/src/pages/user/home.vue | 14 ++++++++++---- packages/frontend/src/pages/user/index.vue | 8 ++++---- 23 files changed, 107 insertions(+), 18 deletions(-) create mode 100644 packages/backend/migration/1730364663000-youBlockedImageUrl.js diff --git a/CHANGELOG_CHERRYPICK.md b/CHANGELOG_CHERRYPICK.md index 5471c594bd..d0d8b926f8 100644 --- a/CHANGELOG_CHERRYPICK.md +++ b/CHANGELOG_CHERRYPICK.md @@ -56,6 +56,11 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2024xx](CHANGE - Enhance: 사용자 페이지와 사용자 팝업 개선 - 사용자 페이지와 사용자 팝업에 `새 노트 알림 켜기` 버튼이 추가됨 - 사용자 페이지에 `사용자 노트 검색` 버튼이 추가됨 +- Enhance: 상대방이 나를 차단한 경우 차단되었음을 알 수 있도록 개선함 + - 차단되면 다음 기능들이 화면 상에서 사라지고 사용이 제한됩니다. + - 팔로우 버튼 + - 사용자 페이지에서 기본 정보 외 다른 모든 정보는 열람할 수 없음 + - 사용자 페이지에서 요약 탭 외에 모든 탭이 사용할 수 없게됨 - Fix: 임베디드 코드에서 CherryPick의 색상 설정이 반영되지 않음 - Fix: 임베디드 코드에 `fade`와 `Temml(KaTex)`가 반영되지 않음 - Fix: 노트의 QR 코드를 생성했을 때 `링크 복사` 버튼을 누르면 잘못된 토스트 알림이 표시됨 diff --git a/locales/en-US.yml b/locales/en-US.yml index 1024c25d3a..6f1fa2e2d1 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1,5 +1,7 @@ --- _lang_: "English" +youBlocked: "You’re blocked" +youBlockedDescription: "You can’t follow or see {user}’s posts." schedulePost: "Posting a scheduled note" schedulePostList: "List of scheduled notes" welcomeBackToast: "Display a welcome message when you log in after a certain period of time" diff --git a/locales/index.d.ts b/locales/index.d.ts index fb056bbe3d..c90549b1d0 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -13,6 +13,14 @@ export interface Locale extends ILocale { * 日本語 */ "_lang_": string; + /** + * ブロックされています + */ + "youBlocked": string; + /** + * {user}さんのフォローやポストの表示はできません。 + */ + "youBlockedDescription": ParameterizedString<"user">; /** * 予約投稿 */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index bfada6d58b..6c80c55e74 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1,5 +1,7 @@ _lang_: "日本語" +youBlocked: "ブロックされています" +youBlockedDescription: "{user}さんのフォローやポストの表示はできません。" schedulePost: "予約投稿" schedulePostList: "予約投稿一覧" welcomeBackToast: "一定時間が経過した後に接続したときに歓迎メッセージを表示" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 90dfb4f02c..1ff091bd8e 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -1,5 +1,7 @@ --- _lang_: "한국어" +youBlocked: "앗.. 차단당했어요.." +youBlockedDescription: "{user} 님을 팔로우하거나 해당 사용자의 게시물을 볼 수 없어요." schedulePost: "노트 게시 예약" schedulePostList: "게시가 예약된 노트 목록" welcomeBackToast: "일정 시간이 지난 후 접속했을 때 환영 메시지 표시" @@ -27,7 +29,7 @@ showReplyTargetNoteInSemiTransparent: "답글 대상 노트를 반투명하게 noteFooterButton: "노트 동작 버튼" collapseReplies: "답글로 작성된 노트 간략화하기" collapseRepliesDescription: "답글로 작성된 노트를 접어서 표시해요.\n리액션한 노트는 영향을 받지 않아요." -repliedBy: "{user}님이 답글을 작성했어요" +repliedBy: "{user} 님이 답글을 작성했어요" collapseLongNoteContent: "내용이 긴 노트 간략화하기" alwaysShowCw: "'내용 가리기'로 설정한 내용을 항상 보이기" forceRenoteVisibilitySelector: "리노트 공개 범위 지정" @@ -114,7 +116,7 @@ gotIt: "알겠어요" cancel: "취소" noThankYou: "나중에" enterUsername: "사용자 이름 입력" -renotedBy: "{user}님이 리노트 했어요" +renotedBy: "{user} 님이 리노트 했어요" noNotes: "노트가 없어요" noNotifications: "표시할 알림이 없어요" instance: "서버" diff --git a/packages/backend/migration/1730364663000-youBlockedImageUrl.js b/packages/backend/migration/1730364663000-youBlockedImageUrl.js new file mode 100644 index 0000000000..c7ad9f5b13 --- /dev/null +++ b/packages/backend/migration/1730364663000-youBlockedImageUrl.js @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export class YouBlockedImageUrl1730364663000 { + name = 'YouBlockedImageUrl1730364663000' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "youBlockedImageUrl" character varying(1024)`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "youBlockedImageUrl"`); + } +} diff --git a/packages/backend/src/core/entities/MetaEntityService.ts b/packages/backend/src/core/entities/MetaEntityService.ts index bdcf57f2db..6b2e4164a1 100644 --- a/packages/backend/src/core/entities/MetaEntityService.ts +++ b/packages/backend/src/core/entities/MetaEntityService.ts @@ -104,6 +104,7 @@ export class MetaEntityService { infoImageUrl: instance.infoImageUrl, serverErrorImageUrl: instance.serverErrorImageUrl, notFoundImageUrl: instance.notFoundImageUrl, + youBlockedImageUrl: instance.youBlockedImageUrl, iconUrl: instance.iconUrl, backgroundImageUrl: instance.backgroundImageUrl, logoImageUrl: instance.logoImageUrl, diff --git a/packages/backend/src/models/Meta.ts b/packages/backend/src/models/Meta.ts index a271dfebf1..30565a7b3a 100644 --- a/packages/backend/src/models/Meta.ts +++ b/packages/backend/src/models/Meta.ts @@ -157,6 +157,12 @@ export class MiMeta { }) public infoImageUrl: string | null; + @Column('varchar', { + length: 1024, + nullable: true, + }) + public youBlockedImageUrl: string | null; + @Column('boolean', { default: false, }) diff --git a/packages/backend/src/models/json-schema/meta.ts b/packages/backend/src/models/json-schema/meta.ts index 5f0bfd0488..0942279b52 100644 --- a/packages/backend/src/models/json-schema/meta.ts +++ b/packages/backend/src/models/json-schema/meta.ts @@ -144,6 +144,10 @@ export const packedMetaLiteSchema = { type: 'string', optional: false, nullable: true, }, + youBlockedImageUrl: { + type: 'string', + optional: false, nullable: true, + }, iconUrl: { type: 'string', optional: false, nullable: true, diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 2fadb7634d..0fd911917b 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -94,6 +94,10 @@ export const meta = { type: 'string', optional: false, nullable: true, }, + youBlockedImageUrl: { + type: 'string', + optional: false, nullable: true, + }, iconUrl: { type: 'string', optional: false, nullable: true, @@ -654,6 +658,7 @@ export default class extends Endpoint { // eslint- serverErrorImageUrl: instance.serverErrorImageUrl, notFoundImageUrl: instance.notFoundImageUrl, infoImageUrl: instance.infoImageUrl, + youBlockedImageUrl: instance.youBlockedImageUrl, iconUrl: instance.iconUrl, app192IconUrl: instance.app192IconUrl, app512IconUrl: instance.app512IconUrl, 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 23b4628a02..264551bdd3 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -54,6 +54,7 @@ export const paramDef = { serverErrorImageUrl: { type: 'string', nullable: true }, infoImageUrl: { type: 'string', nullable: true }, notFoundImageUrl: { type: 'string', nullable: true }, + youBlockedImageUrl: { type: 'string', nullable: true }, iconUrl: { type: 'string', nullable: true }, app192IconUrl: { type: 'string', nullable: true }, app512IconUrl: { type: 'string', nullable: true }, @@ -302,6 +303,10 @@ export default class extends Endpoint { // eslint- set.notFoundImageUrl = ps.notFoundImageUrl; } + if (ps.youBlockedImageUrl !== undefined) { + set.youBlockedImageUrl = ps.youBlockedImageUrl; + } + if (ps.backgroundImageUrl !== undefined) { set.backgroundImageUrl = ps.backgroundImageUrl; } diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index 598c8e2ca5..fdbb2c0169 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -198,6 +198,7 @@ export class ClientServerService { serverErrorImageUrl: meta.serverErrorImageUrl ?? 'https://xn--931a.moe/assets/error.jpg', infoImageUrl: meta.infoImageUrl ?? 'https://xn--931a.moe/assets/info.jpg', notFoundImageUrl: meta.notFoundImageUrl ?? 'https://xn--931a.moe/assets/not-found.jpg', + youBlockedImageUrl: meta.youBlockedImageUrl ?? 'https://xn--931a.moe/assets/error.jpg', instanceUrl: this.config.url, metaJson: htmlSafeJsonStringify(await this.metaEntityService.packDetailed(meta)), now: Date.now(), diff --git a/packages/cherrypick-js/src/autogen/types.ts b/packages/cherrypick-js/src/autogen/types.ts index 17a16a2aed..3b7ad95849 100644 --- a/packages/cherrypick-js/src/autogen/types.ts +++ b/packages/cherrypick-js/src/autogen/types.ts @@ -5334,6 +5334,7 @@ export type components = { serverErrorImageUrl: string | null; infoImageUrl: string | null; notFoundImageUrl: string | null; + youBlockedImageUrl: string | null; iconUrl: string | null; maxNoteTextLength: number; ads: { @@ -5465,6 +5466,7 @@ export type operations = { serverErrorImageUrl: string | null; infoImageUrl: string | null; notFoundImageUrl: string | null; + youBlockedImageUrl: string | null; iconUrl: string | null; app192IconUrl: string | null; app512IconUrl: string | null; @@ -10152,6 +10154,7 @@ export type operations = { serverErrorImageUrl?: string | null; infoImageUrl?: string | null; notFoundImageUrl?: string | null; + youBlockedImageUrl?: string | null; iconUrl?: string | null; app192IconUrl?: string | null; app512IconUrl?: string | null; diff --git a/packages/frontend-shared/js/const.ts b/packages/frontend-shared/js/const.ts index 6d9b8edda5..0d3089c8fb 100644 --- a/packages/frontend-shared/js/const.ts +++ b/packages/frontend-shared/js/const.ts @@ -120,6 +120,7 @@ export const CURRENT_STICKY_BOTTOM = 'CURRENT_STICKY_BOTTOM'; export const DEFAULT_SERVER_ERROR_IMAGE_URL = 'https://xn--931a.moe/assets/error.jpg'; export const DEFAULT_NOT_FOUND_IMAGE_URL = 'https://xn--931a.moe/assets/not-found.jpg'; export const DEFAULT_INFO_IMAGE_URL = 'https://xn--931a.moe/assets/info.jpg'; +export const DEFAULT_YOU_BLOCKED_IMAGE_URL = 'https://xn--931a.moe/assets/error.jpg'; export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'scale', 'position', 'fg', 'bg', 'border', 'font', 'blur', 'rainbow', 'sparkle', 'fade', 'rotate', 'ruby', 'unixtime']; export const MFM_PARAMS: Record = { diff --git a/packages/frontend/src/components/MkFollowButton.vue b/packages/frontend/src/components/MkFollowButton.vue index 9839182d91..ccf4e5018e 100644 --- a/packages/frontend/src/components/MkFollowButton.vue +++ b/packages/frontend/src/components/MkFollowButton.vue @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkUserPopup.vue b/packages/frontend/src/components/MkUserPopup.vue index bf0859bd93..da6d18c4dc 100644 --- a/packages/frontend/src/components/MkUserPopup.vue +++ b/packages/frontend/src/components/MkUserPopup.vue @@ -44,9 +44,9 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ number(user.followersCount) }}
- - - + + +
@@ -260,8 +260,18 @@ onMounted(() => { border-radius: 999px; } +.menu { + &.isBlocked { + right: 44px; + } +} + .notify { right: 44px; + + &.isBlocked { + right: 8px; + } } .follow { diff --git a/packages/frontend/src/components/global/CPPageHeader.vue b/packages/frontend/src/components/global/CPPageHeader.vue index 02f397e41d..84f646a41d 100644 --- a/packages/frontend/src/components/global/CPPageHeader.vue +++ b/packages/frontend/src/components/global/CPPageHeader.vue @@ -52,7 +52,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
@@ -90,6 +90,7 @@ const props = withDefaults(defineProps<{ actions?: PageHeaderItem[] | null; thin?: boolean; displayMyAvatar?: boolean; + disableFollowButton?: boolean; }>(), { tabs: () => ([] as Tab[]), }); diff --git a/packages/frontend/src/components/global/MkPageHeader.vue b/packages/frontend/src/components/global/MkPageHeader.vue index ab24fff021..37cf27a66e 100644 --- a/packages/frontend/src/components/global/MkPageHeader.vue +++ b/packages/frontend/src/components/global/MkPageHeader.vue @@ -55,7 +55,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
@@ -92,6 +92,7 @@ const props = withDefaults(defineProps<{ actions?: PageHeaderItem[] | null; thin?: boolean; displayMyAvatar?: boolean; + disableFollowButton?: boolean; }>(), { tabs: () => ([] as Tab[]), }); diff --git a/packages/frontend/src/instance.ts b/packages/frontend/src/instance.ts index ca0ecc0673..3cf677a187 100644 --- a/packages/frontend/src/instance.ts +++ b/packages/frontend/src/instance.ts @@ -5,7 +5,7 @@ import { computed, reactive } from 'vue'; import * as Misskey from 'cherrypick-js'; -import { DEFAULT_INFO_IMAGE_URL, DEFAULT_NOT_FOUND_IMAGE_URL, DEFAULT_SERVER_ERROR_IMAGE_URL } from '@@/js/const.js'; +import { DEFAULT_INFO_IMAGE_URL, DEFAULT_NOT_FOUND_IMAGE_URL, DEFAULT_SERVER_ERROR_IMAGE_URL, DEFAULT_YOU_BLOCKED_IMAGE_URL } from '@@/js/const.js'; import { misskeyApi } from '@/scripts/misskey-api.js'; import { miLocalStorage } from '@/local-storage.js'; @@ -36,6 +36,8 @@ export const infoImageUrl = computed(() => instance.infoImageUrl ?? DEFAULT_INFO export const notFoundImageUrl = computed(() => instance.notFoundImageUrl ?? DEFAULT_NOT_FOUND_IMAGE_URL); +export const youBlockedImageUrl = computed(() => instance.youBlockedImageUrl ?? DEFAULT_YOU_BLOCKED_IMAGE_URL); + export const isEnabledUrlPreview = computed(() => instance.enableUrlPreview ?? true); export async function fetchInstance(force = false): Promise { diff --git a/packages/frontend/src/pages/admin/branding.vue b/packages/frontend/src/pages/admin/branding.vue index 33d61cddd7..84e81701f6 100644 --- a/packages/frontend/src/pages/admin/branding.vue +++ b/packages/frontend/src/pages/admin/branding.vue @@ -62,6 +62,11 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + + @@ -135,6 +140,7 @@ const defaultDarkTheme = ref(null); const serverErrorImageUrl = ref(null); const infoImageUrl = ref(null); const notFoundImageUrl = ref(null); +const youBlockedImageUrl = ref(null); const repositoryUrl = ref(null); const feedbackUrl = ref(null); const manifestJsonOverride = ref('{}'); @@ -153,6 +159,7 @@ async function init() { serverErrorImageUrl.value = meta.serverErrorImageUrl; infoImageUrl.value = meta.infoImageUrl; notFoundImageUrl.value = meta.notFoundImageUrl; + youBlockedImageUrl.value = meta.youBlockedImageUrl; repositoryUrl.value = meta.repositoryUrl; feedbackUrl.value = meta.feedbackUrl; manifestJsonOverride.value = meta.manifestJsonOverride === '' ? '{}' : JSON.stringify(JSON.parse(meta.manifestJsonOverride), null, '\t'); @@ -171,6 +178,7 @@ function save() { defaultDarkTheme: defaultDarkTheme.value === '' ? null : defaultDarkTheme.value, infoImageUrl: infoImageUrl.value === '' ? null : infoImageUrl.value, notFoundImageUrl: notFoundImageUrl.value === '' ? null : notFoundImageUrl.value, + youBlockedImageUrl: youBlockedImageUrl.value === '' ? null : youBlockedImageUrl.value, serverErrorImageUrl: serverErrorImageUrl.value === '' ? null : serverErrorImageUrl.value, repositoryUrl: repositoryUrl.value === '' ? null : repositoryUrl.value, feedbackUrl: feedbackUrl.value === '' ? null : feedbackUrl.value, diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index d35ff2ba24..5d741d3179 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -148,11 +148,11 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
{{ i18n.ts.userPagePinTip }} -