Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: Improve dropdown component with null option filtering #6830

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

deon-sanchez
Copy link
Collaborator

@deon-sanchez deon-sanchez commented Feb 25, 2025

This pull request focuses on improving the Dropdown component by filtering out null or undefined options to ensure the component works with valid data. The changes include the introduction of a new utility function and updates to the component to use this function.

Key changes:

Dropdown Component Enhancements:

  • Added filterNullOptions utility function to filter out null or undefined options in src/frontend/src/utils/utils.ts.
  • Updated import statements in src/frontend/src/components/core/dropdownComponent/index.tsx to include useMemo and filterNullOptions.
  • Introduced validOptions using useMemo to filter out null or undefined options and replaced occurrences of options with validOptions in the Dropdown component. [1] [2] [3] [4] [5] [6]\

BUG

Screen.Recording.2025-02-25.at.2.45.08.PM.mov

FIX

Screen.Recording.2025-02-25.at.2.44.20.PM.mov

@deon-sanchez deon-sanchez self-assigned this Feb 25, 2025
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request javascript Pull requests that update Javascript code labels Feb 25, 2025
@deon-sanchez deon-sanchez added bug Something isn't working and removed enhancement New feature or request labels Feb 25, 2025
@deon-sanchez deon-sanchez changed the title Improve dropdown component with null option filtering bug:Improve dropdown component with null option filtering Feb 25, 2025
@deon-sanchez deon-sanchez changed the title bug:Improve dropdown component with null option filtering bug: Improve dropdown component with null option filtering Feb 25, 2025
@deon-sanchez deon-sanchez changed the title bug: Improve dropdown component with null option filtering fix: Improve dropdown component with null option filtering Feb 25, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Feb 25, 2025
Copy link
Collaborator

@mfortman11 mfortman11 left a comment

Choose a reason for hiding this comment

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

Nice fix

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 25, 2025
@ogabrielluiz ogabrielluiz added this pull request to the merge queue Feb 25, 2025
@ogabrielluiz ogabrielluiz removed this pull request from the merge queue due to a manual request Feb 25, 2025
@ogabrielluiz ogabrielluiz merged commit e98b25f into main Feb 25, 2025
40 of 51 checks passed
@ogabrielluiz ogabrielluiz deleted the lfoss-651 branch February 25, 2025 22:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working javascript Pull requests that update Javascript code lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants