diff --git a/FrontEnd/src/actions/ExportList.js b/FrontEnd/src/actions/ExportList.js index abbb6ffe..da206cfd 100644 --- a/FrontEnd/src/actions/ExportList.js +++ b/FrontEnd/src/actions/ExportList.js @@ -21,7 +21,6 @@ export function addToExportList(seriesArray, studiesArray) { export function addStudiesToExportList(studiesArray) { return async function (dispatch) { for (const studyObject of studiesArray) { - console.log(studyObject) try { let seriesInfo = await apis.content.getSeriesDetailsOfStudy(studyObject.StudyOrthancID) let series = seriesInfo.map(series => { diff --git a/FrontEnd/src/components/Admin/Robots/AutoRetrieveRobotDetails.js b/FrontEnd/src/components/Admin/Robots/AutoRetrieveRobotDetails.js index 3e4c2ad9..ebe72881 100644 --- a/FrontEnd/src/components/Admin/Robots/AutoRetrieveRobotDetails.js +++ b/FrontEnd/src/components/Admin/Robots/AutoRetrieveRobotDetails.js @@ -20,6 +20,7 @@ export default ({ robotId }) => { })) ) + if (isLoading) return return ( diff --git a/FrontEnd/src/components/Anonymize/Anonymize/AnonymizePanel.js b/FrontEnd/src/components/Anonymize/Anonymize/AnonymizePanel.js index f9445e8a..12ba7613 100644 --- a/FrontEnd/src/components/Anonymize/Anonymize/AnonymizePanel.js +++ b/FrontEnd/src/components/Anonymize/Anonymize/AnonymizePanel.js @@ -74,7 +74,6 @@ export default () => { try { let answer = await apis.anon.createAnonRobot(listToAnonymize, store.username) //wait for the robot's answer to know what do to next successMessage('Anonymization started') - console.log(answer) } catch (error) { errorMessage(error.statusText) } diff --git a/FrontEnd/src/components/AutoQuery/AutoQueryRoot.js b/FrontEnd/src/components/AutoQuery/AutoQueryRoot.js index 3cdd5f3d..53fbc94b 100644 --- a/FrontEnd/src/components/AutoQuery/AutoQueryRoot.js +++ b/FrontEnd/src/components/AutoQuery/AutoQueryRoot.js @@ -4,6 +4,42 @@ import QueryRoot from './Query/QueryRoot' import ResultsRoot from './Results/ResultsRoot' import MyRobotRoot from './MyRobot/MyRobotRoot' import RobotHistoryRoot from './RobotHistory/RobotHistoryRoot' +import { useSelector } from 'react-redux' +import apis from '../../services/apis' +import Spinner from '../CommonComponents/Spinner' +import { useCustomQuery } from '../../services/ReactQuery/hooks' +import { errorMessage } from '../../tools/toastify' +import { keys } from '../../model/Constant' + + +const MyRobotWrapper = () => { + + const store = useSelector(state => { + return { + username: state.OrthancTools.username, + } + }) + + const { isLoading, data : retrieveId } = useCustomQuery( + [keys.ROBOTS_KEY, store.username, keys.AUTOQUERY_KEY], + () => apis.task.getTaskOfUser(store.username, 'retrieve'), + () => errorMessage('Failed to retrieve robot list'), + (retrieveIds) => { + if (retrieveIds.length > 0) { + return retrieveIds[0] + } else { + return null + } + } + ) + + if (isLoading) return + if (retrieveId == null) return <> + + return ( + + ) +} export default () => { @@ -19,10 +55,10 @@ export default () => { case TAB_QUERIES: return setCurrentComponent(TAB_RESULTS)} /> case TAB_RESULTS: - return setCurrentComponent(TAB_MYROBOT)}/> + return setCurrentComponent(TAB_MYROBOT)} /> case TAB_MYROBOT: - return - case TAB_ROBOT_HISTORY: + return + case TAB_ROBOT_HISTORY: return default: break @@ -33,11 +69,11 @@ export default () => {
-

Auto Retrieve

+

Auto Retrieve