mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-30 04:05:39 +00:00
TSK-1263 Fix inbox settings (#3082)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
564a361db0
commit
db90c6e88c
@ -1126,7 +1126,7 @@ export function createModel (builder: Builder): void {
|
|||||||
recruit.class.Applicant,
|
recruit.class.Applicant,
|
||||||
recruit.ids.ApplicationNotificationGroup,
|
recruit.ids.ApplicationNotificationGroup,
|
||||||
[],
|
[],
|
||||||
['comments', 'state', 'doneState']
|
['comments', 'state', 'doneState', 'dueDate']
|
||||||
)
|
)
|
||||||
|
|
||||||
builder.createDoc(
|
builder.createDoc(
|
||||||
|
@ -1856,7 +1856,7 @@ export function createModel (builder: Builder): void {
|
|||||||
tracker.class.Issue,
|
tracker.class.Issue,
|
||||||
tracker.ids.TrackerNotificationGroup,
|
tracker.ids.TrackerNotificationGroup,
|
||||||
[],
|
[],
|
||||||
['comments', 'status', 'priority']
|
['comments', 'status', 'priority', 'assignee', 'subIssues', 'blockedBy', 'sprint', 'dueDate']
|
||||||
)
|
)
|
||||||
|
|
||||||
createAction(
|
createAction(
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
NotificationType
|
NotificationType
|
||||||
} from '@hcengineering/notification'
|
} from '@hcengineering/notification'
|
||||||
import { IntlString } from '@hcengineering/platform'
|
import { IntlString } from '@hcengineering/platform'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||||
import { Grid, Label, ToggleWithLabel } from '@hcengineering/ui'
|
import { Grid, Label, ToggleWithLabel } from '@hcengineering/ui'
|
||||||
import notification from '../plugin'
|
import notification from '../plugin'
|
||||||
|
|
||||||
@ -34,11 +34,15 @@
|
|||||||
let providers: NotificationProvider[] = []
|
let providers: NotificationProvider[] = []
|
||||||
let providersMap: IdMap<NotificationProvider> = new Map()
|
let providersMap: IdMap<NotificationProvider> = new Map()
|
||||||
|
|
||||||
$: load(group)
|
load()
|
||||||
|
|
||||||
async function load (group: Ref<NotificationGroup>) {
|
const query = createQuery()
|
||||||
types = await client.findAll(notification.class.NotificationType, { group })
|
$: query.query(notification.class.NotificationType, { group }, (res) => {
|
||||||
|
types = res
|
||||||
typesMap = toIdMap(types)
|
typesMap = toIdMap(types)
|
||||||
|
})
|
||||||
|
|
||||||
|
async function load () {
|
||||||
providers = await client.findAll(notification.class.NotificationProvider, {})
|
providers = await client.findAll(notification.class.NotificationProvider, {})
|
||||||
providersMap = toIdMap(providers)
|
providersMap = toIdMap(providers)
|
||||||
}
|
}
|
||||||
@ -100,30 +104,32 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex-grow container">
|
<div class="flex-grow vScroll w-full">
|
||||||
<Grid {column} columnGap={5} rowGap={1.5}>
|
<div class="container">
|
||||||
{#each types as type}
|
<Grid {column} columnGap={5} rowGap={1.5}>
|
||||||
<div class="flex">
|
{#each types as type}
|
||||||
{#if type.generated}
|
<div class="flex">
|
||||||
<Label label={getLabel(type)} />:
|
{#if type.generated}
|
||||||
{/if}
|
<Label label={getLabel(type)} />:
|
||||||
<Label label={type.label} />
|
{/if}
|
||||||
</div>
|
<Label label={type.label} />
|
||||||
{#each providers as provider (provider._id)}
|
</div>
|
||||||
{#if type.providers[provider._id] !== undefined}
|
{#each providers as provider (provider._id)}
|
||||||
<div class="toggle">
|
{#if type.providers[provider._id] !== undefined}
|
||||||
<ToggleWithLabel
|
<div class="toggle">
|
||||||
label={provider.label}
|
<ToggleWithLabel
|
||||||
on={getStatus(settings, type._id, provider._id)}
|
label={provider.label}
|
||||||
on:change={createHandler(type._id, provider._id)}
|
on={getStatus(settings, type._id, provider._id)}
|
||||||
/>
|
on:change={createHandler(type._id, provider._id)}
|
||||||
</div>
|
/>
|
||||||
{:else}
|
</div>
|
||||||
<div />
|
{:else}
|
||||||
{/if}
|
<div />
|
||||||
|
{/if}
|
||||||
|
{/each}
|
||||||
{/each}
|
{/each}
|
||||||
{/each}
|
</Grid>
|
||||||
</Grid>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@ -787,7 +787,9 @@ export async function OnAttributeCreate (tx: Tx, control: TriggerControl): Promi
|
|||||||
const ctx = tx as TxCreateDoc<AnyAttribute>
|
const ctx = tx as TxCreateDoc<AnyAttribute>
|
||||||
if (ctx.objectClass !== core.class.Attribute) return []
|
if (ctx.objectClass !== core.class.Attribute) return []
|
||||||
const attribute = TxProcessor.createDoc2Doc(ctx)
|
const attribute = TxProcessor.createDoc2Doc(ctx)
|
||||||
const group = (await control.findAll(notification.class.NotificationGroup, { objectClass: attribute.attributeOf }))[0]
|
const group = (
|
||||||
|
await control.modelDb.findAll(notification.class.NotificationGroup, { objectClass: attribute.attributeOf })
|
||||||
|
)[0]
|
||||||
if (group === undefined) return []
|
if (group === undefined) return []
|
||||||
const isCollection: boolean = core.class.Collection === attribute.type._class
|
const isCollection: boolean = core.class.Collection === attribute.type._class
|
||||||
const objectClass = !isCollection ? attribute.attributeOf : (attribute.type as Collection<AttachedDoc>).of
|
const objectClass = !isCollection ? attribute.attributeOf : (attribute.type as Collection<AttachedDoc>).of
|
||||||
|
Loading…
Reference in New Issue
Block a user