From fcaf7f57fd120c3b72188045f46f2b288e8c5a51 Mon Sep 17 00:00:00 2001 From: Jeffrin Jojo <135723871+Jeffrin2005@users.noreply.github.com> Date: Mon, 2 Dec 2024 13:01:29 +0530 Subject: [PATCH 1/6] Fixed scroll issue in shifting in facilities. Closes #7487 --- package-lock.json | 2 +- src/CAREUI/display/ScrollableColumn.tsx | 28 +++++++++++++++++++++++++ src/CAREUI/interactive/temp.tsx | 0 src/components/Kanban/Board.tsx | 28 ++++++++++++------------- 4 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 src/CAREUI/display/ScrollableColumn.tsx create mode 100644 src/CAREUI/interactive/temp.tsx diff --git a/package-lock.json b/package-lock.json index 63af1164ef0..5c703af8fe1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20862,4 +20862,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/CAREUI/display/ScrollableColumn.tsx b/src/CAREUI/display/ScrollableColumn.tsx new file mode 100644 index 00000000000..7cc458a5e57 --- /dev/null +++ b/src/CAREUI/display/ScrollableColumn.tsx @@ -0,0 +1,28 @@ +// src/CAREUI/display/ScrollableColumn.tsx +import React from "react"; + +interface ScrollableColumnProps { + title: string; + children: React.ReactNode; +} + +const ScrollableColumn: React.FC = ({ + title, + children, +}) => { + return ( +
+

{title}

