From eae0107d28f93dfbcad34e2cc6c098f2a043ce6e Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Mon, 29 May 2023 15:26:36 +0600 Subject: [PATCH] Notification hot fixes (#3276) Signed-off-by: Denis Bykhov --- models/chunter/src/index.ts | 2 +- .../notification-resources/src/components/Activity.svelte | 6 +++--- .../src/components/EmployeeInbox.svelte | 1 + plugins/notification-resources/src/components/People.svelte | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/models/chunter/src/index.ts b/models/chunter/src/index.ts index 28ba887d57..c54317f6dc 100644 --- a/models/chunter/src/index.ts +++ b/models/chunter/src/index.ts @@ -456,7 +456,7 @@ export function createModel (builder: Builder, options = { addApplication: true icon: chunter.icon.Chunter, txClass: core.class.TxCreateDoc, component: chunter.activity.TxCommentCreate, - // label: chunter.string.LeftComment, + label: chunter.string.LeftComment, display: 'content', editable: true, hideOnRemove: true diff --git a/plugins/notification-resources/src/components/Activity.svelte b/plugins/notification-resources/src/components/Activity.svelte index c346b955dd..7db752cfa5 100644 --- a/plugins/notification-resources/src/components/Activity.svelte +++ b/plugins/notification-resources/src/components/Activity.svelte @@ -53,11 +53,11 @@ function getFiltered (docs: DocUpdates[], filter: 'all' | 'read' | 'unread'): void { if (filter === 'read') { - filtered = docs.filter((p) => !p.txes.some((p) => p.isNew)) + filtered = docs.filter((p) => !p.txes.some((p) => p.isNew) && p.txes.length > 0) } else if (filter === 'unread') { - filtered = docs.filter((p) => p.txes.some((p) => p.isNew)) + filtered = docs.filter((p) => p.txes.some((p) => p.isNew) && p.txes.length > 0) } else { - filtered = docs + filtered = docs.filter((p) => p.txes.length > 0) } listProvider.update(filtered) if (loading || _id === undefined) { diff --git a/plugins/notification-resources/src/components/EmployeeInbox.svelte b/plugins/notification-resources/src/components/EmployeeInbox.svelte index 82df6678ca..11423833df 100644 --- a/plugins/notification-resources/src/components/EmployeeInbox.svelte +++ b/plugins/notification-resources/src/components/EmployeeInbox.svelte @@ -45,6 +45,7 @@ (res) => { docs = [] for (const doc of res) { + if (doc.txes.length === 0) continue const txes = doc.txes.filter((p) => p.modifiedBy === accountId) if (txes.length > 0) { docs.push({ diff --git a/plugins/notification-resources/src/components/People.svelte b/plugins/notification-resources/src/components/People.svelte index 53fca91813..a9a2477d96 100644 --- a/plugins/notification-resources/src/components/People.svelte +++ b/plugins/notification-resources/src/components/People.svelte @@ -55,6 +55,7 @@ function getFiltered (docs: DocUpdates[], filter: 'all' | 'read' | 'unread'): void { const filtered: DocUpdates[] = [] for (const doc of docs) { + if (doc.txes.length === 0) continue if (filter === 'read') { const txes = doc.txes.filter((p) => !p.isNew) if (txes.length > 0) {