* Update analytics documentation, and reflect docs in code
Update analytics documentation to remove UA and edit the code to make it match the GA4 docs.
- Re-write analytics documentation intro
- Remove: UA documentation
- Remove: UA dataLayer pushes
- Remove: data-link-group (migrate into data-link-position where appropriate)
- Remove: data-cta-type="button"
- Remove: data-cta-type="link"
- data-cta and data-link should not be used on the same attribute
* review fixes
* Support using the url() helper in a non-CMS page to get a path for a page that will only exist in the CMS
Depends on the CMS page being on a planned/known path in the tree. See the updates to cms.rst for more
* Fix italics in documentation
* Update "make preflight" command to allow a -- --retain-db flag
This will help people avoid blatting their local DB and losing WIP CMS pages
* Improve formatting (line breaks) for the boostrap_local_admin management command
* Add tool to download images to match a fresh DB download
* Expand set to default rendition sizes exported, so that downloaded images all have appropriate sizes made
The 165x165 is what the Image Library in Wagtail needs, so we must ensure a local download of images regenerates that immediately
* Add docs for the image-download tool
* Exclude image renditions from the DB export
These are not needed, and indeed block the [re]generation of renditions after download. If a DB row exists for a rendition, even though the image does not, Wagtail won't regenerate an image rendition to replace it because it thinks it already exists.
* Test fixups
* Add extra line to Makefile help explain how to use --retain-db flag via make
* Add docs explaining how to get CMS state down to local dev
* Minor fixups following code review
* Exclude WorkflowState from DB export to avoid integrity errors
WorkflowState references TaskState, which cannot be dumped because it may
contain sensitive info.
We could dump TaskState and redact TaskState.comment, but this approach
is simpler and exporting the state of a workflow to local developers is
not something we need to do
* Add the LeadershipPage model to the DB export - essential
Without this, the LeadershipPage only exists as the Page metadata,
with no content, and cannot be edited or deleted locally
* Update documentation to point out that new CMS pages need to be added to the export script, too
* Fix node warning calling rmdirSync() when running Playwright setup (Fixes#15058)
* Add linnks to Axe rules in testing docs
* Add link to a11y test job and fix heading levels in docs
* Amend all usage of docker-compose to be docker compose
This is because the ubuntu-latest GHA image no longer supports the V1 compose API, which was breaking our CI.
https://github.com/actions/runner-images/issues/9692
This is a wholesale change, to ensure consistent use of the v2 syntax
* Address subtle container-naming change brough in with docker compose v2
With v1 we had Selenium Grid name containers ..._selenium-hub_1, but with v2
that changed to ...-selenium-hub-1, causing the jq filter to miss when trying
to extract the IP we needed.
* Remove now-redundant docker-compose.yaml version key
* Add support for controlling which CMS Page types can be used in the site
This means we can control when a page is available for use in the CMS, versus
simply being in the codebase. Also, note that removing a particular page class
from this allowlist will not break existing pages that are of that class, but
will stop anyone adding a _new_ one.
NB: EVERY TIME we add a new Wagtail Page subclass to the CMS, we must add
to the CMS_ALLOWED_PAGE_MODELS setting if we want it to be selectable as
a new child page in Production (or ticket up when we do want to add it to
the setting)
* Fix DEV mode allowance of all page types
* Add wagtail-localize-smartling to the project, for Smartling L10N support
* Add docs for wagtail-localize-smartling
* Minor reformatting
* Fix duplicated env var reference 🤦
* Add a management command that wraps the sync_smartling command so we can monitor it with a DMS
* Update minimal_site pytest fixture to ensure only one Site exists
Previously, it was adding an additional site beyond the default one bootstrapped by Wagtail migrations
* Add a new decorator to help us transition gracefully from a Django-based view to a CMS-based replacement
See docstring on the decorator for all the details
* Add documentation for the prefer_cms decorator
* Add mozilla-django-oidc to the project dependencies
* Add SSO support to Bedrock for accessing Wagtail and Django admins
* Plumbs in mozilla-django-oidc
* Add custom login pages for Wagtail and Django admins that show an SSO button instead of form fields
* Retain support for username + password login (for local development)
* Tests
* Add custom CSRF page to help explain SSO-related session loss, if it occurs
Because a renewed/cycled OIDC/SSO session can zap a CSRF token and block
a user from submitting a CMS edit, we need to provide a bit more information
about what's happened. This changeset adds that, via a new template and a tiny view
to serve it, plugged in as Django's default CSRF view
Logged out users (who are very unlikely to see this anyway) get a simple
version of the message, while logged in users get more detail/context.
* Bump SSO lease time to 18 hours - trying to balance awkward signouts with wanting re-checks
* Update test.env so that Wagtail and Django admins are available by default when urlconf is generated. Oddly the reload trick didn't work here
* Update bedrock/base/templates/403_csrf.html
Co-authored-by: Alex Gibson <alexgibson@users.noreply.github.com>
* Make translation tagging consistent on new login templates
* Move new CSRF view to use a CSS bundle, not inline CSS
* Remove old, redundant CSRF view
It looks like this was no longer in use. It wasn't specified as settings.CSRF_FAILURE_VIEW so wouldn't have been used/found by Django I believe
* Drop translation markup from login templates to simplify
* Don't count the test 404 and 500 views as nonlocaled, because we do localize them
* Update bedrock/admin/templates/wagtailadmin/login.html
* Tweak wording re SSO for login pages
---------
Co-authored-by: Alex Gibson <alexgibson@users.noreply.github.com>
* Add django-rq to the project, with initial configuration for two redis-backed queues if redis is available
* Add Django-rq to project, including link from (now necessary) Django admin's userlinks
* Update Docker support to run a local worker node for RQ
* Add Sentry integration for Redis and for RQ
* Add a make command to run the worker queue
Temporarily loads env vars from .env, looking for REDIS_URL
* Make a new setting that makes it unambiguous whether a task queue is available
* Add helper that will enqueue a task or immediately execute it, depending on whether the task queue is available
Note that if it finds a queue is available it will put a job in there, regardless of whether the queue is being processed by a worker
* Switch image-rendition pre-generation to use the task queue, if available
* Add initial, basic, docs about the task queue
* Improve logging around task queue usage
* Fix formatting of Makefile
Thanks @janbrasna!
* Typo fixes in documentation
Thanks @janbrasna!