Panoptes-Front-End icon indicating copy to clipboard operation
Panoptes-Front-End copied to clipboard

refactor(subject previews): allow for single series JSON data subjects

Open eatyourgreens opened this issue 8 months ago • 9 comments

Refactor previews for JSON data subjects to include subjects with a single x,y data series eg. PH-TESS subjects. getDatasets(data) reflects on the type of data, then calls an appropriate helper function to convert data into an array of chart.js datasets.

You can check the subject viewer for a JSON data subject on Black Hole Hunters Talk eg. https://local.zooniverse.org:3735/projects/cobalt-lensing/black-hole-hunters/talk/subjects/96013284?env=production

  • Fixes d.map is not a function for subject previews, when you pass an { x, y } subject to the chart plotter. See https://github.com/zooniverse/front-end-monorepo/issues/6118.

Required Manual Testing

  • [ ] Does the non-logged in home page render correctly?
  • [ ] Does the logged in home page render correctly?
  • [ ] Does the projects page render correctly?
  • [ ] Can you load project home pages?
  • [ ] Can you load the classification page?
  • [ ] Can you submit a classification?
  • [ ] Does talk load correctly?
  • [ ] Can you post a talk comment?

Review Checklist

  • [ ] Does it work in all major browsers: Firefox, Chrome, Edge, Safari?
  • [ ] Does it work on mobile?
  • [ ] Can you npm ci and app works as expected?
  • [ ] If the component is in coffeescript, is it converted to ES6? Is it free of eslint errors? Is the conversion its own commit?
  • [ ] Are the tests passing locally and on GitHub Actions?

Optional

eatyourgreens avatar Jun 06 '24 11:06 eatyourgreens