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

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

@@ -213,7 +213,7 @@ class SearchPage extends React.Component {
         activePage={this.state.activePage}
         activePage={this.state.activePage}
         pagingLimit={this.state.pagingLimit}
         pagingLimit={this.state.pagingLimit}
         onClickInvoked={this.selectPage}
         onClickInvoked={this.selectPage}
-        onChangedInvoked={this.toggleCheckBox}
+        toggleCheckBox={this.toggleCheckBox}
         onPagingNumberChanged={this.onPagingNumberChanged}
         onPagingNumberChanged={this.onPagingNumberChanged}
       />
       />
     );
     );

+ 2 - 1
packages/app/src/components/SearchPage/SearchResultList.jsx

@@ -16,6 +16,7 @@ class SearchResultList extends React.Component {
             <SearchResultListItem
             <SearchResultListItem
               page={page}
               page={page}
               onClickInvoked={this.props.onClickInvoked}
               onClickInvoked={this.props.onClickInvoked}
+              toggleCheckBox={this.props.toggleCheckBox}
               noLink
               noLink
             />
             />
           );
           );
@@ -44,7 +45,7 @@ SearchResultList.propTypes = {
   activePage: PropTypes.number.isRequired,
   activePage: PropTypes.number.isRequired,
   pagingLimit: PropTypes.number,
   pagingLimit: PropTypes.number,
   onClickInvoked: PropTypes.func,
   onClickInvoked: PropTypes.func,
-  onChangeInvoked: PropTypes.func,
+  toggleCheckBox: PropTypes.func.isRequired,
   onPagingNumberChanged: PropTypes.func,
   onPagingNumberChanged: PropTypes.func,
 };
 };
 
 

+ 16 - 2
packages/app/src/components/SearchPage/SearchResultListItem.tsx

@@ -18,11 +18,20 @@ type Props ={
     }
     }
   },
   },
   onClickInvoked: (data: string) => void,
   onClickInvoked: (data: string) => void,
+  toggleCheckBox: (page: {
+    _id: string,
+    path: string,
+    noLink: boolean,
+    lastUpdateUser: any
+    elasticSearchResult: {
+      snippet: string,
+    }
+  }) => void,
 }
 }
 
 
 const SearchResultListItem: FC<Props> = (props:Props) => {
 const SearchResultListItem: FC<Props> = (props:Props) => {
 
 
-  const { page, onClickInvoked } = props;
+  const { page, onClickInvoked, toggleCheckBox } = props;
 
 
   // Add prefix 'id_' in pageId, because scrollspy of bootstrap doesn't work when the first letter of id attr of target component is numeral.
   // Add prefix 'id_' in pageId, because scrollspy of bootstrap doesn't work when the first letter of id attr of target component is numeral.
   const pageId = `#${page._id}`;
   const pageId = `#${page._id}`;
@@ -52,7 +61,12 @@ const SearchResultListItem: FC<Props> = (props:Props) => {
         <div className="d-flex">
         <div className="d-flex">
           {/* checkbox */}
           {/* checkbox */}
           <div className="form-check my-auto mx-2">
           <div className="form-check my-auto mx-2">
-            <input className="form-check-input my-auto" type="checkbox" value="" id="flexCheckDefault" />
+            <input
+              className="form-check-input my-auto"
+              type="checkbox"
+              id="flexCheckDefault"
+              onClick={() => { toggleCheckBox(page) }}
+            />
           </div>
           </div>
           <div className="w-100">
           <div className="w-100">
             {/* page path */}
             {/* page path */}