Skip to content

Commit

Permalink
KPMP-4847: disable grid for EM/IF & problem slides
Browse files Browse the repository at this point in the history
  • Loading branch information
HaneenT committed Jul 30, 2024
1 parent 53708c2 commit e86afc8
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions src/components/Slides/SlideViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class SlideViewer extends Component {
}

async componentDidMount() {
await this.props.selectedParticipant.selectedSlide.slideType
if (!noSlidesFound(this.props.selectedParticipant, this.props.handleError)) {
await this.renderOverlayLabels();
this.initSeaDragon();
}
this.setState({loaded: true})
await this.props.selectedParticipant.selectedSlide.slideType
if (!noSlidesFound(this.props.selectedParticipant, this.props.handleError)) {
await this.renderOverlayLabels();
this.initSeaDragon();
}
this.setState({loaded: true})
}

async componentDidUpdate(prevProps, prevState) {
Expand All @@ -52,15 +52,23 @@ class SlideViewer extends Component {
}

async renderOverlayLabels() {
if(this.props.selectedParticipant.selectedSlide.slideType === "(LM) Light Microscopy"){
await this.setState({
overlayLabel: this.props.selectedParticipant.selectedSlide.metadata.overlayLabel,
gridOverlay: this.props.selectedParticipant.selectedSlide.metadata.overlay,
renderLabels: false,
}
)
}
await this.setState({renderLabels: true});
if(this.props.selectedParticipant.selectedSlide.slideType === "(LM) Light Microscopy" &&
!(this.props.selectedParticipant.selectedSlide?.removed === true)){
await this.setState({
overlayLabel: this.props.selectedParticipant.selectedSlide.metadata.overlayLabel,
gridOverlay: this.props.selectedParticipant.selectedSlide.metadata.overlay,
renderLabels: false,
}
)
await this.setState({renderLabels: true});
}
else {
await this.setState({
overlayLabel: [],
gridOverlay: null,
renderLabels: false,
})
}
}

initSeaDragon() {
Expand Down

0 comments on commit e86afc8

Please sign in to comment.