Merged PR 544: ヘッダの表示文言(タブ・タイトル)を翻訳ファイルを参照するように修正する

## 概要
[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)

## 動作確認状況
- ローカルで確認
This commit is contained in:
makabe.t 2023-11-02 09:41:43 +00:00
parent 18757e3243
commit d0f4971dc9
7 changed files with 72 additions and 19 deletions

View File

@ -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のみに表示するヘッダータブ

View File

@ -61,11 +61,11 @@ const LoginedHeader: React.FC<HeaderProps> = (props: HeaderProps) => {
<div className={styles.headerLogo}>
<img src={logo} alt="OM System" />
</div>
<div className={styles.headerSub}>{HEADER_NAME}</div>
<div className={styles.headerSub}>{t(HEADER_NAME)}</div>
<div className={styles.headerMenu}>
<ul>
{filterMenus.map((x) => (
<li key={x.label}>
<li key={x.key}>
<a
href={x.path}
className={
@ -74,7 +74,7 @@ const LoginedHeader: React.FC<HeaderProps> = (props: HeaderProps) => {
: ""
}
>
{x.label}
{t(x.label)}
</a>
</li>
))}

View File

@ -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でなく、第15階層でもないアカウントに表示する空のヘッダータブ

View File

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

View File

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

View File

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

View File

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