Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 25 additions & 17 deletions frontend/web/components/modals/CreateSegmentRulesTabForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,27 +202,35 @@ const CreateSegmentRulesTabForm: React.FC<CreateSegmentRulesTabFormProps> = ({
{!readOnly &&
setTopLevelRuleType &&
Utils.getFlagsmithHasFeature('segment_any_rule_type') ? (
<Row className='mb-3 align-items-center gap-2'>
<label className='control-label mb-0'>Include users when</label>
<InlinePillToggle
data-test='top-level-rule-type'
size='medium'
options={[
{ label: 'ALL', value: 'ALL' },
{ label: 'ANY', value: 'ANY' },
]}
value={topLevelRuleType}
onChange={setTopLevelRuleType}
/>
<label className='control-label mb-0'>
of the following rules apply:
</label>
</Row>
<>
<Row className='mb-2 align-items-center gap-2'>
<label className='control-label mb-0'>Include users when</label>
<InlinePillToggle
data-test='top-level-rule-type'
size='medium'
options={[
{ label: 'ALL', value: 'ALL' },
{ label: 'ANY', value: 'ANY' },
]}
value={topLevelRuleType}
onChange={setTopLevelRuleType}
/>
<label className='control-label mb-0'>
of the following rules apply
</label>
</Row>
{topLevelRuleType === 'ANY' &&
Utils.getFlagsmithValue('segment_any_rule_type') && (
<div className='fs-small fst-italic text-muted mb-3'>
{Utils.getFlagsmithValue('segment_any_rule_type')}
</div>
)}
</>
) : (
<Flex className='mb-3'>
<label className='cols-sm-2 control-label mb-1'>
Include users when {topLevelRuleType === 'ANY' ? 'any' : 'all'} of
the following rules apply:
the following rules apply
</label>
</Flex>
)}
Expand Down
Loading