Skip to content

Commit

Permalink
Merge branch 'develop' into remove-clickElementById/ohcnetwork#8929
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Nov 18, 2024
2 parents c021f4e + c4f54a8 commit 6a56e6f
Show file tree
Hide file tree
Showing 28 changed files with 111 additions and 187 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ jobs:
group: "UI-Chrome"
env:
CYPRESS_SPLIT_TESTS: "true"
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max_old_space_size=4096
COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}}
Expand All @@ -133,7 +132,7 @@ jobs:

- name: Upload cypress videos 📹
uses: actions/upload-artifact@v3
if: steps.pr_origin.outputs.is_forked == 'true'
if: ${{ failure() && steps.pr_origin.outputs.is_forked == 'true' }}
with:
name: cypress-videos
path: cypress/videos
24 changes: 12 additions & 12 deletions cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Progress Note Log Update filed successfully");
cy.closeNotification();
// Verify the data reflection
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
Expand Down Expand Up @@ -180,9 +180,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.submitButton("Complete");
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#respiratory-support", [
Expand All @@ -195,9 +195,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
]);
// Go back and edit the data on a third section
patientLogupdate.clickGoBackConsultation();
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateUpdateLog(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
patientLogupdate.selectCriticalCareSection("Dialysis");
Expand All @@ -210,9 +210,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Detailed Log Update filed successfully");
cy.closeNotification();
//Reverify the editted and newly added data
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#respiratory-support", [
Expand Down Expand Up @@ -285,9 +285,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.verifyNotification("Brief Update created successfully");
cy.closeNotification();
// edit the card and verify the data.
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
Expand All @@ -309,9 +309,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientLogupdate.typeDiastolic(patientModifiedDiastolic);
cy.submitButton("Continue");
cy.verifyNotification("Brief Update updated successfully");
cy.contains("button", "Daily Rounds").click();
cy.contains("button", "Log Updates").click();
patientLogupdate.clickLogUpdateViewDetails(
"#dailyround-entry",
"#logupdate-entry",
patientCategory,
);
cy.verifyContentPresence("#consultation-preview", [
Expand Down
9 changes: 2 additions & 7 deletions cypress/e2e/users_spec/UsersManage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,9 @@ describe("Manage User", () => {
manageUserPage.clicklinkedskillbutton();
manageUserPage.selectSkillFromDropdown(linkedskill);
manageUserPage.clickAddSkillButton();
manageUserPage.clickCloseSlideOver();
cy.wait(5000); // temporary hack to fix the failure
manageUserPage.clicklinkedskillbutton();
cy.verifyNotification("Skill added successfully");
cy.closeNotification();
manageUserPage.assertSkillInAddedUserSkills(linkedskill);
manageUserPage.clickUnlinkSkill();
manageUserPage.clickSubmit();
manageUserPage.selectSkillFromDropdown(linkedskill);
manageUserPage.clickAddSkillButton();
manageUserPage.clickCloseSlideOver();
// verifying the doctor connect
manageUserPage.navigateToFacility();
Expand Down
3 changes: 3 additions & 0 deletions cypress/pageobject/Hcx/HcxClaims.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export class HcxClaims {
selectEligiblePolicy(policy: string) {
cy.get("#select-insurance-policy", { timeout: 10000 })
.should("be.visible")
.and("not.be.disabled");
cy.clickAndSelectOption("#select-insurance-policy", policy);
}

Expand Down
4 changes: 2 additions & 2 deletions cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ export class PatientConsultationPage {

clickViewConsultationButton() {
cy.verifyAndClickElement(
"#view_consultation_updates",
"View Consultation / Consultation Updates",
"#view_consultation_and_log_updates",
"View Consultation / Log Updates",
);
}

Expand Down
4 changes: 4 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,8 @@
"location_management": "Location Management",
"log_lab_results": "Log Lab Results",
"log_report": "Log Report",
"log_update": "Log Update",
"log_updates": "Log Updates",
"login": "Login",
"longitude_invalid": "Longitude must be between -180 and 180",
"lsg": "Lsg",
Expand Down Expand Up @@ -901,6 +903,7 @@
"no_investigation_suggestions": "No Investigation Suggestions",
"no_linked_facilities": "No Linked Facilities",
"no_log_update_delta": "No changes since previous log update",
"no_log_updates": "No log updates found",
"no_notices_for_you": "No notices for you.",
"no_patients_to_show": "No patients to show.",
"no_policy_added": "No Insurance Policy Added",
Expand Down Expand Up @@ -1309,6 +1312,7 @@
"view_abdm_records": "View ABDM Records",
"view_asset": "View Assets",
"view_cns": "View CNS",
"view_consultation_and_log_updates": "View Consultation / Log Updates",
"view_details": "View Details",
"view_faciliy": "View Facility",
"view_patients": "View Patients",
Expand Down
10 changes: 5 additions & 5 deletions src/Routers/routes/ConsultationRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const consultationRoutes: AppRoutes = {
sessionId={sessionId}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:id/daily-rounds": ({
"/facility/:facilityId/patient/:patientId/consultation/:id/log_updates": ({
facilityId,
patientId,
id,
Expand All @@ -92,7 +92,7 @@ const consultationRoutes: AppRoutes = {
consultationId={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily-rounds/:id/update":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/update":
({ facilityId, patientId, consultationId, id }) => (
<DailyRounds
facilityId={facilityId}
Expand All @@ -101,7 +101,7 @@ const consultationRoutes: AppRoutes = {
id={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily-rounds/:id":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id":
({ facilityId, patientId, consultationId, id }) => (
<DailyRoundListDetails
facilityId={facilityId}
Expand All @@ -110,7 +110,7 @@ const consultationRoutes: AppRoutes = {
id={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily_rounds/:id":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/critical_care":
({ facilityId, patientId, consultationId, id }) => (
<CriticalCarePreview
facilityId={facilityId}
Expand All @@ -119,7 +119,7 @@ const consultationRoutes: AppRoutes = {
id={id}
/>
),
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily_rounds/:id/update":
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/critical_care/update":
({ facilityId, patientId, consultationId, id }) => (
<CriticalCareEditor
facilityId={facilityId}
Expand Down
4 changes: 2 additions & 2 deletions src/common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,12 @@ export const NOTIFICATION_EVENTS: NotificationEvent[] = [
},
{
id: "PATIENT_CONSULTATION_UPDATE_CREATED",
text: "Patient Consultation Update Created",
text: "Patient Log Update Created",
icon: "l-heart",
},
{
id: "PATIENT_CONSULTATION_UPDATE_UPDATED",
text: "Patient Consultation Update Updated",
text: "Patient Log Update Updated",
icon: "l-heart-medical",
},
{
Expand Down
9 changes: 5 additions & 4 deletions src/components/Facility/ConsultationCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import careConfig from "@careConfig";
import { t } from "i18next";
import { navigate } from "raviger";
import { useState } from "react";

Expand Down Expand Up @@ -169,15 +170,15 @@ export const ConsultationCard = (props: ConsultationProps) => {
</div>
<div className="mt-4 flex w-full flex-col justify-between gap-1 md:flex-row">
<ButtonV2
id="view_consultation_updates"
id="view_consultation_and_log_updates"
className="h-auto whitespace-pre-wrap border border-secondary-500 bg-white text-black hover:bg-secondary-300"
onClick={() =>
navigate(
`/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}`,
)
}
>
View Consultation / Consultation Updates
{t("view_consultation_and_log_updates")}
</ButtonV2>
<ButtonV2
className="h-auto whitespace-pre-wrap border border-secondary-500 bg-white text-black hover:bg-secondary-300"
Expand All @@ -200,14 +201,14 @@ export const ConsultationCard = (props: ConsultationProps) => {
setOpen(true);
} else {
navigate(
`/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}/daily-rounds`,
`/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}/log_updates/`,
);
}
}}
disabled={!!itemData.discharge_date}
authorizeFor={NonReadOnlyUsers}
>
Add Consultation Updates
{t("add") + " " + t("log_update")}
</ButtonV2>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import ReadMore from "@/components/Common/Readmore";
import Tabs from "@/components/Common/Tabs";
import EventsList from "@/components/Facility/ConsultationDetails/Events/EventsList";
import { ConsultationTabProps } from "@/components/Facility/ConsultationDetails/index";
import DailyRoundsFilter from "@/components/Facility/Consultations/DailyRoundsFilter";
import DailyRoundsList from "@/components/Facility/Consultations/DailyRoundsList";
import LogUpdatesFilter from "@/components/Facility/Consultations/LogUpdatesFilter";
import LogUpdatesList from "@/components/Facility/Consultations/LogUpdatesList";
import { BedModel } from "@/components/Facility/models";
import PrescriptionsTable from "@/components/Medicine/PrescriptionsTable";
import EncounterSymptomsCard from "@/components/Symptoms/SymptomsCard";
Expand Down Expand Up @@ -688,7 +688,7 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => {
),
value: 1,
},
{ text: t("daily_rounds"), value: 0 },
{ text: t("log_updates"), value: 0 },
]}
onTabChange={(v) => setShowEvents(!!v)}
currentTab={showEvents ? 1 : 0}
Expand Down Expand Up @@ -756,7 +756,7 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => {
{showEvents ? (
<EventsList query={eventsQuery!} />
) : (
<DailyRoundsList
<LogUpdatesList
consultation={props.consultationData}
query={dailyRoundsQuery!}
/>
Expand All @@ -773,7 +773,7 @@ function DailyRoundsSortDropdown({
setDailyRoundsQuery: (query: QueryParams) => void;
}) {
return (
<DailyRoundsFilter
<LogUpdatesFilter
onApply={(query) => {
setDailyRoundsQuery(query);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PaginatedList from "@/CAREUI/misc/PaginatedList";
import GenericEvent from "@/components/Facility/ConsultationDetails/Events/GenericEvent";
import { getEventIcon } from "@/components/Facility/ConsultationDetails/Events/iconMap";
import { EventGeneric } from "@/components/Facility/ConsultationDetails/Events/types";
import LoadingLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/LoadingCard";
import LoadingLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/LoadingCard";

import { useSlugs } from "@/hooks/useSlug";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import CareIcon from "@/CAREUI/icons/CareIcon";

import ButtonV2 from "@/components/Common/ButtonV2";
import LogUpdateCardAttribute from "@/components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute";
import LogUpdateCardAttribute from "@/components/Facility/Consultations/LogUpdates/LogUpdateCardAttribute";
import { ConsultationModel } from "@/components/Facility/models";
import { DailyRoundsModel } from "@/components/Patient/models";

Expand All @@ -26,7 +26,7 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => {
return (
<div
className="flex w-full flex-col gap-4 rounded-lg border border-secondary-400 p-4 @container"
id="dailyround-entry"
id="logupdate-entry"
>
<LogUpdateCardAttribute
attributeKey={"rounds_type"}
Expand Down Expand Up @@ -59,8 +59,8 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => {
["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes(
round.rounds_type!,
)
? `${consultationUrl}/daily-rounds/${round.id}`
: `${consultationUrl}/daily_rounds/${round.id}`
? `${consultationUrl}/log_updates/${round.id}`
: `${consultationUrl}/log_updates/${round.id}/critical_care`
}
>
<CareIcon icon="l-eye" className="text-lg" />
Expand All @@ -81,8 +81,8 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => {
"DOCTORS_LOG",
"COMMUNITY_NURSES_LOG",
].includes(round.rounds_type!)
? `${consultationUrl}/daily-rounds/${round.id}/update`
: `${consultationUrl}/daily_rounds/${round.id}/update`
? `${consultationUrl}/log_updates/${round.id}/update`
: `${consultationUrl}/log_updates/${round.id}/critical_care/update`
}
>
<CareIcon icon="l-pen" className="text-lg" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next";

import LogUpdateCardAttribute from "@/components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute";
import LogUpdateCardAttribute from "@/components/Facility/Consultations/LogUpdates/LogUpdateCardAttribute";
import { DailyRoundsModel } from "@/components/Patient/models";

// TODO: remove this method once events module is ready
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface Props {
onApply: (filter: FilterState) => void;
}

export default function DailyRoundsFilter(props: Props) {
export default function LogUpdatesFilter(props: Props) {
const { t } = useTranslation();
const [filter, setFilter] = useState<FilterState>({});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { useTranslation } from "react-i18next";
import Timeline, { TimelineNode } from "@/CAREUI/display/Timeline";
import PaginatedList from "@/CAREUI/misc/PaginatedList";

import DefaultLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard";
import LoadingLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/LoadingCard";
import VirtualNursingAssistantLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/VirtualNursingAssistantLogUpdateCard";
import DefaultLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/DefaultLogUpdateCard";
import LoadingLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/LoadingCard";
import VirtualNursingAssistantLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/VirtualNursingAssistantLogUpdateCard";
import { ConsultationModel } from "@/components/Facility/models";
import { DailyRoundsModel } from "@/components/Patient/models";

Expand All @@ -21,7 +21,7 @@ interface Props {
query: QueryParams;
}

export default function DailyRoundsList({ consultation, query }: Props) {
export default function LogUpdatesList({ consultation, query }: Props) {
const [consultationId] = useSlugs("consultation");
const { t } = useTranslation();

Expand All @@ -37,7 +37,7 @@ export default function DailyRoundsList({ consultation, query }: Props) {
<div className="flex flex-col gap-4 overflow-y-auto overflow-x-hidden px-3">
<PaginatedList.WhenEmpty className="flex w-full justify-center border-b border-secondary-200 bg-white p-5 text-center text-2xl font-bold text-secondary-500">
<span className="flex justify-center rounded-lg bg-white p-3 text-secondary-700">
{t("no_consultation_updates")}
{t("no_log_updates")}
</span>
</PaginatedList.WhenEmpty>
<PaginatedList.WhenLoading>
Expand Down
Loading

0 comments on commit 6a56e6f

Please sign in to comment.