mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-29 03:21:13 +00:00
Assign project when assigning sprint (#2612)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
f2ed55eefa
commit
df7667289d
@ -593,12 +593,17 @@
|
||||
object = { ...object, project: projectId }
|
||||
}
|
||||
|
||||
const handleSprintIdChanged = (sprintId: Ref<Sprint> | null | undefined) => {
|
||||
const handleSprintIdChanged = async (sprintId: Ref<Sprint> | null | undefined) => {
|
||||
if (sprintId === undefined) {
|
||||
return
|
||||
}
|
||||
let projectSprintId: Ref<Project> | null
|
||||
if (sprintId != null) {
|
||||
const sprint = await client.findOne(tracker.class.Sprint, { _id: sprintId })
|
||||
projectSprintId = sprint && sprint.project ? sprint.project : null
|
||||
} else projectSprintId = null
|
||||
|
||||
object = { ...object, sprint: sprintId }
|
||||
object = { ...object, sprint: sprintId, project: projectSprintId }
|
||||
}
|
||||
|
||||
function addTagRef (tag: TagElement): void {
|
||||
|
@ -336,6 +336,24 @@ async function doIssueUpdate (
|
||||
}))
|
||||
)
|
||||
}
|
||||
|
||||
if (Object.prototype.hasOwnProperty.call(updateTx.operations, 'sprint')) {
|
||||
if (updateTx.operations.sprint != null) {
|
||||
const [sprint] = await control.findAll(tracker.class.Sprint, { _id: updateTx.operations.sprint }, { limit: 1 })
|
||||
res.push(
|
||||
control.txFactory.createTxUpdateDoc(updateTx.objectClass, updateTx.objectSpace, updateTx.objectId, {
|
||||
project: sprint.project
|
||||
})
|
||||
)
|
||||
} else {
|
||||
res.push(
|
||||
control.txFactory.createTxUpdateDoc(updateTx.objectClass, updateTx.objectSpace, updateTx.objectId, {
|
||||
project: null
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
Object.prototype.hasOwnProperty.call(updateTx.operations, 'estimation') ||
|
||||
Object.prototype.hasOwnProperty.call(updateTx.operations, 'reportedTime')
|
||||
|
@ -104,8 +104,6 @@ test.describe('tracker layout tests', () => {
|
||||
let groupLabels: any[]
|
||||
if (group === 'Sprint') {
|
||||
groupLabels = issuesProps.map((props) => props.sprint)
|
||||
} else if (group === 'Project') {
|
||||
groupLabels = issuesProps.map((props) => props.project)
|
||||
} else {
|
||||
groupLabels = groupsLabels[group] ?? []
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user