diff options
author | Revanshu Paliwal <revanshu.paliwal@sonarsource.com> | 2022-03-29 12:05:31 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-03-30 13:38:10 +0000 |
commit | 633f0b63149fb79ea5096fa69f6840112c4bfb6f (patch) | |
tree | e7fbf6c3c42743716021dcfa58dc70bb921ccaf2 /server/sonar-web/src/main/js/apps/projectBaseline | |
parent | 50be294c265cd259b99c6d9f3a5a9fff2a69cd72 (diff) | |
download | sonarqube-633f0b63149fb79ea5096fa69f6840112c4bfb6f.tar.gz sonarqube-633f0b63149fb79ea5096fa69f6840112c4bfb6f.zip |
SONAR-16087 Remove select legacy from permissions, projectActivity and projectBaseline
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projectBaseline')
2 files changed, 71 insertions, 31 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisListRenderer.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisListRenderer.tsx index 93e3f2d2f83..b9031a25063 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisListRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BranchAnalysisListRenderer.tsx @@ -19,8 +19,8 @@ */ import classNames from 'classnames'; import * as React from 'react'; +import Select from '../../../components/controls/Select'; import Radio from '../../../components/controls/Radio'; -import SelectLegacy from '../../../components/controls/SelectLegacy'; import Tooltip from '../../../components/controls/Tooltip'; import DateFormatter from '../../../components/intl/DateFormatter'; import TimeFormatter from '../../../components/intl/TimeFormatter'; @@ -95,27 +95,31 @@ export default function BranchAnalysisListRenderer(props: BranchAnalysisListRend byVersionByDay.length > 1 || (byVersionByDay.length === 1 && Object.keys(byVersionByDay[0].byDay).length > 0); + const options = [ + { + label: translate('baseline.branch_analyses.ranges.30days'), + value: 30 + }, + { + label: translate('baseline.branch_analyses.ranges.allTime'), + value: 0 + } + ]; + return ( <> <div className="spacer-bottom"> - {translate('baseline.analysis_from')} - <SelectLegacy + <label htmlFor="branch-analysis-from-input" className="spacer-right"> + {translate('baseline.analysis_from')} + </label> + <Select autoBlur={true} + inputId="branch-analysis-from-input" className="input-medium spacer-left" - clearable={false} onChange={props.handleRangeChange} - options={[ - { - label: translate('baseline.branch_analyses.ranges.30days'), - value: 30 - }, - { - label: translate('baseline.branch_analyses.ranges.allTime'), - value: 0 - } - ]} - searchable={false} - value={range} + options={options} + isSearchable={false} + value={options.filter(o => o.value === range)} /> </div> <div className="branch-analysis-list-wrapper"> diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/__snapshots__/BranchAnalysisListRenderer-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/__snapshots__/BranchAnalysisListRenderer-test.tsx.snap index 44f7ba92bbc..fff6d543a90 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/__snapshots__/BranchAnalysisListRenderer-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/__tests__/__snapshots__/BranchAnalysisListRenderer-test.tsx.snap @@ -5,11 +5,17 @@ exports[`should render correctly: Analyses 1`] = ` <div className="spacer-bottom" > - baseline.analysis_from - <SelectLegacy + <label + className="spacer-right" + htmlFor="branch-analysis-from-input" + > + baseline.analysis_from + </label> + <Select autoBlur={true} className="input-medium spacer-left" - clearable={false} + inputId="branch-analysis-from-input" + isSearchable={false} onChange={[MockFunction]} options={ Array [ @@ -23,8 +29,14 @@ exports[`should render correctly: Analyses 1`] = ` }, ] } - searchable={false} - value={30} + value={ + Array [ + Object { + "label": "baseline.branch_analyses.ranges.30days", + "value": 30, + }, + ] + } /> </div> <div @@ -301,11 +313,17 @@ exports[`should render correctly: empty 1`] = ` <div className="spacer-bottom" > - baseline.analysis_from - <SelectLegacy + <label + className="spacer-right" + htmlFor="branch-analysis-from-input" + > + baseline.analysis_from + </label> + <Select autoBlur={true} className="input-medium spacer-left" - clearable={false} + inputId="branch-analysis-from-input" + isSearchable={false} onChange={[MockFunction]} options={ Array [ @@ -319,8 +337,14 @@ exports[`should render correctly: empty 1`] = ` }, ] } - searchable={false} - value={30} + value={ + Array [ + Object { + "label": "baseline.branch_analyses.ranges.30days", + "value": 30, + }, + ] + } /> </div> <div @@ -345,11 +369,17 @@ exports[`should render correctly: loading 1`] = ` <div className="spacer-bottom" > - baseline.analysis_from - <SelectLegacy + <label + className="spacer-right" + htmlFor="branch-analysis-from-input" + > + baseline.analysis_from + </label> + <Select autoBlur={true} className="input-medium spacer-left" - clearable={false} + inputId="branch-analysis-from-input" + isSearchable={false} onChange={[MockFunction]} options={ Array [ @@ -363,8 +393,14 @@ exports[`should render correctly: loading 1`] = ` }, ] } - searchable={false} - value={30} + value={ + Array [ + Object { + "label": "baseline.branch_analyses.ranges.30days", + "value": 30, + }, + ] + } /> </div> <div |