0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
Commit Graph

586 Commits

Author SHA1 Message Date
Desaiakshata
997ac738b0 dropdown - improve focus and high contrast mode visibility
- Update _dropdown.legacy.scss
- improvement to existing styles for dropdown/up button on focus and windows high contrast mode
- see #7366
2021-09-30 08:12:00 +10:00
Matt Westcott
0380f01b24 Allow specifying a format for the label of a collapsed StructBlock
Currently, the label shown for a StructBlock's collapsed representation takes its content from the first sub-block of the StructBlock, which isn't always what you want. Add a new `label_format` meta option to StructBlock to allow customising this - e.g. `label_format = "Profile for {first_name} {surname}"`
2021-09-27 19:07:14 +01:00
Storm Heg
19ad01ddd5 Fix userbar tabbing behaviour
Tabbing (navigation using Tab or Shift + Tab keys) will now close
the menu and move to the next focusable element on the page instead
of focusing the next menu item.

The previous behaviour was a deviation from the ARIA menu practices:
https://w3c.github.io/aria-practices/#menu

Further changes / cleanup:

* Consume keyboard events like arrow down to prevent the browser
  from interpreting them.
* Refactor repeated setTimeout and `.focus()` calls into single
  `focusElement(el)` function. Let's keep it DRY!

