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

Using DateFormField instead of DateInputV2 #6227

Closed
wants to merge 4 commits into from

Conversation

suprabathk
Copy link
Contributor

@suprabathk suprabathk commented Sep 5, 2023

WHAT

🤖 Generated by Copilot at 1f85408

Updated the date input components for asset creation and service records. Used DateFormField instead of DateInputV2 to improve date validation and state management. Fixed some bugs related to date logic in AssetCreate.tsx and AssetServiceEditModal.tsx.

Proposed Changes

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

HOW

🤖 Generated by Copilot at 1f85408

  • Replace DateInputV2 component with DateFormField component, which adds validation and error handling for date inputs, in two components: AssetCreate and AssetServiceEditModal (link, link, link, link)
  • Modify onChange handler of DateFormField component in AssetCreate component to use the value property of the date object, instead of the date object itself, for comparison and state update, and remove the max prop of the DateInputV2 component, as it is handled by the DateFormField component (link, link)
  • Modify onChange handler of DateFormField component in AssetServiceEditModal component to check if the selected service date is after the creation date of the service record, and show an error notification if so (link)

@suprabathk suprabathk requested a review from a team September 5, 2023 15:40
@suprabathk suprabathk requested a review from a team as a code owner September 5, 2023 15:40
@vercel
Copy link

vercel bot commented Sep 5, 2023

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

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2023 4:50am

@netlify
Copy link

netlify bot commented Sep 5, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit d9e46c8
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/64fbf96c2ab8cf00082c4cf9
😎 Deploy Preview https://deploy-preview-6227--care-egov-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nihal467
Copy link
Member

@suprabathk
image

The bug here is that, initially, when we click the last service detail, the calendar sometimes, becomes only half visible, so, when we try to click on the date to select, on the first click, it makes the component fully visible, and on the next click only the date selection takes place.

The above situation shouldn't be the ideal case, on the first click itself the user should be able to select the date

Note: This bug won't occur, if the user manually scrolls and makes the component fully visible first and click on the date.

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

The PR still doesn't solve the underlying issue

@github-actions
Copy link

Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions.

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.

BUG: date picker- asset service update
3 participants