From 9cc36ef32d9d60552b36f58f77e7beb698b85d50 Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 10 Feb 2023 11:52:13 +0000 Subject: [PATCH 01/22] fix share page --- packages/frontend/src/components/MkPostForm.vue | 2 +- packages/frontend/src/pages/share.vue | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index c7e7e85b2..a06bdecaa 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -109,7 +109,7 @@ const props = withDefaults(defineProps<{ mention?: misskey.entities.User; specified?: misskey.entities.User; initialText?: string; - initialVisibility?: typeof misskey.noteVisibilities; + initialVisibility?: (typeof misskey.noteVisibilities)[number]; initialFiles?: misskey.entities.DriveFile[]; initialLocalOnly?: boolean; initialVisibleUsers?: misskey.entities.User[]; diff --git a/packages/frontend/src/pages/share.vue b/packages/frontend/src/pages/share.vue index d8b956b6d..78e071016 100644 --- a/packages/frontend/src/pages/share.vue +++ b/packages/frontend/src/pages/share.vue @@ -2,7 +2,7 @@ - (); +let reply = $ref(); +let renote = $ref(); +let visibility = $ref(noteVisibilities.includes(visibilityQuery) ? visibilityQuery : undefined); +let localOnly = $ref(localOnlyQuery === '0' ? false : localOnlyQuery === '1' ? true : undefined); let files = $ref([] as Misskey.entities.DriveFile[]); let visibleUsers = $ref([] as Misskey.entities.User[]); @@ -130,7 +130,7 @@ async function init() { ); } //#endregion - } catch (err) { + } catch (err: any) { os.alert({ type: 'error', title: err.message, From 9351fb9617948383111963d9d4c6779f57940e12 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 11 Feb 2023 09:03:43 +0900 Subject: [PATCH 02/22] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=87=E3=82=A3?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=8A=E3=83=AB=E3=83=AD=E3=83=BC=E3=83=AB?= =?UTF-8?q?=E3=82=82=E3=83=90=E3=83=83=E3=82=B8=E3=81=A8=E3=81=97=E3=81=A6?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E5=8F=AF=E8=83=BD=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 +++++++++ packages/backend/src/core/RoleService.ts | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6705535f0..bfd64a94b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,15 @@ You should also include the user name that made the change. --> + +## 13.x.x (unreleased) + +### Improvements +- コンディショナルロールもバッジとして表示可能に + +### Bugfixes +- + ## 13.5.6 (2023/02/10) ### Improvements diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index d15d8c0ae..9a782780d 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -211,8 +211,14 @@ export class RoleService implements OnApplicationShutdown { const assignedRoleIds = assigns.map(x => x.roleId); const roles = await this.rolesCache.fetch(null, () => this.rolesRepository.findBy({})); const assignedBadgeRoles = roles.filter(r => r.asBadge && assignedRoleIds.includes(r.id)); - // コンディショナルロールも含めるのは負荷高そうだから一旦無し - return assignedBadgeRoles; + const badgeCondRoles = roles.filter(r => r.asBadge && (r.target === 'conditional')); + if (badgeCondRoles.length > 0) { + const user = roles.some(r => r.target === 'conditional') ? await this.userCacheService.findById(userId) : null; + const matchedBadgeCondRoles = badgeCondRoles.filter(r => this.evalCond(user!, r.condFormula)); + return [...assignedBadgeRoles, ...matchedBadgeCondRoles]; + } else { + return assignedBadgeRoles; + } } @bindThis From 8bd2d6328a9122a26c6221c4c09ac0c9f9487529 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 11 Feb 2023 09:41:54 +0900 Subject: [PATCH 03/22] =?UTF-8?q?enhance(client):=20=E4=B8=80=E5=BA=A6?= =?UTF-8?q?=E8=A6=8B=E3=81=9F=E3=83=8E=E3=83=BC=E3=83=88=E3=81=AERenote?= =?UTF-8?q?=E3=81=AF=E7=9C=81=E7=95=A5=E3=81=97=E3=81=A6=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolve #1792 --- CHANGELOG.md | 1 + packages/frontend/src/components/MkNote.vue | 55 +++++++++++++++++-- .../frontend/src/components/MkNoteHeader.vue | 2 +- .../src/components/MkNotification.vue | 4 +- packages/frontend/src/os.ts | 6 ++ 5 files changed, 59 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfd64a94b..984061f23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ You should also include the user name that made the change. ### Improvements - コンディショナルロールもバッジとして表示可能に +- enhance(client): 一度見たノートのRenoteは省略して表示するように ### Bugfixes - diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 7edcaf132..e4729eb1f 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -12,7 +12,7 @@
- +