itizawa 6 年 前
コミット
29e8e78816

+ 11 - 11
src/client/js/components/Admin/UserGroupDetail/UserGroupUserModal.jsx

@@ -23,30 +23,30 @@ class UserGroupUserModal extends React.Component {
           <div className="row mt-4">
           <div className="row mt-4">
             <div className="col-xs-12">
             <div className="col-xs-12">
               <legend>検索時に有効にする</legend>
               <legend>検索時に有効にする</legend>
-              <div className="col-xs-6 my-1" key="isEmailForSearchEnabled">
+              <div className="col-xs-6 my-1" key="isAlsoMailSearched">
                 <div className="checkbox checkbox-info">
                 <div className="checkbox checkbox-info">
                   <input
                   <input
                     type="checkbox"
                     type="checkbox"
-                    id="isEmailForSearchEnabled"
+                    id="isAlsoMailSearched"
                     className="form-check-input"
                     className="form-check-input"
-                    checked={userGroupDetailContainer.state.isEmailForSearchEnabled}
-                    onChange={userGroupDetailContainer.switchIsEmailEnabled}
+                    checked={userGroupDetailContainer.state.isAlsoMailSearched}
+                    onChange={userGroupDetailContainer.switchIsAlsoMailSearched}
                   />
                   />
-                  <label className="text-capitalize form-check-label ml-3" htmlFor="isEmailForSearchEnabled">
-                    Email
+                  <label className="text-capitalize form-check-label ml-3" htmlFor="isAlsoMailSearched">
+                    Mail
                   </label>
                   </label>
                 </div>
                 </div>
               </div>
               </div>
-              <div className="col-xs-6 my-1" key="isNameForSearchEnabled">
+              <div className="col-xs-6 my-1" key="isAlsoNameSearched">
                 <div className="checkbox checkbox-info">
                 <div className="checkbox checkbox-info">
                   <input
                   <input
                     type="checkbox"
                     type="checkbox"
-                    id="isNameForSearchEnabled"
+                    id="isAlsoNameSearched"
                     className="form-check-input"
                     className="form-check-input"
-                    checked={userGroupDetailContainer.state.isNameForSearchEnabled}
-                    onChange={userGroupDetailContainer.switchIsEmailEnabled}
+                    checked={userGroupDetailContainer.state.isAlsoNameSearched}
+                    onChange={userGroupDetailContainer.switchIsAlsoNameSearched}
                   />
                   />
-                  <label className="text-capitalize form-check-label ml-3" htmlFor="isNameForSearchEnabled">
+                  <label className="text-capitalize form-check-label ml-3" htmlFor="isAlsoNameSearched">
                     Name
                     Name
                   </label>
                   </label>
                 </div>
                 </div>

+ 20 - 2
src/client/js/services/UserGroupDetailContainer.js

@@ -24,10 +24,14 @@ export default class UserGroupDetailContainer extends Container {
       userGroupRelations: [],
       userGroupRelations: [],
       relatedPages: [],
       relatedPages: [],
       isUserGroupUserModalOpen: false,
       isUserGroupUserModalOpen: false,
+      isAlsoMailSearched: false,
+      isAlsoNameSearched: false,
     };
     };
 
 
     this.init();
     this.init();
 
 
+    this.switchIsAlsoMailSearched = this.switchIsAlsoMailSearched.bind(this);
+    this.switchIsAlsoNameSearched = this.switchIsAlsoNameSearched.bind(this);
     this.openUserGroupUserModal = this.openUserGroupUserModal.bind(this);
     this.openUserGroupUserModal = this.openUserGroupUserModal.bind(this);
     this.closeUserGroupUserModal = this.closeUserGroupUserModal.bind(this);
     this.closeUserGroupUserModal = this.closeUserGroupUserModal.bind(this);
     this.addUserByUsername = this.addUserByUsername.bind(this);
     this.addUserByUsername = this.addUserByUsername.bind(this);
@@ -65,6 +69,20 @@ export default class UserGroupDetailContainer extends Container {
     }
     }
   }
   }
 
 
+  /**
+   * switch isAlsoMailSearched
+   */
+  switchIsAlsoMailSearched() {
+    this.setState({ isAlsoMailSearched: !this.state.isAlsoMailSearched });
+  }
+
+  /**
+   * switch isAlsoNameSearched
+   */
+  switchIsAlsoNameSearched() {
+    this.setState({ isAlsoNameSearched: !this.state.isAlsoNameSearched });
+  }
+
   /**
   /**
    * update user group
    * update user group
    *
    *
@@ -108,8 +126,8 @@ export default class UserGroupDetailContainer extends Container {
       searchWord,
       searchWord,
       // TODO GW-716 switch value
       // TODO GW-716 switch value
       isForwardMatch: false,
       isForwardMatch: false,
-      isAlsoNameSearched: false,
-      isAlsoMailSearched: false,
+      isAlsoMailSearched: this.state.isAlsoMailSearched,
+      isAlsoNameSearched: this.state.isAlsoNameSearched,
     });
     });
 
 
     const { users } = res.data;
     const { users } = res.data;