fix: Drop to reorder cursor appearing where move location is invalid

This commit is contained in:
Tom Moor committed 2024-09-28 09:21:26 -04:00
1 parent 3e75b24f7a
commit fa961d7464
2 files changed
+11 -3

No files matched your search

@@ -279,11 +279,19 @@ export function useDropToReorderDocument(
>({
accept: "document",
canDrop: (item: DragObject) => {
if (item.id === node.id) {
if (item.id === node.id || !policies.abilities(item.id)?.move) {
return false;
}
return policies.abilities(item.id)?.move;
const params = getMoveParams(item);
if (params?.collectionId) {
return policies.abilities(params.collectionId)?.updateDocument;
}
if (params?.parentDocumentId) {
return policies.abilities(params.parentDocumentId)?.update;
}
return true;
},
drop: async (item) => {
if (!collection?.isManualSort && item.collectionId === collection?.id) {
+1 -1
View File
@@ -646,7 +646,7 @@
"view and edit access": "view and edit access",
"view only access": "view only access",
"no access": "no access",
"Heads up – moving the document <em>{{ title }}</em> to the <em>{{ newCollectionName }}</em> collection will grant all members of the workspace <em>{{ newPermission }}</em>, they currently have {{ prevPermission }}.": "Heads up – moving the document <em>{{ title }}</em> to the <em>{{ newCollectionName }}</em> collection will grant all members of the workspace <em>{{ newPermission }}</em>, they currently have {{ prevPermission }}.",
"Moving the document <em>{{ title }}</em> to the {{ newCollectionName }} collection will grant all members of the workspace <em>{{ newPermission }}</em>, they currently have <em>{{ prevPermission }}</em>.": "Moving the document <em>{{ title }}</em> to the {{ newCollectionName }} collection will grant all members of the workspace <em>{{ newPermission }}</em>, they currently have <em>{{ prevPermission }}</em>.",
"Moving": "Moving",
"Search documents": "Search documents",
"No documents found for your filters.": "No documents found for your filters.",