dombizita commented on code in PR #5176:
URL: https://github.com/apache/ozone/pull/5176#discussion_r1308460989
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/components/overviewCard/overviewCard.tsx:
##########
@@ -46,18 +46,31 @@ const defaultProps = {
interface IOverviewCardWrapperProps {
linkToUrl: string;
+ title:string
}
class OverviewCardWrapper extends React.Component<IOverviewCardWrapperProps> {
render() {
const {linkToUrl, children} = this.props;
- if (linkToUrl) {
+ if (linkToUrl ) {
+ if(linkToUrl === '/Om'){
return (
- <Link to={linkToUrl}>
+ <Link to={{
+ pathname: linkToUrl,
+ state: { activeTab: children._owner &&
children._owner.stateNode.props && children._owner.stateNode.props.title ===
"Open Keys Summary"? '2':'3'}
Review Comment:
can't we do something like this now?
```
if (children._owner && children._owner.stateNode.props) {
let title = children._owner.stateNode.props.title;
let activeTab = '1';
if (title === "Open Keys Summary") {
activeTab = '2'
} else if (title === "Pending Deleted Keys Summary") {
activeTab = '3'
}
}
```
and later we just need this:
```
state: { activeTab: activeTab }
```
let me know what you think of this. with this approach if someone reads the
code they would automatically know hot the active tab is set, without checking
the code elsewhere. important: I didn't test this code, just a suggestion!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]