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

Restore ability to search in Select fields #1805

Merged
merged 9 commits into from
Oct 4, 2023

Conversation

prathamesh-mutkure
Copy link
Contributor

Which problem is this PR solving?

Description of the changes

  • All the Ant Design's Select fields are now searchable
  • Added new util to override default behaviour of searching by value instead of label

How was this change tested?

  • The test was done manually
  • I'll add tests if this approach seems okay

Screenshot

Screenshot 2023-09-19 at 2 05 21 PM

Checklist

@prathamesh-mutkure
Copy link
Contributor Author

prathamesh-mutkure commented Sep 19, 2023

Let me fix the tests

@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

All modified lines are covered by tests ✅

Files Coverage Δ
...r-ui/src/components/Monitor/ServicesView/index.tsx 98.23% <ø> (ø)
...r-ui/src/components/SearchTracePage/SearchForm.jsx 92.15% <100.00%> (ø)
...components/SearchTracePage/SearchResults/index.tsx 86.15% <ø> (ø)
...i/src/components/TracePage/TraceSpanView/index.tsx 89.39% <ø> (ø)
...eger-ui/src/components/common/SearchableSelect.tsx 100.00% <100.00%> (ø)

📢 Thoughts on this report? Let us know!.

@prathamesh-mutkure prathamesh-mutkure force-pushed the ant-select-fix branch 3 times, most recently from e6e1568 to 6c4c170 Compare September 27, 2023 07:31
@yurishkuro
Copy link
Member

  • missing sign-off on some commits
  • need to regenerate snapshot (yarn test -u in packages/jaeger-ui)

Signed-off-by: Prathamesh Mutkure <pmutkure009@gmail.com>
Signed-off-by: Prathamesh Mutkure <pmutkure009@gmail.com>
Signed-off-by: Prathamesh Mutkure <pmutkure009@gmail.com>
Signed-off-by: Prathamesh Mutkure <pmutkure009@gmail.com>
Signed-off-by: Prathamesh Mutkure <pmutkure009@gmail.com>
Signed-off-by: Prathamesh Mutkure <pmutkure009@gmail.com>
Signed-off-by: Prathamesh Mutkure <pmutkure009@gmail.com>
Signed-off-by: Prathamesh Mutkure <pmutkure009@gmail.com>
Signed-off-by: Prathamesh Mutkure <pmutkure009@gmail.com>
@yurishkuro yurishkuro changed the title Ant Select Fields Searchable Restore ability to search in Select fields Oct 3, 2023
import { Select } from 'antd';
import SearchableSelect, { filterOptionsByLabel } from './SearchableSelect';

describe('SearchableSelect', () => {
Copy link
Member

Choose a reason for hiding this comment

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

You're missing the test of actually searching when typing. Instead of testing the internal findBy... function, you could've made those same tests from the perspective of the end user, who is typing into the field, not calling a function.

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, that's how we initially planned to do it but isn't the part for showing matching options on the UI handled by Ant Design that is already tested? I can add an explicit UI test if that makes more sense

Copy link
Member

Choose a reason for hiding this comment

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

Recently we broke the ability to search and no unit tests failed. If something changes in ant design regarding HOW filtering is supposed to be hooked up, no tests will fail again. So (a) we need to test for that, and (b) why restrict the input permission tests that you have to test inner function if we could test them end to end to the user facing behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, that makes more sense

@yurishkuro
Copy link
Member

I am going to merge this so that it can make it into the next release, we can alter the tests in another PR.

@yurishkuro yurishkuro merged commit a4ab315 into jaegertracing:main Oct 4, 2023
@prathamesh-mutkure prathamesh-mutkure deleted the ant-select-fix branch October 11, 2023 11:45
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.

[Bug]: Can not use search in service or Operation
2 participants