diff --git a/dictation_client/src/components/header/constants.ts b/dictation_client/src/components/header/constants.ts index 6b3f7dc..0e2219c 100644 --- a/dictation_client/src/components/header/constants.ts +++ b/dictation_client/src/components/header/constants.ts @@ -51,8 +51,6 @@ export const HEADER_MENUS: { }, ]; -export const HEADER_NAME = "ODMS Cloud"; - /** * adminのみに表示するヘッダータブ */ diff --git a/dictation_client/src/components/header/loginedHeader.tsx b/dictation_client/src/components/header/loginedHeader.tsx index 7b900ab..d6e48ac 100644 --- a/dictation_client/src/components/header/loginedHeader.tsx +++ b/dictation_client/src/components/header/loginedHeader.tsx @@ -17,7 +17,6 @@ import { getFilteredMenus } from "./utils"; import logo from "../../assets/images/OMS_logo_black.svg"; import ac from "../../assets/images/account_circle.svg"; import { LoginedPaths } from "./types"; -import { HEADER_NAME } from "./constants"; import logout from "../../assets/images/logout.svg"; import { getTranslationID } from "../../translation"; @@ -74,7 +73,6 @@ const LoginedHeader: React.FC = (props: HeaderProps) => {
OM System
-
{HEADER_NAME}
{displayColumn.JobNumber && ( diff --git a/dictation_client/src/pages/UserListPage/index.tsx b/dictation_client/src/pages/UserListPage/index.tsx index 48e0805..b6b0072 100644 --- a/dictation_client/src/pages/UserListPage/index.tsx +++ b/dictation_client/src/pages/UserListPage/index.tsx @@ -13,8 +13,12 @@ import { } from "features/user"; import { useTranslation } from "react-i18next"; import { getTranslationID } from "translation"; -import { isLicenseStatusType, UserView } from "features/user/types"; -import { LICENSE_STATUS } from "features/user/constants"; +import { LicenseStatusType, UserView } from "features/user/types"; +import { + LICENSE_NORMAL, + LICENSE_STATUS, + NO_LICENSE, +} from "features/user/constants"; import { isApproveTier } from "features/auth"; import { TIERS } from "components/auth/constants"; import { @@ -184,66 +188,63 @@ const UserListPage: React.FC = (): JSX.Element => { {!isLoading && - users.map((user) => { - const { isAlertLicenseStatus, isAlertRemaining } = - isAlertElement(user.licenseStatus); - return ( - - - + + {user.name} + {user.role} + {user.authorId} + {boolToElement(user.encryption)} + {boolToElement(user.prompt)} + {arrayToElement(user.typistGroupName)} + {user.email} + + + {getLicenseStatus(user.licenseStatus)} + + + + + {user.expiration ?? "-"} + + + + + {user.remaining ?? "-"} + + + {boolToElement(user.autoRenew)} + {boolToElement(user.notification)} + {boolToElement(user.emailVerified)} + + ))} {!isLoading && users.length === 0 && ( @@ -352,38 +360,15 @@ const arrayToElement = ( )); }; -const isAlertElement = ( - licenseStatus: string -): { - isAlertLicenseStatus: boolean; - isAlertRemaining: boolean; -} => { - // licenseStatusの型がLicenseStatusTypeでない場合(Normal)、どちらもfalseにする - if (isLicenseStatusType(licenseStatus) === false) { - return { - isAlertLicenseStatus: false, - isAlertRemaining: false, - }; - } - // licenseStatusがNOLICENSEの場合、isAlertLicenseStatusをtrueにする(Remainingはハイフン) +// ライセンスステータスに応じて、ライセンスステータスの文字列を返す +const getLicenseStatus = (licenseStatus: LicenseStatusType): string => { if (licenseStatus === LICENSE_STATUS.NOLICENSE) { - return { - isAlertLicenseStatus: true, - isAlertRemaining: false, - }; + return NO_LICENSE; } - // licenseStatusがALERTの場合、どちらもtrueにする - if (licenseStatus === LICENSE_STATUS.ALERT) { - return { - isAlertLicenseStatus: true, - isAlertRemaining: true, - }; + if (licenseStatus === LICENSE_STATUS.NORMAL) { + return LICENSE_NORMAL; } - // licenseStatusがRENEWの場合、どちらもfalseにする - return { - isAlertLicenseStatus: false, - isAlertRemaining: false, - }; + return licenseStatus; }; export default UserListPage; diff --git a/dictation_server/src/common/test/init.ts b/dictation_server/src/common/test/init.ts index e919d16..bfe1512 100644 --- a/dictation_server/src/common/test/init.ts +++ b/dictation_server/src/common/test/init.ts @@ -1,4 +1,4 @@ -import { DataSource } from "typeorm"; +import { DataSource } from 'typeorm'; export const truncateAllTable = async (source: DataSource) => { const entities = source.entityMetadatas; @@ -18,4 +18,4 @@ export const truncateAllTable = async (source: DataSource) => { } finally { await queryRunner.release(); } -}; \ No newline at end of file +}; diff --git a/dictation_server/src/features/auth/auth.service.spec.ts b/dictation_server/src/features/auth/auth.service.spec.ts index c0b47d4..85473b3 100644 --- a/dictation_server/src/features/auth/auth.service.spec.ts +++ b/dictation_server/src/features/auth/auth.service.spec.ts @@ -340,7 +340,7 @@ describe('generateDelegationRefreshToken', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -486,7 +486,7 @@ describe('generateDelegationAccessToken', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -597,7 +597,7 @@ describe('updateDelegationAccessToken', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', diff --git a/dictation_server/src/features/files/files.service.spec.ts b/dictation_server/src/features/files/files.service.spec.ts index 62e4286..17d1253 100644 --- a/dictation_server/src/features/files/files.service.spec.ts +++ b/dictation_server/src/features/files/files.service.spec.ts @@ -46,7 +46,7 @@ describe('publishUploadSas', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -302,7 +302,7 @@ describe('タスク作成から自動ルーティング(DB使用)', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -1024,7 +1024,7 @@ describe('音声ファイルダウンロードURL取得', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -1529,7 +1529,7 @@ describe('テンプレートファイルダウンロードURL取得', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -1984,7 +1984,7 @@ describe('publishTemplateFileUploadSas', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -2099,7 +2099,7 @@ describe('templateUploadFinished', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', diff --git a/dictation_server/src/features/licenses/licenses.service.spec.ts b/dictation_server/src/features/licenses/licenses.service.spec.ts index 63db663..c3473ab 100644 --- a/dictation_server/src/features/licenses/licenses.service.spec.ts +++ b/dictation_server/src/features/licenses/licenses.service.spec.ts @@ -32,7 +32,7 @@ describe('ライセンス注文', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -205,7 +205,7 @@ describe('カードライセンス発行', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -295,7 +295,7 @@ describe('カードライセンスを取り込む', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -640,7 +640,7 @@ describe('ライセンス割り当て', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -1220,7 +1220,7 @@ describe('ライセンス割り当て解除', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -1389,7 +1389,7 @@ describe('ライセンス注文キャンセル', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', diff --git a/dictation_server/src/features/terms/terms.service.spec.ts b/dictation_server/src/features/terms/terms.service.spec.ts index 4a6ac7e..3607f41 100644 --- a/dictation_server/src/features/terms/terms.service.spec.ts +++ b/dictation_server/src/features/terms/terms.service.spec.ts @@ -12,7 +12,7 @@ describe('利用規約取得', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', diff --git a/dictation_server/src/features/users/users.service.spec.ts b/dictation_server/src/features/users/users.service.spec.ts index dc3b656..6f0f44d 100644 --- a/dictation_server/src/features/users/users.service.spec.ts +++ b/dictation_server/src/features/users/users.service.spec.ts @@ -436,7 +436,7 @@ describe('UsersService.createUser', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -1393,7 +1393,7 @@ describe('UsersService.getUsers', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -1882,7 +1882,7 @@ describe('UsersService.updateUser', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -2478,7 +2478,7 @@ describe('UsersService.updateAcceptedVersion', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -2578,7 +2578,7 @@ describe('UsersService.getUserName', () => { beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -2632,7 +2632,7 @@ describe('UsersService.getRelations', () => { beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db', @@ -2708,7 +2708,6 @@ describe('UsersService.getRelations', () => { { const workflows = await getWorkflows(source, account.id); workflows.sort((a, b) => a.id - b.id); - expect(workflows.length).toBe(4); expect(workflows[0].worktype_id).toBe(worktype1.id); expect(workflows[0].author_id).toBe(user1); diff --git a/dictation_server/src/features/workflows/workflows.service.spec.ts b/dictation_server/src/features/workflows/workflows.service.spec.ts index d04e4c5..5c464aa 100644 --- a/dictation_server/src/features/workflows/workflows.service.spec.ts +++ b/dictation_server/src/features/workflows/workflows.service.spec.ts @@ -25,7 +25,7 @@ describe('getWorkflows', () => { let source: DataSource | null = null; beforeAll(async () => { if (source == null) { - source = await(async () => { + source = await (async () => { const s = new DataSource({ type: 'mysql', host: 'test_mysql_db',