From 4c21d83639b7fb92e58c1c0925abd04235740416 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 13 Jan 2023 12:07:24 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=81=AB=E3=83=AD=E3=83=BC=E3=83=AB=E3=82=92=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=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 --- .../src/core/entities/UserEntityService.ts | 8 ++++++++ packages/frontend/src/pages/user/home.vue | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index 9a90aec456..6b754150cf 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -448,6 +448,14 @@ export class UserEntityService implements OnModuleInit { userId: user.id, }).then(result => result >= 1) : false, + roles: this.roleService.getUserRoles(user.id).then(roles => roles.filter(role => role.isPublic).map(role => ({ + id: role.id, + name: role.name, + color: role.color, + description: role.description, + isModerator: role.isModerator, + isAdministrator: role.isAdministrator, + }))), } : {}), ...(opts.detail && isMe ? { diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index eea4d20094..0af86be59d 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -38,6 +38,9 @@ +
+ {{ role.name }} +

{{ i18n.ts.noAccountDescription }}

@@ -337,6 +340,18 @@ onUnmounted(() => { box-shadow: 1px 1px 3px rgba(#000, 0.2); } + > .roles { + padding: 24px 24px 0 154px; + font-size: 0.95em; + + > .role { + border: solid 1px var(--color, var(--divider)); + border-radius: 999px; + margin-right: 4px; + padding: 3px 8px; + } + } + > .description { padding: 24px 24px 24px 154px; font-size: 0.95em; @@ -467,6 +482,11 @@ onUnmounted(() => { margin: auto; } + > .roles { + padding: 16px 16px 0 16px; + text-align: center; + } + > .description { padding: 16px; text-align: center;