feat-dev(wip): files table view (#2100)

This commit is contained in:
Aman Harwara
2022-12-20 19:01:24 +05:30
committed by GitHub
parent 343c39e873
commit c94035c1d6
23 changed files with 800 additions and 93 deletions

View File

@@ -1,5 +1,5 @@
import { WebApplication } from '@/Application/Application'
import { PopoverFileItemActionType } from '@/Components/AttachedFilesPopover/PopoverFileItemAction'
import { FileItemActionType } from '@/Components/AttachedFilesPopover/PopoverFileItemAction'
import { NoteViewController } from '@/Components/NoteView/Controller/NoteViewController'
import { AppPaneId } from '@/Components/Panes/AppPaneMetadata'
import { PrefDefaults } from '@/Constants/PrefDefaults'
@@ -153,7 +153,7 @@ export class LinkingController extends AbstractViewController {
}
} else if (item instanceof FileItem) {
await this.filesController.handleFileAction({
type: PopoverFileItemActionType.PreviewFile,
type: FileItemActionType.PreviewFile,
payload: {
file: item,
otherFiles: [],
@@ -164,6 +164,12 @@ export class LinkingController extends AbstractViewController {
return undefined
}
unlinkItems = async (item: LinkableItem, itemToUnlink: LinkableItem) => {
await this.application.items.unlinkItems(item, itemToUnlink)
void this.application.sync.sync()
}
unlinkItemFromSelectedItem = async (itemToUnlink: LinkableItem) => {
const selectedItem = this.selectionController.firstSelectedItem
@@ -171,9 +177,7 @@ export class LinkingController extends AbstractViewController {
return
}
await this.application.items.unlinkItems(selectedItem, itemToUnlink)
void this.application.sync.sync()
void this.unlinkItems(selectedItem, itemToUnlink)
}
ensureActiveItemIsInserted = async () => {