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

Track republishing of Pages in the new Republishing UI #9042

Merged
merged 2 commits into from
May 15, 2024

Conversation

Gweaton
Copy link
Contributor

@Gweaton Gweaton commented May 14, 2024

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

Context

Trello card

Now that we've added a new UI for republishing content to replace the running of various rake tasks, we want to know how often it's being used and why.

Changes in this PR

This PR adds a new RepublishingEvent model to Whitehall to keep track of an action being performed (i.e. republishing a thing), a user-entered reason why, and the user who performed the action. The (mandatory) reason for republishing is captured in a newly-added textarea in the Republishing UI for republishing specific Pages, but will shortly be added to the other content types in the interface.

Screenshot (including validation error)

image

We'll create one of these whenever a user republishes content via the
admin interface to keep track of why and how often this action is being
performed, as well as the reason why. This will help us understand how
useful this part of the admin interface is.
This adds a textarea to the Page republishing confirmation page to
capture the reason for republishing a page. This is a mandatory field.

Submitting the form now creates a RepublishingEvent containing:

- the action being performed: e.g. that a page has been scheduled for
  republishing, re-using the original flash message for this
- the reason why the document was republished to help us understand how
  people are using this functionality
- the user who performed the republishing

I've opted not to add a cucumber feature test for the validation error
as although I've seen one or two validation error tests in cucumber
tests, I feel this is well-tested enough in the functional test, and
don't want to double the number of tests as we'd need to add one for
each type of content item anyway.
@Gweaton Gweaton merged commit 4374419 into main May 15, 2024
24 checks passed
@Gweaton Gweaton deleted the track-republishing-events branch May 15, 2024 08:43
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