Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: click tag to create filter #863 #1297

Merged

Conversation

squigglybob
Copy link
Collaborator

resolves #863

@squigglybob squigglybob changed the title feat: allow query parameters on archive pages feat: click tag to create filter Apr 16, 2021
@squigglybob squigglybob changed the title feat: click tag to create filter feat: click tag to create filter #863 Apr 16, 2021
@corsacca
Copy link
Member

This looks brilliant.

@squigglybob squigglybob marked this pull request as draft April 19, 2021 11:49
@squigglybob squigglybob marked this pull request as ready for review April 19, 2021 15:38
@squigglybob
Copy link
Collaborator Author

Hi @corsacca This PR is ready to go for review I think :)

@corsacca
Copy link
Member

Thank you @squigglybob
To simplify I think we could remove the name part of the filter, and have it default to the 'Custom Filter' as you do here: https://github.com/DiscipleTools/disciple-tools-theme/pull/1297/files#diff-f4c9631e9bb5cbd0faec26098367fc3c1eb03a42b1df5e238c0fe29bd9f8a5a7R130
The label is what is displayed.

Will this setup handle a multiple field query?
ie: overall_status: 'active', seeker_path: 'met'
or tags: ['tag_1', 'tag_2' ]

@squigglybob
Copy link
Collaborator Author

squigglybob commented Apr 20, 2021

No worries @corsacca. Yes it will handle multiple field query, each filterLabel query param defines a new field query, and then they all get built together into a custom query. maybe the query params should be called fieldQuery instead of filterLabel ?

Also just to clarify, do you want me to remove the optional queryparam filterName ?

@corsacca
Copy link
Member

@squigglybob Yeah. Please remove it, i'm looking at the list code and the name field does not look like it is being used.

@corsacca
Copy link
Member

fieldQuery is maybe better too.

@squigglybob
Copy link
Collaborator Author

ok @corsacca those last query param name changes are done also

@corsacca
Copy link
Member

Thanks @squigglybob looks good.
I created a tag this&that and the list doesn't seem to filter to it. Is that the same for you?

@squigglybob
Copy link
Collaborator Author

squigglybob commented Apr 20, 2021

Yes, i'm getting the same thing @corsacca

Hmmm. It looks like the ampersand & is not being encoded by encodeUri as it doesn't encode this list of characters:

A-Z a-z 0-9 ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) #

It looks like encodeUriComponent should do the trick though...

& + and many other chars aren't escaped by encodeURI as it deals with encoding a full URI without breaking it for GET and POST requests which need & to be kept
@corsacca corsacca merged commit 61af3a7 into DiscipleTools:master Apr 20, 2021
@squigglybob squigglybob deleted the 863-click-tag-to-create-filter branch April 20, 2021 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tags: clickable tag to create a list/filter
2 participants