fix clear history and hide filter icon
This commit is contained in:
@ -20,17 +20,17 @@ const ListToolbar = () => {
|
|||||||
onChange={(event) => table.getColumn('name')?.setFilterValue(event.target.value)}
|
onChange={(event) => table.getColumn('name')?.setFilterValue(event.target.value)}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<DefaultTooltip title={'Filter'} placement={'top'}>
|
{/* <DefaultTooltip title={'Filter'} placement={'top'}>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="h-7.5 disabled:bg-gray-400"
|
className="h-7.5 disabled:bg-gray-400"
|
||||||
// disabled={isLoading}
|
// disabled={isLoading}
|
||||||
// onClick={handleFilterData}
|
// onClick={handleFilterData}
|
||||||
>
|
>
|
||||||
{/* {loadingButton === 'filter' ? <ContentLoader /> : <KeenIcon icon="filter" />} */}
|
{loadingButton === 'filter' ? <ContentLoader /> : <KeenIcon icon="filter" />}
|
||||||
<KeenIcon icon="filter" />
|
<KeenIcon icon="filter" />
|
||||||
</Button>
|
</Button>
|
||||||
</DefaultTooltip>
|
</DefaultTooltip> */}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-3 items-center">
|
<div className="flex gap-3 items-center">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@ -35,16 +35,22 @@ const EditDialog = () => {
|
|||||||
show: false,
|
show: false,
|
||||||
message: ''
|
message: ''
|
||||||
});
|
});
|
||||||
const [formField, setFormField] = useState({
|
const initialState = {
|
||||||
name: '',
|
name: '',
|
||||||
username: '',
|
username: '',
|
||||||
email: '',
|
email: '',
|
||||||
id_role: '',
|
id_role: '',
|
||||||
id_role_old: '',
|
id_role_old: '',
|
||||||
status: ''
|
status: ''
|
||||||
});
|
};
|
||||||
|
const [formField, setFormField] = useState(initialState);
|
||||||
|
|
||||||
/* actions */
|
/* actions */
|
||||||
|
const doResetForm = () => {
|
||||||
|
setAlert({ show: false, message: '' });
|
||||||
|
setFormField(initialState);
|
||||||
|
};
|
||||||
|
|
||||||
const doUpdateUser = useCallback(
|
const doUpdateUser = useCallback(
|
||||||
async (e: React.FormEvent<HTMLFormElement>) => {
|
async (e: React.FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@ -103,6 +109,12 @@ const EditDialog = () => {
|
|||||||
}
|
}
|
||||||
}, [selectedUser]);
|
}, [selectedUser]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (showEditDialog === false) {
|
||||||
|
doResetForm();
|
||||||
|
}
|
||||||
|
}, [showEditDialog]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={showEditDialog} onOpenChange={(open) => handleEditDialog(open, null)}>
|
<Dialog open={showEditDialog} onOpenChange={(open) => handleEditDialog(open, null)}>
|
||||||
<DialogContent className="container-fixed max-w-[768px] flex flex-col p-5 overflow-hidden [&>button]:hidden">
|
<DialogContent className="container-fixed max-w-[768px] flex flex-col p-5 overflow-hidden [&>button]:hidden">
|
||||||
|
|||||||
@ -22,17 +22,17 @@ const ListToolBar = () => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<DefaultTooltip title={'Filter'} placement={'top'}>
|
{/* <DefaultTooltip title={'Filter'} placement={'top'}>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="h-7.5 disabled:bg-gray-400"
|
className="h-7.5 disabled:bg-gray-400"
|
||||||
// disabled={isLoading}
|
// disabled={isLoading}
|
||||||
// onClick={handleFilterData}
|
// onClick={handleFilterData}
|
||||||
>
|
>
|
||||||
{/* {loadingButton === 'filter' ? <ContentLoader /> : <KeenIcon icon="filter" />} */}
|
{loadingButton === 'filter' ? <ContentLoader /> : <KeenIcon icon="filter" />}
|
||||||
<KeenIcon icon="filter" />
|
<KeenIcon icon="filter" />
|
||||||
</Button>
|
</Button>
|
||||||
</DefaultTooltip>
|
</DefaultTooltip> */}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-3 items-center">
|
<div className="flex gap-3 items-center">
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user