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

refactor: integrate datepicker with the internal dropdown #69

Merged
merged 10 commits into from
Dec 10, 2024

Conversation

sun-mota
Copy link
Contributor

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

Alaska Airlines Pull Request

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

Refactor the datepicker component to integrate with the internal dropdown, enhancing the component's structure and updating tests accordingly.

Enhancements:

  • Refactor the datepicker component to integrate with the internal dropdown, improving modularity and maintainability.

Tests:

  • Update tests to accommodate the integration of the datepicker with the internal dropdown, ensuring all functionalities are covered.

@sun-mota sun-mota self-assigned this Nov 29, 2024
Copy link

sourcery-ai bot commented Nov 29, 2024

Reviewer's Guide by Sourcery

This PR refactors the auro-datepicker component to use an internal auro-dropdown component, improving the component's modularity. The main changes involve restructuring how the calendar is accessed through the dropdown and updating the event handling logic. The tests have been updated to reflect this new structure.

Sequence diagram for AuroDatePicker and AuroDropdown interaction

sequenceDiagram
    participant User
    participant AuroDatePicker
    participant AuroDropdown
    participant AuroCalendar
    User->>AuroDatePicker: Select date
    AuroDatePicker->>AuroDropdown: Open dropdown
    AuroDropdown->>AuroCalendar: Display calendar
    AuroCalendar->>AuroDatePicker: Date selected
    AuroDatePicker->>AuroDropdown: Close dropdown
    AuroDatePicker->>User: Confirm date selection
Loading

Updated class diagram for AuroDatePicker integration with AuroDropdown

classDiagram
    class AuroDatePicker {
        - configureCalendar()
        - configureDatepicker()
        - handleReadOnly()
        - notifyReady() // Removed
        - ready // Removed
        + calendar: AuroCalendar
        + dropdown: AuroDropdown
    }
    class AuroCalendar {
        + datepicker: AuroDatePicker
        + calendarStartDate
        + calendarEndDate
        + centralDate
    }
    class AuroCalendarCell {
        + datepicker: AuroDatePicker
        + calendarMonth: AuroCalendarMonth
        + auroPopover: AuroPopover
        + firstUpdated()
        + updated(properties)
    }
    AuroDatePicker --> AuroCalendar
    AuroCalendarCell --> AuroDatePicker
    AuroCalendarCell --> AuroCalendarMonth
    AuroCalendarCell --> AuroPopover
    AuroCalendar --> AuroDatePicker
    note for AuroDatePicker "Refactored to integrate with AuroDropdown"
Loading

File-Level Changes

Change Details Files
Restructured calendar access through dropdown component
  • Updated calendar element queries to access through dropdown.bibContent
  • Modified calendar configuration to establish bidirectional reference with datepicker
  • Removed direct calendar queries in favor of dropdown-based access
components/datepicker/test/auro-datepicker.test.js
components/datepicker/src/auro-datepicker.js
Enhanced event handling and click detection
  • Updated click outside detection to consider dropdown content
  • Modified focusin event handling to account for dropdown content
  • Removed auroDatePicker-ready event as it's no longer needed
components/datepicker/src/auro-datepicker.js
Improved calendar cell component initialization
  • Refactored datepicker reference acquisition in calendar cells
  • Added retry mechanism for calendar cell initialization
  • Updated boundary setting for popover elements
components/datepicker/src/auro-calendar-cell.js
components/datepicker/src/auro-calendar.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

@sun-mota sun-mota linked an issue Nov 29, 2024 that may be closed by this pull request
3 tasks
@sun-mota sun-mota force-pushed the sunMota/integrate-datepicker-dropdown branch 3 times, most recently from e8c9c7a to 5c6c131 Compare December 5, 2024 20:51
@sun-mota sun-mota marked this pull request as ready for review December 5, 2024 20:53
@sun-mota sun-mota requested a review from a team as a code owner December 5, 2024 20:53
@sun-mota
Copy link
Contributor Author

sun-mota commented Dec 5, 2024

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

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue found
  • 🟢 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.

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: 1 issue 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.

@sun-mota sun-mota force-pushed the sunMota/integrate-datepicker-dropdown branch 2 times, most recently from 5a5a986 to 12b16b0 Compare December 9, 2024 22:46
@sun-mota sun-mota linked an issue Dec 9, 2024 that may be closed by this pull request
@sun-mota sun-mota force-pushed the sunMota/integrate-datepicker-dropdown branch from 12b16b0 to 6246c0d Compare December 9, 2024 22:49
@sun-mota sun-mota force-pushed the sunMota/integrate-datepicker-dropdown branch from 6246c0d to d6077b6 Compare December 9, 2024 23:12
components/select/demo/api.md Outdated Show resolved Hide resolved
components/datepicker/src/auro-datepicker.js Show resolved Hide resolved
components/datepicker/src/auro-calendar.js Outdated Show resolved Hide resolved
components/datepicker/src/auro-calendar.js Outdated Show resolved Hide resolved
@sun-mota sun-mota linked an issue Dec 10, 2024 that may be closed by this pull request
Copy link
Member

@jason-capsule42 jason-capsule42 left a comment

Choose a reason for hiding this comment

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

All new files in this PR need to have and EOF extra line. I would suggest turning on the feature in VS Code that does this for you by default when saving a file.

https://stackoverflow.com/questions/44704968/visual-studio-code-insert-newline-at-the-end-of-files

components/dropdown/src/styles/bibStyles.scss Show resolved Hide resolved
components/select/docs/partials/api.md Outdated Show resolved Hide resolved
@sun-mota sun-mota merged commit 5b08948 into main Dec 10, 2024
4 of 6 checks passed
@sun-mota sun-mota deleted the sunMota/integrate-datepicker-dropdown branch December 10, 2024 22:36
@rmenner
Copy link
Contributor

rmenner commented Dec 16, 2024

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

The release is available on GitHub release

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
3 participants