Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KPMP-4834_add-accordions-for-config-type #107

Merged
merged 253 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
253 commits
Select commit Hold shift + click to select a range
72ccbae
log result.data
Dert1129 Mar 25, 2024
55496d8
loop through backend data and see what it looks like
Dert1129 Mar 25, 2024
a9036d9
do more loggign
Dert1129 Mar 25, 2024
33c41e8
more logging
Dert1129 Mar 25, 2024
185d7e4
define slides
Dert1129 Mar 25, 2024
2ba65da
dispatch slides for each image type
Dert1129 Mar 25, 2024
c7c510e
first pass at accordions
Dert1129 Mar 25, 2024
df39287
update reactstrap for accordion
Dert1129 Mar 25, 2024
9b145bc
upgrade common-components and pass accordion styles
Dert1129 Mar 25, 2024
ec1523c
more accordion styles
Dert1129 Mar 25, 2024
78630c4
fix bootstrap
Dert1129 Mar 25, 2024
bbb401d
fix weird image sizes
Dert1129 Mar 25, 2024
d7a9d42
remove padding
Dert1129 Mar 25, 2024
b0cf7b1
remove height and font size
Dert1129 Mar 25, 2024
5231edc
remove padding
Dert1129 Mar 25, 2024
65b9532
use default css for accordion
Dert1129 Mar 25, 2024
06e4079
set padding for x and y to 0
Dert1129 Mar 25, 2024
7deebff
use bootstrap variable
Dert1129 Mar 25, 2024
b82572d
use correct accordion sass variable
Dert1129 Mar 25, 2024
ef70a1a
change class names to adapt to bottstrap v5
Dert1129 Mar 27, 2024
fcdba1a
Remove react column
Dert1129 Mar 27, 2024
4f927a4
put div inside of col
Dert1129 Mar 27, 2024
a594bea
write accordionList component
Dert1129 Mar 27, 2024
1c78a50
pass selected participant
Dert1129 Mar 27, 2024
0d2f4ad
copy accordionList logic
Dert1129 Mar 27, 2024
d713eb5
handle selected slide logic
Dert1129 Mar 27, 2024
3a2c606
log selected participant
Dert1129 Mar 27, 2024
ec56091
remove unused props
Dert1129 Mar 27, 2024
6137013
pass setSelectedSlide to AccordionList
Dert1129 Mar 27, 2024
8164325
also pass props to slideList
Dert1129 Mar 27, 2024
6e34156
trying accordionlist container
Dert1129 Mar 27, 2024
a059f9c
use accordionlist container
Dert1129 Mar 27, 2024
90ecf0f
pass toggleMenu as prop
Dert1129 Mar 27, 2024
cdf1613
remove console.log
Dert1129 Mar 27, 2024
864e817
remove unused import
Dert1129 Mar 27, 2024
2b69f7a
log result.data
Dert1129 Mar 28, 2024
bc00147
first pass at getting all data before moving to slides
Dert1129 Mar 28, 2024
1df4c09
load accordions once all data is retrieved
Dert1129 Mar 28, 2024
c027cbf
try async accordion loading
Dert1129 Mar 28, 2024
3912682
fix state
Dert1129 Mar 28, 2024
cd4f77f
fix loaded state
Dert1129 Mar 28, 2024
adc3b8d
log loaded state
Dert1129 Mar 28, 2024
4638c8d
log slideType
Dert1129 Mar 28, 2024
e3b1d17
log props.slideType
Dert1129 Mar 28, 2024
5dd1f54
log slides
Dert1129 Mar 28, 2024
e094549
log slide type in slideviewer
Dert1129 Mar 28, 2024
12da231
await slide type in slideviewer
Dert1129 Mar 28, 2024
f63d558
remove logging
Dert1129 Mar 28, 2024
44d91b6
log seSelectedParticipant
Dert1129 Mar 28, 2024
eec180d
load contenet
Dert1129 Mar 28, 2024
73ec2a1
remove a bunch of logging
Dert1129 Mar 28, 2024
0ef0afc
log slide type in menu
Dert1129 Mar 28, 2024
5f9892a
await menu load
Dert1129 Mar 28, 2024
d2ce4e4
trying a map
Dert1129 Mar 28, 2024
5644cb8
log selectedParticipant to see what I can iterate through
Dert1129 Mar 28, 2024
b3e5103
loop through object
Dert1129 Mar 28, 2024
9a2652b
logs slides
Dert1129 Mar 28, 2024
6b8c137
trying iterating
Dert1129 Mar 28, 2024
fbd181d
fix vars and log them
Dert1129 Mar 28, 2024
8f92ec0
Return slide type to see what happens
Dert1129 Mar 28, 2024
1bbb87e
bind this to map
Dert1129 Mar 28, 2024
384a965
remove confusing console logs
Dert1129 Mar 28, 2024
54cdb4a
bring back menu console logs
Dert1129 Mar 28, 2024
f1ff4f5
bring back console logs in participant select
Dert1129 Mar 28, 2024
85cb28a
log more in slide list
Dert1129 Mar 28, 2024
d704fba
more investigating
Dert1129 Mar 28, 2024
6e18998
fix accordions
Dert1129 Mar 28, 2024
20977d9
log selected participant
Dert1129 Mar 28, 2024
10835c9
see what happens when I remove async await
Dert1129 Mar 28, 2024
dc2006a
comment out await
Dert1129 Mar 28, 2024
a0feafd
revert handle click
Dert1129 Mar 28, 2024
352797b
experiment with getting slides
Dert1129 Mar 28, 2024
b6126e7
push response into an array
Dert1129 Mar 28, 2024
d618cd5
do more logging to see what happens
Dert1129 Mar 28, 2024
8e78653
see how many keys there are
Dert1129 Mar 28, 2024
231bdb7
fix map function
Dert1129 Mar 28, 2024
8acdf0c
push slidesTypes into an array
Dert1129 Mar 28, 2024
5193593
fix error
Dert1129 Mar 28, 2024
04314c3
see if all slide types get pushed into an array
Dert1129 Mar 28, 2024
fc4d7a5
trying await
Dert1129 Mar 28, 2024
b9b3c46
trying componentDidUpdate method
Dert1129 Mar 28, 2024
f4f91bc
log setSelectedParticipant
Dert1129 Mar 28, 2024
8c85a41
remove extra logging
Dert1129 Mar 28, 2024
45ca7d1
remove infinite loop
Dert1129 Mar 28, 2024
5e00320
load menu
Dert1129 Mar 28, 2024
7f39844
iterate on slideTypes array
Dert1129 Mar 28, 2024
347f6a0
get name of slide types at index position
Dert1129 Mar 28, 2024
9cd2151
remove index
Dert1129 Mar 28, 2024
8f7ec69
fix log
Dert1129 Mar 28, 2024
59df372
remove extra loggign
Dert1129 Mar 28, 2024
a83ad04
use only one dispatch action
Dert1129 Mar 28, 2024
6889e08
log data arr
Dert1129 Mar 28, 2024
9900446
print data
Dert1129 Mar 28, 2024
f27d0d6
store keys into an array
Dert1129 Mar 28, 2024
bf7a5cd
trying dispatch
Dert1129 Mar 28, 2024
b1fd9eb
log slides
Dert1129 Mar 28, 2024
448818a
try this out
Dert1129 Mar 28, 2024
a0d5534
log newData
Dert1129 Mar 28, 2024
e693f7f
iterate on keys
Dert1129 Mar 29, 2024
f97f62b
delete extra code
Dert1129 Mar 29, 2024
cc23d9d
use selected participant and log it
Dert1129 Mar 29, 2024
b2853bb
log selectedParticipant
Dert1129 Mar 29, 2024
1dc4a48
log selected Partcipant
Dert1129 Mar 29, 2024
51699db
revert commit
Dert1129 Mar 29, 2024
93205c2
comment out code for logging
Dert1129 Mar 29, 2024
2e26bed
generate accordions
Dert1129 Mar 29, 2024
23698d8
iterate on slidetype
Dert1129 Mar 29, 2024
69ee665
deleting extra logs
Dert1129 Mar 29, 2024
e9ef121
use string index
Dert1129 Mar 29, 2024
c1ad1d4
fix defaultopen prop
Dert1129 Mar 29, 2024
04ad717
adjust css
Dert1129 Mar 29, 2024
c11b037
adjust styles
Dert1129 Mar 29, 2024
06299cd
log slides
Dert1129 Mar 29, 2024
455e873
hardcode in light microscopy
Dert1129 Mar 29, 2024
c0b5025
log slide Index
Dert1129 Mar 29, 2024
f210f30
use keys
Dert1129 Mar 29, 2024
01d4fe1
sort the data
Dert1129 Mar 29, 2024
a9190db
use LM slide type
Dert1129 Mar 29, 2024
4d88bb4
first pass at selectedAccordion
Dert1129 Mar 29, 2024
88d0539
export setSelectedAccordion
Dert1129 Mar 29, 2024
79301d9
update initialState
Dert1129 Mar 29, 2024
0a567b8
log selectedAccordion
Dert1129 Mar 29, 2024
a3a3f20
select accordion
Dert1129 Apr 1, 2024
2e3d2dc
remove selected Accordion stuff
Dert1129 Apr 1, 2024
ab88531
fix spelling mistake
Dert1129 Apr 1, 2024
ddad0ca
bind handle selected Accordion to this
Dert1129 Apr 1, 2024
0f9aa07
select accordion when selecting the slide
Dert1129 Apr 1, 2024
963161c
set accordion
Dert1129 Apr 1, 2024
0a3bf0d
store selected Accordion in an array
Dert1129 Apr 1, 2024
3aad08c
trying to push selected accordion to array
Dert1129 Apr 1, 2024
8f6a24d
remove array idea
Dert1129 Apr 1, 2024
a01d71f
remove .push
Dert1129 Apr 1, 2024
bec3106
first pass at accordion scrolling
Dert1129 Apr 1, 2024
717d6bd
do some logging
Dert1129 Apr 1, 2024
6a131c5
pass slidePos
Dert1129 Apr 1, 2024
87f4b01
fix array index
Dert1129 Apr 1, 2024
9ae7900
remove method call
Dert1129 Apr 1, 2024
3b87e6e
more logging
Dert1129 Apr 1, 2024
55a098f
see what happens
Dert1129 Apr 1, 2024
6ffd023
log slides object
Dert1129 Apr 1, 2024
be7902d
move log
Dert1129 Apr 1, 2024
8e019a6
use arrow notation??
Dert1129 Apr 1, 2024
7f9accf
remove this.state and this.setState
Dert1129 Apr 1, 2024
e3a160d
log slideTypes at currentSlideTypeIndex
Dert1129 Apr 1, 2024
96aaf85
log nextSlide
Dert1129 Apr 1, 2024
34251fe
change slide position to zero
Dert1129 Apr 1, 2024
bd1f3ec
seeing if chatgpt and go to the beginning of the slides
Dert1129 Apr 3, 2024
ddf6ecb
do handenextslide but backwards
Dert1129 Apr 3, 2024
3701142
set state of slide types and log props in slide list to see if they a…
Dert1129 Apr 3, 2024
0c2b952
fix logging
Dert1129 Apr 3, 2024
504a6db
log some props
Dert1129 Apr 3, 2024
ea5da55
fix really confusing naming
Dert1129 Apr 3, 2024
c46ceb8
go back to slideListcontainer
Dert1129 Apr 3, 2024
4c873c6
Revert "fix really confusing naming"
Dert1129 Apr 3, 2024
09407f8
set inex in slideList and pass as props
Dert1129 Apr 4, 2024
321d47d
log props and set accordion in header
Dert1129 Apr 4, 2024
0cf5ac0
set selected accordion with buttons
Dert1129 Apr 4, 2024
5d7d794
fix setSelectedAccordion
Dert1129 Apr 4, 2024
965ece2
try opening accordions
Dert1129 Apr 4, 2024
2fd546e
pass slideType
Dert1129 Apr 4, 2024
c511e16
trying regular accordion
Dert1129 Apr 4, 2024
1270a1e
fix page refresh on accordion click
Dert1129 Apr 4, 2024
5f49a02
add toggle prop
Dert1129 Apr 4, 2024
9aa34a4
set accordion on slide click
Dert1129 Apr 4, 2024
3f6d320
see what chatgpt does
Dert1129 Apr 4, 2024
cb2521f
rever commit
Dert1129 Apr 4, 2024
db87f1d
mess around with state
Dert1129 Apr 4, 2024
2e009ae
trying array of slide Types
Dert1129 Apr 4, 2024
c2ff922
keep accordion items open
Dert1129 Apr 4, 2024
0940720
pass tons of props to header
Dert1129 Apr 4, 2024
079c8a4
revert commit
Dert1129 Apr 4, 2024
27df82a
revert commits
Dert1129 Apr 4, 2024
711eecf
revert commit
Dert1129 Apr 4, 2024
dda790c
set selected accordion on header click
Dert1129 Apr 5, 2024
eb96ae0
bind handleselectedaccordion
Dert1129 Apr 5, 2024
9756dc4
revert commit
Dert1129 Apr 5, 2024
f2d91ca
trying uncontrolled accordion
Dert1129 Apr 5, 2024
4d18c9a
revert back to regular accoridion
Dert1129 Apr 5, 2024
ef88491
use string index
Dert1129 Apr 5, 2024
1aa1ce8
toggle state of accordion
Dert1129 Apr 5, 2024
53ace11
pass down openitems as props to header
Dert1129 Apr 5, 2024
281401c
use selected accordion instead of numbe
Dert1129 Apr 5, 2024
032ad07
use open state
Dert1129 Apr 5, 2024
8a96c98
remove open
Dert1129 Apr 5, 2024
8a48db3
remove parens
Dert1129 Apr 5, 2024
3c149ce
revert some commits
Dert1129 Apr 5, 2024
24c2d42
testing number state to props
Dert1129 Apr 5, 2024
e09d10c
combine accordionList with slideList
Dert1129 Apr 5, 2024
e5e2f37
fix slideType def
Dert1129 Apr 5, 2024
60638ac
fix openItems
Dert1129 Apr 5, 2024
b5c7970
combine header, accordionlist and slidelist into one file to pass sta…
Dert1129 Apr 5, 2024
9185c06
log slide inex
Dert1129 Apr 5, 2024
ba96549
set currentSlideType index state when clicking on a slide from slide …
Dert1129 Apr 5, 2024
f83bcc0
log my props
Dert1129 Apr 5, 2024
315fccf
set slide position to slide index
Dert1129 Apr 5, 2024
d860343
pass slidetype array
Dert1129 Apr 5, 2024
0d64b4a
log slide position
Dert1129 Apr 5, 2024
b7669f5
trying get next slide
Dert1129 Apr 5, 2024
c9913e9
put slide in to getNextSlide method
Dert1129 Apr 5, 2024
5429ff0
fix variable
Dert1129 Apr 5, 2024
e3c53ac
log slideIndex
Dert1129 Apr 5, 2024
6887a0a
don't set state for current slide type index
Dert1129 Apr 5, 2024
29e7f42
log openItems
Dert1129 Apr 5, 2024
481a4f3
log slideType
Dert1129 Apr 5, 2024
1722696
push open items into state
Dert1129 Apr 5, 2024
44dfa91
rewrite setstate with spread operator
Dert1129 Apr 8, 2024
8c56977
modify openItems
Dert1129 Apr 8, 2024
63d76ec
revert code
Dert1129 Apr 8, 2024
6c39317
revert to see what happening
Dert1129 Apr 8, 2024
2580989
handle selected accordion logic
Dert1129 Apr 8, 2024
00102d6
store entire object name instead of characters
Dert1129 Apr 8, 2024
f6de180
revert some commits
Dert1129 Apr 9, 2024
cf159e5
openItems is the same as setSelectedAccordion
Dert1129 Apr 9, 2024
bb5eea3
log slide type to ensure I can write an onClick event for AccordionHe…
Dert1129 Apr 9, 2024
44cd875
trying to pass slideType to handleselectAccordioin
Dert1129 Apr 9, 2024
9363568
call toggle with handleNextSlide
Dert1129 Apr 9, 2024
21ebbba
console log openItems to see what's happening
Dert1129 Apr 9, 2024
d0c3a3e
set light microscopy to be open by default
Dert1129 Apr 9, 2024
0434dda
move console log to be less confusing
Dert1129 Apr 9, 2024
a6f307f
set currentSlideTypeIndex to accordionIndex
Dert1129 Apr 9, 2024
d7399a3
fix handlepreviousslide
Dert1129 Apr 9, 2024
8f43cf4
specify .openItems object for consistency
Dert1129 Apr 9, 2024
98bb66b
do nothing if accordion is already open
Dert1129 Apr 9, 2024
ef44147
switch up if statement
Dert1129 Apr 9, 2024
4e0a79b
rever commits
Dert1129 Apr 9, 2024
e3aafb8
check if accordion is already open and add it if it isn't
Dert1129 Apr 9, 2024
be87dba
go back to older code
Dert1129 Apr 9, 2024
1ac12e6
reverting a commit
Dert1129 Apr 9, 2024
3ae851a
Remove accordionId if header is clicked on and accordion is already open
Dert1129 Apr 9, 2024
a82e493
comment out code
Dert1129 Apr 9, 2024
3d1122c
log what's happening to openItems
Dert1129 Apr 9, 2024
deadc36
use different methods for using navigation arrows vs clicking on headers
Dert1129 Apr 9, 2024
4d91380
do not pass accordion name to handleselectaccordion
Dert1129 Apr 9, 2024
e6314c4
fix weird bug
Dert1129 Apr 9, 2024
a7f0d88
log accordionIndex to see what's happening
Dert1129 Apr 9, 2024
4e5beb2
use arrow notation to bind this to my method
Dert1129 Apr 9, 2024
66caf73
remove handleSelectedAccordion from accordion header
Dert1129 Apr 9, 2024
8168b3f
comment out call to handleSelectAccordion from handleSelectSlide
Dert1129 Apr 9, 2024
198dff4
cleanup code and format code to look similar to the rest
Dert1129 Apr 9, 2024
b44c4db
general clean up of variables
Dert1129 Apr 9, 2024
16828e0
fix var naming convention
Dert1129 Apr 9, 2024
5da888b
remove unused code
Dert1129 Apr 9, 2024
ebd0052
log openItems state and openAccordion
Dert1129 Apr 9, 2024
b2c8376
copy code from handeNextSlide to handPreviousSlide
Dert1129 Apr 9, 2024
f084eb0
remove duplicate code that's handled in toggle method
Dert1129 Apr 9, 2024
2826f26
Update node.js.yml
rlreamy Apr 9, 2024
56d68d1
remove unused vars
Dert1129 Apr 10, 2024
a03feba
Revert "remove unused vars"
Dert1129 Apr 10, 2024
6d70494
Merge branch 'KPMP-4834_add-accordions-for-config-type' of https://gi…
Dert1129 Apr 10, 2024
135a57f
remove unused variables
Dert1129 Apr 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm ci
- run: npm run build --if-present
- run: npm test
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"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",
"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",
Expand All @@ -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"
Expand Down
24 changes: 21 additions & 3 deletions src/actions/Participants/participantActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ export const setSelectedSlide = (slide) => {
}
}

