forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request galaxyproject#17684 from ahmedhamidawan/grid_filte…
…ring_bugs [24.0] Grid filtering bug fixes
- Loading branch information
Showing
12 changed files
with
505 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,115 +1,171 @@ | ||
import Filtering, { contains, equals, expandNameTag, toBool } from "utils/filtering"; | ||
|
||
export const helpHtml = `<div> | ||
<p>This input can be used to filter the workflows displayed.</p> | ||
export function helpHtml(activeList = "my") { | ||
let extra = ""; | ||
if (activeList === "my") { | ||
extra = `<dt><code>is:published</code></dt> | ||
<dd> | ||
Shows published workflows. | ||
</dd> | ||
<dt><code>is:importable</code></dt> | ||
<dd> | ||
Shows importable workflows (this also means they are URL generated). | ||
</dd> | ||
<dt><code>is:shared_with_me</code></dt> | ||
<dd> | ||
Shows workflows shared by another user directly with you. | ||
</dd> | ||
<dt><code>is:deleted</code></dt> | ||
<dd>Shows deleted workflows.</dd>`; | ||
} else if (activeList === "shared_with_me") { | ||
extra = `<dt><code>user:____</code></dt> | ||
<dd> | ||
Shows workflows owned by the given user. | ||
</dd> | ||
<dt><code>is:published</code></dt> | ||
<dd> | ||
Shows published workflows. | ||
</dd>`; | ||
} else { | ||
extra = `<dt><code>user:____</code></dt> | ||
<dd> | ||
Shows workflows owned by the given user. | ||
</dd> | ||
<dt><code>is:shared_with_me</code></dt> | ||
<dd> | ||
Shows workflows shared by another user directly with you. | ||
</dd>`; | ||
} | ||
|
||
<p> | ||
Text entered here will be searched against workflow names and workflow | ||
tags. Additionally, advanced filtering tags can be used to refine the | ||
search more precisely. Filtering tags are of the form | ||
<code><tag_name>:<tag_value></code> or | ||
<code><tag_name>:'<tag_value>'</code>. For instance to | ||
search just for RNAseq in the workflow name, | ||
<code>name:rnsseq</code> can be used. Notice by default the search is | ||
not case-sensitive. If the quoted version of tag is used, the search is | ||
case sensitive and only full matches will be returned. So | ||
<code>name:'RNAseq'</code> would show only workflows named exactly | ||
<code>RNAseq</code>. | ||
</p> | ||
const conditionalHelpHtml = `<div> | ||
<p>This menu can be used to filter the workflows displayed.</p> | ||
<p>The available filtering tags are:</p> | ||
<dl> | ||
<dt><code>name</code></dt> | ||
<dd> | ||
Shows workflows with the given sequence of characters in their names. | ||
</dd> | ||
<dt><code>tag</code></dt> | ||
<dd> | ||
Shows workflows with the given workflow tag. You may also click | ||
on a tag to filter on that tag directly. | ||
</dd> | ||
<dt><code>is:published</code></dt> | ||
<dd> | ||
Shows published workflows. | ||
</dd> | ||
<dt><code>is:importable</code></dt> | ||
<dd> | ||
Shows importable workflows (this also means they are URL generated). | ||
</dd> | ||
<dt><code>is:shared_with_me</code></dt> | ||
<dd> | ||
Shows workflows shared by another user directly with you. | ||
</dd> | ||
<dt><code>is:deleted</code></dt> | ||
<dd>Shows deleted workflows.</dd> | ||
</dl> | ||
</div>`; | ||
<p> | ||
Text entered here will be searched against workflow names and workflow | ||
tags. Additionally, advanced filtering tags can be used to refine the | ||
search more precisely. Filtering tags are of the form | ||
<code><tag_name>:<tag_value></code> or | ||
<code><tag_name>:'<tag_value>'</code>. For instance to | ||
search just for RNAseq in the workflow name, | ||
<code>name:rnsseq</code> can be used. Notice by default the search is | ||
not case-sensitive. If the quoted version of tag is used, the search is | ||
case sensitive and only full matches will be returned. So | ||
<code>name:'RNAseq'</code> would show only workflows named exactly | ||
<code>RNAseq</code>. | ||
</p> | ||
const validFilters = { | ||
name: { placeholder: "name", type: String, handler: contains("name"), menuItem: true }, | ||
user: { | ||
placeholder: "owner", | ||
type: String, | ||
handler: contains("user"), | ||
menuItem: false, | ||
}, | ||
tag: { | ||
placeholder: "tag(s)", | ||
type: "MultiTags", | ||
handler: contains("tag", "tag", expandNameTag), | ||
menuItem: true, | ||
}, | ||
published: { | ||
placeholder: "Filter on published workflows", | ||
type: Boolean, | ||
boolType: "is", | ||
handler: equals("published", "published", toBool), | ||
menuItem: true, | ||
}, | ||
importable: { | ||
placeholder: "Filter on importable workflows", | ||
type: Boolean, | ||
boolType: "is", | ||
handler: equals("importable", "importable", toBool), | ||
menuItem: true, | ||
}, | ||
shared_with_me: { | ||
placeholder: "Filter on workflows shared with me", | ||
type: Boolean, | ||
boolType: "is", | ||
handler: equals("shared_with_me", "shared_with_me", toBool), | ||
menuItem: true, | ||
}, | ||
deleted: { | ||
placeholder: "Filter on deleted workflows", | ||
type: Boolean, | ||
boolType: "is", | ||
handler: equals("deleted", "deleted", toBool), | ||
menuItem: true, | ||
}, | ||
}; | ||
<p>The available filtering tags are:</p> | ||
<dl> | ||
<dt><code>name:____</code></dt> | ||
<dd> | ||
Shows workflows with the given sequence of characters in their names. | ||
</dd> | ||
<dt><code>tag:____</code></dt> | ||
<dd> | ||
Shows workflows with the given workflow tag. You may also click | ||
on a tag to filter on that tag directly. | ||
</dd> | ||
${extra} | ||
</dl> | ||
</div>`; | ||
return conditionalHelpHtml; | ||
} | ||
|
||
export const WorkflowFilters = new Filtering(validFilters, undefined, false, false); | ||
export function WorkflowFilters(activeList = "my") { | ||
const commonFilters = { | ||
name: { placeholder: "name", type: String, handler: contains("name"), menuItem: true }, | ||
n: { handler: contains("n"), menuItem: false }, | ||
tag: { | ||
placeholder: "tag(s)", | ||
type: "MultiTags", | ||
handler: contains("tag", "tag", expandNameTag), | ||
menuItem: true, | ||
}, | ||
t: { type: "MultiTags", handler: contains("t", "t", expandNameTag), menuItem: false }, | ||
}; | ||
|
||
const validPublishedFilters = { | ||
...validFilters, | ||
user: { | ||
...validFilters.user, | ||
menuItem: true, | ||
}, | ||
published: { | ||
...validFilters.published, | ||
default: true, | ||
menuItem: false, | ||
}, | ||
shared_with_me: { | ||
...validFilters.shared_with_me, | ||
menuItem: false, | ||
}, | ||
importable: { | ||
...validFilters.importable, | ||
menuItem: false, | ||
}, | ||
}; | ||
|
||
export const PublishedWorkflowFilters = new Filtering(validPublishedFilters, undefined, false, false); | ||
if (activeList === "my") { | ||
return new Filtering( | ||
{ | ||
...commonFilters, | ||
published: { | ||
placeholder: "Filter on published workflows", | ||
type: Boolean, | ||
boolType: "is", | ||
handler: equals("published", "published", toBool), | ||
menuItem: true, | ||
}, | ||
importable: { | ||
placeholder: "Filter on importable workflows", | ||
type: Boolean, | ||
boolType: "is", | ||
handler: equals("importable", "importable", toBool), | ||
menuItem: true, | ||
}, | ||
shared_with_me: { | ||
placeholder: "Filter on workflows shared with me", | ||
type: Boolean, | ||
boolType: "is", | ||
handler: equals("shared_with_me", "shared_with_me", toBool), | ||
menuItem: true, | ||
}, | ||
deleted: { | ||
placeholder: "Filter on deleted workflows", | ||
type: Boolean, | ||
boolType: "is", | ||
handler: equals("deleted", "deleted", toBool), | ||
menuItem: true, | ||
}, | ||
}, | ||
undefined, | ||
false, | ||
false | ||
); | ||
} else if (activeList === "shared_with_me") { | ||
return new Filtering( | ||
{ | ||
...commonFilters, | ||
user: { | ||
placeholder: "owner", | ||
type: String, | ||
handler: contains("user"), | ||
menuItem: true, | ||
}, | ||
u: { handler: contains("u"), menuItem: false }, | ||
published: { | ||
placeholder: "Filter on published workflows", | ||
type: Boolean, | ||
boolType: "is", | ||
handler: equals("published", "published", toBool), | ||
menuItem: true, | ||
}, | ||
}, | ||
undefined, | ||
false, | ||
false | ||
); | ||
} else { | ||
return new Filtering( | ||
{ | ||
...commonFilters, | ||
user: { | ||
placeholder: "owner", | ||
type: String, | ||
handler: contains("user"), | ||
menuItem: true, | ||
}, | ||
u: { handler: contains("u"), menuItem: false }, | ||
shared_with_me: { | ||
placeholder: "Filter on workflows shared with me", | ||
type: Boolean, | ||
boolType: "is", | ||
handler: equals("shared_with_me", "shared_with_me", toBool), | ||
menuItem: true, | ||
}, | ||
}, | ||
undefined, | ||
false, | ||
false | ||
); | ||
} | ||
} |
Oops, something went wrong.