From 049332662d7ec0e2622e63150e54333a54ab9603 Mon Sep 17 00:00:00 2001
From: Pedro Sousa - ICRC <68599335+icrc-psousa@users.noreply.github.com>
Date: Mon, 1 Apr 2024 15:36:50 +0100
Subject: [PATCH] (feat) Patient name sorting (#76)
* Patient sorting by name
* Fixed session patient list toggle issue
* Removed unnecessary div tag
* Use name instead of deprecated extensionSlotName property
* Adjusted AttendanceTable rendering to prevent undefined patient issues
* Fixed AttendanceTable
* Added cleanup function to SortedPatientLists effect
* Consider only patient name and not id when sorting
* Refactored patient list ordering
* Removed unnecessary sort on reducer
---
src/add-group-modal/AddGroupModal.tsx | 60 ++++++++++++-------
.../SessionDetailsForm.tsx | 4 +-
.../attendance-table/AttendanceTable.tsx | 4 +-
.../group-search-header/GroupSearchHeader.tsx | 5 +-
4 files changed, 48 insertions(+), 25 deletions(-)
diff --git a/src/add-group-modal/AddGroupModal.tsx b/src/add-group-modal/AddGroupModal.tsx
index 5d917fc..ef03aa1 100644
--- a/src/add-group-modal/AddGroupModal.tsx
+++ b/src/add-group-modal/AddGroupModal.tsx
@@ -16,7 +16,12 @@ import {
} from "@carbon/react";
import { TrashCan } from "@carbon/react/icons";
import { useTranslation } from "react-i18next";
-import { ExtensionSlot, showToast, usePatient } from "@openmrs/esm-framework";
+import {
+ ExtensionSlot,
+ fetchCurrentPatient,
+ showToast,
+ usePatient,
+} from "@openmrs/esm-framework";
import styles from "./styles.scss";
import GroupFormWorkflowContext from "../context/GroupFormWorkflowContext";
import { usePostCohort } from "../hooks";
@@ -111,7 +116,7 @@ const NewGroupForm = (props) => {