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

Upgrade to Wagtail 3.0.3 #7423

Merged
merged 14 commits into from
Jan 18, 2023
Merged

Upgrade to Wagtail 3.0.3 #7423

merged 14 commits into from
Jan 18, 2023

Conversation

chosak
Copy link
Member

@chosak chosak commented Dec 21, 2022

(Note: this PR is going into upgrade/wagtail, not main.)

This PR updates the version of Wagtail used from 2.16.3 to 3.0.3.

With this PR it's possible to run a local server and load basic pages on the site. Note that some of our Python tests and some of our acceptance tests fail against this PR; see below for details.

This PR is primarily the code changes necessary to get tox to even run completely and report test failures:

This PR also includes a temporary pin of the wagtail-treemodeladmin package to the branch being worked on in cfpb/wagtail-treemodeladmin#34, as it adds 3.x support.

Notes and todos

The Python tests that fail here all relate to our custom code for StreamField migrations, which we document here. These fail because of this documented change to the way PageRevision data is stored. I would prefer to address those failures in another PR; see internal Design-and-Content-Team#117 for some context.

Besides the additional few functional test failures, there are definitely additional minor changes we'll want to make related to the Wagtail 3.0 upgrade; for example updating documentation that refers to the old Wagtail module paths, or deprecating our custom page description functionality, which we backported from 3.0 in #7134. I'd like to get this PR merged into upgrade/wagtail to do the heavy lifting and then address those things in subsequent smaller PRs.

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code follows the standards laid out in the CFPB development guidelines
  • Future todos are captured in comments and/or tickets

chosak added 9 commits January 9, 2023 11:11
This commit updates the imports of Wagtail modules to be compatible
with the new organization in Wagtail 3.x. These changes are the result
of running Wagtail's updatemodulepaths command, as documented:

https://docs.wagtail.org/en/latest/releases/3.0.html#changes-to-module-paths
In Wagtail 2.x, the second positional argument to FieldPanel was its
heading, but starting in 3.x you need to specify it as a keyword
argument (`heading="whatever"`).
In Wagtail 3.0, PageRevision models have a content field, not a
content_json field.
anselmbradford and others added 4 commits January 10, 2023 13:55
In Cypress tests we check for block visibility using

.should('be.visible')

but this assumes that the block is visible within the browser screen
dimensions. In Wagtail 3 the admin UI changes significantly, and the
spacing changes mean that some blocks may be off screen.

This commit adds

.scrollIntoView()

before checking whether a block is visible.
In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates our custom
migration utils to support that change.
In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates the places in our
code where we referenced that field.
@chosak
Copy link
Member Author

chosak commented Jan 11, 2023

@anselmbradford @willbarton all tests pass against this PR now; the only thing that fails is Python coverage but those failures are against infrequently used management commands that didn't have tests before.

@chosak chosak merged commit 2bad2f7 into upgrade/wagtail Jan 18, 2023
@chosak chosak deleted the upgrade/wagtail-3.0.3 branch January 18, 2023 15:58
chosak added a commit that referenced this pull request Jan 24, 2023
* Bump Wagtail version from 2.16.3 to 3.0.3

* Update Wagtail module paths for 3.x

This commit updates the imports of Wagtail modules to be compatible
with the new organization in Wagtail 3.x. These changes are the result
of running Wagtail's updatemodulepaths command, as documented:

https://docs.wagtail.org/en/latest/releases/3.0.html#changes-to-module-paths

* Use FieldPanel instead of StreamFieldPanel

StreamFieldPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of ImageChooserPanel

ImageChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of DocumentChooserPanel

DocumentChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of SnippetChooserPanel

 SnippetChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of PageChooserPanel

PageChooserPanel has been (mostly) deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Fix FieldPanel usage for Wagtail 3.x

In Wagtail 2.x, the second positional argument to FieldPanel was its
heading, but starting in 3.x you need to specify it as a keyword
argument (`heading="whatever"`).

* Update indexed field on IndexedPageRevision

In Wagtail 3.0, PageRevision models have a content field, not a
content_json field.

