Wykres commitów

17936 Commity (50ba3a9c44e6923c15222b0b85e120fd5aec37df)

Autor SHA1 Wiadomość Data
rahulsamant37 50ba3a9c44 Update email notification header to new logo
- Fixes #12369
- Relates to logo update #10404
2024-10-02 15:43:57 +10:00
Matt Westcott 665b9a073e Update django-taggit dependency to allow 6.1.x
Fixes #12372
2024-09-30 17:34:18 +01:00
Krzysztof Jeziorny 72292d4d01
Documentation: Configure API to use the DRF's TokenAuthentication (#12363)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2024-09-29 15:59:15 +01:00
Ishwari8104 f86161ba00
Ensure dropdown toggles show with border in high contrast mode
Update _dropdown.scss (#12365)
2024-09-29 16:37:38 +10:00
Matthew Scouten 1f7710c4d8 oEmbed - Update polldaddy to crowdsignal & remove polleverywhere
- Update polldaddy oEmbed to crowdsignal (changed in 2018) https://crowdsignal.com/2018/10/18/introducing-crowdsignal/
- Remove polleverywhere as it no longer supports oEmbed
2024-09-28 18:26:53 +10:00
Drikus Roor 6aa4647120 docs: Clarify file location, add missing imports 2024-09-28 17:45:32 +10:00
Sage Abdullah 3a9b975ba1 Fix UnsavedController.forceValue not immediately notifying the unsaved changes
Fixes #12355
2024-09-28 17:41:48 +10:00
Shubham e7de2f8955 Refactor UnsavedController to use event.preventDefault() to trigger browser confirmation dialog
Per https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event

"best practice is to trigger the dialog by invoking `preventDefault()`
on the event object, while also setting `returnValue` to support legacy
cases."

We don't need to support legacy cases, as our supported browsers all
support the `preventDefault()` approach.

See also:
https://caniuse.com/mdn-api_window_beforeunload_event_preventdefault_activation

Fixes #12132

From PR #12139
2024-09-28 17:41:48 +10:00
Coen van der Kamp abcb2da372 Add translatable model copy for translation done signal (#12362) 2024-09-27 16:01:52 +01:00
LB Johnston a5c31f91c2
Mark js_translation_strings template tag for deprecation
- `js_translation_strings` is no longer used by Wagtail admin code
- It was historically used for generating the JS config strings within templates, we now do this in Python and expose as JSON via the `wagtail_config` template tag
- Add a warning for deprecation so that we can remove this unused template tag in the next major version of Wagtail
- See #9771 for context
2024-09-26 01:12:31 -04:00
Sage Abdullah 53f55a8786
Release note for #11166 2024-09-25 14:52:50 -04:00
LB Johnston 429732f09e
Start deprecation for the `locales` as a template tag
- This was only used by our JS config globals and can now be removed in a future release
2024-09-25 14:45:45 -04:00
LB Johnston ee1cb9108a
Remove inline scripts that re-declare wagtailConfig.ACTIVE_CONTENT_LOCALE
This will now be set in one place centrally (admin_tags)
2024-09-25 14:45:44 -04:00
LB Johnston fa8fdaf72d
Simplify wagtailConfig.ts mocks in unit tests
- Avoid mock values that are already in the stub
- Only mock values that are needing to be mocked for unit tess
2024-09-25 14:45:43 -04:00
Sage Abdullah 4bb47f7e25
Move wagtailConfig values to wagtail_config template tag
The first step on cleaning up our client-side metadata configuration. With this approach, the values are computed in the `wagtail_config` template tag and passed into the template using Django's json_script.

Then, it's parsed on the client-side and set as `global.wagtailConfig` to retain compatibility with existing code that rely on `window.wagtailConfig`.

This allows us to remove our existing approach of putting metadata values in a `<script>` tag using Django templates directly in the HTML, without changing too much of the existing code, and allowing new code to import the values as `WAGTAIL_CONFIG` from `wagtailConfig.js` instead of using `window.wagtailConfig`. It also means we remove the inline script tag from the core admin base template.

Refactor wagtailConfig util

- Avoid extraneous named exports when they are included in the named WAGTAIL_CONFIG
- Simplify locale map generation
- Avoid reading from global, instead export util that can be used as a global
- Update unit tests for more robust checks
2024-09-25 14:45:09 -04:00
LB Johnston b52ca03702
Rename wagtailConfig.js to ts file 2024-09-25 14:45:07 -04:00
LB Johnston 46947fe740
Simplify unit tests for TooltipEntity
- Avoid the entire stubbed document element being in snapshots
- Reset the JSDom each test for better snapshot usage
2024-09-25 14:21:20 -04:00
SebCorbin 83f00a8363 Capfirst should be used on model verbose name instead of title (#12358) 2024-09-25 17:13:21 +01:00
Cynthia Kiser d526612e4b
Added example for customizing a default accessibility check (#12267)
Co-authored-by: Albina <51043550+albinazs@users.noreply.github.com>
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2024-09-24 11:00:20 +01:00
Albina 722b79d9be
Fix minimap toggle visibility (#12279)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2024-09-24 10:58:23 +01:00
Thibaud Colas c2b35b8945 Release notes for #12045 2024-09-24 10:52:01 +01:00
Sage Abdullah 3b22cbf0a5 Fix content path links in usage view to scroll to the correct element 2024-09-24 10:52:01 +01:00
Sage Abdullah 86610560e6 Fix scrolling to anchored panels on Chromium-based browsers
On Chrome, using scrollIntoView() while elements are still being
rendered does not work as expected (i.e. it would intermittently stop
midway).

We start by using getElementById instead of selecting :target, as the
latter doesn't always yield result until the 'load' event is fired. This
does not fix the issue.

The initAnchoredPanels() function is already being called in a 'load'
event handler, so this is as late as it can be, even after the
StreamField blocks have been initialized. However, clearly this doesn't
seem to be enough.

The only solution that seems to work is to use setTimeout, and that does
not even consistently work if the delay isn't high enough for the
elements to render. For now, use 100ms as it seems to be enough in most
cases.
2024-09-24 10:52:01 +01:00
Sage Abdullah 42262484ce Fix editor crash when the URL anchor starts with a number 2024-09-24 10:52:01 +01:00
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