Просмотр исходного кода

GW77674 checkd state to checkd props

Mao 4 лет назад
Родитель
Сommit
e60012c28b

+ 1 - 2
packages/app/resource/locales/en_US/translation.json

@@ -567,8 +567,7 @@
     "check_all": "Check all",
     "check_all": "Check all",
     "deletion_modal_header": "Delete page",
     "deletion_modal_header": "Delete page",
     "delete_completely": "Delete completely",
     "delete_completely": "Delete completely",
-    "include_user_path" : "Include /user path ",
-    "include_trash_path": "Include /trash path "
+    "include_certain_path" : "Include {{pathToInclude}} path "
   },
   },
   "security_setting": {
   "security_setting": {
     "Guest Users Access": "Guest users access",
     "Guest Users Access": "Guest users access",

+ 1 - 2
packages/app/resource/locales/ja_JP/translation.json

@@ -568,8 +568,7 @@
     "check_all": "すべてチェック",
     "check_all": "すべてチェック",
     "deletion_modal_header": "以下のページを削除",
     "deletion_modal_header": "以下のページを削除",
     "delete_completely": "完全に削除する",
     "delete_completely": "完全に削除する",
-    "include_user_path": "/user下を含む ",
-    "include_trash_path": "/trash下を含む "
+    "include_certain_path": "{{pathToInclude}}下を含む "
   },
   },
   "security_setting": {
   "security_setting": {
     "Guest Users Access": "ゲストユーザーのアクセス",
     "Guest Users Access": "ゲストユーザーのアクセス",

+ 1 - 2
packages/app/resource/locales/zh_CN/translation.json

@@ -840,8 +840,7 @@
 		"check_all": "全部检查",
 		"check_all": "全部检查",
 		"deletion_modal_header": "删除页",
 		"deletion_modal_header": "删除页",
 		"delete_completely": "完全删除",
 		"delete_completely": "完全删除",
-    "include_user_path": "包含 /user 路径 ",
-    "include_trash_path": "包含 /trash 路径 "
+    "include_certain_path": "包含 {{pathToInclude}} 路径 "
 	},
 	},
 	"to_cloud_settings": "進入 GROWI.cloud 的管理界面",
 	"to_cloud_settings": "進入 GROWI.cloud 的管理界面",
 	"login": {
 	"login": {

+ 6 - 4
packages/app/src/components/SearchPage/IncludeSpecificPathButton.jsx

@@ -3,9 +3,8 @@ import PropTypes from 'prop-types';
 import { useTranslation } from 'react-i18next';
 import { useTranslation } from 'react-i18next';
 
 
 const IncludeSpecificPathButton = (props) => {
 const IncludeSpecificPathButton = (props) => {
-  const { pathToInclude } = props;
+  const { pathToInclude, checked } = props;
   const { t } = useTranslation();
   const { t } = useTranslation();
-  const [checked, setChecked] = useState(true);
 
 
   // TODO : implement this function
   // TODO : implement this function
   // 77526 story https://estoc.weseek.co.jp/redmine/issues/77526
   // 77526 story https://estoc.weseek.co.jp/redmine/issues/77526
@@ -16,12 +15,14 @@ const IncludeSpecificPathButton = (props) => {
   return (
   return (
     <div className="border px-2 btn btn-outline-secondary">
     <div className="border px-2 btn btn-outline-secondary">
       <label className="mb-0">
       <label className="mb-0">
-        <span className="font-weight-light">{pathToInclude === '/user' ? t('search_result.include_user_path') : t('search_result.include_trash_path')}</span>
+        <span className="font-weight-light">
+          {pathToInclude === '/user'
+            ? t('search_result.include_certain_path', { pathToInclude: '/user' }) : t('search_result.include_certain_path', { pathToInclude: '/trash' })}
+        </span>
         <input
         <input
           type="checkbox"
           type="checkbox"
           name="check"
           name="check"
           onChange={() => {
           onChange={() => {
-            setChecked(prevState => !prevState);
             if (checked) {
             if (checked) {
               includeSpecificPathInSearchResult(pathToInclude);
               includeSpecificPathInSearchResult(pathToInclude);
             }
             }
@@ -35,6 +36,7 @@ const IncludeSpecificPathButton = (props) => {
 
 
 IncludeSpecificPathButton.propTypes = {
 IncludeSpecificPathButton.propTypes = {
   pathToInclude: PropTypes.string.isRequired,
   pathToInclude: PropTypes.string.isRequired,
+  checked: PropTypes.bool.isRequired,
 };
 };
 
 
 export default IncludeSpecificPathButton;
 export default IncludeSpecificPathButton;