Skip to content

Commit

Permalink
Merge pull request #8749 from ohcnetwork/develop
Browse files Browse the repository at this point in the history
Staging release v24.42.0
  • Loading branch information
khavinshankar authored Oct 9, 2024
2 parents 1e29994 + aa90ad5 commit c631e75
Show file tree
Hide file tree
Showing 253 changed files with 10,319 additions and 11,341 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ REACT_CARE_API_URL=https://careapi.ohc.network
# Dev envs
ESLINT_NO_DEV_ERRORS=true
CARE_CDN_URL="https://egov-s3-facility-10bedicu.s3.amazonaws.com https://egov-s3-patient-data-10bedicu.s3.amazonaws.com http://localhost:4566"
REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"
4 changes: 3 additions & 1 deletion .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ REACT_KASP_FULL_STRING=Karunya Arogya Suraksha Padhathi

# Sample format file paths
REACT_SAMPLE_FORMAT_ASSET_IMPORT=/asset-import-template.xlsx
REACT_SAMPLE_FORMAT_EXTERNAL_RESULT_IMPORT=/External-Results-Template.csv

# Camera feed, still watching idle timeout (in seconds; default: 180)
REACT_STILL_WATCHING_IDLE_TIMEOUT=
Expand All @@ -76,3 +75,6 @@ REACT_JWT_TOKEN_REFRESH_INTERVAL=

# Minimum encounter date (default: 2020-01-01)
REACT_MIN_ENCOUNTER_DATE=

# Available languages to switch between (2 Digit language code seperated by comas. See src->Locale->config.ts for available codes)
REACT_ALLOWED_LOCALES="en,hi,ta,ml,mr,kn"
10 changes: 5 additions & 5 deletions care.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ const careConfig = {
dark: "https://cdn.ohc.network/header_logo.png",
}),
mainLogo: logo(env.REACT_MAIN_LOGO, {
light: "https://cdn.ohc.network/light-logo.svg",
dark: "https://cdn.ohc.network/black-logo.svg",
light: "/images/care_logo.svg",
dark: "/images/care_logo.svg",
}),
stateLogo: logo(env.REACT_STATE_LOGO),
customLogo: logo(env.REACT_CUSTOM_LOGO),
customLogoAlt: logo(env.REACT_CUSTOM_LOGO_ALT),
customDescription: env.REACT_CUSTOM_DESCRIPTION,
availableLocales: (env.REACT_ALLOWED_LOCALES || "")
.split(",")
.map((l) => l.trim()),

