Skip to content

Commit ccf3a71

Browse files
Omit mag slider in TIFF export if only one mag is available (#8297)
* only display mag slider if there are multiple mags and fix additional axes check * add changelog * improve if clause * address review: remove <br />
1 parent 8606100 commit ccf3a71

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

CHANGELOG.unreleased.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
3939
- Fixed some layout issues in the upload view. [#8231](https://github.com/scalableminds/webknossos/pull/8231)
4040
- Fixed `FATAL: role "postgres" does not exist` error message in Docker compose. [#8240](https://github.com/scalableminds/webknossos/pull/8240)
4141
- Fixed the Zarr 3 implementation not accepting BytesCodec without "configuration" key. [#8282](https://github.com/scalableminds/webknossos/pull/8282)
42+
- 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)
4243

4344
### Removed
4445
- Removed support for HTTP API versions 3 and 4. [#8075](https://github.com/scalableminds/webknossos/pull/8075)

frontend/javascripts/oxalis/view/action-bar/download_modal_view.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,8 @@ function _DownloadModalView({
576576
</>
577577
);
578578

579+
const onlyOneMagAvailable = selectedLayerMagInfo.getMagList().length === 1;
580+
579581
const tiffExportTab = (
580582
<>
581583
<Row>
@@ -642,7 +644,7 @@ function _DownloadModalView({
642644
style={{ width: "100%" }}
643645
/>
644646
{boundingBoxCompatibilityAlerts}
645-
{selectedLayerInfos.additionalAxes != null && (
647+
{(selectedLayerInfos.additionalAxes?.length || 0) > 0 && (
646648
<Row>
647649
<Divider
648650
style={{
@@ -670,23 +672,26 @@ function _DownloadModalView({
670672
>
671673
Mag
672674
</Divider>
673-
<Row>
674-
<Col span={19}>
675-
<MagSlider magnificationInfo={selectedLayerMagInfo} value={mag} onChange={setMag} />
676-
</Col>
677-
<Col
678-
span={5}
679-
style={{ display: "flex", justifyContent: "flex-end", alignItems: "center" }}
680-
>
681-
{mag.join("-")}
682-
</Col>
683-
</Row>
675+
{!onlyOneMagAvailable && (
676+
<Row>
677+
<Col span={19}>
678+
<MagSlider magnificationInfo={selectedLayerMagInfo} value={mag} onChange={setMag} />
679+
</Col>
680+
<Col
681+
span={5}
682+
style={{ display: "flex", justifyContent: "flex-end", alignItems: "center" }}
683+
>
684+
{mag.join("-")}
685+
</Col>
686+
</Row>
687+
)}
684688
<Text
685689
style={{
686690
margin: "0 6px 12px",
687691
display: "block",
688692
}}
689693
>
694+
{onlyOneMagAvailable && <div>{mag.join("-")}</div>}
690695
Estimated file size:{" "}
691696
{estimateFileSize(selectedLayer, mag, selectedBoundingBox.boundingBox, exportFormat)}
692697
<br />

0 commit comments

Comments
 (0)