mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
fixing disable field detail
This commit is contained in:
@@ -173,15 +173,7 @@ const RowOptionsMenu = ({
|
|||||||
anchorName={popoverAnchorName}
|
anchorName={popoverAnchorName}
|
||||||
className={restrictionInfo.isLocked ? 'text-error' : ''}
|
className={restrictionInfo.isLocked ? 'text-error' : ''}
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon icon='material-symbols:more-vert' width={16} height={16} />
|
||||||
icon={
|
|
||||||
restrictionInfo.isLocked
|
|
||||||
? 'material-symbols:lock-outline'
|
|
||||||
: 'material-symbols:more-vert'
|
|
||||||
}
|
|
||||||
width={16}
|
|
||||||
height={16}
|
|
||||||
/>
|
|
||||||
</PopoverButton>
|
</PopoverButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
@@ -218,7 +210,7 @@ const RowOptionsMenu = ({
|
|||||||
</Button>
|
</Button>
|
||||||
</RequirePermission>
|
</RequirePermission>
|
||||||
)}
|
)}
|
||||||
{!isApproved && !isRejected && (
|
{!restrictionInfo.isLocked && !isApproved && !isRejected && (
|
||||||
<RequirePermission permissions='lti.production.recording.approve'>
|
<RequirePermission permissions='lti.production.recording.approve'>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -234,7 +226,7 @@ const RowOptionsMenu = ({
|
|||||||
</Button>
|
</Button>
|
||||||
</RequirePermission>
|
</RequirePermission>
|
||||||
)}
|
)}
|
||||||
{!isApproved && !isRejected && (
|
{!restrictionInfo.isLocked && !isApproved && !isRejected && (
|
||||||
<RequirePermission permissions='lti.production.recording.approve'>
|
<RequirePermission permissions='lti.production.recording.approve'>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -513,14 +513,12 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
}, [initialValues, projectFlockKandangLookup]);
|
}, [initialValues, projectFlockKandangLookup]);
|
||||||
|
|
||||||
const recordingRestriction = useMemo(() => {
|
const recordingRestriction = useMemo(() => {
|
||||||
// Determine isLaying - check both is_laying flag AND category
|
// Determine isLaying primarily from transition flags.
|
||||||
let isLaying: boolean;
|
let isLaying: boolean;
|
||||||
if (initialValues?.is_laying !== undefined) {
|
if (initialValues?.is_laying !== undefined) {
|
||||||
isLaying = initialValues.is_laying;
|
isLaying = initialValues.is_laying;
|
||||||
} else if (projectFlockKandangLookup) {
|
} else if (projectFlockKandangLookup?.is_laying !== undefined) {
|
||||||
isLaying =
|
isLaying = projectFlockKandangLookup.is_laying;
|
||||||
projectFlockKandangLookup.is_laying ||
|
|
||||||
projectFlockKandangLookup.project_flock?.category === 'LAYING';
|
|
||||||
} else {
|
} else {
|
||||||
isLaying =
|
isLaying =
|
||||||
projectFlockKandangDetail?.project_flock?.category === 'LAYING' ||
|
projectFlockKandangDetail?.project_flock?.category === 'LAYING' ||
|
||||||
@@ -684,12 +682,9 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
return initialValues.is_laying;
|
return initialValues.is_laying;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Priority 2: projectFlockKandangLookup (for add mode with lookup)
|
// Priority 2: projectFlockKandangLookup flag (for add mode)
|
||||||
if (projectFlockKandangLookup) {
|
if (projectFlockKandangLookup?.is_laying !== undefined) {
|
||||||
return (
|
return projectFlockKandangLookup.is_laying;
|
||||||
projectFlockKandangLookup.is_laying ||
|
|
||||||
projectFlockKandangLookup.project_flock?.category === 'LAYING'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Priority 3: projectFlockKandangDetail (fallback for edit/detail mode)
|
// Priority 3: projectFlockKandangDetail (fallback for edit/detail mode)
|
||||||
|
|||||||
Reference in New Issue
Block a user