Skip to content

Commit a2cabfe

Browse files
authored
Merge pull request #13889 from ohcnetwork/develop
2 parents ea968d4 + caaaca8 commit a2cabfe

File tree

205 files changed

+6418
-6906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+6418
-6906
lines changed

.example.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,8 @@ REACT_APP_RESEND_OTP_TIMEOUT=
7979
# Maximum image upload size allowed (in megabytes)
8080
REACT_APP_MAX_IMAGE_UPLOAD_SIZE_MB=
8181

82+
# Disables public patient login in Care, (default: false)
83+
REACT_DISABLE_PATIENT_LOGIN=false
84+
8285
# Default payment terms for invoices
8386
REACT_DEFAULT_PAYMENT_TERMS=

care.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ const careConfig = {
143143
? parseInt(env.REACT_APP_MAX_IMAGE_UPLOAD_SIZE_MB, 10)
144144
: 2,
145145

146+
/**
147+
* Disable patient login if set to "true"
148+
*/
149+
disablePatientLogin: boolean("REACT_DISABLE_PATIENT_LOGIN", false),
150+
146151
patientRegistration: {
147152
/**
148153
* Minimum number of geo-organization levels the user must select

cypress/pageObject/Patients/PatientDepartments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export class PatientDepartments {
225225
return this;
226226
}
227227
clickConfirmRemove() {
228-
cy.verifyAndClickElement('[data-cy="confirm-remove-user"]', "Remove");
228+
cy.clickConfirmAction("Remove");
229229
return this;
230230
}
231231

cypress/pageObject/Patients/PatientDetails.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ export class PatientDetails {
4646
}
4747

4848
confirmUserRemoval() {
49-
cy.verifyAndClickElement(
50-
'[data-cy="patient-user-remove-confirm-button"]',
51-
"Remove",
52-
);
49+
cy.clickConfirmAction("Remove");
5350
return this;
5451
}
5552

cypress/pageObject/Patients/PatientLocation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class PatientLocation {
4242

4343
clickFirstDeleteLocationButton() {
4444
cy.get(this.selectors.deleteLocationButton).first().click({ force: true });
45-
cy.verifyAndClickElement(this.selectors.removeLocationButton, "Remove");
45+
cy.clickConfirmAction("Remove");
4646
return this;
4747
}
4848

cypress/pageObject/Patients/PatientPrescription.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,7 @@ export class PatientPrescription {
9797
.then(($button) => {
9898
if (!$button.is(":disabled")) {
9999
cy.wrap($button).click();
100-
cy.verifyAndClickElement(
101-
'[data-cy="confirm-remove-medication"]',
102-
"Remove",
103-
);
100+
cy.clickConfirmAction("Remove");
104101
}
105102
});
106103
return this;

cypress/pageObject/facility/FacilityDevices.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,7 @@ export class FacilityDevices {
119119
cy.intercept("DELETE", "/api/v1/facility/**/device/**").as("deleteDevice");
120120

121121
cy.verifyAndClickElement('[data-cy="delete-device-button"]', "Delete");
122-
cy.verifyAndClickElement(
123-
'[data-cy="confirm-delete-device-button"]',
124-
"Delete",
125-
);
122+
cy.clickConfirmAction("Delete");
126123

127124
// Wait for the delete request to complete and verify status code is 204
128125
cy.wait("@deleteDevice").its("response.statusCode").should("eq", 204);

cypress/support/commands.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,3 +339,11 @@ Cypress.Commands.add(
339339
});
340340
},
341341
);
342+
343+
Cypress.Commands.add("clickConfirmAction", (label: string) => {
344+
cy.get('div[data-slot="alert-dialog-footer"]')
345+
.should("be.visible")
346+
.within(() => {
347+
cy.contains("button", label).click();
348+
});
349+
});

cypress/support/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ declare global {
7373
labelText: string,
7474
buttonValue: string,
7575
): Chainable<Element>;
76+
clickConfirmAction(label: string): Chainable<JQuery<HTMLElement>>;
7677
}
7778
}
7879
}

eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ fs.writeFileSync(
2525
);
2626

2727
const isPreCommit = process.env.PRE_COMMIT === "true";
28+
const isProduction = process.env.NODE_ENV === "production";
2829
const DEFAULT = true;
2930

3031
const dynamicRules = (ruleset, logKey) => {
@@ -182,7 +183,7 @@ const config = [
182183
],
183184
"i18next-no-undefined-translation-keys/no-undefined-translation-keys": [
184185
dynamicRules({
185-
error: isPreCommit,
186+
error: isPreCommit || isProduction,
186187
warn: DEFAULT,
187188
}),
188189
{

0 commit comments

Comments
 (0)