From: radhika Date: Tue, 25 Oct 2016 16:35:55 +0000 (-0400) Subject: 10079: show spinner when a child component details are being displayed using ajax. X-Git-Tag: 1.1.0~635^2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/85292497b7a89b9a0681fc38d307eea26681924c?ds=sidebyside 10079: show spinner when a child component details are being displayed using ajax. --- diff --git a/apps/workbench/app/assets/javascripts/work_unit_component.js b/apps/workbench/app/assets/javascripts/work_unit_component.js index 6c8374bd5a..baff0e8de1 100644 --- a/apps/workbench/app/assets/javascripts/work_unit_component.js +++ b/apps/workbench/app/assets/javascripts/work_unit_component.js @@ -6,6 +6,7 @@ $(document). } var content_div = href.find('.work-unit-component-detail-body'); + content_div.html('
'); var content_url = href.attr('content-url'); var action_data = href.attr('action-data'); $.ajax(content_url, {dataType: 'html', type: 'POST', data: {action_data: action_data}}). diff --git a/apps/workbench/app/views/work_units/_component_detail.html.erb b/apps/workbench/app/views/work_units/_component_detail.html.erb index 1ec5c3226f..bb5b913dfe 100644 --- a/apps/workbench/app/views/work_units/_component_detail.html.erb +++ b/apps/workbench/app/views/work_units/_component_detail.html.erb @@ -1,8 +1,6 @@ <% - collections = current_obj.outputs.flatten.uniq - collections << current_obj.docker_image - collections = collections.compact.uniq - collections_pdhs = collections.select {|x| !(m = CollectionsHelper.match(x)).nil?}.uniq.compact + collections = [current_obj.outputs, current_obj.docker_image].flatten.compact.uniq + collections_pdhs = collections.select {|x| !CollectionsHelper.match(x).nil?}.uniq.compact collections_uuids = collections - collections_pdhs preload_collections_for_objects collections_uuids if collections_uuids.any? preload_for_pdhs collections_pdhs if collections_pdhs.any? @@ -21,10 +19,16 @@ <% keys << :log_collection if @object.uuid != current_obj.uuid %> <% keys << :outputs %> <% keys.each do |k| %> - <% val = current_obj.send(k) if current_obj.respond_to?(k) %> - <% has_val = val %> - <% has_val = val.andand.any? if k == :outputs %> - <% has_val = true if k == :log_collection and current_obj.state_label == "Running" %> + <% + val = current_obj.send(k) if current_obj.respond_to?(k) + if k == :outputs + has_val = val.andand.any? + elsif k == :log_collection and current_obj.state_label == "Running" + has_val = true + else + has_val = val + end + %> <% if has_val %>