mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
refactor(FE): Update button behavior based on kandang status
This commit is contained in:
@@ -398,24 +398,26 @@ const ProjectFlockDetail = ({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='grid grid-cols-4 gap-3'>
|
<div className='grid grid-cols-4 gap-3'>
|
||||||
<RequirePermission permissions='lti.production.chickins.detail'>
|
{selectedKandang?.status !== 'NON_ACTIVE' && (
|
||||||
<Link
|
<RequirePermission permissions='lti.production.chickins.detail'>
|
||||||
href={`/production/project-flock/chickin/add/kandang?projectFlockKandangId=${selectedKandang?.project_flock_kandang_id}&projectFlockId=${projectFlock.id}`}
|
<Link
|
||||||
className='m-0 p-0'
|
href={`/production/project-flock/chickin/add/kandang?projectFlockKandangId=${selectedKandang?.project_flock_kandang_id}&projectFlockId=${projectFlock.id}`}
|
||||||
>
|
className='m-0 p-0'
|
||||||
<Button
|
|
||||||
className='w-full px-2 py-1 text-sm'
|
|
||||||
variant='outline'
|
|
||||||
color='success'
|
|
||||||
disabled={
|
|
||||||
!selectedKandangId ||
|
|
||||||
projectFlock?.approval?.step_number == 1
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
Chickin <Icon icon='mdi:checkbox-marked-outline' />
|
<Button
|
||||||
</Button>
|
className='w-full px-2 py-1 text-sm'
|
||||||
</Link>
|
variant='outline'
|
||||||
</RequirePermission>
|
color='success'
|
||||||
|
disabled={
|
||||||
|
!selectedKandangId ||
|
||||||
|
projectFlock?.approval?.step_number == 1
|
||||||
|
}
|
||||||
|
>
|
||||||
|
Chickin <Icon icon='mdi:checkbox-marked-outline' />
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
</RequirePermission>
|
||||||
|
)}
|
||||||
<RequirePermission permissions='lti.production.project_flock_kandangs.closing.detail'>
|
<RequirePermission permissions='lti.production.project_flock_kandangs.closing.detail'>
|
||||||
<Link
|
<Link
|
||||||
href={`/production/project-flock/closing?projectFlockId=${projectFlock.id}&projectFlockKandangId=${selectedKandang?.project_flock_kandang_id}`}
|
href={`/production/project-flock/closing?projectFlockId=${projectFlock.id}&projectFlockKandangId=${selectedKandang?.project_flock_kandang_id}`}
|
||||||
@@ -430,7 +432,15 @@ const ProjectFlockDetail = ({
|
|||||||
projectFlock?.approval?.step_number == 1
|
projectFlock?.approval?.step_number == 1
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Close <Icon icon='mdi:checkbox-marked-circle-outline' />
|
{selectedKandang?.status === 'NON_ACTIVE' ? (
|
||||||
|
<>
|
||||||
|
Unclose <Icon icon='mdi:lock-open-variant' />
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
Close <Icon icon='mdi:checkbox-marked-circle-outline' />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</RequirePermission>
|
</RequirePermission>
|
||||||
|
|||||||
Reference in New Issue
Block a user