mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-18 13:48:58 +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 type { ImpactMetricsSeries } from 'hooks/api/getters/useImpactMetricsMetadata/useImpactMetricsMetadata';
|
||||||
import { Highlighter } from 'component/common/Highlighter/Highlighter';
|
import { Highlighter } from 'component/common/Highlighter/Highlighter';
|
||||||
|
|
||||||
type SeriesOption = ImpactMetricsSeries & { name: string };
|
type SeriesOption = ImpactMetricsSeries & { name: string; displayName: string };
|
||||||
|
|
||||||
export type SeriesSelectorProps = {
|
export type SeriesSelectorProps = {
|
||||||
value: string;
|
value: string;
|
||||||
@ -20,7 +20,7 @@ export const SeriesSelector: FC<SeriesSelectorProps> = ({
|
|||||||
}) => (
|
}) => (
|
||||||
<Autocomplete
|
<Autocomplete
|
||||||
options={options}
|
options={options}
|
||||||
getOptionLabel={(option) => option.name}
|
getOptionLabel={(option) => option.displayName}
|
||||||
value={options.find((option) => option.name === value) || null}
|
value={options.find((option) => option.name === value) || null}
|
||||||
onChange={(_, newValue) => onChange(newValue?.name || '')}
|
onChange={(_, newValue) => onChange(newValue?.name || '')}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
@ -29,7 +29,7 @@ export const SeriesSelector: FC<SeriesSelectorProps> = ({
|
|||||||
<Box sx={{ display: 'flex', flexDirection: 'column' }}>
|
<Box sx={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
<Typography variant='body2'>
|
<Typography variant='body2'>
|
||||||
<Highlighter search={inputValue}>
|
<Highlighter search={inputValue}>
|
||||||
{option.name}
|
{option.displayName}
|
||||||
</Highlighter>
|
</Highlighter>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant='caption' color='text.secondary'>
|
<Typography variant='caption' color='text.secondary'>
|
||||||
|
@ -4,6 +4,7 @@ import { formatApiPath } from 'utils/formatPath';
|
|||||||
export type ImpactMetricsSeries = {
|
export type ImpactMetricsSeries = {
|
||||||
type: string;
|
type: string;
|
||||||
help: string;
|
help: string;
|
||||||
|
displayName: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ImpactMetricsMetadata = {
|
export type ImpactMetricsMetadata = {
|
||||||
|
Loading…
Reference in New Issue
Block a user