Skip to content
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

Fixed Add a better search UI for patients index page #8691 #8834

Open
wants to merge 66 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
c55d12e
Add shadcn components
bodhish Oct 18, 2024
6b0daf2
Add seach by multiple fileds
bodhish Oct 19, 2024
0c6200c
Merge remote-tracking branch 'g/filter-component' into issues/8691-ad…
i0am0arunava Oct 20, 2024
cb5d577
Add seach by multiple fileds
i0am0arunava Oct 20, 2024
c4cfde4
required changes fixed
i0am0arunava Oct 22, 2024
9aa5285
conflict resolved
i0am0arunava Oct 22, 2024
b5b51b4
sd
i0am0arunava Oct 23, 2024
2c8e255
conflict resolved
i0am0arunava Oct 23, 2024
85a7ce6
Merge branch 'develop' into issues/8691-add-better-serchui
i0am0arunava Oct 23, 2024
ecda175
conflict resolved
i0am0arunava Oct 24, 2024
4a5d79d
checked
i0am0arunava Oct 24, 2024
67c8fcf
solved
i0am0arunava Oct 24, 2024
49ae4dd
Merge branch 'develop' into issues/8691-add-better-serchui
gigincg Oct 25, 2024
0cec042
tested locally
i0am0arunava Oct 29, 2024
185b44b
Merge remote-tracking branch 'fh/develop' into issues/8691-add-better…
i0am0arunava Oct 29, 2024
7262ada
Merge branch 'issues/8691-add-better-serchui' of https://github.com/i…
i0am0arunava Oct 29, 2024
6115516
tested locally
i0am0arunava Oct 29, 2024
65b58bc
tested done locally
i0am0arunava Oct 29, 2024
b6e1aca
tested done locally made required changes and removed unused packages…
i0am0arunava Oct 30, 2024
490d266
Merge branch 'develop' into issues/8691-add-better-serchui
i0am0arunava Oct 30, 2024
3028543
fised issue erroclassname=hidden
i0am0arunava Oct 30, 2024
38ad7d0
Merge branch 'issues/8691-add-better-serchui' of https://github.com/i…
i0am0arunava Oct 30, 2024
6b962dc
Merge branch 'develop' into issues/8691-add-better-serchui
i0am0arunava Oct 30, 2024
a6b754d
fised issue erroclassname=hidden
i0am0arunava Oct 30, 2024
973d068
added i18n content for serchfield compnent
i0am0arunava Oct 30, 2024
c7bb7b7
added i18n content for serchfield compnent
i0am0arunava Oct 30, 2024
4c9d929
type are defined in correct way
i0am0arunava Oct 30, 2024
c9404a8
Update src/components/Patient/ManagePatients.tsx
i0am0arunava Oct 30, 2024
593eda3
Update src/CAREUI/display/Count.tsx
i0am0arunava Oct 30, 2024
ba889eb
Update src/Locale/en.json
i0am0arunava Oct 30, 2024
0d3bf62
Update src/Locale/en.json
i0am0arunava Oct 30, 2024
a3d1fb9
type are defined in correct way
i0am0arunava Oct 30, 2024
2a33019
phonehelp section problem is fixed
i0am0arunava Oct 30, 2024
e535a94
type are defined in correct way
i0am0arunava Oct 30, 2024
9efea86
work removed usestae and useeffect and added phhelp feature in a simp…
i0am0arunava Oct 31, 2024
fe09b27
work removed usestae and useeffect and added phhelp feature in a simp…
i0am0arunava Oct 31, 2024
1919710
fixed at a one time only one filter will be applied for the serchbymu…
i0am0arunava Nov 2, 2024
7d4a20d
Merge branch 'develop' into issues/8691-add-better-serchui
i0am0arunava Nov 2, 2024
4f15037
error function name changed to Onerro in phnumberfiedl and serchbyfield
i0am0arunava Nov 2, 2024
f7c535f
error function name changed to Onerro in phnumberfiedl and serchbyfield
i0am0arunava Nov 2, 2024
6ff1219
made some changes,requseted by reviewer
i0am0arunava Nov 3, 2024
a8936a5
fixed the bug related to filter when applying advanced filter
i0am0arunava Nov 4, 2024
c8ce4cc
fixed the bug related to filter when applying advanced filter
i0am0arunava Nov 4, 2024
144511f
Merge branch 'develop' into issues/8691-add-better-serchui
i0am0arunava Nov 4, 2024
04bd5b1
hide help added
i0am0arunava Nov 4, 2024
25ff81d
Merge branch 'issues/8691-add-better-serchui' of https://github.com/i…
i0am0arunava Nov 4, 2024
9287679
hide help added
i0am0arunava Nov 4, 2024
795a7c3
Merge branch 'develop' into issues/8691-add-better-serchui
i0am0arunava Nov 5, 2024
9e5826b
merged develop
i0am0arunava Nov 16, 2024
0067cde
fixed: clear input value after clearing filter
i0am0arunava Nov 17, 2024
eb4b6bf
Merge remote-tracking branch 'gh/develop' into issues/8691-add-better…
i0am0arunava Nov 17, 2024
189896e
Discard changes to .env
sainak Nov 18, 2024
e039027
fixed
i0am0arunava Nov 18, 2024
bac1db6
Merge remote-tracking branch 'hgh/develop' into issues/8691-add-bette…
i0am0arunava Nov 18, 2024
3e75b22
merge conflict resolving
i0am0arunava Nov 19, 2024
7a4ecac
debouncing added for search field
i0am0arunava Nov 19, 2024
b7e3e00
debouncing added for search field
i0am0arunava Nov 19, 2024
acc6362
Merge branch 'develop' into issues/8691-add-better-serchui
i0am0arunava Nov 20, 2024
db5962c
Merge branch 'develop' into issues/8691-add-better-serchui
i0am0arunava Nov 21, 2024
12af40e
fixed debouncing and prevent unnecessary api calls
i0am0arunava Nov 24, 2024
fa58519
Merge remote-tracking branch 'xx/develop' into issues/8691-add-better…
i0am0arunava Nov 24, 2024
9102b20
cleanup
shivankacker Nov 26, 2024
a9746cc
minor fixes
shivankacker Nov 26, 2024
241a1f1
Merge branch 'develop' into issues/8691-add-better-serchui
shivankacker Nov 26, 2024
53a6c35
Fixed keyboard shortcutes
shivankacker Nov 26, 2024
84c1155
Merge branch 'issues/8691-add-better-serchui' of https://github.com/i…
shivankacker Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cypress/pageobject/Patient/PatientCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export class PatientPage {
}

