]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6416 update calls to /api/tests/list
authorStas Vilchik <vilchiks@gmail.com>
Mon, 19 Oct 2015 14:56:09 +0000 (16:56 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 21 Oct 2015 12:11:17 +0000 (14:11 +0200)
server/sonar-web/src/main/js/components/source-viewer/main.js
server/sonar-web/src/main/js/components/source-viewer/measures-overlay.js
server/sonar-web/src/main/js/components/source-viewer/popups/coverage-popup.js
server/sonar-web/src/main/js/components/source-viewer/templates/measures/_source-viewer-measures-test-cases.hbs
server/sonar-web/src/main/js/components/source-viewer/templates/source-viewer-coverage-popup.hbs

index 05a94e07e538d9993bdbe254c78354e40baa1782..cecf4e519489d04f1c036ccaf7828354e1d99399 100644 (file)
@@ -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
         };
index 7283eaa2a2e6165ed44a62d8f4160c2ce4c036d4..ded8d4c2b198b772b85fef96f9507068e83369ed 100644 (file)
@@ -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();
     });
   },
index 9e3e0993ec4db896eb857113fea3756c91ed074f..62259771af10cb6d98491dd0455aad380a71c0e6 100644 (file)
@@ -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
index 26bf9818cc1f4d998e63e1378ba38e0a0ffe3136..6b0d5a110a634df070bfc9f7b11c1dcbae9aca33 100644 (file)
@@ -28,7 +28,7 @@
               {{#ifTestData this}}
                 <td class="source-viewer-test-status note">{{testStatusIcon status}}</td>
                 <td class="source-viewer-test-duration note">{{durationInMs}}ms</td>
-                <td class="source-viewer-test-name"><a class="js-show-test" data-id="{{testUuid}}">{{name}}</a></td>
+                <td class="source-viewer-test-name"><a class="js-show-test" data-id="{{id}}">{{name}}</a></td>
                 <td class="source-viewer-test-covered-lines note">{{coveredLines}}</td>
               {{else}}
                 <td class="source-viewer-test-status note">{{testStatusIcon status}}</td>
index 3c53b6c18674eed17cceb346d61d595857fef97d..d0ee94c797c803aeaea2a51be60149ea14be61cb 100644 (file)
@@ -14,9 +14,8 @@
   </div>
 
   {{#each testFiles}}
-    {{log this}}
     <div class="bubble-popup-section">
-      <a class="component-viewer-popup-test-file link-action" data-uuid="{{file.uuid}}" title="{{file.longName}}">
+      <a class="component-viewer-popup-test-file link-action" data-id="{{file.id}}" title="{{file.longName}}">
         <span>{{collapsedDirFromPath file.longName}}</span><span class="component-name-file">{{fileFromPath file.longName}}</span>
       </a>
       <ul class="bubble-popup-list">
@@ -25,7 +24,7 @@
             <i class="component-viewer-popup-test-status {{testStatusIconClass status}}"></i>
             <span class="component-viewer-popup-test-name">
               <a class="component-viewer-popup-test-file link-action" title="{{name}}"
-                 data-uuid="{{../file.uuid}}" data-method="{{name}}">
+                 data-id="{{../file.id}}" data-method="{{name}}">
                 {{name}}
               </a>
             </span>