Added user permission events to document history

This commit is contained in:
Tom Moor
2024-02-23 22:44:39 -05:00
parent 99cdef2ad4
commit 12d1c66473
5 changed files with 24 additions and 3 deletions

View File

@@ -86,6 +86,18 @@ const EventListItem = ({ event, latest, document, ...rest }: Props) => {
icon = <TrashIcon size={16} />;
meta = t("{{userName}} deleted", opts);
break;
case "documents.add_user":
meta = t("{{userName}} added {{addedUserName}}", {
...opts,
addedUserName: event.user?.name ?? t("a user"),
});
break;
case "documents.remove_user":
meta = t("{{userName}} removed {{removedUserName}}", {
...opts,
removedUserName: event.user?.name ?? t("a user"),
});
break;
case "documents.restore":
meta = t("{{userName}} moved from trash", opts);

View File

@@ -218,7 +218,10 @@ class PaginatedList<T extends PaginatedItem> extends React.Component<Props<T>> {
// If the heading is different to any previous heading then we
// should render it, otherwise the item can go under the previous
// heading
if (!previousHeading || currentHeading !== previousHeading) {
if (
children &&
(!previousHeading || currentHeading !== previousHeading)
) {
previousHeading = currentHeading;
return (
<React.Fragment key={item.id}>