Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
fix(ui): add empty list indication to dashboard widgets (#866)
Browse files Browse the repository at this point in the history
  • Loading branch information
gallotamas authored Oct 31, 2023
1 parent dbce9a3 commit eb59863
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
padding: 12px 0 5px 0;
overflow-wrap: anywhere;
}

.empty-results-display-wrapper {
margin: 20px 0px;
}
}
}
}
}
24 changes: 13 additions & 11 deletions ui/src/layout/Dashboard/FindingsTabsWidget/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ const WidgetContent = ({data=[], getHeaderItems, getBodyItems, selectedId}) => {
</thead>
<tbody>
{
displayData.map((item, index) => {
return (
<tr key={index}>
{getBodyItems(selectedId).map(({dataKey, customDisplay: CustomDisplay}, index, items) => (
<td key={index} style={items.length - 1 === index ? {textAlign: "right"} : {}}>
{!!CustomDisplay ? <CustomDisplay {...item} /> : get(item, dataKey)}
</td>
))}
</tr>
)
})
displayData.length > 0 ?
displayData.map((item, index) => {
return (
<tr key={index}>
{getBodyItems(selectedId).map(({dataKey, customDisplay: CustomDisplay}, index, items) => (
<td key={index} style={items.length - 1 === index ? {textAlign: "right"} : {}}>
{!!CustomDisplay ? <CustomDisplay {...item} /> : get(item, dataKey)}
</td>
))}
</tr>
)
})
: <div className="empty-results-display-wrapper">No results available</div>
}
</tbody>
</table>
Expand Down

0 comments on commit eb59863

Please sign in to comment.