merge: Show signup reason in user admin screen (resolves #1090) (!1114)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1114

Closes #1090

Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
Hazelnoot 2025-06-14 17:30:17 +00:00
commit f6964f6e27
9 changed files with 36 additions and 16 deletions

View file

@ -13,6 +13,7 @@ import { type WebhookEventTypes } from '@/models/Webhook.js';
import { CustomEmojiService } from '@/core/CustomEmojiService.js';
import { type UserWebhookPayload, UserWebhookService } from '@/core/UserWebhookService.js';
import { QueueService } from '@/core/QueueService.js';
import { IdService } from '@/core/IdService.js';
import { ModeratorInactivityRemainingTime } from '@/queue/processors/CheckModeratorsActivityProcessorService.js';
const oneDayMillis = 24 * 60 * 60 * 1000;
@ -166,6 +167,7 @@ export class WebhookTestService {
private userWebhookService: UserWebhookService,
private systemWebhookService: SystemWebhookService,
private queueService: QueueService,
private readonly idService: IdService,
) {
}
@ -449,6 +451,8 @@ export class WebhookTestService {
offsetX: it.offsetX,
offsetY: it.offsetY,
})),
createdAt: this.idService.parse(user.id).date.toISOString(),
description: '',
isBot: user.isBot,
isCat: user.isCat,
emojis: await this.customEmojiService.populateEmojis(user.emojis, user.host),

View file

@ -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,

View file

@ -221,6 +221,10 @@ export const meta = {
},
},
},
signupReason: {
type: 'string',
optional: false, nullable: true,
},
},
},
} as const;

View file

@ -652,7 +652,7 @@ export async function sendEnvResetRequest() {
// 与えられた値を強制的にエラーとみなす。この関数は型安全性を破壊するため、異常系のアサーション以外で用いられるべきではない。
// FIXME(misskey-js): misskey-jsがエラー情報を公開するようになったらこの関数を廃止する
export function castAsError(obj: Record<string, unknown>): { error: ApiError } {
export function castAsError(obj: object | null | undefined): { error: ApiError } {
return obj as { error: ApiError };
}