Futa Arai 2 лет назад
Родитель
Сommit
84e0bdae03

+ 20 - 1
apps/app/public/static/locales/en_US/admin.json

@@ -9,6 +9,7 @@
   "specified_users": "Specified users",
   "specified_users": "Specified users",
   "only_me": "Only me",
   "only_me": "Only me",
   "only_inside_the_group": "Only inside the group",
   "only_inside_the_group": "Only inside the group",
+  "optional": "Optional",
   "security_settings": {
   "security_settings": {
     "security_settings": "Security Settings",
     "security_settings": "Security Settings",
     "scope_of_page_disclosure": "Scope of page disclosure",
     "scope_of_page_disclosure": "Scope of page disclosure",
@@ -89,7 +90,6 @@
     "enable_link_sharing": "Enable link sharing",
     "enable_link_sharing": "Enable link sharing",
     "all_share_links": "All share links",
     "all_share_links": "All share links",
     "configuration": " Configuration",
     "configuration": " Configuration",
-    "optional": "Optional",
     "Treat username matching as identical": "Automatically bind external accounts newly logged in to local accounts when <code>username</code> match",
     "Treat username matching as identical": "Automatically bind external accounts newly logged in to local accounts when <code>username</code> match",
     "Treat username matching as identical_warn": "WARNING: Be aware of security because the system treats the same user as a match of <code>username</code>.",
     "Treat username matching as identical_warn": "WARNING: Be aware of security because the system treats the same user as a match of <code>username</code>.",
     "Treat email matching as identical": "Automatically bind external accounts newly logged in to local accounts when <code>email</code> match",
     "Treat email matching as identical": "Automatically bind external accounts newly logged in to local accounts when <code>email</code> match",
@@ -1037,6 +1037,25 @@
     "error_generate_growi_archive": "Failed to generate GROWI archive file",
     "error_generate_growi_archive": "Failed to generate GROWI archive file",
     "error_send_growi_archive": "Failed to send GROWI archive file to the destination GROWI"
     "error_send_growi_archive": "Failed to send GROWI archive file to the destination GROWI"
   },
   },
