[ARVADOS] updated: 9bde6c54153c29e5a7503b2af793e8eaf22245a1

Git user git at public.curoverse.com
Wed Oct 19 13:47:32 EDT 2016


Summary of changes:
 apps/workbench/app/controllers/work_units_controller.rb      | 8 +++++---
 apps/workbench/app/models/proxy_work_unit.rb                 | 2 +-
 apps/workbench/app/views/work_units/_show_child.html.erb     | 5 +++--
 apps/workbench/app/views/work_units/_show_component.html.erb | 4 +---
 apps/workbench/test/integration/jobs_test.rb                 | 2 +-
 5 files changed, 11 insertions(+), 10 deletions(-)

       via  9bde6c54153c29e5a7503b2af793e8eaf22245a1 (commit)
      from  3cc83a6e4ce8abe8616f3a56d1cdbf49c1df9bd8 (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 9bde6c54153c29e5a7503b2af793e8eaf22245a1
Author: radhika <radhika at curoverse.com>
Date:   Wed Oct 19 13:46:56 2016 -0400

    10079: getting child objects and panel name updates.

diff --git a/apps/workbench/app/controllers/work_units_controller.rb b/apps/workbench/app/controllers/work_units_controller.rb
index 577f939..c0845ee 100644
--- a/apps/workbench/app/controllers/work_units_controller.rb
+++ b/apps/workbench/app/controllers/work_units_controller.rb
@@ -117,14 +117,16 @@ class WorkUnitsController < ApplicationController
 
     current_obj = data['current_obj']
     current_obj_type = data['current_obj_type']
+    if current_obj['uuid']
+      resource_class = resource_class_for_uuid current_obj['uuid']
+      obj = object_for_dataclass(resource_class, current_obj['uuid'])
+      current_obj = obj if obj
+    end
     if current_obj_type == JobWorkUnit.to_s
-      current_obj = arvados_api_client.unpack_api_response current_obj, 'arvados#job'
       wu = JobWorkUnit.new(current_obj, params['name'])
     elsif current_obj_type == PipelineInstanceWorkUnit.to_s
-      current_obj = arvados_api_client.unpack_api_response current_obj, 'arvados#pipelineInstance'
       wu = PipelineInstanceWorkUnit.new(current_obj, params['name'])
     elsif current_obj_type == ContainerWorkUnit.to_s
-      current_obj = arvados_api_client.unpack_api_response current_obj, 'arvados#containerRequest'
       wu = ContainerWorkUnit.new(current_obj, params['name'])
     end
 
diff --git a/apps/workbench/app/models/proxy_work_unit.rb b/apps/workbench/app/models/proxy_work_unit.rb
index 321370a..b5349ec 100644
--- a/apps/workbench/app/models/proxy_work_unit.rb
+++ b/apps/workbench/app/models/proxy_work_unit.rb
@@ -326,7 +326,7 @@ class ProxyWorkUnit < WorkUnit
     if obj.respond_to? key
       obj.send(key)
     elsif obj.is_a?(Hash)
-      obj[key]
+      obj[key] || obj[key.to_s]
     end
   end
 end
diff --git a/apps/workbench/app/views/work_units/_show_child.html.erb b/apps/workbench/app/views/work_units/_show_child.html.erb
index 853fcaa..3451923 100644
--- a/apps/workbench/app/views/work_units/_show_child.html.erb
+++ b/apps/workbench/app/views/work_units/_show_child.html.erb
@@ -51,8 +51,9 @@
   </div>
 
   <% name = if current_obj.respond_to?('name') then current_obj.name else '' end %>
-  <% content_url = url_for(controller: :work_units, action: :show_child_component, name: name, main_obj: @object.uuid) %>
-  <div id="collapse<%=i%>" class="work-unit-component-detail panel-collapse collapse <%= if expanded then 'in' end %>" content-url="<%=content_url%>" action-data="<%={current_obj_type: current_obj.class.to_s, current_obj: current_obj.proxied, main_obj: @object, main_obj_kind: @object.kind}.to_json%>">
+  <% kind = if !@object.is_a?(Hash) then ('arvados#' + @object.class.to_s.camelcase(:lower)) else '' end %>
+  <% content_url = url_for(controller: :work_units, action: :show_child_component, name: name) %>
+  <div id="collapse<%=i%>" class="work-unit-component-detail panel-collapse collapse <%= if expanded then 'in' end %>" content-url="<%=content_url%>" action-data="<%={current_obj_type: current_obj.class.to_s, current_obj: current_obj.proxied, main_obj: @object, main_obj_kind: kind}.to_json%>">
     <div class="panel-body work-unit-component-detail-body">
     </div>
   </div>
diff --git a/apps/workbench/app/views/work_units/_show_component.html.erb b/apps/workbench/app/views/work_units/_show_component.html.erb
index 4c0f660..8f0c2d7 100644
--- a/apps/workbench/app/views/work_units/_show_component.html.erb
+++ b/apps/workbench/app/views/work_units/_show_component.html.erb
@@ -41,9 +41,7 @@
   <%= render(partial: "pipeline_instances/show_components_json",
              locals: {error_name: "Unreadable components", backtrace: nil, wu: wu}) %>
 <% else %>
-  <% @descendent_count = 0 if !@descendent_count %>
   <% wu.children.each do |c| %>
-    <% @descendent_count += 1 %>
-    <%= render(partial: 'work_units/show_child', locals: {current_obj: c, i: @descendent_count, expanded: false}) %>
+    <%= render(partial: 'work_units/show_child', locals: {current_obj: c, i: (c.uuid || rand(2**128).to_s(36)), expanded: false}) %>
   <% end %>
 <% end %>
diff --git a/apps/workbench/test/integration/jobs_test.rb b/apps/workbench/test/integration/jobs_test.rb
index e39d6f4..7708ffd 100644
--- a/apps/workbench/test/integration/jobs_test.rb
+++ b/apps/workbench/test/integration/jobs_test.rb
@@ -154,7 +154,7 @@ class JobsTest < ActionDispatch::IntegrationTest
 
       if readable
         click_link('component1')
-        within('#collapse1') do
+        within('.panel-collapse') do
           assert(has_text? component1['uuid'])
           assert(has_text? component1['script_version'])
           assert(has_text? 'script_parameters')

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list