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

refactor(classifier): model survey task questions as a Map #6088

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eatyourgreens
Copy link
Contributor

@eatyourgreens eatyourgreens commented May 12, 2024

Add a Question model to the survey task. Remove types.frozen({}). Model questions as types.map(Question), mapped by the question ID.

Update tests to test a task model, where previously they were testing a task snapshot.

I've also replaced types.frozen({}) with types.map for task.images and task.questionsMap.

Please request review from @zooniverse/frontend team or an individual member of that team.

Package

  • lib-classifier/plugins/tasks/survey

Linked Issue and/or Talk Post

Part of a group of PRs that remove types.frozen({}) from the survey task, where maps could be used instead.

How to Review

I've used the storybook to test these PRs. Snapshot Wisconsin is also useful as an example of a survey workflow.
https://localhost:8080/?project=zooniverse/snapshot-wisconsin&env=production

Since these PRs are pure refactors, none of the survey task's behaviours should have changed.

Checklist

PR Creator - Please cater the checklist to fit the review needed for your code changes.
PR Reviewer - Use the checklist during your review. Each point should be checkmarked or discussed before PR approval.

General

  • Tests are passing locally and on Github
  • Documentation is up to date and changelog has been updated if appropriate
  • You can yarn panic && yarn bootstrap or docker-compose up --build and FEM works as expected
  • FEM works in all major desktop browsers: Firefox, Chrome, Edge, Safari (Use Browserstack account as needed)
  • FEM works in a mobile browser

General UX

Example Staging Project: i-fancy-cats

  • All pages of a FEM project load: Home Page, Classify Page, and About Pages
  • Can submit a classification
  • Can sign-in and sign-out
  • The component is accessible

Refactoring

  • The PR creator has described the reason for refactoring
  • The refactored component(s) continue to work as expected

@coveralls
Copy link

coveralls commented May 12, 2024

Coverage Status

coverage: 79.274% (-0.05%) from 79.323%
when pulling edc2ceb on eatyourgreens:refactor-survey-task-questions
into 9a7a630 on zooniverse:master.

@eatyourgreens eatyourgreens force-pushed the refactor-survey-task-questions branch 5 times, most recently from 08e1a1e to 0144f6e Compare May 16, 2024 16:01
Add a `Question` model to the survey task. Remove `types.frozen({})`. Model questions as `types.map(Question)`, mapped by the question ID.

Update tests to test a task model, where previously they were testing a task snapshot.

I've also replaced `types.frozen({})` with `types.map` for `task.images` and `task.questionsMap`.
@eatyourgreens eatyourgreens force-pushed the refactor-survey-task-questions branch from 0144f6e to edc2ceb Compare June 8, 2024 09:00
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.

None yet

2 participants