Skip to content

Commit

Permalink
Merge Conflict's fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidSumra committed Oct 22, 2024
2 parents e0d75dd + 30ae500 commit 00963b2
Show file tree
Hide file tree
Showing 36 changed files with 1,358 additions and 1,284 deletions.
2 changes: 1 addition & 1 deletion .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ REACT_OHCN_URL=
# Plausible site domain (default: care.ohc.network)
REACT_PLAUSIBLE_SITE_DOMAIN=

# Plausible server URL (default: https://plausible.10bedicu.in)
# Plausible server URL (default: https://plausible.ohc.network)
REACT_PLAUSIBLE_SERVER_URL=

# Care Apps. repo@branch seperated by commas
Expand Down
2 changes: 1 addition & 1 deletion care.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const careConfig = {
// Plugins related configs...

plausible: {
server: env.REACT_PLAUSIBLE_SERVER_URL || "https://plausible.10bedicu.in",
server: env.REACT_PLAUSIBLE_SERVER_URL || "https://plausible.ohc.network",
domain: env.REACT_PLAUSIBLE_SITE_DOMAIN || "care.ohc.network",
},

Expand Down
12 changes: 6 additions & 6 deletions cypress/pageobject/Facility/FacilityManage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class FacilityManage {
clickCoverImage() {
cy.get("#facility-coverimage").click({ force: true });
cy.get("#facility-coverimage").click();
}

verifyUploadButtonVisible() {
Expand All @@ -13,6 +13,11 @@ class FacilityManage {
.wait(100); // Adjust the wait time as needed
}

clickSaveCoverImage() {
cy.get("#save-cover-image").scrollIntoView();
cy.get("#save-cover-image").click();
}

verifyTotalDoctorCapacity(expectedCapacity: string) {
cy.get("#facility-doctor-totalcapacity").contains(expectedCapacity);
}
Expand All @@ -37,11 +42,6 @@ class FacilityManage {
cy.get("#delete-facility-bedcapacity").click();
}

clickSaveCoverImage() {
cy.get("#save-cover-image").scrollIntoView();
cy.get("#save-cover-image").click();
}

clickFacilityConfigureButton() {
cy.get("#configure-facility").should("be.visible");
cy.get("#configure-facility").click();
Expand Down
4 changes: 2 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ X-Frame-Options = "DENY"
X-Content-Type-Options = "nosniff"
Content-Security-Policy-Report-Only = '''
default-src 'self';
script-src 'self' 'nonce-f51b9742' https://plausible.10bedicu.in;
script-src 'self' 'nonce-f51b9742' https://plausible.ohc.network;
style-src 'self' 'unsafe-inline';
connect-src 'self' https://plausible.10bedicu.in;
connect-src 'self' https://plausible.ohc.network;
img-src 'self' https://cdn.ohc.network https://egov-s3-facility-10bedicu.s3.amazonaws.com https://egov-s3-patient-data-10bedicu.s3.amazonaws.com;
object-src 'self' https://egov-s3-facility-10bedicu.s3.amazonaws.com https://egov-s3-patient-data-10bedicu.s3.amazonaws.com;
report-uri https://csp-logger.ohc.network/
Expand Down
1 change: 1 addition & 0 deletions src/Common/hooks/useAuthUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type AuthContextType = {
user: UserModel | undefined;
signIn: (creds: LoginCredentials) => Promise<SignInReturnType>;
signOut: () => Promise<void>;
refetchUser: () => Promise<RequestResult<UserModel>>;
};

export const AuthUserContext = createContext<AuthContextType | null>(null);
Expand Down
24 changes: 14 additions & 10 deletions src/Components/CameraFeed/CameraFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import useFullscreen from "../../Common/hooks/useFullscreen";
import useBreakpoints from "../../Common/hooks/useBreakpoints";
import { GetPresetsResponse } from "./routes";
import VideoPlayer from "./videoPlayer";
import MonitorAssetPopover from "../Common/MonitorAssetPopover";
import AssetInfoPopover from "../Common/AssetInfoPopover";

interface Props {
children?: React.ReactNode;
Expand All @@ -28,6 +28,7 @@ interface Props {
shortcutsDisabled?: boolean;
onMove?: () => void;
operate: ReturnType<typeof useOperateCamera>["operate"];
hideAssetInfo?: boolean;
}

export default function CameraFeed(props: Props) {
Expand Down Expand Up @@ -183,15 +184,18 @@ export default function CameraFeed(props: Props) {
{props.children}
</div>
<div className="flex w-full flex-col items-end justify-end md:flex-row md:items-center md:gap-4">
<div className="flex items-center gap-2">
<span className="text-xs font-bold md:text-sm">
{props.asset.name}
</span>
<MonitorAssetPopover
asset={props.asset}
className="absolute z-[100] mt-2 w-56 -translate-x-full -translate-y-4 rounded-md bg-white md:w-[350px] md:-translate-x-full md:-translate-y-2"
/>
</div>
{!props.hideAssetInfo && (
<div className="flex items-center gap-2">
<span className="text-xs font-bold md:text-sm">
{props.asset.name}
</span>
<AssetInfoPopover
asset={props.asset}
className="absolute z-[100] mt-2 w-56 -translate-x-full -translate-y-4 rounded-md bg-white md:w-[350px] md:-translate-x-full md:-translate-y-2"
/>
</div>
)}

{!isIOS && (
<div
className={classNames(
Expand Down
8 changes: 7 additions & 1 deletion src/Components/CameraFeed/ConfigureCamera.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ export default function ConfigureCamera(props: Props) {
if (!["DistrictAdmin", "StateAdmin"].includes(authUser.user_type)) {
return (
<div className="w-full overflow-hidden rounded-lg bg-white shadow">
<CameraFeed asset={props.asset} key={key} operate={operate} />
<CameraFeed
asset={props.asset}
key={key}
operate={operate}
hideAssetInfo
/>
</div>
);
}
Expand Down Expand Up @@ -246,6 +251,7 @@ export default function ConfigureCamera(props: Props) {
);
}
}}
hideAssetInfo
>
<div className="flex items-center gap-2">
<Listbox
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import CareIcon from "../../CAREUI/icons/CareIcon";
import { AssetData, assetClassProps } from "../Assets/AssetTypes";
import ButtonV2 from "../Common/components/ButtonV2";
import ButtonV2 from "./components/ButtonV2";
import { navigate } from "raviger";
import { useTranslation } from "react-i18next";
import {
Expand All @@ -10,15 +10,12 @@ import {
Transition,
} from "@headlessui/react";

interface MonitorAssetPopoverProps {
interface AssetInfoPopoverProps {
asset?: AssetData;
className?: string;
}

const MonitorAssetPopover = ({
asset,
className,
}: MonitorAssetPopoverProps) => {
const AssetInfoPopover = ({ asset, className }: AssetInfoPopoverProps) => {
const { t } = useTranslation();

return (
Expand Down Expand Up @@ -87,4 +84,4 @@ const MonitorAssetPopover = ({
);
};

export default MonitorAssetPopover;
export default AssetInfoPopover;
45 changes: 24 additions & 21 deletions src/Components/Common/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cn } from "@/lib/utils";
import React, { useEffect, useRef, useState } from "react";
import React from "react";

const colors: string[] = [
"#E6F3FF", // Light Blue
Expand Down Expand Up @@ -56,44 +56,47 @@ const Avatar: React.FC<AvatarProps> = ({
className,
}) => {
const [bgColor] = propColors || toColor(name);
const [width, setWidth] = useState(0);
const avatarRef = useRef<HTMLDivElement>(null);

useEffect(() => {
const updateWidth = () => {
const avatarRect = avatarRef.current?.getBoundingClientRect();
const width = avatarRect?.width || 0;
setWidth(width);
};
updateWidth();
document.addEventListener("resize", updateWidth);
return () => document.removeEventListener("resize", updateWidth);
}, []);

return (
<div
ref={avatarRef}
className={cn(
`flex aspect-square w-full items-center justify-center overflow-hidden border border-black/10 font-black text-black/10`,
`flex aspect-square w-full items-center justify-center overflow-hidden border border-black/10`,
className,
)}
style={{
background: bgColor,
borderRadius: width / 15 + "px",
fontSize: width / 2.5 + "px",
borderRadius: "calc(100% / 15)",
}}
>
{imageUrl ? (
<img
src={imageUrl}
alt={name}
className="aspect-square w-full object-cover"
className="aspect-square h-full w-full object-cover"
/>
) : (
<div>{initials(name)}</div>
<svg
xmlns="http://www.w3.org/2000/svg"
version="1.1"
viewBox="0 0 100 100"
>
<text
fill="black"
fillOpacity="0.1"
fontSize="40"
fontWeight="900"
x="50"
y="54"
textAnchor="middle"
dominantBaseline="middle"
alignmentBaseline="middle"
>
{initials(name)}
</text>
</svg>
)}
</div>
);
};

export { Avatar };
export type { AvatarProps };
Loading

0 comments on commit 00963b2

Please sign in to comment.