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

added default_open field to details section of datasets #140

Merged
merged 5 commits into from
Aug 12, 2024

Conversation

sherwoodf
Copy link
Contributor

@sherwoodf sherwoodf commented Aug 6, 2024

In the website these are all using html 'details' sections. We want these to be open if it's the first time a e.g. biosample is being displayed, but be closed if a different section re-references the same biosample.

I think it is easier to store this field in the json rather than try to get Astro's rendering logic work out which sections it has rendered before. This PR adds 'default_open' field to BioSample etc. models for use in the website (named that way because True/False maps directly to the value needed for the html)

This PR doesn't cover Image analysis and correlation sections that are embedded objects in the Dataset json - i will revisit that separately as it's a bit more complex. Also refactored some code into a function because i was having to do the same logic for each of the objects.

Part of: https://app.clickup.com/t/86956nvk4

Astro website PR using this field: BioImage-Archive/BIA-astro#13

Copy link
Contributor

@AybukeKY AybukeKY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with a note that the input data form/logic may change but that shouldn't affect the previously_set logic.

@sherwoodf sherwoodf merged commit 57c93de into main Aug 12, 2024
32 of 33 checks passed
@sherwoodf sherwoodf deleted the duplicate_details branch August 12, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants