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

Merge branch 'feat/77545-filtering-search-result-for-sp-ver' into feat/77545-81845-filtering-search-result

# Conflicts:
#	packages/app/src/components/SearchPage.jsx
#	packages/app/src/components/SearchPage/SearchControl.tsx
#	packages/app/src/components/SearchPage/SearchOptionModal.tsx
SULLEY\ryo-h 4 лет назад
Родитель
Сommit
c4fe0c8253

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

@@ -44,8 +44,8 @@ class SearchPage extends React.Component {
     this.searchHandler = this.searchHandler.bind(this);
     this.searchHandler = this.searchHandler.bind(this);
     this.selectPage = this.selectPage.bind(this);
     this.selectPage = this.selectPage.bind(this);
     this.toggleCheckBox = this.toggleCheckBox.bind(this);
     this.toggleCheckBox = this.toggleCheckBox.bind(this);
-    this.switchExcludingUserPagesHandler = this.switchExcludingUserPagesHandler.bind(this);
-    this.switchExcludingTrashPagesHandler = this.switchExcludingTrashPagesHandler.bind(this);
+    this.switchExcludeUserPagesHandler = this.switchExcludeUserPagesHandler.bind(this);
+    this.switchExcludeTrashPagesHandler = this.switchExcludeTrashPagesHandler.bind(this);
     this.onPagingNumberChanged = this.onPagingNumberChanged.bind(this);
     this.onPagingNumberChanged = this.onPagingNumberChanged.bind(this);
   }
   }
 
 
@@ -68,11 +68,11 @@ class SearchPage extends React.Component {
     return query;
     return query;
   }
   }
 
 
-  switchExcludingUserPagesHandler() {
+  switchExcludeUserPagesHandler() {
     this.setState({ excludeUserPages: !this.state.excludeUserPages });
     this.setState({ excludeUserPages: !this.state.excludeUserPages });
   }
   }
 
 
-  switchExcludingTrashPagesHandler() {
+  switchExcludeTrashPagesHandler() {
     this.setState({ excludeTrashPages: !this.state.excludeTrashPages });
     this.setState({ excludeTrashPages: !this.state.excludeTrashPages });
   }
   }
 
 
