diff --git a/client/src/components/Panels/Common/Tool.vue b/client/src/components/Panels/Common/Tool.vue index be926ec04ed..7da41962ca2 100644 --- a/client/src/components/Panels/Common/Tool.vue +++ b/client/src/components/Panels/Common/Tool.vue @@ -59,9 +59,9 @@ export default { computed: { targetClass() { if (this.toolKey) { - return `tool-menu-item-${this.tool[this.toolKey]} title-link`; + return `tool-menu-item-${this.tool[this.toolKey]} title-link cursor-pointer`; } else { - return `title-link`; + return `title-link cursor-pointer`; } }, }, diff --git a/client/src/components/Panels/ToolBoxWorkflow.vue b/client/src/components/Panels/ToolBoxWorkflow.vue index 95e2dab6d48..bcb26c53f60 100644 --- a/client/src/components/Panels/ToolBoxWorkflow.vue +++ b/client/src/components/Panels/ToolBoxWorkflow.vue @@ -18,7 +18,7 @@ @@ -74,7 +74,7 @@ import _l from "utils/localization"; import ToolSection from "./Common/ToolSection"; import ToolSearch from "./Common/ToolSearch"; -import { filterToolSections } from "./utilities"; +import { filterToolSections, removeDisabledTools } from "./utilities"; import PanelViewButton from "./Buttons/PanelViewButton"; export default { @@ -140,12 +140,13 @@ export default { }; }, sections() { - return filterToolSections(this.toolsLayout, this.results); + return filterToolSections(this.workflowTools, this.results); }, toolsLayout() { return this.toolbox.map((section) => { return { ...section, + disabled: !section.elems && !section.is_workflow_compatible, elems: section.elems && section.elems.map((el) => { @@ -155,6 +156,9 @@ export default { }; }); }, + workflowTools() { + return removeDisabledTools(this.toolsLayout); + }, }, methods: { onQuery(query) { diff --git a/client/src/components/Panels/utilities.js b/client/src/components/Panels/utilities.js index 8431e0828c1..434f1005d81 100644 --- a/client/src/components/Panels/utilities.js +++ b/client/src/components/Panels/utilities.js @@ -109,6 +109,22 @@ export function normalizeTools(tools) { return tools; } +export function removeDisabledTools(tools) { + return tools.filter((section) => { + if (section.model_class === "ToolSectionLabel") { + return true; + } else if (!section.elems && section.disabled) { + return false; + } else if (section.elems) { + section.elems = section.elems.filter((el) => !el.disabled); + if (!section.elems.length) { + return false; + } + } + return true; + }); +} + function flattenToolsSection(section) { const flattenTools = []; if (section.elems) {