-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
add click on "flag icon" for additional filtering #5340
add click on "flag icon" for additional filtering #5340
Conversation
…l and deprecated) into clickable buttons to filter record based on the tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great start, a few notes!
|
||
{{ if $isNative -}} | ||
<button type="button" class="badge rounded-pill text-bg-success text-white" | ||
onclick="document.getElementById('input-s').value = 'native'; document.getElementById('input-language').value = 'all';document.getElementById('input-component').value = 'all';document.getElementById('searchForm').submit();"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move the javascript code into a dedicated file? Since it is related to it, you can put it into https://github.com/open-telemetry/opentelemetry.io/blob/main/assets/js/registrySearch.js
I suggest that you add some data-
-tag to the elements and then select them in javascript:
<button type=button" data-filter-value="native" class="...">...native</button>
and then something like
document.querySelectorAll('[data-filter-value]').forEach(element => ...)
Also, provide a tooltip or something that says "click to filter by..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate your feedback. I will update the code accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @svrnm I’ve implemented the recommended changes. However, I observed an issue: after clicking a tag and the results page is rendered, clicking the tag again or another doesn’t trigger a new search. The reset button has to be clicked before the tag filter can work again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@basiratkareem can you append the label to the existing search term instead of setting/replacing it. This way someone can have an existing search word and refine their search with adding one of the labels. The only thing you might want to check for if the label is already included in the search string so it's not added twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @svrnm, I implemented your suggestions, but the behavior remained unchanged. I realized that I was using the command npm run serve
in the terminal. The issue persists with that command, but when I switched to npm run serve:netlify
, the labels function as intended with both the previous commit and the new lines of code. Clicking on the label at any point now initiates a filter search using the label value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I look forward to your feedback. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still not working, please take a look in the auto generated preview:
https://deploy-preview-5340--opentelemetry.netlify.app/ecosystem/registry/
If I click on a button (e.g. native of the first element) the search is updated, but if I click another button it's not updated once again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @svrnm,
Thank you for your feedback. I have taken a look at the preview link and that is the same experience on my end when I use the command npm run serve
However, It worked on my end using npm run serve:netlify
, but I see there’s still an issue in the Netlify preview. I’ll check the code again and I’ll update you soon. Thank you.
…nstead of replacing
@basiratkareem checking in if you could make some progress here? Today is the last day I can help you with moving this PR forward, so let me know if there is anything I can do to help you |
Hi @svrnm, Thank you for your continued support and feedback! I aplogiize for the delay response. I’ve made several adjustments to the code, including tweaks to the event handling. Unfortunately, these updates haven’t resolved the issue, and the functionality is still the same as what we both observed in the Netlify preview. Initially, running I suspect the issue might be due to the URL updating after the initial click. If there’s anything specific you’d suggest trying or if there’s something I might be missing, I’d be glad to explore it to resolve this within your timeline. Thank you again for your guidance and patience. |
the problem is the following:
You might need to update your code in a way that it re-applies the addition of event listeners to the newly created elements after the search was executed |
I will check this out. |
…call applyFilterTag.
…l applyFilterTag.
…l applyFilterTag.
Hello @svrnm, I have added applyTag function to the code and updated the executeSearch function to call applyTag after populating search results. |
hey @basiratkareem, I would like to take that PR into the main branch and with that into the project. But we need to rework it a little bit, would you still be interested in that? Here's what needs to be changed changed: I merged #5328, which introduces a "flag" parameter, so far only for "deprecated", "native" and "first party", not the different CNCF projects, can you make use of that instead of appending it to the search term? We can skip the CNCF projects to simplify it for now. Thanks. |
Hello @svrnm I'm happy to continue working on this. Based on my understanding of your comment:
please let me know if I am missing something. I'll make the necessary changes on my end and provide an update on this. Thank you. |
Your understanding is correct 👍 |
… the search input field
… the search input field
Hi @svrnm I’ve integrated the flag parameter into the code, and the filter is now activated when the flag button is clicked. The page is populated accordingly, and the search input field remains unchanged. I’ve also recorded a screen recording to demonstrate the behaviour. https://www.loom.com/share/3427b2b7965a479c800175b63048d6ba?sid=8db7958f-6ca2-41f5-aa02-2d44d55ac397 Thank you, and please let me know your thoughts! |
I took a look at your code, but from what I see you didn't update your branch to be in sync with main, so the changes introduced via #5328 are not part of your work here, it also creates a merge conflict. Please do the following:
Thanks for taking the time to take a video, but not that we automatically create a preview of your work, which is accessible at https://deploy-preview-5340--opentelemetry.netlify.app/ecosystem/registry/, so approvers can try out your work directly. |
Apologies for that. I will follow the steps, make the required updates, and revert as needed. Thank you for your assistance! |
Task
This update allows users to filter records by clicking on a tag (like native, sandbox, etc.), enabling quicker access to filtered records without needing to use the search bar.
closes #5312
Implementation
<span>
tags with<button>
elements inlayouts/partials/ecosystem/registry/entry.html
applyTagFilter
inassets/js/registrySearch.js
to handle the filter action when a tag is clicked.Result
The tags native, first party integration, sandbox, graduated, and deprecated are now clickable buttons.
Clicking a tag immediately filters the records in the OpenTelemetry registry based on the selected tag, enhancing the filtering experience.