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

Staging Release v24.39.3 #8573

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 4 additions & 0 deletions cypress/e2e/patient_spec/PatientRegistration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ describe("Patient Creation with consultation", () => {
facilityPage.selectLocalBody(patientOneLocalbody);
facilityPage.selectWard(patientOneWard);
patientPage.selectPatientOccupation(patientOccupation);
patientPage.selectSocioeconomicStatus("MIDDLE_CLASS");
patientPage.selectDomesticHealthcareSupport("FAMILY_MEMBER");
// Patient Medical History
patientMedicalHistory.typePatientPresentHealth(patientOnePresentHealth);
patientMedicalHistory.typePatientOngoingMedication(
Expand Down Expand Up @@ -130,6 +132,8 @@ describe("Patient Creation with consultation", () => {
yearOfBirth,
patientOneBloodGroup,
patientOccupation,
"Middle Class",
"Family member",
);
patientMedicalHistory.verifyPatientMedicalDetails(
patientOnePresentHealth,
Expand Down
149 changes: 0 additions & 149 deletions cypress/e2e/users_spec/user_manage.cy.ts

This file was deleted.

82 changes: 0 additions & 82 deletions cypress/e2e/users_spec/user_profile.cy.ts

This file was deleted.

13 changes: 13 additions & 0 deletions cypress/pageobject/Patient/PatientCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ export class PatientPage {
cy.searchAndSelectOption("#occupation", occupation);
}

selectSocioeconomicStatus(value: string) {
cy.selectRadioOption("socioeconomic_status", value);
}

selectDomesticHealthcareSupport(value: string) {
cy.selectRadioOption("domestic_healthcare_support", value);
}

clickCreatePatient() {
cy.intercept("POST", "**/api/v1/patient/").as("createPatient");
cy.get("button[data-testid='submit-button']").click();
Expand Down Expand Up @@ -165,6 +173,8 @@ export class PatientPage {
yearOfBirth,
bloodGroup,
occupation,
socioeconomicStatus = null,
domesticHealthcareSupport = null,
isAntenatal = false,
isPostPartum = false,
) {
Expand All @@ -178,6 +188,9 @@ export class PatientPage {
expect($dashboard).to.contain(yearOfBirth);
expect($dashboard).to.contain(bloodGroup);
expect($dashboard).to.contain(occupation);
socioeconomicStatus && expect($dashboard).to.contain(socioeconomicStatus);
domesticHealthcareSupport &&
expect($dashboard).to.contain(domesticHealthcareSupport);

if (isAntenatal) {
expect($dashboard).to.contain("Antenatal");
Expand Down
4 changes: 4 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ Cypress.Commands.add(
},
);

Cypress.Commands.add("selectRadioOption", (name: string, value: string) => {
cy.get(`input[type='radio'][name='${name}'][value=${value}]`).click();
});

Cypress.Commands.add("clickAndTypeDate", (selector: string, date: string) => {
cy.get(selector).scrollIntoView();
cy.get(selector).click();
Expand Down
1 change: 1 addition & 0 deletions cypress/support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ declare global {
selector: string,
symptoms: string | string[],
): Chainable<Element>;
selectRadioOption(name: string, value: string): Chainable<Element>;
typeAndMultiSelectOption(
selector: string,
input: string,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"scripts": {
"build:react": "cross-env NODE_ENV=production vite build",
"build": "npm run generate-build-meta && npm run supported-browsers && npm run build:react",
"dev": "vite",
"dev": "npm run supported-browsers && vite",
"preview": "cross-env NODE_ENV=production vite preview",
"generate-build-meta": "node ./scripts/generate-build-version.js",
"test": "snyk test",
Expand All @@ -41,7 +41,7 @@
"lint": "eslint ./src",
"lint-fix": "eslint ./src --fix",
"format": "prettier ./src --write",
"supported-browsers": "echo \"export default $(browserslist-useragent-regexp --allowHigherVersions --ignorePatch --ignoreMinor);\" | sed 's/\\x1b\\[[0-9;]*m//g' > src/supportedBrowsers.ts"
"supported-browsers": "node ./scripts/generate-supported-browsers.mjs"
},
"dependencies": {
"@fontsource/inter": "^5.0.21",
Expand Down
17 changes: 17 additions & 0 deletions scripts/generate-supported-browsers.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { getUserAgentRegex } from 'browserslist-useragent-regexp';
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const regex = getUserAgentRegex({
ignoreMinor: true,
ignorePatch: true,
allowZeroSubversions: false,
allowHigherVersions: true,
});

const supportedBrowsersPath = path.resolve(__dirname, '../src/supportedBrowsers.ts');
fs.writeFileSync(supportedBrowsersPath, `export default ${regex};`);
14 changes: 14 additions & 0 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,20 @@ export const CONSENT_PATIENT_CODE_STATUS_CHOICES = [
{ id: 3, text: "Comfort Care Only" },
{ id: 4, text: "Active treatment" },
];

export const SOCIOECONOMIC_STATUS_CHOICES = [
"MIDDLE_CLASS",
"POOR",
"VERY_POOR",
"WELL_OFF",
] as const;

export const DOMESTIC_HEALTHCARE_SUPPORT_CHOICES = [
"FAMILY_MEMBER",
"PAID_CAREGIVER",
"NO_SUPPORT",
] as const;

export const OCCUPATION_TYPES = [
{
id: 27,
Expand Down
Loading
Loading