Skip to content
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 @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,19 @@ class DatasetSettings extends React.PureComponent<DatasetSettingsProps, State> {
);
};

getReloadDataButton = (layerName: string) => {
getReloadDataButton = (
layerName: string,
isHistogramAvailable: boolean,
maybeFallbackLayerName: string | null,
) => {
const tooltipText = "Use this when the data on the server changed.";
return (
<FastTooltip title={tooltipText}>
<div onClick={() => this.reloadLayerData(layerName)}>
<div
onClick={() =>
this.reloadLayerData(layerName, isHistogramAvailable, maybeFallbackLayerName)
}
>
<ReloadOutlined className="icon-margin-right" />
Reload data from server
</div>
Expand Down Expand Up @@ -585,6 +593,7 @@ class DatasetSettings extends React.PureComponent<DatasetSettingsProps, State> {
isInEditMode: boolean,
layerName: string,
layerSettings: DatasetLayerConfiguration,
isHistogramAvailable: boolean,
hasLessThanTwoColorLayers: boolean = true,
) => {
const { tracing, dataset, isAdminOrManager } = this.props;
Expand Down Expand Up @@ -645,7 +654,10 @@ class DatasetSettings extends React.PureComponent<DatasetSettingsProps, State> {
}
: 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),
Expand Down Expand Up @@ -976,6 +988,7 @@ class DatasetSettings extends React.PureComponent<DatasetSettingsProps, State> {
);

const defaultLayerViewConfig = getDefaultLayerViewConfiguration();
const isHistogramAvailable = isHistogramSupported(elementClass) && isColorLayer;

return (
<div key={layerName} style={style} ref={setNodeRef}>
Expand All @@ -985,6 +998,7 @@ class DatasetSettings extends React.PureComponent<DatasetSettingsProps, State> {
isInEditMode,
layerName,
layerConfiguration,
isHistogramAvailable,
hasLessThanTwoColorLayers,
)}
{isDisabled ? null : (
Expand All @@ -994,9 +1008,7 @@ class DatasetSettings extends React.PureComponent<DatasetSettingsProps, State> {
marginLeft: 10,
}}
>
{isHistogramSupported(elementClass) && layerName != null && isColorLayer
? this.getHistogram(layerName, layerConfiguration)
: null}
{isHistogramAvailable && this.getHistogram(layerName, layerConfiguration)}
<NumberSliderSetting
label={opacityLabel}
min={0}
Expand Down Expand Up @@ -1077,9 +1089,13 @@ class DatasetSettings extends React.PureComponent<DatasetSettingsProps, State> {
);
};

reloadLayerData = async (layerName: string): Promise<void> => {
await clearCache(this.props.dataset, layerName);
this.props.reloadHistogram(layerName);
reloadLayerData = async (
layerName: string,
isHistogramAvailable: boolean,
maybeFallbackLayerName: string | null,
): Promise<void> => {
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}.`);
};
Expand Down