galaxy-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 15302 discussions
commit/galaxy-central: guerler: ToolForm: Fix datatype mapping, provide data mapping through api
by commits-noreply@bitbucket.org 25 Sep '14
by commits-noreply@bitbucket.org 25 Sep '14
25 Sep '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a3d10d4db962/
Changeset: a3d10d4db962
User: guerler
Date: 2014-09-25 01:13:45+00:00
Summary: ToolForm: Fix datatype mapping, provide data mapping through api
Affected #: 7 files
diff -r 09aa10faa300c54071abff167f301dade9b76b95 -r a3d10d4db962d762d045bf3e46163508d3572e95 client/galaxy/scripts/mvc/tools/tools-datasets.js
--- a/client/galaxy/scripts/mvc/tools/tools-datasets.js
+++ b/client/galaxy/scripts/mvc/tools/tools-datasets.js
@@ -1,38 +1,58 @@
-define([ 'mvc/history/history-contents' ], function( HISTORY_CONTENTS ){
+define([ 'mvc/history/history-contents', 'utils/utils' ], function( HistoryContents, Utils ){
return Backbone.Model.extend({
// initialize
initialize: function(options) {
// create history contents container
- this.currHistoryContents = new HISTORY_CONTENTS.HistoryContents({});
+ this.currHistoryContents = new HistoryContents.HistoryContents({});
// identify current history id
this.currHistoryContents.historyId = options.history_id;
- // make request
+ // prepare datatype structure
+ this.typedict = {};
+
+ // link this
var self = this;
- var xhr = this.currHistoryContents.fetchAllDetails()
- .done( function(){
- // log request success
- console.debug('tools-datasets::initialize() - Completed.');
+
+ // request datatypes
+ Utils.get(galaxy_config.root + 'api/datatypes/mapping',
+ // success
+ function(typedict) {
+ // backup datatype dictionary
+ self.typedict = typedict;
- // callback
- options.success && options.success();
- })
- .fail( function(){
+ // make request
+ var xhr = self.currHistoryContents.fetchAllDetails()
+ .done( function(){
+ // log request success
+ console.debug('tools-datasets::initialize() - Completed.');
+
+ // callback
+ options.success && options.success();
+ })
+ .fail( function(){
+ // log request failure
+ console.debug('tools-datasets::initialize() - Ajax request for history datasets failed.');
+ });
+ },
+ // error
+ function(response) {
// log request failure
- console.debug('tools-datasets::initialize() - Ajax request failed.');
- });
+ console.debug('tools-datasets::initialize() - Ajax request for datatype dictionary failed.');
+ }
+ );
},
/** Filters datasets by data type.
*/
filterType: function(options) {
options = options || {};
+ var self = this;
return this.currHistoryContents.filter(function(content){
// match datatypes
var found = false;
for (var i in options.data_types) {
- if (content.get('data_type').indexOf(options.data_types[i]) != -1) {
+ if (self._matchType(content.get('data_type'), options.data_types[i])) {
found = true;
break;
}
@@ -48,6 +68,26 @@
*/
filter: function(filter_id) {
return _.first( this.currHistoryContents.filter( function( content ){ return content.get( 'id' ) === filter_id; }) );
+ },
+
+ /** Check if datatypes match
+ */
+ _matchType: function(reference, target) {
+ // check if target class is available
+ var target_class = this.typedict.ext_to_class_name[target];
+ if (!target_class) {
+ console.debug('tools-datasets::_matchType() - Specific target class unavailable. Accepting all formats.');
+ return true;
+ }
+
+ // check reference group
+ var reference_group = this.typedict.class_to_classes[reference];
+ if (reference_group[target_class]) {
+ return true;
+ }
+
+ // classes do not match
+ return false;
}
});
});
\ No newline at end of file
diff -r 09aa10faa300c54071abff167f301dade9b76b95 -r a3d10d4db962d762d045bf3e46163508d3572e95 lib/galaxy/webapps/galaxy/api/datatypes.py
--- a/lib/galaxy/webapps/galaxy/api/datatypes.py
+++ b/lib/galaxy/webapps/galaxy/api/datatypes.py
@@ -5,6 +5,7 @@
from galaxy import web
from galaxy.web.base.controller import BaseAPIController
from galaxy.util import asbool
+from galaxy.datatypes.data import Data
import logging
log = logging.getLogger( __name__ )
@@ -43,6 +44,37 @@
return { 'error': str( exception ) }
@web.expose_api_anonymous
+ def mapping( self, trans ):
+ '''
+ GET /api/datatypes/mapping
+ Return a dictionary of class to class mappings.
+ '''
+ try:
+ ext_to_class_name = dict()
+ classes = []
+ for k, v in trans.app.datatypes_registry.datatypes_by_extension.iteritems():
+ c = v.__class__
+ ext_to_class_name[k] = c.__module__ + "." + c.__name__
+ classes.append( c )
+ class_to_classes = dict()
+
+ def visit_bases( types, cls ):
+ for base in cls.__bases__:
+ if issubclass( base, Data ):
+ types.add( base.__module__ + "." + base.__name__ )
+ visit_bases( types, base )
+ for c in classes:
+ n = c.__module__ + "." + c.__name__
+ types = set( [ n ] )
+ visit_bases( types, c )
+ class_to_classes[ n ] = dict( ( t, True ) for t in types )
+ return dict( ext_to_class_name=ext_to_class_name, class_to_classes=class_to_classes )
+ except Exception, exception:
+ log.error( 'could not get datatype mapping: %s', str( exception ), exc_info=True )
+ trans.response.status = 500
+ return { 'error': str( exception ) }
+
+ @web.expose_api_anonymous
def sniffers( self, trans, **kwd ):
'''
GET /api/datatypes/sniffers
diff -r 09aa10faa300c54071abff167f301dade9b76b95 -r a3d10d4db962d762d045bf3e46163508d3572e95 lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -192,7 +192,7 @@
webapp.mapper.resource( 'datatype',
'datatypes',
path_prefix='/api',
- collection={ 'sniffers': 'GET' },
+ collection={ 'sniffers': 'GET', 'mapping' : 'GET' },
parent_resources=dict( member_name='datatype', collection_name='datatypes' ) )
#webapp.mapper.connect( 'run_workflow', '/api/workflow/{workflow_id}/library/{library_id}', controller='workflows', action='run', workflow_id=None, library_id=None, conditions=dict(method=["GET"]) )
webapp.mapper.resource( 'search', 'search', path_prefix='/api' )
diff -r 09aa10faa300c54071abff167f301dade9b76b95 -r a3d10d4db962d762d045bf3e46163508d3572e95 lib/galaxy/webapps/galaxy/controllers/workflow.py
--- a/lib/galaxy/webapps/galaxy/controllers/workflow.py
+++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py
@@ -1179,28 +1179,6 @@
use_panels=True,
myexperiment_target_url=myexperiment_target_url )
- @web.json
- def get_datatypes( self, trans ):
- ext_to_class_name = dict()
- classes = []
- for k, v in trans.app.datatypes_registry.datatypes_by_extension.iteritems():
- c = v.__class__
- ext_to_class_name[k] = c.__module__ + "." + c.__name__
- classes.append( c )
- class_to_classes = dict()
-
- def visit_bases( types, cls ):
- for base in cls.__bases__:
- if issubclass( base, Data ):
- types.add( base.__module__ + "." + base.__name__ )
- visit_bases( types, base )
- for c in classes:
- n = c.__module__ + "." + c.__name__
- types = set( [ n ] )
- visit_bases( types, c )
- class_to_classes[ n ] = dict( ( t, True ) for t in types )
- return dict( ext_to_class_name=ext_to_class_name, class_to_classes=class_to_classes )
-
@web.expose
def build_from_current_history( self, trans, job_ids=None, dataset_ids=None, dataset_collection_ids=None, workflow_name=None ):
user = trans.get_user()
diff -r 09aa10faa300c54071abff167f301dade9b76b95 -r a3d10d4db962d762d045bf3e46163508d3572e95 static/scripts/mvc/tools/tools-datasets.js
--- a/static/scripts/mvc/tools/tools-datasets.js
+++ b/static/scripts/mvc/tools/tools-datasets.js
@@ -1,38 +1,58 @@
-define([ 'mvc/history/history-contents' ], function( HISTORY_CONTENTS ){
+define([ 'mvc/history/history-contents', 'utils/utils' ], function( HistoryContents, Utils ){
return Backbone.Model.extend({
// initialize
initialize: function(options) {
// create history contents container
- this.currHistoryContents = new HISTORY_CONTENTS.HistoryContents({});
+ this.currHistoryContents = new HistoryContents.HistoryContents({});
// identify current history id
this.currHistoryContents.historyId = options.history_id;
- // make request
+ // prepare datatype structure
+ this.typedict = {};
+
+ // link this
var self = this;
- var xhr = this.currHistoryContents.fetchAllDetails()
- .done( function(){
- // log request success
- console.debug('tools-datasets::initialize() - Completed.');
+
+ // request datatypes
+ Utils.get(galaxy_config.root + 'api/datatypes/mapping',
+ // success
+ function(typedict) {
+ // backup datatype dictionary
+ self.typedict = typedict;
- // callback
- options.success && options.success();
- })
- .fail( function(){
+ // make request
+ var xhr = self.currHistoryContents.fetchAllDetails()
+ .done( function(){
+ // log request success
+ console.debug('tools-datasets::initialize() - Completed.');
+
+ // callback
+ options.success && options.success();
+ })
+ .fail( function(){
+ // log request failure
+ console.debug('tools-datasets::initialize() - Ajax request for history datasets failed.');
+ });
+ },
+ // error
+ function(response) {
// log request failure
- console.debug('tools-datasets::initialize() - Ajax request failed.');
- });
+ console.debug('tools-datasets::initialize() - Ajax request for datatype dictionary failed.');
+ }
+ );
},
/** Filters datasets by data type.
*/
filterType: function(options) {
options = options || {};
+ var self = this;
return this.currHistoryContents.filter(function(content){
// match datatypes
var found = false;
for (var i in options.data_types) {
- if (content.get('data_type').indexOf(options.data_types[i]) != -1) {
+ if (self._matchType(content.get('data_type'), options.data_types[i])) {
found = true;
break;
}
@@ -48,6 +68,26 @@
*/
filter: function(filter_id) {
return _.first( this.currHistoryContents.filter( function( content ){ return content.get( 'id' ) === filter_id; }) );
+ },
+
+ /** Check if datatypes match
+ */
+ _matchType: function(reference, target) {
+ // check if target class is available
+ var target_class = this.typedict.ext_to_class_name[target];
+ if (!target_class) {
+ console.debug('tools-datasets::_matchType() - Specific target class unavailable. Accepting all formats.');
+ return true;
+ }
+
+ // check reference group
+ var reference_group = this.typedict.class_to_classes[reference];
+ if (reference_group[target_class]) {
+ return true;
+ }
+
+ // classes do not match
+ return false;
}
});
});
\ No newline at end of file
diff -r 09aa10faa300c54071abff167f301dade9b76b95 -r a3d10d4db962d762d045bf3e46163508d3572e95 static/scripts/packed/mvc/tools/tools-datasets.js
--- a/static/scripts/packed/mvc/tools/tools-datasets.js
+++ b/static/scripts/packed/mvc/tools/tools-datasets.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-contents"],function(a){return Backbone.Model.extend({initialize:function(c){this.currHistoryContents=new a.HistoryContents({});this.currHistoryContents.historyId=c.history_id;var b=this;var d=this.currHistoryContents.fetchAllDetails().done(function(){console.debug("tools-datasets::initialize() - Completed.");c.success&&c.success()}).fail(function(){console.debug("tools-datasets::initialize() - Ajax request failed.")})},filterType:function(b){b=b||{};return this.currHistoryContents.filter(function(d){var e=false;for(var c in b.data_types){if(d.get("data_type").indexOf(b.data_types[c])!=-1){e=true;break}}return(d.get("history_content_type")===b.content_type||!b.content_type)&&(e||!b.data_types)&&!d.get("deleted")})},filter:function(b){return _.first(this.currHistoryContents.filter(function(c){return c.get("id")===b}))}})});
\ No newline at end of file
+define(["mvc/history/history-contents","utils/utils"],function(b,a){return Backbone.Model.extend({initialize:function(d){this.currHistoryContents=new b.HistoryContents({});this.currHistoryContents.historyId=d.history_id;this.typedict={};var c=this;a.get(galaxy_config.root+"api/datatypes/mapping",function(e){c.typedict=e;var f=c.currHistoryContents.fetchAllDetails().done(function(){console.debug("tools-datasets::initialize() - Completed.");d.success&&d.success()}).fail(function(){console.debug("tools-datasets::initialize() - Ajax request for history datasets failed.")})},function(e){console.debug("tools-datasets::initialize() - Ajax request for datatype dictionary failed.")})},filterType:function(d){d=d||{};var c=this;return this.currHistoryContents.filter(function(f){var g=false;for(var e in d.data_types){if(c._matchType(f.get("data_type"),d.data_types[e])){g=true;break}}return(f.get("history_content_type")===d.content_type||!d.content_type)&&(g||!d.data_types)&&!f.get("deleted")})},filter:function(c){return _.first(this.currHistoryContents.filter(function(d){return d.get("id")===c}))},_matchType:function(c,f){var d=this.typedict.ext_to_class_name[f];if(!d){console.debug("tools-datasets::_matchType() - Specific target class unavailable. Accepting all formats.");return true}var e=this.typedict.class_to_classes[c];if(e[d]){return true}return false}})});
\ No newline at end of file
diff -r 09aa10faa300c54071abff167f301dade9b76b95 -r a3d10d4db962d762d045bf3e46163508d3572e95 templates/webapps/galaxy/workflow/editor.mako
--- a/templates/webapps/galaxy/workflow/editor.mako
+++ b/templates/webapps/galaxy/workflow/editor.mako
@@ -41,7 +41,7 @@
// URLs used by galaxy.workflows.js
var tool_search_url = "${h.url_for( controller='root', action='tool_search' )}",
- get_datatypes_url = "${h.url_for( controller='workflow', action='get_datatypes' )}",
+ get_datatypes_url = "${h.url_for( '/api/datatypes/mapping' )}",
load_workflow_url = "${h.url_for( controller='workflow', action='load_workflow' )}",
run_workflow_url = "${h.url_for( controller='root', action='index', workflow_id=trans.security.encode_id(stored.id))}",
rename_async_url = "${h.url_for( controller='workflow', action='rename_async', id=trans.security.encode_id(stored.id) )}",
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Tool API test submitting multiple select checkboxes as a list of values.
by commits-noreply@bitbucket.org 25 Sep '14
by commits-noreply@bitbucket.org 25 Sep '14
25 Sep '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/09aa10faa300/
Changeset: 09aa10faa300
User: jmchilton
Date: 2014-09-25 00:08:03+00:00
Summary: Tool API test submitting multiple select checkboxes as a list of values.
Run with:
./run_tests.sh -with_framework_test_tools -api test/api/test_tools.py:ToolsTestCase.test_multi_select_as_list
Affected #: 1 file
diff -r 85c30938943db094cd54c3848b8402efb0ffd590 -r 09aa10faa300c54071abff167f301dade9b76b95 test/api/test_tools.py
--- a/test/api/test_tools.py
+++ b/test/api/test_tools.py
@@ -95,6 +95,17 @@
result_content = self._upload_and_get_content( table )
self.assertEquals( result_content, table )
+ @skip_without_tool( "multi_select" )
+ def test_multi_select_as_list( self ):
+ history_id = self.dataset_populator.new_history()
+ inputs = {
+ "select_ex": ["--ex1", "ex2"],
+ }
+ response = self._run( "multi_select", history_id, inputs, assert_ok=True )
+ output = response[ "outputs" ][ 0 ]
+ output1_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output )
+ assert output1_content == "--ex1,ex2"
+
@skip_without_tool( "cat1" )
def test_run_cat1( self ):
# Run simple non-upload tool with an input data parameter.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: davebgx: scripts/common_startup.sh executes fetch_eggs.py correctly.
by commits-noreply@bitbucket.org 25 Sep '14
by commits-noreply@bitbucket.org 25 Sep '14
25 Sep '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/85c30938943d/
Changeset: 85c30938943d
User: davebgx
Date: 2014-09-24 20:54:53+00:00
Summary: scripts/common_startup.sh executes fetch_eggs.py correctly.
Affected #: 1 file
diff -r 583d9ba9c4f9673c42f4378829b741845e95f1c0 -r 85c30938943db094cd54c3848b8402efb0ffd590 buildbot_setup.sh
--- a/buildbot_setup.sh
+++ b/buildbot_setup.sh
@@ -126,5 +126,3 @@
echo "Appending tool-data/shared/ucsc/builds.txt.buildbot to tool-data/shared/ucsc/builds.txt"
cat tool-data/shared/ucsc/builds.txt.buildbot >> tool-data/shared/ucsc/builds.txt
-
-python ./scripts/fetch_eggs.py all
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
[galaxyproject/usegalaxy-playbook] b313e0: Update Pulsar's Galaxy clone at the same time as G...
by GitHub 25 Sep '14
by GitHub 25 Sep '14
25 Sep '14
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: b313e093118a58233c2b15eaab5b3aa8fff36d26
https://github.com/galaxyproject/usegalaxy-playbook/commit/b313e093118a5823…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2014-09-24 (Wed, 24 Sep 2014)
Changed paths:
M galaxy.yml
Log Message:
-----------
Update Pulsar's Galaxy clone at the same time as Galaxy so I stop
forgetting to do it as a second step.
1
0
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: 716cc2b4d668f6c24bf75790c8681705441156e2
https://github.com/galaxyproject/usegalaxy-playbook/commit/716cc2b4d668f6c2…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2014-09-24 (Wed, 24 Sep 2014)
Changed paths:
M production/group_vars/all.yml
Log Message:
-----------
Update Main.
1
0
Branch: refs/heads/master
Home: https://github.com/galaxyproject/usegalaxy-playbook
Commit: c571cd114dac2da43631ee10ae510064c501b373
https://github.com/galaxyproject/usegalaxy-playbook/commit/c571cd114dac2da4…
Author: Nate Coraor <nate(a)bx.psu.edu>
Date: 2014-09-24 (Wed, 24 Sep 2014)
Changed paths:
M stage/group_vars/all.yml
Log Message:
-----------
Update Test.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7aed3778587e/
Changeset: 7aed3778587e
Branch: next-stable
User: jmchilton
Date: 2014-09-24 19:21:44+00:00
Summary: Allow remotely executed tools to write version files to the temp directory.
Like with discovered datasets - such use of this directory should be phased out in favor of the job's working directory of a job relative to it.
Affected #: 1 file
diff -r 381c547b681aa09fccab1b03963377115d9d7cc4 -r 7aed3778587ed9d8e703721adc0f8e4df656e902 lib/galaxy/webapps/galaxy/api/job_files.py
--- a/lib/galaxy/webapps/galaxy/api/job_files.py
+++ b/lib/galaxy/webapps/galaxy/api/job_files.py
@@ -118,9 +118,16 @@
https://gist.github.com/jmchilton/9103619.)
"""
in_work_dir = self.__in_working_directory( job, path, trans.app )
- if not in_work_dir and not self.__is_output_dataset_path( job, path ):
+ allow_temp_dir_file = self.__is_allowed_temp_dir_file( trans.app, job, path )
+ if not in_work_dir and not allow_temp_dir_file and not self.__is_output_dataset_path( job, path ):
raise exceptions.ItemAccessibilityException("Job is not authorized to write to supplied path.")
+ def __is_allowed_temp_dir_file( self, app, job, path ):
+ # grrr.. need to get away from new_file_path - these should be written
+ # to job working directory like metadata files.
+ in_temp_dir = util.in_directory( path, app.config.new_file_path )
+ return in_temp_dir and os.path.split( path )[ -1 ].startswith( "GALAXY_VERSION_")
+
def __is_output_dataset_path( self, job, path ):
""" Check if is an output path for this job or a file in the an
output's extra files path.
https://bitbucket.org/galaxy/galaxy-central/commits/5296d69134bd/
Changeset: 5296d69134bd
Branch: next-stable
User: jmchilton
Date: 2014-09-24 19:21:44+00:00
Summary: Rework version command to work with job wrappers that have not had 'prepare' executed.
Traditionally all synchronous job wrappers have had 'prepare' called when they are queued up, but prepare isn't called on the more transient job wrappers that are created in response to Pulsar asnchronous status update messages.
Affected #: 1 file
diff -r 7aed3778587ed9d8e703721adc0f8e4df656e902 -r 5296d69134bddeb11246c70347d83c6073da646f lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -1035,7 +1035,7 @@
else:
final_job_state = job.states.ERROR
- if self.write_version_cmd:
+ if self.tool.version_string_cmd:
version_filename = self.get_version_string_path()
if os.path.exists(version_filename):
self.version_string = open(version_filename).read()
https://bitbucket.org/galaxy/galaxy-central/commits/583d9ba9c4f9/
Changeset: 583d9ba9c4f9
User: jmchilton
Date: 2014-09-24 19:23:08+00:00
Summary: Merge next-stable.
Affected #: 2 files
diff -r fda2251972f612ded8c3c5cb096795ace194d192 -r 583d9ba9c4f9673c42f4378829b741845e95f1c0 lib/galaxy/jobs/__init__.py
--- a/lib/galaxy/jobs/__init__.py
+++ b/lib/galaxy/jobs/__init__.py
@@ -1035,7 +1035,7 @@
else:
final_job_state = job.states.ERROR
- if self.write_version_cmd:
+ if self.tool.version_string_cmd:
version_filename = self.get_version_string_path()
if os.path.exists(version_filename):
self.version_string = open(version_filename).read()
diff -r fda2251972f612ded8c3c5cb096795ace194d192 -r 583d9ba9c4f9673c42f4378829b741845e95f1c0 lib/galaxy/webapps/galaxy/api/job_files.py
--- a/lib/galaxy/webapps/galaxy/api/job_files.py
+++ b/lib/galaxy/webapps/galaxy/api/job_files.py
@@ -118,9 +118,16 @@
https://gist.github.com/jmchilton/9103619.)
"""
in_work_dir = self.__in_working_directory( job, path, trans.app )
- if not in_work_dir and not self.__is_output_dataset_path( job, path ):
+ allow_temp_dir_file = self.__is_allowed_temp_dir_file( trans.app, job, path )
+ if not in_work_dir and not allow_temp_dir_file and not self.__is_output_dataset_path( job, path ):
raise exceptions.ItemAccessibilityException("Job is not authorized to write to supplied path.")
+ def __is_allowed_temp_dir_file( self, app, job, path ):
+ # grrr.. need to get away from new_file_path - these should be written
+ # to job working directory like metadata files.
+ in_temp_dir = util.in_directory( path, app.config.new_file_path )
+ return in_temp_dir and os.path.split( path )[ -1 ].startswith( "GALAXY_VERSION_")
+
def __is_output_dataset_path( self, job, path ):
""" Check if is an output path for this job or a file in the an
output's extra files path.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: History panel: allow toggling show_hidden/deleted without altering the sessionStorage preferences
by commits-noreply@bitbucket.org 25 Sep '14
by commits-noreply@bitbucket.org 25 Sep '14
25 Sep '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fda2251972f6/
Changeset: fda2251972f6
User: carlfeberhard
Date: 2014-09-24 18:54:33+00:00
Summary: History panel: allow toggling show_hidden/deleted without altering the sessionStorage preferences
Affected #: 6 files
diff -r 139468c177324ecce07469265692988e92fb3842 -r fda2251972f612ded8c3c5cb096795ace194d192 client/galaxy/scripts/mvc/history/history-panel-edit.js
--- a/client/galaxy/scripts/mvc/history/history-panel-edit.js
+++ b/client/galaxy/scripts/mvc/history/history-panel-edit.js
@@ -284,7 +284,6 @@
view.$el.slideDown( panel.fxSpeed );
},
-
/** In this override, add purgeAllowed and whether tags/annotation editors should be shown */
_getItemViewOptions : function( model ){
var options = _super.prototype._getItemViewOptions.call( this, model );
@@ -301,7 +300,7 @@
* @param {Model} the item model to check
*/
_handleHdaDeletionChange : function( itemModel ){
- if( itemModel.get( 'deleted' ) && !this.storage.get( 'show_deleted' ) ){
+ if( itemModel.get( 'deleted' ) && !this.showDeleted ){
this.removeItemView( itemModel );
}
},
@@ -310,7 +309,7 @@
* @param {Model} the item model to check
*/
_handleHdaVisibleChange : function( itemModel ){
- if( itemModel.hidden() && !this.storage.get( 'show_hidden' ) ){
+ if( itemModel.hidden() && !this.storage.showHidden ){
this.removeItemView( itemModel );
}
},
diff -r 139468c177324ecce07469265692988e92fb3842 -r fda2251972f612ded8c3c5cb096795ace194d192 client/galaxy/scripts/mvc/history/history-panel.js
--- a/client/galaxy/scripts/mvc/history/history-panel.js
+++ b/client/galaxy/scripts/mvc/history/history-panel.js
@@ -254,6 +254,10 @@
_setUpWebStorage : function( initiallyExpanded, show_deleted, show_hidden ){
//if( !this.model ){ return this; }
//this.log( '_setUpWebStorage', initiallyExpanded, show_deleted, show_hidden );
+ if( this.storage ){
+ this.stopListening( this.storage );
+ }
+
this.storage = new HistoryPrefs({
id: HistoryPrefs.historyStorageKey( this.model.get( 'id' ) )
});
@@ -276,6 +280,18 @@
this.trigger( 'new-storage', this.storage, this );
this.log( this + ' (init\'d) storage:', this.storage.get() );
+
+ this.listenTo( this.storage, {
+ 'change:show_deleted' : function( view, newVal ){
+ this.showDeleted = newVal;
+ },
+ 'change:show_hidden' : function( view, newVal ){
+ this.showHidden = newVal;
+ }
+ }, this );
+ this.showDeleted = ( show_deleted !== undefined )? show_deleted : this.storage.get( 'show_deleted' );
+ this.showHidden = ( show_hidden !== undefined )? show_hidden : this.storage.get( 'show_hidden' );
+
return this;
},
@@ -317,8 +333,8 @@
_filterItem : function( model ){
var panel = this;
return ( _super.prototype._filterItem.call( panel, model )
- && ( !model.hidden() || panel.storage.get( 'show_hidden' ) )
- && ( !model.isDeletedOrPurged() || panel.storage.get( 'show_deleted' ) ) );
+ && ( !model.hidden() || panel.showHidden )
+ && ( !model.isDeletedOrPurged() || panel.showDeleted ) );
},
/** in this override, add a linktarget, and expand if id is in web storage */
@@ -372,12 +388,16 @@
* (2) re-rendering the history
* @returns {Boolean} new show_deleted setting
*/
- toggleShowDeleted : function( show ){
- show = ( show !== undefined )?( show ):( !this.storage.get( 'show_deleted' ) );
- this.storage.set( 'show_deleted', show );
+ toggleShowDeleted : function( show, store ){
+ show = ( show !== undefined )?( show ):( !this.showDeleted );
+ store = ( store !== undefined )?( store ):( true );
+ this.showDeleted = show;
+ if( store ){
+ this.storage.set( 'show_deleted', show );
+ }
//TODO:?? to events on storage('change:show_deleted')
this.renderItems();
- return this.storage.get( 'show_deleted' );
+ return this.showDeleted;
},
/** Handle the user toggling the deleted visibility by:
@@ -385,12 +405,16 @@
* (2) re-rendering the history
* @returns {Boolean} new show_hidden setting
*/
- toggleShowHidden : function( show ){
- show = ( show !== undefined )?( show ):( !this.storage.get( 'show_hidden' ) );
- this.storage.set( 'show_hidden', show );
- //TODO:?? to events on storage('change:show_hidden')
+ toggleShowHidden : function( show, store ){
+ show = ( show !== undefined )?( show ):( !this.showHidden );
+ store = ( store !== undefined )?( store ):( true );
+ this.showHidden = show;
+ if( store ){
+ this.storage.set( 'show_hidden', show );
+ }
+ //TODO:?? to events on storage('change:show_deleted')
this.renderItems();
- return this.storage.get( 'show_hidden' );
+ return this.showHidden;
},
/** On the first search, if there are no details - load them, then search */
diff -r 139468c177324ecce07469265692988e92fb3842 -r fda2251972f612ded8c3c5cb096795ace194d192 static/scripts/mvc/history/history-panel-edit.js
--- a/static/scripts/mvc/history/history-panel-edit.js
+++ b/static/scripts/mvc/history/history-panel-edit.js
@@ -284,7 +284,6 @@
view.$el.slideDown( panel.fxSpeed );
},
-
/** In this override, add purgeAllowed and whether tags/annotation editors should be shown */
_getItemViewOptions : function( model ){
var options = _super.prototype._getItemViewOptions.call( this, model );
@@ -301,7 +300,7 @@
* @param {Model} the item model to check
*/
_handleHdaDeletionChange : function( itemModel ){
- if( itemModel.get( 'deleted' ) && !this.storage.get( 'show_deleted' ) ){
+ if( itemModel.get( 'deleted' ) && !this.showDeleted ){
this.removeItemView( itemModel );
}
},
@@ -310,7 +309,7 @@
* @param {Model} the item model to check
*/
_handleHdaVisibleChange : function( itemModel ){
- if( itemModel.hidden() && !this.storage.get( 'show_hidden' ) ){
+ if( itemModel.hidden() && !this.storage.showHidden ){
this.removeItemView( itemModel );
}
},
diff -r 139468c177324ecce07469265692988e92fb3842 -r fda2251972f612ded8c3c5cb096795ace194d192 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -254,6 +254,10 @@
_setUpWebStorage : function( initiallyExpanded, show_deleted, show_hidden ){
//if( !this.model ){ return this; }
//this.log( '_setUpWebStorage', initiallyExpanded, show_deleted, show_hidden );
+ if( this.storage ){
+ this.stopListening( this.storage );
+ }
+
this.storage = new HistoryPrefs({
id: HistoryPrefs.historyStorageKey( this.model.get( 'id' ) )
});
@@ -276,6 +280,18 @@
this.trigger( 'new-storage', this.storage, this );
this.log( this + ' (init\'d) storage:', this.storage.get() );
+
+ this.listenTo( this.storage, {
+ 'change:show_deleted' : function( view, newVal ){
+ this.showDeleted = newVal;
+ },
+ 'change:show_hidden' : function( view, newVal ){
+ this.showHidden = newVal;
+ }
+ }, this );
+ this.showDeleted = ( show_deleted !== undefined )? show_deleted : this.storage.get( 'show_deleted' );
+ this.showHidden = ( show_hidden !== undefined )? show_hidden : this.storage.get( 'show_hidden' );
+
return this;
},
@@ -317,8 +333,8 @@
_filterItem : function( model ){
var panel = this;
return ( _super.prototype._filterItem.call( panel, model )
- && ( !model.hidden() || panel.storage.get( 'show_hidden' ) )
- && ( !model.isDeletedOrPurged() || panel.storage.get( 'show_deleted' ) ) );
+ && ( !model.hidden() || panel.showHidden )
+ && ( !model.isDeletedOrPurged() || panel.showDeleted ) );
},
/** in this override, add a linktarget, and expand if id is in web storage */
@@ -372,12 +388,16 @@
* (2) re-rendering the history
* @returns {Boolean} new show_deleted setting
*/
- toggleShowDeleted : function( show ){
- show = ( show !== undefined )?( show ):( !this.storage.get( 'show_deleted' ) );
- this.storage.set( 'show_deleted', show );
+ toggleShowDeleted : function( show, store ){
+ show = ( show !== undefined )?( show ):( !this.showDeleted );
+ store = ( store !== undefined )?( store ):( true );
+ this.showDeleted = show;
+ if( store ){
+ this.storage.set( 'show_deleted', show );
+ }
//TODO:?? to events on storage('change:show_deleted')
this.renderItems();
- return this.storage.get( 'show_deleted' );
+ return this.showDeleted;
},
/** Handle the user toggling the deleted visibility by:
@@ -385,12 +405,16 @@
* (2) re-rendering the history
* @returns {Boolean} new show_hidden setting
*/
- toggleShowHidden : function( show ){
- show = ( show !== undefined )?( show ):( !this.storage.get( 'show_hidden' ) );
- this.storage.set( 'show_hidden', show );
- //TODO:?? to events on storage('change:show_hidden')
+ toggleShowHidden : function( show, store ){
+ show = ( show !== undefined )?( show ):( !this.showHidden );
+ store = ( store !== undefined )?( store ):( true );
+ this.showHidden = show;
+ if( store ){
+ this.storage.set( 'show_hidden', show );
+ }
+ //TODO:?? to events on storage('change:show_deleted')
this.renderItems();
- return this.storage.get( 'show_hidden' );
+ return this.showHidden;
},
/** On the first search, if there are no details - load them, then search */
diff -r 139468c177324ecce07469265692988e92fb3842 -r fda2251972f612ded8c3c5cb096795ace194d192 static/scripts/packed/mvc/history/history-panel-edit.js
--- a/static/scripts/packed/mvc/history/history-panel-edit.js
+++ b/static/scripts/packed/mvc/history/history-panel-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-panel","mvc/history/history-contents","mvc/dataset/states","mvc/history/hda-model","mvc/history/hda-li-edit","mvc/history/hdca-li-edit","mvc/tags","mvc/annotations","utils/localization"],function(f,h,k,d,c,g,j,a,b){var i=f.HistoryPanel;var e=i.extend({HDAViewClass:c.HDAListItemEdit,HDCAViewClass:g.HDCAListItemEdit,initialize:function(l){l=l||{};i.prototype.initialize.call(this,l);this.tagsEditor=null;this.annotationEditor=null;this.purgeAllowed=l.purgeAllowed||false;this.annotationEditorShown=l.annotationEditorShown||false;this.tagsEditorShown=l.tagsEditorShown||false;this.multiselectActions=l.multiselectActions||this._getActions()},_setUpCollectionListeners:function(){i.prototype._setUpCollectionListeners.call(this);this.collection.on("change:deleted",this._handleHdaDeletionChange,this);this.collection.on("change:visible",this._handleHdaVisibleChange,this);this.collection.on("change:purged",function(l){this.model.fetch()},this);return this},_setUpModelListeners:function(){i.prototype._setUpModelListeners.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);return this},_buildNewRender:function(){var l=i.prototype._buildNewRender.call(this);if(!this.model){return l}if(Galaxy&&Galaxy.currUser&&Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(l);this._renderAnnotation(l)}return l},_renderTags:function(l){var m=this;this.tagsEditor=new j.TagsEditor({model:this.model,el:l.find(".controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){m.toggleHDATagEditors(true,m.fxSpeed)},onhide:function(){m.toggleHDATagEditors(false,m.fxSpeed)},$activator:faIconButton({title:b("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(l.find(".controls .actions"))})},_renderAnnotation:function(l){var m=this;this.annotationEditor=new a.AnnotationEditor({model:this.model,el:l.find(".controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){m.toggleHDAAnnotationEditors(true,m.fxSpeed)},onhide:function(){m.toggleHDAAnnotationEditors(false,m.fxSpeed)},$activator:faIconButton({title:b("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(l.find(".controls .actions"))})},_setUpBehaviors:function(l){l=l||this.$el;i.prototype._setUpBehaviors.call(this,l);if(!this.model){return}if(this.multiselectActions.length){this.actionsPopup=new PopupMenu(l.find(".list-action-popup-btn"),this.multiselectActions)}if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var m=this,n=".controls .name";l.find(n).attr("title",b("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(o){var p=m.model.get("name");if(o&&o!==p){m.$el.find(n).text(o);m.model.save({name:o}).fail(function(){m.$el.find(n).text(m.model.previous("name"))})}else{m.$el.find(n).text(p)}}})},_getActions:function(){var l=this,m=[{html:b("Hide datasets"),func:function(){var n=d.HistoryDatasetAssociation.prototype.hide;l.getSelectedModels().ajaxQueue(n)}},{html:b("Unhide datasets"),func:function(){var n=d.HistoryDatasetAssociation.prototype.unhide;l.getSelectedModels().ajaxQueue(n)}},{html:b("Delete datasets"),func:function(){var n=d.HistoryDatasetAssociation.prototype["delete"];l.getSelectedModels().ajaxQueue(n)}},{html:b("Undelete datasets"),func:function(){var n=d.HistoryDatasetAssociation.prototype.undelete;l.getSelectedModels().ajaxQueue(n)}}];if(l.purgeAllowed){m.push({html:b("Permanently delete datasets"),func:function(){if(confirm(b("This will permanently remove the data in your datasets. Are you sure?"))){var n=d.HistoryDatasetAssociation.prototype.purge;l.getSelectedModels().ajaxQueue(n)}}})}m.push({html:b("Build Dataset List"),func:function(){l.getSelectedModels().promoteToHistoryDatasetCollection(l.model,"list")}});m.push({html:b("Build Dataset Pair"),func:function(){l.getSelectedModels().promoteToHistoryDatasetCollection(l.model,"paired")}});m.push({html:b("Build List of Dataset Pairs"),func:_.bind(l._showPairedCollectionModal,l)});return m},_showPairedCollectionModal:function(){var l=this,m=l.getSelectedModels().toJSON().filter(function(n){return n.history_content_type==="dataset"&&n.state===k.OK});if(m.length){require(["mvc/collection/paired-collection-creator"],function(n){window.creator=n.pairedCollectionCreatorModal(m,{historyId:l.model.id})})}else{}},_attachItems:function(l){this.$list(l).append(this.views.reverse().map(function(m){return m.$el}));return this},_attachView:function(m){var l=this;l.views.unshift(m);l.$list().prepend(m.render(0).$el.hide());m.$el.slideDown(l.fxSpeed)},_getItemViewOptions:function(m){var l=i.prototype._getItemViewOptions.call(this,m);_.extend(l,{purgeAllowed:this.purgeAllowed,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});return l},_handleHdaDeletionChange:function(l){if(l.get("deleted")&&!this.storage.get("show_deleted")){this.removeItemView(l)}},_handleHdaVisibleChange:function(l){if(l.hidden()&&!this.storage.get("show_hidden")){this.removeItemView(l)}},toggleHDATagEditors:function(l){var m=Array.prototype.slice.call(arguments,1);_.each(this.views,function(n){if(n.tagsEditor){n.tagsEditor.toggle.apply(n.tagsEditor,m)}})},toggleHDAAnnotationEditors:function(l){var m=Array.prototype.slice.call(arguments,1);_.each(this.views,function(n){if(n.annotationEditor){n.annotationEditor.toggle.apply(n.annotationEditor,m)}})},events:_.extend(_.clone(i.prototype.events),{"click .show-selectors-btn":"toggleSelectors"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},toString:function(){return"HistoryPanelEdit("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanelEdit:e}});
\ No newline at end of file
+define(["mvc/history/history-panel","mvc/history/history-contents","mvc/dataset/states","mvc/history/hda-model","mvc/history/hda-li-edit","mvc/history/hdca-li-edit","mvc/tags","mvc/annotations","utils/localization"],function(f,h,k,d,c,g,j,a,b){var i=f.HistoryPanel;var e=i.extend({HDAViewClass:c.HDAListItemEdit,HDCAViewClass:g.HDCAListItemEdit,initialize:function(l){l=l||{};i.prototype.initialize.call(this,l);this.tagsEditor=null;this.annotationEditor=null;this.purgeAllowed=l.purgeAllowed||false;this.annotationEditorShown=l.annotationEditorShown||false;this.tagsEditorShown=l.tagsEditorShown||false;this.multiselectActions=l.multiselectActions||this._getActions()},_setUpCollectionListeners:function(){i.prototype._setUpCollectionListeners.call(this);this.collection.on("change:deleted",this._handleHdaDeletionChange,this);this.collection.on("change:visible",this._handleHdaVisibleChange,this);this.collection.on("change:purged",function(l){this.model.fetch()},this);return this},_setUpModelListeners:function(){i.prototype._setUpModelListeners.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);return this},_buildNewRender:function(){var l=i.prototype._buildNewRender.call(this);if(!this.model){return l}if(Galaxy&&Galaxy.currUser&&Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(l);this._renderAnnotation(l)}return l},_renderTags:function(l){var m=this;this.tagsEditor=new j.TagsEditor({model:this.model,el:l.find(".controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){m.toggleHDATagEditors(true,m.fxSpeed)},onhide:function(){m.toggleHDATagEditors(false,m.fxSpeed)},$activator:faIconButton({title:b("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(l.find(".controls .actions"))})},_renderAnnotation:function(l){var m=this;this.annotationEditor=new a.AnnotationEditor({model:this.model,el:l.find(".controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){m.toggleHDAAnnotationEditors(true,m.fxSpeed)},onhide:function(){m.toggleHDAAnnotationEditors(false,m.fxSpeed)},$activator:faIconButton({title:b("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(l.find(".controls .actions"))})},_setUpBehaviors:function(l){l=l||this.$el;i.prototype._setUpBehaviors.call(this,l);if(!this.model){return}if(this.multiselectActions.length){this.actionsPopup=new PopupMenu(l.find(".list-action-popup-btn"),this.multiselectActions)}if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var m=this,n=".controls .name";l.find(n).attr("title",b("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(o){var p=m.model.get("name");if(o&&o!==p){m.$el.find(n).text(o);m.model.save({name:o}).fail(function(){m.$el.find(n).text(m.model.previous("name"))})}else{m.$el.find(n).text(p)}}})},_getActions:function(){var l=this,m=[{html:b("Hide datasets"),func:function(){var n=d.HistoryDatasetAssociation.prototype.hide;l.getSelectedModels().ajaxQueue(n)}},{html:b("Unhide datasets"),func:function(){var n=d.HistoryDatasetAssociation.prototype.unhide;l.getSelectedModels().ajaxQueue(n)}},{html:b("Delete datasets"),func:function(){var n=d.HistoryDatasetAssociation.prototype["delete"];l.getSelectedModels().ajaxQueue(n)}},{html:b("Undelete datasets"),func:function(){var n=d.HistoryDatasetAssociation.prototype.undelete;l.getSelectedModels().ajaxQueue(n)}}];if(l.purgeAllowed){m.push({html:b("Permanently delete datasets"),func:function(){if(confirm(b("This will permanently remove the data in your datasets. Are you sure?"))){var n=d.HistoryDatasetAssociation.prototype.purge;l.getSelectedModels().ajaxQueue(n)}}})}m.push({html:b("Build Dataset List"),func:function(){l.getSelectedModels().promoteToHistoryDatasetCollection(l.model,"list")}});m.push({html:b("Build Dataset Pair"),func:function(){l.getSelectedModels().promoteToHistoryDatasetCollection(l.model,"paired")}});m.push({html:b("Build List of Dataset Pairs"),func:_.bind(l._showPairedCollectionModal,l)});return m},_showPairedCollectionModal:function(){var l=this,m=l.getSelectedModels().toJSON().filter(function(n){return n.history_content_type==="dataset"&&n.state===k.OK});if(m.length){require(["mvc/collection/paired-collection-creator"],function(n){window.creator=n.pairedCollectionCreatorModal(m,{historyId:l.model.id})})}else{}},_attachItems:function(l){this.$list(l).append(this.views.reverse().map(function(m){return m.$el}));return this},_attachView:function(m){var l=this;l.views.unshift(m);l.$list().prepend(m.render(0).$el.hide());m.$el.slideDown(l.fxSpeed)},_getItemViewOptions:function(m){var l=i.prototype._getItemViewOptions.call(this,m);_.extend(l,{purgeAllowed:this.purgeAllowed,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});return l},_handleHdaDeletionChange:function(l){if(l.get("deleted")&&!this.showDeleted){this.removeItemView(l)}},_handleHdaVisibleChange:function(l){if(l.hidden()&&!this.storage.showHidden){this.removeItemView(l)}},toggleHDATagEditors:function(l){var m=Array.prototype.slice.call(arguments,1);_.each(this.views,function(n){if(n.tagsEditor){n.tagsEditor.toggle.apply(n.tagsEditor,m)}})},toggleHDAAnnotationEditors:function(l){var m=Array.prototype.slice.call(arguments,1);_.each(this.views,function(n){if(n.annotationEditor){n.annotationEditor.toggle.apply(n.annotationEditor,m)}})},events:_.extend(_.clone(i.prototype.events),{"click .show-selectors-btn":"toggleSelectors"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},toString:function(){return"HistoryPanelEdit("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanelEdit:e}});
\ No newline at end of file
diff -r 139468c177324ecce07469265692988e92fb3842 -r fda2251972f612ded8c3c5cb096795ace194d192 static/scripts/packed/mvc/history/history-panel.js
--- a/static/scripts/packed/mvc/history/history-panel.js
+++ b/static/scripts/packed/mvc/history/history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/list/list-panel","mvc/history/history-model","mvc/history/history-contents","mvc/history/hda-li","mvc/history/hdca-li","mvc/collection/collection-panel","mvc/user/user-model","mvc/base-mvc","utils/localization"],function(d,f,l,b,a,m,g,o,e){var j=o.SessionStorageModel.extend({defaults:{expandedIds:{},show_deleted:false,show_hidden:false},addExpanded:function(p){var q="expandedIds";this.save(q,_.extend(this.get(q),_.object([p.id],[p.get("id")])))},removeExpanded:function(p){var q="expandedIds";this.save(q,_.omit(this.get(q),p.id))},toString:function(){return"HistoryPrefs("+this.id+")"}});j.storageKeyPrefix="history:";j.historyStorageKey=function h(p){if(!p){throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+p)}return(j.storageKeyPrefix+p)};j.get=function c(p){return new j({id:j.historyStorageKey(p)})};j.clearAll=function i(q){for(var p in sessionStorage){if(p.indexOf(j.storageKeyPrefix)===0){sessionStorage.removeItem(p)}}};var n=d.ModelListPanel;var k=n.extend({HDAViewClass:b.HDAListItemView,HDCAViewClass:a.HDCAListItemView,collectionClass:l.HistoryContents,modelCollectionKey:"contents",tagName:"div",className:n.prototype.className+" history-panel",emptyMsg:e("This history is empty"),noneFoundMsg:e("No matching datasets found"),searchPlaceholder:e("search datasets"),initialize:function(p){n.prototype.initialize.call(this,p);this.linkTarget=p.linkTarget||"_blank"},freeModel:function(){n.prototype.freeModel.call(this);if(this.model){this.model.clearUpdateTimeout()}return this},_setUpListeners:function(){n.prototype._setUpListeners.call(this);this.on("error",function(q,t,p,s,r){this.errorHandler(q,t,p,s,r)});this.on("loading-done",function(){if(!this.views.length){this.trigger("empty-history",this)}})},loadHistoryWithDetails:function(s,r,q,t){this.info("loadHistoryWithDetails:",s,r,q,t);var p=function(u){return _.values(j.get(u.id).get("expandedIds"))};return this.loadHistory(s,r,q,t,p)},loadHistory:function(t,s,r,u,p){this.info("loadHistory:",t,s,r,u,p);var q=this;s=s||{};q.trigger("loading",q);var v=f.History.getHistoryData(t,{historyFn:r,contentsFn:u,detailIdsFn:s.initiallyExpanded||p});return q._loadHistoryFromXHR(v,s).fail(function(y,w,x){q.trigger("error",q,y,s,e("An error was encountered while "+w),{historyId:t,history:x||{}})}).always(function(){q.trigger("loading-done",q)})},_loadHistoryFromXHR:function(r,q){var p=this;r.then(function(s,t){p.JSONToModel(s,t,q);p.render()});r.fail(function(t,s){p.render()});return r},refreshContents:function(q,p){if(this.model){return this.model.refresh(q,p)}return $.when()},JSONToModel:function(s,p,q){this.log("JSONToModel:",s,p,q);q=q||{};var r=new f.History(s,p,q);this.setModel(r);return r},setModel:function(q,p){p=p||{};n.prototype.setModel.call(this,q,p);if(this.model){this._setUpWebStorage(p.initiallyExpanded,p.show_deleted,p.show_hidden)}},_setUpWebStorage:function(q,p,r){this.storage=new j({id:j.historyStorageKey(this.model.get("id"))});if(_.isObject(q)){this.storage.set("expandedIds",q)}if(_.isBoolean(p)){this.storage.set("show_deleted",p)}if(_.isBoolean(r)){this.storage.set("show_hidden",r)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get());return this},_buildNewRender:function(){var p=n.prototype._buildNewRender.call(this);if(this.multiselectActions.length){p.find(".controls .actions").prepend(this._renderSelectButton())}return p},_renderSelectButton:function(p){return faIconButton({title:e("Operations on multiple datasets"),classes:"show-selectors-btn",faIcon:"fa-check-square-o"})},_getItemViewClass:function(p){var q=p.get("history_content_type");switch(q){case"dataset":return this.HDAViewClass;case"dataset_collection":return this.HDCAViewClass}throw new TypeError("Unknown history_content_type: "+q)},_filterItem:function(q){var p=this;return(n.prototype._filterItem.call(p,q)&&(!q.hidden()||p.storage.get("show_hidden"))&&(!q.isDeletedOrPurged()||p.storage.get("show_deleted")))},_getItemViewOptions:function(q){var p=n.prototype._getItemViewOptions.call(this,q);return _.extend(p,{linkTarget:this.linkTarget,expanded:!!this.storage.get("expandedIds")[q.id],hasUser:this.model.ownedByCurrUser()})},_setUpItemViewListeners:function(q){var p=this;n.prototype._setUpItemViewListeners.call(p,q);q.on("expanded",function(r){p.storage.addExpanded(r.model)});q.on("collapsed",function(r){p.storage.removeExpanded(r.model)});return this},getSelectedModels:function(){var p=n.prototype.getSelectedModels.call(this);p.historyId=this.collection.historyId;return p},events:_.extend(_.clone(n.prototype.events),{"click .show-selectors-btn":"toggleSelectors"}),toggleShowDeleted:function(p){p=(p!==undefined)?(p):(!this.storage.get("show_deleted"));this.storage.set("show_deleted",p);this.renderItems();return this.storage.get("show_deleted")},toggleShowHidden:function(p){p=(p!==undefined)?(p):(!this.storage.get("show_hidden"));this.storage.set("show_hidden",p);this.renderItems();return this.storage.get("show_hidden")},_firstSearch:function(p){var q=this,r=".history-search-input";this.log("onFirstSearch",p);if(q.model.contents.haveDetails()){q.searchItems(p);return}q.$el.find(r).searchInput("toggle-loading");q.model.contents.fetchAllDetails({silent:true}).always(function(){q.$el.find(r).searchInput("toggle-loading")}).done(function(){q.searchItems(p)})},errorHandler:function(r,u,q,t,s){this.error(r,u,q,t,s);if(u&&u.status===0&&u.readyState===0){}else{if(u&&u.status===502){}else{var p=this._parseErrorMessage(r,u,q,t,s);if(!this.$messages().is(":visible")){this.once("rendered",function(){this.displayMessage("error",p.message,p.details)})}else{this.displayMessage("error",p.message,p.details)}}}},_parseErrorMessage:function(t,w,x,r,p,u){var s=Galaxy.currUser,v={message:this._bePolite(r),details:{message:r,raven:(window.Raven&&_.isFunction(Raven.lastEventId))?(Raven.lastEventId()):(undefined),agent:navigator.userAgent,url:(window.Galaxy)?(Galaxy.lastAjax.url):(undefined),data:(window.Galaxy)?(Galaxy.lastAjax.data):(undefined),options:(w)?(_.omit(x,"xhr")):(x),xhr:w,source:(_.isFunction(t.toJSON))?(t.toJSON()):(t+""),user:(s instanceof g.User)?(s.toJSON()):(s+"")}};_.extend(v.details,p||{});if(w&&_.isFunction(w.getAllResponseHeaders)){var q=w.getAllResponseHeaders();q=_.compact(q.split("\n"));q=_.map(q,function(y){return y.split(": ")});v.details.xhr.responseHeaders=_.object(q)}return v},_bePolite:function(p){p=p||e("An error occurred while getting updates from the server");return p+". "+e("Please contact a Galaxy administrator if the problem persists")+"."},displayMessage:function(u,v,t){var r=this;this.scrollToTop();var s=this.$messages(),p=$("<div/>").addClass(u+"message").html(v);if(!_.isEmpty(t)){var q=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(r._messageToModalOptions(u,v,t));return false});p.append(" ",q)}return s.html(p)},_messageToModalOptions:function(s,v,r){var p=this,q={title:"Details"};if(_.isObject(r)){r=_.omit(r,_.functions(r));var u=JSON.stringify(r,null," "),t=$("<pre/>").text(u);q.body=$("<div/>").append(t)}else{q.body=$("<div/>").html(r)}q.buttons={Ok:function(){Galaxy.modal.hide();p.clearMessages()}};return q},clearMessages:function(p){$(p.currentTarget).fadeOut(this.fxSpeed,function(){$(this).remove()});return this},scrollToHid:function(p){return this.scrollToItem(_.first(this.viewsWhereModel({hid:p})))},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});k.prototype.templates=(function(){var p=o.wrapTemplate(['<div class="controls">','<div class="title">','<div class="name"><%= history.name %></div>',"</div>",'<div class="subtitle">',"</div>",'<div class="history-size"><%= history.nice_size %></div>','<div class="actions"></div>','<div class="messages">',"<% if( history.deleted ){ %>",'<div class="deleted-msg warningmessagesmall">',e("This history has been deleted"),"</div>","<% } %>","<% if( history.message ){ %>",'<div class="<%= history.message.level || "info" %>messagesmall">',"<%= history.message.text %>","</div>","<% } %>","</div>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="search">','<div class="search-input"></div>',"</div>",'<div class="list-actions">','<div class="btn-group">','<button class="select-all btn btn-default"','data-mode="select">',e("All"),"</button>",'<button class="deselect-all btn btn-default"','data-mode="select">',e("None"),"</button>","</div>",'<button class="list-action-popup-btn btn btn-default">',e("For all selected"),"...</button>","</div>","</div>"],"history");return _.extend(_.clone(n.prototype.templates),{controls:p})}());return{HistoryPanel:k}});
\ No newline at end of file
+define(["mvc/list/list-panel","mvc/history/history-model","mvc/history/history-contents","mvc/history/hda-li","mvc/history/hdca-li","mvc/collection/collection-panel","mvc/user/user-model","mvc/base-mvc","utils/localization"],function(d,f,l,b,a,m,g,o,e){var j=o.SessionStorageModel.extend({defaults:{expandedIds:{},show_deleted:false,show_hidden:false},addExpanded:function(p){var q="expandedIds";this.save(q,_.extend(this.get(q),_.object([p.id],[p.get("id")])))},removeExpanded:function(p){var q="expandedIds";this.save(q,_.omit(this.get(q),p.id))},toString:function(){return"HistoryPrefs("+this.id+")"}});j.storageKeyPrefix="history:";j.historyStorageKey=function h(p){if(!p){throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+p)}return(j.storageKeyPrefix+p)};j.get=function c(p){return new j({id:j.historyStorageKey(p)})};j.clearAll=function i(q){for(var p in sessionStorage){if(p.indexOf(j.storageKeyPrefix)===0){sessionStorage.removeItem(p)}}};var n=d.ModelListPanel;var k=n.extend({HDAViewClass:b.HDAListItemView,HDCAViewClass:a.HDCAListItemView,collectionClass:l.HistoryContents,modelCollectionKey:"contents",tagName:"div",className:n.prototype.className+" history-panel",emptyMsg:e("This history is empty"),noneFoundMsg:e("No matching datasets found"),searchPlaceholder:e("search datasets"),initialize:function(p){n.prototype.initialize.call(this,p);this.linkTarget=p.linkTarget||"_blank"},freeModel:function(){n.prototype.freeModel.call(this);if(this.model){this.model.clearUpdateTimeout()}return this},_setUpListeners:function(){n.prototype._setUpListeners.call(this);this.on("error",function(q,t,p,s,r){this.errorHandler(q,t,p,s,r)});this.on("loading-done",function(){if(!this.views.length){this.trigger("empty-history",this)}})},loadHistoryWithDetails:function(s,r,q,t){this.info("loadHistoryWithDetails:",s,r,q,t);var p=function(u){return _.values(j.get(u.id).get("expandedIds"))};return this.loadHistory(s,r,q,t,p)},loadHistory:function(t,s,r,u,p){this.info("loadHistory:",t,s,r,u,p);var q=this;s=s||{};q.trigger("loading",q);var v=f.History.getHistoryData(t,{historyFn:r,contentsFn:u,detailIdsFn:s.initiallyExpanded||p});return q._loadHistoryFromXHR(v,s).fail(function(y,w,x){q.trigger("error",q,y,s,e("An error was encountered while "+w),{historyId:t,history:x||{}})}).always(function(){q.trigger("loading-done",q)})},_loadHistoryFromXHR:function(r,q){var p=this;r.then(function(s,t){p.JSONToModel(s,t,q);p.render()});r.fail(function(t,s){p.render()});return r},refreshContents:function(q,p){if(this.model){return this.model.refresh(q,p)}return $.when()},JSONToModel:function(s,p,q){this.log("JSONToModel:",s,p,q);q=q||{};var r=new f.History(s,p,q);this.setModel(r);return r},setModel:function(q,p){p=p||{};n.prototype.setModel.call(this,q,p);if(this.model){this._setUpWebStorage(p.initiallyExpanded,p.show_deleted,p.show_hidden)}},_setUpWebStorage:function(q,p,r){if(this.storage){this.stopListening(this.storage)}this.storage=new j({id:j.historyStorageKey(this.model.get("id"))});if(_.isObject(q)){this.storage.set("expandedIds",q)}if(_.isBoolean(p)){this.storage.set("show_deleted",p)}if(_.isBoolean(r)){this.storage.set("show_hidden",r)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get());this.listenTo(this.storage,{"change:show_deleted":function(s,t){this.showDeleted=t},"change:show_hidden":function(s,t){this.showHidden=t}},this);this.showDeleted=(p!==undefined)?p:this.storage.get("show_deleted");this.showHidden=(r!==undefined)?r:this.storage.get("show_hidden");return this},_buildNewRender:function(){var p=n.prototype._buildNewRender.call(this);if(this.multiselectActions.length){p.find(".controls .actions").prepend(this._renderSelectButton())}return p},_renderSelectButton:function(p){return faIconButton({title:e("Operations on multiple datasets"),classes:"show-selectors-btn",faIcon:"fa-check-square-o"})},_getItemViewClass:function(p){var q=p.get("history_content_type");switch(q){case"dataset":return this.HDAViewClass;case"dataset_collection":return this.HDCAViewClass}throw new TypeError("Unknown history_content_type: "+q)},_filterItem:function(q){var p=this;return(n.prototype._filterItem.call(p,q)&&(!q.hidden()||p.showHidden)&&(!q.isDeletedOrPurged()||p.showDeleted))},_getItemViewOptions:function(q){var p=n.prototype._getItemViewOptions.call(this,q);return _.extend(p,{linkTarget:this.linkTarget,expanded:!!this.storage.get("expandedIds")[q.id],hasUser:this.model.ownedByCurrUser()})},_setUpItemViewListeners:function(q){var p=this;n.prototype._setUpItemViewListeners.call(p,q);q.on("expanded",function(r){p.storage.addExpanded(r.model)});q.on("collapsed",function(r){p.storage.removeExpanded(r.model)});return this},getSelectedModels:function(){var p=n.prototype.getSelectedModels.call(this);p.historyId=this.collection.historyId;return p},events:_.extend(_.clone(n.prototype.events),{"click .show-selectors-btn":"toggleSelectors"}),toggleShowDeleted:function(p,q){p=(p!==undefined)?(p):(!this.showDeleted);q=(q!==undefined)?(q):(true);this.showDeleted=p;if(q){this.storage.set("show_deleted",p)}this.renderItems();return this.showDeleted},toggleShowHidden:function(p,q){p=(p!==undefined)?(p):(!this.showHidden);q=(q!==undefined)?(q):(true);this.showHidden=p;if(q){this.storage.set("show_hidden",p)}this.renderItems();return this.showHidden},_firstSearch:function(p){var q=this,r=".history-search-input";this.log("onFirstSearch",p);if(q.model.contents.haveDetails()){q.searchItems(p);return}q.$el.find(r).searchInput("toggle-loading");q.model.contents.fetchAllDetails({silent:true}).always(function(){q.$el.find(r).searchInput("toggle-loading")}).done(function(){q.searchItems(p)})},errorHandler:function(r,u,q,t,s){this.error(r,u,q,t,s);if(u&&u.status===0&&u.readyState===0){}else{if(u&&u.status===502){}else{var p=this._parseErrorMessage(r,u,q,t,s);if(!this.$messages().is(":visible")){this.once("rendered",function(){this.displayMessage("error",p.message,p.details)})}else{this.displayMessage("error",p.message,p.details)}}}},_parseErrorMessage:function(t,w,x,r,p,u){var s=Galaxy.currUser,v={message:this._bePolite(r),details:{message:r,raven:(window.Raven&&_.isFunction(Raven.lastEventId))?(Raven.lastEventId()):(undefined),agent:navigator.userAgent,url:(window.Galaxy)?(Galaxy.lastAjax.url):(undefined),data:(window.Galaxy)?(Galaxy.lastAjax.data):(undefined),options:(w)?(_.omit(x,"xhr")):(x),xhr:w,source:(_.isFunction(t.toJSON))?(t.toJSON()):(t+""),user:(s instanceof g.User)?(s.toJSON()):(s+"")}};_.extend(v.details,p||{});if(w&&_.isFunction(w.getAllResponseHeaders)){var q=w.getAllResponseHeaders();q=_.compact(q.split("\n"));q=_.map(q,function(y){return y.split(": ")});v.details.xhr.responseHeaders=_.object(q)}return v},_bePolite:function(p){p=p||e("An error occurred while getting updates from the server");return p+". "+e("Please contact a Galaxy administrator if the problem persists")+"."},displayMessage:function(u,v,t){var r=this;this.scrollToTop();var s=this.$messages(),p=$("<div/>").addClass(u+"message").html(v);if(!_.isEmpty(t)){var q=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(r._messageToModalOptions(u,v,t));return false});p.append(" ",q)}return s.html(p)},_messageToModalOptions:function(s,v,r){var p=this,q={title:"Details"};if(_.isObject(r)){r=_.omit(r,_.functions(r));var u=JSON.stringify(r,null," "),t=$("<pre/>").text(u);q.body=$("<div/>").append(t)}else{q.body=$("<div/>").html(r)}q.buttons={Ok:function(){Galaxy.modal.hide();p.clearMessages()}};return q},clearMessages:function(p){$(p.currentTarget).fadeOut(this.fxSpeed,function(){$(this).remove()});return this},scrollToHid:function(p){return this.scrollToItem(_.first(this.viewsWhereModel({hid:p})))},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});k.prototype.templates=(function(){var p=o.wrapTemplate(['<div class="controls">','<div class="title">','<div class="name"><%= history.name %></div>',"</div>",'<div class="subtitle">',"</div>",'<div class="history-size"><%= history.nice_size %></div>','<div class="actions"></div>','<div class="messages">',"<% if( history.deleted ){ %>",'<div class="deleted-msg warningmessagesmall">',e("This history has been deleted"),"</div>","<% } %>","<% if( history.message ){ %>",'<div class="<%= history.message.level || "info" %>messagesmall">',"<%= history.message.text %>","</div>","<% } %>","</div>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="search">','<div class="search-input"></div>',"</div>",'<div class="list-actions">','<div class="btn-group">','<button class="select-all btn btn-default"','data-mode="select">',e("All"),"</button>",'<button class="deselect-all btn btn-default"','data-mode="select">',e("None"),"</button>","</div>",'<button class="list-action-popup-btn btn btn-default">',e("For all selected"),"...</button>","</div>","</div>"],"history");return _.extend(_.clone(n.prototype.templates),{controls:p})}());return{HistoryPanel:k}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: ToolForm: Minor style fix
by commits-noreply@bitbucket.org 25 Sep '14
by commits-noreply@bitbucket.org 25 Sep '14
25 Sep '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/139468c17732/
Changeset: 139468c17732
User: guerler
Date: 2014-09-24 18:55:20+00:00
Summary: ToolForm: Minor style fix
Affected #: 2 files
diff -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 -r 139468c177324ecce07469265692988e92fb3842 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1294,7 +1294,7 @@
.ui-button-icon{margin-right:5px}.ui-button-icon ul i{font-size:1.2em;margin-right:5px;position:relative;top:1px}
.ui-button-icon .button{margin-right:5px;margin-left:5px}.ui-button-icon .button .title{position:relative;font-size:0.8em;font-weight:normal;top:-1px}
.ui-button-icon .button.disabled{filter:alpha(opacity=65);opacity:.65;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=65);filter:alpha(opacity=65)}
-.ui-button-icon-plain{border:none !important;background:none !important;height:inherit !important}
+.ui-button-icon-plain{border:none !important;background:none !important;height:inherit !important;width:inherit !important;padding-right:3px !important}
.ui-tabs .ui-tabs-add{font-size:0.8em;margin-right:5px}
.ui-tabs .ui-tabs-delete{font-size:0.8em;margin-left:5px;cursor:pointer}
.ui-portlet,.ui-portlet-repeat,.ui-portlet-repeat{border:solid #d6b161 1px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;position:relative;clear:both;width:auto;height:100%}.ui-portlet .portlet-header{background:#ebd9b2;border-bottom:solid #d6b161 1px;padding:2px 8px;overflow:visible;float:right;width:100%}.ui-portlet .portlet-header .portlet-title .portlet-title-text{vertical-align:middle}
diff -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 -r 139468c177324ecce07469265692988e92fb3842 static/style/src/less/ui.less
--- a/static/style/src/less/ui.less
+++ b/static/style/src/less/ui.less
@@ -110,6 +110,8 @@
border: none !important;
background: none !important;
height: inherit !important;
+ width: inherit !important;
+ padding-right: 3px !important;
}
.ui-tabs {
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: ToolForm: Additional validation for batch mode, style fixes
by commits-noreply@bitbucket.org 25 Sep '14
by commits-noreply@bitbucket.org 25 Sep '14
25 Sep '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5a846bf0080b/
Changeset: 5a846bf0080b
User: guerler
Date: 2014-09-24 18:37:34+00:00
Summary: ToolForm: Additional validation for batch mode, style fixes
Affected #: 11 files
diff -r 7d53a4a090a4b17ea46a256b4dc16712297d48ec -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 client/galaxy/scripts/mvc/tools/tools-jobs.js
--- a/client/galaxy/scripts/mvc/tools/tools-jobs.js
+++ b/client/galaxy/scripts/mvc/tools/tools-jobs.js
@@ -32,6 +32,7 @@
console.debug('tools-jobs::submit - Submission canceled. Validation failed.');
return;
}
+ console.log(job_def);
// post job
Utils.request('POST', galaxy_config.root + 'api/tools', job_def,
@@ -66,27 +67,59 @@
// validation flag
var valid = true;
- // check inputs
+ // link this
+ var self = this;
+
+ /** Highlight and scroll to error */
+ function foundError (input_id, message) {
+ // get input field
+ var input_element = self.app.element_list[input_id];
+
+ // mark error
+ input_element.error(message || 'Please verify this parameter.');
+
+ // set flag
+ if (valid) {
+ // scroll to first input element
+ $(self.app.container).animate({
+ scrollTop: input_element.$el.offset().top - 20
+ }, 500);
+
+ // set error flag
+ valid = false;
+ }
+ }
+
+ // counter for values declared in batch mode
+ var n_values = -1;
+
+ // validation
for (var job_input_id in job_inputs) {
+ // get current value
+ var input_value = job_inputs[job_input_id];
+
// collect input field properties
- var input = job_inputs[job_input_id];
var input_id = this.app.tree.match(job_input_id);
var input_field = this.app.field_list[input_id];
- var input_element = this.app.element_list[input_id];
+ var input_def = this.app.input_list[input_id];
- // check field validation
- if (input && !input.optional && input_field && input_field.validate && !input_field.validate()) {
- this.app.element_list[input_id].error('Please verify this parameter.');
- if (valid) {
- // scroll to first input element
- $(this.app.container).animate({
- scrollTop: input_element.$el.offset().top - 20
- }, 500);
-
- // validation failed
- valid = false;
+ // check basic field validation
+ if (input_def && !input_def.optional && input_field && input_field.validate && !input_field.validate()) {
+ foundError(input_id);
+ }
+
+ // check if input field is in batch mode
+ if (input_value.batch) {
+ var n = input_value.values.length;
+ if (n_values === -1) {
+ n_values = n;
+ } else {
+ if (n_values !== n) {
+ foundError(input_id, 'Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>' + n + '</b> selection(s) while a previous field contains <b>' + n_values + '</b>.');
+ }
}
}
+
}
// return result
diff -r 7d53a4a090a4b17ea46a256b4dc16712297d48ec -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 client/galaxy/scripts/mvc/tools/tools-select-dataset.js
--- a/client/galaxy/scripts/mvc/tools/tools-select-dataset.js
+++ b/client/galaxy/scripts/mvc/tools/tools-select-dataset.js
@@ -1,9 +1,12 @@
// dependencies
-define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs'], function(Utils, Ui, Tabs) {
+define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs', 'mvc/tools/tools-template'], function(Utils, Ui, Tabs, ToolTemplate) {
var View = Backbone.View.extend({
// initialize
initialize : function(app, options) {
+ // configure options
+ this.options = options;
+
// link this
var self = this;
@@ -83,6 +86,11 @@
this.$el.append(this.select_datasets.$el);
this.$el.append(this.select_collection.$el);
+ // check for batch mode
+ if (!this.options.multiple) {
+ this.$el.append(ToolTemplate.batchMode());
+ }
+
// refresh view
this.refresh();
diff -r 7d53a4a090a4b17ea46a256b4dc16712297d48ec -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 client/galaxy/scripts/mvc/tools/tools-template.js
--- a/client/galaxy/scripts/mvc/tools/tools-template.js
+++ b/client/galaxy/scripts/mvc/tools/tools-template.js
@@ -38,6 +38,13 @@
// return success message element
return tmpl;
+ },
+
+ batchMode: function() {
+ return '<div class="ui-table-form-info">' +
+ '<i class="fa fa-sitemap" style="font-size: 1.2em; padding: 2px 5px;"/>' +
+ 'This is a batch mode input field. A separate job will be triggered for each dataset.'
+ '</div>';
}
};
diff -r 7d53a4a090a4b17ea46a256b4dc16712297d48ec -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 static/scripts/mvc/tools/tools-jobs.js
--- a/static/scripts/mvc/tools/tools-jobs.js
+++ b/static/scripts/mvc/tools/tools-jobs.js
@@ -32,6 +32,7 @@
console.debug('tools-jobs::submit - Submission canceled. Validation failed.');
return;
}
+ console.log(job_def);
// post job
Utils.request('POST', galaxy_config.root + 'api/tools', job_def,
@@ -66,27 +67,59 @@
// validation flag
var valid = true;
- // check inputs
+ // link this
+ var self = this;
+
+ /** Highlight and scroll to error */
+ function foundError (input_id, message) {
+ // get input field
+ var input_element = self.app.element_list[input_id];
+
+ // mark error
+ input_element.error(message || 'Please verify this parameter.');
+
+ // set flag
+ if (valid) {
+ // scroll to first input element
+ $(self.app.container).animate({
+ scrollTop: input_element.$el.offset().top - 20
+ }, 500);
+
+ // set error flag
+ valid = false;
+ }
+ }
+
+ // counter for values declared in batch mode
+ var n_values = -1;
+
+ // validation
for (var job_input_id in job_inputs) {
+ // get current value
+ var input_value = job_inputs[job_input_id];
+
// collect input field properties
- var input = job_inputs[job_input_id];
var input_id = this.app.tree.match(job_input_id);
var input_field = this.app.field_list[input_id];
- var input_element = this.app.element_list[input_id];
+ var input_def = this.app.input_list[input_id];
- // check field validation
- if (input && !input.optional && input_field && input_field.validate && !input_field.validate()) {
- this.app.element_list[input_id].error('Please verify this parameter.');
- if (valid) {
- // scroll to first input element
- $(this.app.container).animate({
- scrollTop: input_element.$el.offset().top - 20
- }, 500);
-
- // validation failed
- valid = false;
+ // check basic field validation
+ if (input_def && !input_def.optional && input_field && input_field.validate && !input_field.validate()) {
+ foundError(input_id);
+ }
+
+ // check if input field is in batch mode
+ if (input_value.batch) {
+ var n = input_value.values.length;
+ if (n_values === -1) {
+ n_values = n;
+ } else {
+ if (n_values !== n) {
+ foundError(input_id, 'Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>' + n + '</b> selection(s) while a previous field contains <b>' + n_values + '</b>.');
+ }
}
}
+
}
// return result
diff -r 7d53a4a090a4b17ea46a256b4dc16712297d48ec -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 static/scripts/mvc/tools/tools-select-dataset.js
--- a/static/scripts/mvc/tools/tools-select-dataset.js
+++ b/static/scripts/mvc/tools/tools-select-dataset.js
@@ -1,9 +1,12 @@
// dependencies
-define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs'], function(Utils, Ui, Tabs) {
+define(['utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-tabs', 'mvc/tools/tools-template'], function(Utils, Ui, Tabs, ToolTemplate) {
var View = Backbone.View.extend({
// initialize
initialize : function(app, options) {
+ // configure options
+ this.options = options;
+
// link this
var self = this;
@@ -83,6 +86,11 @@
this.$el.append(this.select_datasets.$el);
this.$el.append(this.select_collection.$el);
+ // check for batch mode
+ if (!this.options.multiple) {
+ this.$el.append(ToolTemplate.batchMode());
+ }
+
// refresh view
this.refresh();
diff -r 7d53a4a090a4b17ea46a256b4dc16712297d48ec -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 static/scripts/mvc/tools/tools-template.js
--- a/static/scripts/mvc/tools/tools-template.js
+++ b/static/scripts/mvc/tools/tools-template.js
@@ -38,6 +38,13 @@
// return success message element
return tmpl;
+ },
+
+ batchMode: function() {
+ return '<div class="ui-table-form-info">' +
+ '<i class="fa fa-sitemap" style="font-size: 1.2em; padding: 2px 5px;"/>' +
+ 'This is a batch mode input field. A separate job will be triggered for each dataset.'
+ '</div>';
}
};
diff -r 7d53a4a090a4b17ea46a256b4dc16712297d48ec -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 static/scripts/packed/mvc/tools/tools-jobs.js
--- a/static/scripts/packed/mvc/tools/tools-jobs.js
+++ b/static/scripts/packed/mvc/tools/tools-jobs.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(d,c){this.app=d;this.options=b.merge(c,this.optionsDefault)},submit:function(){var c=this;var d={tool_id:this.app.options.id,inputs:this.app.tree.finalize()};this.app.reset();if(!this._validation(d)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");return}b.request("POST",galaxy_config.root+"api/tools",d,function(e){c.app.message(a.success(e));c._refreshHdas()},function(e){console.debug(e);if(e&&e.message&&e.message.data){var h=c.app.tree.matchResponse(e.message.data);for(var g in h){var f=h[g];if(!f){f="Please verify this parameter."}c.app.element_list[g].error(f)}}})},_validation:function(h){var e=h.inputs;var g=true;for(var j in e){var d=e[j];var f=this.app.tree.match(j);var c=this.app.field_list[f];var i=this.app.element_list[f];if(d&&!d.optional&&c&&c.validate&&!c.validate()){this.app.element_list[f].error("Please verify this parameter.");if(g){$(this.app.container).animate({scrollTop:i.$el.offset().top-20},500);g=false}}}return g},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
\ No newline at end of file
+define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(d,c){this.app=d;this.options=b.merge(c,this.optionsDefault)},submit:function(){var c=this;var d={tool_id:this.app.options.id,inputs:this.app.tree.finalize()};this.app.reset();if(!this._validation(d)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");return}console.log(d);b.request("POST",galaxy_config.root+"api/tools",d,function(e){c.app.message(a.success(e));c._refreshHdas()},function(e){console.debug(e);if(e&&e.message&&e.message.data){var h=c.app.tree.matchResponse(e.message.data);for(var g in h){var f=h[g];if(!f){f="Please verify this parameter."}c.app.element_list[g].error(f)}}})},_validation:function(h){var e=h.inputs;var c=true;var o=this;function m(n,p){var q=o.app.element_list[n];q.error(p||"Please verify this parameter.");if(c){$(o.app.container).animate({scrollTop:q.$el.offset().top-20},500);c=false}}var l=-1;for(var k in e){var f=e[k];var j=this.app.tree.match(k);var d=this.app.field_list[j];var i=this.app.input_list[j];if(i&&!i.optional&&d&&d.validate&&!d.validate()){m(j)}if(f.batch){var g=f.values.length;if(l===-1){l=g}else{if(l!==g){m(j,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+g+"</b> selection(s) while a previous field contains <b>"+l+"</b>.")}}}}return c},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
\ No newline at end of file
diff -r 7d53a4a090a4b17ea46a256b4dc16712297d48ec -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 static/scripts/packed/mvc/tools/tools-select-dataset.js
--- a/static/scripts/packed/mvc/tools/tools-select-dataset.js
+++ b/static/scripts/packed/mvc/tools/tools-select-dataset.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs"],function(b,d,a){var c=Backbone.View.extend({initialize:function(m,g){var f=this;this.setElement("<div/>");this.current="hda";this.button_new=new d.RadioButton.View({value:this.current,data:[{icon:"fa-file-o",label:"Select datasets",value:"hda"},{icon:"fa-files-o",label:"Select a collection",value:"hdca"}],onchange:function(i){f.current=i;f.refresh();f.trigger("change")}});var k=m.datasets.filterType({content_type:"dataset",data_types:g.extensions});var j=[];for(var h in k){j.push({label:k[h].get("name"),value:k[h].get("id")})}this.select_datasets=new d.Select.View({multiple:true,data:j,value:j[0]&&j[0].value,onchange:function(){f.trigger("change")}});var l=m.datasets.filterType({content_type:"collection",data_types:g.extensions});var e=[];for(var h in l){e.push({label:l[h].get("name"),value:l[h].get("id")})}this.select_collection=new d.Select.View({data:e,value:e[0]&&e[0].value,onchange:function(){f.trigger("change")}});this.$el.append(b.wrap(this.button_new.$el));this.$el.append(this.select_datasets.$el);this.$el.append(this.select_collection.$el);this.refresh();this.on("change",function(){if(g.onchange){g.onchange(f.value())}})},value:function(){var f=null;switch(this.current){case"hda":f=this.select_datasets;break;case"hdca":f=this.select_collection;break}var h=f.value();if(!(h instanceof Array)){h=[h]}var e={batch:!this.options.multiple,values:[]};for(var g in h){e.values.push({id:h[g],src:this.current})}return e},validate:function(){switch(this.current){case"hda":return this.select_datasets.validate();case"hdca":return this.select_collection.validate()}},refresh:function(){switch(this.current){case"hda":this.select_datasets.$el.fadeIn();this.select_collection.$el.hide();break;case"hdca":this.select_datasets.$el.hide();this.select_collection.$el.fadeIn();break}}});return{View:c}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-template"],function(c,e,b,a){var d=Backbone.View.extend({initialize:function(n,h){this.options=h;var g=this;this.setElement("<div/>");this.current="hda";this.button_new=new e.RadioButton.View({value:this.current,data:[{icon:"fa-file-o",label:"Select datasets",value:"hda"},{icon:"fa-files-o",label:"Select a collection",value:"hdca"}],onchange:function(i){g.current=i;g.refresh();g.trigger("change")}});var l=n.datasets.filterType({content_type:"dataset",data_types:h.extensions});var k=[];for(var j in l){k.push({label:l[j].get("name"),value:l[j].get("id")})}this.select_datasets=new e.Select.View({multiple:true,data:k,value:k[0]&&k[0].value,onchange:function(){g.trigger("change")}});var m=n.datasets.filterType({content_type:"collection",data_types:h.extensions});var f=[];for(var j in m){f.push({label:m[j].get("name"),value:m[j].get("id")})}this.select_collection=new e.Select.View({data:f,value:f[0]&&f[0].value,onchange:function(){g.trigger("change")}});this.$el.append(c.wrap(this.button_new.$el));this.$el.append(this.select_datasets.$el);this.$el.append(this.select_collection.$el);if(!this.options.multiple){this.$el.append(a.batchMode())}this.refresh();this.on("change",function(){if(h.onchange){h.onchange(g.value())}})},value:function(){var g=null;switch(this.current){case"hda":g=this.select_datasets;break;case"hdca":g=this.select_collection;break}var j=g.value();if(!(j instanceof Array)){j=[j]}var f={batch:!this.options.multiple,values:[]};for(var h in j){f.values.push({id:j[h],src:this.current})}return f},validate:function(){switch(this.current){case"hda":return this.select_datasets.validate();case"hdca":return this.select_collection.validate()}},refresh:function(){switch(this.current){case"hda":this.select_datasets.$el.fadeIn();this.select_collection.$el.hide();break;case"hdca":this.select_datasets.$el.hide();this.select_collection.$el.fadeIn();break}}});return{View:d}});
\ No newline at end of file
diff -r 7d53a4a090a4b17ea46a256b4dc16712297d48ec -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 static/scripts/packed/mvc/tools/tools-template.js
--- a/static/scripts/packed/mvc/tools/tools-template.js
+++ b/static/scripts/packed/mvc/tools/tools-template.js
@@ -1,1 +1,1 @@
-define([],function(){return{help:function(a){return'<div class="toolHelp"><div class="toolHelpBody">'+a+"</div></div>"},citations:function(){return'<div id="citations"></div>'},success:function(c){var a=c.jobs.length;var d="";if(a==1){d="1 job has"}else{d=a+" jobs have been"}var b='<div class="donemessagelarge"><p>'+d+" been successfully added to the queue - resulting in the following datasets:</p>";for(var e in c.outputs){b+='<p style="padding: 10px 20px;"><b>'+(parseInt(e)+1)+": "+c.outputs[e].name+"</b></p>"}b+="<p>You can check the status of queued jobs and view the resulting data by refreshing the History pane. When the job has been run the status will change from 'running' to 'finished' if completed successfully or 'error' if problems were encountered.</p></div>";return b}}});
\ No newline at end of file
+define([],function(){return{help:function(a){return'<div class="toolHelp"><div class="toolHelpBody">'+a+"</div></div>"},citations:function(){return'<div id="citations"></div>'},success:function(c){var a=c.jobs.length;var d="";if(a==1){d="1 job has"}else{d=a+" jobs have been"}var b='<div class="donemessagelarge"><p>'+d+" been successfully added to the queue - resulting in the following datasets:</p>";for(var e in c.outputs){b+='<p style="padding: 10px 20px;"><b>'+(parseInt(e)+1)+": "+c.outputs[e].name+"</b></p>"}b+="<p>You can check the status of queued jobs and view the resulting data by refreshing the History pane. When the job has been run the status will change from 'running' to 'finished' if completed successfully or 'error' if problems were encountered.</p></div>";return b},batchMode:function(){return'<div class="ui-table-form-info"><i class="fa fa-sitemap" style="font-size: 1.2em; padding: 2px 5px;"/>This is a batch mode input field. A separate job will be triggered for each dataset.';"</div>"}}});
\ No newline at end of file
diff -r 7d53a4a090a4b17ea46a256b4dc16712297d48ec -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1294,7 +1294,7 @@
.ui-button-icon{margin-right:5px}.ui-button-icon ul i{font-size:1.2em;margin-right:5px;position:relative;top:1px}
.ui-button-icon .button{margin-right:5px;margin-left:5px}.ui-button-icon .button .title{position:relative;font-size:0.8em;font-weight:normal;top:-1px}
.ui-button-icon .button.disabled{filter:alpha(opacity=65);opacity:.65;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=65);filter:alpha(opacity=65)}
-.ui-button-icon-plain{border:none !important;background:none !important}
+.ui-button-icon-plain{border:none !important;background:none !important;height:inherit !important}
.ui-tabs .ui-tabs-add{font-size:0.8em;margin-right:5px}
.ui-tabs .ui-tabs-delete{font-size:0.8em;margin-left:5px;cursor:pointer}
.ui-portlet,.ui-portlet-repeat,.ui-portlet-repeat{border:solid #d6b161 1px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;position:relative;clear:both;width:auto;height:100%}.ui-portlet .portlet-header{background:#ebd9b2;border-bottom:solid #d6b161 1px;padding:2px 8px;overflow:visible;float:right;width:100%}.ui-portlet .portlet-header .portlet-title .portlet-title-text{vertical-align:middle}
diff -r 7d53a4a090a4b17ea46a256b4dc16712297d48ec -r 5a846bf0080bc7db4b7d99e9f6046182fbff8ec5 static/style/src/less/ui.less
--- a/static/style/src/less/ui.less
+++ b/static/style/src/less/ui.less
@@ -109,6 +109,7 @@
&:extend(.icon-btn);
border: none !important;
background: none !important;
+ height: inherit !important;
}
.ui-tabs {
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0