From: Philippe Perrin Date: Wed, 27 Apr 2022 06:53:03 +0000 (+0200) Subject: [NO-JIRA] Fix react-select typings X-Git-Tag: 9.5.0.56709~208 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=288c3986d8c611a9e433c168f4166021ca28e4c0;p=sonarqube.git [NO-JIRA] Fix react-select typings --- diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.tsx index 4e80efeca57..6e248342f54 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/StatusFilter.tsx @@ -53,8 +53,8 @@ export default class StatusFilter extends React.PureComponent { className="input-medium" onChange={this.handleChange} options={options} - searchable={false} value={options.find(o => o.value === this.props.value)} + isSearchable={false} /> ); } diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.tsx index bb7dd9de5f4..b84b2150539 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.tsx @@ -51,10 +51,10 @@ export default class TypesFilter extends React.PureComponent { graph[0].type); }; - addCustomMetric = (metric: string) => { - const customMetrics = [...this.props.query.customMetrics, metric]; - saveActivityGraph(PROJECT_ACTIVITY_GRAPH, this.props.project, GraphType.custom, customMetrics); - this.props.updateQuery({ customMetrics }); - }; - - removeCustomMetric = (removedMetric: string) => { - const customMetrics = this.props.query.customMetrics.filter(metric => metric !== removedMetric); - saveActivityGraph(PROJECT_ACTIVITY_GRAPH, this.props.project, GraphType.custom, customMetrics); - this.props.updateQuery({ customMetrics }); + updateSelectedMetrics = (selectedMetrics: string[]) => { + saveActivityGraph( + PROJECT_ACTIVITY_GRAPH, + this.props.project, + GraphType.custom, + selectedMetrics + ); + this.props.updateQuery({ customMetrics: selectedMetrics }); }; updateGraph = (graph: GraphType) => { @@ -195,12 +193,10 @@ export default class ProjectActivityGraphs extends React.PureComponent @@ -213,7 +209,6 @@ export default class ProjectActivityGraphs extends React.PureComponent @@ -108,7 +106,6 @@ exports[`should render correctly the graph and legends 1`] = ` }, ] } - removeCustomMetric={[Function]} series={ Array [ Object { diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx index 9cf2517a172..7a34d01e6d3 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx @@ -112,8 +112,7 @@ export default function BaselineSettingReferenceBranch(props: BaselineSettingRef {translate('baseline.reference_branch.choose')} - - autofocus={false} + { isLoading={this.props.isLoading} onChange={this.handleOptionChange} onInputChange={this.props.onInputChange} - onOpen={this.props.onOpen} + onMenuOpen={this.props.onOpen} options={this.props.options} placeholder={translate('search_verb')} /> diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx index 123ae2ec623..9a51ec49016 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/Search.tsx @@ -153,7 +153,7 @@ export class Search extends React.PureComponent {