diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index d900adde2e1..dceaf8a3fd3 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -39,6 +39,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released - Fixed some layout issues in the upload view. [#8231](https://github.com/scalableminds/webknossos/pull/8231) - Fixed `FATAL: role "postgres" does not exist` error message in Docker compose. [#8240](https://github.com/scalableminds/webknossos/pull/8240) - Fixed the Zarr 3 implementation not accepting BytesCodec without "configuration" key. [#8282](https://github.com/scalableminds/webknossos/pull/8282) +- Fixed that reloading the data of a volume annotation layer did not work properly. [#8298](https://github.com/scalableminds/webknossos/pull/8298) - Removed the magnification slider for the TIFF export within the download modal if only one magnification is available for the selected layer. [#8297](https://github.com/scalableminds/webknossos/pull/8297) ### Removed diff --git a/frontend/javascripts/oxalis/view/left-border-tabs/layer_settings_tab.tsx b/frontend/javascripts/oxalis/view/left-border-tabs/layer_settings_tab.tsx index 9ff4def3ff9..2c66b66a082 100644 --- a/frontend/javascripts/oxalis/view/left-border-tabs/layer_settings_tab.tsx +++ b/frontend/javascripts/oxalis/view/left-border-tabs/layer_settings_tab.tsx @@ -386,11 +386,19 @@ class DatasetSettings extends React.PureComponent { ); }; - getReloadDataButton = (layerName: string) => { + getReloadDataButton = ( + layerName: string, + isHistogramAvailable: boolean, + maybeFallbackLayerName: string | null, + ) => { const tooltipText = "Use this when the data on the server changed."; return ( -
this.reloadLayerData(layerName)}> +
+ this.reloadLayerData(layerName, isHistogramAvailable, maybeFallbackLayerName) + } + > Reload data from server
@@ -585,6 +593,7 @@ class DatasetSettings extends React.PureComponent { isInEditMode: boolean, layerName: string, layerSettings: DatasetLayerConfiguration, + isHistogramAvailable: boolean, hasLessThanTwoColorLayers: boolean = true, ) => { const { tracing, dataset, isAdminOrManager } = this.props; @@ -645,7 +654,10 @@ class DatasetSettings extends React.PureComponent { } : null, this.props.dataset.isEditable - ? { label: this.getReloadDataButton(layerName), key: "reloadDataButton" } + ? { + label: this.getReloadDataButton(layerName, isHistogramAvailable, maybeFallbackLayer), + key: "reloadDataButton", + } : null, { label: this.getFindDataButton(layerName, isDisabled, isColorLayer, maybeVolumeTracing), @@ -976,6 +988,7 @@ class DatasetSettings extends React.PureComponent { ); const defaultLayerViewConfig = getDefaultLayerViewConfiguration(); + const isHistogramAvailable = isHistogramSupported(elementClass) && isColorLayer; return (
@@ -985,6 +998,7 @@ class DatasetSettings extends React.PureComponent { isInEditMode, layerName, layerConfiguration, + isHistogramAvailable, hasLessThanTwoColorLayers, )} {isDisabled ? null : ( @@ -994,9 +1008,7 @@ class DatasetSettings extends React.PureComponent { marginLeft: 10, }} > - {isHistogramSupported(elementClass) && layerName != null && isColorLayer - ? this.getHistogram(layerName, layerConfiguration) - : null} + {isHistogramAvailable && this.getHistogram(layerName, layerConfiguration)} { ); }; - reloadLayerData = async (layerName: string): Promise => { - await clearCache(this.props.dataset, layerName); - this.props.reloadHistogram(layerName); + reloadLayerData = async ( + layerName: string, + isHistogramAvailable: boolean, + maybeFallbackLayerName: string | null, + ): Promise => { + await clearCache(this.props.dataset, maybeFallbackLayerName ?? layerName); + if (isHistogramAvailable) this.props.reloadHistogram(layerName); await api.data.reloadBuckets(layerName); Toast.success(`Successfully reloaded data of layer ${layerName}.`); };