From 9d2a0a97d598ae84532a6de89451b1f33101ca31 Mon Sep 17 00:00:00 2001 From: Hunter Craft <118154470+hunterckx@users.noreply.github.com> Date: Sat, 4 Jan 2025 13:35:01 -0800 Subject: [PATCH] fix: disabled integration lead buttons when user doesn't have edit access (#513) (#514) --- .../IntegrationLeadSection/integrationLeadSection.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/components/Forms/components/Atlas/components/IntegrationLeadSection/integrationLeadSection.tsx b/app/components/Forms/components/Atlas/components/IntegrationLeadSection/integrationLeadSection.tsx index b7786cbe..7dbf1d1d 100644 --- a/app/components/Forms/components/Atlas/components/IntegrationLeadSection/integrationLeadSection.tsx +++ b/app/components/Forms/components/Atlas/components/IntegrationLeadSection/integrationLeadSection.tsx @@ -48,6 +48,9 @@ export const IntegrationLeadSection = < getNewValue, integrationLeadName, }: IntegrationLeadSectionProps): JSX.Element => { + const { + formStatus: { isReadOnly }, + } = formManager; const { append, fields, remove } = useFieldArray({ control: formMethod.control, name: integrationLeadName, @@ -75,6 +78,7 @@ export const IntegrationLeadSection = < remove(index)} + disabled={isReadOnly} > @@ -87,6 +91,7 @@ export const IntegrationLeadSection = < {...BUTTON_PROPS} startIcon={} onClick={() => append(getNewValue())} + disabled={isReadOnly} > Add lead