From 7a04b8ad9900649168cf80c62c359cc6ae093295 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 16 Nov 2024 02:48:13 +0530 Subject: [PATCH 01/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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/38] 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<

)); From e32e0e11a69dfacc90f6c63598dde39050464737 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Mon, 25 Nov 2024 01:42:28 +0530 Subject: [PATCH 13/38] remove unwanted code --- tsconfig.json | 5 ++--- vite.config.mts | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index ad5d4507ed8..cab2bfbcc30 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,10 +22,9 @@ "@core/*": ["src/*"], "@apps/*": ["apps/*/src"], "@app-manifest/*": ["apps/*/src/manifest.ts"], - "@careConfig": ["./care.config.ts"], - "@radix-ui/react-separator": ["node_modules/@radix-ui/react-separator"] + "@careConfig": ["./care.config.ts"] } }, - "include": ["src/**/*", "apps/**/*", "care.config.ts", "src/@types" ], + "include": ["src/**/*", "apps/**/*", "care.config.ts" ], "exclude": ["src/**/*.gen.tsx"] } diff --git a/vite.config.mts b/vite.config.mts index 400372d8256..3f6df95c290 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -167,9 +167,7 @@ export default defineConfig(({ mode }) => { }, }, optimizeDeps: { - include: [ - ...getPluginDependencies(), - ], + include: getPluginDependencies(), }, build: { outDir: "build", From e714f7b47e236c9c0e7b8034d48d980675c91592 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Wed, 27 Nov 2024 00:33:47 +0530 Subject: [PATCH 14/38] retain older code --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index cab2bfbcc30..51ffeb4a0ae 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"], "exclude": ["src/**/*.gen.tsx"] } From 87e56c4d2d60cdc329205856232fe48383327f95 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Wed, 27 Nov 2024 00:59:56 +0530 Subject: [PATCH 15/38] lint issue solved --- src/components/ui/separator.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx index de11e1ea4b4..a7f18fff5a6 100644 --- a/src/components/ui/separator.tsx +++ b/src/components/ui/separator.tsx @@ -1,3 +1,3 @@ export default function Separator() { return
; -} \ No newline at end of file +} From 34a66daa9349ec1f8ce7478b5c564550c881f7de Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Wed, 27 Nov 2024 01:15:45 +0530 Subject: [PATCH 16/38] cypress test --- src/components/Patient/SampleDetails.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 505f082df1c..191de392460 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -318,6 +318,7 @@ export const SampleDetails = ({ id }: DetailRoute) => { } > + {/* Card */}
From 14b177a041accabe9e0ba969e5979c0c42c54880 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Wed, 27 Nov 2024 08:04:30 +0530 Subject: [PATCH 17/38] removed text --- src/components/Patient/SampleDetails.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 191de392460..505f082df1c 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -318,7 +318,6 @@ export const SampleDetails = ({ id }: DetailRoute) => { } > - {/* Card */}
From 25a2ec2a552c74d1cd97c3603a6ecc240792e6db Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Fri, 29 Nov 2024 00:33:56 +0530 Subject: [PATCH 18/38] removed custom seperator component --- src/components/Patient/SampleDetails.tsx | 5 ++--- src/components/ui/separator.tsx | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 src/components/ui/separator.tsx diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 505f082df1c..92196c3c26e 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -6,7 +6,6 @@ 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"; @@ -376,7 +375,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
)} - +
{sampleDetails?.fast_track && (
@@ -488,7 +487,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
)}
- +
{sampleDetails?.sample_type && (
Sample Type:
diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx deleted file mode 100644 index a7f18fff5a6..00000000000 --- a/src/components/ui/separator.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function Separator() { - return
; -} From f184969933e6722049f02b0db3ccd1b6180704f8 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Fri, 29 Nov 2024 00:50:56 +0530 Subject: [PATCH 19/38] cypress-run (4) failing issue --- src/components/Patient/SampleDetails.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 92196c3c26e..e6294ecdb9b 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -337,7 +337,8 @@ export const SampleDetails = ({ id }: DetailRoute) => {
Patient:
-
{sampleDetails?.patient_name}
+ {/*
{sampleDetails?.patient_name}
*/} +
TestName
{sampleDetails?.facility_object && (
From f3eac8117b6b6943d456e877afe333a5221b6797 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Fri, 29 Nov 2024 01:05:32 +0530 Subject: [PATCH 20/38] try to solve Cypress test --- src/components/Patient/SampleDetails.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index e6294ecdb9b..167bf0e3a68 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -337,8 +337,9 @@ export const SampleDetails = ({ id }: DetailRoute) => {
Patient:
- {/*
{sampleDetails?.patient_name}
*/} -
TestName
+
+ {sampleDetails?.patient_name || "-"} +
{sampleDetails?.facility_object && (
From 2db902a887cf04a335b0f7a60debed06e87939c1 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 20:44:52 +0530 Subject: [PATCH 21/38] cypress test fail --- src/components/Patient/SampleDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 5d6a1bb1112..bed773dd45d 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -338,7 +338,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
Patient:
-
+
{sampleDetails?.patient_name || "-"}
From a19072c9ac69f388f5793bbf91af35e5fba7825b Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 21:12:22 +0530 Subject: [PATCH 22/38] cypress test fail 1 --- src/components/Patient/SampleDetails.tsx | 51 +++++++++++++++--------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index bed773dd45d..076b8e919e0 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -337,21 +337,27 @@ export const SampleDetails = ({ id }: DetailRoute) => {
-
Patient:
+
+ {t("Patient")}: +
{sampleDetails?.patient_name || "-"}
{sampleDetails?.facility_object && (
-
Facility:
+
+ {t("Facility")}: +
{sampleDetails?.facility_object.name}
)}
-
Tested on:
+
+ {t("Tested on")}: +
{sampleDetails?.date_of_result ? formatDateTime(sampleDetails.date_of_result) @@ -359,7 +365,9 @@ export const SampleDetails = ({ id }: DetailRoute) => {
-
Result on:
+
+ {t("Result on")}: +
{sampleDetails?.date_of_result ? formatDateTime(sampleDetails.date_of_result) @@ -371,7 +379,7 @@ export const SampleDetails = ({ id }: DetailRoute) => { {sampleDetails?.doctor_name && (
- Doctor's Name: + {t("Doctor's Name")}:
{startCase(camelCase(sampleDetails.doctor_name))} @@ -383,21 +391,21 @@ export const SampleDetails = ({ id }: DetailRoute) => { {sampleDetails?.fast_track && (
- Fast track testing reason:{" "} + {t("fast_track_testing_reason")}:{" "}
{sampleDetails.fast_track}
)} {sampleDetails?.diagnosis && (
-
Diagnosis:
+
{t("diagnosis")}:
{sampleDetails.diagnosis}
)} {sampleDetails?.diff_diagnosis && (
- Differential diagnosis:{" "} + {t("differential_diagnosis")}:{" "}
{" "} @@ -407,7 +415,9 @@ export const SampleDetails = ({ id }: DetailRoute) => { )} {sampleDetails?.etiology_identified && (
-
Etiology identified:
+
+ {t("Etiology identified")}:{" "} +
{" "} {sampleDetails.etiology_identified} @@ -416,7 +426,7 @@ export const SampleDetails = ({ id }: DetailRoute) => { )}
- Is Atypical presentation{" "} + {t("Is Atypical presentation")}
{" "} @@ -424,7 +434,9 @@ export const SampleDetails = ({ id }: DetailRoute) => {
-
Is unusual course
+
+ {t("Is unusual course")} +
{" "} {yesOrNoBadge(sampleDetails?.is_unusual_course)} @@ -433,7 +445,7 @@ export const SampleDetails = ({ id }: DetailRoute) => { {sampleDetails?.atypical_presentation && (
- Atypical presentation details:{" "} + {t("Atypical presentation details")}:{" "}
{" "} @@ -443,7 +455,7 @@ export const SampleDetails = ({ id }: DetailRoute) => { )}
- SARI - Severe Acute Respiratory illness{" "} + {t("SARI - Severe Acute Respiratory illness")}{" "}
{" "} @@ -452,7 +464,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
- ARI - Acute Respiratory illness{" "} + {t("ARI - Acute Respiratory illness")}{" "}
{" "} @@ -461,7 +473,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
- Contact with confirmed carrier{" "} + {t(" Contact with confirmed carrier")}{" "}
{" "} @@ -470,7 +482,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
- Contact with suspected carrier{" "} + {t("Contact with suspected carrier")}{" "}
{" "} @@ -481,7 +493,7 @@ export const SampleDetails = ({ id }: DetailRoute) => { sampleDetails.patient_travel_history.length !== 0 && (
- Countries travelled:{" "} + {t("Countries travelled")}:{" "}
{" "} @@ -493,9 +505,10 @@ export const SampleDetails = ({ id }: DetailRoute) => {
{sampleDetails?.sample_type && (
-
Sample Type:
+
+ {t("sample_type")}:{" "} +
- {" "} {startCase(camelCase(sampleDetails.sample_type))}
From 2cd6f1a70ed5f40c06b66b7fd67ab6ad246a5e83 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 21:26:23 +0530 Subject: [PATCH 23/38] cypress test fail(4) --- src/components/Patient/SampleDetails.tsx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 076b8e919e0..bff0c1a288c 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -321,13 +321,13 @@ export const SampleDetails = ({ id }: DetailRoute) => {
-
Status:
+
{t("Status")}:
{sampleDetails?.status}
-
Result:
+
{t("Result")}:
{sampleDetails?.result} @@ -378,7 +378,7 @@ export const SampleDetails = ({ id }: DetailRoute) => { {sampleDetails?.doctor_name && (
-
+
{t("Doctor's Name")}:
@@ -390,7 +390,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
{sampleDetails?.fast_track && (
-
+
{t("fast_track_testing_reason")}:{" "}
{sampleDetails.fast_track} @@ -398,12 +398,17 @@ export const SampleDetails = ({ id }: DetailRoute) => { )} {sampleDetails?.diagnosis && (
-
{t("diagnosis")}:
+
+ {t("diagnosis")}:{" "} +
{sampleDetails.diagnosis}
)} {sampleDetails?.diff_diagnosis && ( -
+
{t("differential_diagnosis")}:{" "}
@@ -414,7 +419,10 @@ export const SampleDetails = ({ id }: DetailRoute) => {
)} {sampleDetails?.etiology_identified && ( -
+
{t("Etiology identified")}:{" "}
From 3dbeac6f52219b1296217cef616d0c4d04ffda77 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 21:29:33 +0530 Subject: [PATCH 24/38] prettier issue solved --- src/components/Patient/SampleDetails.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index bff0c1a288c..d890827255f 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -321,13 +321,17 @@ export const SampleDetails = ({ id }: DetailRoute) => {
-
{t("Status")}:
+
+ {t("Status")}: +
{sampleDetails?.status}
-
{t("Result")}:
+
+ {t("Result")}: +
{sampleDetails?.result} From ca336b16b593b91bb67531ce1cba1140cb5c10b6 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 22:06:32 +0530 Subject: [PATCH 25/38] lint soving 1 --- src/components/Patient/SampleDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index d890827255f..f8f4960a17d 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -394,7 +394,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
{sampleDetails?.fast_track && (
-
+
{t("fast_track_testing_reason")}:{" "}
{sampleDetails.fast_track} From 702c72874f6420138cc4c624630b2a90cd655ba9 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 22:14:27 +0530 Subject: [PATCH 26/38] lint ShiftDetails.tsx solved --- src/components/Shifting/ShiftDetails.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/Shifting/ShiftDetails.tsx b/src/components/Shifting/ShiftDetails.tsx index bc97b0b0f24..cb5140d6ed0 100644 --- a/src/components/Shifting/ShiftDetails.tsx +++ b/src/components/Shifting/ShiftDetails.tsx @@ -492,13 +492,20 @@ export default function ShiftDetails(props: { id: string }) { : "" } tooltipClassName="tooltip-top -translate-x-28 -translate-y-1 text-xs" - disabled={data?.status === "COMPLETED" || data?.status === "CANCELLED"} - onClick={() => navigate(`/shifting/${data?.external_id}/update`)} + disabled={ + data?.status === "COMPLETED" || data?.status === "CANCELLED" + } + onClick={() => + navigate(`/shifting/${data?.external_id}/update`) + } > {t("update_status_details")} - setIsPrintMode(true)}> + setIsPrintMode(true)} + > {" "} {t("referral_letter")} From c992f31a037fbe205eb19225330e0289e6e60db9 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 22:27:00 +0530 Subject: [PATCH 27/38] cypress issue Expected to find element: #fast_track_reason, but never found it --- src/components/Patient/SampleDetails.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index f8f4960a17d..6b063b9cfb8 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -393,7 +393,10 @@ export const SampleDetails = ({ id }: DetailRoute) => {
{sampleDetails?.fast_track && ( -
+
{t("fast_track_testing_reason")}:{" "}
From d7cc03d87a0c0b234656036210df412f70e2e868 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 22:39:33 +0530 Subject: [PATCH 28/38] doctor name id removed --- src/components/Patient/SampleDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 6b063b9cfb8..3f94e6f7c31 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -382,7 +382,7 @@ export const SampleDetails = ({ id }: DetailRoute) => { {sampleDetails?.doctor_name && (
-
+
{t("Doctor's Name")}:
From 29b48db4c3e4e9ef3c1af9c31fd469fb13c722f5 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 22:53:11 +0530 Subject: [PATCH 29/38] doctor name id added --- src/components/Patient/SampleDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 3f94e6f7c31..ef782177945 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -385,7 +385,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
{t("Doctor's Name")}:
-
+
{startCase(camelCase(sampleDetails.doctor_name))}
From 4192971abbadbb51d769af1785c5b8ea737c7101 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sat, 30 Nov 2024 23:09:34 +0530 Subject: [PATCH 30/38] id positioning issue --- src/components/Patient/SampleDetails.tsx | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index ef782177945..2dfc104b62d 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -405,35 +405,30 @@ export const SampleDetails = ({ id }: DetailRoute) => { )} {sampleDetails?.diagnosis && (
-
- {t("diagnosis")}:{" "} -
- {sampleDetails.diagnosis} +
{t("diagnosis")}:
+ + {" "} + {sampleDetails.diagnosis} +
)} {sampleDetails?.diff_diagnosis && ( -
+
{t("differential_diagnosis")}:{" "}
- + {" "} {sampleDetails?.diff_diagnosis}
)} {sampleDetails?.etiology_identified && ( -
+
{t("Etiology identified")}:{" "}
- + {" "} {sampleDetails.etiology_identified} From 615a29dcb9eb7164230783715097f99fecf08678 Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Sun, 1 Dec 2024 19:04:10 +0530 Subject: [PATCH 31/38] ButtonV2 removed and shadcn button added --- src/components/Patient/SampleDetails.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 2dfc104b62d..722814f6077 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -1,13 +1,13 @@ import { camelCase, capitalize, startCase } from "lodash-es"; -import { navigate } from "raviger"; +import { Link, navigate } from "raviger"; import { useTranslation } from "react-i18next"; import Card from "@/CAREUI/display/Card"; import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; import { CardContent, CardHeader } from "@/components/ui/card"; -import ButtonV2 from "@/components/Common/ButtonV2"; import Loading from "@/components/Common/Loading"; import Page from "@/components/Common/Page"; import { FileUpload } from "@/components/Files/FileUpload"; @@ -308,11 +308,16 @@ export const SampleDetails = ({ id }: DetailRoute) => { options={ sampleDetails?.patient && (
- - {t("icmr_specimen_referral_form")} - + + {t("icmr_specimen_referral_form")} + +
) } From 54c73df0b784b7d9a7e913415af54786b30cf71e Mon Sep 17 00:00:00 2001 From: Mohamed amaan Date: Mon, 2 Dec 2024 00:57:51 +0530 Subject: [PATCH 32/38] shadcn button and variant parimary added --- src/components/Patient/SampleDetails.tsx | 5 +---- src/components/ui/button.tsx | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx index 722814f6077..3e7bdbc606f 100644 --- a/src/components/Patient/SampleDetails.tsx +++ b/src/components/Patient/SampleDetails.tsx @@ -308,10 +308,7 @@ export const SampleDetails = ({ id }: DetailRoute) => { options={ sampleDetails?.patient && (
-