|
@@ -1,6 +1,5 @@
|
|
|
import styled from '@emotion/styled';
|
|
|
|
|
|
-import Tooltip from 'sentry/components/tooltip';
|
|
|
import {t, tct} from 'sentry/locale';
|
|
|
import space from 'sentry/styles/space';
|
|
|
import {WebVital} from 'sentry/utils/discover/fields';
|
|
@@ -26,15 +25,15 @@ function getVitalStateText(vital: WebVital | WebVital[], vitalState) {
|
|
|
case VitalState.POOR:
|
|
|
return Array.isArray(vital)
|
|
|
? t('Poor')
|
|
|
- : tct('Poor: >[threshold][unit]', {threshold: webVitalPoor[vital], unit});
|
|
|
+ : tct('(>[threshold][unit])', {threshold: webVitalPoor[vital], unit});
|
|
|
case VitalState.MEH:
|
|
|
return Array.isArray(vital)
|
|
|
? t('Meh')
|
|
|
- : tct('Meh: >[threshold][unit]', {threshold: webVitalMeh[vital], unit});
|
|
|
+ : tct('(>[threshold][unit])', {threshold: webVitalMeh[vital], unit});
|
|
|
case VitalState.GOOD:
|
|
|
return Array.isArray(vital)
|
|
|
? t('Good')
|
|
|
- : tct('Good: <[threshold][unit]', {threshold: webVitalMeh[vital], unit});
|
|
|
+ : tct('(<=[threshold][unit])', {threshold: webVitalMeh[vital], unit});
|
|
|
default:
|
|
|
return null;
|
|
|
}
|
|
@@ -44,19 +43,12 @@ export default function VitalPercents(props: Props) {
|
|
|
return (
|
|
|
<VitalSet>
|
|
|
{props.percents.map(pct => (
|
|
|
- <Tooltip
|
|
|
- key={pct.vitalState}
|
|
|
- title={getVitalStateText(props.vital, pct.vitalState)}
|
|
|
- disabled={props.hideTooltips}
|
|
|
- >
|
|
|
- <VitalStatus data-test-id="vital-status">
|
|
|
- {vitalStateIcons[pct.vitalState]}
|
|
|
- <span>
|
|
|
- {props.showVitalPercentNames && t(`${pct.vitalState}`)}{' '}
|
|
|
- {formatPercentage(pct.percent, 0)}
|
|
|
- </span>
|
|
|
- </VitalStatus>
|
|
|
- </Tooltip>
|
|
|
+ <VitalStatus data-test-id="vital-status" key={pct.vitalState}>
|
|
|
+ {vitalStateIcons[pct.vitalState]}
|
|
|
+ {props.showVitalPercentNames && t(`${pct.vitalState}`)}{' '}
|
|
|
+ {formatPercentage(pct.percent, 0)}
|
|
|
+ {getVitalStateText(props.vital, pct.vitalState)}
|
|
|
+ </VitalStatus>
|
|
|
))}
|
|
|
</VitalSet>
|
|
|
);
|