Skip to content

Commit

Permalink
Merge remote-tracking branch 'guerler/remove_toolshed_grids' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
dannon committed Oct 23, 2017
2 parents b8dfceb + 7f5048b commit 2f2acb9
Show file tree
Hide file tree
Showing 24 changed files with 138 additions and 354 deletions.
25 changes: 18 additions & 7 deletions client/galaxy/scripts/apps/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ window.app = function app(options, bootstrapped) {
/** Routes */
var AdminRouter = Router.extend({
routes: {
"(/)admin(/)users": "show_users",
"(/)admin(/)roles": "show_roles",
"(/)admin(/)groups": "show_groups",
"(/)admin(/)tool_versions": "show_tool_versions",
"(/)admin(/)quotas": "show_quotas",
"(/)admin(/)forms": "show_forms",
"(/)admin(/)form(/)(:form_id)": "show_form"
"(/)admin(/)users" : "show_users",
"(/)admin(/)roles" : "show_roles",
"(/)admin(/)groups" : "show_groups",
"(/)admin(/)tool_versions" : "show_tool_versions",
"(/)admin(/)quotas" : "show_quotas",
"(/)admin(/)repositories" : "show_repositories",
"(/)admin(/)forms" : "show_forms",
"(/)admin(/)form(/)(:form_id)" : "show_form"
},

authenticate: function(args, name) {
Expand Down Expand Up @@ -60,6 +61,16 @@ window.app = function app(options, bootstrapped) {
);
},

show_repositories: function() {
this.page.display(
new GridView({
url_base: Galaxy.root + "admin_toolshed/browse_repositories",
url_data: Galaxy.params,
dict_format: true
})
);
},

show_tool_versions: function() {
this.page.display(
new GridView({
Expand Down
5 changes: 3 additions & 2 deletions client/galaxy/scripts/apps/panels/admin-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ var AdminPanel = Backbone.View.extend({
},
{
title: "Manage installed tools",
url: "admin_toolshed/browse_repositories",
enabled: self.settings.is_repo_installed
url: "admin/repositories",
enabled: self.settings.is_repo_installed,
target: "__use_router__"
},
{
title: "Reset metadata",
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/layout/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ define(
'<div id="messagebox"/>',
'<div id="inactivebox" class="panel-warning-message" />',
'<div id="left" />',
'<div id="center" class="inbound" />',
'<div id="center" />',
'<div id="right" />',
"</div>",
'<div id="dd-helper" />'
Expand Down
9 changes: 2 additions & 7 deletions client/galaxy/scripts/mvc/grid/grid-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -671,13 +671,8 @@ define(
async: async
});
switch (target) {
case "inbound":
// this currently assumes that there is only a single grid shown at a time
var $div = $(".grid-header").closest(".inbound");
if ($div.length !== 0) {
$div.load(href);
return;
}
case "center":
$("#galaxy_main").attr("src", href);
break;
case "top":
window.top.location = href;
Expand Down
3 changes: 2 additions & 1 deletion lib/galaxy/web/framework/helpers/grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,8 @@ def url(*args, **kwargs):
for operation in self.operations:
item_dict['operation_config'][operation.label] = {
'allowed' : operation.allowed(item),
'url_args' : url(**operation.get_url_args(item))
'url_args' : url(**operation.get_url_args(item)),
'target' : operation.target
}
grid_config['items'].append(item_dict)
trans.log_action(trans.get_user(), text_type("grid.view"), context, params)
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/webapps/galaxy/buildapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def paste_app_factory(global_conf, **kwargs):
webapp.add_client_route('/admin/roles', 'admin')
webapp.add_client_route('/admin/forms', 'admin')
webapp.add_client_route('/admin/groups', 'admin')
webapp.add_client_route('/admin/repositories', 'admin')
webapp.add_client_route('/admin/tool_versions', 'admin')
webapp.add_client_route('/admin/quotas', 'admin')
webapp.add_client_route('/admin/form/{form_id}', 'admin')
Expand Down
265 changes: 78 additions & 187 deletions lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/controllers/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_accepted_filters(self):
grids.TextColumn("Name", key="name",
# Link name to dataset's history.
link=(lambda item: iff(item.history.deleted, None, dict(operation="switch", id=item.id))), filterable="advanced", attach_popup=True),
HistoryColumn("History", key="history", sortable=False, target="inbound",
HistoryColumn("History", key="history", sortable=False,
link=(lambda item: iff(item.history.deleted, None, dict(operation="switch_history", id=item.id)))),
grids.IndividualTagsColumn("Tags", key="tags", model_tag_association_class=model.HistoryDatasetAssociationTagAssociation, filterable="advanced", grid_name="HistoryDatasetAssocationListGrid"),
StatusColumn("Status", key="deleted", attach_popup=False),
Expand Down
36 changes: 17 additions & 19 deletions lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def get_accepted_filters(self):
key="name",
link=(lambda item: iff(item.status in [tool_shed_install.ToolShedRepository.installation_status.CLONING],
None,
dict(operation="manage_repository", id=item.id))),
dict(controller="admin_toolshed", action="manage_repository", id=item.id))),
target="center",
attach_popup=True),
DescriptionColumn(label="Description"),
OwnerColumn(label="Owner"),
Expand All @@ -158,10 +159,7 @@ def get_accepted_filters(self):
]
operations = [grids.GridOperation(label="Update tool shed status",
condition=(lambda item: not item.deleted),
allow_multiple=False,
url_args=dict(controller='admin_toolshed',
action='browse_repositories',
operation='update tool shed status')),
allow_multiple=False),
grids.GridOperation(label="Get updates",
condition=(lambda item:
not item.deleted and
Expand All @@ -170,20 +168,21 @@ def get_accepted_filters(self):
tool_shed_install.ToolShedRepository.installation_status.ERROR,
tool_shed_install.ToolShedRepository.installation_status.NEW]),
allow_multiple=False,
target="center",
url_args=dict(controller='admin_toolshed',
action='browse_repositories',
operation='get updates')),
action='check_for_updates')),
grids.GridOperation(label="Install latest revision",
condition=(lambda item: item.upgrade_available),
allow_multiple=False,
target="center",
url_args=dict(controller='admin_toolshed',
action='browse_repositories',
operation='install latest revision')),
action='install_latest_repository_revision')),
grids.GridOperation(label="Install",
condition=(lambda item:
not item.deleted and
item.status == tool_shed_install.ToolShedRepository.installation_status.NEW),
allow_multiple=False,
target='center',
url_args=dict(controller='admin_toolshed',
action='manage_repository',
operation='install')),
Expand All @@ -192,30 +191,29 @@ def get_accepted_filters(self):
not item.deleted and
item.status != tool_shed_install.ToolShedRepository.installation_status.NEW),
allow_multiple=True,
target="center",
url_args=dict(controller='admin_toolshed',
action='browse_repositories',
operation='deactivate or uninstall')),
action='deactivate_or_uninstall_repository')),
grids.GridOperation(label="Reset to install",
condition=(lambda item:
(item.status == tool_shed_install.ToolShedRepository.installation_status.ERROR)),
allow_multiple=False,
target='center',
url_args=dict(controller='admin_toolshed',
action='browse_repositories',
operation='reset to install')),
action='reset_to_install',
reset_repository=True)),
grids.GridOperation(label="Activate or reinstall",
condition=(lambda item: item.deleted),
allow_multiple=False,
target=None,
target='center',
url_args=dict(controller='admin_toolshed',
action='browse_repositories',
operation='activate or reinstall')),
action='restore_repository')),
grids.GridOperation(label="Purge",
condition=(lambda item: item.is_new),
allow_multiple=False,
target=None,
target='center',
url_args=dict(controller='admin_toolshed',
action='browse_repositories',
operation='purge'))]
action='purge_repository'))]
standard_filters = []
default_filter = dict(deleted="False")
num_rows_per_page = 50
Expand Down

0 comments on commit 2f2acb9

Please sign in to comment.