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

561 Commits

Author SHA1 Message Date
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
Storm Heg
2b35464783 sidebar: use darker background color 2021-06-21 14:29:34 +01:00
Storm Heg
dec4e9a0a3 Increase slim sidebar width 2021-06-21 14:29:34 +01:00
Karl Hobley
967626f9a2 Allow footer text to be set on sub menus 2021-06-11 13:47:12 +01:00
Karl Hobley
e047266153 Convert Icon to TypeScript 2021-06-11 09:32:18 +01:00
Karl Hobley
36966a5819 Merge Sidebar button implementation into shared implementation 2021-06-11 09:32:18 +01:00
Karl Hobley
5dabd762fa Use React event listeners for peeking the sidebar 2021-06-10 14:18:19 +01:00
Karl Hobley
8a79f27738 Add story containing Arabic translations 2021-06-10 14:18:19 +01:00
Karl Hobley
e463bedff1 Prevent double initialisation if Telepath is imported twice 2021-06-10 14:18:19 +01:00
Karl Hobley
33af79a1c4 Initial work on new sidebar react/css 2021-06-10 14:18:19 +01:00
Karl Hobley
4daeed1bf5 Add locale filter into snippet chooser (#6699) 2021-05-17 13:24:03 +01:00
Karl Hobley
e67fb23ea8 Add JS and CSS entrypoints for new sidebar 2021-05-17 11:48:29 +01:00
Karl Hobley
04deadedba Move legacy sidebar JS into a separate module 2021-05-17 11:48:29 +01:00
Matt Westcott
cfadc59acc Fix eslint/csslint warnings about line length / indenting 2021-05-13 16:09:02 +01:00
Coen van der Kamp
95693efc10
Disable options without translated parent. Add help text. (#7171) 2021-05-12 13:49:36 +01:00
Matt Westcott
3f128b554e
Prevent JS error on URL hashes that are not tabs (#7169)
The tab code looks for the presence of a URL hash and calls showTab on a link with that href, without checking that the link A) actually exists and B) is a tab as identified by the data-tab attribute. As a result, non-tab-related uses of URL hashes (such as simply visiting /admin/#foo) throw a JS error.
2021-05-07 17:02:08 +01:00
Matt Westcott
c1d3b87674
Prevent StreamField initialisation from being broken by colliding HTML IDs (#7152)
Fixes #7146 - the root StreamField element is now matched by ID _and_ having a data-block attribute. (Duplicate IDs are invalid HTML and the 'proper' fix would be to add a global prefix to form fields, particularly since this problem isn't necessarily specific to StreamFields - but that would be a bigger breaking change.)
2021-05-06 09:45:23 +01:00
jacobtoppm
722d8836a9 Remove explicit height from comment-list to stop overflow on short pages 2021-05-04 15:05:19 +01:00
jacobtoppm
f7bc89c03e Remove teal line under active tab and align tab and comment text better 2021-05-04 10:16:23 +01:00
Karl Hobley
d50da87cf4 Get commenting stories working again 2021-05-03 17:05:56 +01:00
Karl Hobley
b9d61ab82a Use stubs in storybook 2021-05-03 17:05:56 +01:00
Karl Hobley
d927838b6c Add crypto to storybook fallbacks 2021-05-03 17:05:56 +01:00
Karl Hobley
66ff35ea52 Installed storybook
- Run `npx -p @storybook/cli sb init --type react --builder webpack5`
- Moved .storybook and stories folders into client
- Run `npm i --save-dev html-webpack-plugin@latest` to workaround https://github.com/storybookjs/storybook/issues/13332
- Add storybook-static to .gitignore
2021-05-03 17:05:56 +01:00
jacobtoppm
9b1156210c Prevent Draftail rerender when editing comments 2021-04-29 10:58:07 +01:00
jacobtoppm
6c3647f3c5 Fix comment reply actions padding 2021-04-28 17:36:07 +01:00
jacobtoppm
7be2006e8d Align comment notification with comment bottom 2021-04-28 16:21:52 +01:00