mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
ToolBoxWorkflow only include and search for compatible tools
This commit is contained in:
@@ -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`;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<tool-search
|
||||
:current-panel-view="currentPanelView"
|
||||
placeholder="search tools"
|
||||
:toolbox="toolbox"
|
||||
:toolbox="workflowTools"
|
||||
:query="query"
|
||||
@onQuery="onQuery"
|
||||
@onResults="onResults" />
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user