Skip to content

Commit

Permalink
fix: disabled integration lead buttons when user doesn't have edit ac…
Browse files Browse the repository at this point in the history
…cess (#513) (#514)
  • Loading branch information
hunterckx authored Jan 4, 2025
1 parent d03023f commit 9d2a0a9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export const IntegrationLeadSection = <
getNewValue,
integrationLeadName,
}: IntegrationLeadSectionProps<T, TFieldArrayName, R>): JSX.Element => {
const {
formStatus: { isReadOnly },
} = formManager;
const { append, fields, remove } = useFieldArray({
control: formMethod.control,
name: integrationLeadName,
Expand Down Expand Up @@ -75,6 +78,7 @@ export const IntegrationLeadSection = <
<IconButton
{...ICON_BUTTON_PROPS}
onClick={() => remove(index)}
disabled={isReadOnly}
>
<DeleteIcon {...SVG_ICON_PROPS} />
</IconButton>
Expand All @@ -87,6 +91,7 @@ export const IntegrationLeadSection = <
{...BUTTON_PROPS}
startIcon={<AddIcon />}
onClick={() => append(getNewValue())}
disabled={isReadOnly}
>
Add lead
</StyledButton>
Expand Down

0 comments on commit 9d2a0a9

Please sign in to comment.