Skip to content

Commit a991bc4

Browse files
committed
[bug-app] fix: hide default badges in BadgeWrapper
1 parent 81fc671 commit a991bc4

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎src/client/src/components/BadgeWrapper.jsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Badge } from "@mui/material";
33
const BadgeWrapper = ({
44
panel,
55
children,
6+
hideDefault = false,
67
position = {
78
vertical: "top",
89
horizontal: "right",
@@ -12,6 +13,7 @@ const BadgeWrapper = ({
1213
let warningCount = 0;
1314
let infoCount = 0;
1415
let criticalCount = 0;
16+
let defaultCount = 0;
1517

1618
if (panel?._status) {
1719
criticalCount = panel._status.filter((x) => x.type === "critical").length;
@@ -84,6 +86,9 @@ const BadgeWrapper = ({
8486
);
8587
}
8688

89+
if (hideDefault) {
90+
return null;
91+
}
8792
return children;
8893
};
8994

‎src/client/src/core/BugToolbarWrapper.jsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,15 @@ export default function BugToolbarWrapper({ buttons, menuItems }) {
199199
horizontal: "center",
200200
}}
201201
>
202-
<PanelStatus statusItems={panel.data._status} panel={panel.data} />
202+
<PanelStatus
203+
statusItems={panel.data._status.filter((x) => x.type !== "default")}
204+
panel={panel.data}
205+
/>
203206
</Popover>
204207

205208
<BugToolbarIcon onClick={handleStatusClick}>
206209
<BadgeWrapper
210+
hideDefault={true}
207211
panel={panel.data}
208212
position={{
209213
vertical: "top",

0 commit comments

Comments
 (0)