From 1fa43d4c52d17c30ff3f0d745310862babd84a9e Mon Sep 17 00:00:00 2001 From: adzukimame <88547072+adzukimame@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:16:24 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=91=E3=83=BC=E3=82=BD=E3=83=8A=E3=83=AB?= =?UTF-8?q?=EF=BC=88=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=EF=BC=89=E3=83=A1?= =?UTF-8?q?=E3=83=A2=E6=A9=9F=E8=83=BD=E3=82=92=E5=89=8A=E9=99=A4=20(#364)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/1733908053587-RemoveUserMemo.js | 18 ++++ .../src/core/entities/UserEntityService.ts | 21 ----- packages/backend/src/di-symbols.ts | 1 - .../backend/src/models/RepositoryModule.ts | 9 -- packages/backend/src/models/UserMemo.ts | 47 ---------- packages/backend/src/models/_.ts | 3 - .../backend/src/models/json-schema/user.ts | 4 - packages/backend/src/postgres.ts | 2 - .../backend/src/server/api/EndpointsModule.ts | 4 - packages/backend/src/server/api/endpoints.ts | 2 - .../server/api/endpoints/users/update-memo.ts | 89 ------------------ packages/backend/test/e2e/endpoints.ts | 81 ---------------- packages/backend/test/e2e/users.ts | 17 ---- .../test/unit/entities/UserEntityService.ts | 23 ----- packages/frontend/.storybook/fakes.ts | 1 - packages/frontend/src/pages/user/home.vue | 93 ------------------- .../frontend/src/scripts/get-user-menu.ts | 28 ------ packages/misskey-js/etc/misskey-js.api.md | 4 - .../misskey-js/src/autogen/apiClientJSDoc.ts | 11 --- packages/misskey-js/src/autogen/endpoint.ts | 2 - packages/misskey-js/src/autogen/entities.ts | 1 - packages/misskey-js/src/autogen/types.ts | 64 ------------- 22 files changed, 18 insertions(+), 507 deletions(-) create mode 100644 packages/backend/migration/1733908053587-RemoveUserMemo.js delete mode 100644 packages/backend/src/models/UserMemo.ts delete mode 100644 packages/backend/src/server/api/endpoints/users/update-memo.ts diff --git a/packages/backend/migration/1733908053587-RemoveUserMemo.js b/packages/backend/migration/1733908053587-RemoveUserMemo.js new file mode 100644 index 000000000000..f4abc1fd39e2 --- /dev/null +++ b/packages/backend/migration/1733908053587-RemoveUserMemo.js @@ -0,0 +1,18 @@ +export default class RemoveUserMemo1733908053587 { + name = 'RemoveUserMemo1733908053587' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user_memo" DROP CONSTRAINT "FK_66ac4a82894297fd09ba61f3d35"`); + await queryRunner.query(`ALTER TABLE "user_memo" DROP CONSTRAINT "FK_650b49c5639b5840ee6a2b8f83e"`); + await queryRunner.query(`DROP TABLE "user_memo"`); + } + + async down(queryRunner) { + await queryRunner.query(`CREATE TABLE "user_memo" ("id" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, "targetUserId" character varying(32) NOT NULL, "memo" character varying(2048) NOT NULL, CONSTRAINT "PK_e9aaa58f7d3699a84d79078f4d9" PRIMARY KEY ("id")); COMMENT ON COLUMN "user_memo"."userId" IS 'The ID of author.'; COMMENT ON COLUMN "user_memo"."targetUserId" IS 'The ID of target user.'; COMMENT ON COLUMN "user_memo"."memo" IS 'Memo.'`); + await queryRunner.query(`CREATE INDEX "IDX_650b49c5639b5840ee6a2b8f83" ON "user_memo" ("userId") `); + await queryRunner.query(`CREATE INDEX "IDX_66ac4a82894297fd09ba61f3d3" ON "user_memo" ("targetUserId") `); + await queryRunner.query(`CREATE UNIQUE INDEX "IDX_faef300913c738265638ba3ebc" ON "user_memo" ("userId", "targetUserId") `); + await queryRunner.query(`ALTER TABLE "user_memo" ADD CONSTRAINT "FK_650b49c5639b5840ee6a2b8f83e" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + await queryRunner.query(`ALTER TABLE "user_memo" ADD CONSTRAINT "FK_66ac4a82894297fd09ba61f3d35" FOREIGN KEY ("targetUserId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + } +} diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index 56f768d310a7..8583f1bfcef3 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -33,7 +33,6 @@ import type { MutingsRepository, NoteUnreadsRepository, RenoteMutingsRepository, - UserMemoRepository, UserNotePiningsRepository, UserProfilesRepository, UserSecurityKeysRepository, @@ -124,9 +123,6 @@ export class UserEntityService implements OnModuleInit { @Inject(DI.userProfilesRepository) private userProfilesRepository: UserProfilesRepository, - - @Inject(DI.userMemosRepository) - private userMemosRepository: UserMemoRepository, ) { } @@ -380,7 +376,6 @@ export class UserEntityService implements OnModuleInit { includeSecrets?: boolean, userProfile?: MiUserProfile, userRelations?: Map, - userMemos?: Map, pinNotes?: Map, }, ): Promise> { @@ -409,16 +404,6 @@ export class UserEntityService implements OnModuleInit { } } - let memo: string | null = null; - if (isDetailed && meId) { - if (opts.userMemos) { - memo = opts.userMemos.get(user.id) ?? null; - } else { - memo = await this.userMemosRepository.findOneBy({ userId: meId, targetUserId: user.id }) - .then(row => row?.memo ?? null); - } - } - let pins: MiUserNotePining[] = []; if (isDetailed) { if (opts.pinNotes) { @@ -517,7 +502,6 @@ export class UserEntityService implements OnModuleInit { isAdministrator: role.isAdministrator, displayOrder: role.displayOrder, }))), - memo: memo, moderationNote: iAmModerator ? (profile!.moderationNote ?? '') : undefined, } : {}), @@ -624,7 +608,6 @@ export class UserEntityService implements OnModuleInit { let profilesMap: Map = new Map(); let userRelations: Map = new Map(); - let userMemos: Map = new Map(); let pinNotes: Map = new Map(); if (options?.schema !== 'UserLite') { @@ -633,9 +616,6 @@ export class UserEntityService implements OnModuleInit { const meId = me ? me.id : null; if (meId) { - userMemos = await this.userMemosRepository.findBy({ userId: meId }) - .then(memos => new Map(memos.map(memo => [memo.targetUserId, memo.memo]))); - if (_userIds.length > 0) { userRelations = await this.getRelations(meId, _userIds); pinNotes = await this.userNotePiningsRepository.createQueryBuilder('pin') @@ -667,7 +647,6 @@ export class UserEntityService implements OnModuleInit { ...options, userProfile: profilesMap.get(u.id), userRelations: userRelations, - userMemos: userMemos, pinNotes: pinNotes, }, )), diff --git a/packages/backend/src/di-symbols.ts b/packages/backend/src/di-symbols.ts index df678a37a59d..12724019879d 100644 --- a/packages/backend/src/di-symbols.ts +++ b/packages/backend/src/di-symbols.ts @@ -64,6 +64,5 @@ export const DI = { roleAssignmentsRepository: Symbol('roleAssignmentsRepository'), flashsRepository: Symbol('flashsRepository'), flashLikesRepository: Symbol('flashLikesRepository'), - userMemosRepository: Symbol('userMemosRepository'), //#endregion }; diff --git a/packages/backend/src/models/RepositoryModule.ts b/packages/backend/src/models/RepositoryModule.ts index c72344804a8c..b947a8ee52de 100644 --- a/packages/backend/src/models/RepositoryModule.ts +++ b/packages/backend/src/models/RepositoryModule.ts @@ -52,7 +52,6 @@ import { MiUserList, MiUserListFavorite, MiUserListMembership, - MiUserMemo, MiUserNotePining, MiUserPending, MiUserProfile, @@ -356,12 +355,6 @@ const $roleAssignmentsRepository: Provider = { inject: [DI.db], }; -const $userMemosRepository: Provider = { - provide: DI.userMemosRepository, - useFactory: (db: DataSource) => db.getRepository(MiUserMemo).extend(miRepository as MiRepository), - inject: [DI.db], -}; - @Module({ imports: [], providers: [ @@ -414,7 +407,6 @@ const $userMemosRepository: Provider = { $roleAssignmentsRepository, $flashsRepository, $flashLikesRepository, - $userMemosRepository, ], exports: [ $usersRepository, @@ -466,7 +458,6 @@ const $userMemosRepository: Provider = { $roleAssignmentsRepository, $flashsRepository, $flashLikesRepository, - $userMemosRepository, ], }) export class RepositoryModule { diff --git a/packages/backend/src/models/UserMemo.ts b/packages/backend/src/models/UserMemo.ts deleted file mode 100644 index 29e28d290aef..000000000000 --- a/packages/backend/src/models/UserMemo.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Column, Entity, Index, JoinColumn, ManyToOne, PrimaryColumn } from 'typeorm'; -import { id } from './util/id.js'; -import { MiUser } from './User.js'; - -@Entity('user_memo') -@Index(['userId', 'targetUserId'], { unique: true }) -export class MiUserMemo { - @PrimaryColumn(id()) - public id: string; - - @Index() - @Column({ - ...id(), - comment: 'The ID of author.', - }) - public userId: MiUser['id']; - - @ManyToOne(type => MiUser, { - onDelete: 'CASCADE', - }) - @JoinColumn() - public user: MiUser | null; - - @Index() - @Column({ - ...id(), - comment: 'The ID of target user.', - }) - public targetUserId: MiUser['id']; - - @ManyToOne(type => MiUser, { - onDelete: 'CASCADE', - }) - @JoinColumn() - public targetUser: MiUser | null; - - @Column('varchar', { - length: 2048, - comment: 'Memo.', - }) - public memo: string; -} diff --git a/packages/backend/src/models/_.ts b/packages/backend/src/models/_.ts index 33c4d696ba53..06ff83bf481f 100644 --- a/packages/backend/src/models/_.ts +++ b/packages/backend/src/models/_.ts @@ -52,7 +52,6 @@ import { MiUserPending } from '@/models/UserPending.js'; import { MiUserProfile } from '@/models/UserProfile.js'; import { MiUserPublickey } from '@/models/UserPublickey.js'; import { MiUserSecurityKey } from '@/models/UserSecurityKey.js'; -import { MiUserMemo } from '@/models/UserMemo.js'; import { MiWebhook } from '@/models/Webhook.js'; import { MiChannel } from '@/models/Channel.js'; import { MiRole } from '@/models/Role.js'; @@ -155,7 +154,6 @@ export { MiRoleAssignment, MiFlash, MiFlashLike, - MiUserMemo, }; export type AccessTokensRepository = Repository & MiRepository; @@ -207,4 +205,3 @@ export type RolesRepository = Repository & MiRepository; export type RoleAssignmentsRepository = Repository & MiRepository; export type FlashsRepository = Repository & MiRepository; export type FlashLikesRepository = Repository & MiRepository; -export type UserMemoRepository = Repository & MiRepository; diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index 5354f1d1cdd6..47de3c38f34f 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -301,10 +301,6 @@ export const packedUserDetailedNotMeOnlySchema = { ref: 'RoleLite', }, }, - memo: { - type: 'string', - nullable: true, optional: false, - }, moderationNote: { type: 'string', nullable: false, optional: true, diff --git a/packages/backend/src/postgres.ts b/packages/backend/src/postgres.ts index 9dcb8c7435e6..c59404d4b92d 100644 --- a/packages/backend/src/postgres.ts +++ b/packages/backend/src/postgres.ts @@ -58,7 +58,6 @@ import { MiRole } from '@/models/Role.js'; import { MiRoleAssignment } from '@/models/RoleAssignment.js'; import { MiFlash } from '@/models/Flash.js'; import { MiFlashLike } from '@/models/FlashLike.js'; -import { MiUserMemo } from '@/models/UserMemo.js'; import { Config } from '@/config.js'; import MisskeyLogger from '@/logger.js'; @@ -176,7 +175,6 @@ export const entities = [ MiRoleAssignment, MiFlash, MiFlashLike, - MiUserMemo, ...charts, ]; diff --git a/packages/backend/src/server/api/EndpointsModule.ts b/packages/backend/src/server/api/EndpointsModule.ts index 746fa9eb4138..8c92bab040fb 100644 --- a/packages/backend/src/server/api/EndpointsModule.ts +++ b/packages/backend/src/server/api/EndpointsModule.ts @@ -293,7 +293,6 @@ import * as ep___users_relation from './endpoints/users/relation.js'; import * as ep___users_searchByUsernameAndHost from './endpoints/users/search-by-username-and-host.js'; import * as ep___users_search from './endpoints/users/search.js'; import * as ep___users_show from './endpoints/users/show.js'; -import * as ep___users_updateMemo from './endpoints/users/update-memo.js'; import { GetterService } from './GetterService.js'; import { ApiLoggerService } from './ApiLoggerService.js'; import type { Provider } from '@nestjs/common'; @@ -585,7 +584,6 @@ const $users_relation: Provider = { provide: 'ep:users/relation', useClass: ep__ const $users_searchByUsernameAndHost: Provider = { provide: 'ep:users/search-by-username-and-host', useClass: ep___users_searchByUsernameAndHost.default }; const $users_search: Provider = { provide: 'ep:users/search', useClass: ep___users_search.default }; const $users_show: Provider = { provide: 'ep:users/show', useClass: ep___users_show.default }; -const $users_updateMemo: Provider = { provide: 'ep:users/update-memo', useClass: ep___users_updateMemo.default }; @Module({ imports: [ @@ -881,7 +879,6 @@ const $users_updateMemo: Provider = { provide: 'ep:users/update-memo', useClass: $users_searchByUsernameAndHost, $users_search, $users_show, - $users_updateMemo, ], exports: [ $admin_meta, @@ -1171,7 +1168,6 @@ const $users_updateMemo: Provider = { provide: 'ep:users/update-memo', useClass: $users_searchByUsernameAndHost, $users_search, $users_show, - $users_updateMemo, ], }) export class EndpointsModule {} diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index 9f68b6d5f655..f0066964ab51 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -294,7 +294,6 @@ import * as ep___users_relation from './endpoints/users/relation.js'; import * as ep___users_searchByUsernameAndHost from './endpoints/users/search-by-username-and-host.js'; import * as ep___users_search from './endpoints/users/search.js'; import * as ep___users_show from './endpoints/users/show.js'; -import * as ep___users_updateMemo from './endpoints/users/update-memo.js'; const eps = [ ['admin/meta', ep___admin_meta], @@ -584,7 +583,6 @@ const eps = [ ['users/search-by-username-and-host', ep___users_searchByUsernameAndHost], ['users/search', ep___users_search], ['users/show', ep___users_show], - ['users/update-memo', ep___users_updateMemo], ]; interface IEndpointMetaBase { diff --git a/packages/backend/src/server/api/endpoints/users/update-memo.ts b/packages/backend/src/server/api/endpoints/users/update-memo.ts deleted file mode 100644 index 5a10de0c40ce..000000000000 --- a/packages/backend/src/server/api/endpoints/users/update-memo.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * SPDX-FileCopyrightText: syuilo and misskey-project - * SPDX-License-Identifier: AGPL-3.0-only - */ - -import { Inject, Injectable } from '@nestjs/common'; -import { Endpoint } from '@/server/api/endpoint-base.js'; -import { IdService } from '@/core/IdService.js'; -import type { UserMemoRepository } from '@/models/_.js'; -import { DI } from '@/di-symbols.js'; -import { GetterService } from '@/server/api/GetterService.js'; -import { ApiError } from '../../error.js'; - -export const meta = { - tags: ['account'], - - requireCredential: true, - - kind: 'write:account', - - errors: { - noSuchUser: { - message: 'No such user.', - code: 'NO_SUCH_USER', - id: '6fef56f3-e765-4957-88e5-c6f65329b8a5', - }, - }, -} as const; - -export const paramDef = { - type: 'object', - properties: { - userId: { type: 'string', format: 'misskey:id' }, - memo: { - type: 'string', - nullable: true, - description: 'A personal memo for the target user. If null or empty, delete the memo.', - }, - }, - required: ['userId', 'memo'], -} as const; - -@Injectable() -export default class extends Endpoint { // eslint-disable-line import/no-default-export - constructor( - @Inject(DI.userMemosRepository) - private userMemosRepository: UserMemoRepository, - private getterService: GetterService, - private idService: IdService, - ) { - super(meta, paramDef, async (ps, me) => { - // Get target - const target = await this.getterService.getUser(ps.userId).catch(err => { - if (err.id === '15348ddd-432d-49c2-8a5a-8069753becff') throw new ApiError(meta.errors.noSuchUser); - throw err; - }); - - // 引数がnullか空文字であれば、パーソナルメモを削除する - if (ps.memo === '' || ps.memo == null) { - await this.userMemosRepository.delete({ - userId: me.id, - targetUserId: target.id, - }); - return; - } - - // 以前に作成されたパーソナルメモがあるかどうか確認 - const previousMemo = await this.userMemosRepository.findOneBy({ - userId: me.id, - targetUserId: target.id, - }); - - if (!previousMemo) { - await this.userMemosRepository.insert({ - id: this.idService.gen(), - userId: me.id, - targetUserId: target.id, - memo: ps.memo, - }); - } else { - await this.userMemosRepository.update(previousMemo.id, { - userId: me.id, - targetUserId: target.id, - memo: ps.memo, - }); - } - }); - } -} diff --git a/packages/backend/test/e2e/endpoints.ts b/packages/backend/test/e2e/endpoints.ts index 01f23c750e4f..e772d6e5e5bd 100644 --- a/packages/backend/test/e2e/endpoints.ts +++ b/packages/backend/test/e2e/endpoints.ts @@ -1042,85 +1042,4 @@ describe('Endpoints', () => { assert.strictEqual(res.body[0].id, carolPost.id); }); }); - - describe('パーソナルメモ機能のテスト', () => { - test('他者に関するメモを更新できる', async () => { - const memo = '10月まで低浮上とのこと。'; - - const res1 = await api('users/update-memo', { - memo, - userId: bob.id, - }, alice); - - const res2 = await api('users/show', { - userId: bob.id, - }, alice); - assert.strictEqual(res1.status, 204); - assert.strictEqual((res2.body as unknown as { memo: string })?.memo, memo); - }); - - test('自分に関するメモを更新できる', async () => { - const memo = 'チケットを月末までに買う。'; - - const res1 = await api('users/update-memo', { - memo, - userId: alice.id, - }, alice); - - const res2 = await api('users/show', { - userId: alice.id, - }, alice); - assert.strictEqual(res1.status, 204); - assert.strictEqual((res2.body as unknown as { memo: string })?.memo, memo); - }); - - test('メモを削除できる', async () => { - const memo = '10月まで低浮上とのこと。'; - - await api('users/update-memo', { - memo, - userId: bob.id, - }, alice); - - await api('users/update-memo', { - memo: '', - userId: bob.id, - }, alice); - - const res = await api('users/show', { - userId: bob.id, - }, alice); - - // memoには常に文字列かnullが入っている(5cac151) - assert.strictEqual((res.body as unknown as { memo: string | null }).memo, null); - }); - - test('メモは個人ごとに独立して保存される', async () => { - const memoAliceToBob = '10月まで低浮上とのこと。'; - const memoCarolToBob = '例の件について今度問いただす。'; - - await Promise.all([ - api('users/update-memo', { - memo: memoAliceToBob, - userId: bob.id, - }, alice), - api('users/update-memo', { - memo: memoCarolToBob, - userId: bob.id, - }, carol), - ]); - - const [resAlice, resCarol] = await Promise.all([ - api('users/show', { - userId: bob.id, - }, alice), - api('users/show', { - userId: bob.id, - }, carol), - ]); - - assert.strictEqual((resAlice.body as unknown as { memo: string }).memo, memoAliceToBob); - assert.strictEqual((resCarol.body as unknown as { memo: string }).memo, memoCarolToBob); - }); - }); }); diff --git a/packages/backend/test/e2e/users.ts b/packages/backend/test/e2e/users.ts index de2161f7e45a..a74f72953830 100644 --- a/packages/backend/test/e2e/users.ts +++ b/packages/backend/test/e2e/users.ts @@ -79,7 +79,6 @@ describe('ユーザー', () => { followingVisibility: user.followingVisibility, followersVisibility: user.followersVisibility, roles: user.roles, - memo: user.memo, }); }; @@ -326,7 +325,6 @@ describe('ユーザー', () => { assert.strictEqual(response.followingVisibility, 'public'); assert.strictEqual(response.followersVisibility, 'public'); assert.deepStrictEqual(response.roles, []); - assert.strictEqual(response.memo, null); // MeDetailedOnly assert.strictEqual(response.avatarId, null); @@ -506,21 +504,6 @@ describe('ユーザー', () => { assert.deepStrictEqual(response2, expected2); }); - //#endregion - //#region メモの更新(users/update-memo) - - test.each([ - { label: '最大長', memo: 'x'.repeat(2048) }, - { label: '空文字', memo: '', expects: null }, - { label: 'null', memo: null }, - ])('を書き換えることができる(メモを$labelに)', async ({ memo, expects }) => { - const expected = { ...await show(bob.id, alice), memo: expects === undefined ? memo : expects }; - const parameters = { userId: bob.id, memo }; - await successfulApiCall({ endpoint: 'users/update-memo', parameters, user: alice }); - const response = await show(bob.id, alice); - assert.deepStrictEqual(response, expected); - }); - //#endregion //#region ユーザー情報(users/show) diff --git a/packages/backend/test/unit/entities/UserEntityService.ts b/packages/backend/test/unit/entities/UserEntityService.ts index f86bf612ec82..d525643b4e90 100644 --- a/packages/backend/test/unit/entities/UserEntityService.ts +++ b/packages/backend/test/unit/entities/UserEntityService.ts @@ -14,7 +14,6 @@ import { BlockingsRepository, FollowingsRepository, FollowRequestsRepository, MiUserProfile, MutingsRepository, RenoteMutingsRepository, - UserMemoRepository, UserProfilesRepository, UsersRepository, } from '@/models/_.js'; @@ -54,7 +53,6 @@ describe('UserEntityService', () => { let service: UserEntityService; let usersRepository: UsersRepository; let userProfileRepository: UserProfilesRepository; - let userMemosRepository: UserMemoRepository; let followingRepository: FollowingsRepository; let followingRequestRepository: FollowRequestsRepository; let blockingRepository: BlockingsRepository; @@ -80,15 +78,6 @@ describe('UserEntityService', () => { return user; } - async function memo(writer: MiUser, target: MiUser, memo: string) { - await userMemosRepository.insert({ - id: genAidx(Date.now()), - userId: writer.id, - targetUserId: target.id, - memo, - }); - } - async function follow(follower: MiUser, followee: MiUser) { await followingRepository.insert({ id: genAidx(Date.now()), @@ -177,7 +166,6 @@ describe('UserEntityService', () => { service = app.get(UserEntityService); usersRepository = app.get(DI.usersRepository); userProfileRepository = app.get(DI.userProfilesRepository); - userMemosRepository = app.get(DI.userMemosRepository); followingRepository = app.get(DI.followingsRepository); followingRequestRepository = app.get(DI.followRequestsRepository); blockingRepository = app.get(DI.blockingsRepository); @@ -193,11 +181,7 @@ describe('UserEntityService', () => { const me = await createUser(); const who = await createUser(); - await memo(me, who, 'memo'); - const actual = await service.pack(who, me, { schema: 'UserLite' }) as any; - // no detail - expect(actual.memo).toBeUndefined(); // no detail and me expect(actual.birthday).toBeUndefined(); }); @@ -206,12 +190,8 @@ describe('UserEntityService', () => { const me = await createUser(); const who = await createUser({}, { birthday: '2000-01-01' }); - await memo(me, who, 'memo'); - const actual = await service.pack(who, me, { schema: 'UserDetailedNotMe' }) as any; // is detail - expect(actual.memo).toBe('memo'); - // is detail expect(actual.birthday).toBe('2000-01-01'); }); @@ -219,12 +199,9 @@ describe('UserEntityService', () => { const me = await createUser({}, { birthday: '2000-01-01', }); - await memo(me, me, 'memo'); const actual = await service.pack(me, me, { schema: 'MeDetailed' }) as any; // is detail - expect(actual.memo).toBe('memo'); - // is detail expect(actual.birthday).toBe('2000-01-01'); }); diff --git a/packages/frontend/.storybook/fakes.ts b/packages/frontend/.storybook/fakes.ts index 02ad79e7ea46..378891d23404 100644 --- a/packages/frontend/.storybook/fakes.ts +++ b/packages/frontend/.storybook/fakes.ts @@ -234,7 +234,6 @@ export function userDetailed(id = 'someuserid', username = 'miskist', host: enti movedTo: null, alsoKnownAs: null, notify: 'none', - memo: null, }; } diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index 7dd166829e86..152dc9a90b0f 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -27,9 +27,6 @@ SPDX-License-Identifier: AGPL-3.0-only - {{ i18n.ts.followsYou }} @@ -65,17 +62,6 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.addModerationNote }} -
-
-