Skip to content

Commit

Permalink
[HCS images] Ability to download displayed TIFF file (#2527) - Data s…
Browse files Browse the repository at this point in the history
…haring service
  • Loading branch information
rodichenko committed Mar 10, 2022
1 parent ec25820 commit 1f7bb23
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 2 deletions.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/

/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */

/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */

/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@
width: 300px;
}

.download-tiff-row {
display: flex;
align-items: center;
justify-content: center;
margin: 5px;
}

.details-panel {
left: 5px;
max-width: 300px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ import HcsImageControls from './hcs-image-controls';
import LoadingView from '../LoadingView';
import Panel from '../panel';
import HcsZPositionSelector from './hcs-z-position-selector';
import {
downloadAvailable as downloadCurrentTiffAvailable,
downloadCurrentTiff
} from './utilities/download-current-tiff';
import styles from './hcs-image.css';

@observer
Expand Down Expand Up @@ -417,11 +421,23 @@ class HcsImage extends React.PureComponent {
) {
return null;
}
const downloadAvailable = downloadCurrentTiffAvailable(this.hcsImageViewer);
if (!showConfiguration) {
return (
<div
className={styles.configurationActions}
>
<Button
className={styles.action}
size="small"
disabled={!downloadAvailable}
onClick={() => downloadCurrentTiff(this.hcsImageViewer)}
>
<Icon
type="camera"
className="cp-larger"
/>
</Button>
<Button
className={styles.action}
size="small"
Expand All @@ -442,6 +458,14 @@ class HcsImage extends React.PureComponent {
onClose={this.hideConfiguration}
>
<HcsImageControls />
<div className={styles.downloadTiffRow}>
<Button
disabled={!downloadAvailable}
onClick={() => downloadCurrentTiff(this.hcsImageViewer)}
>
Download current image
</Button>
</div>
</Panel>
);
};
Expand Down
Loading

0 comments on commit 1f7bb23

Please sign in to comment.