Rothamsted-Ecoinformatics / eRA

e-RA website code
3 stars 0 forks source link

experiment: hide design and site tab if no information there #54

Closed nathcast closed 3 years ago

nathcast commented 4 years ago

When displaying an experiment, hide the tabs that have no information like design and site.

nathcast commented 4 years ago

Highfield Bare Fallow has no "design" so that is an example where the site tab needs to go. In this design.json file, there are fields but there are empty: [ { "administrative": { "type": "experiment", "identifier": null, "localIdentifier": null, "name": null, "url": null, "description": "" }, "design": { "dateStart": null, "dateEnd": null, "description": null, "studyDesign": null, "factorCombinationNumber": "NA", "numberOdBlocks": null, "numberOfPlots": null, "numberOfReplicates": null, "numberOfSubplots": null, "numberOfHarvests": null }, "crops": "NA", "cropRotations": "NA", "factor": "NA", "factorCombinations": "NA", "measurements": "NA" } ]

What is the minimum information to decide if the tab is going to appear?

nathcast commented 4 years ago

design is not shown when design[0]['administrative']['identifier'] is null (always has an identifier... )

site is not shown when site['administrative']['name'] is null : assuming a site always has a name (sometimes identifier is missing)

this seems to work. We can discuss the validitiy of these assumptions.