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

Investigate if we can automate pending rulemaking wagtail page #6580

Closed
2 tasks
rfultz opened this issue Dec 4, 2024 · 4 comments
Closed
2 tasks

Investigate if we can automate pending rulemaking wagtail page #6580

rfultz opened this issue Dec 4, 2024 · 4 comments

Comments

@rfultz
Copy link
Contributor

rfultz commented Dec 4, 2024

Summary

What we're after:
We want to utilize Wagtail CMS’s scheduled publishing and unpublishing capabilities for the Pending Rulemakings page. This functionality will ensure timely updates by automating page visibility based on predefined dates and times, similar to the scheduling process for homepage banners.

Example of pending rulemaking page

Image

Corresponding homepage banner for pending rulemaking comments

Image

Related issues

Action items

  • A documented plan for enabling scheduled publishing and unpublishing for the Pending Rulemakings page.
    • Investigate Wagtail CMS documentation and settings for scheduling publishing/unpublishing, in the page's status menu
    • Identify any dependencies or limitations specific to the Pending Rulemakings page.
  • Clear steps for implementation, including any required configuration in Wagtail CMS.
  • Confirmation that the scheduling works as expected, including:
    • Proper display of the page after scheduled publication.
    • Automatic removal of the page after the scheduled unpublishing.
  • Testing results to confirm no disruptions to existing content workflows or the CMS.

Completion criteria

  • Scheduled publishing and unpublishing of the pending rulemaking page is implemented
  • A documented plan is written in conjunction with the content team
@rfultz rfultz added this to the 27.1 milestone Dec 4, 2024
@rfultz rfultz moved this to 🔨 Pre-refinement in Website project Dec 4, 2024
@JonellaCulmer JonellaCulmer moved this from 🔨 Pre-refinement to 🔜 Sprint backlog in Website project Dec 5, 2024
@rfultz rfultz moved this from 🔜 Sprint backlog to 📥 Assigned in Website project Dec 10, 2024
@johnnyporkchops
Copy link
Contributor

johnnyporkchops commented Dec 13, 2024

As of version 5.1, "scheduled publishing" is handled in the pages Status panel.
https://docs.wagtail.org/en/v5.1.3/reference/pages/theory.html#scheduled-publishing

Research this command: ./manage.py publish-scheduled
https://docs.wagtail.org/en/v5.1.3/reference/management_commands.html#publish-scheduled

In order for scheduled publishing to work, one has to run ./manage.py publish-scheduled twice:

  • Once after the go-live date/time passes ,to publish it.
  • And then once again after the expiry date/time passes to un-publish it.

However, we can access the Wagtail Scheduled Publishing fields in template code (self.go_live_at and self.expire_at ). But I am not sure how we could use that to control publishing of the page with code.

Poposed solution (Working prototype was demoed in last Sprint Demo)

  1. Add an optional "rulemaking_content" field to banner model/edit-template
  2. Create a new inclusion tag in the home_page.py templatetag to capture any rulemaking_content in banners
  3. Rulemakiing content scheduling will then be controlled by date_active/date_inactive of the banner in which it was placed.
    • This works with both single rulemaking banners and banners for multiple rulemakings
  4. Render the inclusion tag only in the specific rulemaking instance of CustomPage:
        {% if  "pending-rulemaking-matters-comment" in request.path  %}
           {% rulemaking_page_content %}
        {% endif %}
  1. The rulemaking instance of CustomPage template can still be manually edited to add content when needed

Future Work: Once we are on Wagtail <6.1, we can also implement a Banner PageListingViewset in the admin sidebar that will allow us to show the date_active/date_inactive on the listing page so one does not have to open each banner to see the dates--making it much easier for editors to schedule and manage banners. In this example I added an add'l property to show active banners dates in green. Issue: #6629
Image

@patphongs
Copy link
Member

Thanks @johnnyporkchops for your work on this. I have a question about what happens if there's multiple rulemakings that are listed with different opening and closing comment period dates? Would we have to edit the page and modify the listing separately?

@rfultz rfultz modified the milestones: 27.3, 27.4 Jan 21, 2025
@johnnyporkchops
Copy link
Contributor

Thanks @johnnyporkchops for your work on this. I have a question about what happens if there's multiple rulemakings that are listed with different opening and closing comment period dates? Would we have to edit the page and modify the listing separately?

@patphongs No, the rulemaking CustomPage would not have to be manually edited. I demoed this scenario to the Content team and it is probably better to demo it again so you can see, rather than attempt to explain it in writing.

@tmpayton tmpayton modified the milestones: 27.4, 27.5 Feb 4, 2025
@cnlucas
Copy link
Member

cnlucas commented Feb 18, 2025

Research has been logged in this ticket, ticket for implementation here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

No branches or pull requests

6 participants