Skip to content

Commit

Permalink
fix: enable click functionality on dashboard tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
harshitg927 committed Jan 13, 2025
1 parent e0a6881 commit c3789f2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions frontend/src/components/home/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,20 @@ const HomeDashBoard: React.FC<DashBoardProps> = () => {
}
};

const handleTileClick = (tile) => {
if (testSections?.length > 0 || hasRole(userSessionDetails, "Global Administrator")) {
setSelectedTile(tile);
} else {
setNotificationVisible(true);
addNotification({
kind: NotificationKinds.warning,
title: intl.formatMessage({ id: "accessDenied.title" }),
message: intl.formatMessage({ id: "accessDenied.message" }),
});
}
}

const handleMaximizeClick = (tile) => {
console.log("Icon clicked!");
if (
testSections?.length > 0 ||
hasRole(userSessionDetails, "Global Administrator")
Expand Down Expand Up @@ -504,7 +516,7 @@ const HomeDashBoard: React.FC<DashBoardProps> = () => {
{selectedTile == null ? (
<div className="home-dashboard-container">
{tileList.map((tile, index) => (
<ClickableTile key={index} className="dashboard-tile">
<ClickableTile key={index} className="dashboard-tile" onClick={() => handleTileClick(tile)}>
<h3 className="tile-title">{tile.title}</h3>
<p className="tile-subtitle">{tile.subTitle}</p>
<p className="tile-value">{tile.value}</p>
Expand Down

0 comments on commit c3789f2

Please sign in to comment.