details: http://www.bx.psu.edu/hg/galaxy/rev/0dc1fc63c945
changeset: 3632:0dc1fc63c945
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Tue Apr 13 10:22:27 2010 -0400
description:
Enable user to change dbkey from a known key back to unspecified. This is a hack, but there's no straightforward way to accomplish this without modifying the jquery autocomplete script.
diffstat:
static/scripts/galaxy.base.js | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diffs (30 lines):
diff -r 968161f35d50 -r 0dc1fc63c945 static/scripts/galaxy.base.js
--- a/static/scripts/galaxy.base.js Tue Apr 13 10:16:46 2010 -0400
+++ b/static/scripts/galaxy.base.js Tue Apr 13 10:22:27 2010 -0400
@@ -149,10 +149,10 @@
var select_mapping = {};
select_elt.children('option').each( function() {
// Get text, value for option.
- var text = $(this).text();
+ var text = $(this).text();
var value = $(this).attr('value');
- // Ignore values that are '?'
+ // HACK: dbkey-specific: ignore values that are '?'
if (value == '?') {
return;
}
@@ -169,6 +169,13 @@
}
});
+ // HACK: dbkey-specific: add an unspecified option. We need to add this at the end b/c adding it first mucks
+ // up the autocomplete sorting for some reason. (I.e. All options that start with the first character of the
+ // first option are listed before the other, alphabetized options.)
+ select_options.push( "unspecified (?)" );
+ select_mapping[ "unspecified (?)" ] = "?";
+ select_mapping[ "?" ] = "?";
+
// Set initial text if it's empty.
if ( text_input_elt.attr('value') == '' ) {
text_input_elt.attr('value', 'Click to Search or Select');
details: http://www.bx.psu.edu/hg/galaxy/rev/968161f35d50
changeset: 3631:968161f35d50
user: rc
date: Tue Apr 13 10:16:46 2010 -0400
description:
fixed forms and user_info functional tests
removed a debugging print stmt
diffstat:
lib/galaxy/model/__init__.py | 2 +-
lib/galaxy/web/controllers/forms.py | 1 -
test/functional/test_forms_and_requests.py | 8 ++++----
test/functional/test_user_info.py | 2 +-
4 files changed, 6 insertions(+), 7 deletions(-)
diffs (74 lines):
diff -r fdf5c92e7fae -r 968161f35d50 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py Mon Apr 12 19:11:36 2010 -0400
+++ b/lib/galaxy/model/__init__.py Tue Apr 13 10:16:46 2010 -0400
@@ -1326,7 +1326,7 @@
# the user had already filled out this field and the same form is re-rendered
# due to some reason like required fields have been left out.
if field[ 'type' ] == 'CheckboxField':
- value = CheckboxField.is_checked( util.restore_text( params.get( field_name, False ) ) )
+ value = CheckboxField.is_checked( params.get( field_name, False ) )
else:
value = util.restore_text( params.get( field_name, '' ) )
elif contents:
diff -r fdf5c92e7fae -r 968161f35d50 lib/galaxy/web/controllers/forms.py
--- a/lib/galaxy/web/controllers/forms.py Mon Apr 12 19:11:36 2010 -0400
+++ b/lib/galaxy/web/controllers/forms.py Tue Apr 13 10:16:46 2010 -0400
@@ -541,7 +541,6 @@
self.selectbox_options = []
# if the form is for defining samples, then use the sample field types
# which does not include TextArea & AddressField
- print >> sys.stderr, 'form_type', form_type
if form_type == trans.app.model.FormDefinition.types.SAMPLE:
for ft in BaseField.sample_field_types():
self.fieldtype.add_option(ft, ft)
diff -r fdf5c92e7fae -r 968161f35d50 test/functional/test_forms_and_requests.py
--- a/test/functional/test_forms_and_requests.py Mon Apr 12 19:11:36 2010 -0400
+++ b/test/functional/test_forms_and_requests.py Tue Apr 13 10:16:46 2010 -0400
@@ -106,7 +106,7 @@
"""Testing address & library creation"""
# first create a regular user
self.logout()
- self.login( email='test1(a)bx.psu.edu' )
+ self.login( email='test1(a)bx.psu.edu', username='regular-user1' )
self.logout()
self.login( email='test(a)bx.psu.edu' )
# first create a library for the request so that it can be submitted later
@@ -191,7 +191,7 @@
self.check_page_for_string( name )
# create address
self.logout()
- self.login( email='test1(a)bx.psu.edu' )
+ self.login( email='test1(a)bx.psu.edu', username='regular-user1' )
self.add_user_address( regular_user1.id, address1 )
global regular_user
regular_user = sa_session.query( galaxy.model.User ) \
@@ -206,7 +206,7 @@
"""Testing creating, editing and submitting a request as a regular user"""
# login as a regular user
self.logout()
- self.login( email='test1(a)bx.psu.edu' )
+ self.login( email='test1(a)bx.psu.edu', username='regular-user1' )
# set field values
fields = ['option1', str(user_address.id), 'field three value']
# create the request
@@ -259,7 +259,7 @@
self.home()
sa_session.refresh( request_one )
self.logout()
- self.login( email='test1(a)bx.psu.edu' )
+ self.login( email='test1(a)bx.psu.edu', username='regular-user1' )
# check if the request's state is now set to 'complete'
self.check_request_grid(state='Complete', request_name=request_one.name)
assert request_one.state is not request_one.states.COMPLETE, "The state of the request '%s' should be set to '%s'" \
diff -r fdf5c92e7fae -r 968161f35d50 test/functional/test_user_info.py
--- a/test/functional/test_user_info.py Mon Apr 12 19:11:36 2010 -0400
+++ b/test/functional/test_user_info.py Tue Apr 13 10:16:46 2010 -0400
@@ -162,7 +162,7 @@
# Test changing email and user name - first try an invalid user name
self.edit_login_info( new_email='test12_new(a)bx.psu.edu',
new_username='test12_new',
- check_str1='User name must contain only letters, numbers and' )
+ check_str1="User name must contain only lower-case letters, numbers and '-'" )
# Now try a valid user name
self.edit_login_info( new_email='test12_new(a)bx.psu.edu',
new_username='test12-new',
details: http://www.bx.psu.edu/hg/galaxy/rev/6b93e705c8a4
changeset: 3629:6b93e705c8a4
user: Nate Coraor <nate(a)bx.psu.edu>
date: Mon Apr 12 17:24:17 2010 -0400
description:
If a subdir of the library import dir is a symlink and we are linking instead of copying data on import, dereference that symlink
diffstat:
lib/galaxy/web/controllers/library_common.py | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diffs (25 lines):
diff -r c19605dca27d -r 6b93e705c8a4 lib/galaxy/web/controllers/library_common.py
--- a/lib/galaxy/web/controllers/library_common.py Mon Apr 12 15:56:13 2010 -0400
+++ b/lib/galaxy/web/controllers/library_common.py Mon Apr 12 17:24:17 2010 -0400
@@ -915,8 +915,19 @@
for entry in os.listdir( full_dir ):
# Only import regular files
path = os.path.join( full_dir, entry )
- if os.path.islink( path ) and os.path.isfile( path ) and params.get( 'link_data_only', False ):
- # If we're linking instead of copying, link the file the link points to, not the link itself.
+ if os.path.islink( full_dir ) and params.get( 'link_data_only', False ):
+ # If we're linking instead of copying and the
+ # sub-"directory" in the import dir is actually a symlink,
+ # dereference the symlink, but not any of its contents.
+ link_path = os.readlink( full_dir )
+ if os.path.isabs( link_path ):
+ path = os.path.join( link_path, entry )
+ else:
+ path = os.path.abspath( os.path.join( link_path, entry ) )
+ elif os.path.islink( path ) and os.path.isfile( path ) and params.get( 'link_data_only', False ):
+ # If we're linking instead of copying and the "file" in the
+ # sub-directory of the import dir is actually a symlink,
+ # dereference the symlink (one dereference only, Vasili).
link_path = os.readlink( path )
if os.path.isabs( link_path ):
path = link_path
details: http://www.bx.psu.edu/hg/galaxy/rev/a9402fc7ce1b
changeset: 3625:a9402fc7ce1b
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Fri Apr 09 13:02:15 2010 -0400
description:
Rollback text + autocomplete for big selects. Only use text + autocomplete for dbkey.
diffstat:
static/scripts/galaxy.base.js | 5 ++---
static/scripts/packed/galaxy.base.js | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diffs (24 lines):
diff -r 58ba6fbe22b3 -r a9402fc7ce1b static/scripts/galaxy.base.js
--- a/static/scripts/galaxy.base.js Fri Apr 09 11:35:02 2010 -0400
+++ b/static/scripts/galaxy.base.js Fri Apr 09 13:02:15 2010 -0400
@@ -120,10 +120,9 @@
}
// Replace any select box with 20+ options with a text input box + autocomplete.
-// TODO: make this work _well_ on pages with multiple forms; currently, value is reverted when any form is submitted -
-// value should be reverted when only the form that element is in is submitted.
+// TODO: make work with dynamic tool inputs and then can replace all big selects.
function replace_big_select_inputs() {
- $('select').each( function() {
+ $('select[name=dbkey]').each( function() {
var select_elt = $(this);
// Skip if there are < 20 options.
if (select_elt.find('option').length < 20)
diff -r 58ba6fbe22b3 -r a9402fc7ce1b static/scripts/packed/galaxy.base.js
--- a/static/scripts/packed/galaxy.base.js Fri Apr 09 11:35:02 2010 -0400
+++ b/static/scripts/packed/galaxy.base.js Fri Apr 09 13:02:15 2010 -0400
@@ -1,1 +1,1 @@
-$(document).ready(function(){replace_big_select_inputs()});$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}function make_popupmen!
u(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d)}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function array_length(b){if(b.length){return b.length}var c=0;for(var a in b){c++}return c}function replace_big_select_inputs(){$("select").each(function(){var a=$(this);if(a.find("optio!
n").length<20){return}var b=a.attr("value");var c=$("<input type='text
' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",a.attr("name"));c.click(function(){var g=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",g);$(this).select()});var f=[];var e={};a.children("option").each(function(){var h=$(this).text();var g=$(this).attr("value");if(g=="?"){return}f.push(h);e[h]=g;e[g]=g;if(g==b){c.attr("value",h)}});if(c.attr("value")==""){c.attr("value","Click to Search or Select")}var d={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};c.autocomplete(f,d);a.replaceWith(c);c.parents("form").submit(function(){var h=c.attr("value");var g=e[h];if(g!==null&&g!==undefined){c.attr("value",g)}else{if(b!=""){c.attr("value",b)}else{c.attr("value","?")}}})})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0!
){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text(k)}else{j=$("<input type='text'></input>").attr({value:k,size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){l.text(o);if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});
\ No newline at end of file
+$(document).ready(function(){replace_big_select_inputs()});$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}function make_popupmen!
u(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d)}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function array_length(b){if(b.length){return b.length}var c=0;for(var a in b){c++}return c}function replace_big_select_inputs(){$("select[name=dbkey]").each(function(){var a=$(this);if(a!
.find("option").length<20){return}var b=a.attr("value");var c=$("<inpu
t type='text' class='text-and-autocomplete-select'></input>");c.attr("size",40);c.attr("name",a.attr("name"));c.click(function(){var g=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",g);$(this).select()});var f=[];var e={};a.children("option").each(function(){var h=$(this).text();var g=$(this).attr("value");if(g=="?"){return}f.push(h);e[h]=g;e[g]=g;if(g==b){c.attr("value",h)}});if(c.attr("value")==""){c.attr("value","Click to Search or Select")}var d={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};c.autocomplete(f,d);a.replaceWith(c);c.parents("form").submit(function(){var h=c.attr("value");var g=e[h];if(g!==null&&g!==undefined){c.attr("value",g)}else{if(b!=""){c.attr("value",b)}else{c.attr("value","?")}}})})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-activ!
e").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text(k)}else{j=$("<input type='text'></input>").attr({value:k,size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){l.text(o);if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});
\ No newline at end of file
details: http://www.bx.psu.edu/hg/galaxy/rev/ac044bb17d24
changeset: 3623:ac044bb17d24
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Fri Apr 09 11:29:26 2010 -0400
description:
Fix Test framework's handling of boolean and multiple select checkboxes and radio buttons.
diffstat:
test/base/twilltestcase.py | 22 +++++++---------------
1 files changed, 7 insertions(+), 15 deletions(-)
diffs (55 lines):
diff -r ab319f94495c -r ac044bb17d24 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Thu Apr 08 16:21:53 2010 -0400
+++ b/test/base/twilltestcase.py Fri Apr 09 11:29:26 2010 -0400
@@ -1000,24 +1000,21 @@
break
# To help with debugging a tool, print out the form controls when the test fails
print "form '%s' contains the following controls ( note the values )" % f.name
- control_names = []
- hidden_control_names = [] # cannot change these, so ignore or many complex page tool tests will fail
+ controls = {}
hc_prefix = '<HiddenControl('
for i, control in enumerate( f.controls ):
print "control %d: %s" % ( i, str( control ) )
- if hc_prefix in str(control):
- hidden_control_names.append(control.name) # cannot do much with these
- else:
+ if not hc_prefix in str( control ):
try:
#check if a repeat element needs to be added
if control.name not in kwd and control.name.endswith( '_add' ):
#control name doesn't exist, could be repeat
repeat_startswith = control.name[0:-4]
- if repeat_startswith and not [ c_name for c_name in control_names if c_name.startswith( repeat_startswith ) ] and [ c_name for c_name in kwd.keys() if c_name.startswith( repeat_startswith ) ]:
+ if repeat_startswith and not [ c_name for c_name in controls.keys() if c_name.startswith( repeat_startswith ) ] and [ c_name for c_name in kwd.keys() if c_name.startswith( repeat_startswith ) ]:
tc.submit( control.name )
return self.submit_form( form_no=form_no, button=button, **kwd )
# Check for refresh_on_change attribute, submit a change if required
- if 'refresh_on_change' in control.attrs.keys():
+ if hasattr( control, 'attrs' ) and 'refresh_on_change' in control.attrs.keys():
changed = False
item_labels = [ item.attrs[ 'label' ] for item in control.get_items() if item.selected ] #For DataToolParameter, control.value is the HDA id, but kwd contains the filename. This loop gets the filename/label for the selected values.
for value in kwd[ control.name ]:
@@ -1040,19 +1037,14 @@
except Exception, e:
log.debug( "In submit_form, continuing, but caught exception: %s" % str( e ) )
continue
- control_names.append( control.name )
+ controls[ control.name ] = control
# No refresh_on_change attribute found in current form, so process as usual
for control_name, control_value in kwd.items():
- if control_name in hidden_control_names:
+ if control_name not in controls:
continue # these cannot be handled safely - cause the test to barf out
if not isinstance( control_value, list ):
control_value = [ control_value ]
- try:
- control = f.find_control( name=control_name )
- except:
- # This assumes we always want the first control of the given name,
- # which may not be ideal...
- control = f.find_control( name=control_name, nr=0 )
+ control = controls[ control_name ]
control.clear()
if control.is_of_kind( "text" ):
tc.fv( f.name, control.name, ",".join( control_value ) )