Skip to content

Commit

Permalink
Merge pull request #17155 from guerler/grids_tool_versions
Browse files Browse the repository at this point in the history
Remove legacy tool versions list from admin panel
  • Loading branch information
mvdbeek authored Feb 7, 2024
2 parents e5dc724 + 5b1122b commit 47926ba
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 72 deletions.
5 changes: 0 additions & 5 deletions client/src/components/admin/AdminPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,6 @@ export default {
title: "Manage Dependencies",
route: "/admin/toolbox_dependencies",
},
{
id: "admin-link-tool-versions",
title: "View Lineage",
route: "/admin/tool_versions",
},
{
id: "admin-link-error-stack",
title: "View Error Logs",
Expand Down
6 changes: 0 additions & 6 deletions client/src/components/admin/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@
</strong>
- Select on which repositories you want to reset metadata.
</li>
<li>
<strong>
<router-link to="/admin/tool_versions">View Lineage</router-link>
</strong>
- A view of a version lineages for all installed tools. Useful for debugging.
</li>
</ul>
</div>
</template>
Expand Down
8 changes: 0 additions & 8 deletions client/src/entry/analysis/routes/admin-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import adminGroupsGridConfig from "components/Grid/configs/adminGroups";
import adminQuotasGridConfig from "components/Grid/configs/adminQuotas";
import adminRolesGridConfig from "components/Grid/configs/adminRoles";
import adminUsersGridConfig from "components/Grid/configs/adminUsers";
import Grid from "components/Grid/Grid";
import GridList from "components/Grid/GridList";
import RegisterForm from "components/Login/RegisterForm";
import Toolshed from "components/Toolshed/Index";
Expand Down Expand Up @@ -169,13 +168,6 @@ export default [
gridMessage: route.query.message,
}),
},
{
path: "tool_versions",
component: Grid,
props: {
urlBase: "admin/tool_versions_list",
},
},
// forms
{
path: "form/reset_user_password",
Expand Down
53 changes: 0 additions & 53 deletions lib/galaxy/webapps/galaxy/controllers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
)
from galaxy.exceptions import ActionInputError
from galaxy.managers.quotas import QuotaManager
from galaxy.model import tool_shed_install as install_model
from galaxy.model.base import transaction
from galaxy.model.index_filter_util import (
raw_text_column_filter,
Expand Down Expand Up @@ -355,52 +354,6 @@ def apply_query_filter(self, query, **kwargs):
return query


class ToolVersionListGrid(grids.Grid):
class ToolIdColumn(grids.TextColumn):
def get_value(self, trans, grid, tool_version):
toolbox = trans.app.toolbox
if toolbox.has_tool(tool_version.tool_id, exact=True):
link = url_for(controller="tool_runner", tool_id=tool_version.tool_id)
link_str = f'<a target="_blank" href="{link}">'
return f'<div class="count-box state-color-ok">{link_str}{tool_version.tool_id}</a></div>'
return tool_version.tool_id

class ToolVersionsColumn(grids.TextColumn):
def get_value(self, trans, grid, tool_version):
tool_ids_str = ""
toolbox = trans.app.toolbox
if tool := toolbox._tools_by_id.get(tool_version.tool_id):
for tool_id in tool.lineage.tool_ids:
if toolbox.has_tool(tool_id, exact=True):
link = url_for(controller="tool_runner", tool_id=tool_id)
link_str = f'<a target="_blank" href="{link}">'
tool_ids_str += f'<div class="count-box state-color-ok">{link_str}{tool_id}</a></div><br/>'
else:
tool_ids_str += f"{tool_version.tool_id}<br/>"
else:
tool_ids_str += f"{tool_version.tool_id}<br/>"
return tool_ids_str

# Grid definition
title = "Tool versions"
model_class = install_model.ToolVersion
default_sort_key = "tool_id"
columns = [
ToolIdColumn("Tool id", key="tool_id", attach_popup=False),
ToolVersionsColumn("Version lineage by tool id (parent/child ordered)"),
]
columns.append(
grids.MulticolFilterColumn(
"Search tool id", cols_to_filter=[columns[0]], key="free-text-search", visible=False, filterable="standard"
)
)
num_rows_per_page = 50
use_paging = True

def build_initial_query(self, trans, **kwd):
return trans.install_model.context.query(self.model_class)


# TODO: Convert admin UI to use the API and drop this.
class DatatypesEntryT(TypedDict):
status: str
Expand All @@ -414,7 +367,6 @@ class AdminGalaxy(controller.JSAppLauncher):
role_list_grid = RoleListGrid()
group_list_grid = GroupListGrid()
quota_list_grid = QuotaListGrid()
tool_version_list_grid = ToolVersionListGrid()

def __init__(self, app: StructuredApp):
super().__init__(app)
Expand Down Expand Up @@ -688,11 +640,6 @@ def impersonate(self, trans, **kwd):
web.url_for(controller="admin", action="users", message="Invalid user selected", status="error")
)

@web.legacy_expose_api
@web.require_admin
def tool_versions_list(self, trans, **kwd):
return self.tool_version_list_grid(trans, **kwd)

@web.expose
@web.json
@web.require_admin
Expand Down

0 comments on commit 47926ba

Please sign in to comment.