Add notifications for document and collection access (#6460)
* Add notification for added to document * Add notifications for document and collection access * Add notification delay * fix: Collection notifications not appearing * Add notification settings
This commit is contained in:
@@ -231,7 +231,17 @@ class Collection extends ParanoidModel<
|
||||
|
||||
// getters
|
||||
|
||||
/**
|
||||
* The frontend path to this collection.
|
||||
*
|
||||
* @deprecated Use `path` instead.
|
||||
*/
|
||||
get url(): string {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
/** The frontend path to this collection. */
|
||||
get path(): string {
|
||||
if (!this.name) {
|
||||
return `/collection/untitled-${this.urlId}`;
|
||||
}
|
||||
|
||||
@@ -310,6 +310,11 @@ class Document extends ParanoidModel<
|
||||
* @deprecated Use `path` instead.
|
||||
*/
|
||||
get url() {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
/** The frontend path to this document. */
|
||||
get path() {
|
||||
if (!this.title) {
|
||||
return `/doc/untitled-${this.urlId}`;
|
||||
}
|
||||
@@ -317,11 +322,6 @@ class Document extends ParanoidModel<
|
||||
return `/doc/${slugifiedTitle}-${this.urlId}`;
|
||||
}
|
||||
|
||||
/** The frontend path to this document. */
|
||||
get path() {
|
||||
return this.url;
|
||||
}
|
||||
|
||||
get tasks() {
|
||||
return getTasks(this.text || "");
|
||||
}
|
||||
|
||||
@@ -137,6 +137,8 @@ class Event extends IdModel<
|
||||
"collections.delete",
|
||||
"collections.move",
|
||||
"collections.permission_changed",
|
||||
"collections.add_user",
|
||||
"collections.remove_user",
|
||||
"documents.publish",
|
||||
"documents.unpublish",
|
||||
"documents.archive",
|
||||
|
||||
@@ -72,12 +72,15 @@ import Fix from "./decorators/Fix";
|
||||
include: [
|
||||
{
|
||||
association: "document",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
association: "comment",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
association: "actor",
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
}))
|
||||
@@ -181,7 +184,9 @@ class Notification extends Model<
|
||||
userId: model.userId,
|
||||
modelId: model.id,
|
||||
teamId: model.teamId,
|
||||
commentId: model.commentId,
|
||||
documentId: model.documentId,
|
||||
collectionId: model.collectionId,
|
||||
actorId: model.actorId,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user