Wykres commitów

18062 Commity (98545cd1766f4df1a664d39efdd9075e61332adc)

Autor SHA1 Wiadomość Data
Sage Abdullah 3388f265a3 Remove ineffective code for scrolling to top on tab select
This never really had any effect. Since the new tabs and slim header
designs in v3.0, window.scrollY always equals 0 because the scroll
container is a content element rather than the window itself.

You can verify this by opening the page editor, scrolling down a bit,
and checking window.scrollY on the browser console. It will print 0,
and if you call window.scrollTo(0, 0) it does not do anything.

Even if it did work, we don't want this behaviour either, because this
would interfere with the functionality of scrolling into a panel that
is selected by the URL anchor (#).
2024-09-24 10:52:01 +01:00
Matt Westcott a8ff831615 Update latest.txt for 6.2.2 2024-09-24 10:47:03 +01:00
Matt Westcott 246aaa42d9 Fill in release date for 6.2.2 2024-09-24 10:09:12 +01:00
Matt Westcott a97599bb96 Fetch new translations from Transifex 2024-09-24 10:00:49 +01:00
Matt Westcott f43a516219 Release note for #12352 in 6.3 2024-09-24 09:26:57 +01:00
Matt Westcott 281d600db3 Release note for #12352 in 6.2.2 2024-09-24 09:26:19 +01:00
Matt Westcott d6ef9b5752 Stop PopularTagsFilter from applying an IN clause when not filtering
Fixes #12349
2024-09-23 21:34:41 +01:00
Matt Westcott 5aa0673452 Update `WAGTAIL_WORKFLOW_REQUIRE_REAPPROVAL_ON_EDIT` docs to indicate that default is False (#12340)
Fixes #12329
2024-09-19 16:41:17 +01:00
Matt Westcott 7083bc9460 Docs - Update spelling & reference in release notes for UserViewSet for 6.2.2 2024-09-19 10:12:34 +01:00
LB Johnston 7a03106ddd Docs - Update spelling & reference in release notes for UserViewSet 2024-09-19 10:11:42 +01:00
LB Johnston 8b3540de0d Simplify Wagtail docs section titles
- Avoid additional 'Wagtail' names in the docs titles (inc. contributing)
2024-09-19 10:09:46 +01:00
LB Johnston 8f215bda5f Rename deploy URL to deployment + update title 2024-09-19 10:09:46 +01:00
Matt Westcott a3d06be90c Release note for #12332 in 6.3 2024-09-19 10:01:27 +01:00
Matt Westcott 2cc5cea4c7 Release note for #12332 in 6.2.2 2024-09-19 10:01:05 +01:00
Matt Westcott 926cece82b Remove unnecessary filters from redirects index
Fixes #12330

The filters "Redirect from", "Redirect to a page", "Target page route", "Redirect to any URL", "Automatically created" and "Created at" were introduced when `exclude = []` was set on the filter class in https://github.com/wagtail/wagtail/pull/8851/files#diff-a1afb82083d526ca8eee0f70b714bea11910ca7b12b8efe8acdcb3b8fc6c0519, and there's good reason to believe that this change was unintentional - there's no acknowledgement of it in the PR comments, the "Created at" filter is essentially non-functional since it filters on an exact timestamp rather than a date range, and the labels have not been changed from the verbose_name field defaults (which are somewhat confusing when used outside the context of the create/edit form).

The "Redirect to a page" filter in particular is causing issues on large sites as this dropdown can legitimately run to many thousands of entries and exceed web server resource limits.

Thus, roll back this filter set to its previous state of just `is_permanent` and `site`. If a user needs to find all redirects pointing to a given page, searching on the page title will generally be sufficient.
2024-09-19 09:54:55 +01:00
sag​e e529b5b84e
Fix content metrics plugin to work on the main element before falling back to `body` (#12295)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2024-09-19 08:53:12 +01:00
LB Johnston d677b1fa24 Add changelog for migrate preview-panel.js to Stimulus PreviewController
- Closes #11677
2024-09-19 08:22:54 +10:00
Sage Abdullah 706b95f670 Deprecate the WAGTAIL_AUTO_UPDATE_PREVIEW setting 2024-09-19 08:22:54 +10:00
Sage Abdullah b9f1585a70 Add tests for WAGTAIL_AUTO_UPDATE_PREVIEW_INTERVAL
Surprisingly we didn't have any tests for this...
2024-09-19 08:22:54 +10:00
Sage Abdullah e851717d9c Update Python tests to reflect the new PreviewController changes 2024-09-19 08:22:54 +10:00
Sage Abdullah e6bcfb710b Remove focus-visible fallback in preview panel code
We're dropping support for Safari 15 soon
2024-09-19 08:22:54 +10:00
Sage Abdullah 8d6d772da0 Final clean up of PreviewController and usage
Move all bind() to connect()

Add renderUrl value to use different URLs for sending vs rendering preview data

Add docstrings for PreviewController properties

Rename cleared property to ready and dispatch w-preview:ready

Add events to PreviewController update lifecycle

Use zero interval delay to disable preview auto update

Rearrange PreviewController methods to better follow the update flow

Ensure only one preview iframe has the w-preview-iframe ID at a given time

This doesn't really affect how it functions, but it's semantically more correct

Ensure runContentChecks function does not crash in tests

Only clear stale data if there is a valid stale preview available

Fix preview on Firefox by not removing the only iframe

Reorder targets and values alphabetically and add JSDoc for events

Introduce w-preview__proxy class for invisible elements in preview panel
2024-09-19 08:22:54 +10:00
Sage Abdullah 054e72b4c2 Setup main PreviewController unit tests
Test loading the last device size from localStorage

Ensure selected device size class is applied on connect

Add test for using ResizeObserver in PreviewController

Add tests for default PreviewController behaviour

Add test for opening preview in a new tab

Add test for handling a request error when opening preview in a new tab

Add test for showing the spinner when loading the preview

Add test for enforcing rendered preview width when there are errors

Split PreviewController tests into separate describe blocks

Use fake timers for all PreviewController tests

Add more detailed assertions in initializeOpenedPanel

Add assertions for setTimeout in PreviewController test

Add test for auto-update cycle

Add test for disabling auto update on panel close

Add tests for manually updating the preview

Add tests for switching preview modes

Only add the mode select element for these tests, to ensure that the
preview panel works even without it (e.g. for models that only define a
single preview mode)

Add tests for PreviewController.disconnect and for requiring the url value

Add test for assuming the first size input is the default

Add ResizeObserver test for preview controller

Reuse url variable in PreviewController tests
2024-09-19 08:22:54 +10:00
Sage Abdullah 0b14ae31dc Add block markers to preview.html to ease customisability
This allows developers to more easily customise the panel, e.g. customising the device sizes
2024-09-19 08:22:54 +10:00
Sage Abdullah db4e86a2c1 Rename preview-panel class to w-preview 2024-09-19 08:22:54 +10:00
Sage Abdullah 55d57be7c5 Initial migration of preview panel to Stimulus PreviewController
Initialise preview panel as a Stimulus PreviewController

Fix TypeScript issues in PreviewController

Use Stimulus targets for preview device size inputs

Use Stimulus target for preview panel new tab button

Use Stimulus target for preview panel loading spinner

Use Stimulus target for preview panel refresh button

Use Stimulus target for preview panel mode select

Use Stimulus target for preview panel iframe

Also rename the id to w-preview-iframe to follow our new conventions for
singleton elements

Rely on Stimulus to replace the iframe target

Because we copy all the attributes from the old iframe to the new one,
this means that the new iframe will also become a target. When we remove
the old iframe, the target is disconnected, and subsequent references to
this.iframeTarget should point to the new one.

Access the preview panel's parent side panel element via this.element.parentElement

Bind preview device size inputs using Stimulus data-action

Extract PreviewController.observePanelSize() method

Extract PreviewController.restoreLastSavedPreferences() method

Use Stimulus value for preview panel url

Use Stimulus value for preview panel pending update state

Move edit form and spinner timeout references into instance variables

Extract PreviewController.finishUpdate() method

Extract PreviewController.reloadIframe() method

Extract PreviewController.clearPreviewData() and setPreviewData() methods

Replace preview panel refresh button target with data-action

Extract openPreviewInNewTab method and use it via data-action

Do not close the preview tab if the data is not valid

Use Stimulus values for preview panel auto update config

Extract PreviewController.initAutoUpdate() method

Extract handlePreviewModeChange method and use it via data-action

Use Stimulus classes for preview panel unavailable and has-errors CSS classes

Use Stimulus class for preview panel selected input size

This removes the reliance of having a predefined set of classes for each
device name, making it easier to add support for custom sizes later.

The outline styles have also been updated to make use of focus-visible
when available.

Use hidden attribute for hiding preview panel spinner

Replace PreviewController isUpdating value with an updatePromise instance variable

Extract PreviewController.hasChanges() method

Extract PreviewController.checkAndUpdatePreview() method

Add default values for PreviewController values

Use ProgressController outlet for preview panel refresh button

This allows the use of the button-longrunning handling for the loading state.

Also, turn the button into an icon-only button as there might not be enough space when the panel is resized to the smallest size

Use cloneNode() instead of manually copying the attributes

Extract PreviewController.replaceIframe() and use it as the iframe's action

Extract PreviewController.sidePanelContainer instance attribute

Extract PreviewController.checksSidePanel instance attribute

Extract PreviewController.updateInterval instance attribute

Clean up PreviewController event listeners on disconnect

Extract preview panel device localStorage key into PreviewController Stimulus value

Extract preview panel's width CSS property names into Stimulus values

Disconnect preview panel ResizeObserver on controller disconnect

Use an instance variable for tracking preview availability
2024-09-19 08:22:54 +10:00
Sage Abdullah 5aa0dde2a4 Move preview-panel.js to PreviewController.ts 2024-09-19 08:22:54 +10:00
Sage Abdullah a5b42936ec Extract setOptionalInterval util from SessionController 2024-09-19 08:22:54 +10:00
Sage Abdullah 7b67723da9 Fix error if the preview iframe does not have the userbar loaded 2024-09-19 08:22:54 +10:00
Sage Abdullah 014ffb5ce9 Ensure the side panel's show event is dispatched after any hide events
If the event is dispatched in the loop, then the show event may be
dispatched before the hide event is dispatched. For example, if you're
switching from the checks panel to the preview panel, as the preview
panel is ordered before the checks panel in the DOM.

This could cause an issue with the preview panel code, where we listen
for the show event to activate the auto update, and listen to the hide
event to deactivate it. We're listening to both the preview and checks
side panels.

Without this fix, the preview auto-update will get deactivated upon
switching from the checks panel to the preview panel, as the hide event
is dispatched after the show event.
2024-09-19 08:22:54 +10:00
Sage Abdullah 30f1115353 Fix debounce() return type to follow original function
Without typing Promise and Promise.resolve with R, it defaults to
unknown, so the R generic type can't be used.

Also, the debounced function's args should take the generic A parameter
instead of redefining it as any[].
2024-09-19 08:22:54 +10:00
LB Johnston 6bb0c7597f Docs - Hacktoberfest - Remove reference to the t-shirt
There is no longer a t-shirt reward as of 2023
https://hacktoberfest.com/participation/#faq
2024-09-19 08:03:36 +10:00
sanjeevholla26 aa3be4b888 [UI]: Changed class from warning to failure for confirm delete message
Ensure the contrast of the message is suitable
Fixes #12232
2024-09-18 09:48:41 +10:00
Matt Westcott 9c153d27ea Release note for #12327 2024-09-17 18:12:50 +01:00
Matt Westcott a26bd1d6aa Omit messages about root / unroutable pages when searching or filtering
In this view the results include descendant pages, for which the information is not necessarily accurate.
2024-09-17 18:11:25 +01:00
Matt Westcott 42aa0c027e Move messages about root / unroutable parent pages to a new explorable_index_results template 2024-09-17 18:11:25 +01:00
Matt Westcott baa2e15d82 Update Atif Khan's name in release notes 2024-09-17 17:23:31 +01:00
Sage Abdullah 59689600e9 Fix missing JS in pages/explorable_index.html template 2024-09-17 16:12:58 +01:00
Matt Westcott 66ff3c52cc Use non-tracked links in Divio hosting details
As per https://github.com/wagtail/wagtail/pull/12250#discussion_r1762523573
2024-09-17 14:37:08 +01:00
Sage Abdullah 65efe1f160 Ensure form pages listing tests have consistent ordering 2024-09-17 14:12:50 +01:00
Sage Abdullah 621998f233 Use lru_cache for get_form_types caching 2024-09-17 14:12:50 +01:00
Atif2077 96f8324458 Modified slugify/urlify to according to django's slug validator (#12319)
Fixes #12300
2024-09-17 13:14:51 +01:00
Sage Abdullah 6affa04d32 Add search and filters from PageListingMixin to form pages listing (#12324) 2024-09-17 09:58:12 +01:00
Matt Westcott a7ad9ba5f1 Release note for #12275 2024-09-16 20:27:12 +01:00
Sage Abdullah dfc4a5b2ed Enable breadcrumbs in images URL Generator view 2024-09-16 20:26:14 +01:00
Sage Abdullah 4245d7f619 Use grid and simplify the template for image edit view 2024-09-16 20:26:14 +01:00
Sage Abdullah d3d3299c22 Refactor images edit view to use generic EditView 2024-09-16 20:26:14 +01:00
Sage Abdullah ed2f0c4720 Refactor images single upload view to use generic CreateView 2024-09-16 20:26:14 +01:00
Sage Abdullah 89bd68b0dc Enable breadcrumbs in images multiple upload view 2024-09-16 20:26:14 +01:00
Sage Abdullah 3b07d32fb8 Add missing index_url_name and edit_url_name in images UsageView
And reduce 1 query by using select_related for uploaded_by_user.
2024-09-16 20:26:14 +01:00