10079: update show_child_component route and remove the show_component.js.erb file...
authorradhika <radhika@curoverse.com>
Wed, 19 Oct 2016 03:26:52 +0000 (23:26 -0400)
committerradhika <radhika@curoverse.com>
Wed, 19 Oct 2016 03:26:52 +0000 (23:26 -0400)
apps/workbench/app/controllers/work_units_controller.rb
apps/workbench/app/views/work_units/_show_child.html.erb
apps/workbench/app/views/work_units/show_component.js.erb [deleted file]
apps/workbench/config/routes.rb

index b5cf7ea3e3f26027cbc7063169956ee4c7d75ec6..577f939a13e81066abf43a8f140a96c36211e618 100644 (file)
@@ -112,7 +112,7 @@ class WorkUnitsController < ApplicationController
     end
   end
 
-  def show_component
+  def show_child_component
     data = JSON.load(params[:action_data])
 
     current_obj = data['current_obj']
index f6a6a6997c4add6fdcb4057153215f27a952b914..853fcaac628230adbbafc332905f6950bbd221c8 100644 (file)
@@ -51,7 +51,7 @@
   </div>
 
   <% name = if current_obj.respond_to?('name') then current_obj.name else '' end %>
-  <% content_url = url_for(controller: :work_units, action: :show_component, name: name, main_obj: @object.uuid) %>
+  <% 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%>">
     <div class="panel-body work-unit-component-detail-body">
     </div>
diff --git a/apps/workbench/app/views/work_units/show_component.js.erb b/apps/workbench/app/views/work_units/show_component.js.erb
deleted file mode 100644 (file)
index 9fa2cdb..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<% 
-  resource_class = resource_class_for_uuid params['wu']
-  obj = object_for_dataclass(resource_class, params['wu'])
-  if resource_class == Job
-    wu = JobWorkUnit.new(obj, params['name'])
-  elsif resource_class == PipelineInstance
-    wu = PipelineInstanceWorkUnit.new(obj, params['name'])
-  elsif resource_class == Container or resource_class == ContainerRequest
-    wu = ContainerWorkUnit.new(obj, params['name'])
-  end
-%>
-
-<%= escape_javascript(render partial: 'show_component', locals: {wu: wu}) %>
index d5f341a5750bc8efd5779e3a327ee85abbb55198..9bcebbd2749825da1e288805007d1ef5e336bdff 100644 (file)
@@ -16,7 +16,7 @@ ArvadosWorkbench::Application.routes.draw do
   get "all_processes" => 'work_units#index', :as => :all_processes
   get "choose_work_unit_templates" => 'work_unit_templates#choose', :as => :choose_work_unit_templates
   resources :work_units
-  post "work_units_show_component" => 'work_units#show_component', :as => :work_units_show_component
+  post "show_child_component" => 'work_units#show_child_component'
   resources :nodes
   resources :humans
   resources :traits