From 11ee1920c71134d94ee81d7be8b55a3a7078a9ba Mon Sep 17 00:00:00 2001 From: nithish Date: Thu, 5 Dec 2024 18:23:50 +0530 Subject: [PATCH 1/5] Fixed User Default View in Resource and Shifting --- src/components/Resource/ResourceBoard.tsx | 1 + src/components/Resource/ResourceList.tsx | 1 + src/components/Shifting/ShiftingBoard.tsx | 1 + src/components/Shifting/ShiftingList.tsx | 1 + 4 files changed, 4 insertions(+) diff --git a/src/components/Resource/ResourceBoard.tsx b/src/components/Resource/ResourceBoard.tsx index f76604ff9f6..f46481e4b34 100644 --- a/src/components/Resource/ResourceBoard.tsx +++ b/src/components/Resource/ResourceBoard.tsx @@ -35,6 +35,7 @@ const COMPLETED = ["COMPLETED", "REJECTED"]; const ACTIVE = resourceStatusOptions.filter((o) => !COMPLETED.includes(o)); export default function BoardView() { + localStorage.setItem("defaultResourceView", "board"); const { qParams, FilterBadges, advancedFilter, updateQuery } = useFilters({ limit: -1, cacheBlacklist: ["title"], diff --git a/src/components/Resource/ResourceList.tsx b/src/components/Resource/ResourceList.tsx index 891c2f3378b..3012a26f81a 100644 --- a/src/components/Resource/ResourceList.tsx +++ b/src/components/Resource/ResourceList.tsx @@ -23,6 +23,7 @@ import useQuery from "@/Utils/request/useQuery"; import { formatDateTime } from "@/Utils/utils"; export default function ListView() { + localStorage.setItem("defaultResourceView", "list"); const { qParams, Pagination, diff --git a/src/components/Shifting/ShiftingBoard.tsx b/src/components/Shifting/ShiftingBoard.tsx index 8486c8dd4d0..d64b7d6c6d5 100644 --- a/src/components/Shifting/ShiftingBoard.tsx +++ b/src/components/Shifting/ShiftingBoard.tsx @@ -35,6 +35,7 @@ const KanbanBoard = lazy( ) as KanbanBoardType; export default function BoardView() { + localStorage.setItem("defaultShiftView", "board"); const { qParams, updateQuery, FilterBadges, advancedFilter } = useFilters({ limit: -1, cacheBlacklist: ["patient_name"], diff --git a/src/components/Shifting/ShiftingList.tsx b/src/components/Shifting/ShiftingList.tsx index 7161ea29441..2d12f648404 100644 --- a/src/components/Shifting/ShiftingList.tsx +++ b/src/components/Shifting/ShiftingList.tsx @@ -22,6 +22,7 @@ import useQuery from "@/Utils/request/useQuery"; import ShiftingTable from "./ShiftingTable"; export default function ListView() { + localStorage.setItem("defaultShiftView", "list"); const { qParams, updateQuery, From 73f98dbd766fb982607c21182230c4cb45c17469 Mon Sep 17 00:00:00 2001 From: nithish Date: Thu, 5 Dec 2024 18:44:31 +0530 Subject: [PATCH 2/5] Added bot suggestions --- src/components/Resource/ResourceBoard.tsx | 1 - src/components/Resource/ResourceList.tsx | 5 +++-- src/components/Shifting/ShiftingBoard.tsx | 10 +++++----- src/components/Shifting/ShiftingList.tsx | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/Resource/ResourceBoard.tsx b/src/components/Resource/ResourceBoard.tsx index f46481e4b34..f76604ff9f6 100644 --- a/src/components/Resource/ResourceBoard.tsx +++ b/src/components/Resource/ResourceBoard.tsx @@ -35,7 +35,6 @@ const COMPLETED = ["COMPLETED", "REJECTED"]; const ACTIVE = resourceStatusOptions.filter((o) => !COMPLETED.includes(o)); export default function BoardView() { - localStorage.setItem("defaultResourceView", "board"); const { qParams, FilterBadges, advancedFilter, updateQuery } = useFilters({ limit: -1, cacheBlacklist: ["title"], diff --git a/src/components/Resource/ResourceList.tsx b/src/components/Resource/ResourceList.tsx index 3012a26f81a..0e501f6461c 100644 --- a/src/components/Resource/ResourceList.tsx +++ b/src/components/Resource/ResourceList.tsx @@ -23,7 +23,6 @@ import useQuery from "@/Utils/request/useQuery"; import { formatDateTime } from "@/Utils/utils"; export default function ListView() { - localStorage.setItem("defaultResourceView", "list"); const { qParams, Pagination, @@ -35,8 +34,10 @@ export default function ListView() { const { t } = useTranslation(); - const onBoardViewBtnClick = () => + const onBoardViewBtnClick = () => { navigate("/resource/board", { query: qParams }); + localStorage.setItem("defaultResourceView", "board"); + }; const appliedFilters = formatFilter(qParams); const { loading, data, refetch } = useQuery(routes.listResourceRequests, { diff --git a/src/components/Shifting/ShiftingBoard.tsx b/src/components/Shifting/ShiftingBoard.tsx index d64b7d6c6d5..33481c6f1f5 100644 --- a/src/components/Shifting/ShiftingBoard.tsx +++ b/src/components/Shifting/ShiftingBoard.tsx @@ -35,7 +35,6 @@ const KanbanBoard = lazy( ) as KanbanBoardType; export default function BoardView() { - localStorage.setItem("defaultShiftView", "board"); const { qParams, updateQuery, FilterBadges, advancedFilter } = useFilters({ limit: -1, cacheBlacklist: ["patient_name"], @@ -76,6 +75,10 @@ export default function BoardView() { const [boardFilter, setBoardFilter] = useState(activeBoards); const { t } = useTranslation(); + const onListViewBtnClick = () => { + navigate("/shifting/list", { query: qParams }); + localStorage.setItem("defaultShiftView", "list"); + }; return (
@@ -120,10 +123,7 @@ export default function BoardView() { />
- navigate("/shifting/list", { query: qParams })} - > + {t("list_view")} diff --git a/src/components/Shifting/ShiftingList.tsx b/src/components/Shifting/ShiftingList.tsx index 2d12f648404..b347c055f72 100644 --- a/src/components/Shifting/ShiftingList.tsx +++ b/src/components/Shifting/ShiftingList.tsx @@ -22,7 +22,6 @@ import useQuery from "@/Utils/request/useQuery"; import ShiftingTable from "./ShiftingTable"; export default function ListView() { - localStorage.setItem("defaultShiftView", "list"); const { qParams, updateQuery, @@ -33,6 +32,10 @@ export default function ListView() { } = useFilters({ cacheBlacklist: ["patient_name"] }); const { t } = useTranslation(); + const onBoardViewBtnClick = () => { + navigate("/shifting/board", { query: qParams }); + localStorage.setItem("defaultShiftView", "board"); + }; const { data: shiftData, loading, @@ -74,10 +77,7 @@ export default function ListView() {
- navigate("/shifting/board", { query: qParams })} - > + {t("board_view")} From 5dc8cac4f1751a2cf8348322e448360a1bb8dc4f Mon Sep 17 00:00:00 2001 From: nithish Date: Thu, 5 Dec 2024 19:44:41 +0530 Subject: [PATCH 3/5] changed ButtonV2 to shadcn button --- src/components/Resource/ResourceBoard.tsx | 11 ++++++++--- src/components/Resource/ResourceList.tsx | 11 ++++++++--- src/components/Shifting/ShiftingBoard.tsx | 13 +++++++++---- src/components/Shifting/ShiftingList.tsx | 13 +++++++++---- 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/components/Resource/ResourceBoard.tsx b/src/components/Resource/ResourceBoard.tsx index f76604ff9f6..fbca75e38e5 100644 --- a/src/components/Resource/ResourceBoard.tsx +++ b/src/components/Resource/ResourceBoard.tsx @@ -5,7 +5,8 @@ import { useTranslation } from "react-i18next"; import CareIcon from "@/CAREUI/icons/CareIcon"; import { AdvancedFilterButton } from "@/CAREUI/interactive/FiltersSlideover"; -import ButtonV2 from "@/components/Common/ButtonV2"; +import { Button } from "@/components/ui/button"; + import { ExportButton } from "@/components/Common/Export"; import Loading from "@/components/Common/Loading"; import PageTitle from "@/components/Common/PageTitle"; @@ -92,10 +93,14 @@ export default function BoardView() { currentTab={boardFilter !== ACTIVE ? 1 : 0} />
- + advancedFilter.setShow(true)} /> diff --git a/src/components/Resource/ResourceList.tsx b/src/components/Resource/ResourceList.tsx index 0e501f6461c..480620fcfa2 100644 --- a/src/components/Resource/ResourceList.tsx +++ b/src/components/Resource/ResourceList.tsx @@ -5,7 +5,8 @@ import Chip from "@/CAREUI/display/Chip"; import CareIcon from "@/CAREUI/icons/CareIcon"; import { AdvancedFilterButton } from "@/CAREUI/interactive/FiltersSlideover"; -import ButtonV2 from "@/components/Common/ButtonV2"; +import { Button } from "@/components/ui/button"; + import { ExportButton } from "@/components/Common/Export"; import Loading from "@/components/Common/Loading"; import Page from "@/components/Common/Page"; @@ -218,10 +219,14 @@ export default function ListView() {
- + advancedFilter.setShow(true)} /> diff --git a/src/components/Shifting/ShiftingBoard.tsx b/src/components/Shifting/ShiftingBoard.tsx index 33481c6f1f5..ff1351b7e88 100644 --- a/src/components/Shifting/ShiftingBoard.tsx +++ b/src/components/Shifting/ShiftingBoard.tsx @@ -6,7 +6,8 @@ import { useTranslation } from "react-i18next"; import CareIcon from "@/CAREUI/icons/CareIcon"; import { AdvancedFilterButton } from "@/CAREUI/interactive/FiltersSlideover"; -import ButtonV2 from "@/components/Common/ButtonV2"; +import { Button } from "@/components/ui/button"; + import ConfirmDialog from "@/components/Common/ConfirmDialog"; import { ExportButton } from "@/components/Common/Export"; import Loading from "@/components/Common/Loading"; @@ -123,10 +124,14 @@ export default function BoardView() { />
- - + advancedFilter.setShow(true)} /> diff --git a/src/components/Shifting/ShiftingList.tsx b/src/components/Shifting/ShiftingList.tsx index b347c055f72..069f016726f 100644 --- a/src/components/Shifting/ShiftingList.tsx +++ b/src/components/Shifting/ShiftingList.tsx @@ -4,7 +4,8 @@ import { useTranslation } from "react-i18next"; import CareIcon from "@/CAREUI/icons/CareIcon"; import { AdvancedFilterButton } from "@/CAREUI/interactive/FiltersSlideover"; -import ButtonV2 from "@/components/Common/ButtonV2"; +import { Button } from "@/components/ui/button"; + import { ExportButton } from "@/components/Common/Export"; import Loading from "@/components/Common/Loading"; import Page from "@/components/Common/Page"; @@ -77,10 +78,14 @@ export default function ListView() {
- - + advancedFilter.setShow(true)} /> From 93025349b66f9dae5a5419fd65859ac6d39a5f80 Mon Sep 17 00:00:00 2001 From: nithish Date: Thu, 5 Dec 2024 19:56:04 +0530 Subject: [PATCH 4/5] switched to button default size --- src/components/Resource/ResourceBoard.tsx | 6 +----- src/components/Resource/ResourceList.tsx | 6 +----- src/components/Shifting/ShiftingBoard.tsx | 6 +----- src/components/Shifting/ShiftingList.tsx | 6 +----- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/components/Resource/ResourceBoard.tsx b/src/components/Resource/ResourceBoard.tsx index fbca75e38e5..133dc28a011 100644 --- a/src/components/Resource/ResourceBoard.tsx +++ b/src/components/Resource/ResourceBoard.tsx @@ -93,11 +93,7 @@ export default function BoardView() { currentTab={boardFilter !== ACTIVE ? 1 : 0} />
- diff --git a/src/components/Resource/ResourceList.tsx b/src/components/Resource/ResourceList.tsx index 480620fcfa2..6e818417756 100644 --- a/src/components/Resource/ResourceList.tsx +++ b/src/components/Resource/ResourceList.tsx @@ -219,11 +219,7 @@ export default function ListView() {
- diff --git a/src/components/Shifting/ShiftingBoard.tsx b/src/components/Shifting/ShiftingBoard.tsx index ff1351b7e88..cd9f4300fd4 100644 --- a/src/components/Shifting/ShiftingBoard.tsx +++ b/src/components/Shifting/ShiftingBoard.tsx @@ -124,11 +124,7 @@ export default function BoardView() { />
- diff --git a/src/components/Shifting/ShiftingList.tsx b/src/components/Shifting/ShiftingList.tsx index 069f016726f..f9727bdd819 100644 --- a/src/components/Shifting/ShiftingList.tsx +++ b/src/components/Shifting/ShiftingList.tsx @@ -78,11 +78,7 @@ export default function ListView() {
- From 7ab9adfeb432e7d61ba0e6e5fccf41ff6d497d55 Mon Sep 17 00:00:00 2001 From: nithish Date: Thu, 5 Dec 2024 21:11:48 +0530 Subject: [PATCH 5/5] Added margin to icons --- src/components/Resource/ResourceBoard.tsx | 2 +- src/components/Resource/ResourceList.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Resource/ResourceBoard.tsx b/src/components/Resource/ResourceBoard.tsx index 133dc28a011..1f8ccafcb5d 100644 --- a/src/components/Resource/ResourceBoard.tsx +++ b/src/components/Resource/ResourceBoard.tsx @@ -94,7 +94,7 @@ export default function BoardView() { />