aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2021-11-16 16:48:18 +0100
committersonartech <sonartech@sonarsource.com>2021-11-18 20:03:33 +0000
commit74382e376bfe75b521d95314cdfd93911fbfe252 (patch)
treebd826f5b6a29a61e099b8fa15e816be4ef6a8202 /server/sonar-web/src/main/js
parent96f0ee77a8ddbc233b0834bbed6d1b16362dfc95 (diff)
downloadsonarqube-74382e376bfe75b521d95314cdfd93911fbfe252.tar.gz
sonarqube-74382e376bfe75b521d95314cdfd93911fbfe252.zip
SONAR-15498 Allow user to select project that already belongs to an other portfolio
Diffstat (limited to 'server/sonar-web/src/main/js')
-rw-r--r--server/sonar-web/src/main/js/components/controls/SelectListListContainer.tsx3
-rw-r--r--server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SelectListListContainer-test.tsx.snap6
2 files changed, 5 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/components/controls/SelectListListContainer.tsx b/server/sonar-web/src/main/js/components/controls/SelectListListContainer.tsx
index 288f23d5d9d..5b6e607c748 100644
--- a/server/sonar-web/src/main/js/components/controls/SelectListListContainer.tsx
+++ b/server/sonar-web/src/main/js/components/controls/SelectListListContainer.tsx
@@ -18,6 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import classNames from 'classnames';
+import { uniqueId } from 'lodash';
import * as React from 'react';
import { translate } from '../../helpers/l10n';
import DeferredSpinner from '../ui/DeferredSpinner';
@@ -115,7 +116,7 @@ export default class SelectListListContainer extends React.PureComponent<Props,
<SelectListListElement
disabled={this.isDisabled(element)}
element={element}
- key={element}
+ key={uniqueId()}
onSelect={this.props.onSelect}
onUnselect={this.props.onUnselect}
renderElement={this.props.renderElement}
diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SelectListListContainer-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SelectListListContainer-test.tsx.snap
index bf96116e95a..450d9144161 100644
--- a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SelectListListContainer-test.tsx.snap
+++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SelectListListContainer-test.tsx.snap
@@ -32,7 +32,7 @@ exports[`should render correctly 1`] = `
<SelectListListElement
disabled={false}
element="foo"
- key="foo"
+ key="1"
onSelect={[MockFunction]}
onUnselect={[MockFunction]}
renderElement={[Function]}
@@ -41,7 +41,7 @@ exports[`should render correctly 1`] = `
<SelectListListElement
disabled={false}
element="bar"
- key="bar"
+ key="2"
onSelect={[MockFunction]}
onUnselect={[MockFunction]}
renderElement={[Function]}
@@ -50,7 +50,7 @@ exports[`should render correctly 1`] = `
<SelectListListElement
disabled={false}
element="baz"
- key="baz"
+ key="3"
onSelect={[MockFunction]}
onUnselect={[MockFunction]}
renderElement={[Function]}