Skip to content

Commit

Permalink
Merge pull request #104 from mitaai/stateful-rendering-of-annotations…
Browse files Browse the repository at this point in the history
…-doc-view

Stateful rendering of annotations doc view
  • Loading branch information
mbogo-mit committed Dec 18, 2020
2 parents e12f4b8 + 23963b8 commit dd942df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/AnnotationCard/AnnotationCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function AnnotationCard({
} else if (newAnnotationPermissions === 1) {
// user wants the annotation to be shared with groups
// getting the intersection between the groups that have access to this specific document and the groups that the user is in
newAnnotationData.permissions.groups = newAnnotationData.target.document.groups.filter((id) => (user.groups.includes(id)));
newAnnotationData.permissions.groups = user.groups.filter(({ id }) => (newAnnotationData.target.document.groups.includes(id)));
newAnnotationData.permissions.sharedTo = undefined;
newAnnotationData.permissions.private = false;
} else if (newAnnotationPermissions === 2) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/FilterPopover/FilterPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function FilterPopover({ session }) {
index = filterOptions.annotatedBy.findIndex((opt) => opt.email === a.creator.email);
if (index === -1) {
// if the permissions is either shared or shared with only me your own name shouldn't show in the dropdown because you can't share an annotation with your self
if (filters.permissions === 0 || user_email !== a.creator.email) {
if (filters.permissions !== 2 || user_email !== a.creator.email) {
filterOptions.annotatedBy.push({
id: a.creator.email,
name: FirstNameLastInitial(a.creator.name),
Expand Down

0 comments on commit dd942df

Please sign in to comment.