]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15498 Allow user to select project that already belongs to an other portfolio
authorPhilippe Perrin <philippe.perrin@sonarsource.com>
Tue, 16 Nov 2021 15:48:18 +0000 (16:48 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 18 Nov 2021 20:03:33 +0000 (20:03 +0000)
server/sonar-web/src/main/js/components/controls/SelectListListContainer.tsx
server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SelectListListContainer-test.tsx.snap

index 288f23d5d9d4152c017521798c251b368ea95b09..5b6e607c748abafe2f4464a88c0a4a15e7df6f41 100644 (file)
@@ -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}
index bf96116e95ace5b22b630bc853fa94bf63bcccbd..450d9144161f92db50e638a81e5ff0a6734f7a21 100644 (file)
@@ -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]}