The frontend form validation of the dataset settings seem to be a little faulty.
Context
When I try to edit a dataset via the advanced datasource view and then try to submit the changes, I get an error that some fields have errors, although all values are valid. Only once I try to submit again, the frontend validation succeeds and then sends the data to ther server.
Expected Behavior
The first try of submitting the changes should succeed.
Current Behavior
The first try fails. I gave this a quick investigation.
The console shows an error that
validator: syncValidator(
(value: string) =>
dataLayers.filter((someLayer: APIDataLayer) => someLayer.name === value)
.length <= 1,
"Layer names must be unique.",
),
yields an undefined error in the first try to submit it, as the useWatch value is outdated and undefined. Switching to
validator: syncValidator(
(value: string) =>
form
.getFieldValue(["dataSource", "dataLayers"])
.filter((someLayer: APIDataLayer) => someLayer.name === value).length <= 1,
"Layer names must be unique.",
),
resolves this error, but the validation error still exists. With outOfDate: true being set in the error thrown by the validation. I did not have a quick idea regarding this, thus I created this issue.
Steps to Reproduce the bug
Open the dataset settings for one ds
select the advanced tab
For one color layer increase the bbox by one voxel in each dim.
try to save -> the error should occur
try to save again -> this time it should succeed
Your Environment for bug
Nothing special. Noticed why working on #8075 but seems like this was not introduced in this pr.
The frontend form validation of the dataset settings seem to be a little faulty.
Context
When I try to edit a dataset via the advanced datasource view and then try to submit the changes, I get an error that some fields have errors, although all values are valid. Only once I try to submit again, the frontend validation succeeds and then sends the data to ther server.
Expected Behavior
The first try of submitting the changes should succeed.
Current Behavior
The first try fails. I gave this a quick investigation. The console shows an error that
yields an undefined error in the first try to submit it, as the useWatch value is outdated and undefined. Switching to
resolves this error, but the validation error still exists. With
outOfDate: true
being set in the error thrown by the validation. I did not have a quick idea regarding this, thus I created this issue.Steps to Reproduce the bug
Your Environment for bug
Nothing special. Noticed why working on #8075 but seems like this was not introduced in this pr.