mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #9873 from juleengraham/fav-tool-version
Show favourited tools independent of version
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
export function filterToolSections(layout, results) {
|
||||
if (results) {
|
||||
results = normalize_results(results);
|
||||
const filteredLayout = layout.map((section) => {
|
||||
var toolRes = [];
|
||||
if (section.elems) {
|
||||
section.elems.forEach((el) => {
|
||||
if (!el.text && results.includes(el.id)) {
|
||||
if (
|
||||
(!el.text && results.includes(el.id)) ||
|
||||
(el.tool_shed_repository && results.includes(el.tool_shed_repository.name))
|
||||
) {
|
||||
toolRes.push(el);
|
||||
}
|
||||
});
|
||||
@@ -41,6 +45,7 @@ export function filterTools(layout, results) {
|
||||
// do not consider expression tools, unless requested by the workflow editor
|
||||
layout = layout.filter((section) => section.name !== "Expression Tools");
|
||||
if (results) {
|
||||
results = normalize_results(results);
|
||||
var toolsResults = [];
|
||||
if (results.length < 1) {
|
||||
return toolsResults;
|
||||
@@ -50,7 +55,10 @@ export function filterTools(layout, results) {
|
||||
layout.map((section) => {
|
||||
if (section.elems) {
|
||||
section.elems.forEach((el) => {
|
||||
if (!el.text && results.includes(el.id)) {
|
||||
if (
|
||||
(!el.text && results.includes(el.id)) ||
|
||||
(el.tool_shed_repository && results.includes(el.tool_shed_repository.name))
|
||||
) {
|
||||
toolsResults.push(el);
|
||||
}
|
||||
});
|
||||
@@ -65,3 +73,15 @@ export function filterTools(layout, results) {
|
||||
return layout;
|
||||
}
|
||||
}
|
||||
|
||||
function normalize_results(results) {
|
||||
var norm_results = [];
|
||||
results.forEach((result) => {
|
||||
if (result.includes("/repos/")) {
|
||||
norm_results.push(result.split("/")[3]);
|
||||
} else {
|
||||
norm_results.push(result);
|
||||
}
|
||||
});
|
||||
return norm_results;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user