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:
parent
e27bd74dcc
commit
3ca3fd756a
@ -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'>
|
||||
|
@ -4,6 +4,7 @@ import { formatApiPath } from 'utils/formatPath';
|
||||
export type ImpactMetricsSeries = {
|
||||
type: string;
|
||||
help: string;
|
||||
displayName: string;
|
||||
};
|
||||
|
||||
export type ImpactMetricsMetadata = {
|
||||
|
Loading…
Reference in New Issue
Block a user