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

chore(ui): migrate DateTimePicker to TypeScript #640

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gjaskiewicz
Copy link
Contributor

Summary

migrate DateTimePicker to TypeScript

Changes Made

  • migrate DateTimePicker to TypeScript

Related Issues

Testing Instructions

  1. npm i
  2. npm run storybook

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.

Copy link

changeset-bot bot commented Nov 26, 2024

🦋 Changeset detected

Latest commit: c946c0e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudoperators/juno-ui-components Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Nov 26, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://cloudoperators.github.io/juno/pr-preview/pr-640/
on branch gh-pages at 2024-11-28 08:11 UTC

@ArtieReus ArtieReus added the ui-components All tasks related to juno-ui-components library label Nov 27, 2024
@guoda-puidokaite guoda-puidokaite added package All tasks related to package under packages/ enhancement New feature or request labels Nov 27, 2024
@gjaskiewicz gjaskiewicz marked this pull request as ready for review November 27, 2024 10:14
@gjaskiewicz gjaskiewicz requested review from franzheidl and a team as code owners November 27, 2024 10:14
Copy link
Contributor

@guoda-puidokaite guoda-puidokaite left a comment

Choose a reason for hiding this comment

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

Nice job! So many lines in the component. 🚀
Added a few blocking improvements.

Copy link
Contributor

@guoda-puidokaite guoda-puidokaite left a comment

Choose a reason for hiding this comment

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

Thank You for the changes! 🚀 Just a few blocking changes again.

Comment on lines +145 to +147
const fpRef = useRef<HTMLInputElement>(null) // the dom node flatpickr instance will be bound to
const flatpickrInstanceRef = useRef<flatpickr.Instance | null>(null) // The actual flatpickr instance
const calendarTargetRef = useRef(null) // The DOM node the flatpickr calendar should be rendered to
Copy link
Contributor

@guoda-puidokaite guoda-puidokaite Nov 28, 2024

Choose a reason for hiding this comment

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

(Blocking Change)

We need types everywhere here:

Suggested change
const fpRef = useRef<HTMLInputElement>(null) // the dom node flatpickr instance will be bound to
const flatpickrInstanceRef = useRef<flatpickr.Instance | null>(null) // The actual flatpickr instance
const calendarTargetRef = useRef(null) // The DOM node the flatpickr calendar should be rendered to
const fpRef = useRef<HTMLInputElement | null>(null) // The DOM node flatpickr instance will be bound to
const flatpickrInstanceRef = useRef<flatpickr.Instance | null>(null) // The actual flatpickr instance
const calendarTargetRef = useRef<HTMLDivElement | null>(null) // The DOM node the flatpickr calendar should be rendered to

//if (instance) {
instance?.destroy()
setTheDate({})
flatpickrInstanceRef.current = null // Not sure if this is actually necessary?
Copy link
Contributor

Choose a reason for hiding this comment

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

(Non-Blocking Suggestion)

I think it is, comment can be removed.


const destroyFlatpickrInstance = () => {
const instance = flatpickrInstanceRef.current
//if (instance) {
Copy link
Contributor

Choose a reason for hiding this comment

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

(Blocking)

Since this commented out code was introduced in this PR, please remove for cleaner code 🙏

instance?.destroy()
setTheDate({})
flatpickrInstanceRef.current = null // Not sure if this is actually necessary?
//}
Copy link
Contributor

Choose a reason for hiding this comment

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

(Blocking)

Since this commented out code was introduced in this PR, please remove for cleaner code 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request package All tasks related to package under packages/ ui-components All tasks related to juno-ui-components library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants