From 7a04b8ad9900649168cf80c62c359cc6ae093295 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 16 Nov 2024 02:48:13 +0530 Subject: [PATCH 01/12] updated sample test details form ui --- src/components/Patient/SampleDetails.tsx | 294 +++++++++++++---------- 1 file changed, 172 insertions(+), 122 deletions(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index c556177ec13..10e1fd629e7 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -3,6 +3,10 @@ import { navigate } from "raviger"; import Card from "@/CAREUI/display/Card"; +import { Badge } from "@/components/ui/badge"; +import { CardContent, CardHeader } from "@/components/ui/card"; +import { Separator } from "@/components/ui/separator"; + import ButtonV2 from "@/components/Common/ButtonV2"; import Loading from "@/components/Common/Loading"; import Page from "@/components/Common/Page"; @@ -285,142 +289,188 @@ export const SampleDetails = ({ id }: DetailRoute) => { ) } > - -
-
- - Status:{" "} - - {sampleDetails?.status} -
-
- - Result:{" "} - - {sampleDetails?.result} -
-
- Patient: - {sampleDetails?.patient_name} -
- {sampleDetails?.facility_object && ( -
- Facility: - {sampleDetails?.facility_object.name} + + +
+
+
Status:
+ + {sampleDetails?.status} + +
+
+
Result:
+ + {sampleDetails?.result} +
- )} -
- Tested on: - {sampleDetails?.date_of_result - ? formatDateTime(sampleDetails.date_of_result) - : "-"} -
-
- Result on: - {sampleDetails?.date_of_result - ? formatDateTime(sampleDetails.date_of_result) - : "-"}
- {sampleDetails?.fast_track && ( -
- - Fast track testing reason:{" "} - - {sampleDetails.fast_track} + + +
+
+
Patient:
+
{sampleDetails?.patient_name}
- )} - {sampleDetails?.doctor_name && ( -
- - Doctor's Name:{" "} - - {startCase(camelCase(sampleDetails.doctor_name))} + {sampleDetails?.facility_object && ( +
+
Facility:
+
+ {sampleDetails?.facility_object.name} +
+
+ )} +
+
Tested on:
+
+ {sampleDetails?.date_of_result + ? formatDateTime(sampleDetails.date_of_result) + : "-"} +
- )} - {sampleDetails?.diagnosis && ( -
- Diagnosis: - {sampleDetails.diagnosis} +
+
Result on:
+
+ {sampleDetails?.date_of_result + ? formatDateTime(sampleDetails.date_of_result) + : "-"} +
- )} - {sampleDetails?.diff_diagnosis && ( -
- - Differential diagnosis:{" "} - - {sampleDetails?.diff_diagnosis} +
+ + {sampleDetails?.doctor_name && ( +
+
+ Doctor's Name: +
+
+ {startCase(camelCase(sampleDetails.doctor_name))} +
)} - {sampleDetails?.etiology_identified && ( -
- - Etiology identified:{" "} - - {sampleDetails.etiology_identified} + +
+ {sampleDetails?.fast_track && ( +
+
+ Fast track testing reason:{" "} +
+ {sampleDetails.fast_track} +
+ )} + {sampleDetails?.diagnosis && ( +
+
Diagnosis:
+ {sampleDetails.diagnosis} +
+ )} + {sampleDetails?.diff_diagnosis && ( +
+
+ Differential diagnosis:{" "} +
+ + {" "} + {sampleDetails?.diff_diagnosis} + +
+ )} + {sampleDetails?.etiology_identified && ( +
+
Etiology identified:
+ + {" "} + {sampleDetails.etiology_identified} + +
+ )} +
+
+ Is Atypical presentation{" "} +
+ + {" "} + {yesOrNoBadge(sampleDetails?.is_atypical_presentation)} +
- )} -
- - Is Atypical presentation{" "} - - {yesOrNoBadge(sampleDetails?.is_atypical_presentation)} -
-
- - Is unusual course{" "} - - {yesOrNoBadge(sampleDetails?.is_unusual_course)} -
- {sampleDetails?.atypical_presentation && ( -
- - Atypical presentation details:{" "} - - {sampleDetails.atypical_presentation} +
+
Is unusual course
+ + {" "} + {yesOrNoBadge(sampleDetails?.is_unusual_course)} +
- )} -
- - SARI - Severe Acute Respiratory illness{" "} - - {yesOrNoBadge(sampleDetails?.has_sari)} -
-
- - ARI - Acute Respiratory illness{" "} - - {yesOrNoBadge(sampleDetails?.has_ari)} -
-
- - Contact with confirmed carrier{" "} - - {yesOrNoBadge(sampleDetails?.patient_has_confirmed_contact)} -
-
- - Contact with suspected carrier{" "} - - {yesOrNoBadge(sampleDetails?.patient_has_suspected_contact)} -
- {sampleDetails?.patient_travel_history && - sampleDetails.patient_travel_history.length !== 0 && ( -
- - Countries travelled:{" "} - - {sampleDetails.patient_travel_history} + {sampleDetails?.atypical_presentation && ( +
+
+ Atypical presentation details:{" "} +
+ + {" "} + {sampleDetails.atypical_presentation} +
)} +
+
+ SARI - Severe Acute Respiratory illness{" "} +
+ + {" "} + {yesOrNoBadge(sampleDetails?.has_sari)} + +
+
+
+ ARI - Acute Respiratory illness{" "} +
+ + {" "} + {yesOrNoBadge(sampleDetails?.has_ari)} + +
+
+
+ Contact with confirmed carrier{" "} +
+ + {" "} + {yesOrNoBadge(sampleDetails?.patient_has_confirmed_contact)} + +
+
+
+ Contact with suspected carrier{" "} +
+ + {" "} + {yesOrNoBadge(sampleDetails?.patient_has_suspected_contact)} + +
+ {sampleDetails?.patient_travel_history && + sampleDetails.patient_travel_history.length !== 0 && ( +
+
+ Countries travelled:{" "} +
+ + {" "} + {sampleDetails.patient_travel_history} + +
+ )} +
+ {sampleDetails?.sample_type && ( -
- - Sample Type:{" "} - - {startCase(camelCase(sampleDetails.sample_type))} +
+
Sample Type:
+
+ {" "} + {startCase(camelCase(sampleDetails.sample_type))} +
)} -
+
From 55de901918e51d97081349665291ebd42369fee2 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 16 Nov 2024 02:49:09 +0530 Subject: [PATCH 02/12] shadcn components added --- src/components/ui/badge.tsx | 38 +++++++++++++++ src/components/ui/card.tsx | 83 +++++++++++++++++++++++++++++++++ src/components/ui/separator.tsx | 29 ++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 src/components/ui/badge.tsx create mode 100644 src/components/ui/card.tsx create mode 100644 src/components/ui/separator.tsx diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx new file mode 100644 index 00000000000..8c751875222 --- /dev/null +++ b/src/components/ui/badge.tsx @@ -0,0 +1,38 @@ +import { type VariantProps, cva } from "class-variance-authority"; +import * as React from "react"; + +import { cn } from "@/lib/utils"; + +const badgeVariants = cva( + "inline-flex items-center rounded-md border border-gray-200 px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-gray-950 focus:ring-offset-2 dark:border-gray-800 dark:focus:ring-gray-300", + { + variants: { + variant: { + default: + "border-transparent bg-gray-900 text-gray-50 shadow hover:bg-gray-900/80 dark:bg-gray-50 dark:text-gray-900 dark:hover:bg-gray-50/80", + secondary: + "border-transparent bg-gray-100 text-gray-900 hover:bg-gray-100/80 dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-800/80", + destructive: + "border-transparent bg-red-500 text-gray-50 shadow hover:bg-red-500/80 dark:bg-red-900 dark:text-gray-50 dark:hover:bg-red-900/80", + warning: + "border-transparent bg-yellow-400 text-gray-900 shadow hover:bg-yellow-500 dark:bg-yellow-400 dark:text-gray-900 dark:hover:bg-yellow-500", + outline: "text-gray-950 dark:text-gray-50", + }, + }, + defaultVariants: { + variant: "default", + }, + }, +); + +export interface BadgeProps + extends React.HTMLAttributes, + VariantProps {} + +function Badge({ className, variant, ...props }: BadgeProps) { + return ( +
+ ); +} + +export { Badge, badgeVariants }; diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx new file mode 100644 index 00000000000..69acc1bc3b5 --- /dev/null +++ b/src/components/ui/card.tsx @@ -0,0 +1,83 @@ +import * as React from "react"; + +import { cn } from "@/lib/utils"; + +const Card = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +Card.displayName = "Card"; + +const CardHeader = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +CardHeader.displayName = "CardHeader"; + +const CardTitle = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +CardTitle.displayName = "CardTitle"; + +const CardDescription = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +CardDescription.displayName = "CardDescription"; + +const CardContent = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +CardContent.displayName = "CardContent"; + +const CardFooter = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)); +CardFooter.displayName = "CardFooter"; + +export { + Card, + CardHeader, + CardFooter, + CardTitle, + CardDescription, + CardContent, +}; diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx new file mode 100644 index 00000000000..e2a4ee2a76d --- /dev/null +++ b/src/components/ui/separator.tsx @@ -0,0 +1,29 @@ +import * as SeparatorPrimitive from "@radix-ui/react-separator"; +import * as React from "react"; + +import { cn } from "@/lib/utils"; + +const Separator = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>( + ( + { className, orientation = "horizontal", decorative = true, ...props }, + ref, + ) => ( + + ), +); +Separator.displayName = SeparatorPrimitive.Root.displayName; + +export { Separator }; From 06668cbaa26fd992605a3142728acabca0367212 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 16 Nov 2024 03:25:15 +0530 Subject: [PATCH 03/12] rollup issue solved @radix-ui/react-separator --- vite.config.mts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vite.config.mts b/vite.config.mts index 3f6df95c290..41752db096f 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -167,13 +167,17 @@ export default defineConfig(({ mode }) => { }, }, optimizeDeps: { - include: getPluginDependencies(), + include: [ + ...getPluginDependencies(), + "@radix-ui/react-separator", + ], }, build: { outDir: "build", assetsDir: "bundle", sourcemap: true, rollupOptions: { + external: ["@radix-ui/react-separator"], output: { manualChunks(id, { getModuleInfo }) { if (id.includes("node_modules")) { From 787bb439edc82cb66a65d5445ec6aa575e5a03c4 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 16 Nov 2024 03:36:35 +0530 Subject: [PATCH 04/12] rollup issue solved tsconfig.json --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 51ffeb4a0ae..efa388fe849 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,6 +25,6 @@ "@careConfig": ["./care.config.ts"] } }, - "include": ["src/**/*", "apps/**/*", "care.config.ts"], + "include": ["src/**/*", "apps/**/*", "care.config.ts", "src/@types" ], "exclude": ["src/**/*.gen.tsx"] } From 54685a4bce8002ac5e979c258eb92cb686cc92a1 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sun, 17 Nov 2024 08:27:02 +0530 Subject: [PATCH 05/12] badge shadcn component coderabbitai suggestion --- src/components/ui/badge.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx index 8c751875222..99b8f3bbda4 100644 --- a/src/components/ui/badge.tsx +++ b/src/components/ui/badge.tsx @@ -31,7 +31,12 @@ export interface BadgeProps function Badge({ className, variant, ...props }: BadgeProps) { return ( -
+
); } From df0009347765ccc0f326475e788e443f33338c29 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Mon, 18 Nov 2024 01:58:46 +0530 Subject: [PATCH 06/12] try to solve deploy issue --- tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index efa388fe849..ad5d4507ed8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,7 +22,8 @@ "@core/*": ["src/*"], "@apps/*": ["apps/*/src"], "@app-manifest/*": ["apps/*/src/manifest.ts"], - "@careConfig": ["./care.config.ts"] + "@careConfig": ["./care.config.ts"], + "@radix-ui/react-separator": ["node_modules/@radix-ui/react-separator"] } }, "include": ["src/**/*", "apps/**/*", "care.config.ts", "src/@types" ], From abb33c5db2339801d7ecf1bb8004b2808ef326a2 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 23 Nov 2024 20:56:31 +0530 Subject: [PATCH 07/12] coderabbitai suggestion on vite.config.mts --- vite.config.mts | 1 - 1 file changed, 1 deletion(-) diff --git a/vite.config.mts b/vite.config.mts index 41752db096f..0499003e57d 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -177,7 +177,6 @@ export default defineConfig(({ mode }) => { assetsDir: "bundle", sourcemap: true, rollupOptions: { - external: ["@radix-ui/react-separator"], output: { manualChunks(id, { getModuleInfo }) { if (id.includes("node_modules")) { From 443d4b5e5cced9147b247736bd93ffad45e5b8c5 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 23 Nov 2024 21:06:21 +0530 Subject: [PATCH 08/12] seperator updated to solve deploy issue --- src/components/Patient/SampleDetails.tsx | 2 +- src/components/ui/separator.tsx | 32 +++--------------------- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 10e1fd629e7..0743ff287be 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -5,7 +5,7 @@ import Card from "@/CAREUI/display/Card"; import { Badge } from "@/components/ui/badge"; import { CardContent, CardHeader } from "@/components/ui/card"; -import { Separator } from "@/components/ui/separator"; +import Separator from "@/components/ui/separator"; import ButtonV2 from "@/components/Common/ButtonV2"; import Loading from "@/components/Common/Loading"; diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx index e2a4ee2a76d..de11e1ea4b4 100644 --- a/src/components/ui/separator.tsx +++ b/src/components/ui/separator.tsx @@ -1,29 +1,3 @@ -import * as SeparatorPrimitive from "@radix-ui/react-separator"; -import * as React from "react"; - -import { cn } from "@/lib/utils"; - -const Separator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->( - ( - { className, orientation = "horizontal", decorative = true, ...props }, - ref, - ) => ( - - ), -); -Separator.displayName = SeparatorPrimitive.Root.displayName; - -export { Separator }; +export default function Separator() { + return
; +} \ No newline at end of file From 8b2bc4ac651d00e6d7f9374442ef31f0fd6bba54 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 23 Nov 2024 21:14:24 +0530 Subject: [PATCH 09/12] removed @radix-ui/react-separator --- vite.config.mts | 1 - 1 file changed, 1 deletion(-) diff --git a/vite.config.mts b/vite.config.mts index 0499003e57d..400372d8256 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -169,7 +169,6 @@ export default defineConfig(({ mode }) => { optimizeDeps: { include: [ ...getPluginDependencies(), - "@radix-ui/react-separator", ], }, build: { From 8c0b3b15022ce45ac4e2a3434894a5ad0d3e101a Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 23 Nov 2024 22:13:11 +0530 Subject: [PATCH 10/12] coderabbitai suggestion updation --- src/components/Patient/SampleDetails.tsx | 2 +- src/components/ui/card.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 0743ff287be..70507a91f68 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -5,7 +5,7 @@ import Card from "@/CAREUI/display/Card"; import { Badge } from "@/components/ui/badge"; import { CardContent, CardHeader } from "@/components/ui/card"; -import Separator from "@/components/ui/separator"; +import Separator from "@/components/ui/separator"; import ButtonV2 from "@/components/Common/ButtonV2"; import Loading from "@/components/Common/Loading"; diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx index 69acc1bc3b5..c4d29177ab3 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/card.tsx @@ -3,10 +3,10 @@ import * as React from "react"; import { cn } from "@/lib/utils"; const Card = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes + HTMLHeadingElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -
Date: Sat, 23 Nov 2024 22:48:53 +0530 Subject: [PATCH 11/12] coderabbitai suggestion card CardTitle --- src/components/ui/card.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx index c4d29177ab3..67181fac8e0 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/card.tsx @@ -3,10 +3,10 @@ import * as React from "react"; import { cn } from "@/lib/utils"; const Card = React.forwardRef< - HTMLHeadingElement, - React.HTMLAttributes + HTMLDivElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -

+ HTMLHeadingElement, + React.HTMLAttributes >(({ className, ...props }, ref) => ( -
)); From 4733920d22f6ee36d94ff04cb5cf036f0ecf4791 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 23 Nov 2024 23:08:14 +0530 Subject: [PATCH 12/12] Remove invalid ARIA attribute. --- src/components/ui/card.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsx index 67181fac8e0..7bd9ebdb3d3 100644 --- a/src/components/ui/card.tsx +++ b/src/components/ui/card.tsx @@ -36,7 +36,6 @@ const CardTitle = React.forwardRef<

));