mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-27 12:04:56 +02:00
UBERF-4248: Task type (#4042)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
-->
|
||||
<script lang="ts">
|
||||
import chunter, { getDirectChannel } from '@hcengineering/chunter'
|
||||
import { Employee, PersonAccount } from '@hcengineering/contact'
|
||||
import contact, { Employee, PersonAccount } from '@hcengineering/contact'
|
||||
import { Class, Doc, Ref, getCurrentAccount } from '@hcengineering/core'
|
||||
import { DocUpdates } from '@hcengineering/notification'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
@@ -32,7 +32,6 @@
|
||||
Separator
|
||||
} from '@hcengineering/ui'
|
||||
import view from '@hcengineering/view'
|
||||
import contact from '@hcengineering/contact'
|
||||
import { UsersPopup } from '@hcengineering/contact-resources'
|
||||
|
||||
import notification from '../plugin'
|
||||
|
||||
@@ -14,15 +14,16 @@
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Ref } from '@hcengineering/core'
|
||||
import { getResource } from '@hcengineering/platform'
|
||||
import type {
|
||||
NotificationGroup,
|
||||
NotificationPreferencesGroup,
|
||||
NotificationSetting,
|
||||
NotificationType
|
||||
} from '@hcengineering/notification'
|
||||
import { getResource } from '@hcengineering/platform'
|
||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||
import { Label, Scroller, Separator, defineSeparators, settingsSeparators } from '@hcengineering/ui'
|
||||
import { Location, Scroller, getCurrentResolvedLocation, navigate, resolvedLocationStore } from '@hcengineering/ui'
|
||||
import { onDestroy } from 'svelte'
|
||||
import notification from '../plugin'
|
||||
import GroupElement from './GroupElement.svelte'
|
||||
import NotificationGroupSetting from './NotificationGroupSetting.svelte'
|
||||
@@ -31,7 +32,7 @@
|
||||
let groups: NotificationGroup[] = []
|
||||
let preferencesGroups: NotificationPreferencesGroup[] = []
|
||||
|
||||
client.findAll(notification.class.NotificationGroup, {}).then((res) => {
|
||||
void client.findAll(notification.class.NotificationGroup, {}).then((res) => {
|
||||
groups = res
|
||||
})
|
||||
|
||||
@@ -52,7 +53,7 @@
|
||||
let group: Ref<NotificationGroup> | undefined = undefined
|
||||
let currentPreferenceGroup: NotificationPreferencesGroup | undefined = undefined
|
||||
|
||||
client.findAll(notification.class.NotificationPreferencesGroup, {}).then((res) => {
|
||||
void client.findAll(notification.class.NotificationPreferencesGroup, {}).then((res) => {
|
||||
preferencesGroups = res
|
||||
})
|
||||
|
||||
@@ -64,15 +65,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
defineSeparators('settingNotify', settingsSeparators)
|
||||
onDestroy(
|
||||
resolvedLocationStore.subscribe((loc) => {
|
||||
void (async (loc: Location): Promise<void> => {
|
||||
group = loc.path[4] as Ref<NotificationGroup>
|
||||
currentPreferenceGroup = undefined
|
||||
})(loc)
|
||||
})
|
||||
)
|
||||
</script>
|
||||
|
||||
<div class="flex h-full clear-mins">
|
||||
<div class="antiPanel-navigator">
|
||||
<div class="flex">
|
||||
<div class="antiPanel-element ml-4 mt-2">
|
||||
<div class="antiPanel-wrap__content">
|
||||
<div class="antiNav-header overflow-label">
|
||||
<Label label={notification.string.Notifications} />
|
||||
</div>
|
||||
<Scroller shrink>
|
||||
{#each preferencesGroups as preferenceGroup}
|
||||
<GroupElement
|
||||
@@ -82,6 +87,9 @@
|
||||
on:click={() => {
|
||||
currentPreferenceGroup = preferenceGroup
|
||||
group = undefined
|
||||
const loc = getCurrentResolvedLocation()
|
||||
loc.path.length = 4
|
||||
navigate(loc)
|
||||
}}
|
||||
/>
|
||||
{/each}
|
||||
@@ -96,6 +104,10 @@
|
||||
on:click={() => {
|
||||
group = gr._id
|
||||
currentPreferenceGroup = undefined
|
||||
const loc = getCurrentResolvedLocation()
|
||||
loc.path[4] = group
|
||||
loc.path.length = 5
|
||||
navigate(loc)
|
||||
}}
|
||||
/>
|
||||
{/each}
|
||||
@@ -103,8 +115,6 @@
|
||||
</Scroller>
|
||||
</div>
|
||||
</div>
|
||||
<Separator name={'settingNotify'} index={0} color={'var(--theme-navpanel-border)'} />
|
||||
|
||||
<div class="antiPanel-component filled">
|
||||
{#if group}
|
||||
<NotificationGroupSetting {group} {settings} />
|
||||
|
||||
Reference in New Issue
Block a user