+  "external_group": {
+    "management": "External Group Management",
+    "ldap": {
+      "group_sync_settings": "LDAP Group Sync Settings",
+      "group_search_base_DN": "Group Search Base DN",
+      "group_search_base_dn_detail": "The base DN from which to search for groups",
+      "membership_attribute": "Membership Attribute",
+      "membership_attribute_detail": "Attribute of the group object which indicates user membership info",
+      "membership_attribute_type": "Membership Attribute Type",
+      "membership_attribute_type_detail": "Whether membership attribute value is of type DN or UID",
+      "child_group_attribute": "Child Group Attribute",
+      "child_group_attribute_detail": "Attribute of the group object which indicates child group info. The attribute value needs to be the DN of the child group.",
+      "auto_generate_user_on_sync": "Auto Generate User on Sync",
+      "preserve_deleted_ldap_groups": "Preserve Deleted LDAP Groups",
+      "name_mapper_detail": "Attribute to map as group name",
+      "description_mapper_detail": "Attribute to map as group description. Description can be edited after sync. However, when a mapper is set, the edited value can possibly be overwritten by the next sync.",
+      "updated_group_sync_settings": "Updated LDAP group sync settings"
+    }
+  },
   "toaster": {
   "toaster": {
     "grant_user_admin": "Succeeded to grant {{username}} admin",
     "grant_user_admin": "Succeeded to grant {{username}} admin",
     "revoke_user_admin": "Succeeded to revoke {{username}} admin",
     "revoke_user_admin": "Succeeded to revoke {{username}} admin",

+ 20 - 1
apps/app/public/static/locales/ja_JP/admin.json

@@ -17,6 +17,7 @@
   "specified_users": "特定ユーザーのみ",
   "specified_users": "特定ユーザーのみ",
   "only_me": "自分のみ",
   "only_me": "自分のみ",
   "only_inside_the_group": "特定グループのみ",
   "only_inside_the_group": "特定グループのみ",
+  "optional": "オプション",
   "security_settings": {
   "security_settings": {
     "security_settings": "セキュリティ設定",
     "security_settings": "セキュリティ設定",
     "scope_of_page_disclosure": "ページの公開範囲",
     "scope_of_page_disclosure": "ページの公開範囲",
@@ -97,7 +98,6 @@
     "enable_link_sharing": "リンクのシェアを許可",
     "enable_link_sharing": "リンクのシェアを許可",
     "all_share_links": "全てのシェアリンク",
     "all_share_links": "全てのシェアリンク",
     "configuration": "設定",
     "configuration": "設定",
-    "optional": "オプション",
     "Treat username matching as identical": "新規ログイン時、<code>username</code> が一致したローカルアカウントが存在した場合は自動的に紐付ける",
     "Treat username matching as identical": "新規ログイン時、<code>username</code> が一致したローカルアカウントが存在した場合は自動的に紐付ける",
     "Treat username matching as identical_warn": "警告: <code>username</code> の一致を以て同一ユーザーであるとみなすので、セキュリティに注意してください",
     "Treat username matching as identical_warn": "警告: <code>username</code> の一致を以て同一ユーザーであるとみなすので、セキュリティに注意してください",
     "Treat email matching as identical": "新規ログイン時、<code>email</code> が一致したローカルアカウントが存在した場合は自動的に紐付ける",
     "Treat email matching as identical": "新規ログイン時、<code>email</code> が一致したローカルアカウントが存在した場合は自動的に紐付ける",
@@ -1045,6 +1045,25 @@
     "error_generate_growi_archive": "GROWI アーカイブファイルの作成に失敗しました",
     "error_generate_growi_archive": "GROWI アーカイブファイルの作成に失敗しました",
     "error_send_growi_archive": "GROWI アーカイブファイルの送信に失敗しました"
     "error_send_growi_archive": "GROWI アーカイブファイルの送信に失敗しました"
   },
   },
+  "external_group": {
+    "management": "外部グループ管理",
+    "ldap": {
+      "group_sync_settings": "LDAP グループ同期設定",
+      "group_search_base_DN": "グループ検索ベース DN",
+      "group_search_base_dn_detail": "グループ検索をするベース DN",
+      "membership_attribute": "所属メンバーを表す LDAP 属性",
+      "membership_attribute_detail": "グループの所属メンバーを表すグループオブジェクトの属性",
+      "membership_attribute_type": "「所属メンバーを表す LDAP 属性」値の種類",
+      "membership_attribute_type_detail": "グループの所属メンバーを表すグループオブジェクトの属性値は DN か UID か",
+      "child_group_attribute": "子グループを表す LDAP 属性",
+      "child_group_attribute_detail": "グループに所属する子グループを表すグループオブジェクトの属性。属性値は DN である必要があります。",
+      "auto_generate_user_on_sync": "作成されていない GROWI アカウントを自動生成する",
+      "preserve_deleted_ldap_groups": "LDAP から削除されたグループを GROWI に残す",
+      "name_mapper_detail": "グループの「名前」として読み込む属性",
+      "description_mapper_detail": "グループの「説明」として読み込む属性。「説明」は同期後に編集可能です。ただし、mapper が設定されている場合、編集内容は再同期によって上書きされます。",
+      "updated_group_sync_settings": "LDAP グループ同期設定を更新しました"
+    }
+  },
   "toaster": {
   "toaster": {
     "grant_user_admin": "{{username}}を管理者に設定しました",
     "grant_user_admin": "{{username}}を管理者に設定しました",
     "revoke_user_admin": "{{username}}を管理者から外しました",
     "revoke_user_admin": "{{username}}を管理者から外しました",

+ 20 - 1
apps/app/public/static/locales/zh_CN/admin.json

@@ -17,6 +17,7 @@
   "specified_users": "仅指定用户",
   "specified_users": "仅指定用户",
   "only_me": "只有我",
   "only_me": "只有我",
   "only_inside_the_group": "仅组内",
   "only_inside_the_group": "仅组内",
+  "optional": "可选的",
   "security_settings": {
   "security_settings": {
     "security_settings": "安全设置",
     "security_settings": "安全设置",
     "scope_of_page_disclosure": "页面公开范围",
     "scope_of_page_disclosure": "页面公开范围",
@@ -97,7 +98,6 @@
     "enable_link_sharing": "启用链接共享",
     "enable_link_sharing": "启用链接共享",
     "all_share_links": "所有共享链接",
     "all_share_links": "所有共享链接",
 		"configuration": " 配置",
 		"configuration": " 配置",
-		"optional": "可选的",
 		"Treat username matching as identical": "Automatically bind external accounts newly logged in to local accounts when <code>username</code> match",
 		"Treat username matching as identical": "Automatically bind external accounts newly logged in to local accounts when <code>username</code> match",
 		"Treat username matching as identical_warn": "WARNING: Be aware of security because the system treats the same user as a match of <code>username</code>.",
 		"Treat username matching as identical_warn": "WARNING: Be aware of security because the system treats the same user as a match of <code>username</code>.",
 		"Treat email matching as identical": "Automatically bind external accounts newly logged in to local accounts when <code>email</code> match",
 		"Treat email matching as identical": "Automatically bind external accounts newly logged in to local accounts when <code>email</code> match",
@@ -1045,6 +1045,25 @@
     "error_generate_growi_archive": "Failed to generate GROWI archive file",
     "error_generate_growi_archive": "Failed to generate GROWI archive file",
     "error_send_growi_archive": "Failed to send GROWI archive file to the destination GROWI"
     "error_send_growi_archive": "Failed to send GROWI archive file to the destination GROWI"
   },
   },
+  "external_group": {
+    "management": "External Group Management",
+    "ldap": {
+      "group_sync_settings": "LDAP Group Sync Settings",
+      "group_search_base_DN": "Group Search Base DN",
+      "group_search_base_dn_detail": "The base DN from which to search for groups",
+      "membership_attribute": "Membership Attribute",
+      "membership_attribute_detail": "Attribute of the group object which indicates user membership info",
+      "membership_attribute_type": "Membership Attribute Type",
+      "membership_attribute_type_detail": "Whether membership attribute value is of type DN or UID",
+      "child_group_attribute": "Child Group Attribute",
+      "child_group_attribute_detail": "Attribute of the group object which indicates child group info. The attribute value needs to be the DN of the child group.",
+      "auto_generate_user_on_sync": "Auto Generate User on Sync",
+      "preserve_deleted_ldap_groups": "Preserve Deleted LDAP Groups",
+      "name_mapper_detail": "Attribute to map as group name",
+      "description_mapper_detail": "Attribute to map as group description. Description can be edited after sync. However, when a mapper is set, the edited value can possibly be overwritten by the next sync.",
+      "updated_sync_settings": "Updated LDAP group sync settings"
+    }
+  },
   "toaster": {
   "toaster": {
     "grant_user_admin": "Succeeded to grant {{username}} admin",
     "grant_user_admin": "Succeeded to grant {{username}} admin",
     "revoke_user_admin": "Succeeded to revoke {{username}} admin",
     "revoke_user_admin": "Succeeded to revoke {{username}} admin",

+ 2 - 2
apps/app/src/components/Admin/Security/LdapSecuritySettingContents.jsx

@@ -235,7 +235,7 @@ class LdapSecuritySettingContents extends React.Component {
             </div>
             </div>
 
 
             <h3 className="alert-anchor border-bottom">
             <h3 className="alert-anchor border-bottom">
-              Attribute Mapping ({t('security_settings.optional')})
+              Attribute Mapping ({t('optional')})
             </h3>
             </h3>
 
 
             <div className="form-group row">
             <div className="form-group row">
@@ -325,7 +325,7 @@ class LdapSecuritySettingContents extends React.Component {
 
 
 
 
             <h3 className="alert-anchor border-bottom">
             <h3 className="alert-anchor border-bottom">
-              {t('security_settings.ldap.group_search_filter')} ({t('security_settings.optional')})
+              {t('security_settings.ldap.group_search_filter')} ({t('optional')})
             </h3>
             </h3>
 
 
             <div className="form-group row">
             <div className="form-group row">

+ 1 - 1
apps/app/src/components/Admin/Security/OidcSecuritySettingContents.jsx

@@ -296,7 +296,7 @@ class OidcSecurityManagementContents extends React.Component {
             </div>
             </div>
 
 
             <h3 className="alert-anchor border-bottom">
             <h3 className="alert-anchor border-bottom">
-              Attribute Mapping ({t('security_settings.optional')})
+              Attribute Mapping ({t('optional')})
             </h3>
             </h3>
 
 
             <div className="row mb-5 form-group">
             <div className="row mb-5 form-group">

+ 3 - 1
apps/app/src/components/Admin/UserGroup/ExternalGroup/ExternalGroupManagement.tsx

@@ -1,5 +1,6 @@
 import { FC, useMemo, useState } from 'react';
 import { FC, useMemo, useState } from 'react';
 
 
+import { useTranslation } from 'react-i18next';
 import { TabContent, TabPane } from 'reactstrap';
 import { TabContent, TabPane } from 'reactstrap';
 
 
 import CustomNav from '~/components/CustomNavigation/CustomNav';
 import CustomNav from '~/components/CustomNavigation/CustomNav';
@@ -9,6 +10,7 @@ import { LDAPGroupSyncSettingsForm } from './LDAPGroupSyncSettingsForm';
 export const ExternalGroupManagement: FC = () => {
 export const ExternalGroupManagement: FC = () => {
   const [activeTab, setActiveTab] = useState('ldap');
   const [activeTab, setActiveTab] = useState('ldap');
   const [activeComponents, setActiveComponents] = useState(new Set(['ldap']));
   const [activeComponents, setActiveComponents] = useState(new Set(['ldap']));
+  const { t } = useTranslation('admin');
 
 
   const switchActiveTab = (selectedTab) => {
   const switchActiveTab = (selectedTab) => {
     setActiveTab(selectedTab);
     setActiveTab(selectedTab);
@@ -25,7 +27,7 @@ export const ExternalGroupManagement: FC = () => {
   }, []);
   }, []);
 
 
   return <>
   return <>
-    <h2 className="border-bottom">外部グループ管理</h2>
+    <h2 className="border-bottom">{t('external_group.management')}</h2>
     <CustomNav
     <CustomNav
       activeTab={activeTab}
       activeTab={activeTab}
       navTabMapping={navTabMapping}
       navTabMapping={navTabMapping}

+ 23 - 19
apps/app/src/components/Admin/UserGroup/ExternalGroup/LDAPGroupSyncSettingsForm.tsx

@@ -34,7 +34,7 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
   const submitHandler = useCallback(async() => {
   const submitHandler = useCallback(async() => {
     try {
     try {
       await apiv3Put('/external-user-groups/ldap/sync-settings', formValues);
       await apiv3Put('/external-user-groups/ldap/sync-settings', formValues);
-      toastSuccess('更新しました');
+      toastSuccess(t('external_group.ldap.updated_group_sync_settings'));
     }
     }
     catch (err) {
     catch (err) {
       toastError(err);
       toastError(err);
@@ -42,9 +42,9 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
   }, [formValues]);
   }, [formValues]);
 
 
   return <>
   return <>
-    <h3 className="border-bottom">LDAP グループ同期設定</h3>
+    <h3 className="border-bottom">{t('external_group.ldap.group_sync_settings')}</h3>
     <div className="row form-group">
     <div className="row form-group">
-      <label htmlFor="ldapGroupsDN" className="text-left text-md-right col-md-3 col-form-label">グループ検索ベース DN</label>
+      <label htmlFor="ldapGroupsDN" className="text-left text-md-right col-md-3 col-form-label">{t('external_group.ldap.group_search_base_DN')}</label>
       <div className="col-md-6">
       <div className="col-md-6">
         <input
         <input
           className="form-control"
           className="form-control"
@@ -55,12 +55,14 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
           onChange={e => setFormValues({ ...formValues, ldapGroupsDN: e.target.value })}
           onChange={e => setFormValues({ ...formValues, ldapGroupsDN: e.target.value })}
         />
         />
         <p className="form-text text-muted">
         <p className="form-text text-muted">
-          <small>グループ検索をするベース DN</small>
+          <small>{t('external_group.ldap.group_search_base_dn_detail')}</small>
         </p>
         </p>
       </div>
       </div>
     </div>
     </div>
     <div className="row form-group">
     <div className="row form-group">
-      <label htmlFor="ldapGroupMembershipAttribute" className="text-left text-md-right col-md-3 col-form-label">所属メンバーを表す LDAP 属性</label>
+      <label htmlFor="ldapGroupMembershipAttribute" className="text-left text-md-right col-md-3 col-form-label">
+        {t('external_group.ldap.membership_attribute')}
+      </label>
       <div className="col-md-6">
       <div className="col-md-6">
         <input
         <input
           className="form-control"
           className="form-control"
@@ -72,7 +74,7 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
         />
         />
         <p className="form-text text-muted">
         <p className="form-text text-muted">
           <small>
           <small>
-            グループの所属メンバーを表すグループオブジェクトの属性 <br />
+            {t('external_group.ldap.membership_attribute_detail')} <br />
             e.g.) <code>member</code>, <code>memberUid</code>
             e.g.) <code>member</code>, <code>memberUid</code>
           </small>
           </small>
         </p>
         </p>
@@ -80,7 +82,7 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
     </div>
     </div>
     <div className="row form-group">
     <div className="row form-group">
       <label htmlFor="ldapGroupMembershipAttributeType" className="text-left text-md-right col-md-3 col-form-label">
       <label htmlFor="ldapGroupMembershipAttributeType" className="text-left text-md-right col-md-3 col-form-label">
-        「所属メンバーを表す LDAP 属性」値の種類
+        {t('external_group.ldap.membership_attribute_type')}
       </label>
       </label>
       <div className="col-md-6">
       <div className="col-md-6">
         <select
         <select
@@ -94,13 +96,15 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
         </select>
         </select>
         <p className="form-text text-muted">
         <p className="form-text text-muted">
           <small>
           <small>
-          グループの所属メンバーを表すグループオブジェクトの属性値は DN か UID か
+            {t('external_group.ldap.membership_attribute_type_detail')}
           </small>
           </small>
         </p>
         </p>
       </div>
       </div>
     </div>
     </div>
     <div className="row form-group">
     <div className="row form-group">
-      <label htmlFor="ldapGroupChildGroupAttribute" className="text-left text-md-right col-md-3 col-form-label">子グループを表す LDAP 属性</label>
+      <label htmlFor="ldapGroupChildGroupAttribute" className="text-left text-md-right col-md-3 col-form-label">
+        {t('external_group.ldap.child_group_attribute')}
+      </label>
       <div className="col-md-6">
       <div className="col-md-6">
         <input
         <input
           className="form-control"
           className="form-control"
@@ -111,7 +115,7 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
           onChange={e => setFormValues({ ...formValues, ldapGroupChildGroupAttribute: e.target.value })}/>
           onChange={e => setFormValues({ ...formValues, ldapGroupChildGroupAttribute: e.target.value })}/>
         <p className="form-text text-muted">
         <p className="form-text text-muted">
           <small>
           <small>
-            グループに所属する子グループを表すグループオブジェクトの属性。属性値は DN である必要があります。<br />
+            {t('external_group.ldap.child_group_attribute_detail')}<br />
             e.g.) <code>member</code>
             e.g.) <code>member</code>
           </small>
           </small>
         </p>
         </p>
@@ -121,7 +125,7 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
       <label
       <label
         className="text-left text-md-right col-md-3 col-form-label"
         className="text-left text-md-right col-md-3 col-form-label"
       >
       >
-        {/* {t('admin:app_setting.file_uploading')} */}
+        {/* {t('external_group.ldap.auto_generate_user_on_sync')} */}
       </label>
       </label>
       <div className="col-md-6">
       <div className="col-md-6">
         <div className="custom-control custom-checkbox custom-checkbox-info">
         <div className="custom-control custom-checkbox custom-checkbox-info">
@@ -137,7 +141,7 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
             className="custom-control-label"
             className="custom-control-label"
             htmlFor="autoGenerateUserOnLDAPGroupSync"
             htmlFor="autoGenerateUserOnLDAPGroupSync"
           >
           >
-            作成されていない GROWI アカウントを自動生成する
+            {t('external_group.ldap.auto_generate_user_on_sync')}
           </label>
           </label>
         </div>
         </div>
       </div>
       </div>
@@ -146,7 +150,7 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
       <label
       <label
         className="text-left text-md-right col-md-3 col-form-label"
         className="text-left text-md-right col-md-3 col-form-label"
       >
       >
-        {/* {t('admin:app_setting.file_uploading')} */}
+        {/* {t('external_group.ldap.preserve_deleted_ldap_groups')} */}
       </label>
       </label>
       <div className="col-md-6">
       <div className="col-md-6">
         <div className="custom-control custom-checkbox custom-checkbox-info">
         <div className="custom-control custom-checkbox custom-checkbox-info">
@@ -162,14 +166,14 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
             className="custom-control-label"
             className="custom-control-label"
             htmlFor="preserveDeletedLDAPGroups"
             htmlFor="preserveDeletedLDAPGroups"
           >
           >
-            LDAP から削除されたグループを GROWI に残す
+            {t('external_group.ldap.preserve_deleted_ldap_groups')}
           </label>
           </label>
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
-    <h3 className="border-bottom">Attribute Mapping(オプション)</h3>
+    <h3 className="border-bottom">Attribute Mapping ({t('optional')})</h3>
     <div className="row form-group">
     <div className="row form-group">
-      <label htmlFor="ldapGroupNameAttribute" className="text-left text-md-right col-md-3 col-form-label">名前</label>
+      <label htmlFor="ldapGroupNameAttribute" className="text-left text-md-right col-md-3 col-form-label">{t('Name')}</label>
       <div className="col-md-6">
       <div className="col-md-6">
         <input
         <input
           className="form-control"
           className="form-control"
@@ -182,14 +186,14 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
         />
         />
         <p className="form-text text-muted">
         <p className="form-text text-muted">
           <small>
           <small>
-            グループの「名前」として読み込む属性
+            {t('external_group.ldap.name_mapper_detail')}
           </small>
           </small>
         </p>
         </p>
       </div>
       </div>
     </div>
     </div>
     <div className="row form-group">
     <div className="row form-group">
       <label htmlFor="ldapGroupDescriptionAttribute" className="text-left text-md-right col-md-3 col-form-label">
       <label htmlFor="ldapGroupDescriptionAttribute" className="text-left text-md-right col-md-3 col-form-label">
-        説明
+        {t('Description')}
       </label>
       </label>
       <div className="col-md-6">
       <div className="col-md-6">
         <input
         <input
@@ -202,7 +206,7 @@ export const LDAPGroupSyncSettingsForm: FC = () => {
         />
         />
         <p className="form-text text-muted">
         <p className="form-text text-muted">
           <small>
           <small>
-            グループの「説明」として読み込む属性。「説明」は同期後に編集可能です。ただし、mapper が設定されている場合、編集内容は再同期によって上書きされます。
+            {t('external_group.ldap.description_mapper_detail')}
           </small>
           </small>
         </p>
         </p>
       </div>
       </div>

+ 1 - 1
apps/app/src/components/Admin/UserGroup/UserGroupPage.tsx

@@ -148,7 +148,7 @@ export const UserGroupPage: FC = () => {
 
 
   return (
   return (
     <div data-testid="admin-user-groups">
     <div data-testid="admin-user-groups">
-      <h2 className="border-bottom">グループ管理</h2>
+      <h2 className="border-bottom">{t('admin:user_group_management.user_group_management')}</h2>
       {
       {
         isAclEnabled ? (
         isAclEnabled ? (
           <div className="mb-3">
           <div className="mb-3">