Wykres commitów

17084 Commity (2003e14a957d783e1a308765082b8d269c08b16c)

Autor SHA1 Wiadomość Data
LB Johnston 96ae004ce7 Add changelog for #11695
Fixes #11644
2024-02-29 08:15:15 +10:00
Chiemezuo c7018f3279 Remove the usage of inline scripts to init Draftail widget
- Instead use the `w-init` controller and dispatch a custom event with the detail on the input
- Keep the rich_text_area.html template so that any customisations overriding this will not cause issues
- Fixes #11644
2024-02-29 08:15:15 +10:00
Chiemezuo 9ae45aab50 Add ability for Draftail to be initialized via a dispatched CustomEvent 2024-02-29 08:15:15 +10:00
Chiemezuo 514a0aab9f Update InitController to support dispatching detail
- Update JSDoc throughout controller for better internal documentation
- Ensure we 'clean up' the other controller attributes when the init has completed
- Allow for the ready event to have the preventDefault called and stop other events from dispatching
- Add unit tests to support the above changes
2024-02-29 08:15:15 +10:00
LB Johnston 0e9bdca5b1 Fix up unit test for #11620
Instead of rendering the 'value' via provided links, simply check that the URLs are resolved in the 'options'
Otherwise we are not testing the correct HTML data
2024-02-29 08:15:15 +10:00
LB Johnston 287e5f9ded Fix contributor name #11694 2024-02-29 08:01:10 +10:00
Tibor Leupold d26b2ced77 Update template components & Laces references
- Turn laces reference into link to package in the release notes
- This is so that interested parties have an easy path to find more information about the library.
- Add note referencing that implementation are now found in Laces
- Add note about components not being limited to the admin
2024-02-29 07:50:46 +10:00
Pranith 1640104c57 Fixed formatting typo in --purge-only command flag
Was rendering as `-purge-only` (with one dash)
Fixes #11646
2024-02-29 07:32:27 +10:00
LB Johnston f9928b5c95 Add changelog & upgrade considerations for removal of window.chooserUrls
- Fixes #11586
- Fixes #11421
- Fixes #10377
2024-02-28 21:36:49 +10:00
elhussein almasri b993a52757 Adopt entity chooserUrls for Draftail richtext in embeds/documents/images
Avoid the need to append to window.chooserUrls for the rich text usage of choosers for the non-core modules (images, documents, embeds).

Instead pass in the lazy URLs to the feature entity options.
2024-02-28 21:36:49 +10:00
elhussein almasri da88ec81f1 Adopt entity chooserUrls for Draftail richtext links
Avoid the need to load window.chooserUrls globally in the shared _editor_js.html include.

Instead pass in the lazy URLs to the link chooser entity options.
2024-02-28 21:36:49 +10:00
elhussein almasri 6a532d8fe0 Add support for lazy strings in Draftail widget options
Ensure that the JSON encoder can correctly handle lazy strings (such as reverse_lazy and gettext_lazy) so that there is better support for admin URLs and translations that may not be able to resolved when the application starts.
2024-02-28 21:36:49 +10:00
elhussein almasri 69e32660db Add support for Draftail ModalWorkflow JS to use chooserUrls supplied
Instead of relying on global window.chooserUrls, add the support for also passing in entityType config objects that serve the same purpose.

Update JS unit tests to reflect that the future will no longer support the window.chooserUrls
2024-02-28 21:36:49 +10:00
elhussein almasri 266faf63c2 Move modal-workflow.js script to admin_base.html
The modal-workflow.js script is used across a wide range of views in the admin, it's simpler to include it globally instead of having to consider all places it may be used.