visitPatient(patientName: string) {
cy.get("#name").click().type(patientName);
cy.get("button").contains("Name").click();
cy.get("#name").type(patientName); // Type the patient name
Comment on lines +14 to +15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling and visibility checks for the search type selection.

While the changes align with the new search UI, the test could be more robust:

-    cy.get("button").contains("Name").click();
-    cy.get("#name").type(patientName); // Type the patient name
+    cy.get("button")
+      .contains("Name")
+      .should("be.visible")
+      .should("be.enabled")
+      .click();
+    cy.get("#name")
+      .should("be.visible")
+      .should("be.focused")
+      .type(patientName);

This ensures that:

  1. The "Name" button is visible and clickable before interaction
  2. The input field is visible and properly focused after button click
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cy.get("button").contains("Name").click();
cy.get("#name").type(patientName); // Type the patient name
cy.get("button")
.contains("Name")
.should("be.visible")
.should("be.enabled")
.click();
cy.get("#name")
.should("be.visible")
.should("be.focused")
.type(patientName);

cy.intercept("GET", "**/api/v1/consultation/**").as("getPatient");
cy.get("#patient-name-list").contains(patientName).click();
cy.wait(2000);
Expand Down Expand Up @@ -66,6 +67,7 @@ export class PatientPage {
}

typePatientNameList(patientName: string) {
cy.get("button").contains("Name").click();
cy.get("#name").click().type(patientName);
}
Comment on lines +70 to 72
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Refactor to eliminate code duplication with visitPatient.

The typePatientNameList method duplicates the same name search logic as visitPatient. Consider extracting this common functionality into a shared method.

+  private selectNameSearchType() {
+    cy.get("button")
+      .contains("Name")
+      .should("be.visible")
+      .should("be.enabled")
+      .click();
+  }
+
+  private typeIntoNameField(patientName: string) {
+    cy.get("#name")
+      .should("be.visible")
+      .should("be.focused")
+      .type(patientName);
+  }
+
   visitPatient(patientName: string) {
-    cy.get("button").contains("Name").click();
-    cy.get("#name").type(patientName);
+    this.selectNameSearchType();
+    this.typeIntoNameField(patientName);
     // ... rest of the method
   }

   typePatientNameList(patientName: string) {
-    cy.get("button").contains("Name").click();
-    cy.get("#name").click().type(patientName);
+    this.selectNameSearchType();
+    this.typeIntoNameField(patientName);
   }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cy.get("button").contains("Name").click();
cy.get("#name").click().type(patientName);
}
private selectNameSearchType() {
cy.get("button")
.contains("Name")
.should("be.visible")
.should("be.enabled")
.click();
}
private typeIntoNameField(patientName: string) {
cy.get("#name")
.should("be.visible")
.should("be.focused")
.type(patientName);
}
visitPatient(patientName: string) {
this.selectNameSearchType();
this.typeIntoNameField(patientName);
// ... rest of the method
}
typePatientNameList(patientName: string) {
this.selectNameSearchType();
this.typeIntoNameField(patientName);
}


Expand Down
Loading
Loading