Integration TrizRis OHIF: key images, annotations, layouts, access control and reconstruction
Build and Deploy Docs / build-and-deploy-docs (push) Canceled after 0s

This commit is contained in:
Kenza committed 2026-10-11 10:34:47 +02:00
1 parent bbe37ff388
commit f00379a672
28 files changed
+1898 -105

No files matched your search

+2
View File
@@ -317,6 +317,8 @@ export default function ModeRoute({
extensionManager,
commandsManager,
appConfig,
// ===== TRIZRIS =====
studyInstanceUIDs,
});
// Move hotkeys setup here, after onModeEnter
+23
View File
@@ -0,0 +1,23 @@
import React from 'react';
export default function NoAccess() {
return (
<div
style={{
height: '100vh',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
background: '#0b0f14',
color: 'white',
textAlign: 'center',
padding: '20px',
}}
>
<h1>Accès refusé</h1>
<p>Vous devez être connecté à TrizRis avec un compte médecin pour accéder au viewer.</p>
</div>
);
}
@@ -0,0 +1,72 @@
import React, { useEffect, useState } from 'react';
import { Navigate } from 'react-router-dom';
import { checkTrizRisAccess } from '../../../../extensions/default/src/services/TrizRisAccessApi';
type Props = {
children: React.ReactNode;
};
export default function TrizRisProtectedRoute({ children }: Props) {
const [checking, setChecking] = useState(true);
const [authorized, setAuthorized] = useState(false);
useEffect(() => {
let mounted = true;
const checkAccess = async () => {
try {
const result = await checkTrizRisAccess();
if (!mounted) {
return;
}
console.log('### VERIFICATION ACCES TRIZRIS ###', result);
setAuthorized(result);
} catch (error) {
console.error('### ERREUR VERIFICATION ACCES TRIZRIS ###', error);
if (mounted) {
setAuthorized(false);
}
} finally {
if (mounted) {
setChecking(false);
}
}
};
checkAccess();
return () => {
mounted = false;
};
}, []);
// Pendant la vérification :
// on n'affiche PAS encore le viewer.
if (checking) {
return (
<div
style={{
width: '100vw',
height: '100vh',
background: '#0b0f14',
}}
/>
);
}
if (!authorized) {
return (
<Navigate
to="/no-access"
replace
/>
);
}
return <>{children}</>;
}
+30 -16
View File
@@ -18,6 +18,8 @@ import PropTypes from 'prop-types';
import { routerBasename } from '../utils/publicUrl';
import { useAppConfig } from '@state';
import { history } from '../utils/history';
import TrizRisProtectedRoute from './TrizRisProtectedRoute';
import NoAccess from './NoAccess';
const NotFoundServer = ({
message = 'Unable to query for studies at this time. Check your data source configuration or network connection',
@@ -71,6 +73,10 @@ NotFoundStudy.propTypes = {
// TODO: Include "routes" debug route if dev build
const bakedInRoutes = [
{
path: `/no-access`,
children: NoAccess,
},
{
path: `/notfoundserver`,
children: NotFoundServer,
@@ -105,7 +111,7 @@ const createRoutes = ({
hotkeysManager,
showStudyList,
}: withAppTypes) => {
const routes =
const routes = (
buildModeRoutes({
modes,
dataSources,
@@ -113,7 +119,11 @@ const createRoutes = ({
servicesManager,
commandsManager,
hotkeysManager,
}) || [];
}) || []
).map(route => ({
...route,
trizRisProtected: true,
}));
const { customizationService } = servicesManager.services;
@@ -176,23 +186,27 @@ const createRoutes = ({
return (
<Routes>
{allRoutes.map((route, i) => {
return route.private === true ? (
let element = <RouteWithErrorBoundary route={route} />;
if (route.trizRisProtected === true) {
element = <TrizRisProtectedRoute>{element}</TrizRisProtectedRoute>;
}
if (route.private === true) {
element = (
<PrivateRoute
handleUnauthenticated={() => userAuthenticationService.handleUnauthenticated()}
>
{element}
</PrivateRoute>
);
}
return (
<Route
key={i}
path={route.path}
element={
<PrivateRoute
handleUnauthenticated={() => userAuthenticationService.handleUnauthenticated()}
>
<RouteWithErrorBoundary route={route} />
</PrivateRoute>
}
></Route>
) : (
<Route
key={i}
path={route.path}
element={<RouteWithErrorBoundary route={route} />}
element={element}
/>
);
})}