* Workaround for fbjs global undefined issue (#7446)

* Scroll to blocks in Cypress tests

In Cypress tests we check for block visibility using

.should('be.visible')

but this assumes that the block is visible within the browser screen
dimensions. In Wagtail 3 the admin UI changes significantly, and the
spacing changes mean that some blocks may be off screen.

This commit adds

.scrollIntoView()

before checking whether a block is visible.

* Update migration utils for content JSONField

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates our custom
migration utils to support that change.

* Update uses of PageRevision content field

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates the places in our
code where we referenced that field.

* Avoid unsafe chaining of Cypress functions

https://docs.cypress.io/api/commands/scrollintoview

Co-authored-by: Ans <[email protected]>
chosak added a commit that referenced this pull request Feb 1, 2023
* Bump Wagtail version from 2.16.3 to 3.0.3

* Update Wagtail module paths for 3.x

This commit updates the imports of Wagtail modules to be compatible
with the new organization in Wagtail 3.x. These changes are the result
of running Wagtail's updatemodulepaths command, as documented:

https://docs.wagtail.org/en/latest/releases/3.0.html#changes-to-module-paths

* Use FieldPanel instead of StreamFieldPanel

StreamFieldPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of ImageChooserPanel

ImageChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of DocumentChooserPanel

DocumentChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of SnippetChooserPanel

 SnippetChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of PageChooserPanel

PageChooserPanel has been (mostly) deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Fix FieldPanel usage for Wagtail 3.x

In Wagtail 2.x, the second positional argument to FieldPanel was its
heading, but starting in 3.x you need to specify it as a keyword
argument (`heading="whatever"`).

* Update indexed field on IndexedPageRevision

In Wagtail 3.0, PageRevision models have a content field, not a
content_json field.

* Workaround for fbjs global undefined issue (#7446)

* Scroll to blocks in Cypress tests

In Cypress tests we check for block visibility using

.should('be.visible')

but this assumes that the block is visible within the browser screen
dimensions. In Wagtail 3 the admin UI changes significantly, and the
spacing changes mean that some blocks may be off screen.

This commit adds

.scrollIntoView()

before checking whether a block is visible.

* Update migration utils for content JSONField

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates our custom
migration utils to support that change.

* Update uses of PageRevision content field

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates the places in our
code where we referenced that field.

* Avoid unsafe chaining of Cypress functions

https://docs.cypress.io/api/commands/scrollintoview

Co-authored-by: Ans <[email protected]>
willbarton pushed a commit that referenced this pull request Feb 10, 2023
* Bump Wagtail version from 2.16.3 to 3.0.3

* Update Wagtail module paths for 3.x

This commit updates the imports of Wagtail modules to be compatible
with the new organization in Wagtail 3.x. These changes are the result
of running Wagtail's updatemodulepaths command, as documented:

https://docs.wagtail.org/en/latest/releases/3.0.html#changes-to-module-paths

* Use FieldPanel instead of StreamFieldPanel

StreamFieldPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of ImageChooserPanel

ImageChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of DocumentChooserPanel

DocumentChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of SnippetChooserPanel

 SnippetChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of PageChooserPanel

PageChooserPanel has been (mostly) deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Fix FieldPanel usage for Wagtail 3.x

In Wagtail 2.x, the second positional argument to FieldPanel was its
heading, but starting in 3.x you need to specify it as a keyword
argument (`heading="whatever"`).

* Update indexed field on IndexedPageRevision

In Wagtail 3.0, PageRevision models have a content field, not a
content_json field.

* Workaround for fbjs global undefined issue (#7446)

* Scroll to blocks in Cypress tests

In Cypress tests we check for block visibility using

.should('be.visible')

but this assumes that the block is visible within the browser screen
dimensions. In Wagtail 3 the admin UI changes significantly, and the
spacing changes mean that some blocks may be off screen.

This commit adds

.scrollIntoView()

before checking whether a block is visible.

* Update migration utils for content JSONField

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates our custom
migration utils to support that change.

* Update uses of PageRevision content field

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates the places in our
code where we referenced that field.

* Avoid unsafe chaining of Cypress functions

https://docs.cypress.io/api/commands/scrollintoview

Co-authored-by: Ans <[email protected]>
willbarton pushed a commit that referenced this pull request Feb 13, 2023
* Bump Wagtail version from 2.16.3 to 3.0.3

* Update Wagtail module paths for 3.x

This commit updates the imports of Wagtail modules to be compatible
with the new organization in Wagtail 3.x. These changes are the result
of running Wagtail's updatemodulepaths command, as documented:

https://docs.wagtail.org/en/latest/releases/3.0.html#changes-to-module-paths

* Use FieldPanel instead of StreamFieldPanel

StreamFieldPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of ImageChooserPanel

ImageChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of DocumentChooserPanel

DocumentChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of SnippetChooserPanel

 SnippetChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of PageChooserPanel

PageChooserPanel has been (mostly) deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Fix FieldPanel usage for Wagtail 3.x

In Wagtail 2.x, the second positional argument to FieldPanel was its
heading, but starting in 3.x you need to specify it as a keyword
argument (`heading="whatever"`).

* Update indexed field on IndexedPageRevision

In Wagtail 3.0, PageRevision models have a content field, not a
content_json field.

* Workaround for fbjs global undefined issue (#7446)

* Scroll to blocks in Cypress tests

In Cypress tests we check for block visibility using

.should('be.visible')

but this assumes that the block is visible within the browser screen
dimensions. In Wagtail 3 the admin UI changes significantly, and the
spacing changes mean that some blocks may be off screen.

This commit adds

.scrollIntoView()

before checking whether a block is visible.

* Update migration utils for content JSONField

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates our custom
migration utils to support that change.

* Update uses of PageRevision content field

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates the places in our
code where we referenced that field.

* Avoid unsafe chaining of Cypress functions

https://docs.cypress.io/api/commands/scrollintoview

Co-authored-by: Ans <[email protected]>
chosak added a commit that referenced this pull request Feb 15, 2023
* Bump Wagtail version from 2.16.3 to 3.0.3

* Update Wagtail module paths for 3.x

This commit updates the imports of Wagtail modules to be compatible
with the new organization in Wagtail 3.x. These changes are the result
of running Wagtail's updatemodulepaths command, as documented:

https://docs.wagtail.org/en/latest/releases/3.0.html#changes-to-module-paths

* Use FieldPanel instead of StreamFieldPanel

StreamFieldPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of ImageChooserPanel

ImageChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of DocumentChooserPanel

DocumentChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of SnippetChooserPanel

 SnippetChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of PageChooserPanel

PageChooserPanel has been (mostly) deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Fix FieldPanel usage for Wagtail 3.x

In Wagtail 2.x, the second positional argument to FieldPanel was its
heading, but starting in 3.x you need to specify it as a keyword
argument (`heading="whatever"`).

* Update indexed field on IndexedPageRevision

In Wagtail 3.0, PageRevision models have a content field, not a
content_json field.

* Workaround for fbjs global undefined issue (#7446)

* Scroll to blocks in Cypress tests

In Cypress tests we check for block visibility using

.should('be.visible')

but this assumes that the block is visible within the browser screen
dimensions. In Wagtail 3 the admin UI changes significantly, and the
spacing changes mean that some blocks may be off screen.

This commit adds

.scrollIntoView()

before checking whether a block is visible.

* Update migration utils for content JSONField

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates our custom
migration utils to support that change.

* Update uses of PageRevision content field

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates the places in our
code where we referenced that field.

* Avoid unsafe chaining of Cypress functions

https://docs.cypress.io/api/commands/scrollintoview

Co-authored-by: Ans <[email protected]>
chosak added a commit that referenced this pull request Feb 15, 2023
* Bump Wagtail version from 2.16.3 to 3.0.3

* Update Wagtail module paths for 3.x

This commit updates the imports of Wagtail modules to be compatible
with the new organization in Wagtail 3.x. These changes are the result
of running Wagtail's updatemodulepaths command, as documented:

https://docs.wagtail.org/en/latest/releases/3.0.html#changes-to-module-paths

* Use FieldPanel instead of StreamFieldPanel

StreamFieldPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of ImageChooserPanel

ImageChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of DocumentChooserPanel

DocumentChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of SnippetChooserPanel

 SnippetChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of PageChooserPanel

PageChooserPanel has been (mostly) deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Fix FieldPanel usage for Wagtail 3.x

In Wagtail 2.x, the second positional argument to FieldPanel was its
heading, but starting in 3.x you need to specify it as a keyword
argument (`heading="whatever"`).

* Update indexed field on IndexedPageRevision

In Wagtail 3.0, PageRevision models have a content field, not a
content_json field.

* Workaround for fbjs global undefined issue (#7446)

* Scroll to blocks in Cypress tests

In Cypress tests we check for block visibility using

.should('be.visible')

but this assumes that the block is visible within the browser screen
dimensions. In Wagtail 3 the admin UI changes significantly, and the
spacing changes mean that some blocks may be off screen.

This commit adds

.scrollIntoView()

before checking whether a block is visible.

* Update migration utils for content JSONField

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates our custom
migration utils to support that change.

* Update uses of PageRevision content field

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates the places in our
code where we referenced that field.

* Avoid unsafe chaining of Cypress functions

https://docs.cypress.io/api/commands/scrollintoview

Co-authored-by: Ans <[email protected]>
chosak added a commit that referenced this pull request Mar 3, 2023
* Bump Wagtail version from 2.16.3 to 3.0.3

* Update Wagtail module paths for 3.x

This commit updates the imports of Wagtail modules to be compatible
with the new organization in Wagtail 3.x. These changes are the result
of running Wagtail's updatemodulepaths command, as documented:

https://docs.wagtail.org/en/latest/releases/3.0.html#changes-to-module-paths

* Use FieldPanel instead of StreamFieldPanel

StreamFieldPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of ImageChooserPanel

ImageChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of DocumentChooserPanel

DocumentChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of SnippetChooserPanel

 SnippetChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of PageChooserPanel

PageChooserPanel has been (mostly) deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Fix FieldPanel usage for Wagtail 3.x

In Wagtail 2.x, the second positional argument to FieldPanel was its
heading, but starting in 3.x you need to specify it as a keyword
argument (`heading="whatever"`).

* Update indexed field on IndexedPageRevision

In Wagtail 3.0, PageRevision models have a content field, not a
content_json field.

* Workaround for fbjs global undefined issue (#7446)

* Scroll to blocks in Cypress tests

In Cypress tests we check for block visibility using

.should('be.visible')

but this assumes that the block is visible within the browser screen
dimensions. In Wagtail 3 the admin UI changes significantly, and the
spacing changes mean that some blocks may be off screen.

This commit adds

.scrollIntoView()

before checking whether a block is visible.

* Update migration utils for content JSONField

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates our custom
migration utils to support that change.

* Update uses of PageRevision content field

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates the places in our
code where we referenced that field.

* Avoid unsafe chaining of Cypress functions

https://docs.cypress.io/api/commands/scrollintoview

Co-authored-by: Ans <[email protected]>
chosak added a commit that referenced this pull request Mar 8, 2023
* Bump Wagtail version from 2.16.3 to 3.0.3

* Update Wagtail module paths for 3.x

This commit updates the imports of Wagtail modules to be compatible
with the new organization in Wagtail 3.x. These changes are the result
of running Wagtail's updatemodulepaths command, as documented:

https://docs.wagtail.org/en/latest/releases/3.0.html#changes-to-module-paths

* Use FieldPanel instead of StreamFieldPanel

StreamFieldPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of ImageChooserPanel

ImageChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of DocumentChooserPanel

DocumentChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of SnippetChooserPanel

 SnippetChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of PageChooserPanel

PageChooserPanel has been (mostly) deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Fix FieldPanel usage for Wagtail 3.x

In Wagtail 2.x, the second positional argument to FieldPanel was its
heading, but starting in 3.x you need to specify it as a keyword
argument (`heading="whatever"`).

* Update indexed field on IndexedPageRevision

In Wagtail 3.0, PageRevision models have a content field, not a
content_json field.

* Workaround for fbjs global undefined issue (#7446)

* Scroll to blocks in Cypress tests

In Cypress tests we check for block visibility using

.should('be.visible')

but this assumes that the block is visible within the browser screen
dimensions. In Wagtail 3 the admin UI changes significantly, and the
spacing changes mean that some blocks may be off screen.

This commit adds

.scrollIntoView()

before checking whether a block is visible.

* Update migration utils for content JSONField

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates our custom
migration utils to support that change.

* Update uses of PageRevision content field

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates the places in our
code where we referenced that field.

* Avoid unsafe chaining of Cypress functions

https://docs.cypress.io/api/commands/scrollintoview

Co-authored-by: Ans <[email protected]>
chosak added a commit that referenced this pull request Mar 9, 2023
* Bump Wagtail version from 2.16.3 to 3.0.3

* Update Wagtail module paths for 3.x

This commit updates the imports of Wagtail modules to be compatible
with the new organization in Wagtail 3.x. These changes are the result
of running Wagtail's updatemodulepaths command, as documented:

https://docs.wagtail.org/en/latest/releases/3.0.html#changes-to-module-paths

* Use FieldPanel instead of StreamFieldPanel

StreamFieldPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of ImageChooserPanel

ImageChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of DocumentChooserPanel

DocumentChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of SnippetChooserPanel

 SnippetChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of PageChooserPanel

PageChooserPanel has been (mostly) deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Fix FieldPanel usage for Wagtail 3.x

In Wagtail 2.x, the second positional argument to FieldPanel was its
heading, but starting in 3.x you need to specify it as a keyword
argument (`heading="whatever"`).

* Update indexed field on IndexedPageRevision

In Wagtail 3.0, PageRevision models have a content field, not a
content_json field.

* Workaround for fbjs global undefined issue (#7446)

* Scroll to blocks in Cypress tests

In Cypress tests we check for block visibility using

.should('be.visible')

but this assumes that the block is visible within the browser screen
dimensions. In Wagtail 3 the admin UI changes significantly, and the
spacing changes mean that some blocks may be off screen.

This commit adds

.scrollIntoView()

before checking whether a block is visible.

* Update migration utils for content JSONField

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates our custom
migration utils to support that change.

* Update uses of PageRevision content field

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates the places in our
code where we referenced that field.

* Avoid unsafe chaining of Cypress functions

https://docs.cypress.io/api/commands/scrollintoview

Co-authored-by: Ans <[email protected]>
chosak added a commit that referenced this pull request Mar 9, 2023
* Bump Wagtail version from 2.16.3 to 3.0.3

* Update Wagtail module paths for 3.x

This commit updates the imports of Wagtail modules to be compatible
with the new organization in Wagtail 3.x. These changes are the result
of running Wagtail's updatemodulepaths command, as documented:

https://docs.wagtail.org/en/latest/releases/3.0.html#changes-to-module-paths

* Use FieldPanel instead of StreamFieldPanel

StreamFieldPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of ImageChooserPanel

ImageChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of DocumentChooserPanel

DocumentChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of SnippetChooserPanel

 SnippetChooserPanel has been deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Use FieldPanel instead of PageChooserPanel

PageChooserPanel has been (mostly) deprecated in 3.0:

https://docs.wagtail.org/en/latest/releases/3.0.html#removal-of-special-purpose-field-panel-types

* Fix FieldPanel usage for Wagtail 3.x

In Wagtail 2.x, the second positional argument to FieldPanel was its
heading, but starting in 3.x you need to specify it as a keyword
argument (`heading="whatever"`).

* Update indexed field on IndexedPageRevision

In Wagtail 3.0, PageRevision models have a content field, not a
content_json field.

* Workaround for fbjs global undefined issue (#7446)

* Scroll to blocks in Cypress tests

In Cypress tests we check for block visibility using

.should('be.visible')

but this assumes that the block is visible within the browser screen
dimensions. In Wagtail 3 the admin UI changes significantly, and the
spacing changes mean that some blocks may be off screen.

This commit adds

.scrollIntoView()

before checking whether a block is visible.

* Update migration utils for content JSONField

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates our custom
migration utils to support that change.

* Update uses of PageRevision content field

In Wagtail 3.0+, the PageRevision content_json TextField has been
changed to a content JSONField. This commit updates the places in our
code where we referenced that field.

* Avoid unsafe chaining of Cypress functions

https://docs.cypress.io/api/commands/scrollintoview

Co-authored-by: Ans <[email protected]>
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.

3 participants