|
@@ -9,9 +9,6 @@ import AdminUserGroupDetailContainer from '~/client/services/AdminUserGroupDetai
|
|
|
import { IUserGroupHasId } from '~/interfaces/user';
|
|
import { IUserGroupHasId } from '~/interfaces/user';
|
|
|
import { SearchTypes, SearchType } from '~/interfaces/user-group';
|
|
import { SearchTypes, SearchType } from '~/interfaces/user-group';
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-import { withUnstatedContainers } from '../../UnstatedUtils';
|
|
|
|
|
-
|
|
|
|
|
import CheckBoxForSerchUserOption from './CheckBoxForSerchUserOption';
|
|
import CheckBoxForSerchUserOption from './CheckBoxForSerchUserOption';
|
|
|
import RadioButtonForSerchUserOption from './RadioButtonForSerchUserOption';
|
|
import RadioButtonForSerchUserOption from './RadioButtonForSerchUserOption';
|
|
|
import UserGroupUserFormByInput from './UserGroupUserFormByInput';
|
|
import UserGroupUserFormByInput from './UserGroupUserFormByInput';
|
|
@@ -21,16 +18,30 @@ type Props = {
|
|
|
adminUserGroupDetailContainer: AdminUserGroupDetailContainer,
|
|
adminUserGroupDetailContainer: AdminUserGroupDetailContainer,
|
|
|
userGroup: IUserGroupHasId,
|
|
userGroup: IUserGroupHasId,
|
|
|
searchType: SearchType,
|
|
searchType: SearchType,
|
|
|
|
|
+ isAlsoMailSearched: boolean,
|
|
|
|
|
+ isAlsoNameSearched: boolean,
|
|
|
onClickAddUserBtn: () => void,
|
|
onClickAddUserBtn: () => void,
|
|
|
onSearchApplicableUsers: () => void,
|
|
onSearchApplicableUsers: () => void,
|
|
|
- onChangeSearchType: (searchType: SearchType) => void
|
|
|
|
|
|
|
+ onSwitchSearchType: (searchType: SearchType) => void
|
|
|
onClose: () => void,
|
|
onClose: () => void,
|
|
|
|
|
+ onToggleIsAlsoMailSearched: () => void,
|
|
|
|
|
+ onToggleIsAlsoNameSearched: () => void,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const UserGroupUserModal = (props: Props) => {
|
|
|
|
|
|
|
+export const UserGroupUserModal = (props: Props): JSX.Element => {
|
|
|
const { t } = useTranslation();
|
|
const { t } = useTranslation();
|
|
|
const {
|
|
const {
|
|
|
- isOpen, adminUserGroupDetailContainer, userGroup, searchType, onClickAddUserBtn, onSearchApplicableUsers, onChangeSearchType, onClose,
|
|
|
|
|
|
|
+ isOpen,
|
|
|
|
|
+ userGroup,
|
|
|
|
|
+ searchType,
|
|
|
|
|
+ onClickAddUserBtn,
|
|
|
|
|
+ onSearchApplicableUsers,
|
|
|
|
|
+ onSwitchSearchType,
|
|
|
|
|
+ onClose,
|
|
|
|
|
+ isAlsoMailSearched,
|
|
|
|
|
+ isAlsoNameSearched,
|
|
|
|
|
+ onToggleIsAlsoMailSearched,
|
|
|
|
|
+ onToggleIsAlsoNameSearched,
|
|
|
} = props;
|
|
} = props;
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
@@ -49,15 +60,15 @@ const UserGroupUserModal = (props: Props) => {
|
|
|
<div className="mb-5">
|
|
<div className="mb-5">
|
|
|
<CheckBoxForSerchUserOption
|
|
<CheckBoxForSerchUserOption
|
|
|
option="mail"
|
|
option="mail"
|
|
|
- checked={adminUserGroupDetailContainer.state.isAlsoMailSearched}
|
|
|
|
|
- onChange={adminUserGroupDetailContainer.switchIsAlsoMailSearched}
|
|
|
|
|
|
|
+ checked={isAlsoMailSearched}
|
|
|
|
|
+ onChange={onToggleIsAlsoMailSearched}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div className="mb-5">
|
|
<div className="mb-5">
|
|
|
<CheckBoxForSerchUserOption
|
|
<CheckBoxForSerchUserOption
|
|
|
option="name"
|
|
option="name"
|
|
|
- checked={adminUserGroupDetailContainer.state.isAlsoNameSearched}
|
|
|
|
|
- onChange={adminUserGroupDetailContainer.switchIsAlsoNameSearched}
|
|
|
|
|
|
|
+ checked={isAlsoNameSearched}
|
|
|
|
|
+ onChange={onToggleIsAlsoNameSearched}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -66,21 +77,21 @@ const UserGroupUserModal = (props: Props) => {
|
|
|
<RadioButtonForSerchUserOption
|
|
<RadioButtonForSerchUserOption
|
|
|
searchType="forward"
|
|
searchType="forward"
|
|
|
checked={searchType === SearchTypes.FORWARD}
|
|
checked={searchType === SearchTypes.FORWARD}
|
|
|
- onChange={() => onChangeSearchType(SearchTypes.FORWARD)}
|
|
|
|
|
|
|
+ onChange={() => onSwitchSearchType(SearchTypes.FORWARD)}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div className="mb-5">
|
|
<div className="mb-5">
|
|
|
<RadioButtonForSerchUserOption
|
|
<RadioButtonForSerchUserOption
|
|
|
searchType="partial"
|
|
searchType="partial"
|
|
|
checked={searchType === SearchTypes.PARTIAL}
|
|
checked={searchType === SearchTypes.PARTIAL}
|
|
|
- onChange={() => onChangeSearchType(SearchTypes.PARTIAL)}
|
|
|
|
|
|
|
+ onChange={() => onSwitchSearchType(SearchTypes.PARTIAL)}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div className="mb-5">
|
|
<div className="mb-5">
|
|
|
<RadioButtonForSerchUserOption
|
|
<RadioButtonForSerchUserOption
|
|
|
searchType="backward"
|
|
searchType="backward"
|
|
|
checked={searchType === SearchTypes.BACKWORD}
|
|
checked={searchType === SearchTypes.BACKWORD}
|
|
|
- onChange={() => onChangeSearchType(SearchTypes.BACKWORD)}
|
|
|
|
|
|
|
+ onChange={() => onSwitchSearchType(SearchTypes.BACKWORD)}
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -89,10 +100,3 @@ const UserGroupUserModal = (props: Props) => {
|
|
|
</Modal>
|
|
</Modal>
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * Wrapper component for using unstated
|
|
|
|
|
- */
|
|
|
|
|
-const UserGroupUserModalWrapper = withUnstatedContainers(UserGroupUserModal, [AdminUserGroupDetailContainer]);
|
|
|
|
|
-
|
|
|
|
|
-export default UserGroupUserModalWrapper;
|
|
|