Skip to content

Commit

Permalink
Preview for the HCS images (#2489) - "Channels settings" panel
Browse files Browse the repository at this point in the history
  • Loading branch information
rodichenko committed Feb 10, 2022
1 parent 4ac153e commit ca5d383
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class Channel extends React.PureComponent {
};
return (
<Popover
overlayClassName="popover-overlay-content-no-padding"
onVisibleChange={handleColorPickerVisibility}
key="color picker"
trigger={['click']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ function ColorMap (
Blending mode:
</span>
<Select
allowClear={colorMap !== ''}
value={colorMap}
disabled={pending}
className={styles.colorMapSelector}
onChange={hcsViewerState.changeColorMap}
onChange={(o) => hcsViewerState.changeColorMap(o || '')}
>
<Select.Option key="empty" value="">
<i className="cp-text-not-important">Unset</i>
Expand Down
41 changes: 33 additions & 8 deletions client/src/components/special/hcs-image/hcs-image.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,37 +88,62 @@
width: 100%;
}

.details-panel {
.configuration-actions {
position: absolute;
top: 5px;
left: 5px;
bottom: 5px;
right: 5px;
z-index: 1;
}

.configuration-actions .action {
margin: 5px;
line-height: 1;
}

.details-panel,
.configuration {
position: absolute;
top: 5px;
max-height: calc(100% - 10px);
z-index: 2;
display: flex;
overflow: auto;
}

.configuration {
right: 5px;
width: 300px;
}

.details-panel {
left: 5px;
max-width: 300px;
min-width: 200px;
}

.details-panel-content {
.panel-content {
flex: 1;
overflow: auto;
display: flex;
flex-direction: column;
width: 100%;
max-height: 100%;
border-radius: 2px;
}

.details-panel .details-panel-content .details-header {
.panel-content .panel-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 5px;
}

.details-panel .details-panel-content .details {
.panel-content .content {
flex: 1;
overflow: auto;
}

.details-panel .close-button {
.details-panel .close-button,
.configuration .close-button {
cursor: pointer;
}

Expand Down
85 changes: 80 additions & 5 deletions client/src/components/special/hcs-image/hcs-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class HcsImage extends React.PureComponent {
wellWidth: 0,
wellHeight: 0,
sequences: [],
showDetails: false
showDetails: false,
showConfiguration: false
};

@observable hcsInfo;
Expand Down Expand Up @@ -352,6 +353,18 @@ class HcsImage extends React.PureComponent {
});
}

showConfiguration = () => {
this.setState({
showConfiguration: true
});
}

hideConfiguration = () => {
this.setState({
showConfiguration: false
});
}

showDetailsPanel = () => {
const {
children,
Expand All @@ -364,12 +377,12 @@ class HcsImage extends React.PureComponent {
<div
className={
classNames(
styles.detailsPanelContent,
styles.panelContent,
'cp-panel-card'
)
}
>
<div className={styles.detailsHeader}>
<div className={styles.panelHeader}>
<b>{detailsTitle}</b>
<Icon
className={styles.closeButton}
Expand All @@ -378,14 +391,74 @@ class HcsImage extends React.PureComponent {
onClick={this.hideDetails}
/>
</div>
<div className={styles.details}>
<div className={styles.content}>
{children}
</div>
</div>
</div>
);
}

renderConfigurationActions = () => {
const {
error,
showConfiguration
} = this.state;
if (
error ||
!this.hcsViewerState ||
!this.hcsViewerState.channels ||
!this.hcsViewerState.channels.length
) {
return null;
}
if (!showConfiguration) {
return (
<div
className={styles.configurationActions}
>
<Button
className={styles.action}
size="small"
onClick={this.showConfiguration}
>
<Icon
type="setting"
className="cp-larger"
/>
</Button>
</div>
);
}
return (
<div
className={styles.configuration}
>
<div
className={
classNames(
styles.panelContent,
'cp-panel-card'
)
}
>
<div className={styles.panelHeader}>
<b>Settings</b>
<Icon
className={styles.closeButton}
type="close"
size="small"
onClick={this.hideConfiguration}
/>
</div>
<div className={styles.content}>
<HcsImageControls />
</div>
</div>
</div>
);
};

render () {
const {
className,
Expand Down Expand Up @@ -459,6 +532,9 @@ class HcsImage extends React.PureComponent {
</div>
)
}
{
!error && this.renderConfigurationActions()
}
{
showDetails
? this.showDetailsPanel()
Expand Down Expand Up @@ -486,7 +562,6 @@ class HcsImage extends React.PureComponent {
)
}
>
<HcsImageControls />
<HcsCellSelector
className={styles.selectorContainer}
cells={wells}
Expand Down
4 changes: 4 additions & 0 deletions client/src/staticStyles/antd-extensions.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@
.ant-collapse > .ant-collapse-item.cp-collapse-body-no-padding > .ant-collapse-content {
padding: 0;
}

.ant-popover.popover-overlay-content-no-padding .ant-popover-inner-content {
padding: 0;
}

0 comments on commit ca5d383

Please sign in to comment.