diff options
author | Jeremy Davis <jeremy.davis@sonarsource.com> | 2020-08-24 15:55:38 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-08-26 20:06:43 +0000 |
commit | b833cf484f15bd1e689afac1eedcf8fe11b28d21 (patch) | |
tree | f8be8a0ca450b75b029d30ec6d397b4b27ea0023 /server/sonar-web/src/main/js/apps/projects | |
parent | c39ab47130cf79261312b7b08afbcb2c79441f9c (diff) | |
download | sonarqube-b833cf484f15bd1e689afac1eedcf8fe11b28d21.tar.gz sonarqube-b833cf484f15bd1e689afac1eedcf8fe11b28d21.zip |
SONAR-12616 Drop deprecated 'periods'
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects')
-rw-r--r-- | server/sonar-web/src/main/js/apps/projects/__tests__/utils-test.ts | 2 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/projects/utils.ts | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/__tests__/utils-test.ts b/server/sonar-web/src/main/js/apps/projects/__tests__/utils-test.ts index f61d62d3ead..247de5267ae 100644 --- a/server/sonar-web/src/main/js/apps/projects/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/apps/projects/__tests__/utils-test.ts @@ -27,7 +27,7 @@ jest.mock('../../../api/components', () => ({ jest.mock('../../../api/measures', () => ({ getMeasuresForProjects: jest.fn().mockResolvedValue([ - { component: 'foo', metric: 'new_coverage', periods: [{ index: 1, value: '10' }] }, + { component: 'foo', metric: 'new_coverage', period: { index: 1, value: '10' } }, { component: 'bar', metric: 'languages', value: '20' } ]) })); diff --git a/server/sonar-web/src/main/js/apps/projects/utils.ts b/server/sonar-web/src/main/js/apps/projects/utils.ts index 753a9c457d0..7f0f6d097e7 100644 --- a/server/sonar-web/src/main/js/apps/projects/utils.ts +++ b/server/sonar-web/src/main/js/apps/projects/utils.ts @@ -23,7 +23,7 @@ import { RequestData } from 'sonar-ui-common/helpers/request'; import { Facet, searchProjects } from '../../api/components'; import { getMeasuresForProjects } from '../../api/measures'; import { getOrganizations } from '../../api/organizations'; -import { getPeriodValue, isDiffMetric } from '../../helpers/measures'; +import { isDiffMetric } from '../../helpers/measures'; import { MetricKey } from '../../types/metrics'; import { convertToFilter, Query } from './query'; @@ -225,9 +225,7 @@ export function fetchProjects( measures .filter(measure => measure.component === component.key) .forEach(measure => { - const value = isDiffMetric(measure.metric) - ? getPeriodValue(measure, 1) - : measure.value; + const value = isDiffMetric(measure.metric) ? measure.period?.value : measure.value; if (value !== undefined) { componentMeasures[measure.metric] = value; } |