From aa40b8ca0d777c1b7ae87a2708f3ed1d748e93f0 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Fri, 13 Jun 2025 20:01:06 -0400 Subject: [PATCH] show signup reason in user admin screen --- locales/index.d.ts | 4 ++++ .../backend/src/models/json-schema/user.ts | 20 +++++++++---------- .../server/api/endpoints/admin/show-user.ts | 4 ++++ .../src/components/SkApprovalUser.vue | 2 +- packages/frontend/src/pages/admin-user.vue | 5 +++++ packages/misskey-js/src/autogen/types.ts | 9 +++++---- sharkey-locales/en-US.yml | 2 ++ 7 files changed, 31 insertions(+), 15 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index f9fcbdb238..a22a8e893e 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -13257,6 +13257,10 @@ export interface Locale extends ILocale { * ActivityPub user data in its raw form. These fields are public and accessible to other instances. */ "rawApDescription": string; + /** + * Signup Reason + */ + "signupReason": string; } declare const locales: { [lang: string]: Locale; diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index 2e5364f404..1678cab067 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -73,6 +73,16 @@ export const packedUserLiteSchema = { type: 'string', nullable: true, optional: false, }, + description: { + type: 'string', + nullable: true, optional: false, + example: 'Hi masters, I am Ai!', + }, + createdAt: { + type: 'string', + nullable: false, optional: false, + format: 'date-time', + }, avatarDecorations: { type: 'array', nullable: false, optional: false, @@ -278,11 +288,6 @@ export const packedUserDetailedNotMeOnlySchema = { nullable: false, optional: false, }, }, - createdAt: { - type: 'string', - nullable: false, optional: false, - format: 'date-time', - }, updatedAt: { type: 'string', nullable: true, optional: false, @@ -324,11 +329,6 @@ export const packedUserDetailedNotMeOnlySchema = { nullable: false, optional: false, example: false, }, - description: { - type: 'string', - nullable: true, optional: false, - example: 'Hi masters, I am Ai!', - }, location: { type: 'string', nullable: true, optional: false, diff --git a/packages/backend/src/server/api/endpoints/admin/show-user.ts b/packages/backend/src/server/api/endpoints/admin/show-user.ts index 6a77fc177f..6f0081f1f7 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-user.ts @@ -221,6 +221,10 @@ export const meta = { }, }, }, + signupReason: { + type: 'string', + optional: false, nullable: true, + }, }, }, } as const; diff --git a/packages/frontend/src/components/SkApprovalUser.vue b/packages/frontend/src/components/SkApprovalUser.vue index 310d044387..3f5bd345f2 100644 --- a/packages/frontend/src/components/SkApprovalUser.vue +++ b/packages/frontend/src/components/SkApprovalUser.vue @@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ email }}
-
Reason
+
{{ i18n.ts.signupReason }}
{{ reason }}
diff --git a/packages/frontend/src/pages/admin-user.vue b/packages/frontend/src/pages/admin-user.vue index 840eff77dd..dc29ae2f80 100644 --- a/packages/frontend/src/pages/admin-user.vue +++ b/packages/frontend/src/pages/admin-user.vue @@ -130,6 +130,11 @@ SPDX-License-Identifier: AGPL-3.0-only + + + {{ info.signupReason }} + +
{{ i18n.ts.silence }} diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 6cb52fcbea..8debdec9c1 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -4246,6 +4246,10 @@ export type components = { /** Format: url */ avatarUrl: string | null; avatarBlurhash: string | null; + /** @example Hi masters, I am Ai! */ + description: string | null; + /** Format: date-time */ + createdAt: string; avatarDecorations: { /** Format: id */ id: string; @@ -4304,8 +4308,6 @@ export type components = { movedTo: string | null; alsoKnownAs: string[] | null; /** Format: date-time */ - createdAt: string; - /** Format: date-time */ updatedAt: string | null; /** Format: date-time */ lastFetchedAt: string | null; @@ -4319,8 +4321,6 @@ export type components = { isSilenced: boolean; /** @example false */ isSuspended: boolean; - /** @example Hi masters, I am Ai! */ - description: string | null; location: string | null; /** @example 2018-03-12 */ birthday: string | null; @@ -11236,6 +11236,7 @@ export type operations = { remoteFollowing: number; remoteFollowers: number; }; + signupReason: string | null; }; }; }; diff --git a/sharkey-locales/en-US.yml b/sharkey-locales/en-US.yml index 5ea562d262..3f5c82f2dc 100644 --- a/sharkey-locales/en-US.yml +++ b/sharkey-locales/en-US.yml @@ -628,3 +628,5 @@ noteFooterLabel: "Note controls" rawUserDescription: "Packed user data in its raw form. Most of these fields are public and visible to all users." rawInfoDescription: "Extended user data in its raw form. These fields are private and can only be accessed by moderators." rawApDescription: "ActivityPub user data in its raw form. These fields are public and accessible to other instances." + +signupReason: "Signup Reason"