diff --git a/wax-prosemirror-core/src/utilities/track-changes/helpers/markDeletion.js b/wax-prosemirror-core/src/utilities/track-changes/helpers/markDeletion.js index 8c0781266891da2e2bf669500eae95b6dc7cc515..8b4dce4c8ac1a5e8edc4cef349a7052f9614a894 100644 --- a/wax-prosemirror-core/src/utilities/track-changes/helpers/markDeletion.js +++ b/wax-prosemirror-core/src/utilities/track-changes/helpers/markDeletion.js @@ -1,5 +1,7 @@ +/* eslint-disable prefer-object-spread */ /* eslint-disable consistent-return */ import { Selection, TextSelection } from 'prosemirror-state'; +import { v4 as uuidv4 } from 'uuid'; import { Slice } from 'prosemirror-model'; import { ReplaceStep, Mapping } from 'prosemirror-transform'; import removeNode from './removeNode'; @@ -97,13 +99,19 @@ const markDeletion = (tr, from, to, user, date, group, viewId) => { user: user.userId, username: user.username, style: `color: ${user.userColor.deletion};`, - - // date + date, + group, + viewid: viewId, }); tr.setNodeMarkup( deletionMap.map(pos), null, - Object.assign(node.attrs.track, { track }), + Object.assign({}, node.attrs, { + track, + group, + id: uuidv4(), + }), + // Object.assign(node.attrs.track, { track }), node.marks, ); } diff --git a/wax-prosemirror-core/src/utilities/track-changes/helpers/markInsertion.js b/wax-prosemirror-core/src/utilities/track-changes/helpers/markInsertion.js index 21ff69f48ff5207c291bcec18a33b9be2d11f7e3..de12bcf111d471410a6ab62f05143c78e2d9d828 100644 --- a/wax-prosemirror-core/src/utilities/track-changes/helpers/markInsertion.js +++ b/wax-prosemirror-core/src/utilities/track-changes/helpers/markInsertion.js @@ -1,3 +1,4 @@ +/* eslint-disable no-else-return */ import { v4 as uuidv4 } from 'uuid'; const markInsertion = (tr, from, to, user, date, group, viewId) => { @@ -39,6 +40,7 @@ const markInsertion = (tr, from, to, user, date, group, viewId) => { tr.setNodeMarkup( pos, null, + // eslint-disable-next-line prefer-object-spread Object.assign({}, node.attrs, { track, group,