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 support for time in dateinput component #8504

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

Conversation

shivankacker
Copy link
Member

@shivankacker shivankacker commented Sep 8, 2024

Proposed Changes

image

@ohcnetwork/care-fe-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

@shivankacker shivankacker self-assigned this Sep 8, 2024
@shivankacker shivankacker requested a review from a team as a code owner September 8, 2024 21:56
Copy link

netlify bot commented Sep 8, 2024

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 3f52db1
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/66e478dc533f7b00092c8cd8
😎 Deploy Preview https://deploy-preview-8504--care-ohc.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.

Copy link

cypress bot commented Sep 8, 2024

CARE    Run #3341

Run Properties:  status check passed Passed #3341  •  git commit 3f52db1723: Added support for time in dateinput component
Project CARE
Branch Review support-time-in-dateinput
Run status status check passed Passed #3341
Run duration 03m 02s
Commit git commit 3f52db1723: Added support for time in dateinput component
Committer Shivank Kacker
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 128
View all changes introduced in this branch ↗︎

@nihal467
Copy link
Member

nihal467 commented Sep 13, 2024

@shivankacker

image

  • When you open the date and time component in the patient consultation page, the entire form is scrolled to the right side, making it hard for the user to see what is the field heading since they are left-aligned
  • Once a user clicks on a specific time, then the component should auto-close

image

  • the placeholder text { hh: mm a }, what is meant by "a" in this text?

image

  • We had an existing behavior where typing "12092024" would automatically format the input as 12/09/2024. This behavior was removed in your PR. Please revert the change and retain the auto-formatting in the component.
  • When the user types "12092024" and moves out of focus of the element or switches tabs, the entered data resets to the current date and time in the discharge pop-up.

image

  • Since the auto-formatting is not working, there is no limit in user input
  • On mobile view, the component is clipping in, making it properly responsive across devices

image

  • Even if the user manually, types all the details by manual formatting, the component still reset to the current date and time

Personal Note: Bro, instead of modifying the entire Cypress test to make it pass, try to understand the core problem of test fail. Then, debug it

CC: @gigincg

@nihal467
Copy link
Member

nihal467 commented Sep 13, 2024

@shivankacker Bro, create a checklist of all the forms where you're changing the component and add it to the description. Review the functionality and responsiveness of each form one by one before requesting the next QA review.

@shivankacker
Copy link
Member Author

shivankacker commented Sep 13, 2024

@nihal467

  1. Will see to the scroll issue. Wasn't happening with my screen size. I even went ahead and fixed the overflow issue that the existing component was causing. The scroll resets once the time is entered.

Before:
WhatsApp Image 2024-09-13 at 21 56 42

After:
WhatsApp Image 2024-09-13 at 21 56 41

Will check and fix this one.

  1. I did not keep the auto closing thing because : It will close if a user will set the time before setting the date or vice-versa which makes it a UX issue.
  2. "a" means AM/PM. If it is not understandable I will change it to "am/pm"

We had an existing behavior where typing "12092024" would automatically format the input as 12/09/2024

  1. The existing behaviour made it easy to enter the date, but totally hard to update it. The reason it was removed was so that the user does not face this while editing the date:
Screen.Recording.2024-09-13.at.9.31.58.PM.mov

Because this behaviour was changed, the tests were also changed. Adding any format restrictions WHILE a user is typing would always result in these kind of issues.

  1. The input will auto reset if the entered time is not of the desired format.
  2. On mobile devices, the component can be scrolled left-right. This is because the date input would become small if i try to change sizes/ do anything else.
  3. You did not add space, which made it an invalid format.

cc. @gigincg

@shivankacker
Copy link
Member Author

shivankacker commented Sep 13, 2024

@nihal467

  • because you did not like the left-right scroll, I changed it to go the next row. Let me know if it doesn't look good.
  • changed "a" to "am/pm"
  • fixed the edge case of the overflow. Also verified all the inputs again. Please let me know if I missed out on something.
  • Also the input will show a red border now if the input format is wrong. Just an add on to make it fool proof.

cc. @gigincg

Copy link

👋 Hi, @shivankacker,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge conflict pull requests with merge conflict work-in-progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Care Date Time Component
2 participants