Skip to content

TimeSlider / TimeLayerSliderPanel: Pass value correctly to layer / component and use DayJs#4175

Merged
ahennr merged 6 commits intoterrestris:mainfrom
ahennr:fix/timelayersliderpanel
Jan 24, 2025
Merged

TimeSlider / TimeLayerSliderPanel: Pass value correctly to layer / component and use DayJs#4175
ahennr merged 6 commits intoterrestris:mainfrom
ahennr:fix/timelayersliderpanel

Conversation

@ahennr
Copy link
Member

@ahennr ahennr commented Jan 23, 2025

Description

This PR refactors the TimeSlider and TimeLayerSliderPanel components to allow the time value to be updated externally (e.g., through a Form) and passed directly to configured time layers. Additionally, momentjs has been replaced with dayjs, aligning with the default time library used in antd.

With these changes, there are now two ways to retrieve the selected value from the slider:

  1. onChange: Triggered immediately when the slider's value changes.
  2. onChangeComplete: Triggered once the user finishes dragging the slider pointer.

Related issues or pull requests

Pull request type

  • Bugfix
  • Feature
  • Dependency updates
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe)

Do you introduce a breaking change?

  • Yes
  • No

Checklist

  • I understand and agree that the changes in this PR will be licensed under the
    BSD-2-Clause.
  • I have followed the guidelines for contributing.
  • The proposed change fits to the content of the Code of Conduct.
  • I have added or updated tests and documentation, and the test suite passes (run npm run check locally).
  • I have added a screenshot/screencast to illustrate the visual output of my update.

Copy link
Member

@LukasLohoff LukasLohoff left a comment

Choose a reason for hiding this comment

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

Very nice!

Shouldn't we also add dayjs to the package.json?

@ahennr
Copy link
Member Author

ahennr commented Jan 24, 2025

Very nice!

Shouldn't we also add dayjs to the package.json?

Is not needed IHMO since its a transitive dependency of antd (see here). Or do you prefer to include it?

@ahennr ahennr merged commit 4f28180 into terrestris:main Jan 24, 2025
1 check passed
@ahennr ahennr deleted the fix/timelayersliderpanel branch January 24, 2025 12:39
@dnlkoch
Copy link
Member

dnlkoch commented Jan 24, 2025

🎉 This PR is included in version 28.0.0 🎉

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants