|
@@ -9,18 +9,18 @@ import MainCard from "../../../components/MainCard"; |
|
|
import { useForm } from "react-hook-form"; |
|
|
import { useForm } from "react-hook-form"; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
// useEffect, |
|
|
|
|
|
useState |
|
|
useState |
|
|
} from "react"; |
|
|
} from "react"; |
|
|
|
|
|
|
|
|
import Checkbox from "@mui/material/Checkbox"; |
|
|
import Checkbox from "@mui/material/Checkbox"; |
|
|
import * as React from "react"; |
|
|
|
|
|
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'; |
|
|
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'; |
|
|
import { useNavigate } from "react-router"; |
|
|
import { useNavigate } from "react-router"; |
|
|
import axios from "axios"; |
|
|
import axios from "axios"; |
|
|
import { GET_EMAIL_LIST } from 'utils/ApiPathConst'; |
|
|
import { GET_EMAIL_LIST } from 'utils/ApiPathConst'; |
|
|
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; |
|
|
|
|
|
import {ThemeProvider} from "@emotion/react"; |
|
|
|
|
|
|
|
|
import { PNSPS_BUTTON_THEME } from "../../../themes/buttonConst"; |
|
|
|
|
|
import { ThemeProvider } from "@emotion/react"; |
|
|
|
|
|
|
|
|
|
|
|
import { isGrantedAny } from "auth/utils"; |
|
|
|
|
|
|
|
|
// ==============================|| DASHBOARD - DEFAULT ||============================== // |
|
|
// ==============================|| DASHBOARD - DEFAULT ||============================== // |
|
|
|
|
|
|
|
@@ -57,12 +57,12 @@ const UserSearchForm = ({ applySearch }) => { |
|
|
setLocked(false); |
|
|
setLocked(false); |
|
|
reset(); |
|
|
reset(); |
|
|
axios.get(`${GET_EMAIL_LIST}`) |
|
|
axios.get(`${GET_EMAIL_LIST}`) |
|
|
.then(r => { |
|
|
|
|
|
console.log(r) |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
.then(r => { |
|
|
|
|
|
console.log(r) |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const handleNewUserClick = () => { |
|
|
const handleNewUserClick = () => { |
|
@@ -77,9 +77,9 @@ const UserSearchForm = ({ applySearch }) => { |
|
|
content={false}> |
|
|
content={false}> |
|
|
|
|
|
|
|
|
<form onSubmit={handleSubmit(onSubmit)}> |
|
|
<form onSubmit={handleSubmit(onSubmit)}> |
|
|
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1}} width="98%"> |
|
|
|
|
|
|
|
|
<Grid container sx={{ backgroundColor: '#ffffff', ml: 2, mt: 1 }} width="98%"> |
|
|
{/*row 1*/} |
|
|
{/*row 1*/} |
|
|
<Grid item justifyContent="space-between" alignItems="center" sx={{mt:1,ml:3,mb:2.5}}> |
|
|
|
|
|
|
|
|
<Grid item justifyContent="space-between" alignItems="center" sx={{ mt: 1, ml: 3, mb: 2.5 }}> |
|
|
<Typography variant="pnspsFormHeader" > |
|
|
<Typography variant="pnspsFormHeader" > |
|
|
Search |
|
|
Search |
|
|
</Typography> |
|
|
</Typography> |
|
@@ -87,69 +87,69 @@ const UserSearchForm = ({ applySearch }) => { |
|
|
{/*row 2*/} |
|
|
{/*row 2*/} |
|
|
|
|
|
|
|
|
<Grid container display="flex" alignItems={"center"}> |
|
|
<Grid container display="flex" alignItems={"center"}> |
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("userName")} |
|
|
|
|
|
id='userName' |
|
|
|
|
|
label="Username" |
|
|
|
|
|
InputLabelProps={{ |
|
|
|
|
|
shrink: true |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("userName")} |
|
|
|
|
|
id='userName' |
|
|
|
|
|
label="Username" |
|
|
|
|
|
InputLabelProps={{ |
|
|
|
|
|
shrink: true |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("fullenName")} |
|
|
|
|
|
id="fullenName" |
|
|
|
|
|
label="Full Name" |
|
|
|
|
|
InputLabelProps={{ |
|
|
|
|
|
shrink: true |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("fullenName")} |
|
|
|
|
|
id="fullenName" |
|
|
|
|
|
label="Full Name" |
|
|
|
|
|
InputLabelProps={{ |
|
|
|
|
|
shrink: true |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("post")} |
|
|
|
|
|
id="post" |
|
|
|
|
|
label="Post" |
|
|
|
|
|
InputLabelProps={{ |
|
|
|
|
|
shrink: true |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("post")} |
|
|
|
|
|
id="post" |
|
|
|
|
|
label="Post" |
|
|
|
|
|
InputLabelProps={{ |
|
|
|
|
|
shrink: true |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("email")} |
|
|
|
|
|
id="email" |
|
|
|
|
|
label="Email" |
|
|
|
|
|
InputLabelProps={{ |
|
|
|
|
|
shrink: true |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("email")} |
|
|
|
|
|
id="email" |
|
|
|
|
|
label="Email" |
|
|
|
|
|
InputLabelProps={{ |
|
|
|
|
|
shrink: true |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
|
|
|
<FormControlLabel |
|
|
|
|
|
control={ |
|
|
|
|
|
<Checkbox |
|
|
|
|
|
checked={locked} |
|
|
|
|
|
onChange={(event) => setLocked(event.target.checked)} |
|
|
|
|
|
name="checked" |
|
|
|
|
|
color="primary" |
|
|
|
|
|
size="small" |
|
|
|
|
|
/> |
|
|
|
|
|
} |
|
|
|
|
|
label={<Typography variant="h6">Locked</Typography>} |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<Grid item xs={9} s={6} md={5} lg={3} sx={{ ml: 3, mr: 3, mb: 3 }}> |
|
|
|
|
|
<FormControlLabel |
|
|
|
|
|
control={ |
|
|
|
|
|
<Checkbox |
|
|
|
|
|
checked={locked} |
|
|
|
|
|
onChange={(event) => setLocked(event.target.checked)} |
|
|
|
|
|
name="checked" |
|
|
|
|
|
color="primary" |
|
|
|
|
|
size="small" |
|
|
|
|
|
/> |
|
|
|
|
|
} |
|
|
|
|
|
label={<Typography variant="h6">Locked</Typography>} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
{/*last row*/} |
|
|
{/*last row*/} |
|
|
<Grid container direction="row" |
|
|
<Grid container direction="row" |
|
@@ -157,37 +157,41 @@ const UserSearchForm = ({ applySearch }) => { |
|
|
alignItems="center"> |
|
|
alignItems="center"> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
|
|
|
|
|
|
<Grid item xs={3} md={3} sx={{ ml: 3,mb: 3 }}> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
onClick={handleNewUserClick} |
|
|
|
|
|
startIcon={<AddCircleOutlineIcon/>} |
|
|
|
|
|
> |
|
|
|
|
|
New User |
|
|
|
|
|
</Button> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={8} md={8}> |
|
|
|
|
|
<Grid container maxWidth justifyContent="flex-end"> |
|
|
|
|
|
<Grid item sx={{ ml: 3, mr: 3, mb: 3,}}> |
|
|
|
|
|
|
|
|
{isGrantedAny(["MAINTAIN_USER"]) ? |
|
|
|
|
|
<Grid item xs={3} md={3} sx={{ ml: 3, mb: 3 }}> |
|
|
<Button |
|
|
<Button |
|
|
variant="contained" |
|
|
variant="contained" |
|
|
color="cancel" |
|
|
|
|
|
onClick={resetForm} |
|
|
|
|
|
|
|
|
onClick={handleNewUserClick} |
|
|
|
|
|
startIcon={<AddCircleOutlineIcon />} |
|
|
> |
|
|
> |
|
|
Reset |
|
|
|
|
|
|
|
|
New User |
|
|
</Button> |
|
|
</Button> |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
: <Grid item xs={3} md={3} sx={{ ml: 3, mb: 3 }}></Grid> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
<Grid item sx={{ mb: 3 }}> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
type="submit" |
|
|
|
|
|
> |
|
|
|
|
|
Search |
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
|
<Grid item xs={8} md={8}> |
|
|
|
|
|
<Grid container maxWidth justifyContent="flex-end"> |
|
|
|
|
|
<Grid item sx={{ ml: 3, mr: 3, mb: 3, }}> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
color="cancel" |
|
|
|
|
|
onClick={resetForm} |
|
|
|
|
|
> |
|
|
|
|
|
Reset |
|
|
|
|
|
</Button> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item sx={{ mb: 3 }}> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
type="submit" |
|
|
|
|
|
> |
|
|
|
|
|
Search |
|
|
|
|
|
</Button> |
|
|
|
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
</ThemeProvider> |
|
|
</ThemeProvider> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|