Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions frontend/web/components/CompareIdentities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ const CompareIdentities: FC<CompareIdentitiesType> = ({
>
{featureStateLeft && (
<FeatureValue
includeEmpty={false}
value={featureStateLeft?.feature_state_value}
/>
)}
Expand All @@ -358,7 +357,6 @@ const CompareIdentities: FC<CompareIdentitiesType> = ({
>
{featureStateRight && (
<FeatureValue
includeEmpty={false}
value={featureStateRight?.feature_state_value}
/>
)}
Expand Down
1 change: 0 additions & 1 deletion frontend/web/components/IdentityTraits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ const IdentityTraits: FC<IdentityTraitsType> = ({
</Flex>
<Flex className='table-column'>
<FeatureValue
includeEmpty
data-test={`user-trait-value-${i}`}
value={trait_value}
/>
Expand Down
3 changes: 3 additions & 0 deletions frontend/web/components/diff/DiffString.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const sanitiseDiffString = (value: FlagsmithValue) => {
if (value === undefined || value === null) {
return ''
}
if (value === '') {
return '""'
}
return `${value}`
}
const DiffString: FC<DiffType> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ const Multivariate: FC<MultivariateType> = ({ controlValue }) => {
<span className='flex-row'>
This feature is being overridden by a % variation in the environment,
the control value of this feature is{' '}
<FeatureValue
className='ml-1 chip--xs'
includeEmpty
value={controlValue}
/>
<FeatureValue className='ml-1 chip--xs' value={controlValue} />
</span>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ const SegmentOverrideDescription: FC<SegmentOverrideDescriptionType> = ({
{`This feature is being overridden by ${
level === 'segment' ? 'this segment' : 'a segment'
} and would normally be`}
<FeatureValue
className='ml-1 chip--xs'
includeEmpty
value={`${controlValue}`}
/>
<FeatureValue className='ml-1 chip--xs' value={`${controlValue}`} />
{level === 'identity' ? ' for this user' : ''}
</span>
)}
Expand Down
8 changes: 2 additions & 6 deletions frontend/web/components/feature-summary/FeatureValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import classNames from 'classnames'

type FeatureValueType = {
value: FlagsmithValue
includeEmpty?: boolean // whether to show empty values
className?: string
onClick?: () => void
'data-test'?: string
Expand All @@ -18,9 +17,6 @@ const FeatureValue: FC<FeatureValueType> = (props) => {
return null
}
const type = typeof props.value
if (type === 'string' && props.value === '' && !props.includeEmpty) {
return null
}
const isCompact = getViewMode() === 'compact'
return (
<div
Expand All @@ -31,7 +27,7 @@ const FeatureValue: FC<FeatureValueType> = (props) => {
data-test={props['data-test']}
style={{ maxWidth: 'fit-content' }}
>
{type == 'string' && <span className='quot'>"</span>}
{type === 'string' && <span className='quot'>"</span>}
<span
className='feature-value'
style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}
Expand All @@ -41,7 +37,7 @@ const FeatureValue: FC<FeatureValueType> = (props) => {
isCompact ? 24 : 20,
)}
</span>
{type == 'string' && <span className='quot'>"</span>}
{type === 'string' && <span className='quot'>"</span>}
</div>
)
}
Expand Down
Loading