@@ -4,6 +4,8 @@ import NotePopup from './NotePopup';
44import { useTranslation } from 'react-i18next' ;
55import { useSelector } from 'react-redux' ;
66import selectors from 'selectors' ;
7+ import { setAnnotationShareType } from 'helpers/annotationShareType' ;
8+ import ShareTypes from 'constants/shareTypes' ;
79
810function NotePopupContainer ( props ) {
911 const [
@@ -45,14 +47,22 @@ function NotePopupContainer(props) {
4547
4648 const handleCopy = React . useCallback ( ( ) => {
4749 const annotManager = core . getAnnotationManager ( activeDocumentViewerKey ) ;
50+ const currentUser = core . getCurrentUser ( activeDocumentViewerKey ) ;
4851 annotManager . deselectAllAnnotations ( ) ;
4952 const copiedAnnotation = annotManager . getAnnotationCopy ( annotation ) ;
53+ const applyPrivateDefaults = ( annot ) => {
54+ setAnnotationShareType ( annot , ShareTypes . NONE ) ;
55+ annot . Author = currentUser ;
56+ annot . setCustomData ( 'isCopy' , 'true' ) ;
57+ } ;
5058 if ( Array . isArray ( copiedAnnotation ) ) {
5159 copiedAnnotation . forEach ( ( copiedAnnot ) => {
60+ applyPrivateDefaults ( copiedAnnot ) ;
5261 annotManager . addAnnotation ( copiedAnnot ) ;
5362 annotManager . redrawAnnotation ( copiedAnnot ) ;
5463 } ) ;
5564 } else if ( copiedAnnotation ) {
65+ applyPrivateDefaults ( copiedAnnotation ) ;
5666 annotManager . addAnnotation ( copiedAnnotation ) ;
5767 annotManager . redrawAnnotation ( copiedAnnotation ) ;
5868 }
@@ -66,7 +76,7 @@ function NotePopupContainer(props) {
6676
6777 const isEditable = canModifyContents ;
6878 const isDeletable = canModify && ! annotation ?. NoDelete ;
69- const isCopyable = true ;
79+ const isCopyable = annotation ?. getCustomData ( 'isCopy' ) !== ' true' ;
7080
7181 const passProps = {
7282 handleEdit,
0 commit comments