export const setSelectedAccordion = (accordion) => {
return {
type: actionNames.SET_SELECTED_ACCORDION,
payload: accordion
}
}

export const setParticipants = (participants) => {
return {
type: actionNames.SET_PARTICIPANTS,
Expand All @@ -29,12 +36,23 @@ 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 => {
let slides = participantSelectSorter(result.data);
dispatch(setSelectedParticipant({id: participantId, slides: slides, selectedSlide: slides[0]}));
let newData = {}
for(const [key, value] of Object.entries(result.data)){
let newValue = participantSelectSorter(value);
newData[key] = newValue
}
let sortedData = {}
let keys = Object.keys(newData)
keys.sort()
keys.reverse()
for (let key of keys) {
sortedData[key] = newData[key]
}
dispatch(setSelectedParticipant({id: participantId, slides: sortedData, selectedSlide:sortedData["(LM) Light Microscopy"][0], selectedAccordion: "(LM) Light Microscopy"}));
props.history.push(process.env.PUBLIC_URL + "/slides");
})
.catch(err => {
console.log("We were unable to get a list of slides for " + participantId);
console.log("We were unable to get a list of slides for " + participantId);
dispatch(sendMessageToBackend(err));
});
}
Expand Down
3 changes: 2 additions & 1 deletion src/actions/actionNames.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const actionNames = {
SET_SELECTED_PARTICIPANT: "SET_SELECTED_PARTICIPANT",
SET_PARTICIPANTS: "SET_PARTICIPANTS",
SET_SELECTED_SLIDE: "SET_SELECTED_SLIDE"
SET_SELECTED_SLIDE: "SET_SELECTED_SLIDE",
SET_SELECTED_ACCORDION: "SET_SELECTED_ACCORDION"
};

export default actionNames;
143 changes: 0 additions & 143 deletions src/components/Slides/Menu/Header.js

This file was deleted.

3 changes: 2 additions & 1 deletion src/components/Slides/Menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
selectedParticipant={this.props.selectedParticipant} />
</BurgerMenu>
<Link id="btn-home" to={process.env.PUBLIC_URL}>
<FontAwesomeIcon icon={faHome} size="2x" />
Expand Down
Loading
Loading