0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 01:22:07 +01:00
Commit Graph

1640 Commits

Author SHA1 Message Date
Sage Abdullah
24deedea78 Add icon support to generic breadcrumbs template tag 2024-03-05 09:56:47 +00:00
Sage Abdullah
a106a3e805 Remove extraneous padding in chooser modal listings
Fixes #11704
2024-03-05 18:09:16 +10:00
LB Johnston
07d6acfb52
Fix - Ensure that modal tabs width are not impacted by side panel opening
Regression from #11150
2024-02-29 11:37:53 +00: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
Viktor Szépe
5679b30d1b
Fix typos (#11687) 2024-02-22 17:39:16 +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
a17996073e
Make sure all custom widgets within drilldown dropdowns use the expected text color 2024-02-15 10:01:48 +00:00
Thibaud Colas
56f9855c07
Ensure BooleanRadioSelect uses the same styles as RadioSelect 2024-02-15 10:01:48 +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
Thibaud Colas
fc3f945781
Styling fixes for universal listings (#11608) 2024-02-07 10:44:56 +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
Sage Abdullah
dbf3c7c586
Adjust margin-bottom of w-field__wrapper in drilldown component
Prevent the focus outline from being cut-off
2024-01-23 09:43:08 +00: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
Sage Abdullah
1ab78fc5c1 Fix first column padding in page listings when custom ordering is active 2024-01-23 06:50:07 +00:00
Sage Abdullah
bbd22d8c43 Use bulk actions header's checkbox to detect bulk actions in listing styles
bulk-action-checkbox is the checkbox in the <td> elements. On page
listings, if you're searching and there are no results, the table will
still be displayed (to give you the option to search the whole site).
The table has no data rows, which means there are no elements with
bulk-action-checkbox class.

Change the selector to target the bulk-actions-filter-checkbox class
instead, which is the bulk action's <th> checkbox. This element (in the
header cell) is always available even when there are no results.
2024-01-23 06:50:07 +00:00