SULLEY\ryo-h 4 лет назад
Родитель
Сommit
09333ac9e6

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

@@ -44,8 +44,8 @@ class SearchPage extends React.Component {
     this.searchHandler = this.searchHandler.bind(this);
     this.selectPage = this.selectPage.bind(this);
     this.toggleCheckBox = this.toggleCheckBox.bind(this);
-    this.switchExcludingUnderUserPage = this.switchExcludingUnderUserPage.bind(this);
-    this.switchExcludingUnderTrashPage = this.switchExcludingUnderTrashPage.bind(this);
+    this.switchExcludingUnderUserPageHandler = this.switchExcludingUnderUserPageHandler.bind(this);
+    this.switchExcludingUnderTrashPageHandler = this.switchExcludingUnderTrashPageHandler.bind(this);
     this.onPagingNumberChanged = this.onPagingNumberChanged.bind(this);
   }
 
@@ -68,11 +68,11 @@ class SearchPage extends React.Component {
     return query;
   }
 
-  switchExcludingUnderUserPage() {
+  switchExcludingUnderUserPageHandler() {
     this.setState({ excludeUnderUserPage: !this.state.excludeUnderUserPage });
   }
 
-  switchExcludingUnderTrashPage() {
+  switchExcludingUnderTrashPageHandler() {
     this.setState({ excludeUnderTrashPage: !this.state.excludeUnderTrashPage });
   }
 
@@ -224,8 +224,8 @@ class SearchPage extends React.Component {
         searchingKeyword={this.state.searchingKeyword}
         appContainer={this.props.appContainer}
         onSearchInvoked={this.searchHandler}
-        switchExcludingUnderUserPage={this.switchExcludingUnderUserPage}
-        switchExcludingUnderTrashPage={this.switchExcludingUnderTrashPage}
+        onSwitchExcludingUnderUserPageInvoked={this.switchExcludingUnderUserPageHandler}
+        onSwitchExcludingUnderTrashPageInvoked={this.switchExcludingUnderTrashPageHandler}
       >
       </SearchControl>
     );

+ 4 - 4
packages/app/src/components/SearchPage/FilterOptionModal.tsx

@@ -9,8 +9,8 @@ import {
 type Props = {
   isOpen: boolean,
   onClose?: () => void,
-  switchExcludingUnderUserPage?: () => void,
-  switchExcludingUnderTrashPage?: () => void,
+  onSwitchExcludingUnderUserPageInvoked?: () => void,
+  onSwitchExcludingUnderTrashPageInvoked?: () => void,
   // todo: implement this method
   // refs: https://redmine.weseek.co.jp/issues/81845
   onClickFilteringSearchResultButton?: () => void,
@@ -42,7 +42,7 @@ const FilterOptionModal: FC<Props> = (props: Props) => {
               <input
                 className="mr-2"
                 type="checkbox"
-                onClick={props.switchExcludingUnderUserPage}
+                onClick={props.onSwitchExcludingUnderUserPageInvoked}
               />
               {t('Include Subordinated Target Page', { target: '/user' })}
             </label>
@@ -54,7 +54,7 @@ const FilterOptionModal: FC<Props> = (props: Props) => {
               <input
                 className="mr-2"
                 type="checkbox"
-                onClick={props.switchExcludingUnderTrashPage}
+                onClick={props.onSwitchExcludingUnderTrashPageInvoked}
               />
               {t('Include Subordinated Target Page', { target: '/trash' })}
             </label>

+ 12 - 12
packages/app/src/components/SearchPage/SearchControl.tsx

@@ -10,8 +10,8 @@ type Props = {
   searchingKeyword: string,
   appContainer: AppContainer,
   onSearchInvoked: (data : any[]) => boolean,
-  switchExcludingUnderUserPage?: () => void,
-  switchExcludingUnderTrashPage?: () => void,
+  onSwitchExcludingUnderUserPageInvoked?: () => void,
+  onSwitchExcludingUnderTrashPageInvoked?: () => void,
 }
 
 const SearchControl: FC <Props> = (props: Props) => {
@@ -22,15 +22,15 @@ const SearchControl: FC <Props> = (props: Props) => {
   const SearchPageFormTypeAny : any = SearchPageForm;
   const { t } = useTranslation('');
 
-  const switchExcludingUnderUserPage = () => {
-    if (props.switchExcludingUnderUserPage != null) {
-      props.switchExcludingUnderUserPage();
+  const switchExcludingUnderUserPageHandler = () => {
+    if (props.onSwitchExcludingUnderUserPageInvoked != null) {
+      props.onSwitchExcludingUnderUserPageInvoked();
     }
   };
 
-  const switchExcludingUnderTrashPage = () => {
-    if (props.switchExcludingUnderTrashPage != null) {
-      props.switchExcludingUnderTrashPage();
+  const switchExcludingUnderTrashPageHandler = () => {
+    if (props.onSwitchExcludingUnderTrashPageInvoked != null) {
+      props.onSwitchExcludingUnderTrashPageInvoked();
     }
   };
 
@@ -62,8 +62,8 @@ const SearchControl: FC <Props> = (props: Props) => {
       <FilterOptionModal
         isOpen={isFileterOptionModalShown || false}
         onClose={closeFilterOptionModalHandler}
-        switchExcludingUnderUserPage={switchExcludingUnderUserPage}
-        switchExcludingUnderTrashPage={switchExcludingUnderTrashPage}
+        onSwitchExcludingUnderUserPageInvoked={switchExcludingUnderUserPageHandler}
+        onSwitchExcludingUnderTrashPageInvoked={switchExcludingUnderTrashPageHandler}
       />
     );
   };
@@ -110,7 +110,7 @@ const SearchControl: FC <Props> = (props: Props) => {
                 className="mr-2"
                 type="checkbox"
                 id="flexCheckDefault"
-                onClick={() => switchExcludingUnderUserPage()}
+                onClick={switchExcludingUnderUserPageHandler}
               />
               {t('Include Subordinated Target Page', { target: '/user' })}
             </label>
@@ -121,7 +121,7 @@ const SearchControl: FC <Props> = (props: Props) => {
                 className="mr-2"
                 type="checkbox"
                 id="flexCheckChecked"
-                onClick={() => switchExcludingUnderTrashPage()}
+                onClick={switchExcludingUnderTrashPageHandler}
               />
               {t('Include Subordinated Target Page', { target: '/trash' })}
             </label>