Commit bfde29ff authored by chris's avatar chris

pass user to props

parent d24196e6
......@@ -94,6 +94,11 @@ const renderImage = file => {
});
};
const user = {
userId: "1234",
username: "demo"
};
const text = `<ul><li>sl jlkf jlfkjdf</li><li>sl jlkf jlfkjdf</li></ul><h1>this is a title</h1><p class="paragraph" data-track="[{&quot;type&quot;:&quot;block_change&quot;,&quot;user&quot;:&quot;editor.user.id&quot;,&quot;username&quot;:&quot;editor.user.username&quot;,&quot;date&quot;:26069447,&quot;before&quot;:{&quot;type&quot;:&quot;author&quot;,&quot;attrs&quot;:{&quot;class&quot;:&quot;author&quot;}}}]">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p><p class="author">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>`;
class Editoria extends Component {
......@@ -111,6 +116,7 @@ class Editoria extends Component {
debug
TrackChange
value={text}
user={user}
>
{({ editor, view, ...props }) => (
<React.Fragment>
......
......@@ -83,7 +83,8 @@ class Wax extends Component {
layout,
theme,
debug,
TrackChange
TrackChange,
user
} = this.props;
const defaultRender = ({ editor, state, dispatch, fileUpload }) => (
......@@ -107,6 +108,7 @@ class Wax extends Component {
onChange={this.onChange || (value => true)}
debug={debug}
TrackChange={TrackChange}
user={user}
>
{WaxRender}
</WaxView>
......
......@@ -205,7 +205,7 @@ const trackedTransaction = (tr, state, editor) => {
) {
return tr;
}
const user = "editor.user.id",
const user = editor.props.user.userId,
approved = false,
// !editor.view.state.doc.firstChild.attrs.tracked &&
// editor.docInfo.access_rights !== "write-tracked",
......@@ -214,7 +214,7 @@ const trackedTransaction = (tr, state, editor) => {
exactDate = Date.now(),
date10 = Math.floor(exactDate / 600000) * 10, // 10 minute interval
date1 = Math.floor(exactDate / 60000), // 1 minute interval
username = "editor.user.username",
username = editor.props.user.username,
// We only insert content if this is not directly a tr for cell deletion. This is because tables delete rows by deleting the
// contents of each cell and replacing it with an empty paragraph.
cellDeleteTr =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment