Added user permission events to document history
This commit is contained in:
@@ -86,6 +86,18 @@ const EventListItem = ({ event, latest, document, ...rest }: Props) => {
|
|||||||
icon = <TrashIcon size={16} />;
|
icon = <TrashIcon size={16} />;
|
||||||
meta = t("{{userName}} deleted", opts);
|
meta = t("{{userName}} deleted", opts);
|
||||||
break;
|
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":
|
case "documents.restore":
|
||||||
meta = t("{{userName}} moved from trash", opts);
|
meta = t("{{userName}} moved from trash", opts);
|
||||||
|
|||||||
@@ -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
|
// If the heading is different to any previous heading then we
|
||||||
// should render it, otherwise the item can go under the previous
|
// should render it, otherwise the item can go under the previous
|
||||||
// heading
|
// heading
|
||||||
if (!previousHeading || currentHeading !== previousHeading) {
|
if (
|
||||||
|
children &&
|
||||||
|
(!previousHeading || currentHeading !== previousHeading)
|
||||||
|
) {
|
||||||
previousHeading = currentHeading;
|
previousHeading = currentHeading;
|
||||||
return (
|
return (
|
||||||
<React.Fragment key={item.id}>
|
<React.Fragment key={item.id}>
|
||||||
|
|||||||
@@ -11,19 +11,22 @@ class Event extends Model {
|
|||||||
|
|
||||||
modelId: string | null | undefined;
|
modelId: string | null | undefined;
|
||||||
|
|
||||||
actorId: string;
|
|
||||||
|
|
||||||
actorIpAddress: string | null | undefined;
|
actorIpAddress: string | null | undefined;
|
||||||
|
|
||||||
documentId: string;
|
documentId: string;
|
||||||
|
|
||||||
collectionId: string | null | undefined;
|
collectionId: string | null | undefined;
|
||||||
|
|
||||||
|
@Relation(() => User)
|
||||||
|
user: User;
|
||||||
|
|
||||||
userId: string;
|
userId: string;
|
||||||
|
|
||||||
@Relation(() => User)
|
@Relation(() => User)
|
||||||
actor: User;
|
actor: User;
|
||||||
|
|
||||||
|
actorId: string;
|
||||||
|
|
||||||
data: {
|
data: {
|
||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export default function presentEvent(event: Event, isAdmin = false) {
|
|||||||
id: event.id,
|
id: event.id,
|
||||||
name: event.name,
|
name: event.name,
|
||||||
modelId: event.modelId,
|
modelId: event.modelId,
|
||||||
|
userId: event.userId,
|
||||||
actorId: event.actorId,
|
actorId: event.actorId,
|
||||||
actorIpAddress: event.ip || undefined,
|
actorIpAddress: event.ip || undefined,
|
||||||
collectionId: event.collectionId,
|
collectionId: event.collectionId,
|
||||||
|
|||||||
@@ -204,6 +204,8 @@
|
|||||||
"{{userName}} archived": "{{userName}} archived",
|
"{{userName}} archived": "{{userName}} archived",
|
||||||
"{{userName}} restored": "{{userName}} restored",
|
"{{userName}} restored": "{{userName}} restored",
|
||||||
"{{userName}} deleted": "{{userName}} deleted",
|
"{{userName}} deleted": "{{userName}} deleted",
|
||||||
|
"{{userName}} added {{addedUserName}}": "{{userName}} added {{addedUserName}}",
|
||||||
|
"{{userName}} removed {{removedUserName}}": "{{userName}} removed {{removedUserName}}",
|
||||||
"{{userName}} moved from trash": "{{userName}} moved from trash",
|
"{{userName}} moved from trash": "{{userName}} moved from trash",
|
||||||
"{{userName}} published": "{{userName}} published",
|
"{{userName}} published": "{{userName}} published",
|
||||||
"{{userName}} unpublished": "{{userName}} unpublished",
|
"{{userName}} unpublished": "{{userName}} unpublished",
|
||||||
|
|||||||
Reference in New Issue
Block a user