| @@ -7,7 +7,7 @@ import { | |||||
| } from '@mui/material'; | } from '@mui/material'; | ||||
| import MainCard from "components/MainCard"; | import MainCard from "components/MainCard"; | ||||
| import { useForm } from "react-hook-form"; | import { useForm } from "react-hook-form"; | ||||
| import { useState } from "react"; | |||||
| import { useState,useEffect } from "react"; | |||||
| import {PNSPS_BUTTON_THEME} from "themes/buttonConst"; | import {PNSPS_BUTTON_THEME} from "themes/buttonConst"; | ||||
| import {ThemeProvider} from "@emotion/react"; | import {ThemeProvider} from "@emotion/react"; | ||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -16,15 +16,22 @@ import {ThemeProvider} from "@emotion/react"; | |||||
| const UserSearchForm_Individual = ({ applySearch, onGridReady, searchCriteria }) => { | const UserSearchForm_Individual = ({ applySearch, onGridReady, searchCriteria }) => { | ||||
| const [type, setType] = useState([]); | const [type, setType] = useState([]); | ||||
| const [accountFilter, setAccountFilter] = useState(() => { | |||||
| if (searchCriteria.accountFilter != undefined && searchCriteria.accountFilter !== "") { | |||||
| return searchCriteria.accountFilter; | |||||
| } | |||||
| return "All"; | |||||
| }); | |||||
| const [accountFilter, setAccountFilter] = useState("All"); | |||||
| const { reset, register, handleSubmit } = useForm() | const { reset, register, handleSubmit } = useForm() | ||||
| useEffect(() => { | |||||
| if(searchCriteria.accountFilter!=undefined){ | |||||
| if(searchCriteria.accountFilter === ""){ | |||||
| setAccountFilter("All") | |||||
| }else{ | |||||
| setAccountFilter(searchCriteria.accountFilter) | |||||
| } | |||||
| }else{ | |||||
| setAccountFilter("All") | |||||
| } | |||||
| }, [searchCriteria]); | |||||
| const onSubmit = (data) => { | const onSubmit = (data) => { | ||||
| let typeArray = []; | let typeArray = []; | ||||
| @@ -45,15 +52,6 @@ const UserSearchForm_Individual = ({ applySearch, onGridReady, searchCriteria }) | |||||
| applySearch(temp); | applySearch(temp); | ||||
| }; | }; | ||||
| function onToBeVerified() { | |||||
| applySearch({ | |||||
| accountFilter: "Not Verified", | |||||
| descOrder: true, | |||||
| start: 0, | |||||
| limit: 10 | |||||
| }); | |||||
| } | |||||
| function resetForm() { | function resetForm() { | ||||
| setType([]); | setType([]); | ||||
| setAccountFilter("All"); | setAccountFilter("All"); | ||||
| @@ -180,22 +178,9 @@ const UserSearchForm_Individual = ({ applySearch, onGridReady, searchCriteria }) | |||||
| <Grid container maxWidth justifyContent="flex-end"> | <Grid container maxWidth justifyContent="flex-end"> | ||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
| <Grid item sx={{ ml: 3, mr: 3, mb: 3 }}> | <Grid item sx={{ ml: 3, mr: 3, mb: 3 }}> | ||||
| <Button | |||||
| variant="contained" | |||||
| color="edit" | |||||
| type="button" | |||||
| onClick={onToBeVerified} | |||||
| disabled={onGridReady} | |||||
| > | |||||
| To be verified | |||||
| </Button> | |||||
| </Grid> | |||||
| <Grid item sx={{ mr: 3, mb: 3 }}> | |||||
| <Button | <Button | ||||
| variant="contained" | variant="contained" | ||||
| color="cancel" | color="cancel" | ||||
| type="button" | |||||
| onClick={resetForm} | onClick={resetForm} | ||||
| > | > | ||||
| Reset | Reset | ||||
| @@ -91,18 +91,6 @@ export default function UserTable_Individual({ searchCriteria, applyGridOnReady, | |||||
| flex: 1, | flex: 1, | ||||
| minWidth: 150, | minWidth: 150, | ||||
| }, | }, | ||||
| { | |||||
| id: 'created', | |||||
| field: 'created', | |||||
| headerName: 'Created Date', | |||||
| flex: 1, | |||||
| minWidth: 200, | |||||
| valueGetter: (params) => { | |||||
| if (params.value) { | |||||
| return DateUtils.datetimeStr(params.value); | |||||
| } | |||||
| } | |||||
| }, | |||||
| { | { | ||||
| id: 'lastLogin', | id: 'lastLogin', | ||||
| field: 'lastLogin', | field: 'lastLogin', | ||||
| @@ -9,7 +9,7 @@ import MainCard from "../../../components/MainCard"; | |||||
| import OrgComboAutocomplete from "../../../components/OrgComboAutocomplete"; | import OrgComboAutocomplete from "../../../components/OrgComboAutocomplete"; | ||||
| import {useForm} from "react-hook-form"; | import {useForm} from "react-hook-form"; | ||||
| import { useState } from "react"; | |||||
| import { useState, useEffect} from "react"; | |||||
| import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; | ||||
| import {ThemeProvider} from "@emotion/react"; | import {ThemeProvider} from "@emotion/react"; | ||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | // ==============================|| DASHBOARD - DEFAULT ||============================== // | ||||
| @@ -18,15 +18,22 @@ import {ThemeProvider} from "@emotion/react"; | |||||
| const UserSearchForm_Organization = ({applySearch, onGridReady, searchCriteria}) => { | const UserSearchForm_Organization = ({applySearch, onGridReady, searchCriteria}) => { | ||||
| const [type, setType] = useState([]); | const [type, setType] = useState([]); | ||||
| const [accountFilter, setAccountFilter] = useState(() => { | |||||
| if (searchCriteria.accountFilter != undefined && searchCriteria.accountFilter !== "") { | |||||
| return searchCriteria.accountFilter; | |||||
| } | |||||
| return "All"; | |||||
| }); | |||||
| const [accountFilter, setAccountFilter] = useState("All"); | |||||
| const [orgSelected, setOrgSelected] = useState({}); | const [orgSelected, setOrgSelected] = useState({}); | ||||
| const { reset, register, handleSubmit } = useForm() | const { reset, register, handleSubmit } = useForm() | ||||
| useEffect(() => { | |||||
| if(searchCriteria.accountFilter!=undefined){ | |||||
| if(searchCriteria.accountFilter === ""){ | |||||
| setAccountFilter("All") | |||||
| }else{ | |||||
| setAccountFilter(searchCriteria.accountFilter) | |||||
| } | |||||
| }else{ | |||||
| setAccountFilter("All") | |||||
| } | |||||
| }, [searchCriteria]); | |||||
| const onSubmit = (data) => { | const onSubmit = (data) => { | ||||
| @@ -51,15 +58,6 @@ const UserSearchForm_Organization = ({applySearch, onGridReady, searchCriteria}) | |||||
| applySearch(temp); | applySearch(temp); | ||||
| }; | }; | ||||
| function onToBeVerified() { | |||||
| applySearch({ | |||||
| accountFilter: "Not Verified", | |||||
| descOrder: true, | |||||
| start: 0, | |||||
| limit: 10 | |||||
| }); | |||||
| } | |||||
| function resetForm(){ | function resetForm(){ | ||||
| setType([]); | setType([]); | ||||
| setAccountFilter("All"); | setAccountFilter("All"); | ||||
| @@ -213,22 +211,9 @@ const UserSearchForm_Organization = ({applySearch, onGridReady, searchCriteria}) | |||||
| <Grid container maxWidth justifyContent="flex-end"> | <Grid container maxWidth justifyContent="flex-end"> | ||||
| <ThemeProvider theme={PNSPS_BUTTON_THEME}> | <ThemeProvider theme={PNSPS_BUTTON_THEME}> | ||||
| <Grid item sx={{ml:3, mr:3, mb:3}}> | <Grid item sx={{ml:3, mr:3, mb:3}}> | ||||
| <Button | |||||
| variant="contained" | |||||
| color="edit" | |||||
| type="button" | |||||
| onClick={onToBeVerified} | |||||
| disabled={onGridReady} | |||||
| > | |||||
| To be verified | |||||
| </Button> | |||||
| </Grid> | |||||
| <Grid item sx={{mr:3, mb:3}}> | |||||
| <Button | <Button | ||||
| variant="contained" | variant="contained" | ||||
| color="cancel" | color="cancel" | ||||
| type="button" | |||||
| onClick={resetForm} | onClick={resetForm} | ||||
| > | > | ||||
| Reset | Reset | ||||
| @@ -85,18 +85,6 @@ export default function UserTable_Organization({searchCriteria, applyGridOnReady | |||||
| flex: 1, | flex: 1, | ||||
| minWidth: 150, | minWidth: 150, | ||||
| }, | }, | ||||
| { | |||||
| id: 'created', | |||||
| field: 'created', | |||||
| headerName: 'Created Date', | |||||
| flex: 1, | |||||
| minWidth: 200, | |||||
| valueGetter:(params)=>{ | |||||
| if(params.value){ | |||||
| return DateUtils.datetimeStr(params.value); | |||||
| } | |||||
| } | |||||
| }, | |||||
| { | { | ||||
| id: 'lastLogin', | id: 'lastLogin', | ||||
| field: 'lastLogin', | field: 'lastLogin', | ||||