Skip to content

Support wagtail42 - #61

Closed
nickmoreton wants to merge 19 commits into
cfpb:mainfrom
nickmoreton:support/wagtail42
Closed

Support wagtail42#61
nickmoreton wants to merge 19 commits into
cfpb:mainfrom
nickmoreton:support/wagtail42

Conversation

@nickmoreton

@nickmoreton nickmoreton commented Feb 13, 2023

Copy link
Copy Markdown
Contributor

This updates the package for Wagtail 4.2

Additions

Wagtail 4.1

Removals

Wagtail < 4.1

Changes

Testing

Updates github actions and tox matrix

Review

Preview this PR without the whitespace changes

Screenshots

Notes

Todos

Checklist

  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows the standards laid out in the front end playbook
  • Passes all existing automated tests
  • New functions include new tests
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged
  • Visually tested in supported browsers and devices
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)

Comment on lines +5 to +8
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cancels previous running actions if not finished.

Comment thread .pre-commit-config.yaml
Comment on lines 5 to +8
- id: black
args: ["wagtailsharing", "setup.py", "--line-length=79"]
exclude: migrations
- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/pycqa/flake8

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gitlab url is now private

Comment thread .pre-commit-config.yaml
additional_dependencies: [flake8-bugbear==22.1.11]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isort was erroring when pre-commit ran

Comment thread wagtailsharing/models.py
def route(self, request, path_components):
if getattr(request, "routed_by_wagtail_sharing", False):
page = self.get_latest_revision_as_page()
page = self.get_latest_revision_as_object()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in Wagtail 4.0

Comment thread wagtailsharing/views.py

# Get the latest revision for the requested page.
page = page.get_latest_revision_as_page()
page = page.get_latest_revision_as_object()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in Wagtail 4.0

@nickmoreton nickmoreton mentioned this pull request Feb 13, 2023

@victoriachan victoriachan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Nick, I have reviewed this. It looks good. The Readme needs updating though. I have attached some new screenshots to save you the trouble.

I wasn't sure if the Page.serve() changes would affect this, so I tried this locally and it works fine.

Comment thread README.rst
@@ -202,9 +202,9 @@ Compatibility

This project has been tested for compatibility with:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further up on you missed The code examples below assume that you are using the latest Wagtail version (3.0+).. Also wondering if all the screenshots need to be replaced to reflect the look and feel of Wagtail 4.1+.

Since I have been trying this locally, I have taken a few screenshots to save you the trouble:
images.zip

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @victoriachan I have updated the docs.

And thanks so much for the screen shots too 👍

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@victoriachan

Copy link
Copy Markdown

Looks good to me!

@willbarton

Copy link
Copy Markdown
Member

Is there a reason this PR is also bringing in token URLs? That seems like a larger change, and it'd be nice to either update #47 or propose that change separately from a version bump, keep the supported version bump more tightly scoped.

@willbarton

Copy link
Copy Markdown
Member

@nickmoreton It looks like your upgrade commits are relatively independent of the token commits. I'll pull them into a separate branch and get it ready to merge!

@nickmoreton

Copy link
Copy Markdown
Contributor Author

Is there a reason this PR is also bringing in token URLs? That seems like a larger change, and it'd be nice to either update #47 or propose that change separately from a version bump, keep the supported version bump more tightly scoped.

Sorry @willbarton I missed your reply here. That would be great to use the upgrade part separately. Thanks

@chosak

chosak commented Mar 17, 2023

Copy link
Copy Markdown
Member

@nickmoreton I'm closing this as support for Wagtail versions up through 4.2 has now been added in #62, based in part on your contributions. Thank you!

@chosak chosak closed this Mar 17, 2023
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.

5 participants