This now implements the logic to link to the next minor's release notes
when such a version difference is computed. If a patch release
difference is computed, then those release notes are linked.
The utils.tests.js seemed a bit unexpected location, because there is no
`utils.js` module. Now the module defining the tests and the one
defining the functionality are named similarly, as is common in the rest
of the code base.
- resolves #7336
- resolves #7405
- resolves #3938
- fixes #8537
Fix issue where upgrade notification was not using translated content.
Normally, generic model views will be spun up through wagtail.admin.viewsets, which takes care of configuring the add_url_name / edit_url_name etc attributes to ensure that they are cross-linked appropriately. But if you're defining one in isolation, that's an unnecessary hoop to jump through, and the error messages if you don't specify them are fairly opaque. Fix this so that:
1. Non-essential cross-links (e.g. the Add button on the index view, and the Delete button on the edit view) are gracefully omitted if the URLs are undefined;
2. Essential cross-links (e.g. the destination of the redirect after a successful form submission) raise an informative error telling the developer what needs to be defined.
Fixes #8190
Django 4 changed the rendering of radio button / checkbox lists to nested divs rather than ul/li - see 5942ab5eb1. This change simply applies the existing li styles to second-level divs.
we were usng Codecov but weren't actually getting any notifications on pull requests.
Update codecov.yml
Removing `after_n_builds` as there is only 1 build
The ajax-request now uses multipart/form-data, similar to
image-chooser-modal.js/document-chooser-modal.js, which allows to add
and use FileFields in the bulk-upload-views.
If Filter.run is requested to create an unknown output format,
it should not fail silently without writing any output, but instead
throw an exception.
Fixes #8503
This was causing relative urls to be rewritten to use the publicPath.
This meant that the icon font would be referenced at the wrong location
if sites had changed STATIC_URL
fixes #8517
Prompted by https://github.com/wagtail/wagtail/discussions/8362#discussioncomment-2647505 - Python files are expected to be in UTF-8, but `open()` will use the system default encoding, which is likely to be Windows-1252 on Windows. Unfortunately [fileinput](https://docs.python.org/3/library/fileinput.html) doesn't provide an encoding argument until Python 3.10, so we have to over-engineer things a bit to keep things consistent across the rewrite / list / diff modes - opening files in binary mode and explicitly decoding each line as utf-8 (with graceful fallback behaviour on UnicodeDecodeError, so that we don't end up clobbering a file mid-write).
- Co-Authored-By: Khanh Hoang <39248704+thoang43@users.noreply.github.com>
- adds ability to set `base_url_path` on ModelAdmin to override the `app_name`/`model` URL building behaviour
- fixes #8038
* Add construct_synced_page_tree_list hook and use in page unpublish view
* Implement construct_synced_page_tree_list in simple_translation
but only when sync page tree is enabled
* Add hook documentation
* Add construct_synced_page_tree_list hook tests (#8058)
* Move translated and alias pages when WAGTAIL_I18N_ENABLED and WAGTAILSIMPLETRANSLATION_SYNC_PAGE_TREE are enabled
Co-Authored-By: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com>
* Delete corresponding translations when WAGTAIL_I18N_ENABLED and WAGTAILSIMPLETRANSLATION_SYNC_PAGE_TREE are true
Co-Authored-By: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com>
* Rename the hook to be more specific
* Update singular string version in confirm_move.html
* Update test test_translation_count_in_context
Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com>
Co-authored-by: Karl Hobley <karl@kaed.uk>
This argument should be used on all new StreamFields created under Wagtail 3. It does add some clutter to the examples, but only using it in select cases would create more confusion...
resolves #8043
ui-monospace, Menlo, Monaco, ... "Courier New", monospace
Operating Systems and their fonts:
ui-monospace -> MacOS (Menlo, Monaco fallback)
Cascadia ->Windows (since Vista)
Roboto -> Android (since 4.0)
Fira -> Firefox OS
Droid -> Android (<4.0)
Oxygen -> KDE
Ubuntu -> Ubuntu
In addition, ui-monospace is supported for Safari/MacOS (only way to access SF Mono in Mac);
Cascadia is a new Microsoft font-face, and Segue is the fallback.
- resolves #1874
- ensure message is dynamic based on the setting TAG_SPACES_ALLOWED
- Update wagtail/admin/templates/wagtailadmin/widgets/tag_widget.html
- fixes #8269
because you cannot dynamically set attributes on bound methods, we need to update the current classes version of admin_thumb so it can be accessed in sub classes
This will result in a migration, but the migration from a `CharField` to an `EmailField` won't hit the database, as `EmailField` is just a `CharField` with extra default validation.
- add documentation for WAGTAILADMIN_BASE_URL
- ensure that WAGTAILADMIN_BASE_URL is used via a util so that it can fallback from request
- resolves #3248
- remove settings URL from pagination template - not required for query string URLs
- global font family on some elements set by normalize.css would override the desired font
- font stack was not correctly used across some elements
- fixes #8016
Currently bulk publishing raises an error if you include pages that
exist in the database without any revisions. This commit ensures
that a revision exists before the page is published.
Fixes issue 8187.
As per discussion on https://github.com/wagtail/wagtail/discussions/7732, the changes in the upcoming release (sidebar redesign, removal of hallo.js, module reorganisation) warrant a version bump to 3.0 if we're following semantic versioning.
Add system check for use_json_field in StreamField
Change system check level to Warning
Add use_json_field argument to StreamField in test models
Use RemovedInWagtail219Warning instead of a system check
Handle unpacked values in to_python when use_json_field is True
Duplicate models and tests for JSONField-based StreamField
Add basic tests for JSONField-based StreamField
Add json_field property in StreamField to unify JSONField usage
Add docs
Don't use destructuring for kwargs in deconstruct
Add versionchanged note to StreamField reference
* update github bug template to have status:Unconfirmed
- by default, ensure that all new bugs are raised with the label status:Unconfirmed
- for the bug template where 'hints' exist - use HTML comments to hide these
* docs - update issue tracking
- convert from RST to markdown
- add details about when to use Github discussions instead of an issue
- add details about bugs will be raised with the status:Unconfirmed
- add link to PR triage guide
- add links to release schedule & roadmap
- put less emphasis on milestones for new issue creation
- resolves #3746
- add a hidden & disabled first submit input so that ‘enter’ does not trigger submit
- allow the behaviour of the actual submit button to still work as expected
- intentionally HTML only solution as it is simpler and more accessible than JS override
This covers pages, snippets, ModelAdmin and settings. This assumes that the form is a subclass of PermissionedForm such as WagtailAdminModelForm - for pages and snippets this is documented as a requirement (https://docs.wagtail.org/en/stable/advanced_topics/customisation/page_editing_interface.html#customising-generated-forms); for settings it's undocumented (but would entail setting `base_form_class`, and from there it's implicit that the same rules as snippets apply).
For ModelAdmin, it's possible to set a custom form by overriding get_form_class. This isn't documented, but the tests from #2752 make use of this - so in case similar code exists in the wild, I've added an upgrade note.
- the original conversion to markdown happened around the same time as the MyST conversion
- this meant that the syntax was not in sync
- also run prettier over markdown for consistent formatting & whitespace
- see #8007
* Consistently set `aria-haspopup="menu"` for all sidebar menu items that have sub-menus (LB (Ben Johnston))
* Make sure `aria-expanded` is always explicitly set as a string in sidebar (LB (Ben Johnston))
* Use a button element instead of a link for page explorer menu item, for the correct semantics and behavior (LB (Ben Johnston))
- As this is only a dev/testing dependency, and declaring the dependencies that you use directly is likely standard knowledge
- if anyone does overlook it, it'll presumably fail in an obvious and easily fixed way
- see 8ac683ef5c (r68486362)
- this appears to be a point of confusion, where developers are unsure what this field does
- this update makes it more explicit that this field does not do anything, except the queryset usage, by default
All built-in choosers use the standard field_panel_field.html template - it's probably been this way since Wagtail 1.0, when choosers got their own Widget classes rather than just being HTML decoration around a HiddenInput. As a result, the additional template context they pass (e.g. self.object_type_name) is redundant. If any third-party chooser panels exist that do need them (which is unlikely, if they just copy the existing ones), they should override render_as_field themselves to pass whatever context they need.
fixes #6555,
Only the final unsaved FormField appears in the preview of a FormPage. As
FormBuilder adds fields to its formfields attribute using their
clean_name as the key, and FormField.clean_name isn't populated until
FormField.save is called, all unsaved fields are added to the
FormBuilder.formfields dict with the empty string as key. This solves
this by calling get_field_clean_name on the field before insertion
into formfields if clean_name hasn't been set yet.
The django-treebeard 4.3.x is not compatible with Django 4.x because of the dreaded ugettext alias removal problem. This makes sure that a proper django-treebeard version will be installed.
*IMPORTANT*: Please notice that django treebeard *does not* officially support django 4.x. However from my tests I have concludeded that it works fine after you install the version 4.5.x.
This:
- updates the pre-commit configuration and setup.py testing dependencies
- updates isort/flake8 configuration for black
- adds black linting to Makefile and CircleCI configuration
- updates editorconfig with the new line length (88) for py files
- updates python guidelines in docs
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
- `-apple-system, BlinkMacSystemFont` - These are used to target modern iOS Safari, macOS Safari, macOS Firefox and macOS Chrome's system fonts.
- ` 'Segoe UI', system-ui,` - These fonts target windows machines on Windows 7+ [reference](https://markdotto.com/2018/02/07/github-system-fonts/#the-stack). Having system-ui placed after Segoe UI allowed Segoe UI to take precedence when used on Windows machines set to Chinese ( Simplified ) language. There are some known language issues around `system-ui` being used: [This github article](https://infinnie.github.io/blog/2017/systemui.html). However, the purpose of `system-ui` [(reference here)](https://drafts.csswg.org/css-fonts-4/#valdef-font-family-system-ui) is to allow web content to integrate with the look and feel of the native OS. Which makes this font-family a good choice for other devices _if_ the problem is solved by putting Segoe UI first.
- `Roboto,` - This is our fallback font for androids devices. Having Segoe set before this allows windows to use its system default font even if you have installed Roboto for development reasons.
- `Helvetica Neue,` - This is a fallback for older macOS
- `Arial` - Using this to catch any of the very old Windows versions (shoutout windows 95)
- `sans-serif` - Our last resort to get a font without serifs
- ` 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';` - All the emoji's for the OS's mentioned above. 😁
- main_nav_css & main_nav_js were added when the new slim sidebar was being built
- with the legacy styles/js - there was little risk of there being conflicts
- with the new sidebar CSS, this sidebar bundle comes with a large duplicate of what is in core.css so we should add it before the hooks run so that hook scan override if needed as per our documentation
- this is a temporary fix for #7943 - ideally we should avoid sidebar.scss bundle duplicating so much of the core css
- note: JS is lower risk but should follow the same convention
- Bulk Actions were failing for objects with id > 999 in projects with
- Django settings `USE_L10N` and `USE_THOUSAND_SEPARATOR` enabled.
- Test bulk action checkboxes handle USE_THOUSAND_SEPARATOR setting