diff options
| author | Melissa Zhang <mzhang19096@gmail.com> | 2020-08-03 15:15:33 -0700 | 
|---|---|---|
| committer | Melissa Zhang <mzhang19096@gmail.com> | 2020-08-03 15:15:33 -0700 | 
| commit | e9737412cb3d60ed76c31c9571e9516518cddd77 (patch) | |
| tree | 407f4a4cbc4947d4057d317dc3a8b7369197c01d /src/client/views/DocComponent.tsx | |
| parent | 1713f5415294b996e6dbbe9ca45f0f4511c69824 (diff) | |
| parent | ef5dbc6ad8bdb70f3e68d2fc4ace1a483b031add (diff) | |
merge with master
Diffstat (limited to 'src/client/views/DocComponent.tsx')
| -rw-r--r-- | src/client/views/DocComponent.tsx | 24 | 
1 files changed, 12 insertions, 12 deletions
| diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index 4c82149e2..804c7a8d4 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -7,7 +7,7 @@ import { InteractionUtils } from '../util/InteractionUtils';  import { List } from '../../fields/List';  import { DateField } from '../../fields/DateField';  import { ScriptField } from '../../fields/ScriptField'; -import { GetEffectiveAcl, getPlaygroundMode, SharingPermissions } from '../../fields/util'; +import { GetEffectiveAcl, SharingPermissions } from '../../fields/util';  ///  DocComponent returns a generic React base class used by views that don't have 'fieldKey' props (e.g.,CollectionFreeFormDocumentView, DocumentView) @@ -150,25 +150,25 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps, T              const effectiveAcl = GetEffectiveAcl(this.dataDoc);              if (added.length) { -                if (effectiveAcl === AclPrivate || (effectiveAcl === AclReadonly && !getPlaygroundMode())) { +                if (effectiveAcl === AclPrivate || effectiveAcl === AclReadonly) {                      return false;                  }                  else { -                    if (this.props.Document[AclSym]) { -                        added.forEach(d => { -                            const dataDoc = d[DataSym]; -                            dataDoc[AclSym] = d[AclSym] = this.props.Document[AclSym]; -                            for (const [key, value] of Object.entries(this.props.Document[AclSym])) { -                                dataDoc[key] = d[key] = this.AclMap.get(value); -                            } -                        }); -                    } +                    // if (this.props.Document[AclSym]) { +                    //     added.forEach(d => { +                    //         const dataDoc = d[DataSym]; +                    //         dataDoc[AclSym] = d[AclSym] = this.props.Document[AclSym]; +                    //         for (const [key, value] of Object.entries(this.props.Document[AclSym])) { +                    //             dataDoc[key] = d[key] = this.AclMap.get(value); +                    //         } +                    //     }); +                    // }                      if (effectiveAcl === AclAddonly) {                          added.map(doc => Doc.AddDocToList(targetDataDoc, this.annotationKey, doc));                      }                      else {                          added.map(doc => doc.context = this.props.Document); -                        targetDataDoc[this.annotationKey] = new List<Doc>([...docList, ...added]); +                        (targetDataDoc[this.annotationKey] as List<Doc>).push(...added);                          targetDataDoc[this.annotationKey + "-lastModified"] = new DateField(new Date(Date.now()));                      }                  } | 
