aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/hoc
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2021-10-20 10:48:08 +0200
committersonartech <sonartech@sonarsource.com>2021-11-09 20:03:16 +0000
commite03b2bf40be7de4821cdf009c74dffc90b87757b (patch)
tree0348599747bae1b6e74b52d9efbc8f05013250aa /server/sonar-web/src/main/js/components/hoc
parente8905886d0e77cc080022dff7e0df79e4823e5de (diff)
downloadsonarqube-e03b2bf40be7de4821cdf009c74dffc90b87757b.tar.gz
sonarqube-e03b2bf40be7de4821cdf009c74dffc90b87757b.zip
SONAR-15498 Manual selection of project's branches for portfolio
Display portfolio's children branch information and group issues by project and branch
Diffstat (limited to 'server/sonar-web/src/main/js/components/hoc')
-rw-r--r--server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx b/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx
index 9288e336bbb..cebddd9aa14 100644
--- a/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx
+++ b/server/sonar-web/src/main/js/components/hoc/withKeyboardNavigation.tsx
@@ -20,6 +20,7 @@
import key from 'keymaster';
import * as React from 'react';
import PageActions from '../../components/ui/PageActions';
+import { getComponentMeasureUniqueKey } from '../../helpers/component';
import { getWrappedDisplayName } from './utils';
export interface WithKeyboardNavigationProps {
@@ -72,7 +73,12 @@ export default function withKeyboardNavigation<P>(
getCurrentIndex = () => {
const { selected, components = [] } = this.props;
- return selected ? components.findIndex(component => component.key === selected.key) : -1;
+ return selected
+ ? components.findIndex(
+ component =>
+ getComponentMeasureUniqueKey(component) === getComponentMeasureUniqueKey(selected)
+ )
+ : -1;
};
skipIfFile = (handler: () => void) => {