-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apps/documents: adjust to new ckeditor5
- Loading branch information
Showing
10 changed files
with
164 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
import React from 'react' | ||
import { createRoot } from 'react-dom/client' | ||
import DocumentManagement from './DocumentManagement' | ||
import { widget as ReactWidget } from 'adhocracy4' | ||
|
||
function init () { | ||
ReactWidget.initialise('mb', 'document-management', | ||
function (el) { | ||
const chapters = JSON.parse(el.dataset.chapters) | ||
const module = el.dataset.module | ||
const config = JSON.parse(el.dataset.config) | ||
|
||
// used getAttribute as returns string that can be parsed as json | ||
const reloadOnSuccess = JSON.parse(el.getAttribute('data-reloadOnSuccess')) | ||
import DocumentManagement from './DocumentManagement' | ||
|
||
const root = createRoot(el) | ||
root.render( | ||
<React.StrictMode> | ||
<DocumentManagement | ||
key={module} | ||
module={module} | ||
chapters={chapters} | ||
config={config} | ||
reloadOnSuccess={reloadOnSuccess} | ||
/> | ||
</React.StrictMode> | ||
) | ||
} | ||
) | ||
function init () { | ||
ReactWidget.initialise('mb', 'document-management', (el) => { | ||
const props = JSON.parse(el.dataset.attributes) | ||
const root = createRoot(el) | ||
root.render( | ||
<React.StrictMode> | ||
<DocumentManagement {...props} /> | ||
</React.StrictMode> | ||
) | ||
}) | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', init, false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
apps/documents/templates/a4_candy_documents/react_documents.html
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.