1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/89dc1fd43e7b/
Changeset: 89dc1fd43e7b
User: greg
Date: 2014-01-15 02:05:28
Summary: Fix messaging broken in my last commit - thanks to Nicola Soranzo!
Affected #: 1 file
diff -r 55a2d1cced87aa2401a99ff3bc33d759f9b6e82c -r 89dc1fd43e7ba1156580e59bb310d09d95ccdb94 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -2002,8 +2002,8 @@
','.join( util.listify( changeset_revisions ) ) ) )
return trans.response.send_redirect( url )
else:
- message = 'Repository installation is not possible due to an invalid Galaxy URL: <b>%s</b>. '
- message += 'You may need to enable cookies in your browser. ' % galaxy_url
+ message = 'Repository installation is not possible due to an invalid Galaxy URL: <b>%s</b>. ' % galaxy_url
+ message += 'You may need to enable cookies in your browser. '
status = 'error'
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_valid_categories',
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9165ed69a678/
Changeset: 9165ed69a678
User: greg
Date: 2014-01-14 22:54:09
Summary: Improved messaging when upgrading an installed repository in Galaxy.
Affected #: 1 file
diff -r 027eb5827babc5a6b07b6c3e098bacd09185adf4 -r 9165ed69a678010aff37fdc93f3a25661aa44e79 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -497,9 +497,10 @@
suc.repository_was_previously_installed( trans, tool_shed_url, name, tmp_repo_info_tuple )
if installed_repository:
current_changeset_revision = str( installed_repository.changeset_revision )
- message = 'Revision %s of repository %s owned by %s has already been installed.'
+ message = 'Revision <b>%s</b> of repository <b>%s</b> owned by <b>%s</b> has already been installed.' % \
+ ( latest_downloadable_revision, name, owner )
if current_changeset_revision != latest_downloadable_revision:
- message += ' The current changeset revision is %s.' % current_changeset_revision
+ message += ' The current changeset revision is <b>%s</b>.' % current_changeset_revision
status = 'error'
else:
# Install the latest downloadable revision of the repository.
@@ -508,10 +509,10 @@
( name, owner, latest_downloadable_revision, web.url_for( '/', qualified=True ) ) )
return trans.response.send_redirect( url )
else:
- message = 'Cannot locate installed tool shed repository with encoded id %s.' % str( repository_id )
+ message = 'Cannot locate installed tool shed repository with encoded id <b>%s</b>.' % str( repository_id )
status = 'error'
else:
- message = 'The request parameters did not include the required encoded id of installed repository.'
+ message = 'The request parameters did not include the required encoded <b>id</b> of installed repository.'
status = 'error'
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='browse_repositories',
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.
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6cba7c5f3635/
Changeset: 6cba7c5f3635
User: carlfeberhard
Date: 2014-01-14 22:41:20
Summary: Histories API: apply None rule from 5c5e543 to history update
Affected #: 1 file
diff -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 -r 6cba7c5f36358f7e71168cff6118e15642d01cef lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -344,6 +344,8 @@
)
validated_payload = {}
for key, val in payload.items():
+ if val is None:
+ continue
if key in ( 'name', 'genome_build', 'annotation' ):
validated_payload[ key ] = self.validate_and_sanitize_basestring( key, val )
if key in ( 'deleted', 'published' ):
https://bitbucket.org/galaxy/galaxy-central/commits/027eb5827bab/
Changeset: 027eb5827bab
User: carlfeberhard
Date: 2014-01-14 22:41:37
Summary: merge
Affected #: 1 file
diff -r 6cba7c5f36358f7e71168cff6118e15642d01cef -r 027eb5827babc5a6b07b6c3e098bacd09185adf4 templates/webapps/galaxy/tool_form.mako
--- a/templates/webapps/galaxy/tool_form.mako
+++ b/templates/webapps/galaxy/tool_form.mako
@@ -268,12 +268,12 @@
<%def name="row_for_rerun()">
%if trans.app.config.track_jobs_in_database and tool_state.rerun_remap_job_id is not None:
- <div class="form-row">
+ <div id="remap-row" class="form-row"><input type="checkbox" name="rerun_remap_job_id" value="${tool_state.rerun_remap_job_id}"> Resume dependencies from this job
<div class="toolParamHelp" style="clear: both;">
The previous run of this tool failed and other tools were waiting for it to finish successfully, use this option to resume those tools using the outputs of this tool run.
</div>
- <div>
+ </div><div style="clear: both;"></div>
%endif
</%def>
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9eb10fd69c98/
Changeset: 9eb10fd69c98
User: jmchilton
Date: 2014-01-14 22:40:27
Summary: Close remap div in tool_form.
Fixes up the GUI slightly and is needed for me to selectively disable feature downstream.
Affected #: 1 file
diff -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 -r 9eb10fd69c986fcd01a4ca0393e28ac18b1c3518 templates/webapps/galaxy/tool_form.mako
--- a/templates/webapps/galaxy/tool_form.mako
+++ b/templates/webapps/galaxy/tool_form.mako
@@ -268,12 +268,12 @@
<%def name="row_for_rerun()">
%if trans.app.config.track_jobs_in_database and tool_state.rerun_remap_job_id is not None:
- <div class="form-row">
+ <div id="remap-row" class="form-row"><input type="checkbox" name="rerun_remap_job_id" value="${tool_state.rerun_remap_job_id}"> Resume dependencies from this job
<div class="toolParamHelp" style="clear: both;">
The previous run of this tool failed and other tools were waiting for it to finish successfully, use this option to resume those tools using the outputs of this tool run.
</div>
- <div>
+ </div><div style="clear: both;"></div>
%endif
</%def>
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/be5f0c5df96f/
Changeset: be5f0c5df96f
User: greg
Date: 2014-01-14 22:37:56
Summary: Add the ability to install the latest installable revision of a repository that is already installed into Galaxy via the installed repository's pop-up menu on the Manage installed Tool Shed repositories grid in Galaxy. This is a new grid operation that is available only for those repositories that have a revision upgrade available in the Tool Shed.
Affected #: 5 files
diff -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -106,10 +106,11 @@
if operation == "activate or reinstall":
repository = suc.get_installed_tool_shed_repository( trans, kwd[ 'id' ] )
if repository.uninstalled:
- # Since we're reinstalling the repository we need to find the latest changeset revision to which it can be updated so that we
- # can reset the metadata if necessary. This will ensure that information about repository dependencies and tool dependencies
- # will be current. Only allow selecting a different section in the tool panel if the repository was uninstalled and it contained
- # tools that should be displayed in the tool panel.
+ # Since we're reinstalling the repository we need to find the latest changeset revision to which it can
+ # be updated so that we can reset the metadata if necessary. This will ensure that information about
+ # repository dependencies and tool dependencies will be current. Only allow selecting a different section
+ # in the tool panel if the repository was uninstalled and it contained tools that should be displayed in
+ # the tool panel.
changeset_revision_dict = repository_util.get_update_to_changeset_revision_and_ctx_rev( trans, repository )
current_changeset_revision = changeset_revision_dict.get( 'changeset_revision', None )
current_ctx_rev = changeset_revision_dict.get( 'ctx_rev', None )
@@ -121,11 +122,12 @@
**kwd ) )
else:
# The uninstalled repository has updates available in the tool shed.
- updated_repo_info_dict = self.get_updated_repository_information( trans=trans,
- repository_id=trans.security.encode_id( repository.id ),
- repository_name=repository.name,
- repository_owner=repository.owner,
- changeset_revision=current_changeset_revision )
+ updated_repo_info_dict = \
+ self.get_updated_repository_information( trans=trans,
+ repository_id=trans.security.encode_id( repository.id ),
+ repository_name=repository.name,
+ repository_owner=repository.owner,
+ changeset_revision=current_changeset_revision )
json_repo_info_dict = json.to_json_string( updated_repo_info_dict )
encoded_repo_info_dict = encoding_util.tool_shed_encode( json_repo_info_dict )
kwd[ 'latest_changeset_revision' ] = current_changeset_revision
@@ -150,6 +152,10 @@
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='deactivate_or_uninstall_repository',
**kwd ) )
+ if operation == "install latest revision":
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='install_latest_repository_revision',
+ **kwd ) )
return self.installed_repository_grid( trans, **kwd )
@web.expose
@@ -460,6 +466,61 @@
@web.expose
@web.require_admin
+ def install_latest_repository_revision( self, trans, **kwd ):
+ """Install the latest installable revision of a repository that has been previously installed."""
+ message = kwd.get( 'message', '' )
+ status = kwd.get( 'status', 'done' )
+ repository_id = kwd.get( 'id', None )
+ if repository_id is not None:
+ repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ if repository is not None:
+ tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
+ name = str( repository.name )
+ owner = str( repository.owner )
+ url = suc.url_join( tool_shed_url,
+ 'repository/get_latest_downloadable_changeset_revision?galaxy_url=%s&name=%s&owner=%s' % \
+ ( web.url_for( '/', qualified=True ), name, owner ) )
+ raw_text = common_util.tool_shed_get( trans.app, tool_shed_url, url )
+ latest_downloadable_revision = json.from_json_string( raw_text )
+ if latest_downloadable_revision == suc.INITIAL_CHANGELOG_HASH:
+ message = 'Error retrieving the latest downloadable revision for this repository via the url <b>%s</b>.' % url
+ status = 'error'
+ else:
+ # Make sure the latest changeset_revision of the repository has not already been installed.
+ # Updates to installed repository revisions may have occurred, so make sure to locate the
+ # appropriate repository revision if one exists. We need to create a temporary repo_info_tuple
+ # with the following entries to handle this.
+ # ( description, clone_url, changeset_revision, ctx_rev, owner, repository_dependencies, tool_dependencies )
+ tmp_clone_url = suc.url_join( tool_shed_url, 'repos', owner, name )
+ tmp_repo_info_tuple = ( None, tmp_clone_url, latest_downloadable_revision, None, owner, None, None )
+ installed_repository, installed_changeset_revision = \
+ suc.repository_was_previously_installed( trans, tool_shed_url, name, tmp_repo_info_tuple )
+ if installed_repository:
+ current_changeset_revision = str( installed_repository.changeset_revision )
+ message = 'Revision %s of repository %s owned by %s has already been installed.'
+ if current_changeset_revision != latest_downloadable_revision:
+ message += ' The current changeset revision is %s.' % current_changeset_revision
+ status = 'error'
+ else:
+ # Install the latest downloadable revision of the repository.
+ url = suc.url_join( tool_shed_url,
+ 'repository/install_repositories_by_revision?name=%s&owner=%s&changeset_revisions=%s&galaxy_url=%s' % \
+ ( name, owner, latest_downloadable_revision, web.url_for( '/', qualified=True ) ) )
+ return trans.response.send_redirect( url )
+ else:
+ message = 'Cannot locate installed tool shed repository with encoded id %s.' % str( repository_id )
+ status = 'error'
+ else:
+ message = 'The request parameters did not include the required encoded id of installed repository.'
+ status = 'error'
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='browse_repositories',
+ message=message,
+ status=status ) )
+
+
+ @web.expose
+ @web.require_admin
def install_tool_dependencies( self, trans, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
@@ -600,12 +661,17 @@
def manage_repository( self, trans, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository_id = kwd[ 'id' ]
+ repository_id = kwd.get( 'id', None )
+ if repository_id is None:
+ return trans.show_error_message( 'Missing required encoded repository id.' )
operation = kwd.get( 'operation', None )
repository = suc.get_installed_tool_shed_repository( trans, repository_id )
- if not repository:
+ if repository is None:
return trans.show_error_message( 'Invalid repository specified.' )
tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
+ name = str( repository.name )
+ owner = str( repository.owner )
+ installed_changeset_revision = str( repository.installed_changeset_revision )
if repository.status in [ trans.install_model.ToolShedRepository.installation_status.CLONING ]:
tool_shed_repository_ids = [ repository_id ]
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
@@ -615,12 +681,12 @@
# Send a request to the tool shed to install the repository.
url = suc.url_join( tool_shed_url,
'repository/install_repositories_by_revision?name=%s&owner=%s&changeset_revisions=%s&galaxy_url=%s' % \
- ( repository.name, repository.owner, repository.installed_changeset_revision, ( web.url_for( '/', qualified=True ) ) ) )
+ ( name, owner, installed_changeset_revision, ( web.url_for( '/', qualified=True ) ) ) )
return trans.response.send_redirect( url )
description = kwd.get( 'description', repository.description )
shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, repository )
if relative_install_dir:
- repo_files_dir = os.path.abspath( os.path.join( tool_path, relative_install_dir, repository.name ) )
+ repo_files_dir = os.path.abspath( os.path.join( tool_path, relative_install_dir, name ) )
else:
repo_files_dir = None
if repository.in_error_state:
@@ -841,7 +907,7 @@
# Get the information necessary to install each repository.
url = suc.url_join( tool_shed_url,
'repository/get_repository_information?repository_ids=%s&changeset_revisions=%s' % \
- ( repository_ids, changeset_revisions ) )
+ ( str( repository_ids ), str( changeset_revisions ) ) )
raw_text = common_util.tool_shed_get( trans.app, tool_shed_url, url )
repo_information_dict = json.from_json_string( raw_text )
for encoded_repo_info_dict in repo_information_dict.get( 'repo_info_dicts', [] ):
diff -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -1581,28 +1581,52 @@
items=functional_test_results )
@web.json
+ def get_latest_downloadable_changeset_revision( self, trans, **kwd ):
+ """
+ Return the latest installable changeset revision for the repository associated with the received
+ name and owner. This method is called from Galaxy when attempting to install the latest revision
+ of an installed repository.
+ """
+ repository_name = kwd.get( 'name', None )
+ repository_owner = kwd.get( 'owner', None )
+ if repository_name is not None and repository_owner is not None:
+ repository = suc.get_repository_by_name_and_owner( trans.app, repository_name, repository_owner )
+ if repository:
+ repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ return suc.get_latest_downloadable_changeset_revision( trans, repository, repo )
+ return suc.INITIAL_CHANGELOG_HASH
+
+ @web.json
def get_readme_files( self, trans, **kwd ):
"""
- This method is called when installing or re-installing a single repository into a Galaxy instance. If the received changeset_revision
- includes one or more readme files, return them in a dictionary.
+ This method is called when installing or re-installing a single repository into a Galaxy instance.
+ If the received changeset_revision includes one or more readme files, return them in a dictionary.
"""
- repository_name = kwd[ 'name' ]
- repository_owner = kwd[ 'owner' ]
- changeset_revision = kwd[ 'changeset_revision' ]
- repository = suc.get_repository_by_name_and_owner( trans.app, repository_name, repository_owner )
- if repository:
- repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans,
- trans.security.encode_id( repository.id ),
- changeset_revision )
- if repository_metadata:
- metadata = repository_metadata.metadata
- if metadata:
- return readme_util.build_readme_files_dict( trans, repository, changeset_revision, repository_metadata.metadata )
+ repository_name = kwd.get( 'name', None )
+ repository_owner = kwd.get( 'owner', None )
+ changeset_revision = kwd.get( 'changeset_revision', None )
+ if repository_name is not None and repository_owner is not None and changeset_revision is not None:
+ repository = suc.get_repository_by_name_and_owner( trans.app, repository_name, repository_owner )
+ if repository:
+ repository_metadata = \
+ suc.get_repository_metadata_by_changeset_revision( trans,
+ trans.security.encode_id( repository.id ),
+ changeset_revision )
+ if repository_metadata:
+ metadata = repository_metadata.metadata
+ if metadata:
+ return readme_util.build_readme_files_dict( trans,
+ repository,
+ changeset_revision,
+ repository_metadata.metadata )
return {}
@web.json
def get_repository_dependencies( self, trans, **kwd ):
- """Return an encoded dictionary of all repositories upon which the contents of the received repository depends."""
+ """
+ Return an encoded dictionary of all repositories upon which the contents of the received repository
+ depends.
+ """
name = kwd.get( 'name', None )
owner = kwd.get( 'owner', None )
changeset_revision = kwd.get( 'changeset_revision', None )
@@ -1630,8 +1654,8 @@
@web.json
def get_repository_information( self, trans, repository_ids, changeset_revisions, **kwd ):
"""
- Generate a list of dictionaries, each of which contains the information about a repository that will be necessary for installing it into
- a local Galaxy instance.
+ Generate a list of dictionaries, each of which contains the information about a repository that will
+ be necessary for installing it into a local Galaxy instance.
"""
includes_tools = False
includes_tools_for_display_in_tool_panel = False
@@ -1665,8 +1689,8 @@
@web.json
def get_required_repo_info_dict( self, trans, encoded_str=None ):
"""
- Retrieve and return a dictionary that includes a list of dictionaries that each contain all of the information needed to install the list of
- repositories defined by the received encoded_str.
+ Retrieve and return a dictionary that includes a list of dictionaries that each contain all of the
+ information needed to install the list of repositories defined by the received encoded_str.
"""
repo_info_dict = {}
if encoded_str:
@@ -1689,7 +1713,10 @@
@web.expose
def get_tool_dependencies( self, trans, **kwd ):
- """Handle a request from a Galaxy instance to get the tool_dependencies entry from the metadata for a specified changeset revision."""
+ """
+ Handle a request from a Galaxy instance to get the tool_dependencies entry from the metadata
+ for a specified changeset revision.
+ """
name = kwd.get( 'name', None )
owner = kwd.get( 'owner', None )
changeset_revision = kwd.get( 'changeset_revision', None )
@@ -1705,7 +1732,10 @@
@web.expose
def get_tool_dependencies_config_contents( self, trans, **kwd ):
- """Handle a request from a Galaxy instance to get the tool_dependencies.xml file contents for a specified changeset revision."""
+ """
+ Handle a request from a Galaxy instance to get the tool_dependencies.xml file contents for a
+ specified changeset revision.
+ """
name = kwd.get( 'name', None )
owner = kwd.get( 'owner', None )
changeset_revision = kwd.get( 'changeset_revision', None )
@@ -1726,8 +1756,8 @@
@web.expose
def get_tool_versions( self, trans, **kwd ):
"""
- For each valid /downloadable change set (up to the received changeset_revision) in the repository's change log, append the change
- set's tool_versions dictionary to the list that will be returned.
+ For each valid /downloadable change set (up to the received changeset_revision) in the repository's
+ change log, append the changeset tool_versions dictionary to the list that will be returned.
"""
name = kwd[ 'name' ]
owner = kwd[ 'owner' ]
@@ -1751,7 +1781,10 @@
@web.json
def get_updated_repository_information( self, trans, name, owner, changeset_revision, **kwd ):
- """Generate a dictionary that contains the information about a repository that is necessary for installing it into a local Galaxy instance."""
+ """
+ Generate a dictionary that contains the information about a repository that is necessary for installing
+ it into a local Galaxy instance.
+ """
repository = suc.get_repository_by_name_and_owner( trans.app, name, owner )
repository_id = trans.security.encode_id( repository.id )
repository_clone_url = suc.generate_clone_url_for_repository_in_tool_shed( trans, repository )
@@ -1828,7 +1861,10 @@
repo_info_dict=repo_info_dict )
def get_versions_of_tool( self, trans, repository, repository_metadata, guid ):
- """Return the tool lineage in descendant order for the received guid contained in the received repsitory_metadata.tool_versions."""
+ """
+ Return the tool lineage in descendant order for the received guid contained in the received
+ repsitory_metadata.tool_versions.
+ """
encoded_id = trans.security.encode_id( repository.id )
repo_dir = repository.repo_path( trans.app )
repo = hg.repository( suc.get_configured_ui(), repo_dir )
@@ -1846,7 +1882,9 @@
current_child_guid = parent_guid
# Get all descendant guids of the received guid.
current_parent_guid = guid
- for changeset in suc.reversed_lower_upper_bounded_changelog( repo, repository_metadata.changeset_revision, repository.tip( trans.app ) ):
+ for changeset in suc.reversed_lower_upper_bounded_changelog( repo,
+ repository_metadata.changeset_revision,
+ repository.tip( trans.app ) ):
ctx = repo.changectx( changeset )
rm = suc.get_repository_metadata_by_changeset_revision( trans, encoded_id, str( ctx ) )
if rm:
@@ -1943,8 +1981,9 @@
@web.expose
def install_repositories_by_revision( self, trans, **kwd ):
"""
- Send the list of repository_ids and changeset_revisions to Galaxy so it can begin the installation process. If the value of
- repository_ids is not received, then the name and owner of a single repository must be received to install a single repository.
+ Send the list of repository_ids and changeset_revisions to Galaxy so it can begin the installation
+ process. If the value of repository_ids is not received, then the name and owner of a single repository
+ must be received to install a single repository.
"""
repository_ids = kwd.get( 'repository_ids', None )
changeset_revisions = kwd.get( 'changeset_revisions', None )
@@ -1958,10 +1997,13 @@
# Redirect back to local Galaxy to perform install.
url = suc.url_join( galaxy_url,
'admin_toolshed/prepare_for_install?tool_shed_url=%s&repository_ids=%s&changeset_revisions=%s' % \
- ( web.url_for( '/', qualified=True ), ','.join( util.listify( repository_ids ) ), ','.join( util.listify( changeset_revisions ) ) ) )
+ ( web.url_for( '/', qualified=True ),
+ ','.join( util.listify( repository_ids ) ),
+ ','.join( util.listify( changeset_revisions ) ) ) )
return trans.response.send_redirect( url )
else:
- message = 'Repository installation is not possible due to an invalid Galaxy URL: <b>%s</b>. You may need to enable cookies in your browser. ' % galaxy_url
+ message = 'Repository installation is not possible due to an invalid Galaxy URL: <b>%s</b>. '
+ message += 'You may need to enable cookies in your browser. ' % galaxy_url
status = 'error'
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_valid_categories',
diff -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
--- a/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
+++ b/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
@@ -131,73 +131,99 @@
args = { self.key: val }
accepted_filters.append( grids.GridColumnFilter( label, args) )
return accepted_filters
+
# Grid definition
title = "Installed tool shed repositories"
model_class = tool_shed_install.ToolShedRepository
template='/admin/tool_shed_repository/grid.mako'
default_sort_key = "name"
columns = [
- ToolShedStatusColumn( "",
- attach_popup=False ),
- NameColumn( "Name",
+ ToolShedStatusColumn( label="" ),
+ NameColumn( label="Name",
key="name",
link=( lambda item: iff( item.status in [ tool_shed_install.ToolShedRepository.installation_status.CLONING ],
None,
dict( operation="manage_repository", id=item.id ) ) ),
attach_popup=True ),
- DescriptionColumn( "Description" ),
- OwnerColumn( "Owner" ),
- RevisionColumn( "Revision" ),
- StatusColumn( "Installation Status",
+ DescriptionColumn( label="Description" ),
+ OwnerColumn( label="Owner" ),
+ RevisionColumn( label="Revision" ),
+ StatusColumn( label="Installation Status",
filterable="advanced" ),
- ToolShedColumn( "Tool shed" ),
+ ToolShedColumn( label="Tool shed" ),
# Columns that are valid for filtering but are not visible.
- DeletedColumn( "Status",
+ DeletedColumn( label="Status",
key="deleted",
visible=False,
filterable="advanced" )
]
columns.append( grids.MulticolFilterColumn( "Search repository name",
- cols_to_filter=[ columns[0] ],
+ cols_to_filter=[ columns[ 1 ] ],
key="free-text-search",
visible=False,
filterable="standard" ) )
global_actions = [
- grids.GridAction( "Update tool shed status",
- dict( controller='admin_toolshed', action='update_tool_shed_status_for_installed_repository', all_installed_repositories=True ) )
+ grids.GridAction( label="Update tool shed status",
+ url_args=dict( controller='admin_toolshed',
+ action='update_tool_shed_status_for_installed_repository',
+ all_installed_repositories=True ),
+ inbound=False )
]
- operations = [ grids.GridOperation( "Update tool shed status",
+ operations = [ grids.GridOperation( label="Update tool shed status",
+ condition=( lambda item: not item.deleted ),
allow_multiple=False,
- condition=( lambda item: not item.deleted ),
- async_compatible=False,
- url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='update tool shed status' ) ),
- grids.GridOperation( "Get updates",
+ url_args=dict( controller='admin_toolshed',
+ action='browse_repositories',
+ operation='update tool shed status' ) ),
+ grids.GridOperation( label="Get updates",
+ condition=( lambda item: \
+ not item.deleted and \
+ item.revision_update_available and \
+ item.status not in \
+ [ tool_shed_install.ToolShedRepository.installation_status.ERROR,
+ tool_shed_install.ToolShedRepository.installation_status.NEW ] ),
allow_multiple=False,
- condition=( lambda item: not item.deleted and item.revision_update_available and item.status not in \
- [ tool_shed_install.ToolShedRepository.installation_status.ERROR, tool_shed_install.ToolShedRepository.installation_status.NEW ] ),
- async_compatible=False,
- url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='get updates' ) ),
- grids.GridOperation( "Install",
+ url_args=dict( controller='admin_toolshed',
+ action='browse_repositories',
+ operation='get updates' ) ),
+ grids.GridOperation( label="Install latest revision",
+ condition=( lambda item: item.upgrade_available ),
allow_multiple=False,
- condition=( lambda item: not item.deleted and item.status == tool_shed_install.ToolShedRepository.installation_status.NEW ),
- async_compatible=False,
- url_args=dict( controller='admin_toolshed', action='manage_repository', operation='install' ) ),
- grids.GridOperation( "Deactivate or uninstall",
+ url_args=dict( controller='admin_toolshed',
+ action='browse_repositories',
+ operation='install latest revision' ) ),
+ grids.GridOperation( label="Install",
+ condition=( lambda item: \
+ not item.deleted and \
+ item.status == tool_shed_install.ToolShedRepository.installation_status.NEW ),
allow_multiple=False,
- condition=( lambda item: not item.deleted and item.status not in \
- [ tool_shed_install.ToolShedRepository.installation_status.ERROR, tool_shed_install.ToolShedRepository.installation_status.NEW ] ),
- async_compatible=False,
- url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='deactivate or uninstall' ) ),
- grids.GridOperation( "Reset to install",
+ url_args=dict( controller='admin_toolshed',
+ action='manage_repository',
+ operation='install' ) ),
+ grids.GridOperation( label="Deactivate or uninstall",
+ condition=( lambda item: \
+ not item.deleted and \
+ item.status not in \
+ [ tool_shed_install.ToolShedRepository.installation_status.ERROR,
+ tool_shed_install.ToolShedRepository.installation_status.NEW ] ),
allow_multiple=False,
- condition=( lambda item: ( item.status == tool_shed_install.ToolShedRepository.installation_status.ERROR ) ),
- async_compatible=False,
- url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='reset to install' ) ),
- grids.GridOperation( "Activate or reinstall",
+ url_args=dict( controller='admin_toolshed',
+ action='browse_repositories',
+ operation='deactivate or uninstall' ) ),
+ grids.GridOperation( label="Reset to install",
+ condition=( lambda item: \
+ ( item.status == tool_shed_install.ToolShedRepository.installation_status.ERROR ) ),
allow_multiple=False,
+ url_args=dict( controller='admin_toolshed',
+ action='browse_repositories',
+ operation='reset to install' ) ),
+ grids.GridOperation( label="Activate or reinstall",
condition=( lambda item: item.deleted ),
- async_compatible=False,
- url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='activate or reinstall' ) ) ]
+ allow_multiple=False,
+ target=None,
+ url_args=dict( controller='admin_toolshed',
+ action='browse_repositories',
+ operation='activate or reinstall' ) ) ]
standard_filters = []
default_filter = dict( deleted="False" )
num_rows_per_page = 50
diff -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 lib/tool_shed/util/common_install_util.py
--- a/lib/tool_shed/util/common_install_util.py
+++ b/lib/tool_shed/util/common_install_util.py
@@ -224,8 +224,9 @@
def get_installed_and_missing_repository_dependencies_for_new_install( trans, repo_info_tuple ):
"""
- Parse the received repository_dependencies dictionary that is associated with a repository being installed into Galaxy for the first time
- and attempt to determine repository dependencies that are already installed and those that are not.
+ Parse the received repository_dependencies dictionary that is associated with a repository being
+ installed into Galaxy for the first time and attempt to determine repository dependencies that are
+ already installed and those that are not.
"""
missing_repository_dependencies = {}
installed_repository_dependencies = {}
@@ -236,20 +237,25 @@
if repository_dependencies:
description = repository_dependencies[ 'description' ]
root_key = repository_dependencies[ 'root_key' ]
- # The repository dependencies container will include only the immediate repository dependencies of this repository, so the container will be
- # only a single level in depth.
+ # The repository dependencies container will include only the immediate repository dependencies of
+ # this repository, so the container will be only a single level in depth.
for key, rd_tups in repository_dependencies.items():
if key in [ 'description', 'root_key' ]:
continue
for rd_tup in rd_tups:
tool_shed, name, owner, changeset_revision, prior_installation_required, only_if_compiling_contained_td = \
common_util.parse_repository_dependency_tuple( rd_tup )
- # Updates to installed repository revisions may have occurred, so make sure to locate the appropriate repository revision if one exists.
- # We need to create a temporary repo_info_tuple that includes the correct repository owner which we get from the current rd_tup. The current
- # tuple looks like: ( description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, installed_td )
+ # Updates to installed repository revisions may have occurred, so make sure to locate the
+ # appropriate repository revision if one exists. We need to create a temporary repo_info_tuple
+ # that includes the correct repository owner which we get from the current rd_tup. The current
+ # tuple looks like: ( description, repository_clone_url, changeset_revision, ctx_rev, repository_owner,
+ # repository_dependencies, installed_td )
tmp_clone_url = suc.generate_clone_url_from_repo_info_tup( rd_tup )
tmp_repo_info_tuple = ( None, tmp_clone_url, changeset_revision, None, owner, None, None )
- repository, installed_changeset_revision = suc.repository_was_previously_installed( trans, tool_shed, name, tmp_repo_info_tuple )
+ repository, installed_changeset_revision = suc.repository_was_previously_installed( trans,
+ tool_shed,
+ name,
+ tmp_repo_info_tuple )
if repository:
new_rd_tup = [ tool_shed,
name,
@@ -263,10 +269,11 @@
if new_rd_tup not in installed_rd_tups:
installed_rd_tups.append( new_rd_tup )
else:
- # A repository dependency that is not installed will not be considered missing if it's value for only_if_compiling_contained_td is
- # True This is because this type of repository dependency will only be considered at the time that the specified tool dependency
- # is being installed, and even then only if the compiled binary of the tool dependency could not be installed due to the unsupported
- # installation environment.
+ # A repository dependency that is not installed will not be considered missing if it's value
+ # for only_if_compiling_contained_td is True This is because this type of repository dependency
+ # will only be considered at the time that the specified tool dependency is being installed, and
+ # even then only if the compiled binary of the tool dependency could not be installed due to the
+ # unsupported installation environment.
if not util.asbool( only_if_compiling_contained_td ):
if new_rd_tup not in missing_rd_tups:
missing_rd_tups.append( new_rd_tup )
@@ -280,8 +287,8 @@
None,
'Never installed' ]
if not util.asbool( only_if_compiling_contained_td ):
- # A repository dependency that is not installed will not be considered missing if it's value for only_if_compiling_contained_td is
- # True - see above...
+ # A repository dependency that is not installed will not be considered missing if it's value for
+ # only_if_compiling_contained_td is True - see above...
if new_rd_tup not in missing_rd_tups:
missing_rd_tups.append( new_rd_tup )
if installed_rd_tups:
@@ -295,7 +302,10 @@
return installed_repository_dependencies, missing_repository_dependencies
def get_installed_and_missing_tool_dependencies_for_installing_repository( trans, tool_shed_url, tool_dependencies_dict ):
- """Return the lists of installed tool dependencies and missing tool dependencies for a set of repositories being installed into Galaxy."""
+ """
+ Return the lists of installed tool dependencies and missing tool dependencies for a set of repositories
+ being installed into Galaxy.
+ """
installed_tool_dependencies = {}
missing_tool_dependencies = {}
if tool_dependencies_dict:
diff -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e -r be5f0c5df96fba1a12e3e96fdb6f1805703f0b73 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -1622,10 +1622,12 @@
def repository_was_previously_installed( trans, tool_shed_url, repository_name, repo_info_tuple ):
"""
- Find out if a repository is already installed into Galaxy - there are several scenarios where this is necessary. For example, this method
- will handle the case where the repository was previously installed using an older changeset_revsion, but later the repository was updated
- in the tool shed and now we're trying to install the latest changeset revision of the same repository instead of updating the one that was
- previously installed. We'll look in the database instead of on disk since the repository may be currently uninstalled.
+ Find out if a repository is already installed into Galaxy - there are several scenarios where this
+ is necessary. For example, this method will handle the case where the repository was previously
+ installed using an older changeset_revsion, but later the repository was updated in the tool shed
+ and now we're trying to install the latest changeset revision of the same repository instead of
+ updating the one that was previously installed. We'll look in the database instead of on disk since
+ the repository may be currently uninstalled.
"""
description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, tool_dependencies = \
get_repo_info_tuple_contents( repo_info_tuple )
@@ -1638,8 +1640,8 @@
changeset_revision )
if tool_shed_repository:
return tool_shed_repository, changeset_revision
- # Get all previous changeset revisions from the tool shed for the repository back to, but excluding, the previous valid changeset
- # revision to see if it was previously installed using one of them.
+ # Get all previous changeset revisions from the tool shed for the repository back to, but excluding,
+ # the previous valid changeset revision to see if it was previously installed using one of them.
url = url_join( tool_shed_url,
'repository/previous_changeset_revisions?galaxy_url=%s&name=%s&owner=%s&changeset_revision=%s' % \
( url_for( '/', qualified=True ), repository_name, repository_owner, changeset_revision ) )
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8ac00a14c7fd/
Changeset: 8ac00a14c7fd
User: carlfeberhard
Date: 2014-01-14 21:52:01
Summary: Visualizations Registry: update unit test to remove expected visualizations, small fixes
Affected #: 4 files
diff -r c5fbdfd31b387056d1dfdad5e9e356c0020c5cec -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e lib/galaxy/visualization/registry.py
--- a/lib/galaxy/visualization/registry.py
+++ b/lib/galaxy/visualization/registry.py
@@ -19,8 +19,6 @@
__TODO__ = """
BUGS:
- anon users clicking a viz link gets 'must be' msg in galaxy_main (w/ masthead)
- should not show visualizations (no icon)?
newick files aren't being sniffed prop? - datatype is txt
have parsers create objects instead of dicts
@@ -29,12 +27,9 @@
some confused vocabulary in docs, var names
tests:
anding, grouping, not
- has_dataprovider
user is admin
data_sources:
lists of
-add description element to visualization.
-
user_pref for ordering/ex/inclusion of particular visualizations
"""
@@ -258,6 +253,7 @@
if test_fn( target_object, test_result ):
#log.debug( '\t test passed' )
return True
+
return False
def get_visualization_url( self, trans, target_object, visualization_name, param_data ):
diff -r c5fbdfd31b387056d1dfdad5e9e356c0020c5cec -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -250,7 +250,7 @@
});
// No need for popup menu because there's a single visualization.
- if( _.keys( visualizations ).length === 1 ) {
+ if( visualizations.length === 1 ) {
var onlyVisualization = visualizations[0];
$icon.attr( 'data-original-title', _l( 'Visualize in ' ) + onlyVisualization.html );
$icon.attr( 'href', onlyVisualization.href );
diff -r c5fbdfd31b387056d1dfdad5e9e356c0020c5cec -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton];this.tagsEditorShown=g.tagsEditorShown||false;this.annotationEditorShown=g.annotationEditorShown||false},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(g||i){h.disabled=true;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h={title:_l("Delete"),classes:"dataset-delete",onclick:function(){g.$el.find(".icon-btn.dataset-delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){h={title:_l("Dataset is already deleted"),disabled:true}}h.faIcon="fa-times";return faIconButton(h)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,classes:"dataset-report-error-btn",target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,classes:"dataset-rerun-btn",target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var n=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(n))){return null}if(_.isObject(n[0])){return this._render_visualizationsFrameworkButton(n)}if(!this.urls.visualization){return null}var k=this.model.get("dbkey"),g=this.urls.visualization,j={},h={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(k){h.dbkey=k}var l=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});var m=this;function i(p){switch(p){case"trackster":return b(g,h,k);case"scatterplot":return e(g,h,m.linkTarget);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:g+"/"+p+"?"+$.param(h)})}}}function o(p){return p.charAt(0).toUpperCase()+p.slice(1)}if(n.length===1){l.attr("data-original-title",_l("Visualize in ")+_l(o(n[0])));l.click(i(n[0]))}else{_.each(n,function(p){j[_l(o(p))]=i(p)});make_popupmenu(l,j)}return l},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});if(_.keys(g).length===1){var h=g[0];i.attr("data-original-title",_l("Visualize in ")+h.html);i.attr("href",h.href)}else{var j=[];_.each(g,function(k){k.func=function(){if(Galaxy.frame.active){Galaxy.frame.add({title:"Visualization",type:"url",content:k.href});return false}return true};j.push(k);return false});PopupMenu.create(i,j)}return i},_buildNewRender:function(){var g=a.HDABaseView.prototype._buildNewRender.call(this);g.find(".dataset-deleted-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk'));g.find(".dataset-hidden-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it'));return g},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);if(this.hasUser){g.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(g);this._renderAnnotation(g)}return g},_renderTags:function(g){var h=this;this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.tagsEditorShown=true},onhide:function(){h.tagsEditorShown=false},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".dataset-actions .right"))});if(this.tagsEditorShown){this.tagsEditor.toggle(true)}},_renderAnnotation:function(g){var h=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.annotationEditorShown=true},onhide:function(){h.annotationEditorShown=false},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".dataset-actions .right"))});if(this.annotationEditorShown){this.annotationEditor.toggle(true)}},makeDbkeyEditLink:function(h){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){var g=$('<a class="value">?</a>').attr("href",this.urls.edit).attr("target",this.linkTarget);h.find(".dataset-dbkey .value").replaceWith(g)}},events:_.extend(_.clone(a.HDABaseView.prototype.events),{"click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function c(g){this.model.purge();return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,i,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(i),target:h,scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton];this.tagsEditorShown=g.tagsEditorShown||false;this.annotationEditorShown=g.annotationEditorShown||false},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(g||i){h.disabled=true;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h={title:_l("Delete"),classes:"dataset-delete",onclick:function(){g.$el.find(".icon-btn.dataset-delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){h={title:_l("Dataset is already deleted"),disabled:true}}h.faIcon="fa-times";return faIconButton(h)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,classes:"dataset-report-error-btn",target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,classes:"dataset-rerun-btn",target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var n=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(n))){return null}if(_.isObject(n[0])){return this._render_visualizationsFrameworkButton(n)}if(!this.urls.visualization){return null}var k=this.model.get("dbkey"),g=this.urls.visualization,j={},h={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(k){h.dbkey=k}var l=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});var m=this;function i(p){switch(p){case"trackster":return b(g,h,k);case"scatterplot":return e(g,h,m.linkTarget);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:g+"/"+p+"?"+$.param(h)})}}}function o(p){return p.charAt(0).toUpperCase()+p.slice(1)}if(n.length===1){l.attr("data-original-title",_l("Visualize in ")+_l(o(n[0])));l.click(i(n[0]))}else{_.each(n,function(p){j[_l(o(p))]=i(p)});make_popupmenu(l,j)}return l},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});if(g.length===1){var h=g[0];i.attr("data-original-title",_l("Visualize in ")+h.html);i.attr("href",h.href)}else{var j=[];_.each(g,function(k){k.func=function(){if(Galaxy.frame.active){Galaxy.frame.add({title:"Visualization",type:"url",content:k.href});return false}return true};j.push(k);return false});PopupMenu.create(i,j)}return i},_buildNewRender:function(){var g=a.HDABaseView.prototype._buildNewRender.call(this);g.find(".dataset-deleted-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk'));g.find(".dataset-hidden-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it'));return g},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);if(this.hasUser){g.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(g);this._renderAnnotation(g)}return g},_renderTags:function(g){var h=this;this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.tagsEditorShown=true},onhide:function(){h.tagsEditorShown=false},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".dataset-actions .right"))});if(this.tagsEditorShown){this.tagsEditor.toggle(true)}},_renderAnnotation:function(g){var h=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.annotationEditorShown=true},onhide:function(){h.annotationEditorShown=false},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".dataset-actions .right"))});if(this.annotationEditorShown){this.annotationEditor.toggle(true)}},makeDbkeyEditLink:function(h){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){var g=$('<a class="value">?</a>').attr("href",this.urls.edit).attr("target",this.linkTarget);h.find(".dataset-dbkey .value").replaceWith(g)}},events:_.extend(_.clone(a.HDABaseView.prototype.events),{"click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function c(g){this.model.purge();return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,i,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(i),target:h,scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
diff -r c5fbdfd31b387056d1dfdad5e9e356c0020c5cec -r 8ac00a14c7fd8fcf263184aeab4786a66cdb4b0e test/unit/visualizations/registry/test_VisualizationsRegistry.py
--- a/test/unit/visualizations/registry/test_VisualizationsRegistry.py
+++ b/test/unit/visualizations/registry/test_VisualizationsRegistry.py
@@ -49,18 +49,8 @@
template_cache_dir=template_cache_dir )
expected_plugins_path = os.path.join( glx_dir, vis_reg_path )
- expected_plugin_names = [
- 'circster',
- 'graphview',
- 'phyloviz',
- 'scatterplot',
- 'sweepster',
- 'trackster',
- ]
-
self.assertEqual( plugin_mgr.base_url, 'visualizations' )
self.assertItemsEqual( plugin_mgr.directories, [ expected_plugins_path ] )
- self.assertItemsEqual( plugin_mgr.plugins.keys(), expected_plugin_names )
scatterplot = plugin_mgr.plugins[ 'scatterplot' ]
self.assertEqual( scatterplot.name, 'scatterplot' )
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/bb0b6a7e73d7/
Changeset: bb0b6a7e73d7
User: carlfeberhard
Date: 2014-01-14 21:26:44
Summary: Visualizations Registry: remove linkText config val (use visualization name attribute), change render_location to render_target, disable circster; fix rendering of visualization button in HDA when only one visualization
Affected #: 9 files
diff -r fb1c758d0eb990f2ce59de422d1184647f051cc8 -r bb0b6a7e73d7154377b414939b9fa44da1fb6306 config/plugins/visualizations/circster/config/circster.xml
--- a/config/plugins/visualizations/circster/config/circster.xml
+++ b/config/plugins/visualizations/circster/config/circster.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE visualization SYSTEM "../../visualization.dtd">
-<visualization name="circster">
+<visualization name="Circster" disabled="true"><data_sources><data_source><model_class>HistoryDatasetAssociation</model_class>
@@ -24,5 +24,5 @@
<!-- template_root and template are currently ignored for the 'built-in' visualizations --><template_root>webapps/galaxy/visualization</template_root><template>circster.mako</template>
- <render_location>_top</render_location>
+ <render_target>_top</render_target></visualization>
diff -r fb1c758d0eb990f2ce59de422d1184647f051cc8 -r bb0b6a7e73d7154377b414939b9fa44da1fb6306 config/plugins/visualizations/phyloviz/config/phyloviz.xml
--- a/config/plugins/visualizations/phyloviz/config/phyloviz.xml
+++ b/config/plugins/visualizations/phyloviz/config/phyloviz.xml
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE visualization SYSTEM "../../visualization.dtd">
-<visualization name="phyloviz">
+<visualization name="Phyloviz"><data_sources><data_source><model_class>HistoryDatasetAssociation</model_class><test type="isinstance" test_attr="datatype" result_type="datatype">data.Newick</test><test type="isinstance" test_attr="datatype" result_type="datatype">data.Nexus</test>
+ <test type="isinstance" test_attr="datatype" result_type="datatype">xml.Phyloxml</test><to_param param_attr="id">dataset_id</to_param></data_source></data_sources>
@@ -16,5 +17,5 @@
<!-- template_root and template are currently ignored for the 'built-in' visualizations --><template_root>webapps/galaxy/visualization</template_root><template>phyloviz.mako</template>
- <render_location>_top</render_location>
+ <render_target>_top</render_target></visualization>
diff -r fb1c758d0eb990f2ce59de422d1184647f051cc8 -r bb0b6a7e73d7154377b414939b9fa44da1fb6306 config/plugins/visualizations/scatterplot/config/scatterplot.xml
--- a/config/plugins/visualizations/scatterplot/config/scatterplot.xml
+++ b/config/plugins/visualizations/scatterplot/config/scatterplot.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE visualization SYSTEM "../../visualization.dtd">
-<visualization name="scatterplot">
+<visualization name="Scatterplot"><data_sources><data_source><model_class>HistoryDatasetAssociation</model_class>
diff -r fb1c758d0eb990f2ce59de422d1184647f051cc8 -r bb0b6a7e73d7154377b414939b9fa44da1fb6306 config/plugins/visualizations/sweepster/config/sweepster.xml
--- a/config/plugins/visualizations/sweepster/config/sweepster.xml
+++ b/config/plugins/visualizations/sweepster/config/sweepster.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE visualization SYSTEM "../../visualization.dtd">
-<visualization name="sweepster" disabled="true">
+<visualization name="Sweepster" disabled="true"><data_sources><data_source><model_class>HistoryDatasetAssociation</model_class>
@@ -23,5 +23,5 @@
<!-- template_root and template are currently ignored for the 'built-in' visualizations --><template_root>webapps/galaxy/visualization</template_root><template>sweepster.mako</template>
- <render_location>_top</render_location>
+ <render_target>_top</render_target></visualization>
diff -r fb1c758d0eb990f2ce59de422d1184647f051cc8 -r bb0b6a7e73d7154377b414939b9fa44da1fb6306 config/plugins/visualizations/trackster/config/trackster.xml
--- a/config/plugins/visualizations/trackster/config/trackster.xml
+++ b/config/plugins/visualizations/trackster/config/trackster.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE visualization SYSTEM "../../visualization.dtd">
-<visualization name="trackster">
+<visualization name="Trackster"><!--not tested yet --><data_sources><data_source>
@@ -26,5 +26,5 @@
<!-- template_root and template are currently ignored for the 'built-in' visualizations --><template_root>webapps/galaxy/visualization/tracks</template_root><template>browser.mako</template>
- <render_location>_top</render_location>
+ <render_target>_top</render_target></visualization>
diff -r fb1c758d0eb990f2ce59de422d1184647f051cc8 -r bb0b6a7e73d7154377b414939b9fa44da1fb6306 config/plugins/visualizations/visualization.dtd
--- a/config/plugins/visualizations/visualization.dtd
+++ b/config/plugins/visualizations/visualization.dtd
@@ -1,7 +1,7 @@
<!-- each visualization must have a template (all other elements are optional) -->
-<!ELEMENT visualization (description*,data_sources*,params*,template_root*,template,link_text*,render_location*)>
+<!ELEMENT visualization (description*,data_sources*,params*,template_root*,template,render_target*)><!-- visualization
- name: some name for the visualization (e.g. 'trackster', 'scatterplot', etc.) REQUIRED
+ name: the title/display name of the visualization (e.g. 'Trackster', 'Fastq Stats', etc.) REQUIRED
disabled: if included (value does not matter), this attribute will prevent the visualization being loaded
--><!ATTLIST visualization
@@ -128,10 +128,8 @@
<!ELEMENT template_root (#PCDATA)><!-- template: the template used to render the visualization. REQUIRED --><!ELEMENT template (#PCDATA)>
-<!-- link_text: the text component of an html anchor displayed when the registry builds the link information -->
-<!ELEMENT link_text (#PCDATA)>
-<!-- render_location: used as the target attribute of the link to the visualization.
+<!-- render_target: used as the target attribute of the link to the visualization.
Can be 'galaxy_main', '_top', '_blank'. DEFAULT: 'galaxy_main'
--><!-- TODO: rename -> render_target -->
-<!ELEMENT render_location (#PCDATA)>
+<!ELEMENT render_target (#PCDATA)>
diff -r fb1c758d0eb990f2ce59de422d1184647f051cc8 -r bb0b6a7e73d7154377b414939b9fa44da1fb6306 lib/galaxy/visualization/registry.py
--- a/lib/galaxy/visualization/registry.py
+++ b/lib/galaxy/visualization/registry.py
@@ -219,16 +219,13 @@
param_data = data_source[ 'to_params' ]
url = self.get_visualization_url( trans, target_object, visualization_name, param_data )
- link_text = visualization.config.get( 'link_text', None )
- if not link_text:
- # default to visualization name, titlecase, and replace underscores
- link_text = visualization_name.title().replace( '_', ' ' )
- render_location = visualization.config.get( 'render_location', 'galaxy_main' )
+ display_name = visualization.config.get( 'name', None )
+ render_target = visualization.config.get( 'render_target', 'galaxy_main' )
# remap some of these vars for direct use in ui.js, PopupMenu (e.g. text->html)
return {
'href' : url,
- 'html' : link_text,
- 'target': render_location
+ 'html' : display_name,
+ 'target': render_target
}
return None
@@ -362,7 +359,7 @@
-- what provides the data
-- what information needs to be added to the query string
"""
- VALID_RENDER_LOCATIONS = [ 'galaxy_main', '_top', '_blank' ]
+ VALID_RENDER_TARGETS = [ 'galaxy_main', '_top', '_blank' ]
def __init__( self, debug=False ):
self.debug = debug
@@ -397,6 +394,12 @@
if 'disabled' in xml_tree.attrib:
return None
+ # a text display name for end user links
+ returned[ 'name' ] = xml_tree.attrib.get( 'name', None )
+ if not returned[ 'name' ]:
+ raise ParsingException( 'visualization needs a name attribute' )
+ print returned[ 'name' ]
+
# a (for now) text description of what the visualization does
description = xml_tree.find( 'description' )
returned[ 'description' ] = description.text.strip() if description is not None else None
@@ -458,14 +461,14 @@
if link_text != None and link_text.text:
returned[ 'link_text' ] = link_text
- # render_location: where in the browser to open the rendered visualization
+ # render_target: where in the browser to open the rendered visualization
# defaults to: galaxy_main
- render_location = xml_tree.find( 'render_location' )
- if( ( render_location != None and render_location.text )
- and ( render_location.text in self.VALID_RENDER_LOCATIONS ) ):
- returned[ 'render_location' ] = render_location.text
+ render_target = xml_tree.find( 'render_target' )
+ if( ( render_target != None and render_target.text )
+ and ( render_target.text in self.VALID_RENDER_TARGETS ) ):
+ returned[ 'render_target' ] = render_target.text
else:
- returned[ 'render_location' ] = 'galaxy_main'
+ returned[ 'render_target' ] = 'galaxy_main'
# consider unifying the above into it's own element and parsing method
return returned
diff -r fb1c758d0eb990f2ce59de422d1184647f051cc8 -r bb0b6a7e73d7154377b414939b9fa44da1fb6306 static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -251,8 +251,9 @@
// No need for popup menu because there's a single visualization.
if( _.keys( visualizations ).length === 1 ) {
- $icon.attr( 'title', _.keys( visualizations )[0] );
- $icon.attr( 'href', _.values( visualizations )[0] );
+ var onlyVisualization = visualizations[0];
+ $icon.attr( 'data-original-title', _l( 'Visualize in ' ) + onlyVisualization.html );
+ $icon.attr( 'href', onlyVisualization.href );
// >1: Populate menu dict with visualization fns, make the popupmenu
} else {
diff -r fb1c758d0eb990f2ce59de422d1184647f051cc8 -r bb0b6a7e73d7154377b414939b9fa44da1fb6306 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton];this.tagsEditorShown=g.tagsEditorShown||false;this.annotationEditorShown=g.annotationEditorShown||false},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(g||i){h.disabled=true;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h={title:_l("Delete"),classes:"dataset-delete",onclick:function(){g.$el.find(".icon-btn.dataset-delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){h={title:_l("Dataset is already deleted"),disabled:true}}h.faIcon="fa-times";return faIconButton(h)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,classes:"dataset-report-error-btn",target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,classes:"dataset-rerun-btn",target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var n=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(n))){return null}if(_.isObject(n[0])){return this._render_visualizationsFrameworkButton(n)}if(!this.urls.visualization){return null}var k=this.model.get("dbkey"),g=this.urls.visualization,j={},h={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(k){h.dbkey=k}var l=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});var m=this;function i(p){switch(p){case"trackster":return b(g,h,k);case"scatterplot":return e(g,h,m.linkTarget);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:g+"/"+p+"?"+$.param(h)})}}}function o(p){return p.charAt(0).toUpperCase()+p.slice(1)}if(n.length===1){l.attr("data-original-title",_l("Visualize in ")+_l(o(n[0])));l.click(i(n[0]))}else{_.each(n,function(p){j[_l(o(p))]=i(p)});make_popupmenu(l,j)}return l},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var h=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});if(_.keys(g).length===1){h.attr("title",_.keys(g)[0]);h.attr("href",_.values(g)[0])}else{var i=[];_.each(g,function(j){j.func=function(){if(Galaxy.frame.active){Galaxy.frame.add({title:"Visualization",type:"url",content:j.href});return false}return true};i.push(j);return false});PopupMenu.create(h,i)}return h},_buildNewRender:function(){var g=a.HDABaseView.prototype._buildNewRender.call(this);g.find(".dataset-deleted-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk'));g.find(".dataset-hidden-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it'));return g},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);if(this.hasUser){g.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(g);this._renderAnnotation(g)}return g},_renderTags:function(g){var h=this;this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.tagsEditorShown=true},onhide:function(){h.tagsEditorShown=false},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".dataset-actions .right"))});if(this.tagsEditorShown){this.tagsEditor.toggle(true)}},_renderAnnotation:function(g){var h=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.annotationEditorShown=true},onhide:function(){h.annotationEditorShown=false},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".dataset-actions .right"))});if(this.annotationEditorShown){this.annotationEditor.toggle(true)}},makeDbkeyEditLink:function(h){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){var g=$('<a class="value">?</a>').attr("href",this.urls.edit).attr("target",this.linkTarget);h.find(".dataset-dbkey .value").replaceWith(g)}},events:_.extend(_.clone(a.HDABaseView.prototype.events),{"click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function c(g){this.model.purge();return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,i,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(i),target:h,scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton];this.tagsEditorShown=g.tagsEditorShown||false;this.annotationEditorShown=g.annotationEditorShown||false},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(g||i){h.disabled=true;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h={title:_l("Delete"),classes:"dataset-delete",onclick:function(){g.$el.find(".icon-btn.dataset-delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){h={title:_l("Dataset is already deleted"),disabled:true}}h.faIcon="fa-times";return faIconButton(h)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,classes:"dataset-report-error-btn",target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,classes:"dataset-rerun-btn",target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var n=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(n))){return null}if(_.isObject(n[0])){return this._render_visualizationsFrameworkButton(n)}if(!this.urls.visualization){return null}var k=this.model.get("dbkey"),g=this.urls.visualization,j={},h={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(k){h.dbkey=k}var l=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});var m=this;function i(p){switch(p){case"trackster":return b(g,h,k);case"scatterplot":return e(g,h,m.linkTarget);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:g+"/"+p+"?"+$.param(h)})}}}function o(p){return p.charAt(0).toUpperCase()+p.slice(1)}if(n.length===1){l.attr("data-original-title",_l("Visualize in ")+_l(o(n[0])));l.click(i(n[0]))}else{_.each(n,function(p){j[_l(o(p))]=i(p)});make_popupmenu(l,j)}return l},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});if(_.keys(g).length===1){var h=g[0];i.attr("data-original-title",_l("Visualize in ")+h.html);i.attr("href",h.href)}else{var j=[];_.each(g,function(k){k.func=function(){if(Galaxy.frame.active){Galaxy.frame.add({title:"Visualization",type:"url",content:k.href});return false}return true};j.push(k);return false});PopupMenu.create(i,j)}return i},_buildNewRender:function(){var g=a.HDABaseView.prototype._buildNewRender.call(this);g.find(".dataset-deleted-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk'));g.find(".dataset-hidden-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it'));return g},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);if(this.hasUser){g.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(g);this._renderAnnotation(g)}return g},_renderTags:function(g){var h=this;this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.tagsEditorShown=true},onhide:function(){h.tagsEditorShown=false},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".dataset-actions .right"))});if(this.tagsEditorShown){this.tagsEditor.toggle(true)}},_renderAnnotation:function(g){var h=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.annotationEditorShown=true},onhide:function(){h.annotationEditorShown=false},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".dataset-actions .right"))});if(this.annotationEditorShown){this.annotationEditor.toggle(true)}},makeDbkeyEditLink:function(h){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){var g=$('<a class="value">?</a>').attr("href",this.urls.edit).attr("target",this.linkTarget);h.find(".dataset-dbkey .value").replaceWith(g)}},events:_.extend(_.clone(a.HDABaseView.prototype.events),{"click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function c(g){this.model.purge();return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,i,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(i),target:h,scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ 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.