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

[fix]: Remove redux-form dependency from sort selector #2569

Merged
merged 4 commits into from
Jan 11, 2025

Conversation

hari45678
Copy link
Contributor

@hari45678 hari45678 commented Jan 9, 2025

Which problem is this PR solving?

Description of the changes

  • This PR removes the dependency of Sort Selector on redux-form.
  • We could previously sort the traces on homepage, and the value we were selecting on this Sort Selector was reflecting to the SearchTrace page that is responsible to rendering the Sorted Traces list and sorting the traces. This state exchange was previously done by redux-form but now we are directly passing it using react state and component props.
  • We were also tracking the changes done by a user in this sort selector using a middleware tied to the redux-actions. Now we are not using redux for form state management so tracking logic is directly moved to the part where a sort action takes place, i.e., handleSortChange
  • Removed @types/redux-form as there is no .ts/x file left that is using redux-form.

How was this change tested?

  • npm run test
  • npm run start and using the sort selector

Checklist

Signed-off-by: Hariom Gupta <guptahariom03082003@gmail.com>
@hari45678 hari45678 requested a review from a team as a code owner January 9, 2025 09:29
@hari45678 hari45678 requested review from mahadzaryab1 and removed request for a team January 9, 2025 09:29
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.58%. Comparing base (2a0a8d3) to head (0edaa06).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2569      +/-   ##
==========================================
- Coverage   96.63%   96.58%   -0.06%     
==========================================
  Files         255      255              
  Lines        7731     7732       +1     
  Branches     2012     2009       -3     
==========================================
- Hits         7471     7468       -3     
- Misses        260      264       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Hariom Gupta <guptahariom03082003@gmail.com>
Signed-off-by: Hariom Gupta <guptahariom03082003@gmail.com>
Comment on lines -52 to -53
export const middlewareHooks = {
[constants.FORM_CHANGE_ACTION_TYPE]: (_: Store<ReduxState>, action: any) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was is only used for tracking Sort Selector changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Looking into the codebase, this middlewareHooks had only one if condition that was checking if the action dispatched via redux-form has the .meta property as sortBy which is possible for only sort selector.
I couldn't find other pages (other than Trace Results page) where a similar sorting selector is used.

@yurishkuro yurishkuro added the changelog:bugfix-or-minor-feature 🐞 Bug fixes, Minor Improvements label Jan 11, 2025
@yurishkuro yurishkuro merged commit b4cdd36 into jaegertracing:main Jan 11, 2025
7 of 8 checks passed
@hari45678 hari45678 deleted the remove-redux-from-sort branch January 11, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:bugfix-or-minor-feature 🐞 Bug fixes, Minor Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants