diff --git a/src/components/pages/production/transfer-to-laying/TransferToLayingsTable.tsx b/src/components/pages/production/transfer-to-laying/TransferToLayingsTable.tsx index 424cc3c2..18ce404d 100644 --- a/src/components/pages/production/transfer-to-laying/TransferToLayingsTable.tsx +++ b/src/components/pages/production/transfer-to-laying/TransferToLayingsTable.tsx @@ -26,6 +26,7 @@ import TextInput from '@/components/input/TextInput'; import CheckboxInput from '@/components/input/CheckboxInput'; import RowOptionsMenuWrapper from '@/components/table/RowOptionsMenuWrapper'; import ConfirmationModalWithNotes from '@/components/modal/ConfirmationModalWithNotes'; +import RequirePermission from '@/components/helper/RequirePermission'; import { TransferToLaying } from '@/types/api/production/transfer-to-laying'; import { TransferToLayingApi } from '@/services/api/production/transfer-to-laying'; @@ -56,72 +57,81 @@ const RowOptionsMenu = ({ const showDeleteButton = showEditButton; - // TODO: apply RBAC const showApproveButton = showEditButton; const showRejectButton = showEditButton; return ( - - - {showEditButton && ( + + + + {showEditButton && ( + + + )} {/* TODO: apply RBAC */} {showApproveButton && ( - + + + )} {showRejectButton && ( - + + + )} {showDeleteButton && ( - + + + )} ); @@ -502,47 +512,53 @@ const TransferToLayingsTable = () => {
- + + + {selectedRowIds.length > 0 && ( <> - + + + - + + + )}
diff --git a/src/components/pages/production/transfer-to-laying/form/TransferToLayingForm.tsx b/src/components/pages/production/transfer-to-laying/form/TransferToLayingForm.tsx index 16885062..4d60f69a 100644 --- a/src/components/pages/production/transfer-to-laying/form/TransferToLayingForm.tsx +++ b/src/components/pages/production/transfer-to-laying/form/TransferToLayingForm.tsx @@ -8,6 +8,7 @@ import useSWR from 'swr'; import { Icon } from '@iconify/react'; import Button from '@/components/Button'; +import RequirePermission from '@/components/helper/RequirePermission'; import SelectInput, { OptionType, useSelect, @@ -500,34 +501,37 @@ const TransferToLayingForm = ({ <> {isShowApproveRejectButton && (
- {/* TODO: apply RBAC */} - + + + - + + +
)} @@ -788,37 +792,41 @@ const TransferToLayingForm = ({ {type !== 'add' && (
{isShowDeleteButton && ( - + + + )} {type !== 'edit' && isShowEditButton && ( - + + + )}
)} @@ -833,15 +841,23 @@ const TransferToLayingForm = ({ Reset - + +
)}