zooniverse / front-end-monorepo

A rebuild of the front-end for zooniverse.org
https://www.zooniverse.org
Apache License 2.0
105 stars 29 forks source link

Workflow Assignment Modal: link URL is incorrect for next workflow #5880

Closed lcjohnso closed 8 months ago

lcjohnso commented 8 months ago

Package

Choose from the list:

Describe the bug

Gravity Spy users report (Talk thread) that the URL used by the "Take me to the next workflow" button in the Workflow Assignment Modal is incorrect -- it does not include /projects at the beginning of the path.

Current Bad URL: https://www.zooniverse.org/zooniverse/gravity-spy/classify/workflow/1934 Target Good URL: https://www.zooniverse.org/projects/zooniverse/gravity-spy/classify/workflow/1934

To Reproduce

  1. Login as zootester (creds in Passbolt)
  2. Navigate to Gravity Spy: https://www.zooniverse.org/projects/zooniverse/gravity-spy
  3. Select Level 1 Workflow from homepage.
  4. Because zootester is leveled up into Level 2, you should see the Workflow Assignment Modal pop-up -- note the incorrect URL for the "Take me to the next workflow" button.

Screenshots

Screenshot of Workflow Assignment Modal:

Screenshot 2024-01-30 at 10 08 46 AM

Expected behavior

URL should include /projects so it is valid.

lcjohnso commented 8 months ago

Issue was reported via Contact Ticket (https://zooniverse.freshdesk.com/a/tickets/18730) and Talk thread (https://www.zooniverse.org/projects/zooniverse/gravity-spy/talk/730/3204115), and I was able to reproduce the issue following instructions above.

eatyourgreens commented 8 months ago

This means that the Next.js Link component, which adds the initial /projects to the URL, isn't being used correctly for those links. Those links need to use client-side links in order to preserve JS state in the browser (eg. any classification work in progress.)

The API for Link changed in Next.js 13, so that's probably the cause of this bug.

eatyourgreens commented 8 months ago

If it's helpful, I used <Anchor as={Link} href={href}> to fix this elsewhere in the project app, when I upgraded it to Next.js v13.