]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5209 Show error message when component api fails
authorStas Vilchik <vilchiks@gmail.com>
Fri, 4 Jul 2014 08:25:38 +0000 (14:25 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 4 Jul 2014 08:25:38 +0000 (14:25 +0600)
sonar-core/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/coffee/component-viewer/main.coffee
sonar-server/src/main/less/ui.less

index 8c2868f8c2bc09dbff7f05cd4a5de70fed651d39..c54b49a5d0538cb1b150e8fa70bd4b3e095d8508 100644 (file)
@@ -2672,6 +2672,7 @@ component_viewer.get_permalink=Get Permalink
 component_viewer.covered_lines=Covered Lines
 component_viewer.issues_limit_reached=For usability reasons, only the {0} first issues will be fully displayed. Remaining issues will simply be underlined.
 component_viewer.issues_limit_reached_tooltip={0}\n\nRefine your filter to be able to see the details of this issue.
+component_viewer.cannot_show=We're sorry, but something went wrong. Please try back in a few minutes and contact support if the problem persists.
 
 component_viewer.workspace=Workspace
 component_viewer.workspace.tooltip=Keeps track of history of navigation
index 6a7ea195a0cf003357948af63f82378b7f08db56..775aa7b08bb927c2987fba6f1472780106d8f57e 100644 (file)
@@ -246,10 +246,16 @@ define [
           if @settings.get('scm') then @showSCM() else @hideSCM()
           @trigger 'loaded'
       .fail =>
-        @state.set 'removed', true
-        @state.set 'hasSource', false
-        @render()
-        @trigger 'loaded'
+        if component.status == 404
+          @state.set 'removed', true
+          @state.set 'hasSource', false
+          @render()
+          @trigger 'loaded'
+        else @cannotOpen()
+
+
+    cannotOpen: ->
+      @$el.html "<div class='message-error'>#{t 'component_viewer.cannot_show'}</div>"
 
 
     toggleWorkspace: (store = false) ->
index c687af8f6ee8b401a1c751c2fb12bbdc22d1aaf8..b4e98b5bd54e00ac6be13b03c49e6cd21917860c 100644 (file)
@@ -285,3 +285,10 @@ input[type=button] {
   padding: 5px 8px;
   border: 2px solid @orange;
 }
+
+.message-error {
+  display: block;
+  padding: 5px 8px;
+  background-color: @red;
+  color: #fff;
+}