Skip to content

Commit

Permalink
Merge branch 'develop' into issues/8624-facilitySpoke
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacobjeevan committed Oct 7, 2024
2 parents 52fdf18 + 8e6a2f2 commit 5a7a1f9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
12 changes: 8 additions & 4 deletions src/Components/Assets/AssetType/ONVIFCamera.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import routes from "../../../Redux/api";
import useQuery from "../../../Utils/request/useQuery";

import CareIcon from "../../../CAREUI/icons/CareIcon";
import useOperateCamera from "../../CameraFeed/useOperateCamera";
import useOperateCamera, {
PTZPayload,
} from "../../CameraFeed/useOperateCamera";

interface Props {
assetId: string;
Expand Down Expand Up @@ -95,18 +97,20 @@ const ONVIFCamera = ({ assetId, facilityId, asset, onUpdated }: Props) => {

const addPreset = async (e: SyntheticEvent) => {
e.preventDefault();
const data = {
const meta = {
bed_id: bed.id,
preset_name: newPreset,
};
try {
setLoadingAddPreset(true);

const { data: presetData } = await operate({ type: "get_status" });
const { data } = await operate({ type: "get_status" });
const { position } = (data as { result: { position: PTZPayload } })
.result;

const { res } = await request(routes.createAssetBed, {
body: {
meta: { ...data, ...presetData },
meta: { ...meta, position },
asset: assetId,
bed: bed?.id as string,
},
Expand Down
5 changes: 4 additions & 1 deletion src/Components/Common/BloodPressureFormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export default function BloodPressureFormField(props: Props) {
const map = meanArterialPressure(props.value)?.toFixed();

const handleChange = (event: FieldChangeEvent<number>) => {
const bp = field.value ?? {};
const bp = {
systolic: field.value?.systolic,
diastolic: field.value?.diastolic,
};
bp[event.name as keyof BloodPressure] = event.value;
field.handleChange(Object.values(bp).filter(Boolean).length ? bp : null);
};
Expand Down
9 changes: 5 additions & 4 deletions src/Components/Facility/FacilityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
)}
</Link>

<div className="flex h-fit w-full flex-col flex-wrap justify-between md:h-full">
<div className="mx-auto flex h-fit w-full max-w-full flex-col flex-wrap justify-between md:h-full lg:max-w-3xl">
<div className="w-full p-4">
<div className="flex gap-5">
<div className="flex flex-col gap-5 sm:flex-row">
<Link
href={`/facility/${facility.id}`}
className="group relative z-0 hidden h-[150px] min-h-[150px] w-[150px] min-w-[150px] items-center justify-center self-stretch rounded-md bg-secondary-300 min-[425px]:flex"
className="group relative z-0 hidden h-[150px] min-h-[150px] w-[150px] min-w-[150px] items-center justify-center rounded-md bg-secondary-300 sm:flex"
>
{(facility.read_cover_image_url && (
<img
Expand All @@ -100,7 +100,7 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
>
<Link
href={`/facility/${facility.id}`}
className="float-left text-xl font-bold capitalize text-inherit hover:text-inherit"
className="text-xl font-bold capitalize text-inherit hover:text-inherit"
>
{facility.name}
</Link>
Expand All @@ -109,6 +109,7 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
href={`/facility/${facility.id}/cns`}
border
ghost
className="mt-2 sm:mt-0"
>
<CareIcon
icon="l-monitor-heart-rate"
Expand Down
2 changes: 1 addition & 1 deletion src/Components/LogUpdate/Sections/Vitals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const BPAttributeEditor = ({
name={attribute}
label={t(attribute)}
onChange={(event) => {
const bp = log.bp ?? {};
const bp = { systolic: log.bp?.systolic, diastolic: log.bp?.diastolic };
bp[event.name as keyof BloodPressure] = event.value;
onChange({
bp: Object.values(bp).filter(Boolean).length ? bp : undefined,
Expand Down

0 comments on commit 5a7a1f9

Please sign in to comment.