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

feat: 217 #231

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

victortwu
Copy link

@victortwu victortwu commented Jan 17, 2025

Alaska Airlines Pull Request

This pull request adds an optional attribute to the <auro-select / > component called displayValueProp to enable displaying the value prop instead of the label text of the <auro-menuoption /> label.

This solves some cases where users may need a more appropriate visual feedback that corresponds to the users cognitively more ergonomic way of selecting an option such as the example screenshot below for country codes. (User does not know what the country code is for their country because of course not! - so selecting their country by common name is more useful, however the display of the country code is also useful for brief verification feedback to the user).

Resolves: # (issue, if applicable)
Please refer to this original Issue #217

Summary:

Screenshots:

With no additional configuration (also as in before these changes) works as expected):
Screenshot 2025-01-16 at 2 43 54 PM

With the implementation of 'displayValueProp`:

Screenshot 2025-01-16 at 2 44 22 PM

Note: manually tested in Chrome and Firefox

Please delete options that are not relevant.

  • New capability
  • Revision of an existing capability
  • Infrastructure change (automation, etc.)
  • Other (please elaborate)

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

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

New Features:

  • Display selected option values in the Auro Select component using the new displayValueProp attribute.

Copy link

sourcery-ai bot commented Jan 17, 2025

Reviewer's Guide by Sourcery

This pull request introduces a new optional attribute, displayValueProp, to the <auro-select> component. When displayValueProp is true, the selected option's value attribute is displayed instead of the default label text. This change allows for more flexible display options, particularly useful when the value provides more relevant visual feedback than the label text (e.g., displaying country codes after selecting a country by name).

Class diagram for updated auro-select component

classDiagram
    class AuroSelect {
        +String value
        +Boolean disabled
        +Boolean noCheckmark
        +Boolean displayValueProp
        +String placeholder
        -Object optionSelected
        +handleOptionSelected()
        +render()
    }
    note for AuroSelect "New displayValueProp attribute added"

    class AuroMenuOption {
        +String value
        +String label
        +Boolean selected
    }

    AuroSelect --> AuroMenuOption: contains
Loading

File-Level Changes

Change Details Files
Added the displayValueProp attribute to the <auro-select> component
  • Added a new boolean property displayValueProp to the component's properties.
  • Modified the rendering logic to conditionally display either the value attribute or the label text based on the displayValueProp value.
  • Added displayValueProp to the JSDoc.
  • Added reflect: true to the displayValueProp property definition.
src/auro-select.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 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

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@dPopeAlaskaAir
Copy link

For context to the reviewers, Victor is a Slalom resource. He had some time and an idea on how to fix so I suggested he put up a PR on a possible solution. Up to you all to decide whether to accept but it would work as a fix for what my team needs.

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.

4 participants