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

Menu: add loadingIcon slot loadingText slot and loading attribute #124

Merged
merged 12 commits into from
Dec 19, 2024

Conversation

sun-mota
Copy link
Contributor

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

Alaska Airlines Pull Request

  • Menu now has loading attribute, loadingIcon and loadingText slots
  • By setting loading attribute, loadingIcon and loadingText slots will be shown in a disabled menuoption - which is non-interactive.
  • When there is no assigned loadingIcon/loadingText, bib will be not showing on combobox and select (no written example)

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

Add a loading attribute and loadingIcon and loadingText slots to the auro-menu component to support loading states, and update related components and documentation to reflect these changes.

New Features:

  • Introduce a loading attribute to the auro-menu component to display a loading state.
  • Add loadingIcon and loadingText slots to the auro-menu component for customizable loading indicators.

Enhancements:

  • Update the auro-combobox and auro-select components to support the new loading attribute and slots from auro-menu.

Documentation:

  • Update documentation to include examples and descriptions of the new loading attribute and slots for auro-menu, auro-combobox, and auro-select components.

Summary by Sourcery

Add a loading attribute and loadingIcon and loadingText slots to the auro-menu component to support loading states, and update related components and documentation to reflect these changes.

New Features:

  • Introduce a loading attribute to the auro-menu component to display a loading state.
  • Add loadingIcon and loadingText slots to the auro-menu component for customizable loading indicators.

Enhancements:

  • Update the auro-combobox and auro-select components to support the new loading attribute and slots from auro-menu.

Documentation:

  • Update documentation to include examples and descriptions of the new loading attribute and slots for auro-menu, auro-combobox, and auro-select components.

@sun-mota sun-mota self-assigned this Dec 17, 2024
@sun-mota sun-mota changed the base branch from main to beta December 17, 2024 19:16
@CLAassistant
Copy link

CLAassistant commented Dec 17, 2024

CLA assistant check
All committers have signed the CLA.

@sun-mota sun-mota force-pushed the sunMota/menu-loading-state branch from 381f155 to 77a9482 Compare December 17, 2024 19:39
@sun-mota
Copy link
Contributor Author

@sourcery-ai review

@AlaskaAirlines AlaskaAirlines deleted a comment from sourcery-ai bot Dec 17, 2024
Copy link

sourcery-ai bot commented Dec 17, 2024

Reviewer's Guide by Sourcery

This PR adds loading state support to the menu component, which is then integrated into both combobox and select components. The implementation includes a loading attribute that, when set, displays a loading placeholder with optional icon and text slots. The loading state can be customized with loading text and/or a loading icon, or remain empty.

Class diagram for updated AuroMenu component

classDiagram
    class AuroMenu {
        Boolean loading
        Boolean hasLoadingPlaceholder
        Event auroMenu-loadingChange
        slot loadingText
        slot loadingIcon
        +get hasLoadingPlaceholder() boolean
    }
    note for AuroMenu "New loading attribute and slots for loading state"
Loading

Class diagram for updated AuroCombobox component

classDiagram
    class AuroCombobox {
        Boolean isHiddenWhileLoading
        +handleMenuLoadingChange(CustomEvent event)
    }
    note for AuroCombobox "Handles loading state changes from AuroMenu"
Loading

Class diagram for updated AuroSelect component

classDiagram
    class AuroSelect {
        Boolean isHiddenWhileLoading
        +handleMenuLoadingChange(CustomEvent event)
    }
    note for AuroSelect "Handles loading state changes from AuroMenu"
Loading

File-Level Changes

Change Details Files
Added loading state functionality to the auro-menu component
  • Added loading attribute to show loading state
  • Added loadingIcon and loadingText slots for customizable loading indicators
  • Added hasLoadingPlaceholder property to detect if loading placeholders exist
  • Added auroMenu-loadingChange event to notify of loading state changes
  • Added CSS styles for loading placeholder state
components/menu/src/auro-menu.js
components/menu/src/styles/style-menu.scss
Integrated loading state support into the combobox component
  • Added handling for menu loading state changes
  • Added logic to show/hide dropdown based on loading state
  • Updated event handling for loading state changes
