diff --git a/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintAccordionViewHeader.tsx b/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintAccordionViewHeader.tsx index 7e1d3f84d7..c272df5286 100644 --- a/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintAccordionViewHeader.tsx +++ b/frontend/src/component/common/ConstraintAccordion/ConstraintAccordionView/ConstraintAccordionViewHeader/ConstraintAccordionViewHeader.tsx @@ -3,6 +3,7 @@ import { IConstraint } from 'interfaces/strategy'; import { ConstraintAccordionViewHeaderInfo } from './ConstraintAccordionViewHeaderInfo'; import { ConstraintAccordionHeaderActions } from '../../ConstraintAccordionHeaderActions/ConstraintAccordionHeaderActions'; import { styled } from '@mui/system'; +import useUnleashContext from 'hooks/api/getters/useUnleashContext/useUnleashContext'; interface IConstraintAccordionViewHeaderProps { constraint: IConstraint; @@ -34,6 +35,13 @@ export const ConstraintAccordionViewHeader = ({ expanded, compact, }: IConstraintAccordionViewHeaderProps) => { + const { context } = useUnleashContext(); + const { contextName } = constraint; + + const disableEdit = !context + .map(contextDefinition => contextDefinition.name) + .includes(contextName); + return ( @@ -46,6 +54,7 @@ export const ConstraintAccordionViewHeader = ({ );