From db90c6e88c860b987db0c21294309c438eb4cf2a Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Wed, 26 Apr 2023 14:54:41 +0600 Subject: [PATCH] TSK-1263 Fix inbox settings (#3082) Signed-off-by: Denis Bykhov --- models/recruit/src/index.ts | 2 +- models/tracker/src/index.ts | 2 +- .../NotificationGroupSetting.svelte | 60 ++++++++++--------- .../notification-resources/src/index.ts | 4 +- 4 files changed, 38 insertions(+), 30 deletions(-) diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 761c262bd9..801f4a0df9 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -1126,7 +1126,7 @@ export function createModel (builder: Builder): void { recruit.class.Applicant, recruit.ids.ApplicationNotificationGroup, [], - ['comments', 'state', 'doneState'] + ['comments', 'state', 'doneState', 'dueDate'] ) builder.createDoc( diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index a2b0f81e33..fe6990fc8b 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -1856,7 +1856,7 @@ export function createModel (builder: Builder): void { tracker.class.Issue, tracker.ids.TrackerNotificationGroup, [], - ['comments', 'status', 'priority'] + ['comments', 'status', 'priority', 'assignee', 'subIssues', 'blockedBy', 'sprint', 'dueDate'] ) createAction( diff --git a/plugins/notification-resources/src/components/NotificationGroupSetting.svelte b/plugins/notification-resources/src/components/NotificationGroupSetting.svelte index 387cbe71b4..7e60ce6e41 100644 --- a/plugins/notification-resources/src/components/NotificationGroupSetting.svelte +++ b/plugins/notification-resources/src/components/NotificationGroupSetting.svelte @@ -21,7 +21,7 @@ NotificationType } from '@hcengineering/notification' import { IntlString } from '@hcengineering/platform' - import { getClient } from '@hcengineering/presentation' + import { createQuery, getClient } from '@hcengineering/presentation' import { Grid, Label, ToggleWithLabel } from '@hcengineering/ui' import notification from '../plugin' @@ -34,11 +34,15 @@ let providers: NotificationProvider[] = [] let providersMap: IdMap = new Map() - $: load(group) + load() - async function load (group: Ref) { - types = await client.findAll(notification.class.NotificationType, { group }) + const query = createQuery() + $: query.query(notification.class.NotificationType, { group }, (res) => { + types = res typesMap = toIdMap(types) + }) + + async function load () { providers = await client.findAll(notification.class.NotificationProvider, {}) providersMap = toIdMap(providers) } @@ -100,30 +104,32 @@ } -
- - {#each types as type} -
- {#if type.generated} -
- {#each providers as provider (provider._id)} - {#if type.providers[provider._id] !== undefined} -
- -
- {:else} -
- {/if} +
+
+ + {#each types as type} +
+ {#if type.generated} +
+ {#each providers as provider (provider._id)} + {#if type.providers[provider._id] !== undefined} +
+ +
+ {:else} +
+ {/if} + {/each} {/each} - {/each} - + +