diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-11-06 17:19:12 +0100 |
---|---|---|
committer | Guillaume Jambet <guillaume.jambet@gmail.com> | 2017-11-08 13:51:31 +0100 |
commit | 20091d38661b5bb43b101b034e3be363a0bad3d7 (patch) | |
tree | ad4db1c1c3939e554211458b2f71fc1a635f1301 /server/sonar-web/src/main/js/components/SourceViewer/views/measures-overlay.js | |
parent | cfed131070e85a90c1e41af492235b8cf488a8eb (diff) | |
download | sonarqube-20091d38661b5bb43b101b034e3be363a0bad3d7.tar.gz sonarqube-20091d38661b5bb43b101b034e3be363a0bad3d7.zip |
SONAR-10040 Update usage of api/metrics/search
Diffstat (limited to 'server/sonar-web/src/main/js/components/SourceViewer/views/measures-overlay.js')
-rw-r--r-- | server/sonar-web/src/main/js/components/SourceViewer/views/measures-overlay.js | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/views/measures-overlay.js b/server/sonar-web/src/main/js/components/SourceViewer/views/measures-overlay.js index ad4ca78efaa..0faa854f57c 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/views/measures-overlay.js +++ b/server/sonar-web/src/main/js/components/SourceViewer/views/measures-overlay.js @@ -25,7 +25,7 @@ import ModalView from '../../common/modals'; import Template from './templates/source-viewer-measures.hbs'; import { searchIssues } from '../../../api/issues'; import { getMeasures } from '../../../api/measures'; -import { getMetrics } from '../../../api/metrics'; +import { getAllMetrics } from '../../../api/metrics'; import { getTests, getCoveredFiles } from '../../../api/tests'; import * as theme from '../../../app/theme'; import { getLocalizedMetricName, getLocalizedMetricDomain } from '../../../helpers/l10n'; @@ -108,20 +108,6 @@ export default ModalView.extend({ this.$('.js-test-list').scrollTop(this.testsScroll); }, - getMetrics() { - let metrics = ''; - const url = window.baseUrl + '/api/metrics/search'; - $.ajax({ - url, - async: false, - data: { ps: 9999 } - }).done(data => { - metrics = data.metrics.filter(metric => metric.type !== 'DATA' && !metric.hidden); - metrics = sortBy(metrics, 'name'); - }); - return metrics; - }, - calcAdditionalMeasures(measures) { measures.issuesRemediationEffort = (Number(measures.sqale_index_raw) || 0) + @@ -153,7 +139,7 @@ export default ModalView.extend({ }, requestMeasures() { - return getMetrics().then(metrics => { + return getAllMetrics().then(metrics => { const metricsToRequest = metrics .filter(metric => metric.type !== 'DATA' && !metric.hidden) .map(metric => metric.key); |