From 07954c8bb621488046c7ddbd6440b62daddac263 Mon Sep 17 00:00:00 2001 From: prafull-opensignlabs Date: Sat, 6 Jul 2024 16:59:14 +0530 Subject: [PATCH] fix: remove unnecessary button from shared template --- .../src/primitives/GetReportDisplay.js | 159 ++++++++++++------ 1 file changed, 108 insertions(+), 51 deletions(-) diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js index 99a75330e..e55a08f63 100644 --- a/apps/OpenSign/src/primitives/GetReportDisplay.js +++ b/apps/OpenSign/src/primitives/GetReportDisplay.js @@ -1352,58 +1352,115 @@ const ReportTable = (props) => {
{props.actions?.length > 0 && - props.actions.map( - (act, index) => - (item.ExtUserPtr?.objectId === - extClass?.[0]?.objectId || - act.btnLabel === "Use") && ( -
handleActionBtn(act, item)} - title={act.hoverLabel} - className={ - act.action !== "option" - ? `${ - act?.btnColor ? act.btnColor : "" - } op-btn op-btn-sm mr-1` - : "text-base-content focus:outline-none text-lg mr-2 relative" - } - > - - {act.btnLabel && ( - - {act.btnLabel} - - )} - {isOption[item.objectId] && - act.action === "option" && ( -
    - {act.subaction?.map((subact) => ( -
  • - handleActionBtn(subact, item) - } - title={subact.hoverLabel} - > - - - {subact.btnLabel && ( - - {subact.btnLabel} - - )} - -
  • - ))} -
+ props.actions.map((act, index) => + props.ReportName === "Templates" ? ( + <> + {(item.ExtUserPtr?.objectId === + extClass?.[0]?.objectId || + act.btnLabel === "Use") && ( +
+ handleActionBtn(act, item) + } + title={act.hoverLabel} + className={ + act.action !== "option" + ? `${ + act?.btnColor + ? act.btnColor + : "" + } op-btn op-btn-sm mr-1` + : "text-base-content focus:outline-none text-lg mr-2 relative" + } + > + + {act.btnLabel && ( + + {act.btnLabel} + )} -
- ) + {isOption[item.objectId] && + act.action === "option" && ( +
    + {act.subaction?.map((subact) => ( +
  • + handleActionBtn( + subact, + item + ) + } + title={subact.hoverLabel} + > + + + {subact.btnLabel && ( + + {subact.btnLabel} + + )} + +
  • + ))} +
+ )} +
+ )} + + ) : ( +
handleActionBtn(act, item)} + title={act.hoverLabel} + className={ + act.action !== "option" + ? `${ + act?.btnColor ? act.btnColor : "" + } op-btn op-btn-sm mr-1` + : "text-base-content focus:outline-none text-lg mr-2 relative" + } + > + + {act.btnLabel && ( + + {act.btnLabel} + + )} + {isOption[item.objectId] && + act.action === "option" && ( +
    + {act.subaction?.map((subact) => ( +
  • + handleActionBtn(subact, item) + } + title={subact.hoverLabel} + > + + + {subact.btnLabel && ( + + {subact.btnLabel} + + )} + +
  • + ))} +
+ )} +
+ ) )}
{isShareWith[item.objectId] && (