7753: show the job Log link in the component panel header only when it is a pipeline_...
authorradhika <radhika@curoverse.com>
Fri, 4 Dec 2015 18:48:48 +0000 (13:48 -0500)
committerradhika <radhika@curoverse.com>
Fri, 4 Dec 2015 20:08:05 +0000 (15:08 -0500)
apps/workbench/app/views/pipeline_instances/_running_component.html.erb
apps/workbench/app/views/pipeline_instances/_show_components_running.html.erb
apps/workbench/test/integration/anonymous_access_test.rb

index 6a24f1f63bddc4297d554901ff7d3472c8933372..cb27f1c46340cf622311c7d92745af2c7c4e87be 100644 (file)
 
         <% if current_job %>
           <%# column offset 4 %>
-          <% if current_job[:state].in? ["Complete", "Failed", "Cancelled"] %>
-            <div class="col-md-1">
-            <% if current_job[:log] %>
-                <% logCollection = Collection.find? current_job[:log] %>
-                <% if logCollection %>
+          <% if(pipeline_display rescue nil) %>
+            <% if current_job[:state].in? ["Complete", "Failed", "Cancelled"] %>
+              <div class="col-md-1">
+              <% if current_job[:log] %>
+                  <% logCollection = Collection.find? current_job[:log] %>
+                  <% if logCollection %>
+                    <%= link_to "Log", job_path(current_job[:uuid], anchor: "Log") %>
+                  <% else %>
+                    Log unavailable
+                  <% end %>
+              <% end %>
+              </div>
+            <% elsif current_job[:state] == "Running" %>
+              <div class="col-md-1">
+                <% job = Job.find? current_job[:uuid] %>
+                <% if job %>
                   <%= link_to "Log", job_path(current_job[:uuid], anchor: "Log") %>
                 <% else %>
                   Log unavailable
                 <% end %>
+              </div>
             <% end %>
-            </div>
-          <% elsif current_job[:state] == "Running" %>
-            <div class="col-md-1">
-              <% job = Job.find? current_job[:uuid] %>
-              <% if job %>
-                <%= link_to "Log", job_path(current_job[:uuid], anchor: "Log") %>
-              <% else %>
-                Log unavailable
-              <% end %>
-            </div>
           <% end %>
 
           <%# column offset 5 %>
index 566e3d771e12796b8d8ebb7e273e34fe499def33..4343f2e57b5adbb64dfb0fbabe177b9d7f937b7a 100644 (file)
@@ -97,5 +97,5 @@
 %>
 
 <% pipeline_jobs.each_with_index do |pj, i| %>
-  <%= render partial: 'running_component', locals: {pj: pj, i: i, expanded: false} %>
+  <%= render partial: 'running_component', locals: {pj: pj, i: i, expanded: false, pipeline_display: true} %>
 <% end %>
index f962821d422013f3f768cc59cca6e2fa8a900737..d58a0315ee54595c2e3d4d10e09c4a822d2e93ae 100644 (file)
@@ -251,17 +251,15 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
           # Function.prototype.bind, which is used by job_log_graph.js.
           find(:xpath, "//a[@href='#Log']").click
           assert_text expect_log_text
-        else
-          assert_selector "a[href=\"/jobs/#{object['uuid']}#Log\"]", text: 'Log'
         end
       else
         assert_selector 'a[data-toggle="disabled"]', text: 'Log'
-        assert_text 'Log unavailable'
         assert_text 'Output data not available'
         assert_text object['job']
         if pipeline_page
           assert_no_text 'This pipeline was created from'  # template is not readable
           assert_no_selector 'a', text: object['components']['foo']['job']['uuid']
+          assert_text 'Log unavailable'
         end
         find(:xpath, "//a[@href='#Log']").click
         assert_text 'Output data not available'