Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webworker tool search for a custom view filters out correct matches #17206

Closed
martenson opened this issue Dec 18, 2023 · 1 comment
Closed

webworker tool search for a custom view filters out correct matches #17206

martenson opened this issue Dec 18, 2023 · 1 comment
Assignees
Labels

Comments

@martenson
Copy link
Member

martenson commented Dec 18, 2023

As seen on https://vgp.usegalaxy.org/ and reproduced on 23.2 locally if you add the following as config/plugins/activities/vgp.yaml and search for cut.

name: Vertebrate Genomes Project
type: generic
id: vgp
items:
- type: section
  id: vgp_pipeline_tools
  name: VGP Pipeline Tools
  items:
  - type: tool
    id: Cut1

The correct results are being lost in the createSortedResultObject function because they are identified as belonging to "uncategorized" section.

The following diff demonstrates what the code expects for the search on a custom view to work (vgp view search works after applying this).

It is unclear to me how this was supposed to work, especially the VALID_SECTION_TYPES and getPanelSectionsForTool function hence creating this issue before I dive deeper.

diff --git a/client/src/components/Panels/utilities.ts b/client/src/components/Panels/utilities.ts
index 2eea547074..84417fdc9e 100644
--- a/client/src/components/Panels/utilities.ts
+++ b/client/src/components/Panels/utilities.ts
@@ -23,7 +23,8 @@ const UNSECTIONED_SECTION = {
     name: "Unsectioned Tools",
     description: "Tools that don't appear under any section in the unsearched panel",
 };
-const VALID_SECTION_TYPES = ["edam_operations", "edam_topics"]; // other than `default`
+const VALID_SECTION_TYPES = ["edam_operations", "edam_topics", "vgp_pipeline_tools"]; // other than `default`
+// const VALID_SECTION_TYPES = ["edam_operations", "edam_topics"]; // other than `default`

 /** These are keys used to order/sort results in `ToolSearch`.
  * The value for each is the sort order, higher number = higher rank.
@@ -424,6 +425,7 @@ export function createSortedResultObject(
  * @returns Array of section ids
  */
 function getPanelSectionsForTool(tool: Tool, panelView: string) {
+    panelView = "generic:vgp_pipeline_tools"
     if (panelView === "default" && tool.panel_section_id) {
         if (tool.panel_section_id.startsWith("tool_")) {
             return [tool.panel_section_id.split("tool_")[1]];
@@ -434,10 +436,12 @@ function getPanelSectionsForTool(tool: Tool, panelView: string) {
         const sectionType = panelView.split(":")[1] as keyof Tool;
         if (
             sectionType &&
-            VALID_SECTION_TYPES.includes(sectionType as string) &&
-            (tool[sectionType] as string[])?.length !== 0
+            VALID_SECTION_TYPES.includes(sectionType as string)
+            // VALID_SECTION_TYPES.includes(sectionType as string) &&
+            // (tool[sectionType] as string[])?.length !== 0
         ) {
-            return tool[sectionType] as string[];
+            // return tool[sectionType] as string[];
+            return ["vgp_pipeline_tools"]
         } else {
             return ["uncategorized"];
         }
@martenson martenson changed the title tool search for a custom view filters out correct matches webworker tool search for a custom view filters out correct matches Dec 18, 2023
@ahmedhamidawan ahmedhamidawan self-assigned this Dec 19, 2023
@ahmedhamidawan
Copy link
Member

Fixed in #17213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants