mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-11 21:09:09 +08:00
feat(dashboard): add widget count to collapsed section rows (#5822)
This commit is contained in:
parent
ae857d3fcd
commit
afc97511af
@ -472,6 +472,15 @@ function GraphLayout(props: GraphLayoutProps): JSX.Element {
|
||||
|
||||
if (currentWidget?.panelTypes === PANEL_GROUP_TYPES.ROW) {
|
||||
const rowWidgetProperties = currentPanelMap[id] || {};
|
||||
let { title } = currentWidget;
|
||||
if (rowWidgetProperties.collapsed) {
|
||||
const widgetCount = rowWidgetProperties.widgets?.length || 0;
|
||||
const collapsedText = `(${widgetCount} widget${
|
||||
widgetCount > 1 ? 's' : ''
|
||||
})`;
|
||||
title += ` ${collapsedText}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<CardContainer
|
||||
className="row-card"
|
||||
@ -489,9 +498,7 @@ function GraphLayout(props: GraphLayoutProps): JSX.Element {
|
||||
cursor="move"
|
||||
/>
|
||||
)}
|
||||
<Typography.Text className="section-title">
|
||||
{currentWidget.title}
|
||||
</Typography.Text>
|
||||
<Typography.Text className="section-title">{title}</Typography.Text>
|
||||
{rowWidgetProperties.collapsed ? (
|
||||
<ChevronDown
|
||||
size={14}
|
||||
|
Loading…
x
Reference in New Issue
Block a user