Allow drafts to be created without requiring a collection (#4175)
* feat(server): allow document to be created without collectionId * fix(server): policies for a draft doc without collection * fix(app): hide share button for drafts * feat(server): permissions around publishing a draft * fix(server): return drafts without collection * fix(server): handle draft deletion * fix(server): show drafts in deleted docs * fix(server): allow drafts without collection to be restored * feat(server): return drafts in search results * fix: use buildDraftDocument for drafts * fix: remove isDraftWithoutCollection * fix: do not return drafts for team * fix: put invariants * fix: query clause * fix: check only for undefined * fix: restore includeDrafts clause as it was before
This commit is contained in:
@@ -10,8 +10,8 @@ type Action = {
|
||||
|
||||
function present(
|
||||
document: Document,
|
||||
collection: Collection,
|
||||
team: Team,
|
||||
collection?: Collection | null,
|
||||
context?: string,
|
||||
actions?: Action[]
|
||||
) {
|
||||
@@ -22,10 +22,10 @@ function present(
|
||||
: document.getSummary();
|
||||
|
||||
return {
|
||||
color: collection.color,
|
||||
color: collection?.color,
|
||||
title: document.title,
|
||||
title_link: `${team.url}${document.url}`,
|
||||
footer: collection.name,
|
||||
footer: collection?.name,
|
||||
callback_id: document.id,
|
||||
text,
|
||||
ts: document.getTimestamp(),
|
||||
|
||||
Reference in New Issue
Block a user