diff --git a/client/src/Annotation/index.jsx b/client/src/Annotation/index.jsx index 3690bc0..2733d43 100644 --- a/client/src/Annotation/index.jsx +++ b/client/src/Annotation/index.jsx @@ -230,8 +230,12 @@ export default () => { } } - const showAnnotationLab = () => { - preloadConfiguration(); + const showAnnotationLab = (newSettings) => { + setSettings(newSettings); + const lastSavedImageIndex = newSettings.lastSavedImageIndex || 0; + if (newSettings.images.length > 0) { + fetchImages(newSettings.images, lastSavedImageIndex); + } } useEffect(() => { preloadConfiguration(); diff --git a/client/src/SetupPage/index.jsx b/client/src/SetupPage/index.jsx index 93d685f..f6f642c 100644 --- a/client/src/SetupPage/index.jsx +++ b/client/src/SetupPage/index.jsx @@ -10,6 +10,7 @@ import React, { useState } from "react"; import Card from '@mui/material/Card'; import CardContent from '@mui/material/CardContent'; import Typography from '@mui/material/Typography'; +import IconButton from '@mui/material/IconButton'; import PropTypes from "prop-types" import ConfigureImageClassification from "../ConfigureImageClassification"; import ConfigureImageSegmentation from "../ConfigureImageSegmentation"; @@ -20,6 +21,7 @@ import { useSettings } from "../SettingsProvider"; import { useTranslation } from "react-i18next" import { Info } from '@mui/icons-material'; import NoteSection from "../NoteSection"; +import CloseIcon from "@mui/icons-material/Close"; import useMediaQuery from '@mui/material/useMediaQuery'; import config from '../config.js'; @@ -60,6 +62,7 @@ export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotat const [hasConfig, setHasConfig] = useState(false); const settingsConfig = useSettings() const isSmallDevice = useMediaQuery(theme.breakpoints.down('sm')); + const isLargeDevice = useMediaQuery(theme.breakpoints.up('md')); const updateConfiguration = (newConfig) => { const {labels, regionTypesAllowed, multipleRegionLabels, multipleRegions} = newConfig @@ -113,7 +116,7 @@ export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotat if(hasLabels) { const newSettings = {...settings, showLab: true} settingsConfig.changeSetting('settings',newSettings); - showAnnotationLab() + showAnnotationLab(newSettings) } }, [setShowLabel]); @@ -130,7 +133,7 @@ export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotat if(hasLabels) { const newSettings = {...settings, showLab: true} settingsConfig.changeSetting('settings',newSettings); - showAnnotationLab() + showAnnotationLab(newSettings) } } @@ -141,6 +144,7 @@ export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotat const isTaskInfoComplete = settings.taskDescription.trim().length > 0; const isConfigComplete = settings.configuration.labels.length > 0; const isImagesUploaded = settings.images.length > 0; + const hasShowLab = settings.showLab; return ( @@ -152,6 +156,17 @@ export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotat } label={t("setup.tabs.images")} value="images" /> + + {hasShowLab && hasConfig && } + {currentTab === "datatype" && ( <>