From: Stas Vilchik Date: Mon, 19 Oct 2015 14:56:09 +0000 (+0200) Subject: SONAR-6416 update calls to /api/tests/list X-Git-Tag: 5.2~24 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5c77ac981cc2c54b252ddfe2f8f189097a69ddc5;p=sonarqube.git SONAR-6416 update calls to /api/tests/list --- diff --git a/server/sonar-web/src/main/js/components/source-viewer/main.js b/server/sonar-web/src/main/js/components/source-viewer/main.js index 05a94e07e53..cecf4e51948 100644 --- a/server/sonar-web/src/main/js/components/source-viewer/main.js +++ b/server/sonar-web/src/main/js/components/source-viewer/main.js @@ -397,7 +397,7 @@ export default Marionette.LayoutView.extend({ row = _.findWhere(this.model.get('source'), { line: line }), url = baseUrl + '/api/tests/list', options = { - sourceFileUuid: this.model.id, + sourceFileId: this.model.id, sourceFileLineNumber: line, ps: 1000 }; diff --git a/server/sonar-web/src/main/js/components/source-viewer/measures-overlay.js b/server/sonar-web/src/main/js/components/source-viewer/measures-overlay.js index 7283eaa2a2e..ded8d4c2b19 100644 --- a/server/sonar-web/src/main/js/components/source-viewer/measures-overlay.js +++ b/server/sonar-web/src/main/js/components/source-viewer/measures-overlay.js @@ -147,7 +147,7 @@ export default ModalView.extend({ requestTests: function () { var that = this, url = baseUrl + '/api/tests/list', - options = { testFileUuid: this.model.id }; + options = { testFileId: this.model.id }; return $.get(url, options).done(function (data) { that.model.set({ tests: data.tests }); that.testSorting = 'status'; @@ -201,13 +201,13 @@ export default ModalView.extend({ showTest: function (e) { var that = this, - testUuid = $(e.currentTarget).data('id'), + testId = $(e.currentTarget).data('id'), url = baseUrl + '/api/tests/covered_files', - options = { testUuid: testUuid }; + options = { testId: testId }; this.testsScroll = $(e.currentTarget).scrollParent().scrollTop(); return $.get(url, options).done(function (data) { that.coveredFiles = data.files; - that.selectedTest = _.findWhere(that.model.get('tests'), { testUuid: testUuid }); + that.selectedTest = _.findWhere(that.model.get('tests'), { id: testId }); that.render(); }); }, diff --git a/server/sonar-web/src/main/js/components/source-viewer/popups/coverage-popup.js b/server/sonar-web/src/main/js/components/source-viewer/popups/coverage-popup.js index 9e3e0993ec4..62259771af1 100644 --- a/server/sonar-web/src/main/js/components/source-viewer/popups/coverage-popup.js +++ b/server/sonar-web/src/main/js/components/source-viewer/popups/coverage-popup.js @@ -8,7 +8,7 @@ export default Popup.extend({ template: Templates['source-viewer-coverage-popup'], events: { - 'click a[data-uuid]': 'goToFile' + 'click a[data-id]': 'goToFile' }, onRender: function () { @@ -18,19 +18,19 @@ export default Popup.extend({ goToFile: function (e) { e.stopPropagation(); - var uuid = $(e.currentTarget).data('uuid'); + var id = $(e.currentTarget).data('id'); var RealWorkspace = Workspace.openComponent ? Workspace : require('components/workspace/main'); - RealWorkspace.openComponent({ uuid: uuid }); + RealWorkspace.openComponent({ uuid: id }); }, serializeData: function () { var row = this.options.row || {}, - tests = _.groupBy(this.collection.toJSON(), 'fileUuid'), + tests = _.groupBy(this.collection.toJSON(), 'fileId'), testFiles = _.map(tests, function (testSet) { var test = testSet[0]; return { file: { - uuid: test.fileUuid, + id: test.fileId, longName: test.fileLongName }, tests: testSet diff --git a/server/sonar-web/src/main/js/components/source-viewer/templates/measures/_source-viewer-measures-test-cases.hbs b/server/sonar-web/src/main/js/components/source-viewer/templates/measures/_source-viewer-measures-test-cases.hbs index 26bf9818cc1..6b0d5a110a6 100644 --- a/server/sonar-web/src/main/js/components/source-viewer/templates/measures/_source-viewer-measures-test-cases.hbs +++ b/server/sonar-web/src/main/js/components/source-viewer/templates/measures/_source-viewer-measures-test-cases.hbs @@ -28,7 +28,7 @@ {{#ifTestData this}} {{testStatusIcon status}} {{durationInMs}}ms - {{name}} + {{name}} {{coveredLines}} {{else}} {{testStatusIcon status}} diff --git a/server/sonar-web/src/main/js/components/source-viewer/templates/source-viewer-coverage-popup.hbs b/server/sonar-web/src/main/js/components/source-viewer/templates/source-viewer-coverage-popup.hbs index 3c53b6c1867..d0ee94c797c 100644 --- a/server/sonar-web/src/main/js/components/source-viewer/templates/source-viewer-coverage-popup.hbs +++ b/server/sonar-web/src/main/js/components/source-viewer/templates/source-viewer-coverage-popup.hbs @@ -14,9 +14,8 @@ {{#each testFiles}} - {{log this}}
- + {{collapsedDirFromPath file.longName}}{{fileFromPath file.longName}}