]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5209 Show a message about duplication inside deleted component
authorStas Vilchik <vilchiks@gmail.com>
Thu, 26 Jun 2014 10:07:16 +0000 (16:07 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 26 Jun 2014 10:07:16 +0000 (16:07 +0600)
sonar-server/src/main/coffee/component-viewer/mixins/main-duplications.coffee
sonar-server/src/main/hbs/component-viewer/source.hbs

index 46c3a1620587a9db4aab934dd8c1cd24087c74a3..0cc0e2e53d1c87906ff3e660fdaf4f73401bcfdd 100644 (file)
@@ -20,10 +20,13 @@ define [], () ->
     skipRemovedFiles: ->
       duplications = @source.get 'duplications'
       files = @source.get 'duplicationFiles'
+      deletedFiles = false
       duplications = _.map duplications, (d) ->
         blocks = _.filter d.blocks, (b) -> files[b._ref]
+        deletedFiles = true if blocks.length != d.blocks.length
         blocks: blocks
       @source.set 'duplications', duplications
+      @source.set 'duplicationsInDeletedFiles', deletedFiles
 
 
     augmentWithDuplications: (duplications) ->
@@ -77,4 +80,4 @@ define [], () ->
             lineFrom = b.from
             lineTo = b.from + b.size
             @sourceView.addShowBlock lineFrom - LINES_AROUND_DUPLICATION, lineTo + LINES_AROUND_DUPLICATION
-      @sourceView.render()
\ No newline at end of file
+      @sourceView.render()
index f033fb4d582af97d059cb840264e7a500227f014..f8d0ddb2c8521be9993bce97a95b3339cda2f624 100644 (file)
@@ -4,6 +4,10 @@
 
 {{else}}
 
+  {{#if source.duplicationsInDeletedFiles}}
+      <p>{{t 'duplications.dups_found_on_deleted_resource'}}</p>
+  {{/if}}
+
   <table class="code">
     {{#if showZeroLine}}
       <tr class="row row-hidden" data-line-number="0">
@@ -74,4 +78,4 @@
     {{/each}}
   </table>
 
-{{/if}}
\ No newline at end of file
+{{/if}}