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 multi-line text input for Doctor Notes #6977

Merged
merged 18 commits into from
Feb 14, 2024

Conversation

kshitijv256
Copy link
Contributor

Proposed Changes

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

Screenshots

Screenshot from 2024-01-04 23-39-52

@kshitijv256 kshitijv256 requested a review from a team as a code owner January 4, 2024 18:10
Copy link

vercel bot commented Jan 4, 2024

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 Feb 1, 2024 3:40pm

Copy link

netlify bot commented Jan 4, 2024

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit eb33dab
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/65bbbb2a65c4890008c564e0
😎 Deploy Preview https://deploy-preview-6977--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.

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.

LGTM, but the PR title does not give clarity. It could have been something like: "Added support for multi-line text input for Doctor Notes"

@kshitijv256 kshitijv256 changed the title Changed TextFormField to TextAreaFormField Added support for multi-line text input for Doctor Notes Jan 5, 2024
@nihal467
Copy link
Member

nihal467 commented Jan 10, 2024

@kshitijv256
image

  • Keep the box width and height as same as the current staging, when there is only one line
  • When the line increases in the message, increase the height of the text box similar to the implementation in Slack DM's

CC: @rithviknishad

@kshitijv256
Copy link
Contributor Author

@nihal467 made changes

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.

  1. Define a max height. If the notes is of 1000 lines, we don't want it to be of 1000 lines high, instead cap it to a certain limit.

  2. Could you make this as a reusable component named: AutoExpandingTextInputFormField instead? This would also require to use a ref instead of getElementById

@kshitijv256
Copy link
Contributor Author

  1. Define a max height. If the notes is of 1000 lines, we don't want it to be of 1000 lines high, instead cap it to a certain limit.

  2. Could you make this as a reusable component named: AutoExpandingTextInputFormField instead? This would also require to use a ref instead of getElementById

On it

@kshitijv256
Copy link
Contributor Author

@rithviknishad @nihal467
made requested changes

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.

LGTM, but one thing left.

As specified in the previous review, consider using a ref instead of ID.

@kshitijv256
Copy link
Contributor Author

@Ashesh3 @rithviknishad
added comments and removed extra code as requested

@nihal467
Copy link
Member

LGTM

@nihal467 nihal467 added reviewed reviewed by a core member and removed needs review labels Jan 22, 2024
Copy link
Member

@khavinshankar khavinshankar left a comment

Choose a reason for hiding this comment

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

@kshitijv256 a minor suggestion

if (myref.current == null) return;
const text = myref.current.textContent?.split("\n");
const len = (text?.length == 0 ? 1 : text?.length) || 1;
const height = Math.min(len * 18, (props.maxHeight || 160) - 28) + 28;
Copy link
Member

Choose a reason for hiding this comment

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

@kshitijv256 instead of using haedcoded value when not get the line height from styles and then use it, just a thought

@khavinshankar khavinshankar added the question Further information is requested label Jan 23, 2024
@kshitijv256
Copy link
Contributor Author

kshitijv256 commented Jan 24, 2024

@khavinshankar

@kshitijv256 a minor suggestion

Thanks for the suggestion, I hadn't thought of it.
just changed it to fetch lineheight dynamically

@nihal467
Copy link
Member

nihal467 commented Feb 7, 2024

@kshitijv256 what is the status of this PR

@kshitijv256
Copy link
Contributor Author

Last time @khavinshankar suggested some changes which I have added. So this PR should be completed

@rithviknishad rithviknishad removed the question Further information is requested label Feb 7, 2024
@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit 5e0727d into coronasafe:develop Feb 14, 2024
35 of 36 checks passed
Copy link

@kshitijv256 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewed reviewed by a core member tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Line breaking support to the doctor notes
5 participants