Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into remove-dnd
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Feb 6, 2025
2 parents 16aedec + 1db9e70 commit 16e1a31
Show file tree
Hide file tree
Showing 90 changed files with 4,312 additions and 2,966 deletions.
3 changes: 0 additions & 3 deletions .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ REACT_SENTRY_DSN=
# Sentry environment (default: staging)
REACT_SENTRY_ENVIRONMENT=

# Sample format file paths
REACT_SAMPLE_FORMAT_ASSET_IMPORT=/asset-import-template.xlsx

# Camera feed, still watching idle timeout (in seconds; default: 180)
REACT_STILL_WATCHING_IDLE_TIMEOUT=

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-merge-conflict.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
wait_ms: 15000
detect_merge_changes: false
conflict_comment: |
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.
Conflicts have been detected against the base branch. Please merge the base branch into your branch.
cc: @${author}
> _See: https://docs.ohc.network/docs/contributing#how-to-resolve-merge-conflicts_
3 changes: 3 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ jobs:

- name: Run lint
run: npm run lint -- --quiet

- name: Run unimported
run: npm run unimported
54 changes: 54 additions & 0 deletions .unimportedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"ignorePatterns": [
"node_modules/**",
"**/*.d.ts"
],
"ignoreUnimported": [
"src/Locale/update_locale.js",
"src/PluginRegistry.ts",
"src/pluginTypes.ts",
"src/service-worker.ts"
],
"ignoreUnused": [
"@fontsource/figtree",
"@originjs/vite-plugin-federation",
"@vitejs/plugin-react",
"browserslist-useragent-regexp",
"cross-env",
"postcss-loader"
],
"ignoreUnresolved": [
[
"./pluginMap",
[
"src/pluginTypes.ts"
]
],
[
"@/supportedBrowsers",
[
"src/components/ErrorPages/BrowserWarning.tsx"
]
],
[
"tsx/cjs",
[
"node_modules/find-cypress-specs/src/index.js"
]
],
[
"virtual:pwa-register",
[
"src/index.tsx"
]
]
],
"respectGitignore": true,
"entry": [
"src/index.tsx",
"vite.config.mts",
"tailwind.config.js",
"cypress.config.ts",
"scripts/**"
]
}
5 changes: 0 additions & 5 deletions care.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ const careConfig = {
reCaptchaSiteKey:
env.REACT_RECAPTCHA_SITE_KEY || "6LdvxuQUAAAAADDWVflgBqyHGfq-xmvNJaToM0pN",

sampleFormats: {
assetImport:
env.REACT_SAMPLE_FORMAT_ASSET_IMPORT || "/asset-import-template.xlsx",
},

wartimeShifting: boolean("REACT_WARTIME_SHIFTING"),

stillWatching: {
Expand Down
5 changes: 2 additions & 3 deletions cypress/e2e/patient_spec/patient_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
PatientFormData,
patientCreation,
} from "@/pageObject/Patients/PatientCreation";
import { patientDashboard } from "@/pageObject/Patients/PatientDashboard";
import { PatientEncounter } from "@/pageObject/Patients/PatientEncounter";
import { patientVerify } from "@/pageObject/Patients/PatientVerify";
import { FacilityCreation } from "@/pageObject/facility/FacilityCreation";
Expand Down Expand Up @@ -126,7 +125,7 @@ describe("Patient Management", () => {
.clickSubmitEncounter()
.assertEncounterCreationSuccess();

patientDashboard.verifyEncounterPatientInfo([
patientEncounter.verifyEncounterPatientInfo([
ENCOUNTER_TYPE,
ENCOUNTER_STATUS,
ENCOUNTER_PRIORITY,
Expand Down Expand Up @@ -154,7 +153,7 @@ describe("Patient Management", () => {
.clickSubmitEncounter()
.assertEncounterCreationSuccess();

patientDashboard.verifyEncounterPatientInfo([
patientEncounter.verifyEncounterPatientInfo([
ENCOUNTER_TYPE,
ENCOUNTER_STATUS,
ENCOUNTER_PRIORITY,
Expand Down
35 changes: 35 additions & 0 deletions cypress/e2e/patient_spec/patient_details.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { PatientDetails } from "@/pageObject/Patients/PatientDetails";
import { PatientEncounter } from "@/pageObject/Patients/PatientEncounter";
import { FacilityCreation } from "@/pageObject/facility/FacilityCreation";

const facilityCreation = new FacilityCreation();
const patientEncounter = new PatientEncounter();
const patientDetails = new PatientDetails();

describe("Patient Management", () => {
beforeEach(() => {
cy.loginByApi("doctor");
cy.visit("/");
});

it("Assign users to a patient", () => {
const userName = "nihal-nurse";
const userRole = "Nurse";
facilityCreation.selectFacility("GHC Trikaripur");
patientEncounter
.navigateToEncounters()
.openFirstEncounterDetails()
.clickPatientDetailsButton();
patientDetails
.clickUsersTab()
.clickAssignUserButton()
.selectUserToAssign(userName)
.selectUserRole(userRole)
.confirmUserAssignment()
.verifyUserAssignmentSuccess()
.verifyUserContent([userName])
.clickRemoveUserButton()
.confirmUserRemoval()
.verifyUserRemovalSuccess();
});
});
8 changes: 0 additions & 8 deletions cypress/pageObject/Patients/PatientDashboard.ts

This file was deleted.

61 changes: 61 additions & 0 deletions cypress/pageObject/Patients/PatientDetails.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
export class PatientDetails {
clickUsersTab() {
cy.verifyAndClickElement('[data-cy="tab-users"]', "Users");
return this;
}

clickAssignUserButton() {
cy.verifyAndClickElement('[data-cy="assign-user-button"]', "Assign User");
return this;
}

selectUserToAssign(username: string) {
cy.typeAndSelectOption(
'[data-cy="patient-user-selector-container"]',
username,
false,
);
return this;
}

selectUserRole(role: string) {
cy.clickAndSelectOption('[data-cy="patient-user-role-select"]', role);
return this;
}

confirmUserAssignment() {
cy.verifyAndClickElement(
'[data-cy="patient-user-assign-button"]',
"Assign to Patient",
);
return this;
}

verifyUserAssignmentSuccess() {
cy.verifyNotification("User added to patient successfully");
return this;
}

clickRemoveUserButton() {
cy.get('[data-cy="patient-user-remove-button"]').first().click();
return this;
}

confirmUserRemoval() {
cy.verifyAndClickElement(
'[data-cy="patient-user-remove-confirm-button"]',
"Remove",
);
return this;
}

verifyUserContent(expectedTexts: string[]) {
cy.verifyContentPresence('[data-cy="patient-users"]', expectedTexts);
return this;
}

verifyUserRemovalSuccess() {
cy.verifyNotification("User removed successfully");
return this;
}
}
5 changes: 5 additions & 0 deletions cypress/pageObject/Patients/PatientEncounter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export class PatientEncounter {
return this;
}

verifyEncounterPatientInfo(contents: string[]) {
cy.verifyContentPresence("#patient-infobadges", contents);
return this;
}

// Questionnaire actions
addQuestionnaire(questionnaireName: string) {
cy.get('[data-cy="add-questionnaire-button"]').click();
Expand Down
Loading

0 comments on commit 16e1a31

Please sign in to comment.