diff --git a/app/components/Sharing/SharePopover.tsx b/app/components/Sharing/SharePopover.tsx index b738bea99b..39c0531e6a 100644 --- a/app/components/Sharing/SharePopover.tsx +++ b/app/components/Sharing/SharePopover.tsx @@ -112,19 +112,7 @@ function SharePopover({ - {document.isDraft ? ( - } - title={document.createdBy.name} - actions={ - - {t("Can edit")} - - } - border={false} - small - /> - ) : collection ? ( + {collection ? ( <> {collection.permission ? ( )} - ) : null} + ) : ( + } + title={document.createdBy.name} + actions={ + + {t("Can edit")} + + } + border={false} + small + /> + )} {team.sharing && visible && ( diff --git a/app/models/UserMembership.ts b/app/models/UserMembership.ts index 318bbaee11..d470a59165 100644 --- a/app/models/UserMembership.ts +++ b/app/models/UserMembership.ts @@ -25,13 +25,20 @@ class UserMembership extends Model { @Relation(() => Document, { onDelete: "cascade" }) document: Document; - /** The user ID of user who is a member */ + /** The ID of the user who is a member */ userId: string; /** The user who is a member */ @Relation(() => User, { onDelete: "cascade" }) user: User; + /** The user that created this membership */ + @Relation(() => User, { onDelete: "null" }) + createdBy: User; + + /** The ID of the user that created this membership */ + createdById: string; + store: UserMembershipsStore; /** diff --git a/server/presenters/documentMembership.ts b/server/presenters/documentMembership.ts index 0454acdbd4..61f06410b5 100644 --- a/server/presenters/documentMembership.ts +++ b/server/presenters/documentMembership.ts @@ -17,6 +17,7 @@ export default function presentDocumentMembership( userId: membership.userId, documentId: membership.documentId, permission: membership.permission, + createdById: membership.createdById, index: membership.index, }; } diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 43bc0c6ec6..fd69f76475 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -260,10 +260,10 @@ "Custom link": "Custom link", "Copy public link": "Copy public link", "People with access": "People with access", - "Creator of this draft": "Creator of this draft", "Everyone at {{ name }}": "Everyone at {{ name }}", "Can view": "Can view", "Collection members": "Collection members", + "Created the document": "Created the document", "Public access": "Public access", "Access inherited from collection": "Access inherited from collection", "Logo": "Logo",