Also unblocks use cases that are outside of the core admin such as custom documents/user/image models that may want to leverage this functionality.
2024-02-28 21:36:49 +10:00
Sage Abdullah bded2cb98b Allow displaying permissions linked to the Admin model's content type (#11668) 2024-02-27 22:16:51 +00:00
Sage Abdullah 2594be387d Add tests for w-dropdown-keep-mounted-value 2024-02-27 09:43:14 +00:00
Sage Abdullah 71a8853365 Add tests for w-link 2024-02-27 09:43:14 +00:00
Sage Abdullah 1b3e54e267 Add tests for w-teleport-reset-value 2024-02-27 09:43:14 +00:00
Buraah e30c25c3b1 Changed all British spellings to American spellings, in the changelog.txt file 2024-02-24 16:59:29 +10:00
Sage Abdullah 3b87644e07 Prevent shadowing of permissions with the same codename action (#11667)
This can cause issues where e.g. stale permissions become the ones used
to render the checkboxes after a RenameModel operation (changing the
Python class name, not just the verbose_name).

A similar issue can also be triggered with custom permissions that share
the same codename action (first part of the codename before _) as the
built-in permissions.
2024-02-23 21:22:35 +00:00
Matt Westcott e418cd6e5b Add Viktor Szépe to contributors 2024-02-22 17:40:11 +00:00
Viktor Szépe 5679b30d1b
Fix typos (#11687) 2024-02-22 17:39:16 +00:00
Sage Abdullah cadc40e6a2
Release note for #11666 2024-02-22 09:58:05 +00:00
Sage Abdullah b73e34f55e
Add tests for custom default_permissions 2024-02-22 09:27:04 +00:00
Sage Abdullah 6596efc0d6
Normalise custom permission labels on a best-effort basis 2024-02-21 14:49:56 +00:00
Sage Abdullah c4335d35de
Revert "Fix inconsistent use of model verbose_name in permissions UI"
This reverts commit e03c412507.
2024-02-21 14:49:55 +00:00
Matt Westcott c11db31a78 Release note for #11665 2024-02-21 14:17:53 +00:00
Sage Abdullah 8058082ba3 Optimise queries in group create/edit view
Add missing select_related for content_type and batch the permission
queries for all content types instead of doing one query per model,
which can be a lot.

There are still duplicated queries due to the use of formsets, but there
isn't much we can do about it without some nasty hacks:

https://stackoverflow.com/questions/32082945
2024-02-21 14:17:13 +00:00
Sage Abdullah 1bc82a65e9 Add test for number of queries to load the group create/edit view 2024-02-21 14:17:13 +00:00
Matt Westcott ff3b41c1f0 Update Damian Borneman in CONTRIBUTORS.md 2024-02-21 12:59:36 +00:00
dependabot[bot] fca9993f5b Bump ip from 2.0.0 to 2.0.1
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-21 12:18:27 +00:00
dambor05 952416cfbc Fix typos of base/models.py (#11682) 2024-02-21 11:57:01 +00:00
Matt Westcott 9c34b60fb2 Update versions of eslint plugins to match package.json 2024-02-20 17:11:20 +00:00
LB Johnston 722d3b2b3c Upgrade build tooling to latest major versions (npm)
- Babel loader v9 (Node version, drop support for Webpack 4) https://github.com/babel/babel-loader/releases/tag/v9.0.0
- Copy webpack plugin (Node version only) https://github.com/webpack-contrib/copy-webpack-plugin/releases/tag/v11.0.0 & https://github.com/webpack-contrib/copy-webpack-plugin/releases/tag/v12.0.0
- Expose loader (Node version only) https://github.com/webpack-contrib/expose-loader/blob/master/CHANGELOG.md
- Postcss loader (Node version only) https://github.com/webpack-contrib/postcss-loader/releases/tag/v7.0.0 & https://github.com/webpack-contrib/postcss-loader/releases/tag/v8.0.0
- Sass loader (Node version, emits warnings by default) https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md
- Webpack CLI (Node version, some other breaking changes, dropping Webpack 4 support) https://github.com/webpack/webpack-cli/releases/tag/webpack-cli%405.0.0
2024-02-20 17:01:02 +00:00
LB Johnston ba516ef492 a11y results - coerce CrossTreeSelector into a string
- Ensures that TypeScript will allow these values to be passed into querySelector
2024-02-20 16:54:35 +00:00
LB Johnston 7dff7ff364 Update npm dependencies (non-major)
- Includes updates to update-browserslist-db@latest
2024-02-20 16:54:26 +00:00
Matt Westcott 98da2e161a Fix pre-commit versions for prettier and eslint
Ensure that versions are consistent between 1) what we specify in package.json; 2) the tag specified on the pre-commit mirror; 3) the package dependency line in the pre-commit config.
2024-02-20 16:54:07 +00:00
Matt Westcott c54d9aa64f Release note for #11637 2024-02-20 02:00:08 +00:00
Sage Abdullah ac02f64449 Check for superuser before groups in GroupApprovalTask
Short-circuit the logic to skip db query for superusers
2024-02-20 01:58:39 +00:00
Sage Abdullah 9b68cf76f7 Move test_dashboard to wagtail.admin.tests
It's no longer specific to pages
2024-02-20 01:58:39 +00:00
Sage Abdullah 4ad514a7dd Annotate previous_revision_id for comparison links in dashboard
Avoid N+1 queries that were done by using .get_previous() on each revision
2024-02-20 01:58:39 +00:00
Sage Abdullah f28a03a911 Cache 'user in groups' check in GroupApprovalTask 2024-02-20 01:58:39 +00:00
Sage Abdullah 93392c6a16 Use live_revision_id in WorkflowObjectsToModeratePanel
We only need the id to generate the links, avoid fetching the full revision object
2024-02-20 01:58:39 +00:00
Sage Abdullah 9260297a65 Fetch specific tasks in bulk in WorkflowObjectsToModeratePanel
Change BaseTaskStateManager.reviewable_by() so that the specific tasks
are queried in bulk.

In GroupApprovalTask.get_task_states_user_can_moderate(), use
self.task_states reverse related manager so the resulting TaskStates
already have their task ForeignKey set to the current GroupApprovalTask
instance.

Remove 'task' from select_related as the reviewable_by() already fetches
the specific task in bulk.
2024-02-20 01:58:39 +00:00
Sage Abdullah 8d49c789b2 Select workflow_state__workflow in WorkflowObjectsToModeratePanel query 2024-02-20 01:58:39 +00:00
Sage Abdullah fb6d5d0d14 Annotate approved_schedule in RecentEditsPanel
Prevent N+1 queries when rendering the status tag
2024-02-20 01:58:39 +00:00
Sage Abdullah 66cf63fce1 Prefetch workflow states in RecentEditsPanel
Prevent N+1 queries when rendering the status tag
2024-02-20 01:58:39 +00:00
Sage Abdullah 606f8607c2 Compare locked_by_id to avoid fetching user object in _locked_indicator.html 2024-02-20 01:58:39 +00:00
Sage Abdullah 9f5e115355 Use .specific(defer=True) and order_by(-locked_at) for LockedPagesPanel 2024-02-20 01:58:39 +00:00
Sage Abdullah 24e6024506 Add tests for WorkflowObjectsToModeratePanel query count 2024-02-20 01:58:39 +00:00