From 46222d0258e75e9700976b6b092d595fc55fad4b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 10 Jun 2023 17:41:52 +0900 Subject: [PATCH] tweak of f3a16bcd6 --- locales/index.d.ts | 2 -- locales/ja-JP.yml | 8 +++----- .../backend/migration/1686381571997-roleuserhidden.js | 11 ----------- packages/backend/src/models/entities/Role.ts | 5 ----- .../src/server/api/endpoints/admin/roles/create.ts | 2 -- .../src/server/api/endpoints/admin/roles/update.ts | 2 -- .../backend/src/server/api/endpoints/roles/list.ts | 1 + .../backend/src/server/api/endpoints/roles/users.ts | 4 +--- packages/frontend/src/pages/admin/roles.editor.vue | 6 ------ 9 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 packages/backend/migration/1686381571997-roleuserhidden.js diff --git a/locales/index.d.ts b/locales/index.d.ts index 638ac10e71..eed29f408c 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1431,8 +1431,6 @@ export interface Locale { "isConditionalRole": string; "isPublic": string; "descriptionOfIsPublic": string; - "isPublicUsers": string; - "descriptionOfIsPublicUsers": string; "options": string; "policies": string; "baseRole": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5a7a2afd5f..8004e53575 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1352,10 +1352,8 @@ _role: conditional: "コンディショナル" condition: "条件" isConditionalRole: "これはコンディショナルロールです。" - isPublic: "ロールを公開" + isPublic: "公開ロール" descriptionOfIsPublic: "ユーザーのプロフィールでこのロールが表示されます。" - isPublicUsers: "ユーザーリストを公開" - descriptionOfIsPublicUsers: "ロールにアサインされたユーザーのリストを誰でも見ることができます。" options: "オプション" policies: "ポリシー" baseRole: "ベースロール" @@ -1364,8 +1362,8 @@ _role: iconUrl: "アイコン画像のURL" asBadge: "バッジとして表示" descriptionOfAsBadge: "オンにすると、ユーザー名の横にロールのアイコンが表示されます。" - isExplorable: "ロールタイムラインを公開" - descriptionOfIsExplorable: "オンにすると、ロールのタイムラインを公開します。ロールの公開がオフの場合、タイムラインの公開はされません。" + isExplorable: "ユーザーを見つけやすくする" + descriptionOfIsExplorable: "オンにすると、「みつける」でメンバー一覧が公開されるほか、ロールのタイムラインが利用可能になります。" displayOrder: "表示順" descriptionOfDisplayOrder: "数値が大きいほどUI上で先頭に表示されます。" canEditMembersByModerator: "モデレーターのメンバー編集を許可" diff --git a/packages/backend/migration/1686381571997-roleuserhidden.js b/packages/backend/migration/1686381571997-roleuserhidden.js deleted file mode 100644 index 5cfa9ab87f..0000000000 --- a/packages/backend/migration/1686381571997-roleuserhidden.js +++ /dev/null @@ -1,11 +0,0 @@ -export class roleuserhidden1686381571997 { - name = 'roleuserhidden1686381571997' - - async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "role" ADD "isPublicUsers" boolean NOT NULL DEFAULT true`); - } - - async down(queryRunner) { - await queryRunner.query(`ALTER TABLE "role" DROP COLUMN "isPublicUsers"`); - } -} diff --git a/packages/backend/src/models/entities/Role.ts b/packages/backend/src/models/entities/Role.ts index 067f7bf629..61f40d59da 100644 --- a/packages/backend/src/models/entities/Role.ts +++ b/packages/backend/src/models/entities/Role.ts @@ -167,11 +167,6 @@ export class Role { }) public displayOrder: number; - @Column('boolean', { - default: true, - }) - public isPublicUsers: boolean; - @Column('jsonb', { default: { }, }) diff --git a/packages/backend/src/server/api/endpoints/admin/roles/create.ts b/packages/backend/src/server/api/endpoints/admin/roles/create.ts index 1cf3157acd..916172f54a 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/create.ts @@ -26,7 +26,6 @@ export const paramDef = { isModerator: { type: 'boolean' }, isAdministrator: { type: 'boolean' }, isExplorable: { type: 'boolean', default: false }, // optional for backward compatibility - isPublicUsers: { type: 'boolean', default: true }, // optional for backward compatibility asBadge: { type: 'boolean' }, canEditMembersByModerator: { type: 'boolean' }, displayOrder: { type: 'number' }, @@ -79,7 +78,6 @@ export default class extends Endpoint { isAdministrator: ps.isAdministrator, isModerator: ps.isModerator, isExplorable: ps.isExplorable, - isPublicUsers: ps.isPublicUsers, asBadge: ps.asBadge, canEditMembersByModerator: ps.canEditMembersByModerator, displayOrder: ps.displayOrder, diff --git a/packages/backend/src/server/api/endpoints/admin/roles/update.ts b/packages/backend/src/server/api/endpoints/admin/roles/update.ts index 5108c4da1d..467f157a61 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/update.ts @@ -34,7 +34,6 @@ export const paramDef = { isModerator: { type: 'boolean' }, isAdministrator: { type: 'boolean' }, isExplorable: { type: 'boolean' }, - isPublicUsers: { type: 'boolean' }, asBadge: { type: 'boolean' }, canEditMembersByModerator: { type: 'boolean' }, displayOrder: { type: 'number' }, @@ -88,7 +87,6 @@ export default class extends Endpoint { isModerator: ps.isModerator, isAdministrator: ps.isAdministrator, isExplorable: ps.isExplorable, - isPublicUsers: ps.isPublicUsers, asBadge: ps.asBadge, canEditMembersByModerator: ps.canEditMembersByModerator, displayOrder: ps.displayOrder, diff --git a/packages/backend/src/server/api/endpoints/roles/list.ts b/packages/backend/src/server/api/endpoints/roles/list.ts index d61c6b8dc6..5ad29839c2 100644 --- a/packages/backend/src/server/api/endpoints/roles/list.ts +++ b/packages/backend/src/server/api/endpoints/roles/list.ts @@ -30,6 +30,7 @@ export default class extends Endpoint { super(meta, paramDef, async (ps, me) => { const roles = await this.rolesRepository.findBy({ isPublic: true, + isExplorable: true, }); return await this.roleEntityService.packMany(roles, me); }); diff --git a/packages/backend/src/server/api/endpoints/roles/users.ts b/packages/backend/src/server/api/endpoints/roles/users.ts index f4b30286a4..b2cb8b42a8 100644 --- a/packages/backend/src/server/api/endpoints/roles/users.ts +++ b/packages/backend/src/server/api/endpoints/roles/users.ts @@ -49,14 +49,12 @@ export default class extends Endpoint { const role = await this.rolesRepository.findOneBy({ id: ps.roleId, isPublic: true, + isExplorable: true, }); if (role == null) { throw new ApiError(meta.errors.noSuchRole); } - if (!role.isPublicUsers) { - return []; - } const query = this.queryService.makePaginationQuery(this.roleAssignmentsRepository.createQueryBuilder('assign'), ps.sinceId, ps.untilId) .andWhere('assign.roleId = :roleId', { roleId: role.id }) diff --git a/packages/frontend/src/pages/admin/roles.editor.vue b/packages/frontend/src/pages/admin/roles.editor.vue index 6aeef6cb1d..a1fa9d2932 100644 --- a/packages/frontend/src/pages/admin/roles.editor.vue +++ b/packages/frontend/src/pages/admin/roles.editor.vue @@ -63,11 +63,6 @@ - - - - -
@@ -506,7 +501,6 @@ const save = throttle(100, () => { isModerator: role.isModerator, isPublic: role.isPublic, isExplorable: role.isExplorable, - isPublicUsers: role.isPublicUsers, asBadge: role.asBadge, canEditMembersByModerator: role.canEditMembersByModerator, policies: role.policies,