From 65051f599c4ff53d043af4be42e7a1182576449b Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 09:22:51 -0400 Subject: [PATCH 001/252] only set overlayLabel and gridOverlay statenfor images with metadata --- src/components/Slides/SlideViewer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Slides/SlideViewer.js b/src/components/Slides/SlideViewer.js index e7a363f..55bfffd 100755 --- a/src/components/Slides/SlideViewer.js +++ b/src/components/Slides/SlideViewer.js @@ -24,9 +24,9 @@ class SlideViewer extends Component { showGrid: false, showGridLabel: false, overlayDivs: '', - overlayLabel: this.props.selectedParticipant.selectedSlide.metadata.overlayLabel, + overlayLabel: null, renderLabels: true, - gridOverlay: this.props.selectedParticipant.selectedSlide.metadata.overlay + gridOverlay: null } } @@ -35,6 +35,10 @@ class SlideViewer extends Component { await this.renderOverlayLabels(); this.initSeaDragon(); } + if(this.props.selectedParticipant.selectedSlide.metadata){ + this.setState({overlayLabel: this.props.selectedParticipant.selectedSlide.metadata.overlayLabel, + gridOverlay: this.props.selectedParticipant.selectedSlide.metadata.gridOverlay}) + } } async componentDidUpdate(prevProps, prevState) { From 36b5c076f9e4e589ff33d5a21c555462bb2b41ae Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 10:19:49 -0400 Subject: [PATCH 002/252] move if statement to renderOverlayLabels mthod --- src/components/Slides/SlideViewer.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/Slides/SlideViewer.js b/src/components/Slides/SlideViewer.js index 55bfffd..d8e882a 100755 --- a/src/components/Slides/SlideViewer.js +++ b/src/components/Slides/SlideViewer.js @@ -24,7 +24,7 @@ class SlideViewer extends Component { showGrid: false, showGridLabel: false, overlayDivs: '', - overlayLabel: null, + overlayLabel: [], renderLabels: true, gridOverlay: null } @@ -35,10 +35,7 @@ class SlideViewer extends Component { await this.renderOverlayLabels(); this.initSeaDragon(); } - if(this.props.selectedParticipant.selectedSlide.metadata){ - this.setState({overlayLabel: this.props.selectedParticipant.selectedSlide.metadata.overlayLabel, - gridOverlay: this.props.selectedParticipant.selectedSlide.metadata.gridOverlay}) - } + } async componentDidUpdate(prevProps, prevState) { @@ -52,8 +49,14 @@ class SlideViewer extends Component { } async renderOverlayLabels() { - await this.setState({ overlayLabel: this.props.selectedParticipant.selectedSlide.metadata.overlayLabel, gridOverlay: this.props.selectedParticipant.selectedSlide.metadata.overlay, - renderLabels: false }); + 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}); } From 0d5ca195aad0163ed045352bd761d263b56b02ba Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 11:57:22 -0400 Subject: [PATCH 003/252] log result --- src/actions/Participants/participantActions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/actions/Participants/participantActions.js b/src/actions/Participants/participantActions.js index ce0bdbc..c62f550 100644 --- a/src/actions/Participants/participantActions.js +++ b/src/actions/Participants/participantActions.js @@ -29,6 +29,7 @@ export const getParticipantSlides = (participantId, props) => { var config = { headers: {'Content-Type': 'application/json', 'Cache-control': 'no-cache'}}; axios.get('/api/v1/slides/' + participantId, config) .then(result => { + console.log(result) let slides = participantSelectSorter(result.data); dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); props.history.push(process.env.PUBLIC_URL + "/slides"); From 72ccbaec85908bc39ebd142944d96217d2d15cff Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 12:02:03 -0400 Subject: [PATCH 004/252] log result.data --- src/actions/Participants/participantActions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/actions/Participants/participantActions.js b/src/actions/Participants/participantActions.js index c62f550..2a1a1de 100644 --- a/src/actions/Participants/participantActions.js +++ b/src/actions/Participants/participantActions.js @@ -30,6 +30,7 @@ export const getParticipantSlides = (participantId, props) => { axios.get('/api/v1/slides/' + participantId, config) .then(result => { console.log(result) + console.log(result.data) let slides = participantSelectSorter(result.data); dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); props.history.push(process.env.PUBLIC_URL + "/slides"); From 55496d8d637a0803a1f17c07bf1925eb3c99d912 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 13:11:52 -0400 Subject: [PATCH 005/252] loop through backend data and see what it looks like --- src/actions/Participants/participantActions.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/actions/Participants/participantActions.js b/src/actions/Participants/participantActions.js index 2a1a1de..56400d1 100644 --- a/src/actions/Participants/participantActions.js +++ b/src/actions/Participants/participantActions.js @@ -29,10 +29,13 @@ export const getParticipantSlides = (participantId, props) => { var config = { headers: {'Content-Type': 'application/json', 'Cache-control': 'no-cache'}}; axios.get('/api/v1/slides/' + participantId, config) .then(result => { - console.log(result) - console.log(result.data) - let slides = participantSelectSorter(result.data); - dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); + for (let i = 0; i < Object.length(result.data); i++){ + let slides = participantSelectSorter(Object.keys(result.data)[i]) + console.log(slides) + dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); + } + // let slides = participantSelectSorter(result.data); + props.history.push(process.env.PUBLIC_URL + "/slides"); }) .catch(err => { From a9036d9f96c5a98f437ff214e390cea119facb64 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 13:17:37 -0400 Subject: [PATCH 006/252] do more loggign --- src/actions/Participants/participantActions.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/actions/Participants/participantActions.js b/src/actions/Participants/participantActions.js index 56400d1..76297b2 100644 --- a/src/actions/Participants/participantActions.js +++ b/src/actions/Participants/participantActions.js @@ -29,13 +29,14 @@ export const getParticipantSlides = (participantId, props) => { var config = { headers: {'Content-Type': 'application/json', 'Cache-control': 'no-cache'}}; axios.get('/api/v1/slides/' + participantId, config) .then(result => { - for (let i = 0; i < Object.length(result.data); i++){ - let slides = participantSelectSorter(Object.keys(result.data)[i]) - console.log(slides) - dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); - } - // let slides = participantSelectSorter(result.data); - + // for (let i = 0; i < Object.length(result.data); i++){ + // let slides = participantSelectSorter(Object.keys(result.data)[i]) + + // } + let slides = participantSelectSorter(Object.keys(result.data)[0]) + console.log(slides) + dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); + console.log(Object.length(result.data)) props.history.push(process.env.PUBLIC_URL + "/slides"); }) .catch(err => { From 33c41e8c4e52c37e61412eed24834aadaf5754c8 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 13:35:56 -0400 Subject: [PATCH 007/252] more logging --- src/actions/Participants/participantActions.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/actions/Participants/participantActions.js b/src/actions/Participants/participantActions.js index 76297b2..4770b79 100644 --- a/src/actions/Participants/participantActions.js +++ b/src/actions/Participants/participantActions.js @@ -33,8 +33,11 @@ export const getParticipantSlides = (participantId, props) => { // let slides = participantSelectSorter(Object.keys(result.data)[i]) // } - let slides = participantSelectSorter(Object.keys(result.data)[0]) - console.log(slides) + console.log(Object.length(result.data)) + let configType = Object.keys(result.data) + // let slides = participantSelectSorter(Object.keys(result.data)[0]) + + console.log(configType) dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); console.log(Object.length(result.data)) props.history.push(process.env.PUBLIC_URL + "/slides"); From 185d7e4aa753b191efcc71bfda6dcf2b7599dbc9 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 13:37:00 -0400 Subject: [PATCH 008/252] define slides --- src/actions/Participants/participantActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions/Participants/participantActions.js b/src/actions/Participants/participantActions.js index 4770b79..7eb9295 100644 --- a/src/actions/Participants/participantActions.js +++ b/src/actions/Participants/participantActions.js @@ -35,7 +35,7 @@ export const getParticipantSlides = (participantId, props) => { // } console.log(Object.length(result.data)) let configType = Object.keys(result.data) - // let slides = participantSelectSorter(Object.keys(result.data)[0]) + let slides = participantSelectSorter(Object.keys(result.data)[0]) console.log(configType) dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); From 2ba65da0d9dc9b6db79b7ebfe83e6f15ba4ec7f5 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 14:30:03 -0400 Subject: [PATCH 009/252] dispatch slides for each image type --- .../Participants/participantActions.js | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/actions/Participants/participantActions.js b/src/actions/Participants/participantActions.js index 7eb9295..7c407b0 100644 --- a/src/actions/Participants/participantActions.js +++ b/src/actions/Participants/participantActions.js @@ -29,17 +29,18 @@ export const getParticipantSlides = (participantId, props) => { var config = { headers: {'Content-Type': 'application/json', 'Cache-control': 'no-cache'}}; axios.get('/api/v1/slides/' + participantId, config) .then(result => { - // for (let i = 0; i < Object.length(result.data); i++){ - // let slides = participantSelectSorter(Object.keys(result.data)[i]) - - // } - console.log(Object.length(result.data)) - let configType = Object.keys(result.data) - let slides = participantSelectSorter(Object.keys(result.data)[0]) - - console.log(configType) - dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); - console.log(Object.length(result.data)) + if (result.data["(LM) Light Microscopy"] != null){ + let slides = participantSelectSorter(result.data["(LM) Light Microscopy"]) + dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); + } + if (result.data["(IF) Immunofluorescence"] != null){ + let slides = participantSelectSorter(result.data["(IF) Immunofluorescence"]) + dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); + } + if (result.data["(EM) Electron Microscopy"] != null){ + let slides = participantSelectSorter(result.data["(EM) Electron Microscopy"]) + dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); + } props.history.push(process.env.PUBLIC_URL + "/slides"); }) .catch(err => { From c7c510e9e03668a95b7d572665fc48f70bc69e3f Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:10:59 -0400 Subject: [PATCH 010/252] first pass at accordions --- src/components/Slides/Menu/Menu.js | 3 ++- src/components/Slides/Menu/SlideList.js | 28 ++++++++++++++++++++++--- src/components/Slides/SlideViewer.js | 3 ++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/components/Slides/Menu/Menu.js b/src/components/Slides/Menu/Menu.js index b8825c7..13cb550 100755 --- a/src/components/Slides/Menu/Menu.js +++ b/src/components/Slides/Menu/Menu.js @@ -36,7 +36,8 @@ class Menu extends Component { verticalRef={this.props.verticalRef} horizontal={this.props.horizontal} vertical={this.props.vertical} - toggleMenu={this.toggleMenu} /> + toggleMenu={this.toggleMenu} + slideType={this.props.slideType}/> diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index 2576d31..24cf4d8 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Col, Row } from 'reactstrap'; +import { Col, Row, UncontrolledAccordion, AccordionItem, AccordionHeader, AccordionBody} from 'reactstrap'; import { noSlidesFound, getStainImageName @@ -31,7 +31,29 @@ class SlideList extends Component { ); diff --git a/src/components/Slides/SlideViewer.js b/src/components/Slides/SlideViewer.js index d8e882a..50c19e8 100755 --- a/src/components/Slides/SlideViewer.js +++ b/src/components/Slides/SlideViewer.js @@ -123,7 +123,8 @@ class SlideViewer extends Component { horizontal='500' horizontalRef={this.horizontalRef} verticalRef={this.verticalRef} - selectedParticipant={this.props.selectedParticipant} /> + selectedParticipant={this.props.selectedParticipant} + slideType={this.props.selectedParticipant.selectedSlide.slideType}/>
{ this.el = node; }}>
From df39287d5a4ace554d8c8d820589b3c2b5b9e90f Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:12:39 -0400 Subject: [PATCH 011/252] update reactstrap for accordion --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1efc722..6d2b1f0 100755 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "react-ga4": "2.1.0", "react-redux": "7.2.2", "react-router-dom": "5.2.0", - "reactstrap": "8.9.0", + "reactstrap": "9.2.0", "redux": "4.0.5", "redux-thunk": "2.3.0", "typescript": "3.7.2" From 9b145bc0bc58d8a39ea44e049828f0b1c4e5f26b Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:16:49 -0400 Subject: [PATCH 012/252] upgrade common-components and pass accordion styles --- package.json | 2 +- src/index.scss | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d2b1f0..eb44daf 100755 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "es6-shim": "0.35.6", "history": "4.10.1", "jquery": "3.6.0", - "kpmp-common-components": "1.2.1", + "kpmp-common-components": "1.2.13", "lodash": "4.17.21", "openseadragon": "2.4.1", "prop-types": "15.8.1", diff --git a/src/index.scss b/src/index.scss index 3f4bb01..21d3729 100755 --- a/src/index.scss +++ b/src/index.scss @@ -2,6 +2,15 @@ @import "common-values.scss"; @import "grid.scss"; +$accordion-button-active-color: black; +$accordion-button-color: black; +$bs-border-color: #dee2e6; +$accordion-icon-width: .8125rem; + +@import "../node_modules/bootstrap/scss/variables"; +@import "../node_modules/bootstrap/scss/mixins"; +// import accordion component with variable overrides applied +@import "../node_modules/bootstrap/scss/_accordion.scss"; // Temporary classes .content-warning { From ec1523c36f94477711e1f368b4fec151bbffbe92 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:17:22 -0400 Subject: [PATCH 013/252] more accordion styles --- src/index.scss | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/index.scss b/src/index.scss index 21d3729..d454d5d 100755 --- a/src/index.scss +++ b/src/index.scss @@ -12,6 +12,29 @@ $accordion-icon-width: .8125rem; // import accordion component with variable overrides applied @import "../node_modules/bootstrap/scss/_accordion.scss"; +.accordion{ + --bs-accordion-border-color: #dee2e6; +} + +.accordion-button{ +height: .25rem !important; +font-size: .8125rem !important; +--bs-accordion-body-padding-y: .5rem !important; +font-weight: 500; +} + +.accordion-item:first-of-type(.collapsed) .accordion-button { + --bs-accordion-color: $accordion-button-color + --bs-accorion-border-color: $accordion-button-color + box-shadow: inset 0 -1px 0 rgba(0,0,0,.125); +} + +.accordion-button:not(.collapsed)::after { + background-color: #e7f1ff; + --bs-accordion-btn-color: $accordion-button-color; + --bs-accordion-active-color: $accordion-button-active-color; +} + // Temporary classes .content-warning { font-size: 16px; From 78630c44ece15340b3ba14db2c25b809e6112e42 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:19:47 -0400 Subject: [PATCH 014/252] fix bootstrap --- package.json | 2 +- src/index.scss | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index eb44daf..f49ec48 100755 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "ajv": "8.10.0", "antd": "5.7.3", "axios": "0.26.0", - "bootstrap": "4.3.1", + "bootstrap": "5.2.3", "es6-shim": "0.35.6", "history": "4.10.1", "jquery": "3.6.0", diff --git a/src/index.scss b/src/index.scss index d454d5d..7272fb0 100755 --- a/src/index.scss +++ b/src/index.scss @@ -2,6 +2,8 @@ @import "common-values.scss"; @import "grid.scss"; +@import "../node_modules/bootstrap/scss/functions"; + $accordion-button-active-color: black; $accordion-button-color: black; $bs-border-color: #dee2e6; From bbb401d391b73dbd4270dfb41e1ca4f9678850b2 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:23:44 -0400 Subject: [PATCH 015/252] fix weird image sizes --- src/components/Slides/Menu/SlideList.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index 24cf4d8..a4fd962 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -38,6 +38,7 @@ class SlideList extends Component { (LM) Light Microscopy + From d7a9d4204db5ecf0d4b4eee62e155ee5c5dd2553 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:32:08 -0400 Subject: [PATCH 016/252] remove padding --- src/index.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.scss b/src/index.scss index 7272fb0..1964a01 100755 --- a/src/index.scss +++ b/src/index.scss @@ -21,7 +21,7 @@ $accordion-icon-width: .8125rem; .accordion-button{ height: .25rem !important; font-size: .8125rem !important; ---bs-accordion-body-padding-y: .5rem !important; +--bs-accordion-body-padding-y: 0rem !important; font-weight: 500; } From b0cf7b1dfa42b0d002cb24f4cd231540cce689be Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:33:00 -0400 Subject: [PATCH 017/252] remove height and font size --- src/index.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/index.scss b/src/index.scss index 1964a01..39f9cce 100755 --- a/src/index.scss +++ b/src/index.scss @@ -19,8 +19,6 @@ $accordion-icon-width: .8125rem; } .accordion-button{ -height: .25rem !important; -font-size: .8125rem !important; --bs-accordion-body-padding-y: 0rem !important; font-weight: 500; } From 5231edcc9478bfb4005352c31b90638bd577c26e Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:35:51 -0400 Subject: [PATCH 018/252] remove padding --- src/index.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.scss b/src/index.scss index 39f9cce..a6eef66 100755 --- a/src/index.scss +++ b/src/index.scss @@ -19,7 +19,7 @@ $accordion-icon-width: .8125rem; } .accordion-button{ ---bs-accordion-body-padding-y: 0rem !important; +padding: 0rem !important; font-weight: 500; } From 65b9532402b6ab68c81c230d56b07f2930b37569 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:38:33 -0400 Subject: [PATCH 019/252] use default css for accordion --- src/index.scss | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/index.scss b/src/index.scss index a6eef66..3f0d625 100755 --- a/src/index.scss +++ b/src/index.scss @@ -18,11 +18,6 @@ $accordion-icon-width: .8125rem; --bs-accordion-border-color: #dee2e6; } -.accordion-button{ -padding: 0rem !important; -font-weight: 500; -} - .accordion-item:first-of-type(.collapsed) .accordion-button { --bs-accordion-color: $accordion-button-color --bs-accorion-border-color: $accordion-button-color From 06e4079570cf81d2a08f91cb011586d5e6893f24 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:43:34 -0400 Subject: [PATCH 020/252] set padding for x and y to 0 --- src/index.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.scss b/src/index.scss index 3f0d625..bf43c76 100755 --- a/src/index.scss +++ b/src/index.scss @@ -18,6 +18,11 @@ $accordion-icon-width: .8125rem; --bs-accordion-border-color: #dee2e6; } +.accordion-button{ +--bs-accordion-body-padding-y: 0px !important; +--bs-accordion-body-padding-x: 0px !important +} + .accordion-item:first-of-type(.collapsed) .accordion-button { --bs-accordion-color: $accordion-button-color --bs-accorion-border-color: $accordion-button-color From 7deebffbe9700198da113ce826ec348c25c175ec Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 15:45:14 -0400 Subject: [PATCH 021/252] use bootstrap variable --- src/index.scss | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/index.scss b/src/index.scss index bf43c76..a448904 100755 --- a/src/index.scss +++ b/src/index.scss @@ -8,6 +8,7 @@ $accordion-button-active-color: black; $accordion-button-color: black; $bs-border-color: #dee2e6; $accordion-icon-width: .8125rem; +$accordion-body-padding: 0rem; @import "../node_modules/bootstrap/scss/variables"; @import "../node_modules/bootstrap/scss/mixins"; @@ -18,11 +19,6 @@ $accordion-icon-width: .8125rem; --bs-accordion-border-color: #dee2e6; } -.accordion-button{ ---bs-accordion-body-padding-y: 0px !important; ---bs-accordion-body-padding-x: 0px !important -} - .accordion-item:first-of-type(.collapsed) .accordion-button { --bs-accordion-color: $accordion-button-color --bs-accorion-border-color: $accordion-button-color From b82572d15ed1fb61d4daf08286f8db10eca405ca Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Mon, 25 Mar 2024 16:07:57 -0400 Subject: [PATCH 022/252] use correct accordion sass variable --- src/index.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.scss b/src/index.scss index a448904..da90234 100755 --- a/src/index.scss +++ b/src/index.scss @@ -8,7 +8,8 @@ $accordion-button-active-color: black; $accordion-button-color: black; $bs-border-color: #dee2e6; $accordion-icon-width: .8125rem; -$accordion-body-padding: 0rem; +$accordion-body-padding-y: 0rem; +$accordion-body-padding-x: 0rem; @import "../node_modules/bootstrap/scss/variables"; @import "../node_modules/bootstrap/scss/mixins"; From ef70a1a006a78522a36d5191c71ebebeee34337c Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 14:20:39 -0400 Subject: [PATCH 023/252] change class names to adapt to bottstrap v5 --- src/components/Slides/Menu/Header.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Slides/Menu/Header.js b/src/components/Slides/Menu/Header.js index d182b1e..07043ec 100755 --- a/src/components/Slides/Menu/Header.js +++ b/src/components/Slides/Menu/Header.js @@ -65,17 +65,17 @@ class Header extends Component {
CASE ID: {this.props.selectedParticipant.id} -
+
- + this.handlePreviousSlide()} size="lg" /> this.handleNextSlide()} size="lg" /> -
+
-
+
From fcdba1af81cb15b9eb626a61c2b7e101a738cce4 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 14:27:25 -0400 Subject: [PATCH 024/252] Remove react column --- src/components/Slides/Menu/Header.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/Slides/Menu/Header.js b/src/components/Slides/Menu/Header.js index 07043ec..8dd83d6 100755 --- a/src/components/Slides/Menu/Header.js +++ b/src/components/Slides/Menu/Header.js @@ -65,9 +65,7 @@ class Header extends Component {
CASE ID: {this.props.selectedParticipant.id} -
- -
+
From 4f927a412eb0a9b5bd7fd3a40ceac828298136ff Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 14:29:57 -0400 Subject: [PATCH 025/252] put div inside of col --- src/components/Slides/Menu/Header.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Slides/Menu/Header.js b/src/components/Slides/Menu/Header.js index 8dd83d6..5de72e7 100755 --- a/src/components/Slides/Menu/Header.js +++ b/src/components/Slides/Menu/Header.js @@ -64,8 +64,10 @@ class Header extends Component { return (
- CASE ID: {this.props.selectedParticipant.id} -
+ CASE ID: {this.props.selectedParticipant.id} +
+ +
From a594bea3e6b78e89c223f7c87f32f712799f01b1 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 15:30:19 -0400 Subject: [PATCH 026/252] write accordionList component --- src/components/Slides/Menu/AccordionList.js | 43 ++++++++++++++++++++ src/components/Slides/Menu/SlideList.js | 44 +++------------------ 2 files changed, 49 insertions(+), 38 deletions(-) create mode 100644 src/components/Slides/Menu/AccordionList.js diff --git a/src/components/Slides/Menu/AccordionList.js b/src/components/Slides/Menu/AccordionList.js new file mode 100644 index 0000000..8f6be6e --- /dev/null +++ b/src/components/Slides/Menu/AccordionList.js @@ -0,0 +1,43 @@ +import React, { Component } from "react"; +import { Row, Col, AccordionItem, AccordionHeader, AccordionBody } from "reactstrap"; +import PropTypes from 'prop-types'; +import { + getStainImageName +} from '../slideHelpers.js'; + +class AccordionList extends Component { + + render() { + return ( + + + {this.props.slideType} + + + + + + ) + } +} + +AccordionList.propTypes = { + targetId: PropTypes.bool.isRequired, + accordionId: PropTypes.bool.isRequired, + slideType: PropTypes.bool.isRequired +} + +export default AccordionList; \ No newline at end of file diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index a4fd962..33d35e1 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -4,6 +4,7 @@ import { noSlidesFound, getStainImageName } from '../slideHelpers.js'; +import AccordionList from './AccordionList.js'; import PropTypes from 'prop-types'; @@ -26,49 +27,16 @@ class SlideList extends Component { } render() { - + let slideType = this.props.selectedParticipant.selectedSlide.slideType; return ( ); From 1c78a507c1e63bccc97f793a4d70985a116a1c1b Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 15:33:30 -0400 Subject: [PATCH 027/252] pass selected participant --- src/components/Slides/Menu/AccordionList.js | 3 ++- src/components/Slides/Menu/SlideList.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Slides/Menu/AccordionList.js b/src/components/Slides/Menu/AccordionList.js index 8f6be6e..0ec5c3d 100644 --- a/src/components/Slides/Menu/AccordionList.js +++ b/src/components/Slides/Menu/AccordionList.js @@ -37,7 +37,8 @@ class AccordionList extends Component { AccordionList.propTypes = { targetId: PropTypes.bool.isRequired, accordionId: PropTypes.bool.isRequired, - slideType: PropTypes.bool.isRequired + slideType: PropTypes.bool.isRequired, + selectedParticipant: PropTypes.bool.isRequired, } export default AccordionList; \ No newline at end of file diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index 33d35e1..0dca202 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -34,7 +34,7 @@ class SlideList extends Component { { - slideType === "(LM) Light Microscopy" ? : '' + slideType === "(LM) Light Microscopy" ? : '' } From 0d2f4ad26e36531da4a296126c3167c5b1d5a570 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 15:37:44 -0400 Subject: [PATCH 028/252] copy accordionList logic --- src/components/Slides/Menu/SlideList.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index 0dca202..53e5b39 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -33,9 +33,10 @@ class SlideList extends Component {
- { - slideType === "(LM) Light Microscopy" ? : '' - } + {slideType === "(LM) Light Microscopy" ? : ''} + {slideType === "(EM) Electron Microscopy" ? : ''} + {slideType === "(IF) Immunoflourescence" ? : ''} +
From d713eb5ce69db1bb48922990d949923893e50039 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 15:40:04 -0400 Subject: [PATCH 029/252] handle selected slide logic --- src/components/Slides/Menu/AccordionList.js | 10 ++++++++++ src/components/Slides/Menu/SlideList.js | 13 +------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/components/Slides/Menu/AccordionList.js b/src/components/Slides/Menu/AccordionList.js index 0ec5c3d..181ec4a 100644 --- a/src/components/Slides/Menu/AccordionList.js +++ b/src/components/Slides/Menu/AccordionList.js @@ -7,6 +7,16 @@ import { class AccordionList extends Component { + constructor(props) { + super(props); + this.handleSelectSlide = this.handleSelectSlide.bind(this); + } + + handleSelectSlide(slide) { + this.props.setSelectedSlide(slide); + this.props.toggleMenu(true); + } + render() { return ( diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index 53e5b39..6b8fbf9 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -1,8 +1,7 @@ import React, { Component } from 'react'; -import { Col, Row, UncontrolledAccordion, AccordionItem, AccordionHeader, AccordionBody} from 'reactstrap'; +import { Col, UncontrolledAccordion} from 'reactstrap'; import { noSlidesFound, - getStainImageName } from '../slideHelpers.js'; import AccordionList from './AccordionList.js'; import PropTypes from 'prop-types'; @@ -12,16 +11,6 @@ import Header from './Header'; class SlideList extends Component { - constructor(props) { - super(props); - this.handleSelectSlide = this.handleSelectSlide.bind(this); - } - - handleSelectSlide(slide) { - this.props.setSelectedSlide(slide); - this.props.toggleMenu(true); - } - componentDidUpdate() { noSlidesFound(this.props.selectedParticipant); } From 3a2c60627ec3dc933004f1f2d0e0215e9bff4cd4 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 16:05:39 -0400 Subject: [PATCH 030/252] log selected participant --- src/components/Slides/Menu/AccordionList.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/Slides/Menu/AccordionList.js b/src/components/Slides/Menu/AccordionList.js index 181ec4a..02d0870 100644 --- a/src/components/Slides/Menu/AccordionList.js +++ b/src/components/Slides/Menu/AccordionList.js @@ -18,6 +18,7 @@ class AccordionList extends Component { } render() { + console.log(this.props.selectedParticipant) return ( @@ -49,6 +50,9 @@ AccordionList.propTypes = { accordionId: PropTypes.bool.isRequired, slideType: PropTypes.bool.isRequired, selectedParticipant: PropTypes.bool.isRequired, + setSelectedSlide: PropTypes.func.isRequired, + toggleMenu: PropTypes.func.isRequired, + handleSelectSlide: PropTypes.func.isRequired } export default AccordionList; \ No newline at end of file From ec5609131fbb9872d50b43d6de9f1334868e1958 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 16:05:53 -0400 Subject: [PATCH 031/252] remove unused props --- src/components/Slides/Menu/SlideList.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index 6b8fbf9..550c9aa 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -36,9 +36,6 @@ class SlideList extends Component { SlideList.propTypes = { selectedParticipant: PropTypes.object.isRequired, - setSelectedSlide: PropTypes.func.isRequired, - toggleMenu: PropTypes.func.isRequired, - handleSelectSlide: PropTypes.func.isRequired } export default SlideList; From 61370131a6eb97b2668b6851d6e8702e3de7ec86 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 16:09:11 -0400 Subject: [PATCH 032/252] pass setSelectedSlide to AccordionList --- src/components/Slides/Menu/SlideListContainer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Slides/Menu/SlideListContainer.js b/src/components/Slides/Menu/SlideListContainer.js index 5dd3d03..dca3c8a 100755 --- a/src/components/Slides/Menu/SlideListContainer.js +++ b/src/components/Slides/Menu/SlideListContainer.js @@ -1,5 +1,5 @@ import { connect } from 'react-redux'; -import SlideList from './SlideList'; +import AccordionList from './AccordionList'; import { setSelectedSlide } from '../../../actions/Participants/participantActions'; const mapStateToProps = (state, props) => @@ -15,4 +15,4 @@ const mapDispatchToProps = (dispatch, props) => } }); -export default connect(mapStateToProps, mapDispatchToProps)(SlideList); \ No newline at end of file +export default connect(mapStateToProps, mapDispatchToProps)(AccordionList); \ No newline at end of file From 81643251bc054f322002c927942781848cd390ea Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 16:10:48 -0400 Subject: [PATCH 033/252] also pass props to slideList --- src/components/Slides/Menu/SlideListContainer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Slides/Menu/SlideListContainer.js b/src/components/Slides/Menu/SlideListContainer.js index dca3c8a..15a6139 100755 --- a/src/components/Slides/Menu/SlideListContainer.js +++ b/src/components/Slides/Menu/SlideListContainer.js @@ -1,5 +1,6 @@ import { connect } from 'react-redux'; import AccordionList from './AccordionList'; +import SlideList from './SlideList'; import { setSelectedSlide } from '../../../actions/Participants/participantActions'; const mapStateToProps = (state, props) => @@ -15,4 +16,4 @@ const mapDispatchToProps = (dispatch, props) => } }); -export default connect(mapStateToProps, mapDispatchToProps)(AccordionList); \ No newline at end of file +export default connect(mapStateToProps, mapDispatchToProps)(SlideList, AccordionList); \ No newline at end of file From 6e34156cf8a9b96757f2e46ee70cec979fc2c8eb Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 16:13:56 -0400 Subject: [PATCH 034/252] trying accordionlist container --- .../Slides/Menu/AccordionListContainer.js | 18 ++++++++++++++++++ .../Slides/Menu/SlideListContainer.js | 3 +-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/components/Slides/Menu/AccordionListContainer.js diff --git a/src/components/Slides/Menu/AccordionListContainer.js b/src/components/Slides/Menu/AccordionListContainer.js new file mode 100644 index 0000000..dca3c8a --- /dev/null +++ b/src/components/Slides/Menu/AccordionListContainer.js @@ -0,0 +1,18 @@ +import { connect } from 'react-redux'; +import AccordionList from './AccordionList'; +import { setSelectedSlide } from '../../../actions/Participants/participantActions'; + +const mapStateToProps = (state, props) => +({ + selectedParticipant: state.selectedParticipant, + participants: state.participants, +}); + +const mapDispatchToProps = (dispatch, props) => +({ + setSelectedSlide(slide) { + dispatch(setSelectedSlide(slide)) + } +}); + +export default connect(mapStateToProps, mapDispatchToProps)(AccordionList); \ No newline at end of file diff --git a/src/components/Slides/Menu/SlideListContainer.js b/src/components/Slides/Menu/SlideListContainer.js index 15a6139..5dd3d03 100755 --- a/src/components/Slides/Menu/SlideListContainer.js +++ b/src/components/Slides/Menu/SlideListContainer.js @@ -1,5 +1,4 @@ import { connect } from 'react-redux'; -import AccordionList from './AccordionList'; import SlideList from './SlideList'; import { setSelectedSlide } from '../../../actions/Participants/participantActions'; @@ -16,4 +15,4 @@ const mapDispatchToProps = (dispatch, props) => } }); -export default connect(mapStateToProps, mapDispatchToProps)(SlideList, AccordionList); \ No newline at end of file +export default connect(mapStateToProps, mapDispatchToProps)(SlideList); \ No newline at end of file From a059f9cd699f1c8fc14100a0e6bcf3f145228def Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 16:16:05 -0400 Subject: [PATCH 035/252] use accordionlist container --- src/components/Slides/Menu/SlideList.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index 550c9aa..ef6bc84 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -3,11 +3,12 @@ import { Col, UncontrolledAccordion} from 'reactstrap'; import { noSlidesFound, } from '../slideHelpers.js'; -import AccordionList from './AccordionList.js'; +// import AccordionList from './AccordionList.js'; import PropTypes from 'prop-types'; import Header from './Header'; +import AccordionListContainer from './AccordionListContainer.js'; class SlideList extends Component { @@ -22,9 +23,9 @@ class SlideList extends Component {
- {slideType === "(LM) Light Microscopy" ? : ''} - {slideType === "(EM) Electron Microscopy" ? : ''} - {slideType === "(IF) Immunoflourescence" ? : ''} + {slideType === "(LM) Light Microscopy" ? : ''} + {slideType === "(EM) Electron Microscopy" ? : ''} + {slideType === "(IF) Immunoflourescence" ? : ''} From 90ecf0f9f733dcc689ded577c4413b11ac32eab6 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 16:19:20 -0400 Subject: [PATCH 036/252] pass toggleMenu as prop --- src/components/Slides/Menu/SlideList.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index ef6bc84..1f87be1 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -23,9 +23,9 @@ class SlideList extends Component {
- {slideType === "(LM) Light Microscopy" ? : ''} - {slideType === "(EM) Electron Microscopy" ? : ''} - {slideType === "(IF) Immunoflourescence" ? : ''} + {slideType === "(LM) Light Microscopy" ? : ''} + {slideType === "(EM) Electron Microscopy" ? : ''} + {slideType === "(IF) Immunoflourescence" ? : ''} From cdf161307af8b3c3277475b3a20447310da036fa Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 16:20:47 -0400 Subject: [PATCH 037/252] remove console.log --- src/components/Slides/Menu/AccordionList.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Slides/Menu/AccordionList.js b/src/components/Slides/Menu/AccordionList.js index 02d0870..c826999 100644 --- a/src/components/Slides/Menu/AccordionList.js +++ b/src/components/Slides/Menu/AccordionList.js @@ -18,7 +18,6 @@ class AccordionList extends Component { } render() { - console.log(this.props.selectedParticipant) return ( From 864e8170bf76bc0e56ed645939465a2c2952851e Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Wed, 27 Mar 2024 16:26:53 -0400 Subject: [PATCH 038/252] remove unused import --- src/components/Slides/Menu/SlideList.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index 1f87be1..a66add9 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -3,7 +3,6 @@ import { Col, UncontrolledAccordion} from 'reactstrap'; import { noSlidesFound, } from '../slideHelpers.js'; -// import AccordionList from './AccordionList.js'; import PropTypes from 'prop-types'; From 2b69f7ab85b43cbffef1d6e823abc5ce68907b0d Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Thu, 28 Mar 2024 08:56:38 -0400 Subject: [PATCH 039/252] log result.data --- src/actions/Participants/participantActions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/actions/Participants/participantActions.js b/src/actions/Participants/participantActions.js index 7c407b0..ca4e792 100644 --- a/src/actions/Participants/participantActions.js +++ b/src/actions/Participants/participantActions.js @@ -41,6 +41,7 @@ export const getParticipantSlides = (participantId, props) => { let slides = participantSelectSorter(result.data["(EM) Electron Microscopy"]) dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]})); } + console.log(result.data) props.history.push(process.env.PUBLIC_URL + "/slides"); }) .catch(err => { From bc001470b1cc0c6ffa2d799f05edcf47b0b77235 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Thu, 28 Mar 2024 09:01:41 -0400 Subject: [PATCH 040/252] first pass at getting all data before moving to slides --- src/components/Summary/ParticipantSelect.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Summary/ParticipantSelect.js b/src/components/Summary/ParticipantSelect.js index d959aee..ab43a28 100644 --- a/src/components/Summary/ParticipantSelect.js +++ b/src/components/Summary/ParticipantSelect.js @@ -21,8 +21,12 @@ class ParticipantSelect extends Component { this.setState({buttonDisabled: false}); }; + async handleSelectedParticipant(participantId){ + await this.props.setSelectedParticipant(participantId) + } + handleClick = () => { - this.props.setSelectedParticipant(this.state.participantId); + this.handleSelectedParticipant(this.state.participantId); }; componentDidMount() { From 1df4c0949ba058cf46773ab6daba0cafbaab14d5 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Thu, 28 Mar 2024 09:28:48 -0400 Subject: [PATCH 041/252] load accordions once all data is retrieved --- src/components/Slides/Menu/AccordionList.js | 36 ++++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/components/Slides/Menu/AccordionList.js b/src/components/Slides/Menu/AccordionList.js index c826999..dff5785 100644 --- a/src/components/Slides/Menu/AccordionList.js +++ b/src/components/Slides/Menu/AccordionList.js @@ -10,13 +10,36 @@ class AccordionList extends Component { constructor(props) { super(props); this.handleSelectSlide = this.handleSelectSlide.bind(this); + this.state = { + loaded: false + } } + async componentDidMount() { + await this.props.setSelectedParticipant(this.props.selectedParticipant) + this.setState({loaded: true}) + } + handleSelectSlide(slide) { this.props.setSelectedSlide(slide); this.props.toggleMenu(true); } + createAccordions() { + return ( + this.props.selectedParticipant.slides.map(function (slide, index) { + let highlightedClass = this.props.selectedParticipant.selectedSlide.id === slide.id ? " slide-highlighted" : ""; + let thumbnailSrc = "img/thumbnail_stain_" + getStainImageName(slide.stain.type) + ".png"; + return ( + this.handleSelectSlide(slide)}> + + {slide.slideName} + + ) + }, this) + ) + } + render() { return ( @@ -25,18 +48,7 @@ class AccordionList extends Component { From c027cbf6e10e1293305d4aca64c82b7617ff5673 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Thu, 28 Mar 2024 09:33:59 -0400 Subject: [PATCH 042/252] try async accordion loading --- src/components/Slides/Menu/SlideList.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index a66add9..6641af6 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -11,22 +11,35 @@ import AccordionListContainer from './AccordionListContainer.js'; class SlideList extends Component { + constructor(props){ + super(props) + this.state({loaded: false}) + } + componentDidUpdate() { noSlidesFound(this.props.selectedParticipant); } + content(slideType) { + + {slideType === "(LM) Light Microscopy" ? : null} + {slideType === "(EM) Electron Microscopy" ? : null} + {slideType === "(IF) Immunoflourescence" ? : null} + + } + + async componentDidMount() { + await this.props.setSelectedPaticipant(this.props.selectedParticipant) + this.setState({loaded: false}) + } + render() { let slideType = this.props.selectedParticipant.selectedSlide.slideType; return ( ); From 3912682505fed9fb07dde4977eecfbe40799ed59 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Thu, 28 Mar 2024 09:36:35 -0400 Subject: [PATCH 043/252] fix state --- src/components/Slides/Menu/SlideList.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index 6641af6..5efbccb 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -13,7 +13,9 @@ class SlideList extends Component { constructor(props){ super(props) - this.state({loaded: false}) + this.state = { + loaded: false + } } componentDidUpdate() { From cd4f77ff3c2b0f90dcf6a1f168b6cf5ac7eb6152 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Thu, 28 Mar 2024 09:46:33 -0400 Subject: [PATCH 044/252] fix loaded state --- src/components/Slides/Menu/AccordionList.js | 10 +--------- src/components/Slides/Menu/SlideList.js | 4 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/components/Slides/Menu/AccordionList.js b/src/components/Slides/Menu/AccordionList.js index dff5785..4da08a1 100644 --- a/src/components/Slides/Menu/AccordionList.js +++ b/src/components/Slides/Menu/AccordionList.js @@ -10,16 +10,8 @@ class AccordionList extends Component { constructor(props) { super(props); this.handleSelectSlide = this.handleSelectSlide.bind(this); - this.state = { - loaded: false - } } - async componentDidMount() { - await this.props.setSelectedParticipant(this.props.selectedParticipant) - this.setState({loaded: true}) - } - handleSelectSlide(slide) { this.props.setSelectedSlide(slide); this.props.toggleMenu(true); @@ -48,7 +40,7 @@ class AccordionList extends Component { diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index 5efbccb..72a268b 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -31,8 +31,8 @@ class SlideList extends Component { } async componentDidMount() { - await this.props.setSelectedPaticipant(this.props.selectedParticipant) - this.setState({loaded: false}) + await this.props.slideType + this.setState({loaded: true}) } render() { From adc3b8d74c6a3b0060775d188e2817bda78915b1 Mon Sep 17 00:00:00 2001 From: Nathan Creger Date: Thu, 28 Mar 2024 09:49:03 -0400 Subject: [PATCH 045/252] log loaded state --- src/components/Slides/Menu/SlideList.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Slides/Menu/SlideList.js b/src/components/Slides/Menu/SlideList.js index 72a268b..ab01197 100755 --- a/src/components/Slides/Menu/SlideList.js +++ b/src/components/Slides/Menu/SlideList.js @@ -37,6 +37,7 @@ class SlideList extends Component { render() { let slideType = this.props.selectedParticipant.selectedSlide.slideType; + console.log(this.state.loaded) return (