You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "dombizita (via GitHub)" <gi...@apache.org> on 2023/09/13 08:20:09 UTC

[GitHub] [ozone] dombizita commented on a diff in pull request #5176: HDDS-9076. Recon UI OMDB Insights Changes and Improvements

dombizita commented on code in PR #5176:
URL: https://github.com/apache/ozone/pull/5176#discussion_r1324153575


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/components/overviewCard/overviewCard.tsx:
##########
@@ -46,18 +46,45 @@ const defaultProps = {
 
 interface IOverviewCardWrapperProps {
   linkToUrl: string;
+  title: string
 }
 
 class OverviewCardWrapper extends React.Component<IOverviewCardWrapperProps> {
+  // To set Current ACtive Tab for OM DB Insights
+  setCurrentActiveTab = (title: any) => {
+    if (title === "Open Keys Summary") {
+      return {
+        active: '2'
+      }
+    }
+    else if (title === "Pending Deleted Keys Summary") {
+      return {
+        active: '3'
+      }
+    }
+  };
+
   render() {
     const {linkToUrl, children} = this.props;
     if (linkToUrl) {
+      if (linkToUrl === '/Om'){
       return (
-        <Link to={linkToUrl}>
+        <Link to={{
+          pathname: linkToUrl,
+          state: { activeTab: children._owner.stateNode.props ? this.setCurrentActiveTab (children._owner.stateNode.props.title).active : '1'}
+        }} >
           {children}
         </Link>
-      );
-    }
+        )
+      }
+      else{
+        return (
+            <Link to={linkToUrl}>
+              {children}
+            </Link>
+        )
+      }
+      }

Review Comment:
   could you please fix the indentation here? in this file it seems to be 2 spaces.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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