From c3789f2c650bb6d54f2627d9e5751306d2a8e052 Mon Sep 17 00:00:00 2001 From: harshitg927 Date: Mon, 13 Jan 2025 15:44:14 +0530 Subject: [PATCH 1/5] fix: enable click functionality on dashboard tiles --- frontend/src/components/home/Dashboard.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/home/Dashboard.tsx b/frontend/src/components/home/Dashboard.tsx index 142f9d52dc..8e09e53f57 100644 --- a/frontend/src/components/home/Dashboard.tsx +++ b/frontend/src/components/home/Dashboard.tsx @@ -359,8 +359,20 @@ const HomeDashBoard: React.FC = () => { } }; + 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") @@ -504,7 +516,7 @@ const HomeDashBoard: React.FC = () => { {selectedTile == null ? (
{tileList.map((tile, index) => ( - + handleTileClick(tile)}>

{tile.title}

{tile.subTitle}

{tile.value}

From 2bc467190fe371a3891ef72b690236bb6a9bfcae Mon Sep 17 00:00:00 2001 From: harshitg927 Date: Mon, 13 Jan 2025 23:47:24 +0530 Subject: [PATCH 2/5] feat(nav): Add home link to top of side navigation bar --- frontend/src/components/layout/Header.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/components/layout/Header.js b/frontend/src/components/layout/Header.js index b1692ad196..e9c956ca8e 100644 --- a/frontend/src/components/layout/Header.js +++ b/frontend/src/components/layout/Header.js @@ -579,6 +579,15 @@ function OEHeader(props) { isPersistent={false} > + {/* Adding the home link at the top in the side navigation bar */} + + + + + {/* Adding other links after the home in the side navigation bar */} {menus["menu"].map((childMenuItem, index) => { // ignore the Home Menu in the new UI if (childMenuItem.menu.elementId != "menu_home") { From fc82aeb1dd3ad84782a250022aa7cbc8f2815831 Mon Sep 17 00:00:00 2001 From: harshitg927 Date: Tue, 14 Jan 2025 23:22:58 +0530 Subject: [PATCH 3/5] code formatting using npm run format --- frontend/src/components/home/Dashboard.tsx | 13 ++++++++++--- frontend/src/components/layout/Header.js | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/home/Dashboard.tsx b/frontend/src/components/home/Dashboard.tsx index 8e09e53f57..3b2c606793 100644 --- a/frontend/src/components/home/Dashboard.tsx +++ b/frontend/src/components/home/Dashboard.tsx @@ -360,7 +360,10 @@ const HomeDashBoard: React.FC = () => { }; const handleTileClick = (tile) => { - if (testSections?.length > 0 || hasRole(userSessionDetails, "Global Administrator")) { + if ( + testSections?.length > 0 || + hasRole(userSessionDetails, "Global Administrator") + ) { setSelectedTile(tile); } else { setNotificationVisible(true); @@ -370,7 +373,7 @@ const HomeDashBoard: React.FC = () => { message: intl.formatMessage({ id: "accessDenied.message" }), }); } - } + }; const handleMaximizeClick = (tile) => { if ( @@ -516,7 +519,11 @@ const HomeDashBoard: React.FC = () => { {selectedTile == null ? (
{tileList.map((tile, index) => ( - handleTileClick(tile)}> + handleTileClick(tile)} + >

{tile.title}

{tile.subTitle}

{tile.value}

diff --git a/frontend/src/components/layout/Header.js b/frontend/src/components/layout/Header.js index e9c956ca8e..8700c79c47 100644 --- a/frontend/src/components/layout/Header.js +++ b/frontend/src/components/layout/Header.js @@ -580,7 +580,7 @@ function OEHeader(props) { > {/* Adding the home link at the top in the side navigation bar */} - From 112ada02b98e387dac2586f464d015f6d727afa1 Mon Sep 17 00:00:00 2001 From: harshitg927 Date: Fri, 17 Jan 2025 01:18:14 +0530 Subject: [PATCH 4/5] Modified code for requested changes --- frontend/src/components/layout/Header.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/frontend/src/components/layout/Header.js b/frontend/src/components/layout/Header.js index d545565c34..a345dc8f43 100644 --- a/frontend/src/components/layout/Header.js +++ b/frontend/src/components/layout/Header.js @@ -579,15 +579,6 @@ function OEHeader(props) { isPersistent={false} > - {/* Adding the home link at the top in the side navigation bar */} - - - - - {/* Adding other links after the home in the side navigation bar */} {menus["menu"].map((childMenuItem, index) => { return generateMenuItems( childMenuItem, From aece0ec598a5f2a0391acb486482044b948d3542 Mon Sep 17 00:00:00 2001 From: harshitg927 Date: Fri, 17 Jan 2025 17:01:17 +0530 Subject: [PATCH 5/5] modified code according to the requested changes --- frontend/src/components/home/Dashboard.tsx | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/frontend/src/components/home/Dashboard.tsx b/frontend/src/components/home/Dashboard.tsx index 3b2c606793..6d04df20b0 100644 --- a/frontend/src/components/home/Dashboard.tsx +++ b/frontend/src/components/home/Dashboard.tsx @@ -359,22 +359,6 @@ const HomeDashBoard: React.FC = () => { } }; - 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) => { if ( testSections?.length > 0 || @@ -522,7 +506,7 @@ const HomeDashBoard: React.FC = () => { handleTileClick(tile)} + onClick={() => handleMaximizeClick(tile)} >

{tile.title}

{tile.subTitle}