update title

This commit is contained in:
Wikzyy
2025-04-09 14:28:02 +07:00
parent 01a77f0067
commit c52db0a6e5
21 changed files with 120 additions and 142 deletions

View File

@ -9,11 +9,11 @@ const AldeiasMaster = () => {
return (
<>
<Helmet>
<title>TPAY | Manage Aldeias</title>
<title>TPAY | Manage Aldeia</title>
</Helmet>
<ManageAldeiasContextProvider>
<Container>
<h1 className="text-xl font-medium leading-none text-gray-900 mb-3">Aldeias</h1>
<h1 className="text-xl font-medium leading-none text-gray-900 mb-3">Aldeia</h1>
<Breadcrumbs sx={{ mb: 2 }}>
<Link underline="none" color="inherit" href="/">
<span className="text-sm hover:underline">Dashboard</span>
@ -24,7 +24,7 @@ const AldeiasMaster = () => {
</Link>
<Link underline="none" color="inherit">
<span className="text-sm">Manage Aldeias</span>
<span className="text-sm">Manage Aldeia</span>
</Link>
</Breadcrumbs>

View File

@ -69,18 +69,18 @@ const AddDialog = () => {
if (response?.status) {
resetForm();
handleAddDialog(false);
toast.success('Success Create Aldeias');
toast.success('Success Create Aldeia');
reload();
const createActivity = {
module: 'Manage Aldeias',
module: 'Manage Aldeia',
description: `Create Aldeia => ${formField.name}`,
action: 'C'
};
doSaveLogActivity(createActivity);
} else {
toast.error('Error Create Aldeias');
setAlert({ show: true, message: 'Failed to create Aldeias. Please try again.' });
toast.error('Error Create Aldeia');
setAlert({ show: true, message: 'Failed to create Aldeia. Please try again.' });
}
},
[formField]
@ -100,7 +100,8 @@ const AddDialog = () => {
// console.log('SUCOS', response?.data);
setSucos(response?.data.list);
} catch (error) {
console.error('Error fetching municipios', error);
// console.error('Error fetching Municipio', error);
setAlert({ show: true, message: 'Failed to fetch Municipio. Please try again.' });
}
};
@ -141,7 +142,7 @@ const AddDialog = () => {
<Dialog open={showAddDialog} onOpenChange={(open) => handleAddDialog(open)}>
<DialogContent className="container-fixed max-w-[768px] flex flex-col p-5 overflow-hidden">
<DialogHeader>
<DialogTitle>Aldeias - Create</DialogTitle>
<DialogTitle>Aldeia - Create</DialogTitle>
<DialogDescription></DialogDescription>
</DialogHeader>
<DialogBody ref={parentRef}>
@ -157,7 +158,7 @@ const AddDialog = () => {
<div className="w-full">
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label className="form-label flex items-center gap-1 max-w-56">
Name<span className="text-red-500">*</span>
Aldeia Name<span className="text-red-500">*</span>
</label>
<Input
className="input"
@ -175,10 +176,11 @@ const AddDialog = () => {
</label>
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
<button
type="button"
className="input col-span-5 text-left"
style={{color:'inherit'}}>
<button
type="button"
className="input col-span-5 text-left"
style={{ color: 'inherit' }}
>
{sucos.find((suco) => suco.sucos_id === formField.sucosId)?.sucos_name ||
'Select Sucos'}
</button>

View File

@ -32,11 +32,11 @@ const DeleteDialog = () => {
if (response?.status) {
setAlert({ show: false, message: '' });
handleDeleteDialog(false, null);
toast.success('Success Delete Aldeias');
toast.success('Success Delete Aldeia');
reload();
const createActivity = {
module: 'Manage Aldeias',
module: 'Manage Aldeia',
description: `Delete Aldeia => ${selectedAldeias}`,
action: 'D'
};
@ -44,7 +44,7 @@ const DeleteDialog = () => {
doSaveLogActivity(createActivity);
} else {
setAlert({ show: true, message: response?.message });
toast.error('Failed Delete Aldeias');
toast.error('Failed Delete Aldeia');
}
}, [selectedAldeias, DeleteData, handleDeleteDialog, reload]);

View File

@ -68,18 +68,18 @@ const EditDialog = () => {
if (response?.status) {
resetForm();
handleEditDialog(false, null);
toast.success('Success Update Aldeias');
toast.success('Success Update Aldeia');
reload();
const createActivity = {
module: 'Manage Aldeias',
module: 'Manage Aldeia',
description: `Edit Aldeia => ${selectedAldeias}`,
action: 'U'
};
doSaveLogActivity(createActivity);
} else {
toast.error('Error Update Aldeias');
setAlert({ show: true, message: 'Error Update Aldeias' });
toast.error('Error Update Aldeia');
setAlert({ show: true, message: 'Error Update Aldeia' });
}
},
[selectedAldeias, formField]
@ -99,7 +99,8 @@ const EditDialog = () => {
// console.log('SUCOS', response?.data);
setSucos(response?.data.list);
} catch (error) {
console.error('Error fetching municipios', error);
console.error('Error fetching Sucos', error);
setAlert({ show: true, message: 'Failed to get Sucos. Please try again.' });
}
};
@ -164,7 +165,7 @@ const EditDialog = () => {
<Dialog open={showEditDialog} onOpenChange={(open) => handleEditDialog(open, null)}>
<DialogContent className="container-fixed max-w-[768px] flex flex-col p-5 overflow-hidden">
<DialogHeader>
<DialogTitle>Aldeias - Update</DialogTitle>
<DialogTitle>Aldeia - Update</DialogTitle>
<DialogDescription></DialogDescription>
</DialogHeader>
<DialogBody>
@ -180,7 +181,7 @@ const EditDialog = () => {
<div className="w-full">
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label className="form-label flex items-center gap-1 max-w-56">
Name<span className="text-red-500">*</span>
Aldeia Name<span className="text-red-500">*</span>
</label>
<Input
className="input"

View File

@ -15,7 +15,7 @@ const ListToolbar = () => {
<KeenIcon icon="magnifier" />
<input
type="text"
placeholder="Search Aldeias"
placeholder="Search Aldeia"
value={(table.getColumn('name')?.getFilterValue() as string) ?? ''}
onChange={(event) => table.getColumn('name')?.setFilterValue(event.target.value)}
/>

View File

@ -80,7 +80,7 @@ const ManageAldeiasContextProvider = ({ children }: { children: React.ReactNode
{
accessorFn: (row) => row.name,
id: 'name',
header: ({ column }) => <DataGridColumnHeader title="Name" column={column} />,
header: ({ column }) => <DataGridColumnHeader title="Aldeia Name" column={column} />,
enableSorting: true,
enableHiding: false,
meta: {
@ -90,7 +90,7 @@ const ManageAldeiasContextProvider = ({ children }: { children: React.ReactNode
{
accessorFn: (row) => row.sucos.name,
id: 'sucos_name',
header: ({ column }) => <DataGridColumnHeader title="Sucos" column={column} />,
header: ({ column }) => <DataGridColumnHeader title="Sucos Name" column={column} />,
enableSorting: true,
enableHiding: false,
meta: {