1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Narrow list of tags to related ones

When a tag is selected, the tag list narrows to show only the related
ones: all tags associated to the currently visible notes. Clicking on
the plus sign near another tag narrows the list again to the tags of
notes associated with the firstly AND secondly selected tag. To show
every tags again, press the tag icon on the top-left corner of
Boostnote.

Before:
![screencast](https://i.imgur.com/PwAdhLe.gif)

After:
![screencast](https://i.imgur.com/s3JCaFq.gif)

NOTE: Tags are joined with `&` character (`#` not works) in
`location.pathname` thus it will make the tags with this character
unavailable. Any suggestion to pass multiple values via pathname?
This commit is contained in:
bimlas
2018-03-26 16:48:07 +02:00
parent 25440a26ee
commit 6c542750f4
5 changed files with 90 additions and 26 deletions

View File

@@ -343,10 +343,11 @@ class NoteList extends React.Component {
}
if (location.pathname.match(/\/tags/)) {
const listOfTags = params.tagname.split('&')
return data.noteMap.map(note => {
return note
}).filter(note => {
return note.tags.includes(params.tagname)
return listOfTags.every((tag) => note.tags.includes(tag))
})
}