|
|
|
|
|
|
|
|
setUsersReq, |
|
|
setUsersReq, |
|
|
} from "../../store/actions/users/usersActions"; |
|
|
} from "../../store/actions/users/usersActions"; |
|
|
import { useTheme } from "@mui/system"; |
|
|
import { useTheme } from "@mui/system"; |
|
|
import { Fade, TextField, useMediaQuery } from "@mui/material"; |
|
|
|
|
|
|
|
|
import { Fade, useMediaQuery } from "@mui/material"; |
|
|
// import DialogComponent from "../../components/MUI/DialogComponent"; |
|
|
// import DialogComponent from "../../components/MUI/DialogComponent"; |
|
|
import InviteDialog from "../../components/MUI/InviteDialog"; |
|
|
import InviteDialog from "../../components/MUI/InviteDialog"; |
|
|
// import { Link } from "react-router-dom"; |
|
|
// import { Link } from "react-router-dom"; |
|
|
|
|
|
|
|
|
const { t } = useTranslation(); |
|
|
const { t } = useTranslation(); |
|
|
|
|
|
|
|
|
const handleChangeVisibility = () => { |
|
|
const handleChangeVisibility = () => { |
|
|
setIsSearchFieldVisible(!isSearchFieldVisible); |
|
|
|
|
|
|
|
|
setIsSearchFieldVisible(s=> !s); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
|
|
|
|
|
|
e.stopPropagation(); |
|
|
e.stopPropagation(); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const input = ( |
|
|
|
|
|
|
|
|
const inputNormal = ( |
|
|
<div> |
|
|
<div> |
|
|
<input |
|
|
<input |
|
|
placeholder="Pretrazi..." |
|
|
placeholder="Pretrazi..." |
|
|
value={search} |
|
|
value={search} |
|
|
onChange={(e) => setSearch(e.target.value)} |
|
|
onChange={(e) => setSearch(e.target.value)} |
|
|
className="candidate-search-field" |
|
|
|
|
|
|
|
|
className="ads-search-field" |
|
|
onClick={stopPropagation} |
|
|
onClick={stopPropagation} |
|
|
role="input" |
|
|
|
|
|
|
|
|
style={{ zIndex: 1000 }} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const inputResponsive = ( |
|
|
|
|
|
<div> |
|
|
|
|
|
<input |
|
|
|
|
|
placeholder="Pretrazi..." |
|
|
|
|
|
value={search} |
|
|
|
|
|
onChange={(e) => setSearch(e.target.value)} |
|
|
|
|
|
className="ads-search-field-responsive smaller" |
|
|
|
|
|
onClick={stopPropagation} |
|
|
|
|
|
style={{ zIndex: 1000, width:'300px' }} |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
<div data-testid="users"> |
|
|
<div data-testid="users"> |
|
|
<div className="l-t-rectangle"></div> |
|
|
<div className="l-t-rectangle"></div> |
|
|
<div className="r-b-rectangle"></div> |
|
|
<div className="r-b-rectangle"></div> |
|
|
|
|
|
<div style={{ postion: "absolute" }}> |
|
|
|
|
|
{!matches && ( |
|
|
|
|
|
<> |
|
|
|
|
|
<Fade |
|
|
|
|
|
in={isSearchFieldVisible} |
|
|
|
|
|
timeout={500} |
|
|
|
|
|
className="ads-page-search-by-title" |
|
|
|
|
|
> |
|
|
|
|
|
{inputNormal} |
|
|
|
|
|
</Fade> |
|
|
|
|
|
<Fade in={isSearchFieldVisible} timeout={500}> |
|
|
|
|
|
<div |
|
|
|
|
|
style={{ |
|
|
|
|
|
position: "absolute", |
|
|
|
|
|
zIndex: 10000, |
|
|
|
|
|
marginTop: 52.5, |
|
|
|
|
|
right: "87.5px", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<img src={searchImage} /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</Fade> |
|
|
|
|
|
</> |
|
|
|
|
|
)} |
|
|
|
|
|
{matches && ( |
|
|
|
|
|
<> |
|
|
|
|
|
<Fade in={isSearchFieldVisible} timeout={500}> |
|
|
|
|
|
{inputResponsive} |
|
|
|
|
|
</Fade> |
|
|
|
|
|
<Fade in={isSearchFieldVisible} timeout={500}> |
|
|
|
|
|
<div |
|
|
|
|
|
style={{ |
|
|
|
|
|
position: "absolute", |
|
|
|
|
|
zIndex: 10000, |
|
|
|
|
|
marginTop: 47.5, |
|
|
|
|
|
right: "26px", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<img src={searchImage} /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</Fade> |
|
|
|
|
|
</> |
|
|
|
|
|
)} |
|
|
|
|
|
</div> |
|
|
<ConfirmDialog |
|
|
<ConfirmDialog |
|
|
open={showConfirm} |
|
|
open={showConfirm} |
|
|
title={"Disable user"} |
|
|
title={"Disable user"} |
|
|
|
|
|
|
|
|
/> |
|
|
/> |
|
|
<div> |
|
|
<div> |
|
|
<div |
|
|
<div |
|
|
|
|
|
onClick={handleChangeVisibility} |
|
|
className="pl-144 flex-center" |
|
|
className="pl-144 flex-center" |
|
|
style={{ |
|
|
style={{ |
|
|
paddingTop: "36px", |
|
|
paddingTop: "36px", |
|
|
|
|
|
|
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<h1 className="page-heading">{t("users.management")}</h1> |
|
|
<h1 className="page-heading">{t("users.management")}</h1> |
|
|
<Fade in={isSearchFieldVisible} timeout={500} className="proba"> |
|
|
|
|
|
{input} |
|
|
|
|
|
</Fade> |
|
|
|
|
|
<Fade in={isSearchFieldVisible} timeout={500}> |
|
|
|
|
|
<div |
|
|
|
|
|
style={{ |
|
|
|
|
|
position: "absolute", |
|
|
|
|
|
zIndex: 10000, |
|
|
|
|
|
right: 95, |
|
|
|
|
|
marginTop: 15, |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<img src={searchImage} /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</Fade> |
|
|
|
|
|
<div className="flex-center"> |
|
|
<div className="flex-center"> |
|
|
{/* <button></button> */} |
|
|
{/* <button></button> */} |
|
|
<EditButton |
|
|
<EditButton |
|
|
|
|
|
|
|
|
setEdit((s) => !s); |
|
|
setEdit((s) => !s); |
|
|
}} |
|
|
}} |
|
|
/> |
|
|
/> |
|
|
<div style={{ display: "none" }}> |
|
|
|
|
|
<IconButton |
|
|
|
|
|
className="c-btn c-btn--primary-outlined candidate-btn" |
|
|
|
|
|
onClick={handleChangeVisibility} |
|
|
|
|
|
> |
|
|
|
|
|
Pretraga |
|
|
|
|
|
<img |
|
|
|
|
|
src={searchImage} |
|
|
|
|
|
alt="filter" |
|
|
|
|
|
className="candidates-image" |
|
|
|
|
|
/> |
|
|
|
|
|
</IconButton> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<IconButton |
|
|
|
|
|
className={ |
|
|
|
|
|
"c-btn--primary-outlined c-btn ads-page-btn userPageBtn ml-20px no-padding" |
|
|
|
|
|
} |
|
|
|
|
|
onClick={handleChangeVisibility} |
|
|
|
|
|
> |
|
|
|
|
|
{!matches && "Pretraga"} |
|
|
|
|
|
<img |
|
|
|
|
|
style={{ |
|
|
|
|
|
position: "relative", |
|
|
|
|
|
top: -0.25, |
|
|
|
|
|
paddingLeft: matches ? "0px" : "10px", |
|
|
|
|
|
}} |
|
|
|
|
|
src={searchImage} |
|
|
|
|
|
/> |
|
|
|
|
|
</IconButton> |
|
|
<IconButton |
|
|
<IconButton |
|
|
className={"c-btn--primary c-btn inviteBtn"} |
|
|
className={"c-btn--primary c-btn inviteBtn"} |
|
|
onClick={() => { |
|
|
onClick={() => { |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div |
|
|
<div |
|
|
className="pl-144" |
|
|
className="pl-144" |
|
|
|
|
|
onClick={handleChangeVisibility} |
|
|
style={{ |
|
|
style={{ |
|
|
display: "flex", |
|
|
display: "flex", |
|
|
marginTop: "39px", |
|
|
marginTop: "39px", |
|
|
|
|
|
|
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<div className="table-cont"> |
|
|
<div className="table-cont"> |
|
|
<TextField |
|
|
|
|
|
name="username" |
|
|
|
|
|
label={t("common.labelUsername")} |
|
|
|
|
|
margin="normal" |
|
|
|
|
|
value={search} |
|
|
|
|
|
onChange={(e) => setSearch(e.target.value)} |
|
|
|
|
|
style={{ |
|
|
|
|
|
width: editEnable ? "960px" : "720px", |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
<table |
|
|
<table |
|
|
className={ |
|
|
className={ |
|
|
editEnable ? "usersTable-users normal" : "usersTable-users mini" |
|
|
editEnable ? "usersTable-users normal" : "usersTable-users mini" |
|
|
|
|
|
|
|
|
src={forbiden} |
|
|
src={forbiden} |
|
|
/> |
|
|
/> |
|
|
</IconButton> |
|
|
</IconButton> |
|
|
<IconButton |
|
|
|
|
|
onClick={()=>{ |
|
|
|
|
|
props.history.push(`/users/${n.id}`) |
|
|
|
|
|
|
|
|
<IconButton |
|
|
|
|
|
onClick={() => { |
|
|
|
|
|
props.history.push(`/users/${n.id}`); |
|
|
}} |
|
|
}} |
|
|
className={ |
|
|
|
|
|
"c-btn--primary-outlined c-btn td-btn" |
|
|
|
|
|
} |
|
|
|
|
|
> |
|
|
|
|
|
<img |
|
|
|
|
|
style={{ |
|
|
|
|
|
position: "relative", |
|
|
|
|
|
}} |
|
|
|
|
|
src={edit} |
|
|
|
|
|
/> |
|
|
|
|
|
</IconButton> |
|
|
|
|
|
|
|
|
className={"c-btn--primary-outlined c-btn td-btn"} |
|
|
|
|
|
> |
|
|
|
|
|
<img |
|
|
|
|
|
style={{ |
|
|
|
|
|
position: "relative", |
|
|
|
|
|
}} |
|
|
|
|
|
src={edit} |
|
|
|
|
|
/> |
|
|
|
|
|
</IconButton> |
|
|
</> |
|
|
</> |
|
|
</td> |
|
|
</td> |
|
|
)} |
|
|
)} |