1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-13 13:48:59 +02:00

feat: user friendly impact metric name

This commit is contained in:
kwasniew 2025-07-10 11:21:02 +02:00
parent e27bd74dcc
commit 3ca3fd756a
No known key found for this signature in database
GPG Key ID: 43A7CBC24C119560
2 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import { Autocomplete, TextField, Typography, Box } from '@mui/material';
import type { ImpactMetricsSeries } from 'hooks/api/getters/useImpactMetricsMetadata/useImpactMetricsMetadata';
import { Highlighter } from 'component/common/Highlighter/Highlighter';
type SeriesOption = ImpactMetricsSeries & { name: string };
type SeriesOption = ImpactMetricsSeries & { name: string; displayName: string };
export type SeriesSelectorProps = {
value: string;
@ -20,7 +20,7 @@ export const SeriesSelector: FC<SeriesSelectorProps> = ({
}) => (
<Autocomplete
options={options}
getOptionLabel={(option) => option.name}
getOptionLabel={(option) => option.displayName}
value={options.find((option) => option.name === value) || null}
onChange={(_, newValue) => onChange(newValue?.name || '')}
disabled={loading}
@ -29,7 +29,7 @@ export const SeriesSelector: FC<SeriesSelectorProps> = ({
<Box sx={{ display: 'flex', flexDirection: 'column' }}>
<Typography variant='body2'>
<Highlighter search={inputValue}>
{option.name}
{option.displayName}
</Highlighter>
</Typography>
<Typography variant='caption' color='text.secondary'>

View File

@ -4,6 +4,7 @@ import { formatApiPath } from 'utils/formatPath';
export type ImpactMetricsSeries = {
type: string;
help: string;
displayName: string;
};
export type ImpactMetricsMetadata = {