mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
fix: show all selected application names (#6110)
This commit is contained in:
parent
fbb5733f18
commit
1834f9f8bc
@ -79,7 +79,14 @@ export const FeatureMetrics = () => {
|
|||||||
.filter((metric) =>
|
.filter((metric) =>
|
||||||
selectedApplications.includes(metric.appName),
|
selectedApplications.includes(metric.appName),
|
||||||
) || [],
|
) || [],
|
||||||
);
|
).map((metric) => ({
|
||||||
|
...metric,
|
||||||
|
appName:
|
||||||
|
selectedApplications.length > 1
|
||||||
|
? 'all selected'
|
||||||
|
: metric.appName,
|
||||||
|
selectedApplications,
|
||||||
|
}));
|
||||||
}, [
|
}, [
|
||||||
cachedMetrics,
|
cachedMetrics,
|
||||||
selectedEnvironment,
|
selectedEnvironment,
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
import { VFC } from 'react';
|
||||||
|
import { styled, Typography } from '@mui/material';
|
||||||
|
import { TooltipLink } from 'component/common/TooltipLink/TooltipLink';
|
||||||
|
import { TextCell } from 'component/common/Table/cells/TextCell/TextCell';
|
||||||
|
|
||||||
|
const StyledTag = styled(Typography)(({ theme }) => ({
|
||||||
|
fontSize: theme.fontSizes.smallerBody,
|
||||||
|
}));
|
||||||
|
|
||||||
|
interface IFeatureTagCellProps {
|
||||||
|
row: {
|
||||||
|
original: {
|
||||||
|
appName: string;
|
||||||
|
selectedApplications: string[];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ApplicationsCell: VFC<IFeatureTagCellProps> = ({ row }) => {
|
||||||
|
if (
|
||||||
|
row.original.selectedApplications &&
|
||||||
|
row.original.selectedApplications.length > 1
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<TextCell>
|
||||||
|
<TooltipLink
|
||||||
|
tooltip={
|
||||||
|
<>
|
||||||
|
{row.original.selectedApplications.map(
|
||||||
|
(appName) => (
|
||||||
|
<StyledTag key={appName}>
|
||||||
|
{appName}
|
||||||
|
</StyledTag>
|
||||||
|
),
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{row.original.appName}
|
||||||
|
</TooltipLink>
|
||||||
|
</TextCell>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return <TextCell>{row.original.appName}</TextCell>;
|
||||||
|
};
|
@ -9,6 +9,7 @@ import { useMemo } from 'react';
|
|||||||
import { TextCell } from 'component/common/Table/cells/TextCell/TextCell';
|
import { TextCell } from 'component/common/Table/cells/TextCell/TextCell';
|
||||||
import theme from 'themes/theme';
|
import theme from 'themes/theme';
|
||||||
import { useConditionallyHiddenColumns } from 'hooks/useConditionallyHiddenColumns';
|
import { useConditionallyHiddenColumns } from 'hooks/useConditionallyHiddenColumns';
|
||||||
|
import { ApplicationsCell } from './ApplicationsCell';
|
||||||
|
|
||||||
interface IFeatureMetricsTableProps {
|
interface IFeatureMetricsTableProps {
|
||||||
metrics: IFeatureMetricsRaw[];
|
metrics: IFeatureMetricsRaw[];
|
||||||
@ -103,6 +104,7 @@ const COLUMNS = [
|
|||||||
{
|
{
|
||||||
Header: 'Application',
|
Header: 'Application',
|
||||||
accessor: 'appName',
|
accessor: 'appName',
|
||||||
|
Cell: ApplicationsCell,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: 'Environment',
|
Header: 'Environment',
|
||||||
|
Loading…
Reference in New Issue
Block a user