-
-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: show all selected application names (#6110)
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...src/component/feature/FeatureView/FeatureMetrics/FeatureMetricsTable/ApplicationsCell.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters