[ARVADOS] updated: ee435c5374d13f187290c7039c0e37dd5ae2ad00
git at public.curoverse.com
git at public.curoverse.com
Thu Jun 19 16:27:30 EDT 2014
Summary of changes:
apps/workbench/app/assets/javascripts/application.js | 7 +++++--
apps/workbench/app/assets/javascripts/select_modal.js | 12 ++++++++----
apps/workbench/app/controllers/application_controller.rb | 4 ++++
apps/workbench/app/controllers/collections_controller.rb | 2 --
apps/workbench/app/views/collections/_choose_rows.html.erb | 1 -
5 files changed, 17 insertions(+), 9 deletions(-)
via ee435c5374d13f187290c7039c0e37dd5ae2ad00 (commit)
from 76dea8772ff5726836393c518088bd8a7e149cc5 (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 ee435c5374d13f187290c7039c0e37dd5ae2ad00
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Jun 19 16:27:26 2014 -0400
2884: Added fail callback preview loading fails. Added comments explaining a
couple of things. Removed spurious puts.
diff --git a/apps/workbench/app/assets/javascripts/application.js b/apps/workbench/app/assets/javascripts/application.js
index 1a8b990..1ade33f 100644
--- a/apps/workbench/app/assets/javascripts/application.js
+++ b/apps/workbench/app/assets/javascripts/application.js
@@ -59,11 +59,14 @@ jQuery(function($){
}
}).
on('ajaxSend', function(e, xhr) {
- // map jquery event to rails event
+ // jQuery triggers 'ajaxSend' event when starting an ajax call, but
+ // rails-generated ajax triggers generate 'ajax:send'. Workbench
+ // event listeners currently expect 'ajax:send', so trigger the
+ // rails event in response to the jQuery one.
$(document).trigger('ajax:send');
}).
on('ajaxComplete', function(e, xhr) {
- // map jquery event to rails event
+ // See comment above about ajaxSend/ajax:send
$(document).trigger('ajax:complete');
}).
on('click', '.removable-tag a', function(e) {
diff --git a/apps/workbench/app/assets/javascripts/select_modal.js b/apps/workbench/app/assets/javascripts/select_modal.js
index a22b990..9107a01 100644
--- a/apps/workbench/app/assets/javascripts/select_modal.js
+++ b/apps/workbench/app/assets/javascripts/select_modal.js
@@ -17,10 +17,14 @@ $(document).on('click', '.selectable', function() {
if ($this.hasClass('active')) {
$(".modal-dialog-preview-pane").html('<img src="/assets/ajax-loader.gif"></img>');
- $.ajax($(this).attr('data-preview-href'),
- {dataType: "html"}).done(function(data, status, jqxhr) {
- $(".modal-dialog-preview-pane").html(data);
- });
+ $.ajax($this.attr('data-preview-href'),
+ {dataType: "html"}).
+ done(function(data, status, jqxhr) {
+ $(".modal-dialog-preview-pane").html(data);
+ }).
+ fail(function(data, status, jqxhr) {
+ $(".modal-dialog-preview-pane").text('Preview load failed.');
+ });
}
}).on('click', '.modal button[data-action-href]', function() {
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index d7ffd9c..9e918f5 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -148,6 +148,10 @@ class ApplicationController < ActionController::Base
params[:limit] ||= 40
if !@objects
if params[:project_uuid] and !params[:project_uuid].empty?
+ # We want the chooser to show objects of the controllers's model_class
+ # type within a specific project specified by project_uuid, so fetch the
+ # project and request the contents of the project filtered on the
+ # controllers's model_class kind.
@objects = Group.find(params[:project_uuid]).contents({:filters => [['uuid', 'is_a', "arvados\##{ArvadosApiClient.class_kind(model_class)}"]]})
end
find_objects_for_index if !@objects
diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index 2ca5929..7737423 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -59,8 +59,6 @@ class CollectionsController < ApplicationController
url_for(offset: next_page_offset, partial: true))
@name_links = @objects
- puts "and the result is (1) ", @name_links.results
-
@objects = Collection.
filter([['uuid','in', at name_links.collect(&:head_uuid)]])
super
diff --git a/apps/workbench/app/views/collections/_choose_rows.html.erb b/apps/workbench/app/views/collections/_choose_rows.html.erb
index 170ce77..5cce19a 100644
--- a/apps/workbench/app/views/collections/_choose_rows.html.erb
+++ b/apps/workbench/app/views/collections/_choose_rows.html.erb
@@ -1,4 +1,3 @@
-<% puts "and the result is (2) ", @name_links.results, "objects is #{@objects}" %>
<% @name_links.each do |name_link| %>
<% puts "looking up #{name_link.head_uuid}" %>
<% if (object = get_object(name_link.head_uuid)) %>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list