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

Explorer: Use query parameters when filtering groups #25

Open
vplasencia opened this issue Dec 2, 2024 · 8 comments · May be fixed by #29
Open

Explorer: Use query parameters when filtering groups #25

vplasencia opened this issue Dec 2, 2024 · 8 comments · May be fixed by #29
Assignees
Labels
feature 🚀 This is enhancing something existing or creating something new good first issue Good for newcomers

Comments

@vplasencia
Copy link
Member

Description

It would be nice to have query parameters in the URL so that people that want to save or send a url with groups with a specific filter, can do it. This can be useful to send a string with all the groups that have a specific admin for example.

Example URL:

https://explorer.semaphore.pse.dev/sepolia?query=0x1234

Resources

https://nextjs.org/docs/app/building-your-application/routing/route-handlers#url-query-parameters

@vplasencia vplasencia added refactoring ♻️ A code change that neither fixes a bug nor adds a feature feature 🚀 This is enhancing something existing or creating something new good first issue Good for newcomers and removed refactoring ♻️ A code change that neither fixes a bug nor adds a feature labels Dec 2, 2024
@roasted-tum0r
Copy link

Hi, I am very new to solving issues in git hub. Very very new so please if you could walk me through where ill find in the hosted website and/or file in codebase where this enhancement needs to be done. Thanks.

@tb38r
Copy link
Contributor

tb38r commented Dec 4, 2024

Hi @vplasencia , picked up this issue via the goodfirstissues site as I'd like to get involved with the open source environment.

Default home page pre amendments
Screenshot 2024-12-04 at 17 46 28

I wasn't entirely sure of the scope of your brief, deduced it to users being able to filter groups via params using an admin's id

returns groups where admin id = 0xcd752555cb1d00d9380e7a7927f84798b9efb4a4
Screenshot 2024-12-04 at 17 46 59

& where admin id = 0x8860ffd389aff6930481b953aac095c9f85ccaae
Screenshot 2024-12-04 at 17 47 35

As is, the only valid param is 'admin' , could reconfigure with others with further instruction.

If you're happy with the above and would like to validate the code, feel free to add me as a collaborator and I'd be happy to push the branch to the repo.

As an aside, I noticed the current id filtering on the homepage is partially incorrect <0, 1, 10, 100, 11, 12, 13....> as (presumably) opposed to <0,1,2,3,4,5...>

@vplasencia
Copy link
Member Author

Hey @roasted-tum0r!

Would you like me to assign you this issue?

There are many articles and videos related to open source contributions. You can take a look at some of them.

Here, there is an article and a video that can help you create a Pull Request:

Article: https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/

Video: https://youtu.be/nCKdihvneS0

In this section, you can find the hosted website: https://github.com/semaphore-protocol/extensions?tab=readme-ov-file#%EF%B8%8F-apps

The project is Explorer

Hosted website: https://explorer.semaphore.pse.dev/

Project code: https://github.com/semaphore-protocol/extensions/tree/main/apps/explorer

To have more context of the project, you can always read the Readme.md file that is displayed on every repo. If you scroll down, you will see it: https://github.com/semaphore-protocol/extensions

Here is the Readme file: https://github.com/semaphore-protocol/extensions/blob/main/README.md

Before contributing, it's always important to read the CONTRIBUTING.md file on the repo (in case the repo has the file): https://github.com/semaphore-protocol/extensions/blob/main/CONTRIBUTING.md

Please, let us know if you have more questions.

@vplasencia
Copy link
Member Author

Hey @tb38r!

I just asked @roasted-tum0r if they would like to work on the issue since they asked first. In case they want, we will assign them the issue. We could wait a few days for their answer.

What you propose is exactly what this issue is about. Apart from filtering by admin, it would be nice to filter by group id.

Also, add the filtered data to the search bar (input text) so that it's easier for the user to know what it's being filtered.

As an aside, I noticed the current id filtering on the homepage is partially incorrect <0, 1, 10, 100, 11, 12, 13....> as (presumably) opposed to <0,1,2,3,4,5...>

Thank you for pointing this out. Would you like to create an issue and a PR to fix this?

@tb38r
Copy link
Contributor

tb38r commented Dec 10, 2024

Hi @vplasencia , I've opened the PR as requested .

Should @roasted-tum0r fail to get back to you, feel free to hit me up and I'll make another for this issue with the additional (input text) proposal addressed as well.

Cheers!

@vplasencia
Copy link
Member Author

Hey @tb38r! Thank you very much!

Feel free to work on this issue. Do you want me to assign you this issue?

@tb38r
Copy link
Contributor

tb38r commented Dec 11, 2024

Hey @vplasencia , no problem!
Please do, no problem.

  1. Just to clarify, you'd like for an additional param (groupid) to be permitted in addition to admin as shown in the screenshots?
  2. The chosen param should be reflected in the input box (i.e. the int (1...100) if a group ids or 0x8376... if an admin's being used instead?

As such, the following
/sepolia?admin=0x7bcd6f009471e9974a77086a69289d16eadba286
/sepolia?groupid=23

would eventually be permissible.


Without meaning to overcomplicate the brief, would you want for multiple params to be allowed?
For eg : /sepolia?id=3&id=4

where we'd return all instances that satisfy the params.

Or would you rather keep it simple and return one entity be it a provided group or admin id?

With the search input requirement I'm guessing just a single param but would rather be certain before getting started !

@vplasencia
Copy link
Member Author

Hey @tb38r I assigned you this issue. Feel free to work on it.

Hey @vplasencia , no problem! Please do, no problem.

  1. Just to clarify, you'd like for an additional param (groupid) to be permitted in addition to admin as shown in the screenshots?
  2. The chosen param should be reflected in the input box (i.e. the int (1...100) if a group ids or 0x8376... if an admin's being used instead?

As such, the following /sepolia?admin=0x7bcd6f009471e9974a77086a69289d16eadba286 /sepolia?groupid=23

would eventually be permissible.

Yes, correct. The idea is to support admin and groupid. Both shouldn't be part of the url at the same time.

Without meaning to overcomplicate the brief, would you want for multiple params to be allowed? For eg : /sepolia?id=3&id=4

where we'd return all instances that satisfy the params.

Or would you rather keep it simple and return one entity be it a provided group or admin id?

With the search input requirement I'm guessing just a single param but would rather be certain before getting started !

Just one groupid, not many at the same time and the same for admin.

tb38r added a commit to tb38r/extensions that referenced this issue Dec 14, 2024
Content can now be filtered using either the params groupid or admin

re semaphore-protocol#25
tb38r added a commit to tb38r/extensions that referenced this issue Dec 14, 2024
Groups and groups belonging to a specified admin can now be filtered via query parameters.
Additionally, the query parameters are reflected within the input element.

re semaphore-protocol#25
@tb38r tb38r linked a pull request Dec 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🚀 This is enhancing something existing or creating something new good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants