Wykres commitów

18310 Commity (57d141c7015a99a2b6b0175551b6ee74f75f6488)

Autor SHA1 Wiadomość Data
Jake Howard 57d141c701 Don't persist credentials in CI
There's no vulnerability here, especially since the token explicitly only has read access anyway, but it's worth improving regardless.
2024-12-18 14:37:54 +00:00
Sage Abdullah 6b33690cd3 Refactor pages revisions_revert view to be a subclass of EditView ()
Currently, the code that handles the POST request for reverting a
revision lives in the EditView class, while the revisions_revert view is
a smaller view that tries to "mimic" the EditView for rendering the view
as part of a GET request. The view injects the revision ID into the
form, which has the action URL hardcoded to the EditView. Including the
revision ID in the form allows the EditView to tell whether it's in a
"reverting" mode or not, and adjust the POST logic accordingly.

However, this results in possible inconsistencies in both views.
Whenever we want to change EditView code or template, we need to make
sure to also update the revisions_revert view. The fact that the
revisions_revert view is a function-based view doesn't help.

Instead of copying the view code and reusing the template with the
addition of injecting the revision ID in the form, turn it into a proper
subclass of the EditView, and make use of Django's URL patterns to
retrieve the revision ID in the EditView.

This approach is similar to how reverting revisions is handled for
snippets.

Ideally, all the code for handling revisions revert should live in the
RevisionsRevertView, and the EditView shouldn't know about it at all.
This is how it's done for snippets: all the revisions revert-related
code is put in RevisionsRevertMixin.

However, this is currently not possible for pages without more
significant refactoring, so this commit does the minimal change needed
to achieve the goal of keeping the revisions_revert view in sync with
the EditView.
2024-12-18 14:36:39 +00:00
Matt Westcott 8bb2a18cd7 Release note for 2024-12-18 12:55:43 +00:00
Sage Abdullah 130a9ebd93 Enable breadcrumbs by default 2024-12-18 12:52:31 +00:00
Sage Abdullah 58d9f9bc72 Make generic/confirm_unschedule.html template extend generic/base.html template 2024-12-18 12:52:31 +00:00
Sage Abdullah faa37c0068 Make generic/confirm_unpublish.html template extend generic/base.html template 2024-12-18 12:52:31 +00:00
Sage Abdullah e63b42b547
Add explicit path to Sphinx configuration in .readthedocs.yml 2024-12-18 11:34:31 +00:00
Sage Abdullah 286d7cbd6b Enable breadcrumbs in revisions compare view () 2024-12-18 00:45:43 +00:00
Matt Westcott 01e7291486 Handle old construct_wagtail_userbar signature in ChecksSidePanel 2024-12-18 00:41:31 +00:00
Claude Meyer 268174b781 Release notes for 2024-12-17 22:10:23 +00:00
Claude Meyer aa08e86cba Fixes by adding page as a third argument to construct_wagtail_userbar hooks along with a deprecation warning. 2024-12-17 22:10:09 +00:00
Jake Howard 076af8bec8 Automatically set CSP when serving images and documents ()
Addresses 
2024-12-17 21:06:39 +00:00
jhrr 5402010d16 Allow hook override of user profile avatar url in admin tags ()
Fixes 
2024-12-17 20:42:36 +00:00
Matt Westcott 9889bddcb8 Release notes for 2024-12-10 01:54:54 +00:00
LB Johnston ae89829661 Deprecate & rework imports for `window.buildExpandingFormset`
- window.buildExpandingFormset and using the base class `ExpandingFormset` can now be deprecated.
- Move the window global setting to core.js which avoids the need to add the import in editor_js, to align with other future deprecations in core.js
- Add upgrade considerations in release notes
- `ExpandingFormset` is still needed for other existing usage (InlinePanel/MultipleChooserPanel)
- Add additional JSDoc and updates to Eslint to advise developers that this feature is not to be used for new code
2024-12-10 01:42:32 +00:00
LB Johnston 6bc9b0ea40 Adopt Stimulus `w-formset` attributes in Group edit/create view
- Use the Wagtail admin formset mixin to adopt new data attributes on core form parts
- Update the edit/create templates to put the attributes on the remaining elements
- Add basic unit tests for smoke testing data attributes
- Remove CSP incompatible inline scripts approach
- Remove the now unused standalone static build/imports for the group edit view as this will not be needed
- Update Eslint accordingly
2024-12-10 01:42:32 +00:00
LB Johnston 585d3e3385 Adopt Stimulus `w-formset` attributes in Workflow pages basic formset
- Use the Wagtail admin formset mixin to adopt new data attributes on core form parts
- Update the edit/create templates to put the attributes on the remaining elements
- Add basic unit tests for smoke testing data attributes
- Remove CSP incompatible inline scripts approach
- Remove the now unused standalone static build/imports for the group edit view as this will not be needed
- Ensure that the edit workflow form does not render any JS or attributes when the pages are not actually editable (workflow disabled)
2024-12-10 01:42:32 +00:00
LB Johnston 3d6f1c366f Prepare Wagtail admin formset mixin
- Leverage the new Django 4.0 feature `deletion_widget` for formsets to attach data attributes and make the input a HiddenInput for existing and 'blank' forms.
- Add support for data attributes used by the new Stimulus FormsetController
2024-12-10 01:42:32 +00:00
LB Johnston 8d35cc57e6 Add initial Stimulus FormsetController `w-formset`
Replaces the core functionality in `client/src/components/ExpandingFormset/index.js` and the Delete callbacks in other usage of the `window.buildExpandingFormset` function.

