From d0f4971dc96a121fbf3d9c111592ed4425de4dd4 Mon Sep 17 00:00:00 2001 From: "makabe.t" Date: Thu, 2 Nov 2023 09:41:43 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20544:=20=E3=83=98=E3=83=83?= =?UTF-8?q?=E3=83=80=E3=81=AE=E8=A1=A8=E7=A4=BA=E6=96=87=E8=A8=80=EF=BC=88?= =?UTF-8?q?=E3=82=BF=E3=83=96=E3=83=BB=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB?= =?UTF-8?q?=EF=BC=89=E3=82=92=E7=BF=BB=E8=A8=B3=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=82=92=E5=8F=82=E7=85=A7=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task2895: ヘッダの表示文言(タブ・タイトル)を翻訳ファイルを参照するように修正する](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2895) - ヘッダに表示するタイトルとタブの文言を翻訳ファイルに定義したラベルを利用するように修正しました。 ## レビューポイント - タブのフィルタ管理用に`key`プロパティを追加したが、構成として適切か - 表示項目の制御には従来通りの定数を利用したいのでkeyプロパティとして設定 - labelプロパティにタブに表示する文言の翻訳文言を参照するように設定 - 対応ラベルの箇所は適切か(各タブ名+タイトル名) ## UIの変更 - [Task2895](https://ndstokyo.sharepoint.com/:f:/r/sites/Piranha/Shared%20Documents/General/OMDS/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88/Task2895?csf=1&web=1&e=Xs3Tac) ## 動作確認状況 - ローカルで確認 --- .../src/components/header/constants.ts | 47 +++++++++++++++---- .../src/components/header/loginedHeader.tsx | 6 +-- .../src/components/header/utils.ts | 10 ++-- dictation_client/src/translation/de.json | 7 +++ dictation_client/src/translation/en.json | 7 +++ dictation_client/src/translation/es.json | 7 +++ dictation_client/src/translation/fr.json | 7 +++ 7 files changed, 72 insertions(+), 19 deletions(-) diff --git a/dictation_client/src/components/header/constants.ts b/dictation_client/src/components/header/constants.ts index 8f9c1f9..79817eb 100644 --- a/dictation_client/src/components/header/constants.ts +++ b/dictation_client/src/components/header/constants.ts @@ -1,3 +1,4 @@ +import { getTranslationID } from "translation"; import { HeaderMenus, LoginedPaths } from "./types"; export const HEADER_MENUS_ACCOUNT = "Account"; @@ -8,17 +9,45 @@ export const HEADER_MENUS_WORKFLOW = "Workflow"; export const HEADER_MENUS_PARTNER = "Partners"; export const HEADER_MENUS_XXX = "XXX"; // XXX 仮のタブ -export const HEADER_MENUS: { label: HeaderMenus; path: LoginedPaths }[] = [ - { label: HEADER_MENUS_ACCOUNT, path: "/account" }, - { label: HEADER_MENUS_DICTATIONS, path: "/dictations" }, - { label: HEADER_MENUS_LICENSE, path: "/license" }, - { label: HEADER_MENUS_USER, path: "/user" }, - { label: HEADER_MENUS_WORKFLOW, path: "/workflow" }, - { label: HEADER_MENUS_PARTNER, path: "/partners" }, - { label: HEADER_MENUS_XXX, path: "/xxx" }, // XXX 仮のタブ +export const HEADER_MENUS: { + key: HeaderMenus; + label: string; + path: LoginedPaths; +}[] = [ + { + key: HEADER_MENUS_ACCOUNT, + label: getTranslationID("common.label.headerAccount"), + path: "/account", + }, + { + key: HEADER_MENUS_DICTATIONS, + label: getTranslationID("common.label.headerDictations"), + path: "/dictations", + }, + { + key: HEADER_MENUS_LICENSE, + label: getTranslationID("common.label.headerLicense"), + path: "/license", + }, + { + key: HEADER_MENUS_USER, + label: getTranslationID("common.label.headerUser"), + path: "/user", + }, + { + key: HEADER_MENUS_WORKFLOW, + label: getTranslationID("common.label.headerWorkflow"), + path: "/workflow", + }, + { + key: HEADER_MENUS_PARTNER, + label: getTranslationID("common.label.headerPartners"), + path: "/partners", + }, + { key: HEADER_MENUS_XXX, label: "xxx", path: "/xxx" }, // XXX 仮のタブ ]; -export const HEADER_NAME = "ODMS Cloud"; +export const HEADER_NAME = getTranslationID("common.label.headerName"); /** * adminのみに表示するヘッダータブ diff --git a/dictation_client/src/components/header/loginedHeader.tsx b/dictation_client/src/components/header/loginedHeader.tsx index 925d09b..0c8643a 100644 --- a/dictation_client/src/components/header/loginedHeader.tsx +++ b/dictation_client/src/components/header/loginedHeader.tsx @@ -61,11 +61,11 @@ const LoginedHeader: React.FC = (props: HeaderProps) => {
OM System
-
{HEADER_NAME}
+
{t(HEADER_NAME)}
    {filterMenus.map((x) => ( -
  • +
  • = (props: HeaderProps) => { : "" } > - {x.label} + {t(x.label)}
  • ))} diff --git a/dictation_client/src/components/header/utils.ts b/dictation_client/src/components/header/utils.ts index 9eeb9f1..db9fc32 100644 --- a/dictation_client/src/components/header/utils.ts +++ b/dictation_client/src/components/header/utils.ts @@ -49,21 +49,17 @@ export const getFilteredMenus = () => { return HEADER_MENUS; } if (isStandard) { - return HEADER_MENUS.filter( - (item) => !ADMIN_ONLY_TABS.includes(item.label) - ); + return HEADER_MENUS.filter((item) => !ADMIN_ONLY_TABS.includes(item.key)); } } if (isTier5) { if (isAdmin) { return HEADER_MENUS.filter( - (item) => !TIER1_TO_TIER4_ONLY_TABS.includes(item.label) + (item) => !TIER1_TO_TIER4_ONLY_TABS.includes(item.key) ); } if (isStandard) { - return HEADER_MENUS.filter( - (item) => !ADMIN_ONLY_TABS.includes(item.label) - ); + return HEADER_MENUS.filter((item) => !ADMIN_ONLY_TABS.includes(item.key)); } } // admin,standardでなく、第1~5階層でもないアカウントに表示する空のヘッダータブ diff --git a/dictation_client/src/translation/de.json b/dictation_client/src/translation/de.json index cf14563..2668a3b 100644 --- a/dictation_client/src/translation/de.json +++ b/dictation_client/src/translation/de.json @@ -18,6 +18,13 @@ "delete": "Löschen", "return": "zurückkehren", "operationInsteadOf": "(de)Operation instead of:", + "headerName": "(de)ODMS Cloud", + "headerAccount": "(de)Account", + "headerUser": "(de)User", + "headerLicense": "(de)License", + "headerDictations": "(de)Dictations", + "headerWorkflow": "(de)Workflow", + "headerPartners": "(de)Partners", "tier1": "(de)Admin", "tier2": "(de)BC", "tier3": "(de)Distributor", diff --git a/dictation_client/src/translation/en.json b/dictation_client/src/translation/en.json index 6ded9d8..acd6860 100644 --- a/dictation_client/src/translation/en.json +++ b/dictation_client/src/translation/en.json @@ -18,6 +18,13 @@ "delete": "Delete", "return": "Return", "operationInsteadOf": "Operation instead of:", + "headerName": "ODMS Cloud", + "headerAccount": "Account", + "headerUser": "User", + "headerLicense": "License", + "headerDictations": "Dictations", + "headerWorkflow": "Workflow", + "headerPartners": "Partners", "tier1": "Admin", "tier2": "BC", "tier3": "Distributor", diff --git a/dictation_client/src/translation/es.json b/dictation_client/src/translation/es.json index 6dd82a1..1d5ffbe 100644 --- a/dictation_client/src/translation/es.json +++ b/dictation_client/src/translation/es.json @@ -18,6 +18,13 @@ "delete": "Delete", "return": "Devolver", "operationInsteadOf": "(es)Operation instead of:", + "headerName": "(es)ODMS Cloud", + "headerAccount": "(es)Account", + "headerUser": "(es)User", + "headerLicense": "(es)License", + "headerDictations": "(es)Dictations", + "headerWorkflow": "(es)Workflow", + "headerPartners": "(es)Partners", "tier1": "(es)Admin", "tier2": "(es)BC", "tier3": "(es)Distributor", diff --git a/dictation_client/src/translation/fr.json b/dictation_client/src/translation/fr.json index f7d0fd1..c245132 100644 --- a/dictation_client/src/translation/fr.json +++ b/dictation_client/src/translation/fr.json @@ -18,6 +18,13 @@ "delete": "Delete", "return": "Retour", "operationInsteadOf": "(fr)Operation instead of:", + "headerName": "(fr)ODMS Cloud", + "headerAccount": "(fr)Account", + "headerUser": "(fr)User", + "headerLicense": "(fr)License", + "headerDictations": "(fr)Dictations", + "headerWorkflow": "(fr)Workflow", + "headerPartners": "(fr)Partners", "tier1": "(fr)Admin", "tier2": "(fr)BC", "tier3": "(fr)Distributor",