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

Added a clear/reset button in InternalDateInput to reset/unschedule events #3154

Merged
merged 11 commits into from
Dec 29, 2023
Merged

Added a clear/reset button in InternalDateInput to reset/unschedule events #3154

merged 11 commits into from
Dec 29, 2023

Conversation

atharvParlikar
Copy link
Contributor

Fixes: #3086

Changes: Added a clear button to change the value of Date to null also made changes in typeguard functions to accept null as a datetime value

VEED.CREATE.Edit.video.mp4

@twentyhq twentyhq deleted a comment from vercel bot Dec 25, 2023
Copy link
Contributor

@lucasbordeau lucasbordeau left a comment

Choose a reason for hiding this comment

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

Nice implementation, a few minor improvements :

  • Vertically center the icon and the "Clear" text
  • Add a separating line between the calendar and the new button
  • The separating line shouldn't be displayed if we don't set the "clearable" props to true

Figma :
Capture d’écran 2023-12-26 à 11 05 21

Actual :
Capture d’écran 2023-12-26 à 11 01 23

Copy link

vercel bot commented Dec 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
twenty-twenty-website ❌ Failed (Inspect) Dec 28, 2023 6:07am

Copy link
Contributor

@lucasbordeau lucasbordeau left a comment

Choose a reason for hiding this comment

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

There's a TS error in ObjectFilterDropdownDateSearchInput.tsx, which should handle null value, I fixed it because it's complex to know how to handle it.

@@ -79,6 +80,8 @@ export const DateInput = ({
hotkeyScope,
});

const { clearable } = useDateTimeField();
Copy link
Contributor

Choose a reason for hiding this comment

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

This call should be made at the DateFieldInput level and drill down the clearable props to DateInput which doesn't know about field related logic.

@lucasbordeau lucasbordeau merged commit 97f83b5 into twentyhq:main Dec 29, 2023
5 checks passed
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.

I should be able to reset a date field
2 participants