mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 00:59:01 +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) {
|
if (currentWidget?.panelTypes === PANEL_GROUP_TYPES.ROW) {
|
||||||
const rowWidgetProperties = currentPanelMap[id] || {};
|
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 (
|
return (
|
||||||
<CardContainer
|
<CardContainer
|
||||||
className="row-card"
|
className="row-card"
|
||||||
@ -489,9 +498,7 @@ function GraphLayout(props: GraphLayoutProps): JSX.Element {
|
|||||||
cursor="move"
|
cursor="move"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Typography.Text className="section-title">
|
<Typography.Text className="section-title">{title}</Typography.Text>
|
||||||
{currentWidget.title}
|
|
||||||
</Typography.Text>
|
|
||||||
{rowWidgetProperties.collapsed ? (
|
{rowWidgetProperties.collapsed ? (
|
||||||
<ChevronDown
|
<ChevronDown
|
||||||
size={14}
|
size={14}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user