Fixes #7290
2021-09-19 14:46:28 +10:00
amychan331@yahoo.com
218e728f34 Make hamburger menu a button for tab accessibility
- Adding type to button element
- Co-authored-by: Dan Braghis <dan@zerolab.org>
- fixes #7327
2021-09-19 14:18:34 +10:00
Andrew Stone
7d9e90fdbd Ensure admin tab events are handled on page load
The `shown.bs.tab` event was being bound after showTab() was already
called, so on page load, the tabs weren't being updated correctly.
2021-09-10 07:06:59 +10:00
Krzysztof Jeziorny
cf064f2b99 Fix width on comment notifications dropdown
- Other languages' word can break the dropdown's layout
2021-09-07 20:54:43 +10:00
Desaiakshata
22cdd89b68 Fix Window high contrast mode - tag field
-edit background color for form input field-forced color mode
2021-09-07 20:11:00 +10:00
Karl Hobley
45b7788c6d
Completely hide sidebar in mobile mode (#7481)
* Add bars.svg icon

* Add Open/Close button for mobile mode

* Completely hide sidebar in mobile mode

* mobile state tweaks

* Rename 'open' to 'visibleOnMobile'
* Don't initialise 'collapsed' state based on screen size (old code)
* Remove main.sidebar--open (not used)

Co-authored-by: Storm Heg <storm@stormbase.digital>
2021-09-02 16:38:03 +01:00
Matt Westcott
17e8fc22eb Refactor helper methods in chooser.py
JS context variables are only needed in one place now
2021-09-01 20:46:41 +10:00
FDGod99
c2347a6d35 fix - high-contrast mode - sidebar needs visual separation
- Due to how high-contrast mode works, there was no visual separation between the sidebar and the main content, adding a transparent border resolves this without having any visual impact in non-high contrast mode
- fixes #7456
2021-09-01 08:02:42 +10:00
Karl Hobley
bb7620f445
Frontend improvements for new slim sidebar (#7469)
* Fix left padding not changing fast enough

* Make all icons stay in a fixed Y position

So they don't move when you hover

* Make the Wagtail a bit bigger in collapsed mode

* Fix position of search icon when expanding/contracting menu

* Animation refinements

* Fix gap between icon and text changing for legacy icons during collapse

* Only peek the menu if the mouse hovers over a menu

This fixes an issue where peeking wouldn't happen if you collapsed the
menu and then hovered over a menu item without the mouse leaving the
sidebar. It now always peeks when the user hovers the menu item.

But we still want to avoid it peeking when the user clicks the collapse
button, so I've moved the mouse enter/leave handlers to a sub-element
that doesn't include this button.

* Peek the sidebar on focus

Allows the sidebar to open when it receives keyboard focus, and stops it
annoyingly closing while you are typing a search query.

* Remove the start peeking timeout
2021-08-31 12:00:29 +01:00
fabienheureux
cb08c997ea
Make all edit panels collapsible (#7365)
* Make more panels type collapsible
* Remove duplicate js in homepage template
* Move collapsible code into its own js file
* Change $li to $target in collapsible.js, as in #6342

Closes #7364, #6342, #6187, #2123

Co-authored by: Fabien Le Frapper <contact@fabienlefrapper.me>
Co-authored-by: Robbie Mackay <rm@robbiemackay.com>
Co-authored-by: Scott Cranfill <scott.cranfill@jpl.nasa.gov>
2021-08-30 08:33:43 -07:00
Seb
a9f13d2dfb Apply list styles for MultipleChoceFields 2021-08-24 08:34:40 +10:00
Dmitrii Faiazov
fb66c1fd17 Styling for Windows high contrast
- add media queries for icons & logos
- fix issue with color problems
2021-08-23 20:15:08 +10:00
Cynthia Kiser
34191a05d4 Fix Uncaught ReferenceError when editing links in Hallo 2021-08-12 14:59:55 +01:00
jacobtoppm
b7a37330bd Make chooser convert external to internal links 2021-08-11 11:52:29 +01:00
Karl Hobley
8413d00bdd Spelling fixes 2021-08-06 20:11:30 +01:00
Matt Westcott
22d4665b17 remove the model_string parameter to createSnippetChooser that we no longer need 2021-08-02 17:05:14 +01:00
Matt Westcott
74a8cfd862 Pass the complete snippet chooser URL as a data attribute, rather than tacking on the model parameter in JS.
I think that's a throwback to when the chooser URL was being passed to the page as a constant in window.chooserUrls...
2021-08-02 17:05:14 +01:00
Storm Heg
952264a2ab
Slim sidebar: remember collapsed state 2021-07-23 10:47:50 +01:00
Matt Westcott
35132296cc Ensure error count badge counts StreamField non-block errors
Fixes #7353

The error counter was only counting elements with class error-message, but non-block errors on ListBlock / StreamBlock use a different styling,help-critical.
2021-07-22 14:21:28 -07:00
Brandon Murch
5bc1c1832e
Fix delete button color 2021-07-20 18:41:04 +01:00
Matt Westcott
7e89180153 Update ListBlock max_num tests from #7334 to reflect markup changes to action buttons from #7307 2021-07-14 13:39:39 +01:00
Matt Westcott
4c4d3b5100 Add client-side validation for ListBlock maxNum 2021-07-14 13:14:15 +01:00
Matt Westcott
d22cc560f1 Move checkBlockCounts into BaseSequenceBlock as a general blockCountChanged callback
The call to checkBlockCounts from duplicateBlock can be removed outright, as it already gets called via the call to insert.
2021-07-14 13:14:15 +01:00
Matt Westcott
439edf381b Update test snapshot from #7322 to reflect action button changes from #7307 2021-07-12 12:59:46 +01:00
Matt Westcott
3306a98257 set icon / label identifier at the class level 2021-07-12 12:16:26 +01:00
Matt Westcott
ca2263a12f DRY ActionButton definitions 2021-07-12 12:16:26 +01:00
Matt Westcott
e1cb2a07d1 Refactor action buttons into subclasses of ActionButton 2021-07-12 12:16:26 +01:00
Matt Westcott
528e4810af Add event listeners for enable/disable logic
This decouples the action button handling from the rest of BaseSequenceChild; nothing after the initial render needs to deal with button states.
2021-07-12 12:16:26 +01:00
Matt Westcott
f584dd57bb Remove onRequestFoo callbacks from BaseSequenceChild in favour of just giving it a handle to the sequence object.
The rationale for these was to keep the control flow in one direction, so that the child blocks don't know about the wider sequence they belong to. But that's already undermined by the fact that they have to keep track of their own index number, and it just makes things needlessly unwieldy, particularly when we go on to make action buttons pluggable (and emphatically want to avoid having a mass of abstraction between the button and the action it performs).
2021-07-12 12:16:26 +01:00
Matt Westcott
be0996486d Give action buttons their own ActionButton class 2021-07-12 12:16:26 +01:00
Matt Westcott
e0ac8ae73d Support non-block validation errors on ListBlock (#7322) 2021-07-09 16:24:11 +01:00
Kevin Gutiérrez
4eb7c2c019 Change spin animation name (#7299)
The animation name `spin` is too generic, and it can be easily override by other libraries (eg. the code used in (django-json-widget)[https://github.com/jmrivas86/django-json-widget/blob/master/django_json_widget/static/dist/jsoneditor.min.css]) or by custom code, affecting the saving animation.
2021-07-08 16:29:54 +01:00
Matt Westcott
aff898ad8d Prevent comments CSS from overriding custom colours
Fixes #7294. CommentApp/main.scss mistakenly redefined the SCSS colour variables to their Wagtail defaults, overriding the ability to customise them as pe https://docs.wagtail.io/en/stable/advanced_topics/customisation/admin_templates.html#custom-user-interface-colors
2021-07-02 12:06:07 +01:00
Matt Westcott
fa648116b2 Correctly handle nulls in ListBlock validation errors
Fixes @cnk's test case from #7248. blockErrors within a ListBlockValidationError is an array (with nulls for the items with no errors), but setError was treating it as a dict keyed by block index, which meant it was erroneously passing nulls to the child setError method. FieldBlock handles this gracefully, but other blocks such as StructBlock don't.
2021-06-29 13:33:55 +01:00
Matt Westcott
5bb9e0547a Move 'responses' dict into the return value of getChooserConfig 2021-06-28 12:25:29 +01:00
Matt Westcott
9fad84b768 Refactor getChooserConfig / filterEntityData into subclasses of ModalWorkflowSource
This means we're not artificially forcing four different entity types into the same code path, and makes it possible to define new entity types outside of this module.

Also relax the eslint no-unused-vars to allow unused function parameters - having multiple classes following the same interface is a legitimate use of this.
2021-06-28 12:25:29 +01:00
Storm Heg
3ee060ffd7
Add keyboard and screen reader support to Wagtail user bar (#6994). Fix #6108
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2021-06-26 20:53:44 +01:00
Jacob Topp-Mugglestone
51c3c8cb40 Don't assume window.comments exists during Draftail init
This may break use of Draftail widgets in custom image models, where the usual editor js is not used.
2021-06-25 09:56:38 +01:00
Storm Heg
688f022e48 Reinstate sidebar slim account menu css selector
It was still in use, oops...
2021-06-24 15:36:21 +01:00
Storm Heg
33efa345e3
[slim-sidebar] Small bug fixes 2021-06-24 11:12:15 +01:00
Storm Heg
877297f67e
[slim-sidebar] Styling changes 2021-06-23 21:50:33 +01:00
Karl Hobley
e457d6a0fd
[slim-sidebar] Always display menu that is opening on top of menu that is closing (#7270) 2021-06-22 14:34:53 +02:00
Storm Heg
c475e96d1b Give every sidebar module a numerical key
This stops React from complaining that every child in a list should
have a unique key prop.
2021-06-22 13:25:00 +01:00
Karl Hobley
b756c37731
[slim-sidebar 5] Page explorer (#7192)
* Added separate SidebarPanel component

* Copied explorer implementation

It's going to need a lot of changes

* Initialise the page explorer

* Move page explorer up a bit

* Hook into page explorer navigation

* Make navigate handler replace default button click behaviour

* Update page explorer to use SidebarPanel

* Add swipe in/out transition for page explorer
2021-06-22 13:45:19 +02:00
Matt Westcott
ac2e07e8c4 Move cleanForSlug into its own utils module
This allows us to test it without having to jump through hoops to make the rest of page-editor.js module-friendly, and moving the test module out of client/src/entrypoints means we don't duplicate it into wagtail/admin/static (where the test runner tries to run it again with broken imports)
2021-06-21 14:34:40 +01:00
Matt Westcott
39e168c574 Build front-end assets on CircleCI
This means we don't need a bogus "eslint-disable-next-line import/no-unresolved" directive when importing built CSS, which ends up breaking lint locally. Fixes #7177
2021-06-21 14:34:40 +01:00
Matt Westcott
9d19c2aa13 Fix eslint warnings 2021-06-21 14:34:40 +01:00
Storm Heg
7a03c125de Sidebar: use new toggle styling 2021-06-21 14:29:34 +01:00