Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix creating/editing a volume task type #5532

Merged
merged 5 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed a bug in the application of agglomerate files where the `cumsum.json` was not used correctly. [#5499](https://github.com/scalableminds/webknossos/pull/5499)
- Improve loading of precomputed meshes and fix some issues (e.g., deleting a mesh which was still being loaded) which could produce an invalid state. [#5519](https://github.com/scalableminds/webknossos/issues/5519)
- Fixed an innocuous error toast when opening the dataset import view. [#5526](https://github.com/scalableminds/webknossos/pull/5526)
- Fixed that creating/editing a volume task type didn't allow submitting the form. [#5532](https://github.com/scalableminds/webknossos/pull/5532)

### Removed
- Removed the button to load or refresh the isosurface of the centered cell from the 3D view. Instead, this action can be triggered from the "Meshes" tab. [#5440](https://github.com/scalableminds/webknossos/pull/5440)
Expand Down
48 changes: 27 additions & 21 deletions frontend/javascripts/admin/tasktype/task_type_create_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,27 +290,33 @@ class TaskTypeCreateView extends React.PureComponent<Props, State> {
prevValues.tracingType !== curValues.tracingType
}
>
{({ getFieldValue }) =>
getFieldValue(["tracingType"]) !== "volume" ? (
<React.Fragment>
<FormItem
name={["settings", "somaClickingAllowed"]}
label="Settings"
valuePropName="checked"
>
<Checkbox>Allow Single-node-tree mode (&quot;Soma clicking&quot;)</Checkbox>
</FormItem>

<FormItem name={["settings", "branchPointsAllowed"]} valuePropName="checked">
<Checkbox>Allow Branchpoints</Checkbox>
</FormItem>

<FormItem name={["settings", "mergerMode"]} valuePropName="checked">
<Checkbox>Merger Mode</Checkbox>
</FormItem>
</React.Fragment>
) : null
}
{({ getFieldValue }) => (
<div
style={{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd propose to add a comment so that this doesn't happen again in the future

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good point 👍

// These form items are always emitted here and only their visibility
// is changed, since the values are always needed to create/edit
// a task type (its schema requires it even though the fields are
// irrelevant for volume-only tasks).
display: getFieldValue(["tracingType"]) === "volume" ? "none" : "block",
}}
>
<FormItem
name={["settings", "somaClickingAllowed"]}
label="Settings"
valuePropName="checked"
>
<Checkbox>Allow Single-node-tree mode (&quot;Soma clicking&quot;)</Checkbox>
</FormItem>

<FormItem name={["settings", "branchPointsAllowed"]} valuePropName="checked">
<Checkbox>Allow Branchpoints</Checkbox>
</FormItem>

<FormItem name={["settings", "mergerMode"]} valuePropName="checked">
<Checkbox>Merger Mode</Checkbox>
</FormItem>
</div>
)}
</FormItem>

<FormItem
Expand Down