Skip to content

Commit

Permalink
ui/alerts: Add the chip in the tabs to display the number of alerts
Browse files Browse the repository at this point in the history
Refs: #3291
  • Loading branch information
ChengYanJin committed Apr 20, 2021
1 parent b83e4ec commit 5913a3f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/src/components/style/CommonLayoutStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const TabsItemsStyle = styled.div`
export const TextBadge = styled.span`
background-color: ${(props) => props.theme.brand.infoPrimary};
color: ${(props) => props.theme.brand.textReverse};
padding: 2px 0.6rem;
padding: 2px ${padding.smaller};
border-radius: 4px;
font-size: 0.8rem;
font-weight: ${fontWeight.bold};
Expand Down
4 changes: 3 additions & 1 deletion ui/src/containers/NodePageRSP.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ const NodePageRSP = (props) => {
title: (
<span>
{intl.translate('alerts')}
<TextBadge>{alertsNode?.length}</TextBadge>
{alertsNode.length ? (
<TextBadge>{alertsNode.length}</TextBadge>
) : null}
</span>
),
onClick: () =>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/containers/VolumePageContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const VolumePageContent = (props) => {
title: (
<span>
{intl.translate('alerts')}
{PVCName && <TextBadge>{alertlist?.length}</TextBadge>}
{alertlist.length ? <TextBadge>{alertlist.length}</TextBadge> : null}
</span>
),
onClick: () =>
Expand Down

0 comments on commit 5913a3f

Please sign in to comment.