From 32c25aa28dd660a5e77dcd20fbcbbbad4bf10933 Mon Sep 17 00:00:00 2001 From: Onkar Jadhav <56870381+Omkar76@users.noreply.github.com> Date: Wed, 11 Oct 2023 08:33:15 +0530 Subject: [PATCH 1/4] Using the treeshakable api for echarts (#6424) --- .../Consultations/components/LinePlot.tsx | 33 +++++++++++++++++-- .../components/StackedLinePlot.tsx | 31 +++++++++++++++-- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/src/Components/Facility/Consultations/components/LinePlot.tsx b/src/Components/Facility/Consultations/components/LinePlot.tsx index 492f80f0388..92e3afcec61 100644 --- a/src/Components/Facility/Consultations/components/LinePlot.tsx +++ b/src/Components/Facility/Consultations/components/LinePlot.tsx @@ -1,4 +1,32 @@ -import ReactECharts from "echarts-for-react"; +import ReactEchartsCore from "echarts-for-react/lib/core"; +import { BarChart, LineChart } from "echarts/charts"; +import { + DataZoomComponent, + GridComponent, + LegendComponent, + TitleComponent, + ToolboxComponent, + TooltipComponent, + VisualMapComponent, + VisualMapPiecewiseComponent, +} from "echarts/components"; + +import * as echarts from "echarts/core"; +import { CanvasRenderer } from "echarts/renderers"; +echarts.use([ + BarChart, + LineChart, + CanvasRenderer, + DataZoomComponent, + GridComponent, + LegendComponent, + LegendComponent, + TitleComponent, + ToolboxComponent, + TooltipComponent, + VisualMapComponent, + VisualMapPiecewiseComponent, +]); export const LinePlot = (props: any) => { const { @@ -197,7 +225,8 @@ export const LinePlot = (props: any) => { } return ( - { @@ -81,5 +108,5 @@ export const StackedLinePlot = (props: any) => { }, series: series, }; - return ; + return ; }; From 6d1effce5513758c5ddb80a70e0a77eb98357944 Mon Sep 17 00:00:00 2001 From: Ashraf Mohammed <98876115+AshrafMd-1@users.noreply.github.com> Date: Wed, 11 Oct 2023 08:33:50 +0530 Subject: [PATCH 2/4] Set page title to medicine (#6431) --- .../Facility/ConsultationDetails/ConsultationMedicinesTab.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Components/Facility/ConsultationDetails/ConsultationMedicinesTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationMedicinesTab.tsx index 19810102833..0643765339f 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationMedicinesTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationMedicinesTab.tsx @@ -1,9 +1,12 @@ import { ConsultationTabProps } from "./index"; import PrescriptionAdministrationsTable from "../../Medicine/PrescriptionAdministrationsTable"; +import PageTitle from "../../Common/PageHeadTitle"; export const ConsultationMedicinesTab = (props: ConsultationTabProps) => { return (
+ {/* eslint-disable-next-line i18next/no-literal-string */} + Date: Wed, 11 Oct 2023 08:34:52 +0530 Subject: [PATCH 3/4] Track camera feed views and display offline status (#6408) --- src/Common/hooks/useMSEplayer.ts | 3 ++ .../Facility/Consultations/Feed.tsx | 30 ++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/Common/hooks/useMSEplayer.ts b/src/Common/hooks/useMSEplayer.ts index b14f94a6a43..fcbf216ed6a 100644 --- a/src/Common/hooks/useMSEplayer.ts +++ b/src/Common/hooks/useMSEplayer.ts @@ -208,6 +208,9 @@ export const useMSEMediaPlayer = ({ readPacket(event.data); } }; + ws.onerror = function (event) { + onError && onError(event); + }; }, false ); diff --git a/src/Components/Facility/Consultations/Feed.tsx b/src/Components/Facility/Consultations/Feed.tsx index 75ab72d168c..31691c736f4 100644 --- a/src/Components/Facility/Consultations/Feed.tsx +++ b/src/Components/Facility/Consultations/Feed.tsx @@ -32,6 +32,7 @@ import useKeyboardShortcut from "use-keyboard-shortcut"; import useFullscreen from "../../../Common/hooks/useFullscreen.js"; import { triggerGoal } from "../../../Integrations/Plausible.js"; import useAuthUser from "../../../Common/hooks/useAuthUser.js"; +import Spinner from "../../Common/Spinner.js"; interface IFeedProps { facilityId: string; @@ -57,6 +58,7 @@ export const Feed: React.FC = ({ consultationId, facilityId }) => { const [cameraState, setCameraState] = useState(null); const [isFullscreen, setFullscreen] = useFullscreen(); const [videoStartTime, setVideoStartTime] = useState(null); + const [statusReported, setStatusReported] = useState(false); const authUser = useAuthUser(); useEffect(() => { @@ -232,13 +234,32 @@ export const Feed: React.FC = ({ consultationId, facilityId }) => { useEffect(() => { let tId: any; if (streamStatus !== StreamStatus.Playing) { - setStreamStatus(StreamStatus.Loading); + if (streamStatus !== StreamStatus.Offline) { + setStreamStatus(StreamStatus.Loading); + } tId = setTimeout(() => { startStream({ onSuccess: () => setStreamStatus(StreamStatus.Playing), - onError: () => setStreamStatus(StreamStatus.Offline), + onError: () => { + setStreamStatus(StreamStatus.Offline); + if (!statusReported) { + triggerGoal("Camera Feed Viewed", { + consultationId, + userId: authUser.id, + result: "error", + }); + setStatusReported(true); + } + }, }); }, 100); + } else if (!statusReported) { + triggerGoal("Camera Feed Viewed", { + consultationId, + userId: authUser.id, + result: "success", + }); + setStatusReported(true); } return () => { @@ -505,8 +526,9 @@ export const Feed: React.FC = ({ consultationId, facilityId }) => { STATUS: OFFLINE

Feed is currently not live.

-

- Click refresh button to try again. +

Trying to connect...

+

+

)} From 31b530a0403cd2b3e4b83a5eb1c9fed50d2eb5d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 08:35:46 +0530 Subject: [PATCH 4/4] Bump react-player from 2.12.0 to 2.13.0 (#6317) Bumps [react-player](https://github.com/CookPete/react-player) from 2.12.0 to 2.13.0. - [Changelog](https://github.com/cookpete/react-player/blob/master/CHANGELOG.md) - [Commits](https://github.com/CookPete/react-player/compare/v2.12.0...v2.13.0) --- updated-dependencies: - dependency-name: react-player dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rithvik Nishad --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1fcda2c19ed..6697b3e7021 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "react-google-recaptcha": "^3.1.0", "react-i18next": "^13.0.1", "react-markdown": "^8.0.7", - "react-player": "^2.12.0", + "react-player": "^2.13.0", "react-qr-reader": "^2.2.1", "react-redux": "^8.1.1", "react-transition-group": "^4.4.5", @@ -18369,9 +18369,9 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" }, "node_modules/react-player": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/react-player/-/react-player-2.12.0.tgz", - "integrity": "sha512-rymLRz/2GJJD+Wc01S7S+i9pGMFYnNmQibR2gVE3KmHJCBNN8BhPAlOPTGZtn1uKpJ6p4RPLlzPQ1OLreXd8gw==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/react-player/-/react-player-2.13.0.tgz", + "integrity": "sha512-gkY7ZdbVFztlKFFhCPcnDrFQm+L399b8fhWsKatZ+b2wpKJwfUHBXQFMRxqYQGT0ic1/wQ7D7EZEWy7ZBqk2pw==", "dependencies": { "deepmerge": "^4.0.0", "load-script": "^1.0.0", diff --git a/package.json b/package.json index c9a9e80258c..6114fdf7496 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "react-google-recaptcha": "^3.1.0", "react-i18next": "^13.0.1", "react-markdown": "^8.0.7", - "react-player": "^2.12.0", + "react-player": "^2.13.0", "react-qr-reader": "^2.2.1", "react-redux": "^8.1.1", "react-transition-group": "^4.4.5",