You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains 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
The pull request refactors and improves the code for sorting and displaying data related to diagnoses, external results, facilities, and patients. It uses consistent and imported types, and a common utility function compareByKey for sorting arrays of objects by a given key. It affects the files LegacyDiagnosesList.tsx, ListFilter.tsx, ResultUpdate.tsx, FacilityCreate.tsx, RangeAutocompleteFormField.tsx, PatientRegister.tsx, models.tsx, and utils.ts.
Refactor and type wardList, lsgList, wards, and selectedLsgs state variables and props in ListFilter.tsx using WardModel and LocalBodyModel types (link, link, link)
Simplify and enhance MultiSelectFormField components for local_bodies and wards in ListFilter.tsx by using optionDescription prop and removing unnecessary wrappers and functions (link, link, link)
Modify WardModel interface in models.tsx to include panchayath and local_body_id fields and use LocalBodyModel["id"] type (link)
Type states, districts, localBodies, and ward state variables and props in FacilityCreate.tsx using StateModel, DistrictModel, LocalBodyModel, and WardModel types and remove unused interfaces (link, link, link)
Add compareByKey function to utils.ts as a utility function for sorting arrays of objects by a given key (link)
rithviknishad
changed the title
Add utility: compareByKey, sort wards in filters
Sort wards by ward number in filters + adds utility method: compareByKeyDec 12, 2023
rithviknishad
changed the title
Sort wards by ward number in filters + adds utility method: compareByKey
Sort wards by ward number in filters + adds utility method: compareByDec 12, 2023
@rithviknishad 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 🙌.
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.
WHAT
🤖[deprecated] Generated by Copilot at b9637f3
The pull request refactors and improves the code for sorting and displaying data related to diagnoses, external results, facilities, and patients. It uses consistent and imported types, and a common utility function
compareByKey
for sorting arrays of objects by a given key. It affects the filesLegacyDiagnosesList.tsx
,ListFilter.tsx
,ResultUpdate.tsx
,FacilityCreate.tsx
,RangeAutocompleteFormField.tsx
,PatientRegister.tsx
,models.tsx
, andutils.ts
.Proposed Changes
compareBy
that returns a comparator function that operates on the value of an object specified by the key@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
🤖[deprecated] Generated by Copilot at b9637f3
compareByKey
function for sorting arrays of objects by a given key in various components (link, link, link, link, link, link, link, link, link, link, link)wardList
,lsgList
,wards
, andselectedLsgs
state variables and props inListFilter.tsx
usingWardModel
andLocalBodyModel
types (link, link, link)MultiSelectFormField
components forlocal_bodies
andwards
inListFilter.tsx
by usingoptionDescription
prop and removing unnecessary wrappers and functions (link, link, link)WardModel
interface inmodels.tsx
to includepanchayath
andlocal_body_id
fields and useLocalBodyModel["id"]
type (link)states
,districts
,localBodies
, andward
state variables and props inFacilityCreate.tsx
usingStateModel
,DistrictModel
,LocalBodyModel
, andWardModel
types and remove unused interfaces (link, link, link)compareByKey
function toutils.ts
as a utility function for sorting arrays of objects by a given key (link)