From 54865cebaa0e6503bdc93e8cb56c6d491aea5ab7 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Thu, 14 Dec 2023 23:35:33 +0500 Subject: [PATCH] [23.2] Fix tools missing in panel bug Some tools would be filtered out from the tool panel needlessly when organizing the `ToolPanel` in `Panels/utilities.ts`. --- client/src/components/Panels/utilities.ts | 11 +---------- client/src/stores/toolStore.ts | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/client/src/components/Panels/utilities.ts b/client/src/components/Panels/utilities.ts index a1e0ff9d8bfe..2eea547074c6 100644 --- a/client/src/components/Panels/utilities.ts +++ b/client/src/components/Panels/utilities.ts @@ -158,22 +158,13 @@ export function getValidToolsInCurrentView( isWorkflowPanel = false, excludedSectionIds: string[] = [] ) { - const addedToolTexts: string[] = []; const toolEntries = Object.entries(toolsById).filter(([, tool]) => { - // filter out duplicate tools (different ids, same exact name+description) - // related ticket: https://github.com/galaxyproject/galaxy/issues/16145 - const toolText = tool.name + tool.description; - if (addedToolTexts.includes(toolText)) { - return false; - } else { - addedToolTexts.push(toolText); - } // filter on non-hidden, non-disabled, and workflow compatibile (based on props.workflow) return ( !tool.hidden && tool.disabled !== true && !(isWorkflowPanel && !tool.is_workflow_compatible) && - !excludedSectionIds.includes(tool.panel_section_id || "") + !excludedSectionIds.includes(tool.panel_section_id) ); }); return Object.fromEntries(toolEntries); diff --git a/client/src/stores/toolStore.ts b/client/src/stores/toolStore.ts index 0ccfc30b364a..694322d3c0d1 100644 --- a/client/src/stores/toolStore.ts +++ b/client/src/stores/toolStore.ts @@ -27,7 +27,7 @@ export interface Tool { link: string; min_width: number; target: string; - panel_section_id: string | null; + panel_section_id: string; panel_section_name: string | null; form_style: string; disabled?: boolean;