You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by pr...@apache.org on 2026/09/30 05:36:26 UTC

(ozone) branch master updated: HDDS-16551. Remove duplicate heatmap feature check in Recon v2 UI (#11323)

This is an automated email from the ASF dual-hosted git repository.

priyeshkaratha pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 46a0ec802b9 HDDS-16551. Remove duplicate heatmap feature check in Recon v2 UI (#11323)
46a0ec802b9 is described below

commit 46a0ec802b9fdf16cd8c7b15965d7e78fd78545c
Author: sravani <14...@users.noreply.github.com>
AuthorDate: Wed Sep 30 11:06:17 2026 +0530

    HDDS-16551. Remove duplicate heatmap feature check in Recon v2 UI (#11323)
---
 .../src/v2/components/navBar/navBar.tsx            |  6 +---
 .../src/v2/pages/heatmap/heatmap.tsx               | 35 +++++-----------------
 2 files changed, 9 insertions(+), 32 deletions(-)

diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/navBar/navBar.tsx b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/navBar/navBar.tsx
index 12a24d1ea2d..d0c03b64144 100644
--- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/navBar/navBar.tsx
+++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/navBar/navBar.tsx
@@ -144,11 +144,7 @@ const NavBar: React.FC<NavBarProps> = ({
     <Menu.Item key='/Heatmap'
       icon={<LayoutOutlined />}>
       <span>Heatmap</span>
-      <Link to={{
-        pathname: '/Heatmap',
-        state: { isHeatmapEnabled: isHeatmapEnabled }
-      }}
-      />
+      <Link to='/Heatmap' />
     </Menu.Item>
   ),(
     isChatbotEnabled &&
diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/heatmap/heatmap.tsx b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/heatmap/heatmap.tsx
index 8895a1dc3e2..3649ed12775 100644
--- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/heatmap/heatmap.tsx
+++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/heatmap/heatmap.tsx
@@ -28,7 +28,6 @@ import { HeatmapChild, HeatmapResponse, HeatmapState, InputPathState, InputPathV
 import HeatmapPlot from '@/v2/components/plots/heatmapPlot';
 
 import './heatmap.less';
-import { useLocation } from 'react-router-dom';
 
 let minSize = Infinity;
 let maxSize = 0;
@@ -42,10 +41,6 @@ const DEFAULT_HEATMAP_RESPONSE: HeatmapResponse = {
   minAccessCount: 0
 };
 
-const DEFAULT_DISABLED_FEATURES_RESPONSE = {
-  data: []
-};
-
 const Heatmap: React.FC<{}> = () => {
   const [state, setState] = useState<HeatmapState>({
     heatmapResponse: DEFAULT_HEATMAP_RESPONSE,
@@ -62,8 +57,9 @@ const Heatmap: React.FC<{}> = () => {
   const [searchPath, setSearchPath] = useState<string>(CONSTANTS.ROOT_PATH);
   const [treeEndpointFailed, setTreeEndpointFailed] = useState<boolean>(false);
 
-  const location = useLocation();
-  const [isHeatmapEnabled, setIsHeatmapEnabled] = useState<boolean>((location?.state as any)?.isHeatmapEnabled);
+  // Heatmap availability is derived from the data endpoint: AccessHeatMapEndpoint returns 404
+  // when the feature is disabled in config (same source as disabledFeatures).
+  const [isHeatmapEnabled, setIsHeatmapEnabled] = useState<boolean>(true);
 
   // Use the modern hooks pattern for heatmap data - only trigger on searchPath change
   const heatmapData = useApiData<HeatmapResponse>(
@@ -74,9 +70,11 @@ const Heatmap: React.FC<{}> = () => {
     {
       retryAttempts: 2,
       onError: (error: any) => {
-        if (error.response?.status !== 404) {
-          showDataFetchError(error.message.toString());
+        if (error.response?.status === 404) {
+          setIsHeatmapEnabled(false);
+          return;
         }
+        showDataFetchError(error.message.toString());
         setTreeEndpointFailed(true);
         setInputPathState(prevState => ({
           ...prevState,
@@ -87,16 +85,6 @@ const Heatmap: React.FC<{}> = () => {
     }
   );
 
-  // Use the modern hooks pattern for disabled features
-  const disabledFeaturesData = useApiData<{ data: string[] }>(
-    '/api/v1/features/disabledFeatures',
-    DEFAULT_DISABLED_FEATURES_RESPONSE,
-    {
-      retryAttempts: 2,
-      onError: (error: any) => showDataFetchError(error)
-    }
-  );
-
   // Process heatmap data when it changes
   useEffect(() => {
     if (heatmapData.data && heatmapData.data.label !== '') {
@@ -111,13 +99,6 @@ const Heatmap: React.FC<{}> = () => {
     }
   }, [heatmapData.data]);
 
-  // Process disabled features data when it changes
-  useEffect(() => {
-    if (disabledFeaturesData.data && disabledFeaturesData.data.data) {
-      setIsHeatmapEnabled(!disabledFeaturesData.data.data.includes('HEATMAP'));
-    }
-  }, [disabledFeaturesData.data]);
-
   function handleChange(e: ChangeEvent<HTMLInputElement>) {
     const value = e.target.value;
     // Only allow letters, numbers,underscores and forward slashes and hyphen
@@ -233,7 +214,7 @@ const Heatmap: React.FC<{}> = () => {
 
   const { date, entityType, heatmapResponse } = state;
   const { inputPath, helpMessage, isInputPathValid } = inputPathState;
-  const loading = heatmapData.loading || disabledFeaturesData.loading;
+  const loading = heatmapData.loading;
 
   const menuCalendar = (
     <Menu


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org