mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 00:37:47 +00:00
tsk-328 Avoid issue relations backreferences (#2303)
Signed-off-by: Denis Bunakalya <denis.bunakalya@xored.com>
This commit is contained in:
parent
52e8fa405e
commit
71c3fce9e7
@ -47,7 +47,7 @@
|
|||||||
import view from '@hcengineering/view'
|
import view from '@hcengineering/view'
|
||||||
import { ObjectBox } from '@hcengineering/view-resources'
|
import { ObjectBox } from '@hcengineering/view-resources'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import { activeProject, activeSprint } from '../issues'
|
import { activeProject, activeSprint, updateIssueRelation } from '../issues'
|
||||||
import tracker from '../plugin'
|
import tracker from '../plugin'
|
||||||
import AssigneeEditor from './issues/AssigneeEditor.svelte'
|
import AssigneeEditor from './issues/AssigneeEditor.svelte'
|
||||||
import ParentIssue from './issues/ParentIssue.svelte'
|
import ParentIssue from './issues/ParentIssue.svelte'
|
||||||
@ -318,11 +318,15 @@
|
|||||||
}
|
}
|
||||||
await descriptionBox.createAttachments()
|
await descriptionBox.createAttachments()
|
||||||
|
|
||||||
const update = await getResource(chunter.backreference.Update)
|
|
||||||
if (relatedTo !== undefined) {
|
if (relatedTo !== undefined) {
|
||||||
const doc = await client.findOne(tracker.class.Issue, { _id: objectId })
|
const doc = await client.findOne(tracker.class.Issue, { _id: objectId })
|
||||||
if (doc !== undefined) {
|
if (doc !== undefined) {
|
||||||
await update(doc, 'relations', [relatedTo], tracker.string.AddedReference)
|
if (client.getHierarchy().isDerived(relatedTo._class, tracker.class.Issue)) {
|
||||||
|
await updateIssueRelation(client, relatedTo as Issue, doc, 'relations', '$push')
|
||||||
|
} else {
|
||||||
|
const update = await getResource(chunter.backreference.Update)
|
||||||
|
await update(doc, 'relations', [relatedTo], tracker.string.AddedReference)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const subIssue of subIssues) {
|
for (const subIssue of subIssues) {
|
||||||
|
@ -36,8 +36,12 @@
|
|||||||
if (type !== 'isBlocking') {
|
if (type !== 'isBlocking') {
|
||||||
await updateIssueRelation(client, value, refDocument, prop, operation)
|
await updateIssueRelation(client, value, refDocument, prop, operation)
|
||||||
}
|
}
|
||||||
if (type !== 'blockedBy' && client.getHierarchy().isDerived(refDocument._class, tracker.class.Issue)) {
|
if (client.getHierarchy().isDerived(refDocument._class, tracker.class.Issue)) {
|
||||||
await updateIssueRelation(client, refDocument as unknown as Issue, value, prop, operation)
|
if (type !== 'blockedBy') {
|
||||||
|
await updateIssueRelation(client, refDocument as Issue, value, prop, operation)
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
}
|
}
|
||||||
const update = await getResource(chunter.backreference.Update)
|
const update = await getResource(chunter.backreference.Update)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user