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

1126 Commits

Author SHA1 Message Date
Karl Hobley
2a40333770 Set referer policy of upgrade notifcation to "strict-origin-when-cross-origin"
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
- Since Django 3.1, all Wagtail admin responses have been given a referer-policy: same-origin header. See: https://chipcullen.com/django-3-referrer-policy-change/
2022-05-19 08:37:25 +10:00
Steve Stein
851ec9a5c1 Apply full header breadcrumb spacing fixes for all templates (#8471, #8491) 2022-05-13 17:09:01 +01:00
Matt Westcott
2da1a051c7
Make 'upload one now' link on document chooser work after results refresh (#8529)
* Make 'upload one now' link on document chooser work after results refresh

Fixes #8528
Put the initTabs call inside ajaxifyLinks so that it's reapplied when the results container (including the 'no results message') is replaced.

* Make 'create one now' link on task chooser work after results refresh
2022-05-13 12:13:36 +01:00
LB Johnston
d9981e0ec7 fix up spelling in documentation & docstrings (should be en-GB not en-US)
- customize -> customise
- color -> colour
- customizing -> customising
- organize -> organise
2022-05-13 08:13:06 +10:00
Matt Westcott
7d8d900d10
Set comment position correctly relative to scroll position (#8511)
Fixes #8500. As a consequence of the CSS changes in c6fdb6bbb3, scroll position is no longer reflected in the document element's scrollTop property, but on the `<main>` element instead. As a result, comment positions were not being adjusted for scroll position. To account for this (and any future CSS changes), we walk all ancestor elements to calculate the true scroll position.
2022-05-12 14:11:47 +01:00
Thibaud Colas
7129ccefc9 Remove logical properties compatibility styles for Safari 13
- update caniuse-db & browserslist
- resolves #8124
2022-05-11 21:41:15 +10:00
jacobtoppm
7e98db7197 Disable webpack css url rewriting
This was causing relative urls to be rewritten to use the publicPath.
This meant that the icon font would be referenced at the wrong location
if sites had changed STATIC_URL
fixes #8517
2022-05-11 19:27:49 +10:00
Thibaud Colas
74ed301562 Fix cropped descenders in sidebar 2022-05-10 16:56:08 +01:00
Thibaud Colas
5afbd6371a Adjust branding spacing in sidebar 2022-05-10 16:55:37 +01:00
Steve Stein
95fcddd9d2
Switch locales selector JS error (#8468). Fix #8466, #8462
* Check for hover tool tip instance to avoid throwing errors

* Remove multiple attr because it is un-needed now
2022-05-06 16:10:09 +01:00
Thibaud Colas
d4f6e81067 Fix last integration test failure 2022-04-29 14:43:45 +01:00
Steve Stein
bb083e4463
Status sidebar design review and fixes (#8445)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-04-29 14:38:53 +01:00
LB (Ben Johnston)
30e1e06a59
Make new font stacks available as css custom properties (3.0) (#8415)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-04-29 14:23:55 +01:00
Steve Stein
e8c8ae778f
Allow external tab triggers - Underline tab issue (#8454)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-04-29 14:21:54 +01:00
Thibaud Colas
28c6a96de8
Separate tab focus and selection to avoid always setting URL hash (#8460) 2022-04-29 14:01:13 +01:00
Thibaud Colas
03bbc2c747
Page explorer regression fixes (#8459) 2022-04-29 14:00:19 +01:00
Steve Stein
20d9fd145e
Design review updates - Remove tab animation, adjust tab spacing and high contrast support, sidebar alignment (#8452) 2022-04-29 13:51:42 +01:00
Karl Hobley
ad8e8034da
Header styling tweaks (#8438)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-04-29 12:59:52 +01:00
Thibaud Colas
64d99d5f57 Fix failing unit tests from #8447 2022-04-29 12:06:44 +01:00
Steve Stein
815f621df4
Resize textareas onload and tab-changed event (#8442) 2022-04-29 11:37:20 +01:00
Thibaud Colas
d2aefa547c
Re-add Pages explorer focus trap. Fixes #8035 (#8447) 2022-04-29 11:33:29 +01:00
Steve Stein
8efb235695
Restyle badge for tab errors (#8446) 2022-04-28 13:49:54 +01:00
Steve Stein
7756453849
Breadcrumbs & Slim header design review styling (#8434)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-04-28 13:25:59 +01:00
Steve Stein
db5f4106db
Sidebar animation fixes (#8423). Fix #8311
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>

- Animations – The close animation for sub-menus doesn't seem to play when the menu is expanded - Made it so sub menu's stay open when the menu is expanded and collapsed
- Animations – The account menu seems to have a different tween animation to the rest of the menu. Causing it to do a weird thing when you collapse the menu while the account menu is open
- Animations – The avatar suddenly jumps to the right when you collapse the menu
- Animations – The Bird seems to have two hover states (try slowly moving your mouse cursor from top to bottom and you'll see it's wing appears before the hover animation is triggered). Not sure if this is intended behaviour.
- Accessibility – Focus order is incorrect on the mobile version (it should be possible to move to the sidebar after having toggled it)
- Try and fit more letters in to the sidebar menu items by reduce the padding / margin on the right side of the arrow, and reduce the gap between the icon and the text a tiny bit
- Make it so when you have a menu open (e.g. Bakery misc) and you click the slim sidebar icon, the menu stays open as the menu gets slim.
- Add a label to the sidebar’s `<aside>`
2022-04-28 02:14:18 +01:00
Tidiane Dia
94b20b418a
More actions dropdown button toggling on bulk actions (#8057)
* Hide more actions dropdown button on listing pages when performing actions in bulk

* Add toggleMoreActionsDropdownBtn function

* Fix lint issues

* Use if/else statement instead of ternary operator to avoid lint warning
2022-04-25 14:53:13 +01:00
Thibaud Colas
1cd784adb7 Add basic "multilingual support" section 2022-04-23 01:05:27 +01:00
Thibaud Colas
a395d9c565 Auto-generate docs for most important design tokens 2022-04-23 01:05:27 +01:00
Thibaud Colas
bd874c63c9 Implement colors palette visualisation with contrast grid link 2022-04-23 01:05:27 +01:00
Thibaud Colas
5fd3962d7f Update existing stories with latest storybook-django version 2022-04-23 01:05:27 +01:00
Steve Stein
64dd361cf7
Slim sidebar visual design issues (#8404)
- Visual design – Collapsed sidebar is wider than intended
- Visual design – Change “Edit your account” to “Account” tooltip
- Visual design – Slim side bar on bird hover, make the bird a little big bigger (don’t make it shrink as much)
- Visual design – Change the tooltip to the darker indigo (discussed with ben and this is no longer necessary)
- Visual design – Expand the space between the menu items (add 3px padding) - then adjust the flyout menu items spacing too
- Visual design – Get the labels and icons to align vertically (space between icon and label)
- Visual design – Make the width 60px
- Visual design – Make the arrows slightly smaller and closer to the icons on slim view
- Visual design – Move the bird higher up and slightly smaller, as per the designs
- Animations – I wonder if the new |-> icon should flip horizontally rather than roll? (or maybe not animate at all?) The rolling animation feels a little strange as I think the pipe is meant to represent the always vertical menu
- Animations – The Bird seems to have two hover states (try slowly moving your mouse cursor from top to bottom and you'll see it's wing appears before the hover animation is triggered). Not sure if this is intended behaviour.
- UX – Unexpected behavior with the search – clicking the "Search" icon submits a search, while all other icons in the sidebar are safe to click (This will expand the menu in slim mode and only have pointer events to submit in expanded mode which should be acceptable as its the submit button for the field?)

Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-04-23 00:10:32 +01:00
Steve Stein
92705d8f06
Design review changes - Info panel, Page title field (#8411)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>

-Add a down arrow to right of Switch Locales
- Change the wording “Set Privacy” to “Change Privacy”
- Make the close icon on the info panel the same size as the close icon on the slim sidebar
- Make title field text font weight 800
2022-04-22 22:08:04 +01:00
Matt Westcott
262e94401a
Housekeeping to start work on 4.0 (#8420)
* Add release notes page for 4.0

* Version bump to 4.0

* Rotate deprecation warnings
2022-04-22 14:25:16 +01:00
Steve Stein
90ccbff15b
Add comment notifications switch back into tabs (#8392) 2022-04-22 13:05:13 +01:00
Karl Hobley
a78216320a
Close the side panel when comments are selected (#8357)
* Move page history button to after the side panel toggles

This was requested by Ben to make the "Info" button come first

* Close the side panel when comments are selected
2022-04-14 11:07:57 +01:00
LB Johnston
5df15bed24 fix minor linting issue page-editor.js 2022-04-14 19:44:29 +10:00
Rishank
7861014316 add Monospace system UI font stack
resolves #8043

ui-monospace, Menlo, Monaco, ... "Courier New", monospace

Operating Systems and their fonts:
ui-monospace -> MacOS (Menlo, Monaco fallback)
Cascadia  ->Windows (since Vista)
Roboto -> Android (since 4.0)
Fira -> Firefox OS
Droid -> Android (<4.0)
Oxygen -> KDE
Ubuntu -> Ubuntu
In addition, ui-monospace is supported for Safari/MacOS (only way to access SF Mono in Mac);

Cascadia is a new Microsoft font-face, and Segue is the fallback.
2022-04-14 19:44:29 +10:00
Steve Stein
b3f95f82ff
Fix comment count styling (#8355)
* Return comment count to header toggle with placeholder styling

* Fix comment count styling, adjust sidebar sizing and comment toggle space

* Remove comment spacing fix for now
2022-04-14 00:09:24 +01:00
jacobtoppm
66c2f3d328 Return comment count to header toggle with placeholder styling 2022-04-13 18:19:05 +01:00
Tidiane Dia
503298556e Add logic to detect duplicates when uploading an image via a modal
Add client-side logic to confirm a duplicate upload

Add template shown when a duplicate image is found via modal upload

Style duplicate upload template shown in modal

Add test for duplicate image upload in modal chooser

Avoid loading all duplicates in memory and use f-string

Make template fragments translatable and use image templatetag to render images

Use class selector instead of direct element one

Set primary button to 'Use existing and delete new' on duplicate upload
2022-04-13 17:59:51 +01:00
Tidiane Dia
c136f461bc Add duplicate detection to multiple image upload view
Add utility function to find an image's potential duplicates

Add logic to detect duplicates on multiple images upload view

Add template shown when a user is prompted to confirm a duplicate upload

Add client-side logic to confirm a duplicate upload

Add/update styles

Add tests for duplicate image uploads

Index Image file_hash field

Ensure that a user can choose an image from duplicates returned by find_image_duplicates

Use CSS classes instead of HTML elements to hide edit form on duplicate upload

Add ImagesPermissionPolicy helper to retrieve the permission policy dynamically

This allows test cases that override the base image model to pick up the corresponding permission policy, should they need it.

Remove usage of sibling selector

Use wagtail image templatetag to generate image

Renamed ImagesPermissionPolicy to ImagesPermissionPolicyGetter

Fail loudly when setting permission policy and a wromg image model is provided

Add decorator to disconnect a signal's receiver during a test execution and use it in get_image_model tests

Improve warning message on duplicate upload in multiple upload view

Show matching form when confirming a duplicate upload
2022-04-13 17:59:51 +01:00
jacobtoppm
cbbdc3a665 Remove remaining uses of blocks receiving parent references 2022-04-13 15:27:30 +01:00
jacobtoppm
3ae0ba51a2 Switch to cut icon, and grey out rather than remove when disabled 2022-04-13 15:27:30 +01:00
jacobtoppm
85457cdad4 Fix js linting issues 2022-04-13 15:27:30 +01:00
jacobtoppm
7787abad2f Tests for splitting 2022-04-13 15:27:30 +01:00
jacobtoppm
c94b09d14b Switch to placeholder icon and translated text for split control 2022-04-13 15:27:30 +01:00
jacobtoppm
e938a9c3aa Move comments appropriately when splitting block 2022-04-13 15:27:30 +01:00
jacobtoppm
4123e2d386 Remove split control when at max block count 2022-04-13 15:27:30 +01:00
jacobtoppm
f0c42c8f4d Draftail widget splitting, permanently on 2022-04-13 15:27:30 +01:00
jacobtoppm
e2c1587f15 Make parentCapability updates use functions rather than events, to make setting other options simpler 2022-04-13 15:27:30 +01:00
jacobtoppm
08fe817375 Add setState to Draftail widget 2022-04-13 15:27:30 +01:00
jacobtoppm
8be861bc0d Start adding split block tests 2022-04-13 15:27:30 +01:00
jacobtoppm
a51a8483b0 Add StreamField parentCapabilities object, using 'duplicate' as an example function. 2022-04-13 15:27:30 +01:00
Steve Stein
f323d88765
Move page meta information from the header to a new status side panel component inside of the page editing UI (#8285)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-04-13 03:21:51 +01:00
Karl Hobley
a8967b5894
Page editor side panels (#8281)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-04-12 23:10:48 +01:00
Steve Stein
629ced01ca
Page editor underline tabs (#8266)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-04-12 16:11:08 +01:00
Steve Stein
8bbf41627b
Implement new slim page editor header with breadcrumb (#8231)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
Co-authored-by: Dan Braghis <dan@zerolab.org>
Co-authored-by: Karl Hobley <karl@kaed.uk>
2022-04-08 17:36:47 +01:00
Thibaud Colas
8694317fb4 Add back support for custom attributes on menu items 2022-04-08 11:51:09 -04:00
Thibaud Colas
4dc5f3c595 Remove legacy sidebar, refactoring slim sidebar implementation 2022-04-08 11:51:09 -04:00
dependabot[bot]
79ad6b65c1 Bump minimist from 1.2.5 to 1.2.6 in /client/tests/integration
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 06:49:08 +10:00
Thibaud Colas
34cd9e2aaa Code review cleanup 2022-04-01 17:01:26 -04:00
Karl Hobley
849ac514a2 Define gettext functions in an importable module 2022-04-01 17:01:26 -04:00
Karl Hobley
2b1d1d0749 Add a script to extract strings from javascript 2022-04-01 17:01:26 -04:00
Karl Hobley
1e884285a1 Replace STRINGS constants with gettext 2022-04-01 17:01:26 -04:00
Matt Westcott
97e781e31c Renumber Wagtail 2.17 to 3.0
As per discussion on https://github.com/wagtail/wagtail/discussions/7732, the changes in the upcoming release (sidebar redesign, removal of hallo.js, module reorganisation) warrant a version bump to 3.0 if we're following semantic versioning.
2022-03-31 06:38:27 +10:00
Steve Stein
af4c4d0653
Change slim sidebar to be fully usable in slim mode. Fix #7918 (#8197)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>

- Removing the peeking attribute so the sidebar only opens when intentionally set to expanded mode by using expand or search or account functionalities
- Adding tooltips on link item hovers
- Expanding of slim sidebar when search is clicked and when account options are clicked
2022-03-28 15:43:35 +01:00
Luis Espinoza
b53017ad94 remove redundant role="main" for <main> 2022-03-26 12:03:35 -07:00
Steve Stein
229fbf476a
Sidebar style updates (#8118)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-03-23 03:27:12 +00:00
PaarthAgarwal
a412dcc8d5 styles - disable text-transform property-disallowed-list for required usage 2022-03-22 08:24:52 +10:00
PaarthAgarwal
255d5e9b03 removed redundant text-transform instances
removed page-specific overrides css from importing
2022-03-22 08:11:41 +10:00
Thibaud Colas
a50ebe9f83
Tailwind setup follow-up: RTL support and Windows High Contrast mode (#8117)
Co-authored-by: LB (Ben Johnston) <mail@lb.ee>
2022-03-15 15:05:18 +00:00
LB (Ben Johnston)
042d077fc1
Minor accessibility fixes to new slim sidebar menu items (#8015)
* Consistently set `aria-haspopup="menu"` for all sidebar menu items that have sub-menus (LB (Ben Johnston))
 * Make sure `aria-expanded` is always explicitly set as a string in sidebar (LB (Ben Johnston))
 * Use a button element instead of a link for page explorer menu item, for the correct semantics and behavior (LB (Ben Johnston))
2022-03-15 14:53:40 +00:00
Thibaud Colas
14280ad7ea
Convert all UI code to CSS logical properties (#8051)
- Rewrite all styles to use logical properties
- Update Stylelint configuration to include logical properties checks
2022-03-15 13:21:06 +00:00
PaarthAgarwal
4b07e4214a
Remove most uppercased text styles from admin UI. Fix #7624 (#8111)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-03-15 12:07:07 +00:00
PaarthAgarwal
6a84cf4583
Switch focus outlines implementation to :focus-visible for cross-browser consistency. Fix #7994 (#8113)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-03-15 11:33:12 +00:00
Steve Stein
5996c5dd29
Switch icons implementation to SVG, with checkbox improvements (#8054) 2022-03-07 17:06:19 +00:00
Steve Stein
07ee733bbe
Page Editor Improvements: TypeScale configuration (#8064). Fix #7982
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-03-04 22:55:24 +00:00
LB Johnston
13091eab34 remove Hallo JS 2022-03-02 20:15:33 +10:00
LB Johnston
5c01ecfa94 remove Hallo styles 2022-03-02 20:15:33 +10:00
LB Johnston
e20f3f6966 test integration - update packages
- puppeteer - v11 to v13 https://github.com/puppeteer/puppeteer/releases/tag/v12.0.0 & https://github.com/puppeteer/puppeteer/releases/tag/v13.0.0
- @wordpress/jest-puppeteer-axe" - v3 to v4 42a5611fa7/packages/jest-puppeteer-axe/CHANGELOG.md (400-2022-01-27)
- jest & expect-puppeteer - minor update
2022-03-01 22:54:12 +00:00
LB Johnston
51ba6e4c47 integration tests - update package-lock for Node v16 usage 2022-03-01 22:54:12 +00:00
Steve Stein
3bf9b65c06
Tailwind package setup (#8003)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-02-27 16:08:38 +00:00
Steve Stein
5417982b8c
Design tokens setup (#8005)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-02-25 13:34:04 +00:00
Thibaud Colas
d149a27392 Upgrade Storybook setup, with latest release, less boilerplate 2022-02-24 21:22:45 +10:00
Thibaud Colas
b3e5f751e4 Add icons loading and demo to Storybook 2022-02-24 21:22:45 +10:00
Thibaud Colas
3aae7d0583 Add base pattern library setup with Storybook 2022-02-24 21:22:45 +10:00
Thibaud Colas
939fa98ef0 Move storybook configuration to a dotless folder, for linting 2022-02-24 21:22:45 +10:00
Gianluca De Cola
aaee9b8c81 Remove IE11 warning message and related files
- resolves #7993
2022-02-22 17:22:39 +10:00
Thibaud Colas
fd8277bcf7 remove modernizr & usage 2022-02-15 16:31:57 +00:00
Thibaud Colas
81b2c56df3 Remove all focusable="false" definitions for IE11 2022-02-15 16:31:57 +00:00
Thibaud Colas
c5d2f98205 Remove redundant noopener from noreferrer rel attributes 2022-02-15 16:31:57 +00:00
Thibaud Colas
ae14fa6e76 Remove JS compatibility code for IE11 2022-02-15 16:31:57 +00:00
Thibaud Colas
9ae8204a1b Remove fallback elements for IE11 support in comment headers 2022-02-15 16:31:57 +00:00
Thibaud Colas
9acce41fec Remove IE11-only Draftail configuration 2022-02-15 16:31:57 +00:00
Thibaud Colas
9ecc105178 Remove legacy browser styles 2022-02-15 16:31:57 +00:00
Thibaud Colas
d2d4651853 Remove polyfills only installed for IE11 2022-02-15 16:31:57 +00:00
Steve Stein
f968aac038
Update system font stack value for compatibility. Fix #7724 (#7972)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>

- `-apple-system, BlinkMacSystemFont` - These are used to target modern iOS Safari, macOS Safari, macOS Firefox and macOS Chrome's system fonts. 
- ` 'Segoe UI',  system-ui,` - These fonts target windows machines on Windows 7+ [reference](https://markdotto.com/2018/02/07/github-system-fonts/#the-stack). Having system-ui placed after Segoe UI allowed Segoe UI to take precedence when used on Windows machines set to Chinese ( Simplified ) language. There are some known language issues around `system-ui` being used: [This github article](https://infinnie.github.io/blog/2017/systemui.html). However, the purpose of `system-ui` [(reference here)](https://drafts.csswg.org/css-fonts-4/#valdef-font-family-system-ui) is to allow web content to integrate with the look and feel of the native OS. Which makes this font-family a good choice for other devices _if_ the problem is solved by putting Segoe UI first. 
- `Roboto,` - This is our fallback font for androids devices. Having Segoe set before this allows windows to use its system default font even if you have installed Roboto for development reasons. 
- `Helvetica Neue,` - This is a fallback for older macOS
- `Arial` - Using this to catch any of the very old Windows versions (shoutout windows 95)
- `sans-serif` - Our last resort to get a font without serifs
- `  'Apple Color Emoji',  'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';` - All the emoji's for the OS's mentioned above. 😁
2022-02-14 15:17:02 +00:00
LB Johnston
ddcdd3e57f slim sidebar - use sameSite lax by default
- this will ensure that the cookie will work as expected in future browser changes on HTTP or HTTPS setups
- fixes #7910#
2022-02-10 15:24:54 +00:00
LB (Ben Johnston)
f2257acc2e
Remove dateformat library usage (#7907). Fix #7904
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-02-04 14:13:48 +00:00
Thibaud Colas
af942a27e4
Reformat codebase with Prettier (#7912)
- Automated reformatting
- Manually change code where Prettier reformatting causes issues
- Revert "Disable Prettier formatting in CI for now"
2022-02-04 11:57:55 +00:00
Thibaud Colas
ee15eec511 Switch all Node tooling from Gulp to Webpack, with needed code changes
- Remove gulp code and docs
- Add base CSS & SCSS processing in Webpack
- Make sure Sass files use paths that can be resolved by Webpack
- Use faster source map generation
- Clean up build scripts
- Make sure Storybook can process Sass
- Switch away from web fonts (more work needed)
2022-02-01 07:36:17 +10:00
Thibaud Colas
0d0584bdbd Update snapshots for latest Jest upgrade 2022-02-01 07:36:17 +10:00
Thibaud Colas
81ec3244d3 Upgrade ESLint configuration, with needed refactorings
- Change ESLint configuration syntax for ease of editing
- Autofix basic issues picked up by ESLint
- Make sure JS linting runs on TypeScript files
2022-02-01 07:36:17 +10:00
Thibaud Colas
23bc6b2670 Upgrade to latest Sass and stylelint configuration, with needed refactorings
- Tweak stylesheets for compatibility with latest stylelint configuration
- Move stylelint config to JS for ease of copying rules with main config
- Enforce scss/no-global-function-names by refactoring code with sass-migrator
- Run Sass code through sass-migrator
- Change stylelint configuration and code to enforce font-family-no-missing-generic-family-keyword
- Manually switch to math.div where migrator used * 0.5
2022-02-01 07:36:17 +10:00
Jérôme Lebleu
e1ecca2f3c Display the select option's text instead of value in telepath (#7629) 2022-01-21 10:52:47 +00:00
Thibaud Colas
42f140a8b9 Switch sidebar props to a JSON script tag for ease of testing 2022-01-21 10:24:02 +00:00
Dan Braghis
76ad7da450 Update move page breadcrumb 2022-01-19 22:22:40 +00:00
Dan Braghis
9c6dace720 Tidy up breadcrumb display in a .tab-merged context
e.g. the ModelAdmin InspectView
2022-01-19 22:22:40 +00:00
Dan Braghis
411d3b00d3 Make breadcrumbs styling backwards compatible 2022-01-19 22:22:40 +00:00
Dan Braghis
a8c4d578fe
Add locale switcher in the page chooser 2022-01-19 13:13:33 +00:00
Matt Westcott
8f91a86c38 Use form.serialize for posting the search form 2022-01-16 14:27:59 +10:00
Matt Westcott
d69f73aa37 replace ajax_pagination_nav with pagination_nav 2022-01-16 14:27:59 +10:00
Matt Westcott
05fdea0394 Use standard form styling for 'create task' form 2022-01-16 14:27:59 +10:00
Matt Westcott
d8b81df487 Move 'create' form handling into its own view that only renders that one tab 2022-01-16 14:27:59 +10:00
Matt Westcott
5ce89f11ff Split ajaxify code for the 'new' tab into its own function
This will be useful shortly when we move the form handling into its own view that renders that tab independently
2022-01-16 14:27:59 +10:00
Jason Attwood
10f9de2459 Fix Dropdown issues in windows High contrast mode
- Fixes #7450
2022-01-16 14:09:45 +10:00
Jason Attwood
a0e55cedee Fix comment buttons not displaying correctly in high contrast mode
- fixes #7459
2022-01-15 23:41:42 +10:00
Shariq Jamil
28d9ded998 Add border to help/warning blocks for high contrast mode
- ensures the content has visible separation in windows high contrast mode
- fixes #7447
2022-01-15 23:37:05 +10:00
Krzysztof Jeziorny
8fa614eaf7 Render horizontal listing as a flex container
- Don't set fixed height on listed images
- Improve display of image listing for long image titles
2022-01-15 22:21:46 +10:00
Thibaud Colas
1c2ef89957 Support changing which origin the integration tests are run on 2022-01-15 21:44:36 +10:00
Thibaud Colas
7630bcf231 Fix package-lock.json package name 2022-01-15 21:44:36 +10:00
Thibaud Colas
60fe493999 Skip editbird tests 2022-01-15 21:44:36 +10:00
Thibaud Colas
44fd1852ee Trial browser tests in CircleCI 2022-01-15 21:44:36 +10:00
Jake Howard
0a9b23979b Update links to wagtail.io website to point to wagtail.org
This covers only links to the website, not other sites
2022-01-15 20:23:44 +10:00
LB (Ben Johnston)
1deed5f5af
Rename admin/expanding-formset.js (using kebab-case file) (#7833) 2022-01-15 01:00:02 +00:00
LB (Ben Johnston)
a7aabf76ac
modal-workflow - block additional opens & add trigger focus management (#7568). Fix #4006
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-01-15 00:47:23 +00:00
Tidiane Dia
bc7e116c75 Style move breadcrumb 2022-01-14 17:07:50 +00:00
Thibaud Colas
1547f0a6d3 Add borders to critical sidebar components for high-contrast mode 2022-01-14 15:59:37 +00:00
Thibaud Colas
df47d8650e Improve focus outline styles within sidebar 2022-01-14 15:59:37 +00:00
Thibaud Colas
1341b3c9c9 Implement support for branding_logo sidebar customisation in slim sidebar 2022-01-14 15:59:37 +00:00
Thibaud Colas
036fd3a4ac Fix visible scrollbars in new slim sidebar. Fix #7742 2022-01-14 15:59:37 +00:00
Jake Howard
feaf39332f Update the release URL to the new .org domain 2022-01-14 11:34:29 +10:00
Dan Braghis
6f5fa46c16 Include the locale label in explorer root 2022-01-13 10:55:28 +00:00
LB Johnston
4de5f3652c fix all basic linting rules (mostly formatting) 2022-01-13 07:50:24 +00:00
Martin Coote
f8d76b4bd1
Improve implementations of visually-hidden text in explorer and main menu toggle (#5793). Fix #5269
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-01-13 07:42:28 +00:00
Wicked
88c7d46282
Improve the visibility of field error messages, in Windows high-contrast mode and out (#7663) Fix #7241
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2022-01-13 06:46:35 +00:00
Thibaud Colas
4e5d130dbb Fix sidebar toggle compatibility with messages 2022-01-12 16:46:08 +00:00
Thibaud Colas
7e4745fd38 Add mobile support for sidebar sub-panels 2022-01-12 16:46:08 +00:00
Thibaud Colas
bdc265d8e2 Fix sidebar sub-menus appearing below action footer 2022-01-12 16:46:08 +00:00
Thibaud Colas
6db5561044 Fix sidebar getting obscured by messages banners 2022-01-12 16:46:08 +00:00
Thibaud Colas
9659ac73ec Fix rendering of sidebar language picker in slim sidebar. Fix #7806 2022-01-12 16:46:08 +00:00
Thibaud Colas
6f43b4f3e8 Fix "click outside dismiss" implementation in slim sidebar 2022-01-12 16:46:08 +00:00
Thibaud Colas
439770927f Fix sidebar MenuItem rendering 2022-01-12 16:46:08 +00:00
Thibaud Colas
c37ff082b7 Remove disused LinkMenuItem peeking and tooltip implementation 2022-01-12 16:46:08 +00:00
Thibaud Colas
962c820fc3 Render SubMenuItem toggles as buttons rather than <a> 2022-01-12 16:46:08 +00:00
Thibaud Colas
7c4b82bb8e Add ARIA markup for sidebar regions and toggle buttons 2022-01-12 16:46:08 +00:00
Thibaud Colas
dab2ad3b3f Fix account menu items not being marked as active 2022-01-12 16:46:08 +00:00
Thibaud Colas
57a9e58766 Implement aria-current for sidebar links 2022-01-12 16:46:08 +00:00
Thibaud Colas
5718dab4de Support right-click and middle-click interactions with sidebar links 2022-01-12 16:46:08 +00:00
thoang43
3651e5f21b Add draftail padding to fix cut off ol items
- fixes #7019
2022-01-08 21:44:11 +10:00
Vu Pham
0055be331b Modify responsive size for buttons on mobile
- fixes #6618
2022-01-08 21:30:14 +10:00
Tidiane Dia
2a3304fab7 Update breadcrumb dropdown button style 2022-01-07 16:23:17 +00:00
Tidiane Dia
bb04093f91 Add icon-only dropdown class and style it 2022-01-07 16:23:17 +00:00
Tidiane Dia
14bfbcc5b8 Set dropdown font-size directly in dropdown_item class 2022-01-07 16:23:17 +00:00
Tidiane Dia
dcd1b116b2 Display header buttons in page edit breadcrumb 2022-01-07 16:23:16 +00:00
Matt Westcott
13319c9716 linting 2022-01-07 16:11:45 +00:00
Matt Westcott
63d6557ece Pass IDs of ListBlock children to the frontend code 2022-01-07 16:11:45 +00:00
Dan Braghis
614ec3fc2a Remove woff fonts 2021-12-20 18:17:04 +00:00
Matt Westcott
980d2c435e collapse option on StreamField, StreamBlock, ListBlock
Fixes #7705
2021-12-01 07:36:54 +10:00
Kevin Gutiérrez
131cd076b7 Change spin animation name 2021-11-18 07:05:53 +10:00
LB Johnston
274e4485f9 fix issue where nested inline panel fix broke inline panel ordering/delete 2021-10-28 13:26:42 +01:00
Matt Westcott
9fcadd9461 Make column-count hidden field include deleted columns in its count
Fixes #7654. Without this fix, the server-side logic ends up only considering column IDs up to the final number of columns in the table, so (for example) if you start with three columns, delete two and add one, it will only consider IDs up to 2 even though the last inserted column has been assigned an ID of 4.
2021-10-28 10:08:39 +01:00
Scott Cranfill
1e7fbae192
TypedTableBlock: Use SVG for add button icons; use rem units for styling (#7647)
* TypedTableBlock: Use SVG for add button icons; use rem units for styling

* Fix add row button positioning in Safari
2021-10-27 07:05:23 -07:00
Jacob Topp-Mugglestone
2f8de89a5c Feature/bulk actions move chooser fixes (#7617)
* [feat] Documents, images and users bulk actions now work with custom models as well

* [fix] Bulk move disables invalid parent pages in the page chooser modal

* [refactor] Make the code DRY

Co-authored-by: Shohan <shohanduttaroy99@gmail.com>
2021-10-15 16:51:18 +01:00
Shohan
0d8ad857bf Customize select all in listing feature (#7606)
* [feat] Add feature to customize behavior of select all objects in listing

* [feat] Select all in listing now works with search terms

* [refactor] Make the code DRY
2021-10-15 16:51:18 +01:00
Shohan
4624d2d540 Fix typos and remove unwanted code from bulk actions (#7613)
* [refactor] Fix typos and documentation

* [refactor] Remove unused attribute object_key

* [refactor] Remove filters from page explorer

* [refactor] Remove unused code of page filters
2021-10-15 16:51:18 +01:00
Shohan
8033078d6c [lint] Fix lint errors (#7608) 2021-10-15 16:51:18 +01:00
Dan Braghis
57b0d2c2d7 Improve image listing checkbox alignment
Co-Authored-By: Thibaud Colas <thibaudcolas@gmail.com>
2021-10-15 16:51:18 +01:00
Dan Braghis
247bfe883f Further tidy up following code review
Co-Authored-By: Thibaud Colas <thibaudcolas@gmail.com>
2021-10-15 16:51:18 +01:00
Dan Braghis
d19e1b4380 Tidy up based on code review 2021-10-15 16:51:18 +01:00
Dan Braghis
2688bb062c Extract bulk actions styles to own component
_listing.scss still has a couple of references to bulk actions, but they quite nested so best left in there
2021-10-15 16:51:18 +01:00
Shohan
6deafb7dd8 [fix] Fix bulk action checkboxes not hiding after deselecting all 2021-10-15 16:51:18 +01:00
Shohan
5f261910ae [fix] Fix bulk actions checkbox not working after search results 2021-10-15 16:51:18 +01:00
Shohan
9c5d0a2a26 Bulk actions - action bar UI fixes (#7403)
* [fix] Fix transform transition of action bar

* [refactor] Increase spacing in action bar, consistent with the designs

* [fix] Make button width fixed, with proper notes to accessibility

* [refactor] Decrease padding and border radius, remove borders from buttons, align action bar with titles

* [refactor] Remove border from more button and decrease font weight of button label
2021-10-15 16:51:18 +01:00
Shohan
95d5097615 Bulk actions - appropriate string for listing (#7428)
* [feat] Add separate strings for different listings

* [refactor] Change string in users listing

* [refactor] Change keys to uppercase for consistency
2021-10-15 16:51:18 +01:00
Shohan
d773e9b4d2 [feat] Add bulk action ui to images listing 2021-10-15 16:51:18 +01:00
Shohan
1b9facb377 [fix] Fix bug that caused disconnect between ui and javascipt state when using the navigate back button in chrome to cancel a bulk action (#7394) 2021-10-15 16:51:18 +01:00
Shohan
ebf2351cff [refactor] Fix typo 2021-10-15 16:51:18 +01:00
Shohan
11d50333b5 [refactor] namespace data attributes for bulk actions 2021-10-15 16:51:18 +01:00
Shohan
48e9508fc1 [refactor] Refactor based on review comments
Changed following
- Use data- attributes to select elements instead of using classes
2021-10-15 16:51:18 +01:00
Shohan
d2ce53903c [refactor] Refactor based on review comments
Changed following
- action bar now uses translate for animation instead of changing layout
- action bar is now hidden from both text readers and keyboard navigation when it is out of view
- css now doesn't use elements for styling
- 'Show all in listing' is now a button instead of an <a>
- Changed aria labels to more suitable and meaningful ones
2021-10-15 16:51:18 +01:00
Shohan
d5481b0df5 [fix] Fix small ui issues and inconsistencies in the action bar
Fixed following
- Fixed the transition time of the action bar
- Fixed the sudden jerk due to text change in the action bar
- select all text in the action bar now appears only if there are more objects to display
2021-10-15 16:51:18 +01:00
Shohan
b7f24a2d81 [refactor] Refactor existing bulk action code for reusability 2021-10-15 16:51:18 +01:00
Shohan
bc24f1eb5e [refactor] Use template literals instead of string concatention, and reduce dependency on html structure for querySelector 2021-10-15 16:51:18 +01:00
Shohan
75764a99e7 [refactor] Capitalise 'More' text using css rather than rendering uppercase text in html 2021-10-15 16:51:18 +01:00
Shohan
263d652a61 [fix] Fix css issues regarding footer and bulk action buttons
Fixed following
- The text color on the bulk action buttons used to turn white on hover. Now, the text color changes acoordingly
- Changes to footer css changed caused changes in some unwanted places. Fixed that by namespacing the css changes
2021-10-15 16:51:18 +01:00
Shohan
020f8dcfaf [feat] Move actions bar to footer and ad bulk actions to search page
Added following
- Add 'More' dropdown if there are more than 4 bulk actions
- Add bulk actions to 'Pages search' page

Changed following
- Move actions bar from headers to footer
2021-10-15 16:51:18 +01:00
Shohan
9b463f0429 [refactor] Remove repeated logic in bulk-actions.js 2021-10-15 16:51:18 +01:00
Shohan
a40d4de316 [refactor] Refactor after review commits
Added following
- Add prepare action method that runs before transaction starts
- Add a default form with a default field

Changed following
- Move permissions check in bulk move from before hook to a method that runs before the transaction starts
- Select all pages now doesn't fetch all ids, but passes id as all and the parent page id
- Change no access permissions

Fixed following
- Fix tests for changes in html
2021-10-15 16:51:18 +01:00
Shohan
403cd5eb29 [feat] Add 'Select all pages in listing' support 2021-10-15 16:51:18 +01:00
Shohan
e524ccb995 [feat] Reintroduced ordering column and remove search input box and related views 2021-10-15 16:51:18 +01:00
Shohan
3ef56faac9 [refactor] Change filters implementation
Added following
- Separate routes for getting filter count with or without parent page id
- Use already existing parse_query_string function for parsing filter string

Changed following
- apply_filters now uses django's Q object, for more flexibility of filters

Fixed following
- bulk_action_choices hook now passes existing tests
2021-10-15 16:51:18 +01:00
Shohan
f96b9c829e [refactor] Refactor code to comply with style guide 2021-10-15 16:51:18 +01:00
Shohan
f875484f73 [feat] Add support for filters and bulk actions (del, pub, and unpub)
Added following
- Add support for filters
- Add bulk delete, publish and unpublish actions (views and templates)
- Add search textbox to get filtered results
- Add view to get count of pages corresponding to a set of given filters
2021-10-15 16:51:18 +01:00
Shohan
64a1d7299f [feat] Add bulk actions in page listing
Added following
- Add bulk action checkboxes (non functional), actions, filters in page listing (non functional)
- Add search bar in page listing (non functional)
2021-10-15 16:51:18 +01:00
Thibaud Colas
a32d390b83 Fix linting issue 2021-10-15 16:17:23 +01:00
Thibaud Colas
7f72540ac3 Fix visibility of sidebar footer items when closed 2021-10-15 16:17:23 +01:00
Thibaud Colas
36a793eb1f Add keyboard interactions to sidebar footer 2021-10-15 16:17:23 +01:00
Thibaud Colas
e1f9db736d Make it possible for slim sidebar submenus to vertically scroll 2021-10-15 16:17:23 +01:00
Thibaud Colas
27428e3760 Fix vertical scrolling of main slim sidebar panel 2021-10-15 16:17:23 +01:00
Shariq Jamil
c4422b2bec add border to comments dropdown
- for windows high contrast mode
- fixes #7458
2021-10-15 23:25:09 +10:00
Matt Westcott
5e720fa1d5 Reorganise control columns to put tab order for 'insert column' buttons at start 2021-10-15 14:20:56 +01:00
Matt Westcott
eec0ad2981 Improve tab ordering of 'insert column' buttons 2021-10-15 14:20:56 +01:00
Matt Westcott
e6b0def9e2 Add aria-label attributes to buttons 2021-10-15 14:20:56 +01:00
Matt Westcott
85781dfbac Update test snapshot for new markup 2021-10-15 14:20:56 +01:00
Coen van der Kamp
8deaf401f4 Reposition bottom add row button, add bin icons 2021-10-15 14:20:56 +01:00
Coen van der Kamp
3f3f3fe319 Make remove buttons red 2021-10-15 14:20:56 +01:00
Coen van der Kamp
516f0dd7e1 Add table wrapper, makes any number of columns possible 2021-10-15 14:20:56 +01:00
Matt Westcott
39978caf53 Revert to initial empty state after removing all columns 2021-10-15 14:20:56 +01:00
Matt Westcott
1b3baaf975 Change 'insert here' tooltips to 'insert' 2021-10-15 14:20:56 +01:00
Matt Westcott
83871f641e CSS tweaks as per https://github.com/wagtail/wagtail/pull/7470#issuecomment-941369676 2021-10-15 14:20:56 +01:00
Matt Westcott
a6649c0080 Add frontend tests for TypedTableBlock 2021-10-15 14:20:56 +01:00
Matt Westcott
3753b7a9e4 implement getTextLabel 2021-10-15 14:20:56 +01:00
Matt Westcott
33e015d1e7 Implement focus 2021-10-15 14:20:56 +01:00
Matt Westcott
d41dcd6381 styling for add-column menu 2021-10-15 14:20:56 +01:00
Matt Westcott
cdf8e9d409 Improve consistency of buttons 2021-10-15 14:20:56 +01:00
Matt Westcott
0270e769d6 Add title text for 'add column' button 2021-10-15 14:20:56 +01:00
Matt Westcott
6abca18817 Make strings translatable 2021-10-15 14:20:56 +01:00
Matt Westcott
4706daf274 Button style/positioning 2021-10-15 14:20:56 +01:00
Matt Westcott
62ead9a1fb Implement validation 2021-10-15 14:20:56 +01:00
Matt Westcott
bef6ffb64e Implement row insertion 2021-10-15 14:20:56 +01:00
Matt Westcott
bb57efc77a Implement row deletion 2021-10-15 14:20:56 +01:00
Matt Westcott
cc1e8282c0 Add hidden fields to keep track of row ordering and deletion 2021-10-15 14:20:56 +01:00
Matt Westcott
b78c658e0f Refactor this.rows so that each element is an object, and the list of blocks is just one property of that object 2021-10-15 14:20:56 +01:00
Matt Westcott
25652970a9 Add a trailing cell to each data row that will contain the 'delete row' button 2021-10-15 14:20:56 +01:00
Matt Westcott
76ef050146 Implement button for inserting column in any position 2021-10-15 14:20:56 +01:00
Matt Westcott
886bce0d0f implement button for deleting columns 2021-10-15 14:20:56 +01:00
Matt Westcott
9ee21b9c9c Add hidden fields to keep track of deleted columns 2021-10-15 14:20:56 +01:00
Matt Westcott
8bd1801103 Add hidden field for column ordering 2021-10-15 14:20:56 +01:00
Matt Westcott
caefa52941 Add a hidden field for column type 2021-10-15 14:20:56 +01:00
Matt Westcott
da14ebaf7c implement setState 2021-10-15 14:20:56 +01:00
Matt Westcott
44d89d330d Add header inputs 2021-10-15 14:20:56 +01:00
Matt Westcott
2b76ce0db0 correct initialisation of cell ID prefixes and initial state 2021-10-15 14:20:56 +01:00
Matt Westcott
614c23c9a0 Typed table block - initial block class and client-side mechanism for adding columns/rows 2021-10-15 14:20:56 +01:00
Thibaud Colas
b56d27d1a1 Fix checkboxes appearing as always checked in Windows high contrast mode 2021-10-15 06:59:51 +10:00
Thibaud Colas
c46001604b Improve checkbox keyboard focus styles without changing page layout 2021-10-15 06:59:51 +10:00
indreshp135
6e90c877ec fix issue with __prefix__ in nested inline panel
changed following:
change only first __prefix__ when multiple __prefix__ are present in
same name when orderable and blocks are nested

Co-authored-by: anirudhvs <54744932+anirudhvs@users.noreply.github.com>
Co-authored-by: CaptainIRS <36656347+CaptainIRS@users.noreply.github.com>

- fixes #7587
- fixes #5770
2021-10-13 07:37:27 +10:00
Sakshi Uppoor
da1e4d9a99
Fix toggle switch bug in high-contrast mode (#7561)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2021-10-08 22:32:55 +01:00
Jérôme Lebleu
5522992c29 Use SVG icons in StreamField buttons and headers
- Simplify rendering of .c-sf-button and its elements
- replaces the rendering of `.c-sf-button` as a flexbox by a simple
- block element - as it is enough here - and moves text related rules to the <button> element.
- Use SVG icon in StreamField's action buttons
2021-10-07 17:04:13 +10:00
Dmitrii F
932762c9f1 windows high contrast mode - multiple fixes
- fix search header field border in Windows High Contrast mode
- fix tab-nav active in Windows High Contrast mode
- add border for c-sf-button. This fix view in WHC mode.
- add justify-content - center for better view on mobile devices.
2021-10-07 15:59:14 +10:00
Matt Westcott
718232ead4 Better styling for snippets 'last updated' link 2021-10-04 13:49:55 +01:00
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
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
Jacob Topp-Mugglestone
c652e67c5e
Feature/commenting streamfield hover fix (#7131)
* Fix streamfield comment buttons not showing on hover

* Fix hover colour change only happening for some comment buttons
2021-04-28 16:21:16 +01:00
Matt Westcott
cf3c328f71 Make StreamField block objects available globally 2021-04-28 09:16:58 +01:00
Matt Westcott
cdeed1954e Implement telepath adapter for HalloRichTextArea
Fixes #7110
2021-04-28 09:15:18 +01:00
jacobtoppm
5dbcce4e1c Remove comment styles from further typing on enter, right/left arrow 2021-04-27 17:02:26 +01:00
Karl Hobley
5271b4e97a Lighten comment more actions icon 2021-04-27 15:45:29 +01:00
Matt Westcott
1061caa5ef Fix inconsistent StreamField ValidationError nesting
Fixes #7086. As per https://github.com/wagtail/wagtail/issues/7086#issuecomment-826945031, ensure that .as_data() is consistently called when telepath-packing ErrorList objects (so that we preserve any embedded ValidationError objects instead of casting them to strings), and introduce an explicit ValidationError class on the client side to make mismatches more obvious (and for future extensibility in case we need to attach more fancy logic to ValidationError).

Also add tests for setError, and fix rendering of StreamBlock non-field errors (selector to clear old errors was incorrect, and jest apparently doesn't support innerText).
2021-04-27 09:59:57 +01:00
jacobtoppm
53e55d28e6 Close comment menu when you click anywhere outside 2021-04-26 18:18:45 +01:00
Karl Hobley
44a3737266
Styling fixes for the "Are you sure?" prompt when deleting a comment/reply (#7101)
* Add a bit of bottom padding to "Are you sure?" buttons

* Change delete buttons from red to blue

* Right-align delete and cancel buttons

* Insert clearfix after delete/cancel buttons
2021-04-26 18:02:49 +01:00
Karl Hobley
f15699414a Put notices straight after the relevant comment/reply 2021-04-26 17:38:52 +01:00
jacobtoppm
dc95d6e22f Don't focus comments on menu click to avoid movement 2021-04-26 16:45:27 +01:00
Simon Evans
2f57a7a4e3 Fix jitter on draftail comment button icon 2021-04-26 15:55:24 +01:00
Karl Hobley
331a4f5719
Tweak comment warnings (#7102)
* Make "Are you sure?" on comment reply deletion correct size

* Update wording of warning after editing comment

* Tighten up height of comment warnings
2021-04-26 15:51:17 +01:00
Matt Westcott
6395f4bcc1 Fix BooleanBlock for telepath
Fixes #7083. Override default FieldBlock / BoundWidget behaviour so that:

* BooleanBlock.get_form_state bypasses CheckboxInput.format_value (which Django uses to determine the 'value' HTML attribute rather than the checked state)
* BoundCheckboxInput.get_state / set_state / get_value work with the 'checked' attribute rather than 'value'
2021-04-26 12:39:04 +01:00
jacobtoppm
144a7a74d4 Add decorator to CommentableEditor even when disabled, as adding after first render doesn't work 2021-04-26 12:14:01 +01:00
Simon Evans
678e117081
Feature/commenting responsive layout (#7091)
* Improve commenting layout

* Improve mobile layout

* Position comments absolutely on mobile

* Remove mobile state toggle
2021-04-26 11:53:04 +01:00
Karl Hobley
c97bc56c68
Add warning to bottom of draft comments (#7089)
* Add warning to bottom of draft comments

* Add a warning to bottom of edited comments

* Add a warning at the bottom of comments with unsaved replies

* Set role="status" on the comment notice
2021-04-23 17:53:54 +01:00
Simon Evans
05f1eb51aa
Feature/commenting improve notification toggle UI (#7085) 2021-04-23 16:24:27 +01:00
jacobtoppm
8f85d95078 Hide comments for collapsed blocks and panels 2021-04-23 15:05:58 +01:00
jacobtoppm
e09ab4e597 Move resolve action to comment menu 2021-04-23 15:05:36 +01:00
jacobtoppm
d6ff2d51ea Fix comment menu on non-IE11 2021-04-23 15:05:36 +01:00
Karl Hobley
e62103ae1c Remove field width transition when commenting is enabled/disabled 2021-04-23 13:42:43 +01:00
Jacob Topp-Mugglestone
dba3a438c0
Feature/commenting disable on snippets (#7080)
* Default to comments disabled

* Don't depend on window.comments being defined
2021-04-22 17:23:03 +01:00
Karl Hobley
d1115c463c
IE11 support for commenting (#7057)
* Polyfill URLSearchParams

* Workaround unimplemented methods for IE11

* Add a fallback for the <details>/<summary> elements
2021-04-22 15:58:08 +01:00
Karl Hobley
711a3310a7 Unfocus comment when user clicks cancel 2021-04-22 15:43:50 +01:00
jacobtoppm
333a22a274 Close the comment menu when unfocused, and focus the first menu item when opened as expected 2021-04-22 14:50:02 +01:00
jacobtoppm
97f605c14c Fix comments list height to prevent grey bar at bottom 2021-04-22 14:49:46 +01:00
Simon Evans
6c065fad8b Make comment buttons focusable 2021-04-21 14:51:31 +01:00
jacobtoppm
1ff4bdceef Alter the date format on comments to match Wagtail listings 2021-04-21 13:39:05 +01:00
Karl Hobley
dff6942a48 Improved layout of profile picture panel 2021-04-20 18:43:22 +01:00
Simon Evans
471856a52c Feature/commenting add icons (#7046)
* Update commenting icons

* Add draftail commenting icon

* Fix draftail icon hover state and update snapshot
2021-04-20 18:25:30 +01:00
Simon Evans
485a248af8 Correctly show comment icons on hover 2021-04-20 18:25:30 +01:00
jacobtoppm
d72cb62a76 Prevent logout button hiding 2021-04-20 18:25:30 +01:00
Simon Evans
1ac9a56279 Improve commenting layout 2021-04-20 18:25:30 +01:00
Karl Hobley
b49c2e498b Update z-index of comments so they render behind main menu 2021-04-20 18:25:30 +01:00
jacobtoppm
831dceaad4 Add missing footer__container class to non-editor footers, and change footer
css to use class selector instead of element
2021-04-20 18:25:30 +01:00