+ {children} +
+ ); +}; + +export default ScrollableColumn; diff --git a/src/CAREUI/interactive/temp.tsx b/src/CAREUI/interactive/temp.tsx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/components/Kanban/Board.tsx b/src/components/Kanban/Board.tsx index 337f98f1caf..43de73ee601 100644 --- a/src/components/Kanban/Board.tsx +++ b/src/components/Kanban/Board.tsx @@ -29,7 +29,6 @@ interface KanbanBoardProps { }[]; itemRender: (item: T) => ReactNode; } - export default function KanbanBoard( props: KanbanBoardProps, ) { @@ -37,7 +36,7 @@ export default function KanbanBoard( return (
-
+
{props.title}
{[0, 1].map((button, i) => ( @@ -56,8 +55,15 @@ export default function KanbanBoard( ))}
+ -
+
{props.sections.map((section, i) => ( @@ -73,7 +79,6 @@ export default function KanbanBoard(
); } - export function KanbanSection( props: Omit, "sections" | "onDragEnd"> & { section: KanbanBoardProps["sections"][number]; @@ -92,8 +97,6 @@ export function KanbanSection( const defaultLimit = 14; const { t } = useTranslation(); - // should be replaced with useInfiniteQuery when we move over to react query - const fetchNextPage = async (refresh: boolean = false) => { if (!refresh && (fetchingNextPage || !hasMore)) return; if (refresh) setPages([]); @@ -121,7 +124,6 @@ export function KanbanSection( const sectionElementHeight = sectionRef.current?.getBoundingClientRect().height; const scrolled = props.boardRef.current?.scrollTop; - // if user has scrolled 3/4th of the current items if ( scrolled && sectionElementHeight && @@ -130,7 +132,6 @@ export function KanbanSection( fetchNextPage(); } }; - props.boardRef.current?.addEventListener("scroll", onBoardReachEnd); return () => props.boardRef.current?.removeEventListener("scroll", onBoardReachEnd); @@ -139,15 +140,12 @@ export function KanbanSection( useEffect(() => { fetchNextPage(true); }, [props.section]); - return ( {(provided) => (
@@ -159,7 +157,10 @@ export function KanbanSection(
-
+
{!fetchingNextPage && totalCount === 0 && (
{t("no_results_found")} @@ -190,5 +191,4 @@ export function KanbanSection( ); } - export type KanbanBoardType = typeof KanbanBoard; From 9a6a1d9b358b52e61ff0bdd439291fee372e7444 Mon Sep 17 00:00:00 2001 From: Jeffrin Jojo <135723871+Jeffrin2005@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:21:12 +0530 Subject: [PATCH 2/6] Changes Updated Closes #9268 --- .gitattributes | 10 +++++++ src/CAREUI/interactive/temp.tsx | 0 src/components/Kanban/Board.tsx | 8 +----- src/components/ui/scroll-area.tsx | 46 +++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 .gitattributes delete mode 100644 src/CAREUI/interactive/temp.tsx create mode 100644 src/components/ui/scroll-area.tsx diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..a491f387dc2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,10 @@ +* text=auto + + +*.c text +*.h text + +*.sln text eol=crlf + +*.png binary +*.jpg binary \ No newline at end of file diff --git a/src/CAREUI/interactive/temp.tsx b/src/CAREUI/interactive/temp.tsx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/components/Kanban/Board.tsx b/src/components/Kanban/Board.tsx index 43de73ee601..470ea19b2c5 100644 --- a/src/components/Kanban/Board.tsx +++ b/src/components/Kanban/Board.tsx @@ -57,13 +57,7 @@ export default function KanbanBoard(
-
+
{props.sections.map((section, i) => ( diff --git a/src/components/ui/scroll-area.tsx b/src/components/ui/scroll-area.tsx new file mode 100644 index 00000000000..d0c4d3ac63b --- /dev/null +++ b/src/components/ui/scroll-area.tsx @@ -0,0 +1,46 @@ +import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"; +import * as React from "react"; + +import { cn } from "@/lib/utils"; + +const ScrollArea = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + {children} + + + + +)); +ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName; + +const ScrollBar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, orientation = "vertical", ...props }, ref) => ( + + + +)); +ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName; + +export { ScrollArea, ScrollBar }; From 25bed76310fad87399ee2a6c1dcc39ffa93914ac Mon Sep 17 00:00:00 2001 From: Jeffrin Jojo <135723871+Jeffrin2005@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:12:32 +0530 Subject: [PATCH 3/6] UPD --- package-lock.json | 18 ++++++++---------- package.json | 4 ++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c703af8fe1..c06b833f4f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "cross-env": "^7.0.3", - "cypress": "^13.15.2", + "cypress": "^13.16.0", "dayjs": "^1.11.13", "echarts": "^5.5.1", "echarts-for-react": "^3.0.2", @@ -54,7 +54,7 @@ "react-infinite-scroll-component": "^6.1.0", "react-pdf": "^9.1.1", "react-webcam": "^7.2.0", - "tailwind-merge": "^2.5.4", + "tailwind-merge": "^2.5.5", "tailwindcss-animate": "^1.0.7", "use-keyboard-shortcut": "^1.1.6", "xlsx": "^0.18.5" @@ -7685,11 +7685,10 @@ "license": "MIT" }, "node_modules/cypress": { - "version": "13.15.2", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.15.2.tgz", - "integrity": "sha512-ARbnUorjcCM3XiPwgHKuqsyr5W9Qn+pIIBPaoilnoBkLdSC2oLQjV1BUpnmc7KR+b7Avah3Ly2RMFnfxr96E/A==", + "version": "13.16.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.16.0.tgz", + "integrity": "sha512-g6XcwqnvzXrqiBQR/5gN+QsyRmKRhls1y5E42fyOvsmU7JuY+wM6uHJWj4ZPttjabzbnRvxcik2WemR8+xT6FA==", "hasInstallScript": true, - "license": "MIT", "dependencies": { "@cypress/request": "^3.0.6", "@cypress/xvfb": "^1.2.4", @@ -17629,10 +17628,9 @@ "license": "MIT" }, "node_modules/tailwind-merge": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.5.4.tgz", - "integrity": "sha512-0q8cfZHMu9nuYP/b5Shb7Y7Sh1B7Nnl5GqNr1U+n2p6+mybvRtayrQ+0042Z5byvTA8ihjlP8Odo8/VnHbZu4Q==", - "license": "MIT", + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.5.5.tgz", + "integrity": "sha512-0LXunzzAZzo0tEPxV3I297ffKZPlKDrjj7NXphC8V5ak9yHC5zRmxnOe2m/Rd/7ivsOMJe3JZ2JVocoDdQTRBA==", "funding": { "type": "github", "url": "https://github.com/sponsors/dcastil" diff --git a/package.json b/package.json index 020d73f5e65..7272fc4e01a 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "cross-env": "^7.0.3", - "cypress": "^13.15.2", + "cypress": "^13.16.0", "dayjs": "^1.11.13", "echarts": "^5.5.1", "echarts-for-react": "^3.0.2", @@ -93,7 +93,7 @@ "react-infinite-scroll-component": "^6.1.0", "react-pdf": "^9.1.1", "react-webcam": "^7.2.0", - "tailwind-merge": "^2.5.4", + "tailwind-merge": "^2.5.5", "tailwindcss-animate": "^1.0.7", "use-keyboard-shortcut": "^1.1.6", "xlsx": "^0.18.5" From e22701b40fd7986e74c4de702dd44ce140e5dc52 Mon Sep 17 00:00:00 2001 From: Jeffrin Jojo <135723871+Jeffrin2005@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:13:40 +0530 Subject: [PATCH 4/6] UPD --- .husky/pre-commit | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit old mode 100755 new mode 100644 From 02ccceb4ed2d55e2f6b76aa4a3ba384589b123d5 Mon Sep 17 00:00:00 2001 From: Jeffrin Jojo <135723871+Jeffrin2005@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:41:03 +0530 Subject: [PATCH 5/6] LTS --- src/CAREUI/display/ScrollableColumn.tsx | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/CAREUI/display/ScrollableColumn.tsx b/src/CAREUI/display/ScrollableColumn.tsx index 7cc458a5e57..8a455b29d71 100644 --- a/src/CAREUI/display/ScrollableColumn.tsx +++ b/src/CAREUI/display/ScrollableColumn.tsx @@ -1,6 +1,7 @@ -// src/CAREUI/display/ScrollableColumn.tsx import React from "react"; +import { ScrollArea } from "@/components/ui/scroll-area"; + interface ScrollableColumnProps { title: string; children: React.ReactNode; @@ -11,16 +12,11 @@ const ScrollableColumn: React.FC = ({ children, }) => { return ( -
-

{title}

- {children} +
+

{title}

+ +
{children}
+
); }; From 69d55190b1b3a642a80cf906e084396d63ab25f5 Mon Sep 17 00:00:00 2001 From: Jeffrin Jojo <135723871+Jeffrin2005@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:51:23 +0530 Subject: [PATCH 6/6] Edited section --- package-lock.json | 39 ++++++++++++++++++++++++++++++++++++--- package.json | 1 + 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d3fde8be105..9575058ee5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "@pnotify/mobile": "^5.2.0", "@radix-ui/react-dropdown-menu": "^2.1.2", "@radix-ui/react-icons": "^1.3.2", + "@radix-ui/react-scroll-area": "^1.2.1", "@radix-ui/react-slot": "^1.1.0", "@radix-ui/react-toast": "^1.2.2", "@radix-ui/react-tooltip": "^1.1.4", @@ -3607,6 +3608,11 @@ "validator": "^13.9.0" } }, + "node_modules/@radix-ui/number": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.0.tgz", + "integrity": "sha512-V3gRzhVNU1ldS5XhAPTom1fOIo4ccrjjJgmE+LI2h/WaFpHmx0MQApT+KZHnx8abG6Avtfcz4WoEciMnpFT3HQ==" + }, "node_modules/@radix-ui/primitive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.0.tgz", @@ -4049,6 +4055,36 @@ } } }, + "node_modules/@radix-ui/react-scroll-area": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-scroll-area/-/react-scroll-area-1.2.1.tgz", + "integrity": "sha512-FnM1fHfCtEZ1JkyfH/1oMiTcFBQvHKl4vD9WnpwkLgtF+UmnXMCad6ECPTaAjcDjam+ndOEJWgHyKDGNteWSHw==", + "dependencies": { + "@radix-ui/number": "1.1.0", + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-direction": "1.1.0", + "@radix-ui/react-presence": "1.1.1", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-use-callback-ref": "1.1.0", + "@radix-ui/react-use-layout-effect": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.0.tgz", @@ -17577,10 +17613,7 @@ "version": "2.5.5", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.5.5.tgz", "integrity": "sha512-0LXunzzAZzo0tEPxV3I297ffKZPlKDrjj7NXphC8V5ak9yHC5zRmxnOe2m/Rd/7ivsOMJe3JZ2JVocoDdQTRBA==", -<<<<<<< HEAD -======= "license": "MIT", ->>>>>>> 60ba91e843cb96ba20d19e30499c116176334f17 "funding": { "type": "github", "url": "https://github.com/sponsors/dcastil" diff --git a/package.json b/package.json index 968c4a3e95b..cf6b1fb7133 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "@pnotify/mobile": "^5.2.0", "@radix-ui/react-dropdown-menu": "^2.1.2", "@radix-ui/react-icons": "^1.3.2", + "@radix-ui/react-scroll-area": "^1.2.1", "@radix-ui/react-slot": "^1.1.0", "@radix-ui/react-toast": "^1.2.2", "@radix-ui/react-tooltip": "^1.1.4",