Skip to content

Commit

Permalink
update: Handle series details view
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGT96 committed Dec 11, 2024
1 parent d525414 commit 6025c81
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REACT_APP_USE_MOCK_API=false
REACT_APP_ENABLE_PERMISSIONS=true
REACT_APP_ENABLE_PERMISSIONS=true
REACT_APP_ORTHANC_EXPLORER=https://orthanc.uni2growcameroun.com/app/explorer.html
3 changes: 2 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REACT_APP_USE_MOCK_API=true
REACT_APP_ENABLE_PERMISSIONS=false
REACT_APP_ENABLE_PERMISSIONS=false
REACT_APP_ORTHANC_EXPLORER=https://orthanc.uni2growcameroun.com/app/explorer.html
1 change: 1 addition & 0 deletions src/components/accessories/radiology/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./useViewMore";
15 changes: 15 additions & 0 deletions src/components/accessories/radiology/hooks/useViewMore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { useCallback } from "react";

export const useViewMore = (level: "study" | "series" | "instance") => {
const handleViewMore = useCallback(
(row: any) => () => {
window.open(
`${process.env.REACT_APP_ORTHANC_EXPLORER}#${level}?uuid=${row.id}`,
"_blank"
);
},
[level]
);

return handleViewMore;
};
23 changes: 20 additions & 3 deletions src/components/accessories/radiology/series/Series.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { ChevronLeft } from "@mui/icons-material";
import { Backdrop, Button, CircularProgress } from "@mui/material";
import { ChevronLeft, Visibility } from "@mui/icons-material";
import {
Backdrop,
Button,
CircularProgress,
IconButton,
Tooltip,
} from "@mui/material";
import InfoBox from "components/accessories/infoBox/InfoBox";
import Table from "components/accessories/table/Table";
import { TFilterField } from "components/accessories/table/filter/types";
Expand All @@ -17,6 +23,7 @@ import {
getStudySeriesWithInstances,
getStudySeriesWithInstancesReset,
} from "state/radiology";
import { useViewMore } from "../hooks";
import { Instances } from "./instances/Instances";
import { Preview } from "./preview/Preview";
import "./styles.scss";
Expand Down Expand Up @@ -131,6 +138,8 @@ export const Series = () => {
}
}, [previewState.status, setOpenPreview]);

const handleViewSeries = useViewMore("series");

return (
<div className="series">
{(() => {
Expand Down Expand Up @@ -182,7 +191,15 @@ export const Series = () => {
columnsOrder={order}
rowsPerPage={5}
isCollapsabile={true}
renderCustomActions={(row) => <></>}
renderCustomActions={(row) => (
<div className="series__actions">
<Tooltip title={t("radiology.series.viewMore")}>
<IconButton onClick={handleViewSeries(row)}>
<Visibility />
</IconButton>
</Tooltip>
</div>
)}
filterColumns={filters}
rawData={(seriesState.data ?? []).map((series) => ({
id: series.id ?? "",
Expand Down
5 changes: 5 additions & 0 deletions src/components/accessories/radiology/series/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
text-transform: none;
}

.series__actions {
display: flex;
justify-content: end;
}

.header {
margin-top: 16px;
}
Expand Down
3 changes: 2 additions & 1 deletion src/resources/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"station": "Station Name",
"status": "Status",
"lastUpdate": "Last Update",
"backToStudies": "Back to studies"
"backToStudies": "Back to studies",
"viewMore": "View More"
},
"instances": {
"date": "Creation Date",
Expand Down

0 comments on commit 6025c81

Please sign in to comment.