Open JavidSumra opened 2 weeks ago
Name | Link |
---|---|
Latest commit | 2c98d0249305f4769ff3a35cdabc0d810b114181 |
Latest deploy log | https://app.netlify.com/sites/care-ohc/deploys/674093b76a6161000889f879 |
Deploy Preview | https://deploy-preview-9062--care-ohc.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
The changes involve updates to several components related to resource management. The ResourceCreate
component now includes a utility function for sanitizing numeric input, enforcing numeric constraints on the requested_quantity
field. The ResourceDetailsUpdate
component has enhanced validation logic and error handling, particularly for new required fields. Additionally, a Cypress test file has been modified to improve test coverage for resource updates. A new utility function, sanitizeNumberInput
, has also been introduced to ensure only numeric values are accepted in input fields.
File | Change Summary |
---|---|
src/components/Resource/ResourceCreate.tsx |
- Added sanitizeNumberInput utility function.- Modified TextFormField for requested_quantity to enforce numeric input (type="number", min={1}).- Updated onInput event to call sanitizeNumberInput . |
src/components/Resource/ResourceDetailsUpdate.tsx |
- Updated validation logic by replacing assigned_facility_type with assigned_facility_object .- Added required fields title and reason with error messages.- Enhanced form submission logic to check for valid form state. |
cypress/e2e/resource_spec/ResourcesHomepage.cy.ts |
- Adjusted import statements and added functionality to select an option from assigned_facility_object in tests. |
src/Utils/utils.ts |
- Introduced sanitizeNumberInput function to sanitize numeric input in forms. |
Objective | Addressed | Explanation |
---|---|---|
Required Quantity should not accept negative values (9053) | β | |
Description field should be mandatory (9053) | β | No changes were made to enforce description field validation. |
TextFormField
for requested_quantity
to include the onInput
event referencing sanitizeNumberInput
, which is directly related to the changes made in the main PR regarding the same field.ResourceCreate
component. This is relevant as the main PR also pertains to the ResourceCreate
component, indicating a connection in the context of resource management.needs review
, tested
π In the fields where bunnies play,
Numbers hop and dance all day.
With inputs clean and errors few,
Resource updates, fresh and new!
So letβs rejoice, for changes bright,
Our forms are now a pure delight! π₯
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Have you updated the value or is it already present there? cc @nihal467
@JavidSumra i updated the value
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
New Features
requested_quantity
andassigned_quantity
fields to accept only numeric values with a minimum of 1.title
andreason
in the resource form, ensuring all necessary information is provided before submission.Bug Fixes
Tests