Skip to content

Commit

Permalink
fix: bookmark table, only filter on valid fields
Browse files Browse the repository at this point in the history
  • Loading branch information
whelmich committed Nov 25, 2024
1 parent b98fd90 commit fb284e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/workspace/helpers/OptionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const createAnnotationOptionList = (items) => {
i.annotations.forEach((a) => {
if (!(a.annotationType in hits)) {
hits[a.annotationType] = true;
if (a.annotationType == "custom") return;
list.push({
value: a.annotationType,
name: "⊆ " + AnnotationTranslator(a),
Expand Down
14 changes: 8 additions & 6 deletions app/workspace/projects/bookmark/BookmarkTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,14 @@ class BookmarkTable extends React.PureComponent {
)) ||
// annotations
(bookmark.annotations &&
bookmark.annotations.some((annotation) =>
Object.keys(annotation).some(
(key) =>
typeof annotation[key] === "string" &&
annotation[key].toLowerCase().includes(k),
),
bookmark.annotations.some(
(annotation) =>
annotation.annotationType !== CUSTOM &&
Object.keys(annotation).some(
(key) =>
typeof annotation[key] === "string" &&
annotation[key].toLowerCase().includes(k),
),
)),
);
});
Expand Down

0 comments on commit fb284e1

Please sign in to comment.