AlaskaAirlines / auro-combobox

An auroLabs custom element w/an experimental API. You've been warned.
https://auro.alaskaair.com/components/auroLabs
Apache License 2.0
4 stars 1 forks source link

Jbaker/fix no match #201

Closed jason-capsule42 closed 2 weeks ago

jason-capsule42 commented 3 weeks ago

Alaska Airlines Pull Request

Type of change:

Please delete options that are not relevant.

Checklist:

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!
-- Auro Design System Team

Summary by Sourcery

Fix the handling of 'no match' options in the AuroCombobox component and improve the logic for displaying available options. Add a settings.json file to configure the development environment.

Bug Fixes:

Enhancements:

Build:

sourcery-ai[bot] commented 3 weeks ago

Reviewer's Guide by Sourcery

This PR fixes the handling of the 'no match' option in the auro-combobox component. The changes improve the state management of the noMatchOption and modify the visibility logic for options based on static attributes.

Updated class diagram for AuroCombobox

classDiagram
    class AuroCombobox {
        +List availableOptions
        +String input
        +Dropdown dropdown
        +Option noMatchOption
        +showBib()
    }

    class Option {
        +String innerText
        +Boolean hasAttribute(String)
        +void removeAttribute(String)
        +void setAttribute(String, String)
        +String getAttribute(String)
    }

    class Dropdown {
        +Boolean isPopoverVisible
        +void show()
    }

    AuroCombobox --> Option
    AuroCombobox --> Dropdown

    note for AuroCombobox "Improved state management for noMatchOption and modified visibility logic for options."

File-Level Changes

Change Details Files
Refactored noMatchOption handling to use class property instead of local variable
  • Converted local noMatchOption variable to a class property
  • Updated references to use this.noMatchOption throughout the code
src/auro-combobox.js
Modified option filtering logic to exclude static options
  • Added condition to check for static attribute when filtering options
  • Options with static attribute will be hidden regardless of match
src/auro-combobox.js
Updated dropdown visibility logic to consider noMatchOption
  • Modified showBib method to show dropdown when noMatchOption is defined
  • Ensures dropdown appears even when there are no available options but noMatchOption exists
src/auro-combobox.js

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
blackfalcon commented 2 weeks ago

:tada: This PR is included in version 2.1.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: