[ARVADOS] updated: fe7bd6e426f08bc9edb16baf297b5958a53c1afa
Git user
git at public.curoverse.com
Mon Jun 27 15:42:17 EDT 2016
Summary of changes:
apps/workbench/app/assets/javascripts/pipeline_instances.js | 2 +-
apps/workbench/app/models/container_work_unit.rb | 7 +++++--
apps/workbench/app/models/work_unit.rb | 2 +-
apps/workbench/app/views/work_unit/_show_log.html.erb | 8 ++++----
.../test/controllers/container_requests_controller_test.rb | 4 ++--
apps/workbench/test/controllers/containers_controller_test.rb | 4 ++--
6 files changed, 15 insertions(+), 12 deletions(-)
via fe7bd6e426f08bc9edb16baf297b5958a53c1afa (commit)
from c9edd85708b7991c21284d93a6cfc497dd3f3975 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit fe7bd6e426f08bc9edb16baf297b5958a53c1afa
Author: radhika <radhika at curoverse.com>
Date: Mon Jun 27 15:41:54 2016 -0400
9407: improve render_log logic
diff --git a/apps/workbench/app/assets/javascripts/pipeline_instances.js b/apps/workbench/app/assets/javascripts/pipeline_instances.js
index 8bb25c1..1617a92 100644
--- a/apps/workbench/app/assets/javascripts/pipeline_instances.js
+++ b/apps/workbench/app/assets/javascripts/pipeline_instances.js
@@ -108,7 +108,7 @@ $(document).on('arv-log-event', '.arv-log-event-handler-append-logs', function(e
}
var wasatbottom = ($(this).scrollTop() + $(this).height() >= this.scrollHeight);
- if (eventData.event_type == "stderr" || eventData.event_type == "stdout") {
+ if (eventData.properties != null && eventData.properties.text != null) {
if( eventData.prepend ) {
$(this).prepend(eventData.properties.text);
} else {
diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index ed7ae7e..f915923 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -131,8 +131,11 @@ class ContainerWorkUnit < ProxyWorkUnit
flat_map { |log| log.properties[:text].split("\n") rescue [] }
end
- def render_log(log)
- ['collections/show_files', {object: log, no_checkboxes: true}]
+ def render_log
+ collection = Collection.find(log_collection) rescue nil
+ if collection
+ return {log: collection, partial: 'collections/show_files', locals: {object: collection, no_checkboxes: true}}
+ end
end
# End combined propeties
diff --git a/apps/workbench/app/models/work_unit.rb b/apps/workbench/app/models/work_unit.rb
index e630835..dee6a60 100644
--- a/apps/workbench/app/models/work_unit.rb
+++ b/apps/workbench/app/models/work_unit.rb
@@ -184,7 +184,7 @@ class WorkUnit
# fetch log entries from logs table for @proxied
end
- def render_log(log)
+ def render_log
# return partial and locals to be rendered
end
end
diff --git a/apps/workbench/app/views/work_unit/_show_log.html.erb b/apps/workbench/app/views/work_unit/_show_log.html.erb
index 12a96c4..e3e6c23 100644
--- a/apps/workbench/app/views/work_unit/_show_log.html.erb
+++ b/apps/workbench/app/views/work_unit/_show_log.html.erb
@@ -16,12 +16,12 @@
<% else %>
<%# Finished running. Show log if exists. %>
- <% log = Collection.find wu.log_collection rescue nil %>
- <% if log %>
+ <% render_log = wu.render_log %>
+ <% if render_log %>
<div>
- <% log_url = url_for log %>
+ <% log_url = url_for render_log[:log] %>
<p> <a href="<%= log_url %>">Download the full log</a> </p>
- <%= render(partial: wu.render_log(log)[0], locals: wu.render_log(log)[1]) %>
+ <%= render(partial: render_log[:partial], locals: render_log[:locals]) %>
</div>
<% else %>
<div> Log not accessible </div>
diff --git a/apps/workbench/test/controllers/container_requests_controller_test.rb b/apps/workbench/test/controllers/container_requests_controller_test.rb
index 77c5d1c..f90e4e4 100644
--- a/apps/workbench/test/controllers/container_requests_controller_test.rb
+++ b/apps/workbench/test/controllers/container_requests_controller_test.rb
@@ -11,7 +11,7 @@ class ContainerRequestsControllerTest < ActionController::TestCase
get :show, {id: cr['uuid'], tab_pane: 'Log'}, session_for(:active)
assert_response :success
- assert_includes @response.body, "<a href=\"/collections/#{container['log']}\">Download the full log</a>"
- assert_includes @response.body, "<div class=\"collection_files_row filterable \" href=\"#{container['log']}/baz\">"
+ assert_select "a", {:href=>"/collections/#{container['log']}", :text=>"Download the full log"}
+ assert_select "a", {:href=>"#{container['log']}/baz"}
end
end
diff --git a/apps/workbench/test/controllers/containers_controller_test.rb b/apps/workbench/test/controllers/containers_controller_test.rb
index 92407af..69ff656 100644
--- a/apps/workbench/test/controllers/containers_controller_test.rb
+++ b/apps/workbench/test/controllers/containers_controller_test.rb
@@ -9,7 +9,7 @@ class ContainersControllerTest < ActionController::TestCase
get :show, {id: container['uuid'], tab_pane: 'Log'}, session_for(:active)
assert_response :success
- assert_includes @response.body, "<a href=\"/collections/#{container['log']}\">Download the full log</a>"
- assert_includes @response.body, "<div class=\"collection_files_row filterable \" href=\"#{container['log']}/baz\">"
+ assert_select "a", {:href=>"/collections/#{container['log']}", :text=>"Download the full log"}
+ assert_select "a", {:href=>"#{container['log']}/baz"}
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list