@@ -226,8 +226,8 @@ class SearchPage extends React.Component {
         searchingKeyword={this.state.searchingKeyword}
         searchingKeyword={this.state.searchingKeyword}
         appContainer={this.props.appContainer}
         appContainer={this.props.appContainer}
         onSearchInvoked={this.searchHandler}
         onSearchInvoked={this.searchHandler}
-        onSwitchExcludingUserPagesInvoked={this.switchExcludingUserPagesHandler}
-        onSwitchExcludingTrashPagesInvoked={this.switchExcludingTrashPagesHandler}
+        onExcludeUserPagesSwitched={this.switchExcludeUserPagesHandler}
+        onExcludeTrashPagesSwitched={this.switchExcludeTrashPagesHandler}
         excludeUnderUserPage={this.state.excludeUnderUserPage}
         excludeUnderUserPage={this.state.excludeUnderUserPage}
         excludeUnderTrashPage={this.state.excludeUnderTrashPage}
         excludeUnderTrashPage={this.state.excludeUnderTrashPage}
       >
       >

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

@@ -12,8 +12,8 @@ type Props = {
   excludeUnderUserPage: boolean,
   excludeUnderUserPage: boolean,
   excludeUnderTrashPage: boolean,
   excludeUnderTrashPage: boolean,
   onSearchInvoked: (data: {keyword: string}) => boolean,
   onSearchInvoked: (data: {keyword: string}) => boolean,
-  onSwitchExcludingUserPagesInvoked?: () => void,
-  onSwitchExcludingTrashPagesInvoked?: () => void,
+  onExcludeUserPagesSwitched?: () => void,
+  onExcludeTrashPagesSwitched?: () => void,
 }
 }
 
 
 const SearchControl: FC <Props> = (props: Props) => {
 const SearchControl: FC <Props> = (props: Props) => {
@@ -24,15 +24,15 @@ const SearchControl: FC <Props> = (props: Props) => {
   const SearchPageFormTypeAny : any = SearchPageForm;
   const SearchPageFormTypeAny : any = SearchPageForm;
   const { t } = useTranslation('');
   const { t } = useTranslation('');
 
 
-  const switchExcludingUnderUserPageHandler = () => {
-    if (props.onSwitchExcludingUserPagesInvoked != null) {
-      props.onSwitchExcludingUserPagesInvoked();
+  const switchExcludeUserPagesHandler = () => {
+    if (props.onExcludeUserPagesSwitched != null) {
+      props.onExcludeUserPagesSwitched();
     }
     }
   };
   };
 
 
-  const switchExcludingUnderTrashPageHandler = () => {
-    if (props.onSwitchExcludingTrashPagesInvoked != null) {
-      props.onSwitchExcludingTrashPagesInvoked();
+  const switchExcludeTrashPagesHandler = () => {
+    if (props.onExcludeTrashPagesSwitched != null) {
+      props.onExcludeTrashPagesSwitched();
     }
     }
   };
   };
 
 
@@ -71,8 +71,8 @@ const SearchControl: FC <Props> = (props: Props) => {
         isOpen={isFileterOptionModalShown || false}
         isOpen={isFileterOptionModalShown || false}
         onClickFilteringSearchResult={onRetrySearchInvoked}
         onClickFilteringSearchResult={onRetrySearchInvoked}
         onClose={closeSearchOptionModalHandler}
         onClose={closeSearchOptionModalHandler}
-        onSwitchExcludingUserPagesInvoked={switchExcludingUnderUserPageHandler}
-        onSwitchExcludingTrashPagesInvoked={switchExcludingUnderTrashPageHandler}
+        onExcludeUserPagesSwitched={switchExcludeUserPagesHandler}
+        onExcludeTrashPagesSwitched={switchExcludeTrashPagesHandler}
         excludeUnderUserPage={props.excludeUnderUserPage}
         excludeUnderUserPage={props.excludeUnderUserPage}
         excludeUnderTrashPage={props.excludeUnderTrashPage}
         excludeUnderTrashPage={props.excludeUnderTrashPage}
       />
       />
@@ -121,7 +121,7 @@ const SearchControl: FC <Props> = (props: Props) => {
                 className="mr-2"
                 className="mr-2"
                 type="checkbox"
                 type="checkbox"
                 id="flexCheckDefault"
                 id="flexCheckDefault"
-                onClick={switchExcludingUnderUserPageHandler}
+                onClick={switchExcludeUserPagesHandler}
               />
               />
               {t('Include Subordinated Target Page', { target: '/user' })}
               {t('Include Subordinated Target Page', { target: '/user' })}
             </label>
             </label>
@@ -132,7 +132,7 @@ const SearchControl: FC <Props> = (props: Props) => {
                 className="mr-2"
                 className="mr-2"
                 type="checkbox"
                 type="checkbox"
                 id="flexCheckChecked"
                 id="flexCheckChecked"
-                onClick={switchExcludingUnderTrashPageHandler}
+                onClick={switchExcludeTrashPagesHandler}
               />
               />
               {t('Include Subordinated Target Page', { target: '/trash' })}
               {t('Include Subordinated Target Page', { target: '/trash' })}
             </label>
             </label>

+ 5 - 5
packages/app/src/components/SearchPage/SearchOptionModal.tsx

@@ -11,8 +11,8 @@ type Props = {
   excludeUnderUserPage: boolean,
   excludeUnderUserPage: boolean,
   excludeUnderTrashPage: boolean,
   excludeUnderTrashPage: boolean,
   onClose?: () => void,
   onClose?: () => void,
-  onSwitchExcludingUserPagesInvoked?: () => void,
-  onSwitchExcludingTrashPagesInvoked?: () => void,
+  onExcludeUserPagesSwitched?: () => void,
+  onExcludeTrashPagesSwitched?: () => void,
   onClickFilteringSearchResult?: () => void,
   onClickFilteringSearchResult?: () => void,
 }
 }
 
 
@@ -44,13 +44,13 @@ const SearchOptionModal: FC<Props> = (props: Props) => {
         Search Option
         Search Option
       </ModalHeader>
       </ModalHeader>
       <ModalBody>
       <ModalBody>
-        <div className="d-flex justify-content-center mr-3">
+        <div className="d-flex p-3">
           <div className="border border-gray mr-3">
           <div className="border border-gray mr-3">
             <label className="px-3 py-2 mb-0 d-flex align-items-center">
             <label className="px-3 py-2 mb-0 d-flex align-items-center">
               <input
               <input
                 className="mr-2"
                 className="mr-2"
                 type="checkbox"
                 type="checkbox"
-                onClick={onSwitchExcludingUserPagesInvoked}
+                onClick={props.onExcludeUserPagesSwitched}
                 checked={!excludeUnderUserPage}
                 checked={!excludeUnderUserPage}
               />
               />
               {t('Include Subordinated Target Page', { target: '/user' })}
               {t('Include Subordinated Target Page', { target: '/user' })}
@@ -61,7 +61,7 @@ const SearchOptionModal: FC<Props> = (props: Props) => {
               <input
               <input
                 className="mr-2"
                 className="mr-2"
                 type="checkbox"
                 type="checkbox"
-                onClick={onSwitchExcludingTrashPagesInvoked}
+                onClick={props.onExcludeTrashPagesSwitched}
                 checked={!excludeUnderTrashPage}
                 checked={!excludeUnderTrashPage}
               />
               />
               {t('Include Subordinated Target Page', { target: '/trash' })}
               {t('Include Subordinated Target Page', { target: '/trash' })}