Skip to content

Commit

Permalink
Merge pull request #20 from will-moore/search_engine_studies
Browse files Browse the repository at this point in the history
Search engine studies
  • Loading branch information
will-moore authored Feb 1, 2023
2 parents 99ec74c + 5c31a23 commit 0b6d477
Show file tree
Hide file tree
Showing 4 changed files with 410 additions and 102 deletions.
9 changes: 8 additions & 1 deletion idr_gallery/static/idr_gallery/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ class StudiesModel {
}

filterStudiesAnyText(text) {
// Search for studies with text in their keys, values, or description.
// Search for studies with text in their keys, values, name or description.
// Returns a list of matching studies. Each study is returned along with kvps that match text
// [study, [{key: value}, {Description: this study is great}]]

Expand All @@ -393,6 +393,13 @@ class StudiesModel {
let keyValuePairs = [];
if (study.mapValues) {
keyValuePairs = [...study.mapValues];

// Don't want to find "annotation.csv" KVPs
keyValuePairs = keyValuePairs.filter(
(kvp) => !kvp[1].includes("annotation.csv")
);

keyValuePairs.push(["Name", study.Name]);
}
keyValuePairs.push(["Description", study.StudyDescription]);
let match = keyValuePairs.some((kvp) => regex.test(kvp[1]));
Expand Down
Loading

0 comments on commit 0b6d477

Please sign in to comment.