Skip to content

Commit

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

export const useViewInOrthanc = (level: "study" | "series" | "instance") => {
/**
* Todo: Use value provided by the backend
*/
const ORTHANC_EXPLORER =
"https://orthanc.uni2growcameroun.com/app/explorer.html";
const handleViewInOrthanc = useCallback(
(row: any) => () => {
window.open(`${ORTHANC_EXPLORER}#${level}?uuid=${row.id}`, "_blank");
},
[level]
);

return handleViewInOrthanc;
};
15 changes: 0 additions & 15 deletions src/components/accessories/radiology/hooks/useViewMore.ts

This file was deleted.

12 changes: 6 additions & 6 deletions src/components/accessories/radiology/series/Series.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChevronLeft, Visibility } from "@mui/icons-material";
import { ChevronLeft, OpenInNew } from "@mui/icons-material";
import {
Backdrop,
Button,
Expand All @@ -23,7 +23,7 @@ import {
getStudySeriesWithInstances,
getStudySeriesWithInstancesReset,
} from "state/radiology";
import { useViewMore } from "../hooks";
import { useViewInOrthanc } from "../hooks";
import { Instances } from "./instances/Instances";
import { Preview } from "./preview/Preview";
import "./styles.scss";
Expand Down Expand Up @@ -138,7 +138,7 @@ export const Series = () => {
}
}, [previewState.status, setOpenPreview]);

const handleViewSeries = useViewMore("series");
const handleViewSeries = useViewInOrthanc("series");

return (
<div className="series">
Expand Down Expand Up @@ -171,7 +171,7 @@ export const Series = () => {
<ChevronLeft /> {t("radiology.series.backToStudies")}
</Button>
{study?.title && (
<p className="series__StudyTitle">
<p className="series__studyTitle">
{study.title} {study.date && " | " + study.date}
</p>
)}
Expand All @@ -193,9 +193,9 @@ export const Series = () => {
isCollapsabile={true}
renderCustomActions={(row) => (
<div className="series__actions">
<Tooltip title={t("radiology.series.viewMore")}>
<Tooltip title={t("radiology.series.viewInOrthanc")}>
<IconButton onClick={handleViewSeries(row)}>
<Visibility />
<OpenInNew />
</IconButton>
</Tooltip>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/resources/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"status": "Status",
"lastUpdate": "Last Update",
"backToStudies": "Back to studies",
"viewMore": "View More"
"viewInOrthanc": "View in ORTHANC Explorer"
},
"instances": {
"date": "Creation Date",
"title": "Instance {number}",
"time": "Creation Time",
"preview": "Preview"
"preview": "Instance Preview"
}
},
"errors": {
Expand Down

0 comments on commit ce09808

Please sign in to comment.