Skip to content

Commit ff965d8

Browse files
committed
fix next button disabled in configuration tab
1 parent 0c84d8e commit ff965d8

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

client/src/ConfigureImageClassification/index.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ export default ({ config, onChange }) => {
5757

5858
const defaultAnswers = useMemo(
5959
() => ({
60-
multipleRegions: Boolean(config.multipleRegions ? config.multipleRegions : true),
60+
multipleRegions: config.multipleRegions ?? false,
61+
multipleRegionLabels: config.multipleRegionLabels ?? false,
6162
regionTypesAllowed: config.regionTypesAllowed ? config.regionTypesAllowed : [],
62-
multipleRegionLabels: Boolean(config.multipleRegionLabels ? config.multipleRegionLabels : true),
6363
labels:
6464
(config.labels || []).map((a) => {
6565
return typeof a === "string" ? { id: a, description: a } : a
6666
}) || [],
67-
regions: config.regions ? config.regions : "Polygon"
67+
regions: config.regions ?? "Polygon"
6868
}),
6969
[config.labels, config.multipleRegions]
7070
)

client/src/ConfigureImageSegmentation/index.jsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { useTranslation } from "react-i18next"
88

99
export default ({ config, onChange }) => {
1010
const { t } = useTranslation();
11-
11+
1212
const form = {
1313
questions: [
1414
{
@@ -50,10 +50,8 @@ export default ({ config, onChange }) => {
5050
() =>
5151
asMutable(
5252
{
53-
multipleRegions: Boolean(
54-
config.multipleRegions ? config.multipleRegions : true
55-
),
56-
multipleRegionLabels: Boolean(config.multipleRegionLabels ? config.multipleRegionLabels : true),
53+
multipleRegions: config.multipleRegions ?? false,
54+
multipleRegionLabels: config.multipleRegionLabels ?? false,
5755
regionTypesAllowed: config.regionTypesAllowed,
5856
labels:
5957
(config.labels || []).map((a) =>

client/src/SetupPage/index.jsx

+15-4
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,22 @@ const StyledCardContent = styled(CardContent)(({ theme }) => ({
5252

5353

5454
export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotationLab}) => {
55-
const { configuration } = settings;
55+
const { configuration, taskChoice } = settings;
5656
const [currentTab, setTab] = useState(false);
5757
const [hasConfig, setHasConfig] = useState(false);
5858
const settingsConfig = useSettings()
59+
5960
const updateConfiguration = (newConfig) => {
60-
const {labels} = newConfig
61-
setHasConfig(labels.length > 0)
61+
const {labels, regionTypesAllowed, multipleRegionLabels, multipleRegions} = newConfig
62+
setHasConfig(labels?.length > 0)
6263
const newSettings = {
6364
...settings,
6465
configuration: {
6566
...settings.configuration,
66-
labels
67+
labels,
68+
regionTypesAllowed,
69+
multipleRegionLabels,
70+
multipleRegions
6771
}
6872
};
6973
settingsConfig.changeSetting('settings',newSettings);
@@ -87,9 +91,16 @@ export const SetupPage = ({setConfiguration, settings, setShowLabel, showAnnotat
8791

8892
const updateTaskInfo = (newTaskInfo) => {
8993
setConfiguration({type: "UPDATE_TASK_INFO", payload: newTaskInfo})
94+
settings.taskDescription = newTaskInfo.taskDescription;
95+
settings.taskChoice = newTaskInfo.taskChoice;
96+
settingsConfig.changeSetting('settings',settings);
9097
}
9198

9299
useEffect(() => {
100+
const { labels } = configuration
101+
if (labels.length > 0) {
102+
setHasConfig(true)
103+
}
93104
setTab("datatype");
94105
}, []);
95106

0 commit comments

Comments
 (0)