components/combobox/src/auro-combobox.js
Integrated loading state support into the select component
  • Added handling for menu loading state changes
  • Added logic to show/hide dropdown based on loading state
  • Updated event handling for loading state changes
components/select/src/auro-select.js
Added documentation and examples for loading state functionality
  • Added loading state examples for menu component
  • Added loading state examples for combobox component
  • Added loading state examples for select component
  • Updated API documentation to include new loading features
components/menu/docs/api.md
components/combobox/docs/api.md
components/select/docs/api.md
components/menu/apiExamples/loading.html
components/menu/apiExamples/loading.js
components/combobox/apiExamples/loading.html
components/combobox/apiExamples/loading.js
components/select/apiExamples/loading.html
components/select/apiExamples/loading.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

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 and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 6 issues found
  • 🟢 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.

components/menu/src/auro-menu.js Outdated Show resolved Hide resolved
components/combobox/src/auro-combobox.js Show resolved Hide resolved
components/combobox/src/auro-combobox.js Show resolved Hide resolved
components/combobox/apiExamples/loading.js Show resolved Hide resolved
components/menu/demo/api.md Outdated Show resolved Hide resolved
components/menu/demo/api.md Outdated Show resolved Hide resolved
components/combobox/src/auro-combobox.js Outdated Show resolved Hide resolved
@sun-mota sun-mota force-pushed the sunMota/menu-loading-state branch 2 times, most recently from 76b6238 to 72e9cab Compare December 17, 2024 22:21
@sun-mota sun-mota marked this pull request as ready for review December 17, 2024 22:22
@sun-mota sun-mota requested a review from a team as a code owner December 17, 2024 22:22
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 and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 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/menu/docs/api.md Outdated Show resolved Hide resolved
components/menu/docs/api.md Show resolved Hide resolved
components/menu/docs/api.md Outdated Show resolved Hide resolved
components/menu/demo/index.min.js Show resolved Hide resolved
components/combobox/src/auro-combobox.js Show resolved Hide resolved
components/menu/docs/api.md Show resolved Hide resolved
components/menu/apiExamples/loading.js Show resolved Hide resolved
components/combobox/apiExamples/loading.js Show resolved Hide resolved
components/combobox/src/auro-combobox.js Show resolved Hide resolved
components/combobox/src/auro-combobox.js Show resolved Hide resolved
components/menu/scripts/wca/auro-menu.js Outdated Show resolved Hide resolved
components/menu/scripts/wca/auro-menu.js Outdated Show resolved Hide resolved
components/menu/src/auro-menu.js Outdated Show resolved Hide resolved
components/menu/src/styles/color-menuoption.scss Outdated Show resolved Hide resolved
components/select/apiExamples/loading.html Outdated Show resolved Hide resolved
components/select/apiExamples/loading.js Show resolved Hide resolved
@sun-mota sun-mota force-pushed the sunMota/menu-loading-state branch from 25623e9 to 1b7b32d Compare December 18, 2024 19:53
components/menu/src/auro-menu.js Outdated Show resolved Hide resolved
components/menu/scripts/wca/auro-menu.js Outdated Show resolved Hide resolved
components/menu/scripts/wca/auro-menu.js Outdated Show resolved Hide resolved
@sun-mota sun-mota force-pushed the sunMota/menu-loading-state branch from 43dc0bc to 58c39ef Compare December 18, 2024 21:54
Copy link
Contributor

@jordanjones243 jordanjones243 left a comment

Choose a reason for hiding this comment

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

Options are not being highlighted correctly after selection in loading example for select

Screen Shot 2024-12-18 at 1 56 31 PM

@sun-mota sun-mota merged commit 2662ac9 into beta Dec 19, 2024
4 checks passed
@sun-mota sun-mota deleted the sunMota/menu-loading-state branch December 19, 2024 18:44
@jason-capsule42
Copy link
Member

🎉 This PR is included in version 1.6.0-beta.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MENU/SELECT/COMBOBOX: UI needs to better handle slow loading of dynamic content
5 participants