refactor(dev-only): show file link row action in table view
This commit is contained in:
@@ -259,26 +259,14 @@ const FilesTableView = ({ application, filesController, featuresController, link
|
|||||||
setContextMenuFile(file)
|
setContextMenuFile(file)
|
||||||
},
|
},
|
||||||
rowActions: (file) => {
|
rowActions: (file) => {
|
||||||
const links = [
|
|
||||||
...naturalSort(application.items.referencesForItem(file), 'title').map((item) =>
|
|
||||||
createLinkFromItem(item, 'linked'),
|
|
||||||
),
|
|
||||||
...naturalSort(application.items.itemsReferencingItem(file), 'title').map((item) =>
|
|
||||||
createLinkFromItem(item, 'linked-by'),
|
|
||||||
),
|
|
||||||
...application.items.getSortedTagsForItem(file).map((item) => createLinkFromItem(item, 'linked')),
|
|
||||||
]
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
{links.length > 0 && (
|
<FileLinksCell
|
||||||
<FileLinksCell
|
file={file}
|
||||||
file={file}
|
filesController={filesController}
|
||||||
filesController={filesController}
|
featuresController={featuresController}
|
||||||
featuresController={featuresController}
|
linkingController={linkingController}
|
||||||
linkingController={linkingController}
|
/>
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<ContextMenuCell files={[file]} filesController={filesController} />
|
<ContextMenuCell files={[file]} filesController={filesController} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user