(core) Allow docs to be permanently deleted in icon view

Summary:
Previously, soft-deleted docs in icon view were still accessible from
the Trash and couldn't be permanently deleted.

Test Plan:
Improved the nbrowser test for deleting docs to verify that it can
be done in both view modes.

Reviewers: dsagal, paulfitz

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2862
This commit is contained in:
George Gevoian
2021-06-14 09:54:47 -07:00
parent 30bbb6fa94
commit 3af6dd46ea
3 changed files with 28 additions and 17 deletions

View File

@@ -200,7 +200,7 @@ function buildWorkspaceDocBlock(home: HomeModel, workspace: Workspace, flashDocI
return dom.forEach(docs, doc => {
if (view === 'icons') {
return dom.update(
buildPinnedDoc(home, doc),
buildPinnedDoc(home, doc, workspace),
testId('doc'),
);
}
@@ -347,7 +347,7 @@ export function makeDocOptionsMenu(home: HomeModel, doc: Document, renaming: Obs
];
}
function makeRemovedDocOptionsMenu(home: HomeModel, doc: Document, workspace: Workspace) {
export function makeRemovedDocOptionsMenu(home: HomeModel, doc: Document, workspace: Workspace) {
function hardDeleteDoc() {
confirmModal(`Permanently Delete "${doc.name}"?`, 'Delete Forever',
() => home.deleteDoc(doc.id, true).catch(reportError),