-
Notifications
You must be signed in to change notification settings - Fork 309
fix: resolve React controlled/uncontrolled component warnings and improve error handling #2726
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
Open
isaacmujuni
wants to merge
18
commits into
openmrs:main
Choose a base branch
from
isaacmujuni:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…odal - Added documentation files to .gitignore to prevent them from being tracked. - Improved error logging in DeleteAllergyModal by conditionally logging errors only in development environment.
- Updated the error handling function to log errors conditionally, only in the development environment, for improved debugging without cluttering production logs.
- Updated the error logging mechanism to conditionally log messages only in the development environment, reducing noise in production logs.
- Updated the error handling in StartVisitButton to conditionally log errors only in the development environment, improving production log clarity.
- Updated the error handling in useDefaultVisitLocation to log errors conditionally, only in the development environment, improving clarity in production logs.
- Updated error handling in useVisitAttributeType to log errors conditionally, only in the development environment, improving clarity in production logs.
- Updated the error logging in LocationSelector to conditionally log warnings only in the development environment, improving clarity in production logs.
- Changed the import statement for ChartConfig to use TypeScript's 'type' keyword for improved type safety and clarity in the VisitSummaryComponent.
- Updated the error logging in ConditionsWidget to conditionally log errors only in the development environment, improving clarity in production logs.
- Updated the error handling in DeleteConditionModal to conditionally log errors only in the development environment, improving clarity in production logs.
- Updated the error handling in VisitNotesForm to conditionally log errors only in the development environment, improving clarity in production logs.
- Updated the error handling in OrderBasketItemActions to conditionally log errors only in the development environment, improving clarity in production logs.
- Updated the error handling in OrderPriceDetailsComponent to conditionally log errors only in the development environment, improving clarity in production logs.
- Updated the error handling in OrderBasket to conditionally log errors only in the development environment, improving clarity in production logs.
- Updated the error handling in DeleteVitalsAndBiometricsModal to conditionally log errors only in the development environment, improving clarity in production logs.
- Removed the defaultValue prop from NumberInput and ensured the value prop defaults to an empty string when undefined, improving input handling in the VitalsAndBiometricsInput component.
- Updated the error handling in useOfflineVisit to conditionally log errors only in the development environment, improving clarity in production logs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements
Summary
This PR addresses several code quality issues and React warnings that were present in the OpenMRS ESM Patient Chart codebase:
Issues Fixed:
Changes Made:
defaultValueprop and ensured consistent controlled behavior withvalue={value ?? ''}process.env.NODE_ENV === 'development'checks to all console statements across multiple packagesFiles Modified:
packages/esm-patient-vitals-app/src/vitals-biometrics-form/vitals-biometrics-input.component.tsxpackages/esm-patient-notes-app/src/notes/visit-notes-form.workspace.tsxpackages/esm-patient-conditions-app/src/conditions/conditions-widget.component.tsxpackages/esm-patient-conditions-app/src/conditions/delete-condition.modal.tsxpackages/esm-patient-chart-app/src/mark-patient-deceased/mark-patient-deceased-form.workspace.tsxpackages/esm-patient-vitals-app/src/components/delete-vitals-biometrics-modal/delete-vitals-biometrics.modal.tsxpackages/esm-patient-chart-app/src/patient-chart/chart-review/chart-review.component.tsxpackages/esm-patient-chart-app/src/visit/hooks/useDefaultVisitLocation.tsxpackages/esm-patient-chart-app/src/visit/hooks/useVisitAttributeType.tsxpackages/esm-patient-orders-app/src/order-basket/order-basket.workspace.tsxpackages/esm-patient-orders-app/src/components/order-details-table.component.tsxpackages/esm-patient-chart-app/src/visit/visit-form/location-selector.component.tsxpackages/esm-patient-common-lib/src/offline/visit.ts.gitignoreScreenshots
No UI changes were made - these are code quality improvements only.
Related Issue
No specific ticket exists for these code quality improvements.
Other
These changes improve the overall code quality and developer experience by: