mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
feat(FE-279): Add functionality closing project flock
This commit is contained in:
@@ -48,6 +48,8 @@ import ProjectFlockKandangTable from '@/components/pages/production/project-floc
|
||||
import { Nonstock } from '@/types/api/master-data/nonstock';
|
||||
import { useUiStore } from '@/stores/ui/ui.store';
|
||||
import Link from 'next/link';
|
||||
import DrawerHeader from '@/components/helper/drawer/DrawerHeader';
|
||||
import { formatDate } from '@/lib/helper';
|
||||
|
||||
interface ProjectFlockFormProps {
|
||||
formType?: 'add' | 'edit' | 'detail';
|
||||
@@ -675,28 +677,20 @@ const ProjectFlockForm = ({
|
||||
<>
|
||||
<section className='w-full'>
|
||||
{/* Header */}
|
||||
<div className='flex flex-row justify-between items-center px-4 pt-4'>
|
||||
<div className='flex flex-row h-full gap-2'>
|
||||
<Link
|
||||
href={
|
||||
formType == 'add'
|
||||
? '/production/project-flock'
|
||||
: `/production/project-flock/detail?projectFlockId=${initialValues?.id}`
|
||||
}
|
||||
className='hover:text-gray-400'
|
||||
>
|
||||
<Icon
|
||||
icon={formType == 'add' ? 'mdi:close' : 'mdi:arrow-left'}
|
||||
width={24}
|
||||
height={24}
|
||||
/>
|
||||
</Link>
|
||||
<div className='divider divider-horizontal p-0 m-0'></div>
|
||||
<div className='text-sm text-neutral'>
|
||||
{formType == 'add' ? 'Add Flock' : 'Update Flock'}
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex flex-row justify-end'>
|
||||
<DrawerHeader
|
||||
leftIcon={formType == 'add' ? 'mdi:close' : 'mdi:arrow-left'}
|
||||
leftIconSize={24}
|
||||
leftIconHref={
|
||||
formType == 'add'
|
||||
? '/production/project-flock'
|
||||
: `/production/project-flock/detail?projectFlockId=${initialValues?.id}`
|
||||
}
|
||||
leftIconClassName='hover:text-gray-400'
|
||||
subtitle={formType == 'add' ? 'Add Flock' : 'Update Flock'}
|
||||
subtitleClassName='text-sm text-neutral'
|
||||
showDivider
|
||||
>
|
||||
{formType == 'edit' && (
|
||||
<Button
|
||||
onClick={() => {
|
||||
if (initialValues?.id) {
|
||||
@@ -713,8 +707,8 @@ const ProjectFlockForm = ({
|
||||
className='justify-start text-sm'
|
||||
/>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</DrawerHeader>
|
||||
{projectFlockFormErrorMessage && (
|
||||
<div className='my-4'>
|
||||
<div role='alert' className='alert alert-error'>
|
||||
@@ -770,21 +764,6 @@ const ProjectFlockForm = ({
|
||||
<Icon icon='mdi:times' width={24} height={24} />
|
||||
Reject
|
||||
</Button>
|
||||
{initialValues?.approval?.step_number == 2 && (
|
||||
<Button
|
||||
variant='outline'
|
||||
color='success'
|
||||
className='w-full sm:w-fit'
|
||||
onClick={() => {
|
||||
router.push(
|
||||
`/production/project-flock/chickin/add?projectFlockId=${initialValues?.id}`
|
||||
);
|
||||
}}
|
||||
>
|
||||
<Icon icon='mdi:home-import-outline' width={18} height={18} />
|
||||
Chickin
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<form
|
||||
|
||||
Reference in New Issue
Block a user