diff --git a/client/src/api/tools.ts b/client/src/api/tools.ts
index 7ef06925577..16cd60c4591 100644
--- a/client/src/api/tools.ts
+++ b/client/src/api/tools.ts
@@ -1,5 +1,6 @@
import { type components, GalaxyApi } from "@/api";
import { ERROR_STATES, type ShowFullJobResponse } from "@/api/jobs";
+import type { Tool, ToolPanelItem, ToolSection, ToolSectionLabel } from "@/stores/toolStore";
import { errorMessageAsString } from "@/utils/simple-error";
export type HdcaUploadTarget = components["schemas"]["HdcaDataItemsTarget"];
@@ -130,3 +131,17 @@ export function fetchJobErrorMessage(jobDetails: ShowFullJobResponse): string |
}
return errorMessage;
}
+
+// TODO: Once the backend models are typed, make sure these type guards are correct.
+export function isTool(section: ToolPanelItem): section is Tool {
+ return !isToolSection(section) && !isToolSectionLabel(section);
+}
+export function isToolSection(section: ToolPanelItem): section is ToolSection {
+ return (section as ToolSection).tools !== undefined || (section as ToolSection).elems !== undefined;
+}
+export function isToolSectionLabel(section: ToolPanelItem): section is ToolSectionLabel {
+ return (
+ (section as ToolSectionLabel).text !== undefined &&
+ (section as ToolSectionLabel).model_class === "ToolSectionLabel"
+ );
+}
diff --git a/client/src/components/Panels/Common/Tool.vue b/client/src/components/Panels/Common/Tool.vue
index 3e3a1b5553a..f47c2011af3 100644
--- a/client/src/components/Panels/Common/Tool.vue
+++ b/client/src/components/Panels/Common/Tool.vue
@@ -1,135 +1,96 @@
-
-
-
-
-
+
+
+
+