Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
dbe8915
Implements `Prefix` on PostgreSQL.
BertrandBordage Jan 4, 2018
1b9b409
Fixes the name of indexes in migrations.
BertrandBordage Jan 4, 2018
96061ae
Add Python 2 check to `wagtail` command
gasman Mar 22, 2018
3101e7b
Add release note for #4416 on 2.1
gasman Mar 23, 2018
99aa078
Fix indentation on 2.1 release notes
gasman Mar 23, 2018
8738f62
Added a simple scale filter to image_operations.
oliver6ft Mar 23, 2018
c003aa7
Merge branch 'master' into feature/scale-filter
oliverseal Mar 23, 2018
18dd01a
Fix link to admin home (#4419)
allcaps Mar 23, 2018
53f015b
Upgrade Draftail to v0.17.1. (#4426)
thibaudcolas Mar 27, 2018
b375db5
Changelog for #4426 in 2.1.
BertrandBordage Mar 27, 2018
f92a890
Update LTS imformation
Mar 21, 2018
626418d
Ensure breadcrumb respects custom get_admin_display_title methods. Fi…
gasman Mar 22, 2018
b2ef833
allow chunk_size to be set in update_index
dibell Mar 12, 2018
86943a3
Change draftjs-exporter version range to allow all 2.x releases
thibaudcolas Mar 24, 2018
c5d21a7
Add a new hook 'register_account_menu_item' (#4421)
mvantellingen Mar 29, 2018
0fcd6d8
Improves #4421 documentation example.
BertrandBordage Mar 29, 2018
3939397
Changelog for #4421.
BertrandBordage Mar 29, 2018
5a5e6d5
Added change email functionality from the account settings. Fix #4325…
alejandrogarza Apr 2, 2018
35049c3
Add request parameter to edit handlers (#4382)
rajeev Apr 2, 2018
7841f54
ImageChooser now sets a default title based on filename. Fix #2844 (#…
allcaps Apr 2, 2018
7740d2d
Add Draftail error handling component
thibaudcolas Feb 27, 2018
1972533
Implement basic editor reloading
thibaudcolas Mar 26, 2018
04ebf07
Implement "Show error" feature for editor crash UI
thibaudcolas Mar 27, 2018
101b446
Add tests for EditorFallback
thibaudcolas Mar 27, 2018
2e74f0f
Change EditorFallback button order
thibaudcolas Mar 27, 2018
9918ee2
Fix Draftail editor fallback layout in .full fields
thibaudcolas Apr 2, 2018
411895e
Update labels to make editor reload feature more understandable
thibaudcolas Apr 2, 2018
7238f22
Improve error display cross-browsers, and add translatable string
thibaudcolas Apr 2, 2018
6bc7fbd
Release note for #4138 in 2.1
gasman Apr 4, 2018
3482b45
Release note for #4138 in 2.0.1
gasman Apr 4, 2018
8e71a59
Fill in release date for 2.0.1
gasman Apr 4, 2018
dd9bb32
Fix monospace formatting
gasman Apr 4, 2018
a9b4b09
Fix spelling mistakes in documentation
kaedroho Apr 3, 2018
a70b813
Add quotes around code
kaedroho Apr 3, 2018
bf3e994
Fix capitalisation of QuerySet
kaedroho Apr 3, 2018
f608c67
Fix capitalisation of names
kaedroho Apr 3, 2018
9ab54d0
Added more words to the spelling wordlist
kaedroho Apr 3, 2018
7242621
Reword 1.2 release note
kaedroho Apr 5, 2018
b12a7b0
Ensure order of headings features is consistent for HalloJS
Apr 4, 2018
a179d0c
Fix typos
DanielSwain Apr 5, 2018
af7cdb4
another typo fix
gasman Apr 6, 2018
8741491
Wording clarification
DanielSwain Apr 5, 2018
84a2a45
Add invalid password reset link error message
allcaps Mar 17, 2018
7837769
Release notes for #4398
Apr 6, 2018
c8cfb1e
Replace is_safe_url()'s host argument with allowed_hosts
kaedroho Apr 3, 2018
630eaad
Rename assertEquals to assertEqual
kaedroho Apr 3, 2018
967ead3
Use tool:pytest in setup.cfg to fix warning message when running pytest
mvantellingen Apr 8, 2018
5d638e3
Add pytest cache directories to gitignore
mvantellingen Apr 8, 2018
4e7ccdc
Add icon template tag with accessibility options (PoC) (#4381)
SanderTuit Apr 8, 2018
35533ad
Fix Wagtail search fails when indexing
timonweb Apr 9, 2018
e809b6a
Changelog/release note for #4458
kaedroho Apr 11, 2018
2f43c10
Wording change to have this feature appear in search results
DanielSwain Apr 5, 2018
950e77d
Wording change requested by Matthew Westcott
DanielSwain Apr 9, 2018
8c686b6
Typo
DanielSwain Apr 11, 2018
9a21060
Fix Add user button label (input->button)
benoitvogel Apr 8, 2018
3bcefe3
4412 Position modeladmin title
allcaps Mar 23, 2018
63e824f
Fixed #4423 -- Fixed background color in docs css.
sir-sigurd Mar 27, 2018
8abceeb
Allow html5lib 1.x. Fixes #4454
gasman Apr 12, 2018
8c5b1bc
Update LTS support period and Django compatibility
Apr 10, 2018
edbfba5
Allow any host in development
tomdyson Jan 11, 2018
17f7f70
Added "find" API view and ability to find pages by HTML path
kaedroho Jan 12, 2018
a977f82
isort fix
gasman Apr 13, 2018
5c9ff23
make site summary panel respect user privileges
chosak Jan 18, 2018
d1830c0
prevent users from navigating privileged pages
chosak Jan 18, 2018
e49e24f
Improve Domain Selection for Multiple Sites (#4390)
codiebeulaine Apr 16, 2018
eece165
Changelog for #4390.
BertrandBordage Apr 16, 2018
06227a1
Removes the temporary Kickstarter banner.
BertrandBordage Apr 16, 2018
63fb483
Restore ability to use non-model fields with FieldPanel
gasman Apr 11, 2018
b704a7e
Release note for #4469
gasman Apr 17, 2018
b743b87
Release note for #4469 in 2.0.x
gasman Apr 17, 2018
443503d
Fix non-model form fields being compared. Fixes #3737
gasman Apr 12, 2018
574e7ff
Release note for #4470
gasman Apr 17, 2018
c309753
Expose reusable client-side code to build Draftail extensions (#4467)
thibaudcolas Apr 17, 2018
b3fa09b
Improved 'purge_page_from_cache' to purge the url for any managed lan…
pyMan Oct 25, 2017
2bf3110
Prevents postgres_search from adding multiple index_entries managers.
BertrandBordage Apr 18, 2018
878a5be
Add `extra_footer_actions` template blocks
Speedy1991 Apr 2, 2018
ea6a994
Convert password reset to class based views
kaedroho Apr 3, 2018
8503d1c
Convert login/logout to class-based views
kaedroho Apr 3, 2018
a03c310
changes message.error to message.validation_error
Mar 15, 2018
7818edf
Use specific page objects on reorder listings with <100 items
gasman Mar 21, 2018
3bd3275
more tests for ordering pages with custom titles
chosak Apr 20, 2018
c82b683
Add a meaningful error message for invalid arguments to pageurl (#4228)
gasman Apr 20, 2018
e43ea79
Add a per-user timezone setting
linuxsoftware Apr 9, 2018
0aced66
fix isort
gasman Apr 20, 2018
1849f0d
Pass index name in URL to Bulk API
kaedroho Feb 28, 2018
5b8ca7d
first working attempt to make gravatar optional
chimeno Mar 3, 2017
ff6ca55
Move avatar tag into wagtailadmin_tags
gasman Jan 16, 2018
f81c7d6
Consistently use the gravatar 'mystery man' as fallback, regardless o…
gasman Jan 16, 2018
96118cd
Makes it possible to set a custom Gravatar source like robohash or yo…
bloodywing Jan 4, 2018
bcbfe22
Allow disabling gravatar with WAGTAIL_GRAVATAR_PROVIDER_URL=None. Fix…
gasman Jan 16, 2018
b25bf0c
Ditch user_profile.get_avatar_url and ignore avatar_choice when locat…
gasman Jan 16, 2018
ac038c3
Remove logic for deleting old avatars
gasman Jan 17, 2018
a3bf84f
Remove avatar_choice field from UserProfile
gasman Jan 17, 2018
4a93267
Remove 'clear' option from avatar upload
gasman Jan 17, 2018
70aea60
Improve layout of avatar upload page
gasman Jan 17, 2018
9d11a6b
Delete old avatar when uploading new one
gasman Apr 10, 2018
651af63
Use <button> for submit button as per https://github.com/wagtail/wagt…
gasman Apr 12, 2018
ad7bf89
Don't override MEDIA_ROOT for avatar tests
gasman Apr 23, 2018
a98f7dd
Add warning when failing to delete old avatar file
gasman Apr 23, 2018
fa27773
Release note for #4462
gasman Apr 23, 2018
d0670da
Fix minor typo in modeladmin docs (#4509)
ababic May 2, 2018
df4f120
Fix a couple of search indexing examples
kaedroho May 3, 2018
135a620
Added Elasticsearch 6 backend
kaedroho Dec 14, 2017
feeeb64
Replaced _all field with custom field
kaedroho Dec 14, 2017
24edeb3
Give all documents the same type name
kaedroho Dec 14, 2017
09c8843
Rename _partials to _edgengrams (ES6 only)
kaedroho Dec 14, 2017
0d7faef
Removed root content type name from document ids
kaedroho Dec 14, 2017
cac3a65
Travis/tox configuration for Elasticsearch 6
kaedroho Dec 14, 2017
6308e6b
Docs update for Elasticsearch 6 support
kaedroho Dec 14, 2017
ed83585
Fixed backend configration tests
kaedroho Dec 15, 2017
961a2f9
Rename Elasticsearch5SearchQuery to Elasticsearch5SearchQueryCompiler…
gasman Apr 10, 2018
01c4b3b
Fix another occurence of query -> query compiler
kaedroho May 4, 2018
7f38c47
Release note for #4132
gasman May 4, 2018
cd3b676
Fix regression in #3988 where no revision records exist - fixes #4505
gasman May 4, 2018
84328e4
Fetch new translations from Transifex
gasman May 4, 2018
b4a9097
Update translator credits
gasman May 4, 2018
4b07960
Promote Ukrainian to the list of default provided languages
gasman May 4, 2018
99275b8
Generate new source files for translation
gasman May 4, 2018
83df616
Add 2.1 to supported versions table
gasman May 4, 2018
679fdca
Version bump to 2.1rc1
gasman May 4, 2018
0dec4c8
Update supported databases in docs
kaedroho May 8, 2018
184469c
Adds another valid AudioBoom oEmbed pattern.
BertrandBordage Apr 30, 2018
10f4c0b
Changelog/release note for #4503
kaedroho May 8, 2018
0e19076
Moved changelog/release note for #4503 to version 2.2
kaedroho May 8, 2018
937254f
Add documentation for deploying with cloud storage
gasman May 8, 2018
5642d56
Merge branch 'master' into postgresql-autocomplete-api
BertrandBordage May 11, 2018
38e97a2
Adds test_incomplete_plain_text.
BertrandBordage May 11, 2018
021fbc8
Isort.
BertrandBordage May 11, 2018
6614004
Fixes tests.
BertrandBordage May 11, 2018
3898354
Test annotate_score on PostgreSQL search backend.
BertrandBordage May 11, 2018
c59da6d
Adds annotate_score support on PostgreSQL.
BertrandBordage May 11, 2018
32148b2
Changelog for #4533.
BertrandBordage May 11, 2018
601cb6c
Fixes elasticsearch tests.
BertrandBordage May 11, 2018
3eea076
Merge branch 'master' into postgresql-autocomplete-api
BertrandBordage May 11, 2018
068ab0b
Prevents a NameError.
BertrandBordage May 11, 2018
3c86267
Removes the last two uses of `None` as a search query.
BertrandBordage May 11, 2018
505c0c7
Merge branch 'master' into feature/scale-filter
oliverseal May 12, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
npm-debug.log*
*.idea/
/*.egg/
/.cache/
/.pytest_cache/

### JetBrains
.idea/
Expand Down
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,21 @@ matrix:
- env: TOXENV=py36-dj20-postgres-elasticsearch5 INSTALL_ELASTICSEARCH5=yes
python: 3.6
sudo: true
- env: TOXENV=py36-dj111-postgres-elasticsearch6 INSTALL_ELASTICSEARCH6=yes
python: 3.6
sudo: true
- env: TOXENV=py36-dj20-postgres-elasticsearch6 INSTALL_ELASTICSEARCH6=yes
python: 3.6
sudo: true
allow_failures:
# Ignore failures on Elasticsearch tests because ES on Travis is intermittently flaky
- env: TOXENV=py35-dj111-postgres-elasticsearch2 INSTALL_ELASTICSEARCH2=yes
- env: TOXENV=py36-dj111-postgres-elasticsearch2 INSTALL_ELASTICSEARCH2=yes
- env: TOXENV=py36-dj20-sqlite-elasticsearch2 INSTALL_ELASTICSEARCH2=yes
- env: TOXENV=py36-dj111-postgres-elasticsearch5 INSTALL_ELASTICSEARCH5=yes
- env: TOXENV=py36-dj20-postgres-elasticsearch5 INSTALL_ELASTICSEARCH5=yes
- env: TOXENV=py36-dj111-postgres-elasticsearch6 INSTALL_ELASTICSEARCH6=yes
- env: TOXENV=py36-dj20-postgres-elasticsearch6 INSTALL_ELASTICSEARCH6=yes

# Services
services:
Expand All @@ -66,6 +74,7 @@ install:
- pip install tox codecov
- 'if [[ -n "$INSTALL_ELASTICSEARCH2" ]]; then ./scripts/travis/install_elasticsearch2.sh; fi'
- 'if [[ -n "$INSTALL_ELASTICSEARCH5" ]]; then ./scripts/travis/install_elasticsearch5.sh; fi'
- 'if [[ -n "$INSTALL_ELASTICSEARCH6" ]]; then ./scripts/travis/install_elasticsearch6.sh; fi'

# Pre-test configuration
before_script:
Expand Down
1 change: 1 addition & 0 deletions .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,4 @@ file_filter = wagtail/contrib/table_block/locale/<lang>/LC_MESSAGES/django.po
source_file = wagtail/contrib/table_block/locale/en/LC_MESSAGES/django.po
source_lang = en
type = PO

54 changes: 50 additions & 4 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
Changelog
=========

2.2 (xx.xx.xxx) - IN DEVELOPMENT
~~~~~~~~~~~~~~~

* Added another valid AudioBoom oEmbed pattern (Bertrand Bordage)
* Added `annotate_score` support to PostgreSQL search backend (Bertrand Bordage)


2.1 (xx.xx.xxxx) - IN DEVELOPMENT
~~~~~~~~~~~~~~~~

* Add `HelpPanel` to add HTML within an edit form (Keving Chung)
* Added direct profile picture upload to account preferences (Daniel Chimeno, Pierre Geier, Matt Westcott)
* Added API endpoint for finding pages by HTML path (Karl Hobley)
* Added time zone setting to account preferences (David Moore)
* Added Elasticsearch 6 support (Karl Hobley)
* Persist tab hash in URL to allow direct navigation to tabs in the admin interface (Ben Weatherman)
* Animate the chevron icon when opening sub-menus in the admin (Carlo Ascani)
* Look through the target link and target page slug (in addition to the old slug) when searching for redirects in the admin (Michael Harrison)
Expand All @@ -13,6 +24,18 @@ Changelog
* Add JavaScript source maps in production build for packaged Wagtail (Thibaud Colas)
* Removed `assert` statements from Wagtail API (Kim Chee Leong)
* Update `jquery-datetimepicker` dependency to make Wagtail more CSP-friendly (`unsafe-eval`) (Mike Kamermans)
* Added error notification when running the `wagtail` command on Python <3.4 (Matt Westcott)
* `update_index` management command now accepts a `--chunk_size` option to determine the number of items to load at once (Dave Bell)
* Added hook `register_account_menu_item` to add new account preference items (Michael van Tellingen)
* Added change email functionality from the account settings (Alejandro Garza, Alexs Mathilda)
* Add request parameter to edit handlers (Rajeev J Sebastian)
* ImageChooser now sets a default title based on filename (Coen van der Kamp)
* Added error handling to the Draftail editor (Thibaud Colas)
* Add new `wagtail_icon` template tag to facilitate making admin icons accessible (Sander Tuit)
* Set `ALLOWED_HOSTS` in the project template to allow any host in development (Tom Dyson)
* Expose reusable client-side code to build Draftail extensions (Thibaud Colas)
* Added `WAGTAILFRONTENDCACHE_LANGUAGES` setting to specify the languages whose URLs are to be purged when using `i18n_patterns` (PyMan Claudio Marinozzi)
* Added `extra_footer_actions` template blocks for customising the add/edit page views (Arthur Holzner)
* Fix: Status button on 'edit page' now links to the correct URL when live and draft slug differ (LB (Ben Johnston))
* Fix: Image title text in the gallery and in the chooser now wraps for long filenames (LB (Ben Johnston), Luiz Boaretto)
* Fix: Move image editor action buttons to the bottom of the form on mobile (Julian Gallo)
Expand All @@ -29,11 +52,34 @@ Changelog
* Fix: Editing setting object with no site configured no longer crashes (Harm Zeinstra)
* Fix: Creating a new object with inlines while mandatory fields are empty no longer crashes (Bertrand Bordage)
* Fix: Localization of image and apps verbose names
* Fix: Draftail editor no longer crashes after deleting image/embed using DEL key (Thibaud Colas)
* Fix: Breadcrumb navigation now respects custom `get_admin_display_title` methods (Arthur Holzner, Wietze Helmantel, Matt Westcott)
* Fix: Inconsistent order of heading features when adding h1, h5 or h6 as default feature for Hallo RichText editor (Loic Teixeira)
* Fix: Add invalid password reset link error message (Coen van der Kamp)
* Fix: Bypass select/prefetch related optimisation on `update_index` for `ParentalManyToManyField` to fix crash (Tim Kamanin)
* Fix: 'Add user' is now rendered as a button due to the use of quotes within translations (Benoît Vogel)
* Fix: Menu icon no longer overlaps with title in Modeladmin on mobile (Coen van der Kamp)
* Fix: Background color overflow within the Wagtail documentation (Sergey Fedoseev)
* Fix: Page count on homepage summary panel now takes account of user permissions (Andy Chosak)
* Fix: Explorer view now prevents navigating outside of the common ancestor of the user's permissions (Andy Chosak)
* Fix: Generate URL for the current site when multiple sites share the same root page (Codie Roelf)
* Fix: Restored ability to use non-model fields with FieldPanel (Matt Westcott, LB (Ben Johnston))
* Fix: Stop revision comparison view from crashing when non-model FieldPanels are in use (LB (Ben Johnston))
* Fix: Ordering in the page explorer now respects custom `get_admin_display_title` methods when sorting <100 pages (Matt Westcott)
* Fix: Use index-specific Elasticsearch endpoints for bulk insertion, for compatibility with providers that lock down the root endpoint (Karl Hobley)


2.0.2 (xx.xx.xxxx) - IN DEVELOPMENT
~~~~~~~~~~~~~~~~~~

* Fix: Restored ability to use non-model fields with FieldPanel (Matt Westcott, LB (Ben Johnston))

2.0.1 (xx.xx.xxxx) - IN DEVELOPMENT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2.0.1 (04.04.2018)
~~~~~~~~~~~~~~~~~~

* Added error notification when running the `wagtail` command on Python <3.4 (Matt Westcott)
* Added error handling to the Draftail editor (Thibaud Colas)
* Fix: Draftail now supports features specified via the `WAGTAILADMIN_RICH_TEXT_EDITORS` setting (Todd Dembrey)
* Fix: Password reset form no longer indicates whether the email is recognised, as per standard Django behaviour (Bertrand Bordage)
* Fix: `UserAttributeSimilarityValidator` is now correctly enforced on user creation / editing forms (Tim Heap)
Expand Down Expand Up @@ -131,8 +177,8 @@ Changelog
* Fix: Prevented intermittent failures on Postgres search backend when a field is defined as both a `SearchField` and a `FilterField` (Matt Westcott)


1.13 (16.10.2017)
~~~~~~~~~~~~~~~~~
1.13 LTS (16.10.2017)
~~~~~~~~~~~~~~~~~~~~~

* Front-end cache invalidator now supports purging URLs as a batch (Karl Hobley)
* Custom document model is now documented (Emily Horsman)
Expand Down
23 changes: 17 additions & 6 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,22 @@ Contributors
* Sebastian Brestin
* Casper Timmers
* Kevin Chung
* Codie Roelf
* Kim Chee Leong
* Dan Swain
* Alexs Mathilda
* Tony Yates
* Mike Kamermans
* Arthur Holzner
* Alejandro Garza
* Rajeev J Sebastian
* Coen van der Kamp
* Sander Tuit
* Tim Kamanin
* Sergey Fedoseev
* Harm Zeinstra
* David Moore
* Pierre Geier

Translators
===========
Expand All @@ -297,15 +308,15 @@ Translators
* Bulgarian: Lyuboslav Petrov
* Catalan: Antoni Aloy, David Llop, Roger Pons
* Chinese: hanfeng, Lihan Li, Leway Colin, Orangle Liu
* Chinese (China): hanfeng, Daniel Hwang, Jian Li, Listeng Teng, Feng Wang, Fred Zeng, Joey Zhao, Vincent Zhao, zhushajun
* Chinese (China): hanfeng, Daniel Hwang, Jian Li, Listeng Teng, Feng Wang, whuim, Fred Zeng, Joey Zhao, Vincent Zhao, zhushajun
* Chinese (Taiwan): gogobook, Lihan Li, Jp Shieh
* Croatian (Croatia): Luka Matijević
* Czech: Ales Dvorak, Martin Galda, Sophy O, Ivan Pomykacz, Jiri Stepanek, Marek Turnovec, Stanislav Vasko
* Danish: Asger Sørensen
* Danish: Mads Kronborg, Asger Sørensen
* Dutch: benny_AT_it_digin.com, Bram, Brecht Dervaux, Huib Keemink, Thijs Kramer, Samuel Leeuwenburg, mahulst, Rob Moorman, Michael van Tellingen, Arne Turpyn
* Dutch (Netherlands): Bram, Kees Hink, Franklin Kingma, Maarten Kling, Thijs Kramer
* Finnish: Eetu Häivälä, Niklas Jerva, Aarni Koskela, Rauli Laine, Glen Somerville, Juha Yrjölä
* French: Adrien, Timothy Allen, Sebastien Andrivet, Bertrand Bordage, André Bouatchidzé, Aurélien Debord, Romain Dorgueil, Tom Dyson, Antonin Enfrun, Axel Haustant, Léo, Pierre Marfoure, nahuel, Dominique Peretti, Loïc Teixeira, Benoît Vogel
* French: Adrien, Timothy Allen, Sebastien Andrivet, Bertrand Bordage, André Bouatchidzé, Aurélien Debord, Romain Dorgueil, Tom Dyson, Antonin Enfrun, Axel Haustant, Léo, Pierre Marfoure, nahuel, Sophy O, Dominique Peretti, Loïc Teixeira, Benoît Vogel
* Galician: fooflare
* Georgian: André Bouatchidzé
* German: Ettore Atalan, Patrick Craston, Henrik Kröger, Tammo van Lessen, Martin Löhle, Wasilis Mandratzis-Walz, Daniel Manser, m0rph3u5, Max Pfeiffer, Moritz Pfeiffer, Herbert Poul, Karl Sander, Tobias Schmidt, Johannes Spielmann, Raphael Stolt, Jannis Vajen, Vorlif, Matthew Westcott
Expand All @@ -320,19 +331,19 @@ Translators
* Latvian: Reinis Rozenbergs, Maris Serzans
* Lithuanian: Matas Dailyda
* Mongolian: Delgermurun Purevkhuu
* Norwegian Bokmål: Eirik Krogstad, Robin Skahjem-Eriksen
* Norwegian Bokmål: Eirik Krogstad, Robin Skahjem-Eriksen, Stein Strindhaug
* Persian: Mohammad reza Jelveh, Mohammad Hossein Mojtahedi, Py Zenberg
* Polish: Konrad Lalik, Mateusz, Miłosz Miśkiewicz, Bartek Sielicki, utek, Grzegorz Wasilewski, Bartosz Wiśniewski
* Portuguese (Brazil): Claudemiro Alves Feitosa Neto, Bruno Bertoldi, Luiz Boaretto, Gladson Brito, Thiago Cangussu, Gilson Filho, Joao Garcia, João Luiz Lorencetti, Marcio Mazza, Douglas Miranda, Guilherme Nabanete
* Portuguese (Portugal): Gladson Brito, Thiago Cangussu, Tiago Henriques, Jose Lourenco, Nuno Matos, Douglas Miranda, Manuela Silva
* Romanian: Dan Braghis
* Russian: ajk, Andrey Avdey, Daniil, gsstver, Sergey Khalymon, Sergey Komarov, Arseni M, Eugene MechanisM, Rustam Mirzaev, Mikalai Radchuk, Alexandr Romantsov, Nikita Viktorovich, Vassiliy Vorobyov
* Russian: ajk, Andrey Avdey, Daniil, gsstver, Sergey Khalymon, Sergey Komarov, Arseni M, Eugene MechanisM, Rustam Mirzaev, Alexander Penshin, Mikalai Radchuk, Alexandr Romantsov, Nikita Viktorovich, Vassiliy Vorobyov
* Slovak (Slovakia): Stevo Backor, dellax, Martin Janšto, Jozef Karabelly
* Slovenian: Mitja Pagon
* Spanish: Mauricio Baeza, Daniel Chimeno, fonso, fooflare, José Luis, Joaquín Tita, Unai Zalakain
* Swedish: Andreas Bergström, Jim Brouzoulis, Alexander Holmbäck, André Karlsson, Jon Karlsson, Ludwig Kjellström, Thomas Kunambi, Andreas Lans, Hannes Lohmander
* Turkish: Zafer Cengiz, Cihad Gündoǧdu, Ragıp Ünal
* Turkish (Turkey): Saadettin Yasir Akel, Cihad Gündoǧdu, José Luis, Ragıp Ünal
* Ukrainian: Viktor Shytiuk, Mykola Zamkovoi
* Ukrainian: Sergiy Shkodenko, Viktor Shytiuk, Mykola Zamkovoi
* Vietnamese: Luan Nguyen, Nguyễn Hồng Quân
* Welsh: Adam Hughes
1 change: 1 addition & 0 deletions client/src/components/Draftail/Draftail.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ $draftail-editor-font-family: $font-serif;
@import '../../../../node_modules/draftail/lib/index';

@import './Tooltip/Tooltip';
@import './EditorFallback/EditorFallback';

@import './decorators/TooltipEntity';

Expand Down
149 changes: 149 additions & 0 deletions client/src/components/Draftail/EditorFallback/EditorFallback.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
import { convertFromRaw } from 'draft-js';

import { STRINGS } from '../../../config/wagtailConfig';

const MAX_EDITOR_RELOADS = 3;

class EditorFallback extends PureComponent {
constructor(props) {
super(props);

const { field } = props;

this.state = {
error: null,
info: null,
reloads: 0,
showContent: false,
showError: false,
initialContent: field.value,
};

this.renderError = this.renderError.bind(this);
this.toggleContent = this.toggleContent.bind(this);
this.toggleError = this.toggleError.bind(this);
this.onReloadEditor = this.onReloadEditor.bind(this);
}

componentDidCatch(error, info) {
const { field } = this.props;
const { initialContent } = this.state;

this.setState({ error, info });

field.value = initialContent;
}

onReloadEditor() {
const { reloads } = this.state;

this.setState({
error: null,
info: null,
reloads: reloads + 1,
showContent: false,
showError: false,
});
}

toggleContent() {
const { showContent } = this.state;
this.setState({ showContent: !showContent });
}

toggleError() {
const { showError } = this.state;
this.setState({ showError: !showError });
}

renderError() {
const { field } = this.props;
const { error, info, reloads, showContent, showError } = this.state;
const content =
field.rawContentState &&
convertFromRaw(field.rawContentState).getPlainText();

return (
<div className="Draftail-Editor">
<div className="Draftail-Toolbar">
{content && (
<button
type="button"
className="Draftail-ToolbarButton"
onClick={this.toggleContent}
>
{STRINGS.SHOW_LATEST_CONTENT}
</button>
)}

<button
type="button"
className="Draftail-ToolbarButton"
onClick={this.toggleError}
>
{STRINGS.SHOW_ERROR}
</button>

{/* At first we propose reloading the editor. If it still crashes, reload the whole page. */}
{reloads < MAX_EDITOR_RELOADS ? (
<button
type="button"
className="Draftail-ToolbarButton"
onClick={this.onReloadEditor}
>
{STRINGS.RELOAD_EDITOR}
</button>
) : (
<button
type="button"
className="Draftail-ToolbarButton"
onClick={() => window.location.reload(false)}
>
{STRINGS.RELOAD_PAGE}
</button>
)}
</div>

<div className="DraftEditor-root">
<div className="public-DraftEditor-content">
<div className="public-DraftEditorPlaceholder-inner">
{STRINGS.EDITOR_CRASH}

{showContent && (
<textarea
className="EditorFallback__textarea"
value={content}
readOnly
/>
)}

{showError && (
<pre className="help-block help-critical">
<code className="EditorFallback__error">
{`${error.name}: ${error.message}\n\n${error.stack}\n${info.componentStack}`}
</code>
</pre>
)}
</div>
</div>
</div>
</div>
);
}

render() {
const { children } = this.props;
const { error } = this.state;

return error ? this.renderError() : children;
}
}

EditorFallback.propTypes = {
children: PropTypes.node.isRequired,
field: PropTypes.object.isRequired,
};

export default EditorFallback;
22 changes: 22 additions & 0 deletions client/src/components/Draftail/EditorFallback/EditorFallback.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.EditorFallback__textarea {
min-height: 150px;
margin-top: 1rem;
resize: vertical;
}

// Override over-reaching styles definition for all textareas in full fields.
@mixin wagtail-textarea-overrides {
padding: 1rem;
border-width: 1px;
border-radius: 6px;
}

.EditorFallback__textarea,
.object.full .EditorFallback__textarea {
@include wagtail-textarea-overrides;
}

.EditorFallback__error {
background: none;
box-shadow: none;
}
Loading