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: add menu #28 #34

Merged
merged 5 commits into from
Nov 21, 2024
Merged

Conversation

sun-mota
Copy link
Contributor

@sun-mota sun-mota commented Nov 7, 2024

Alaska Airlines Pull Request

close #28

adding auro-menu@4.1.4 to auro-formkit

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 new 'auro-menu' component to the project, complete with build scripts, documentation, and tests to support its integration and usage.

New Features:

  • Introduce a new 'auro-menu' component that provides a list of options for user selection, designed for contextual menus like dropdowns.

Enhancements:

  • Update build scripts to include tasks for the new 'auro-menu' component, such as building, testing, and serving.

Documentation:

  • Add comprehensive documentation for the 'auro-menu' component, including API details, usage examples, and design notes.

Tests:

  • Implement a suite of tests for the 'auro-menu' component to ensure its functionality and accessibility.

@sun-mota sun-mota linked an issue Nov 7, 2024 that may be closed by this pull request
@sun-mota sun-mota self-assigned this Nov 7, 2024
Copy link

sourcery-ai bot commented Nov 7, 2024

Reviewer's Guide by Sourcery

This PR adds the auro-menu component to the project, including its implementation, build scripts, documentation, and tests. The menu component provides users with a list of selectable options and supports features like nested menus, disabled states, keyboard navigation, and custom events.

Class diagram for the new auro-menu component

classDiagram
    class AuroMenu {
        -String value
        -Object optionSelected
        -String matchWord
        -Boolean noCheckmark
        -Boolean ready
        -Object optionActive
        -Boolean rootMenu
        -AuroLibraryRuntimeUtils runtimeUtils
        -String nestingSpacer
        +resetOptionsStates()
        +makeSelection()
        +selectNextItem(String moveDirection)
        +selectByValue(String value)
        +updateActiveOption(int index)
        +handleSlotItems()
        +notifyReady()
    }

    class AuroMenuOption {
        -Boolean nocheckmark
        -Boolean disabled
        -Boolean selected
        -String value
        -Number tabIndex
        -AuroLibraryRuntimeUtils runtimeUtils
        +generateIconHtml(String svgContent)
    }

    AuroMenu --> AuroMenuOption : uses
    AuroMenuOption --> AuroIcon : uses
    AuroMenuOption --> AuroLibraryRuntimeUtils : uses
    AuroMenu --> AuroLibraryRuntimeUtils : uses
    AuroMenu --> AuroMenuOption : contains
    AuroMenuOption --> AuroIcon : contains
Loading

File-Level Changes

Change Details Files
Add auro-menu and auro-menuoption component implementations
  • Implement menu component with support for keyboard navigation
  • Add support for nested menus and option indentation
  • Implement disabled states and option selection handling
  • Add custom event support and value matching functionality
  • Implement styling for menu states and option highlighting
components/menu/src/auro-menu.js
components/menu/src/auro-menuoption.js
components/menu/src/style-menu.scss
components/menu/src/style-menuoption.scss
components/menu/src/color-menu.scss
components/menu/src/color-menuoption.scss
Add build configuration and scripts for menu component
  • Add build scripts for menu component compilation
  • Add test scripts for menu component
  • Add demo and documentation build scripts
  • Update package.json with menu-related dependencies and scripts
package.json
Add comprehensive documentation and examples
  • Add API documentation with properties, methods and events
  • Add usage examples for different menu configurations
  • Add design specifications and guidelines
  • Include code examples for common use cases
components/menu/docs/api.md
components/menu/demo/api.md
components/menu/docs/partials/description.md
components/menu/docs/partials/useCases.md
components/menu/apiExamples/*.html
Add test suite for menu component
  • Add tests for menu selection functionality
  • Add tests for keyboard navigation
  • Add tests for disabled states and option handling
  • Add tests for custom events
components/menu/test/auro-menu.test.js
Fix input component clear functionality
  • Change value reset from undefined to empty string
  • Add element update wait in clear button test
components/input/src/base-input.js
components/input/test/auro-input.test.js

Assessment against linked issues

Issue Objective Addressed Explanation
#28 Add menu component to the project

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

@sun-mota sun-mota changed the base branch from main to sunMota/componentIntegration November 8, 2024 20:52
@sun-mota sun-mota marked this pull request as ready for review November 15, 2024 16:56
@sun-mota sun-mota requested a review from a team as a code owner November 15, 2024 16:56
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 documenting the rationale for changing this.value = undefined to this.value = "" in base-input.js, as this could affect other components using this base class.
  • The build scripts contain some duplication for menu-specific tasks. Consider refactoring to make the build configuration more DRY while maintaining explicit behavior.
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 2 issues found
  • 🟡 Complexity: 2 issues 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.

package.json Outdated Show resolved Hide resolved
components/menu/src/auro-menu.js Show resolved Hide resolved
components/menu/test/auro-menu.test.js Show resolved Hide resolved
components/menu/test/auro-menu.test.js Show resolved Hide resolved
components/menu/docs/api.md Show resolved Hide resolved
components/menu/demo/api.min.js Show resolved Hide resolved
components/menu/demo/api.min.js Show resolved Hide resolved
components/menu/demo/api.min.js Show resolved Hide resolved
components/menu/demo/api.min.js Show resolved Hide resolved
components/menu/demo/api.min.js Show resolved Hide resolved
components/input/test/auro-input.test.js Outdated Show resolved Hide resolved
components/menu/package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@@ -9,10 +9,10 @@ export default {
},
coverageConfig: {
threshold: {
statements: 80,
statements: 70,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for now, but we need to have more of a conversation about test coverage. We should be adding more tests to cover code rather than lowering the thresholds. By default, all components should be at least at 80%.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe open a ticket for this?

Copy link
Contributor Author

@sun-mota sun-mota Nov 21, 2024

Choose a reason for hiding this comment

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

this change is temporary workaround, recommended by Jason. The ultimate fix will be needed, ticketed at #47

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.

Run npm run build:release from root level of form to address updates to min.js file

@sun-mota sun-mota merged commit 77a05a1 into sunMota/componentIntegration Nov 21, 2024
1 check passed
@sun-mota sun-mota deleted the sunMota/add-menu branch November 21, 2024 20:17
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.

add Menu
3 participants