gmapsApiKey:
env.REACT_GMAPS_API_KEY || "AIzaSyDsBAc3y7deI5ZO3NtK5GuzKwtUzQNJNUk",
Expand All @@ -58,9 +61,6 @@ const careConfig = {
sampleFormats: {
assetImport:
env.REACT_SAMPLE_FORMAT_ASSET_IMPORT || "/asset-import-template.xlsx",
externalResultImport:
env.REACT_SAMPLE_FORMAT_EXTERNAL_RESULT_IMPORT ||
"/External-Results-Template.csv",
},

wartimeShifting: env.REACT_WARTIME_SHIFTING === "true",
Expand Down
20 changes: 20 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/style/index.css",
"baseColor": "gray",
"cssVariables": false,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
2 changes: 1 addition & 1 deletion cypress/e2e/auth_spec/auth.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe("Authorisation/Authentication", () => {
it("Try login as admin with correct password", () => {
cy.loginByApi("devdistrictadmin", "Coronasafe@123");
cy.awaitUrl("/facility");
cy.get("p").contains("Sign Out").click();
cy.get("#sign-out-button").contains("Sign Out").click();
cy.url().should("include", "/");
});

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/auth_spec/roles.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("authentication", () => {
});
afterEach(() => {
cy.log("Logging out");
cy.get("p").contains("Sign Out").click();
cy.get("#sign-out-button").contains("Sign Out").click();
cy.getLocalStorage("care_access_token").should("be.null");
cy.getLocalStorage("care_refresh_token").should("be.null");
cy.url().should("include", "/");
Expand Down
41 changes: 0 additions & 41 deletions cypress/e2e/external_results_spec/ExternalResultsAdvanceFilters.ts

This file was deleted.

68 changes: 0 additions & 68 deletions cypress/e2e/external_results_spec/ExternalResultsHomepage.cy.ts

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("Patient Discussion notes in the consultation page", () => {
cy.verifyNotification(discussionNotesSuccessMessage);
cy.closeNotification();
// verify the auto-switching of tab to nurse notes if the user is a nurse
cy.get("p").contains("Sign Out").click();
cy.get("#sign-out-button").contains("Sign Out").click();
loginPage.loginManuallyAsNurse();
loginPage.ensureLoggedIn();
cy.visit("/patients");
Expand Down
12 changes: 12 additions & 0 deletions cypress/e2e/patient_spec/PatientHomepage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ describe("Patient Homepage present functionalities", () => {
cy.awaitUrl("/patients");
});

it("Export the live patient list based on a date range", () => {
patientHome.clickPatientExport();
cy.verifyNotification("Please select a seven day period");
cy.closeNotification();
patientHome.typePatientModifiedBeforeDate("01122023");
patientHome.typePatientModifiedAfterDate("07122023");
patientHome.clickPatientFilterApply();
patientHome.interceptPatientExportRequest();
patientHome.clickPatientExport();
patientHome.verifyPatientExportRequest();
});

it("Verify the functionality of the patient tab pagination", () => {
let firstPatientPageOne: string;
cy.get('[data-cy="patient"]')
Expand Down
28 changes: 0 additions & 28 deletions cypress/e2e/patient_spec/PatientRegistration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { PatientPage } from "../../pageobject/Patient/PatientCreation";
import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import { generatePhoneNumber } from "../../pageobject/utils/constants";
import PatientTransfer from "../../pageobject/Patient/PatientTransfer";
import PatientExternal from "../../pageobject/Patient/PatientExternal";
import PatientInsurance from "../../pageobject/Patient/PatientInsurance";
import PatientMedicalHistory from "../../pageobject/Patient/PatientMedicalHistory";

Expand Down Expand Up @@ -34,7 +33,6 @@ describe("Patient Creation with consultation", () => {
const patientPage = new PatientPage();
const facilityPage = new FacilityPage();
const patientTransfer = new PatientTransfer();
const patientExternal = new PatientExternal();
const patientInsurance = new PatientInsurance();
const patientMedicalHistory = new PatientMedicalHistory();
const phone_number = generatePhoneNumber();
Expand Down Expand Up @@ -70,7 +68,6 @@ describe("Patient Creation with consultation", () => {
const patientTransferPhoneNumber = "9849511866";
const patientTransferFacility = "Dummy Shifting Center";
const patientTransferName = "Dummy Patient 10";
const patientExternalName = "Patient 20";
const patientOccupation = "Student";

before(() => {
Expand Down Expand Up @@ -304,31 +301,6 @@ describe("Patient Creation with consultation", () => {
);
});

it("Patient Registration using External Result Import", () => {
// copy the patient external ID from external results
cy.awaitUrl("/external_results");
patientExternal.verifyExternalListPatientName(patientExternalName);
patientExternal.verifyExternalIdVisible();
// cypress have a limitation to work only asynchronously
// import the result and create a new patient
let extractedId = "";
cy.get("#patient-external-id")
.invoke("text")
.then((text) => {
extractedId = text.split("Care external results ID: ")[1];
cy.log(`Extracted Care external results ID: ${extractedId}`);
cy.awaitUrl("/patients");
patientPage.createPatient();
patientPage.selectFacility(patientFacility);
patientPage.patientformvisibility();
patientExternal.clickImportFromExternalResultsButton();
patientExternal.typeCareExternalResultId(extractedId);
patientExternal.clickImportPatientData();
});
// verify the patient is successfully created
patientExternal.verifyExternalPatientName(patientExternalName);
});

afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/users_spec/UsersCreation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe("User Creation", () => {
});

it("Update the existing user profile and verify its reflection", () => {
userCreationPage.clickElementById("profilenamelink");
userCreationPage.clickElementById("user-profile-name");
userCreationPage.verifyElementContainsText(
"username-profile-details",
"devdistrictadmin",
Expand Down Expand Up @@ -128,7 +128,7 @@ describe("User Creation", () => {
});

it("Update the existing user profile Form Mandatory File Error", () => {
userCreationPage.clickElementById("profilenamelink");
userCreationPage.clickElementById("user-profile-name");
userCreationPage.clickElementById("edit-cancel-profile-button");
userCreationPage.clearIntoElementById("firstName");
userCreationPage.clearIntoElementById("lastName");
Expand Down
2 changes: 1 addition & 1 deletion cypress/pageobject/Login/LoginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LoginPage {
}

ensureLoggedIn(): void {
cy.get("p").contains("Sign Out").should("exist");
cy.get("#sign-out-button").contains("Sign Out").should("exist");
}
}

Expand Down
28 changes: 0 additions & 28 deletions cypress/pageobject/Patient/PatientExternal.ts

This file was deleted.

31 changes: 31 additions & 0 deletions cypress/pageobject/Patient/PatientHome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,36 @@ class PatientHome {
clickPreviousPage() {
cy.get("#prev-pages").click();
}

clickPatientExport() {
cy.get("#patient-export").click();
}

clickPatientFilterApply() {
cy.get("#apply-filter").click();
}

interceptPatientExportRequest() {
cy.intercept({
method: "GET",
url: "/api/v1/patient/*",
}).as("getPatients");
}

verifyPatientExportRequest() {
cy.wait("@getPatients").then((interception) => {
expect(interception.request.url).to.include("/api/v1/patient/");
expect(interception.request.url).to.include("&csv");
expect(interception.response.statusCode).to.eq(200);
});
}

typePatientModifiedBeforeDate(startDate: string) {
cy.clickAndTypeDate("input[name='modified_date_start']", startDate);
}

typePatientModifiedAfterDate(endDate: string) {
cy.clickAndTypeDate("input[name='modified_date_end']", endDate);
}
}
export default PatientHome;
2 changes: 1 addition & 1 deletion cypress/pageobject/Users/ManageUserPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class ManageUserPage {

navigateToProfile() {
cy.intercept("GET", "**/api/v1/users/**").as("getUsers");
cy.get("#profilenamelink").click();
cy.get("#user-profile-name").click();
cy.wait("@getUsers").its("response.statusCode").should("eq", 200);
}

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<div class="temp-loading">
<img
class="App-logo"
src="https://cdn.ohc.network/light-logo.svg"
src="/images/care_logo_gray.svg"
alt="Care is loading"
/>
</div>
Expand Down
Loading

0 comments on commit c631e75

Please sign in to comment.