getodk / central-frontend

Vue.js based frontend for ODK Central
https://docs.getodk.org/central-intro/
Apache License 2.0
32 stars 56 forks source link

Show links to FormPreview in FormList #1003

Closed matthew-white closed 1 month ago

matthew-white commented 1 month ago

As of #1001, pressing the W+F keys shows the "New Preview" button (which links to Web Forms) instead of the default Preview button (which links to Enketo). However, pressing W+F has no effect in the project overview: even though there is a Preview button for each form, "New Preview" is not shown. This PR changes that so that W+F has an effect wherever the Preview button is shown, including the project overview.

What has been done to verify that this works as intended?

Trying it locally.

Why is this the best possible solution? Were any other approaches considered?

The underlying issue is that the "New Preview" logic appears in FormVersionStandardButtons, but FormRow renders EnketoPreview without FormVersionStandardButtons. FormVersionStandardButtons and FormRow are the only two components that render EnketoPreview. My change involves moving the "New Preview" logic from FormVersionStandardButtons to EnketoPreview. In other words, EnketoPreview will manage the form preview button for both Enketo and Web Forms. I'd be happy to rename the EnketoPreview component if that'd make things clearer.

Before submitting this PR, please make sure you have:

matthew-white commented 1 month ago

It looks like there's currently a partial outage with CircleCI, but testing and linting pass for me locally.