fix: Prevent navigation of document history in trash, closes #2995
This commit is contained in:
@@ -14,6 +14,7 @@ import Event from "~/models/Event";
|
||||
import Avatar from "~/components/Avatar";
|
||||
import Item, { Actions } from "~/components/List/Item";
|
||||
import Time from "~/components/Time";
|
||||
import useStores from "~/hooks/useStores";
|
||||
import RevisionMenu from "~/menus/RevisionMenu";
|
||||
import { documentHistoryUrl } from "~/utils/routeHelpers";
|
||||
|
||||
@@ -25,6 +26,8 @@ type Props = {
|
||||
|
||||
const EventListItem = ({ event, latest, document }: Props) => {
|
||||
const { t } = useTranslation();
|
||||
const { policies } = useStores();
|
||||
const can = policies.abilities(document.id);
|
||||
const opts = {
|
||||
userName: event.actor.name,
|
||||
};
|
||||
@@ -87,7 +90,7 @@ const EventListItem = ({ event, latest, document }: Props) => {
|
||||
<ListItem
|
||||
small
|
||||
exact
|
||||
to={to}
|
||||
to={document.isDeleted ? undefined : to}
|
||||
title={
|
||||
<Time
|
||||
dateTime={event.createdAt}
|
||||
@@ -105,7 +108,7 @@ const EventListItem = ({ event, latest, document }: Props) => {
|
||||
</Subtitle>
|
||||
}
|
||||
actions={
|
||||
isRevision && event.modelId ? (
|
||||
isRevision && event.modelId && can.update ? (
|
||||
<RevisionMenu document={document} revisionId={event.modelId} />
|
||||
) : undefined
|
||||
}
|
||||
|
||||
@@ -312,9 +312,9 @@
|
||||
"Exporting": "Exporting",
|
||||
"Export Collection": "Export Collection",
|
||||
"Collections are for grouping your documents. They work best when organized around a topic or internal team — Product or Engineering for example.": "Collections are for grouping your documents. They work best when organized around a topic or internal team — Product or Engineering for example.",
|
||||
"This is the default level of access given to team members, you can give specific users or groups more access once the collection is created.": "This is the default level of access given to team members, you can give specific users or groups more access once the collection is created.",
|
||||
"This is the default level of access, you can give individual users or groups more access once the collection is created.": "This is the default level of access, you can give individual users or groups more access once the collection is created.",
|
||||
"Public document sharing": "Public document sharing",
|
||||
"When enabled, documents can be shared publicly on the internet.": "When enabled, documents can be shared publicly on the internet.",
|
||||
"When enabled any documents within this collection can be shared publicly on the internet.": "When enabled any documents within this collection can be shared publicly on the internet.",
|
||||
"Creating": "Creating",
|
||||
"Create": "Create",
|
||||
"{{ groupName }} was added to the collection": "{{ groupName }} was added to the collection",
|
||||
@@ -350,6 +350,7 @@
|
||||
"The <em>{{ collectionName }}</em> collection is private. Team members have no access to it by default.": "The <em>{{ collectionName }}</em> collection is private. Team members have no access to it by default.",
|
||||
"Team members can view documents in the <em>{{ collectionName }}</em> collection by default.": "Team members can view documents in the <em>{{ collectionName }}</em> collection by default.",
|
||||
"Team members can view and edit documents in the <em>{{ collectionName }}</em> collection by\n default.": "Team members can view and edit documents in the <em>{{ collectionName }}</em> collection by\n default.",
|
||||
"When enabled, documents can be shared publicly on the internet.": "When enabled, documents can be shared publicly on the internet.",
|
||||
"Public sharing is currently disabled in the team security settings.": "Public sharing is currently disabled in the team security settings.",
|
||||
"Additional access": "Additional access",
|
||||
"Add groups": "Add groups",
|
||||
|
||||
Reference in New Issue
Block a user