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: use label as placeholder when there is no placeholder string set #36 #157

Closed
wants to merge 1 commit into from

Conversation

sun-mota
Copy link
Contributor

@sun-mota sun-mota commented Dec 28, 2024

Alaska Airlines Pull Request

Closes #36

Before Submitting this pull request:

  • Link all tickets in this repository related to this PR in the Development section
    note: all pull requests require at least one linked ticket
  • If this PR is Ready For Review, all ticket's linked under Development must have their status changed to Ready For Review as well

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I have performed a self-review of my own update.

Summary by Sourcery

Bug Fixes:

  • Fixed an issue where the placeholder text was not displayed correctly when no placeholder string was set.

@sun-mota sun-mota self-assigned this Dec 28, 2024
@sun-mota sun-mota changed the base branch from main to beta December 28, 2024 03:55
@AlaskaAirlines AlaskaAirlines deleted a comment from sourcery-ai bot Dec 28, 2024
@AlaskaAirlines AlaskaAirlines deleted a comment from CLAassistant Dec 28, 2024
@sun-mota sun-mota linked an issue Dec 28, 2024 that may be closed by this pull request
@sun-mota sun-mota changed the title fix: use label as placeholder when there is no placeholder string set #86 fix: use label as placeholder when there is no placeholder string set #36 Dec 28, 2024
@AlaskaAirlines AlaskaAirlines deleted a comment from sourcery-ai bot Dec 28, 2024
@sun-mota sun-mota marked this pull request as ready for review December 28, 2024 04:06
@sun-mota sun-mota requested a review from a team as a code owner December 28, 2024 04:06
Copy link

sourcery-ai bot commented Dec 28, 2024

Reviewer's Guide by Sourcery

This PR fixes an issue where the placeholder text was not displayed correctly when no placeholder string was set. It changes the default placeholder value to an empty string and uses the label as a placeholder when there is no placeholder or value set.

Class diagram for AuroSelect component changes

classDiagram
    class AuroSelect {
        -String placeholder
        -Object optionSelected
        -String validity
        +constructor()
        +render()
    }
    note for AuroSelect "Changed:
    - Default placeholder=''
    - Added asPlaceholder attribute
    - Modified label slot rendering"
Loading

State diagram for select component placeholder behavior

stateDiagram-v2
    [*] --> NoPlaceholder: Initial State
    NoPlaceholder --> ShowLabel: No placeholder & No value
    NoPlaceholder --> ShowValue: Has value
    ShowLabel --> ShowValue: Value selected
    ShowValue --> ShowLabel: Value cleared

    state NoPlaceholder {
        [*] --> EmptyString: Default placeholder=''
    }

    state ShowLabel {
        [*] --> UseLabelAsPlaceholder: asPlaceholder=true
    }

    state ShowValue {
        [*] --> DisplaySelectedValue: asPlaceholder=false
    }
Loading

File-Level Changes

Change Details Files
Set default placeholder to empty string and use label as placeholder when appropriate
  • Changed the default placeholder value to an empty string.
  • Added logic to use the label as placeholder when there is no placeholder or value set.
  • Updated component styles to support label as placeholder behavior.
  • Updated API documentation to reflect the changes in the placeholder behavior.
components/select/demo/api.md
components/select/docs/api.md
components/select/src/auro-select.js
components/select/src/styles/style.scss

Assessment against linked issues

Issue Objective Addressed Explanation
#36 Label should move up when a value is selected and there is no placeholder
#36 Modify the dropdown behavior to match the blueprint design

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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @sun-mota - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding unit tests for the new handleLabelSlotChange functionality to ensure the label-as-placeholder behavior works correctly
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

components/select/src/auro-select.js Outdated Show resolved Hide resolved
components/select/src/auro-select.js Outdated Show resolved Hide resolved
components/select/src/auro-select.js Outdated Show resolved Hide resolved
@sun-mota sun-mota linked an issue Dec 28, 2024 that may be closed by this pull request
components/select/src/auro-select.js Outdated Show resolved Hide resolved
components/select/src/auro-select.js Outdated Show resolved Hide resolved
@sun-mota sun-mota force-pushed the sunMota/no-placeholder-label branch from 0a4ca4e to 665c889 Compare January 6, 2025 18:12
@sun-mota
Copy link
Contributor Author

sun-mota commented Jan 6, 2025

@sourcery-ai review

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @sun-mota - I've reviewed your changes - here's some feedback:

Overall Comments:

  • ⚠️ Changing the default placeholder from 'Please select option' to an empty string is a breaking change that could affect existing applications. Please consider if this needs to be documented in release notes or migration guides.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@sun-mota sun-mota closed this Jan 6, 2025
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.

auro-select label doesn't move up when value is selected
2 participants