Provides limitations on add/delete once the min/max have been reached but does not set up any disabling of these buttons as this is currently in the remit of `InlinePanel`.

Includes a full test suite for error handling, updating inputs and nested usage which leverages Stimulus' scope management.

Does not rely on any id attribute structure or wrangling.

Relates to 
2024-12-10 01:42:32 +00:00
LB 4020efc4d0 Add JSDoc to exported function in runInlineScripts 2024-12-10 01:42:32 +00:00
LB d42af56220 Create `transition` util to resolve a promise when an animation ends 2024-12-10 01:42:32 +00:00
Sage Abdullah 4760509d65
Release note for 2024-12-09 11:06:26 +00:00
Sage Abdullah c7700feae2
Use built-in venv instead of pipenv in CircleCI 2024-12-09 10:38:44 +00:00
Ayaan 3e75c018be Add support for query string params in WAGTAIL_GRAVATAR_PROVIDER_URL
- Enhance capabilities for WAGTAIL_GRAVATAR_PROVIDER_URL URL to support merging of URL params.
- Fixes 
- Rework of original PR 
2024-12-07 21:23:13 +10:00
Krystian Magdziarz 32417f9adc Fix Missing Cache-Control Headers for Password-Protected Pages ()
Fixes 
2024-12-07 02:49:16 +00:00
Matt Westcott 94d3557cea Release note for 2024-12-06 19:58:16 +00:00
Sage Abdullah 5f3235fa4f Add permission tests for search promotions views
This ensures we don't miss adding permission_policy to the views
2024-12-06 19:56:10 +00:00
Sage Abdullah 4bbd26d5a4 Refactor search_promotions delete view to extend generic DeleteView 2024-12-06 19:56:10 +00:00
Sage Abdullah 0d7ea86b2d Unify more code into SearchPromotionCreateEditMixin 2024-12-06 19:56:10 +00:00
Sage Abdullah 5e88817d2e Extract more common code into SearchPromotionCreateEditMixin 2024-12-06 19:56:10 +00:00
Sage Abdullah d811066a5b Refactor save_searchpicks into a view mixin method 2024-12-06 19:56:10 +00:00
Sage Abdullah 4e60e0a82b Make search promotions index view page_title consistent with the breadcrumbs item 2024-12-06 19:56:10 +00:00
Sage Abdullah 0c23ebed87 Refactor search_promotions edit view to extend generic EditView 2024-12-06 19:56:10 +00:00
Sage Abdullah 6db13fb704 Use breadcrumbs and simplify template overrides in search promotions CreateView 2024-12-06 19:56:10 +00:00
Sage Abdullah c498be3234 Reuse get_page_subtitle() for breadcrumbs label in CreateView 2024-12-06 19:56:10 +00:00
Sage Abdullah e9ffe38943 Ensure search promotions formset does not get reset if the query form is invalid 2024-12-06 19:56:10 +00:00
Sage Abdullah 93382d3f21 Ensure log entries are only created once for each search pick 2024-12-06 19:56:10 +00:00
Sage Abdullah 4ad08ddf6a Refactor search_promotions create view to extend generic CreateView 2024-12-06 19:56:10 +00:00
Sage Abdullah a506b7f0e2 Change QueryForm into a ModelForm subclass 2024-12-06 19:56:10 +00:00
Sage Abdullah e547f5e040 Add commented-out test to ensure search promotions formset does not get reset if the query form is invalid 2024-12-06 19:56:10 +00:00
Sage Abdullah 3d915733e6 Add test for creating multiple search picks at once
Also add commented-out assertions that log entries are only created
once for each search pick, which currently would fail due to a bug in
the implementation.
2024-12-06 19:56:10 +00:00
Sage Abdullah e79aed3616 Add test for adding promoted search results with an existing query_string 2024-12-06 19:56:10 +00:00
Sage Abdullah 63da8b2733 Improve form validation in search promotions form
Move the individual form validation to the SearchPromotionForm class
instead of the formset.

Do not assume external_link_url and the other fields are available in
cleaned_data, which can cause a crash if the input is invalid.

Attach validation errors to the most relevant section instead of bunging
everything as a non-field error.
2024-12-06 19:56:10 +00:00
Mauro Soche f177c02da8 Ensure the copy page form only allows choosing valid parents for the copy
Ensure the Page chooser disables the types of pages that do not follow the content hierarchy when trying to copy a page.

Fixes 
2024-12-06 15:07:32 +10:00
hsd2514 547e4d3731 Changing default value for Gravatar URL from ( mm -> mp )
- See https://docs.gravatar.com/api/avatars/images/#default-image
- Fixes 
2024-12-06 13:46:12 +10:00
Sage Abdullah 23275a4cef
Release note for 2024-12-04 10:56:03 +00:00
Matt Westcott 8cdeb23a43
Preserve URL parameters on parent link in page chooser search results
Fixes 
2024-12-04 10:48:46 +00:00
Matt Westcott 28cde800d9
Correctly initialize page chooser search results for multiple selection 2024-12-04 10:48:46 +00:00
Matt Westcott 8da1796d53
Pass all URL parameters to page chooser search action, including multiple and user_perms 2024-12-04 10:48:45 +00:00
Srishti-j18 c2676af857 Ensure new ListBlock instances get created with unique IDs
Fixes 
2024-12-04 19:10:04 +10:00