diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-07-27 15:20:17 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-07-27 15:20:17 -0400 |
commit | 686643f04a5ebfc8abdf1836212c5997ee61db74 (patch) | |
tree | 31dc38b7902f841e6c1cfa3d9dd4f19a898c19aa /src/client/util/DocumentManager.ts | |
parent | 7bdc4799c2546de168cc74d536463d898673afc6 (diff) | |
parent | bc19fd4221c1bd06135c894e5ed2edcfdb61b0be (diff) |
Merge branch 'master' into data-visualization-sarah
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r-- | src/client/util/DocumentManager.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts index b921b3116..8e4e0d8f3 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -1,10 +1,11 @@ import { action, computed, observable, ObservableSet } from 'mobx'; -import { Doc, Opt } from '../../fields/Doc'; -import { Animation } from '../../fields/DocSymbols'; +import { Doc, DocListCast, Opt } from '../../fields/Doc'; +import { AclAdmin, AclEdit, Animation } from '../../fields/DocSymbols'; import { Id } from '../../fields/FieldSymbols'; import { listSpec } from '../../fields/Schema'; import { Cast, DocCast, StrCast } from '../../fields/Types'; import { AudioField } from '../../fields/URLField'; +import { GetEffectiveAcl } from '../../fields/util'; import { CollectionViewType } from '../documents/DocumentTypes'; import { CollectionDockingView } from '../views/collections/CollectionDockingView'; import { TabDocView } from '../views/collections/TabDocView'; @@ -344,6 +345,9 @@ export function DocFocusOrOpen(doc: Doc, options: DocFocusOptions = { willZoomCe }); } }; + if (Doc.IsDataProto(doc) && DocListCast(doc.proto_embeddings).some(embed => embed.hidden && [AclAdmin, AclEdit].includes(GetEffectiveAcl(embed)))) { + doc = DocListCast(doc.proto_embeddings).find(embed => embed.hidden && [AclAdmin, AclEdit].includes(GetEffectiveAcl(embed)))!; + } if (doc.hidden) { doc.hidden = false; options.toggleTarget = false; |