1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-27 01:19:00 +02:00

chore: fix rendering issue without setConstraints (#9975)

The current implementation states that if you do not have
access—typically as a viewer user—it renders the old component.
Rendering an empty view is acceptable, as this is part of the segment
creation flow, and if you do not have permissions, you do not need to
see it.
This commit is contained in:
Jaanus Sellin 2025-05-13 12:41:19 +03:00 committed by GitHub
parent 257b8d1f40
commit 5f4d7de62e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -202,14 +202,14 @@ export const SegmentFormStepTwo: React.FC<ISegmentFormPartTwoProps> = ({
}
/>
<StyledConstraintContainer>
{addEditStrategy &&
hasAccess(modePermission, project) &&
setConstraints ? (
<EditableConstraintsList
ref={constraintsAccordionListRef}
constraints={constraints}
setConstraints={setConstraints}
/>
{addEditStrategy ? (
hasAccess(modePermission, project) && setConstraints ? (
<EditableConstraintsList
ref={constraintsAccordionListRef}
constraints={constraints}
setConstraints={setConstraints}
/>
) : null
) : (
<ConstraintAccordionList
ref={constraintsAccordionListRef}