Skip to content

Commit

Permalink
Fix snippet chooser modal callbacks
Browse files Browse the repository at this point in the history
See #759
  • Loading branch information
zerolab committed Apr 3, 2024
1 parent 087a811 commit ff486d2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.8.2] - 2024-05-05
## [1.8.3] - 2024-04-03

### Fixed

- Fixed snippet chooser modals

## [1.8.2] - 2024-03-05

### Fixed

Expand Down Expand Up @@ -315,6 +321,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Make sure field level validation runs when translating snippets](https://github.com/wagtail/wagtail-localize/pull/427)

[unreleased]: https://github.com/wagtail/wagtail-localize/compare/v1.8.2...HEAD
[1.8.3]: https://github.com/wagtail/wagtail-localize/compare/v1.8.2...v1.8.3
[1.8.2]: https://github.com/wagtail/wagtail-localize/compare/v1.8.1...v1.8.2
[1.8.1]: https://github.com/wagtail/wagtail-localize/compare/v1.8...v1.8.1
[1.8]: https://github.com/wagtail/wagtail-localize/compare/v1.7...v1.8
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wagtail-localize-admin",
"version": "1.8.2",
"version": "1.8.3",
"description": "",
"main": "src/main.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion wagtail_localize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@


# release must be one of alpha, beta, rc, or final
VERSION = (1, 8, 2, "final", 1)
VERSION = (1, 8, 3, "final", 1)

__version__ = get_version(VERSION)
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,11 @@ const EditorSynchronisedValueSegment: FunctionComponent<
const onClickChangeSnippet = () => {
(window as any).ModalWorkflow({
url: widget.chooser_url,
onload: (window as any).SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS,
onload:
(window as any).SNIPPET_CHOOSER_MODAL_ONLOAD_HANDLERS ||
new (
window as any
).ChooserModalOnloadHandlerFactory().getOnLoadHandlers(),
responses: {
snippetChosen: function (snippetData: any) {
saveOverride(
Expand All @@ -745,6 +749,14 @@ const EditorSynchronisedValueSegment: FunctionComponent<
dispatch
);
},
chosen: function (snippetData: any) {
saveOverride(
segment,
snippetData.id,
csrfToken,
dispatch
);
},
},
});
};
Expand Down

0 comments on commit ff486d2

Please sign in to comment.