Skip to content

Commit

Permalink
Improve configuration and display of collection operation tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed May 31, 2016
1 parent 6b56997 commit c886f1e
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 33 deletions.
3 changes: 2 additions & 1 deletion client/galaxy/scripts/mvc/tool/tools.js
Expand Up @@ -521,14 +521,15 @@ var ToolLinkView = BaseView.extend({
var $link = $('<div/>');
$link.append(templates.tool_link(this.model.toJSON()));

var formStyle = this.model.get( 'form_style', null );
// open upload dialog for upload tool
if (this.model.id === 'upload1') {
$link.find('a').on('click', function(e) {
e.preventDefault();
Galaxy.upload.show();
});
}
else if ( this.model.get( 'model_class' ) === 'Tool' ) { // regular tools
else if ( formStyle === 'regular' ) { // regular tools
var self = this;
$link.find('a').on('click', function(e) {
e.preventDefault();
Expand Down
6 changes: 6 additions & 0 deletions config/tool_conf.xml.sample
Expand Up @@ -30,6 +30,12 @@
<section id="send" name="Send Data">
<tool file="genomespace/genomespace_exporter.xml" />
</section>
<section id="collection_operations" name="Collection Operations">
<tool file="${model_tools_path}/unzip_collection.xml" />
<tool file="${model_tools_path}/zip_collection.xml" />
<tool file="${model_tools_path}/filter_failed_collection.xml" />
<tool file="${model_tools_path}/flatten_collection.xml" />
</section>
<section id="liftOver" name="Lift-Over">
<tool file="extract/liftOver_wrapper.xml" />
</section>
Expand Down
10 changes: 10 additions & 0 deletions lib/galaxy/tools/__init__.py
Expand Up @@ -65,6 +65,7 @@
log = logging.getLogger( __name__ )

HELP_UNINITIALIZED = threading.Lock()
MODEL_TOOLS_PATH = os.path.dirname(__file__)


class ToolErrorLog:
Expand Down Expand Up @@ -165,6 +166,11 @@ def get_tool_components( self, tool_id, tool_version=None, get_loaded_tools_by_l
break
return tool_version_select_field, tools, tool

def _path_template_kwds( self ):
return {
"model_tools_path": MODEL_TOOLS_PATH,
}

def _get_tool_shed_repository( self, tool_shed, name, owner, installed_changeset_revision ):
# Abstract toolbox doesn't have a dependency on the the database, so
# override _get_tool_shed_repository here to provide this information.
Expand Down Expand Up @@ -1585,6 +1591,10 @@ def to_dict( self, trans, link_details=False, io_details=False ):

tool_dict[ 'panel_section_id' ], tool_dict[ 'panel_section_name' ] = self.get_panel_section()

tool_class = self.__class__
regular_form = tool_class == Tool or isinstance(self, DatabaseOperationTool)
tool_dict["form_style"] = "regular" if regular_form else "special"

return tool_dict

def to_json( self, trans, kwd={}, job=None, workflow_building_mode=False ):
Expand Down
4 changes: 0 additions & 4 deletions lib/galaxy/tools/special_tools.py
Expand Up @@ -4,10 +4,6 @@
SPECIAL_TOOLS = {
"history export": "galaxy/tools/imp_exp/exp_history_to_archive.xml",
"history import": "galaxy/tools/imp_exp/imp_history_from_archive.xml",
"collection unzip": "galaxy/tools/unzip_collection.xml",
"collection zip": "galaxy/tools/zip_collection.xml",
"filter failed datasets": "galaxy/tools/filter_failed_collection.xml",
"flatten collection": "galaxy/tools/flatten_collection.xml",
}


Expand Down
7 changes: 6 additions & 1 deletion lib/galaxy/tools/toolbox/base.py
Expand Up @@ -539,9 +539,14 @@ def remove_from_dict( has_elems, integrated_has_elems ):
else:
remove_from_dict( self._tool_panel, self._integrated_tool_panel )

def _path_template_kwds( self ):
return {}

def _load_tool_tag_set( self, item, panel_dict, integrated_panel_dict, tool_path, load_panel_dict, guid=None, index=None, internal=False ):
try:
path = item.get( "file" )
path_template = item.get( "file" )
template_kwds = self._path_template_kwds()
path = string.Template(path_template).safe_substitute(**template_kwds)
repository_id = None

tool_shed_repository = None
Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/tool/tools.js.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions static/scripts/bundled/analysis.bundled.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/analysis.bundled.js.map

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions static/scripts/bundled/libs.bundled.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/libs.bundled.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/mvc/tool/tools.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions test/functional/tools/samples_tool_conf.xml
Expand Up @@ -104,4 +104,12 @@

<tool file="simple_constructs.yml" />

<!-- Load collection operation tools - I consider these part of the
"framework" and they are used to in API tests to test the underlying
ToolActions. -->
<tool file="${model_tools_path}/unzip_collection.xml" />
<tool file="${model_tools_path}/zip_collection.xml" />
<tool file="${model_tools_path}/filter_failed_collection.xml" />
<tool file="${model_tools_path}/flatten_collection.xml" />

</toolbox>

0 comments on commit c886f1e

Please sign in to comment.