0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-25 13:10:14 +01:00
Commit Graph

1200 Commits

Author SHA1 Message Date
Sage Abdullah
2003e14a95 Allow TeleportController to have any number of child nodes of any kind 2024-03-09 20:15:03 +10:00
Karthik Ayangar
00474a6152 fix: MutationObserver in dirty form check only tests direct descendants
Fixes #11142
2024-03-07 08:09:37 +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
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
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
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
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
Thibaud Colas
e9727eacaf Code refactorings based on code review feedback 2024-02-14 15:04:17 +00:00
Thibaud Colas
4ec22a4b62 Refactor helper methods for fetch response mocking 2024-02-14 15:04:17 +00:00
Sage Abdullah
88bdd397cf Use w-swap's reflect event in w-drilldown and w-link 2024-02-14 15:04:17 +00:00
Sage Abdullah
4fedf3e2d4 Add the ability to reflect query params in SwapController
This is useful when the controller is used in views that would produce an identical response if the page is hard-reloaded with the same params, e.g. listings
2024-02-14 15:04:17 +00:00
Adrien Hamraoui
58ebfe1fb1 fix: InlinePanel - take 1st child when configuring up and down js events
Issue was appearing when there was nested inline panels.
currentChild. find would match the parent up/down button
but also all the ones of the nested inline panels
Fixes #5919
2024-02-13 07:45:06 +10:00
LB Johnston
d06b04c8bd Update Eslint, Prettier, Stylelint packages & pre-commit versions
This un-reverts commit 99dd11510b with fixes for Prettier mirror (it's rev must be 3.0.3 even if using a newer Prettier).
The original commit which was reverted is 5971ce7f3f
2024-02-08 15:23:48 +00:00
Matt Westcott
99dd11510b Revert "Update Eslint, Prettier, Stylelint packages & pre-commit versions"
This reverts commit 5971ce7f3f.
2024-02-07 17:12:56 +00:00
LB Johnston
5971ce7f3f Update Eslint, Prettier, Stylelint packages & pre-commit versions 2024-02-07 16:07:50 +00:00
advik
0294dd1dd1 Changed Button to Link, and removed unnecessary props
- React Button was only ever used to render a link (a element)
- This creates a potential accessibility issue if developers want to render a button, it's confusing and incorrect
- Additionally, the unused prop (dialogTrigger) & aria-haspopup is non-compliant and has been removed
2024-02-05 20:07:40 +10:00
Karthik Ayangar
41d40f5c37 Adjust Eslint rules for TypeScript files (no-shadow)
Signed-off-by: Karthik Ayangar <karthik.ayangar7118@gmail.com>
2024-02-03 07:35:09 +10:00
Sage Abdullah
a3cb4a6903 Fix filters from being removed when searching
Tippy unmounts its popper element from the DOM on hide, which means that
the filter fields get detached from the form. As a result, when
performing a search (which means the filters popup is closed), any
filters that have been applied will be lost. The issue does not occur
the other way around (filtering after search) because the filter fields
will still be in the DOM (as the popup is open while you're applying the
filters).

Unfortunately, Tippy does not offer a built-in option to keep the popper
mounted in the DOM when it's hidden.

As a workaround, use Tippy's hooks to re-append the popper to the DOM.
- onCreate: ensure the popper element is mounted even when the tippy was
  just created (normally it's only mounted when shown). This is useful
  to keep the filters when searching after a full-page refresh (e.g.
  after navigating to the next page in pagination).
- onHidden: ensure the popper is still mounted, to solve the main issue
- onShow: remove the hidden attribute and let tippy move the popper
  element as necessary (though usually this isn't necessary, because we
  remount it in the same position (the controller's element).

The 'hidden' attribute shouldn't cause any issues here as Tippy doesn't
use it. Without it, the solution still works because Tippy uses CSS to
make the element invisible. However, the complete CSS doesn't get
applied until the tippy is shown at least once. This means on initial
load with the onCreate hook, the tippy will take up the space while
being invisible. Using the attribute fixes it (and display:none probably
would too).

This behaviour can be enabled using the newly-added DropdownController
value 'keepMounted'.
2024-01-26 17:16:51 +00:00
Sage Abdullah
6991c1f2d9 Move Tippy hooks to separate arrow function declarations 2024-01-26 17:16:51 +00:00
Sage Abdullah
ea288448cd Use arrow function for hideTooltipOnClickAway to allow 'this' to refer to DropdownController 2024-01-26 17:16:51 +00:00
Sage Abdullah
a89812f6b9 Move DropdownController themeOptions to an instance property 2024-01-26 17:16:51 +00:00
LB Johnston
54802abcc4 Fix minor duplicate word typos 2024-01-25 06:58:59 +10:00
sag​e
aef6de8a2f
Universal listings: Add LinkController to apply filter URL params to header buttons (#11522) 2024-01-24 12:43:54 +00:00
Sage Abdullah
e8b34ededd Implement active filter button to open drilldown for specific filter 2024-01-24 09:43:42 +00:00
Sage Abdullah
2adda186a0 Add cancelable w-dropdown:clickaway event for closing dropdown on click away 2024-01-24 09:43:42 +00:00
Sage Abdullah
3cedd02994 Render filter count by counting the active filters client-side 2024-01-24 09:32:28 +00:00
Sage Abdullah
a8bf1ab868 Run scripts inside teleported element in TeleportController 2024-01-24 09:32:28 +00:00
Sage Abdullah
981c1ac36a Fix drilldown component closing when interacting with datetime pickers 2024-01-24 09:32:28 +00:00
Sage Abdullah
0fb80e8aa0 Use get reference() instead of getReference() in DropdownController 2024-01-24 09:32:28 +00:00
Sage Abdullah
f1c4a495cc Do not reflect filter_fragment param in the browser
Also move the insertion of the param to get_url_without_foo methods to avoid the param getting applied multiple times and to avoid having to parse the URL again.

Rename the filter_fragment to _w_filter_fragment to avoid clashes
2024-01-24 09:32:28 +00:00
Sage Abdullah
bc381be264 Reset filters' w-drilldown state on close
This fixes the issue where the state is stuck at the last opened filter when the drilldown's contents are replaced
2024-01-24 09:32:28 +00:00
Sage Abdullah
238cbf3cd2 Dispatch w-dropdown:hidden event in DropdownController on tippy hide 2024-01-24 09:32:28 +00:00
Sage Abdullah
2b8d39ab0d Add 'reset' value to TeleportController to allow resetting the target element 2024-01-24 09:32:28 +00:00
Alex Morega
c4ef290859 Explicitly set triggerElement when invoking save (with publish) button on pages
Fixes #11420

Two issues existed;
1. Safari will not set `document.activeElement` as expected in all other browsers, instead, when a button is clicked it will keep the activeElement as `body`. This meant that the reset of the disabled button (before the confirm triggers a click) was not working.
2. Visually the button still had the loading spinner due to w-progress controller having triggered the loading visuals, this did not block the behaviour but looked broken.

See Safari behaviour docs:
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
- https://bugs.webkit.org/show_bug.cgi?id=22261
2024-01-24 08:17:37 +10:00
elhussein almasri
d1b1fa638d Make TableBlock cells reachable using keyboard
Fixes #8893
2024-01-24 07:48:20 +10:00
Thibaud Colas
f1520bfcdd
Clean up unfinished aspects of DrilldownController 2024-01-23 09:22:30 +00:00
Sage Abdullah
7ba218a094
Use data-action to listen to w-swap:success in DrilldownController
and rename the method to updateParamsCount
2024-01-23 09:22:30 +00:00
Thibaud Colas
68df8a0ba3
Add drilldown filters interface for universal listings 2024-01-23 09:22:30 +00:00
Thibaud Colas
4790b44ba1
Move accessibility checker inside the editor (#11478). Fix #10136 2024-01-23 08:15:34 +00:00
Thibaud Colas
76d91d55af
Update color variables documentation and tests 2024-01-22 16:04:06 +00:00
Thibaud Colas
90ca9b7001
Roll out new theme tokens where appropriate 2024-01-22 16:04:06 +00:00
Thibaud Colas
95e763ca2e
Introduce new border-button-outline-hover and text-button-outline-hover theming tokens 2024-01-22 16:04:05 +00:00
Thibaud Colas
c70a4da5cb
Add new color tokens for Wagtail and update existing tokens, dark theme 2024-01-22 16:04:05 +00:00
Jaivignesh-afk
95ee796a0f Remove unused variables & mixins + update *-padding to rem
- Fixes #11458
2024-01-20 21:22:02 +10:00
nandini584
65f8a84cee Clean up sass variable usage
- updated the font to its direct use theme and removed -title-height
- removed the 1-time used scss variables and updated directly in the files
- Fixes #11458
2024-01-20 21:22:02 +10:00
LB Johnston
d7e52d1498 Add unit tests & small fixes to OrderableController
- Fix edge case where keyboard ordering and then drag drop ordering could get out of sync
- Ensure the sortable instance is cleaned up if the controller gets removed
- Relates to PR #11250 & Issue #10909
2024-01-20 10:05:21 +10:00
Aman Pandey
ef9375c475
Fix: Remove blur action from orderable controller (#11476)
* remove blur action from orderable controller as it will update whenever any move is made
* change aria description for instructions
2024-01-19 22:25:17 +10:00