Skip to content

Commit

Permalink
made amendment action menu view only
Browse files Browse the repository at this point in the history
  • Loading branch information
matbusby committed Oct 26, 2023
1 parent 33f2050 commit 7c9ac3a
Showing 1 changed file with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,19 @@ const MineExplosivesPermitTable: FC<RouteComponentProps & MineExplosivesPermitTa
["LET", "PER"].includes(doc.explosives_permit_document_type_code)
)?.length > 0;
const isCoreSource = record.originating_system === "Core";
const isAmendment = !!record.explosives_permit_amendment_guid;

const viewOnlyMenu: ITableAction[] = [
{
key: "view",
label: "View",
clickFunction: (event) => handleOpenViewExplosivesPermitModal(event, record),
icon: viewIcon,
},
];
const approvedMenu: ITableAction[] = isFeatureEnabled(Feature.ESUP_PERMIT_AMENDMENT)
? [
{
key: "view",
label: "View",
clickFunction: (event) => handleOpenViewExplosivesPermitModal(event, record),
icon: viewIcon,
},
...viewOnlyMenu,
{
key: "0",
label: "Edit Documents",
Expand Down Expand Up @@ -170,12 +175,7 @@ const MineExplosivesPermitTable: FC<RouteComponentProps & MineExplosivesPermitTa
? [
...(!isProcessed
? [
{
key: "view",
label: "View",
clickFunction: (event) => handleOpenViewExplosivesPermitModal(event, record),
icon: viewIcon,
},
...viewOnlyMenu,
{
key: "process",
label: "Process",
Expand Down Expand Up @@ -268,7 +268,11 @@ const MineExplosivesPermitTable: FC<RouteComponentProps & MineExplosivesPermitTa
{showActions && (
<AuthorizationWrapper permission={Permission.EDIT_EXPLOSIVES_PERMITS}>
{isFeatureEnabled(Feature.ESUP_PERMIT_AMENDMENT) ? (
<ActionMenu record={record} actionItems={currentMenu} category="ESUP" />
<ActionMenu
record={record}
actionItems={isAmendment ? viewOnlyMenu : currentMenu}
category="ESUP"
/>
) : (
<Dropdown
className="full-height full-mobile"
Expand Down

0 comments on commit 7c9ac3a

Please sign in to comment.