-
Notifications
You must be signed in to change notification settings - Fork 102
(fix) O3-4613 Removing previous sub properties from Form json after changing Question and Rendering Type #446
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
base: main
Are you sure you want to change the base?
Conversation
Thanks @yoursanonymous, great catch! Really appreciate you pointing this out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think its really necessary to default pick a datepicker type for this, but if we are doing it, its much better to set it here when the rendering type is being set rather than use an useEffect-
Line 105 in b5221ee
const updatedObject: FormField = |
We should avoid the usage of useEffects wherever we can - https://react.dev/learn/you-might-not-need-an-effect
Hi @NethmiRodrigo, Thank you for reviewing my PR, Could you please review it again. |
...ractive-builder/modals/question/question-form/rendering-types/inputs/date/date.component.tsx
Show resolved
Hide resolved
Hi @NethmiRodrigo, after trying out multiple scenarios the issue was found to be pretty big one in which when we change the rendering type, the subsequent subproperties of previous rendering type was not removed from the Form json and the default value selected for various fields in interactive builder was also not added automatically by default to json object. |
before.o3-4613.mp4after.o3-4613.mp4 |
Removing unnecesary fields during questionType change. beforeQuestion1.mp4afterQuestion.mp4 |
Hi @NethmiRodrigo, awaiting your approval, Kindly review |
@yoursanonymous The issue you've pivoted to address is already being worked on in PR #391, which has several comments and insights on how to fix it properly.
For future reference, it's best practice to keep PRs focused on their original scope. If you want to work on a different issue, please open a new PR rather than changing direction mid-review. This wastes reviewer time and disrupts our development process. One PR = one focused purpose. |
…roup button
Requirements
Summary
When we create a question of type "encounterDateTime", we have radio buttons of "type of date picker to show" should be selected when we save a form but, it's not working.
Screenshots
Before
beforeSave.mp4
After
afterSave.mp4
Related Issue
https://openmrs.atlassian.net/browse/O3-4613
Other