mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 16:56:07 +00:00
TSK-1158: remove component from sprint. Remove logic for changing component on sprint change (#2998)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
8a45bd0e2f
commit
7fdb585dda
@ -405,10 +405,6 @@ export class TSprint extends TDoc implements Sprint {
|
|||||||
|
|
||||||
@Prop(TypeNumber(), tracker.string.Capacity)
|
@Prop(TypeNumber(), tracker.string.Capacity)
|
||||||
capacity!: number
|
capacity!: number
|
||||||
|
|
||||||
@Prop(TypeRef(tracker.class.Component), tracker.string.Component)
|
|
||||||
@Index(IndexKind.Indexed)
|
|
||||||
component!: Ref<Component>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1745,7 +1741,7 @@ export function createModel (builder: Builder): void {
|
|||||||
)
|
)
|
||||||
|
|
||||||
const sprintOptions: ViewOptionsModel = {
|
const sprintOptions: ViewOptionsModel = {
|
||||||
groupBy: ['component', 'lead'],
|
groupBy: ['lead'],
|
||||||
orderBy: [
|
orderBy: [
|
||||||
['startDate', SortingOrder.Descending],
|
['startDate', SortingOrder.Descending],
|
||||||
['modifiedOn', SortingOrder.Descending],
|
['modifiedOn', SortingOrder.Descending],
|
||||||
@ -1770,7 +1766,6 @@ export function createModel (builder: Builder): void {
|
|||||||
},
|
},
|
||||||
{ key: '', presenter: tracker.component.SprintPresenter, props: { shouldUseMargin: true } },
|
{ key: '', presenter: tracker.component.SprintPresenter, props: { shouldUseMargin: true } },
|
||||||
{ key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } },
|
{ key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } },
|
||||||
{ key: '', presenter: tracker.component.SprintComponentEditor, props: { kind: 'list' } },
|
|
||||||
{
|
{
|
||||||
key: '',
|
key: '',
|
||||||
presenter: contact.component.MembersPresenter,
|
presenter: contact.component.MembersPresenter,
|
||||||
|
@ -452,14 +452,8 @@
|
|||||||
if (sprintId === undefined) {
|
if (sprintId === undefined) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let componentSprintId: Ref<ComponentType> | null
|
|
||||||
if (sprintId != null) {
|
|
||||||
const sprint = await client.findOne(tracker.class.Sprint, { _id: sprintId })
|
|
||||||
componentSprintId = sprint && sprint.component ? sprint.component : null
|
|
||||||
} else componentSprintId = null
|
|
||||||
|
|
||||||
object.sprint = sprintId
|
object.sprint = sprintId
|
||||||
object.component = componentSprintId
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addTagRef (tag: TagElement): void {
|
function addTagRef (tag: TagElement): void {
|
||||||
|
@ -17,11 +17,10 @@
|
|||||||
import { IntlString } from '@hcengineering/platform'
|
import { IntlString } from '@hcengineering/platform'
|
||||||
import { Card, getClient, SpaceSelector } from '@hcengineering/presentation'
|
import { Card, getClient, SpaceSelector } from '@hcengineering/presentation'
|
||||||
import { EmployeeBox, UserBoxList } from '@hcengineering/contact-resources'
|
import { EmployeeBox, UserBoxList } from '@hcengineering/contact-resources'
|
||||||
import { Component, Sprint, SprintStatus, Project } from '@hcengineering/tracker'
|
import { Sprint, SprintStatus, Project } from '@hcengineering/tracker'
|
||||||
import ui, { DatePresenter, EditBox } from '@hcengineering/ui'
|
import ui, { DatePresenter, EditBox } from '@hcengineering/ui'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import tracker from '../../plugin'
|
import tracker from '../../plugin'
|
||||||
import ComponentSelector from '../ComponentSelector.svelte'
|
|
||||||
import SprintStatusSelector from './SprintStatusSelector.svelte'
|
import SprintStatusSelector from './SprintStatusSelector.svelte'
|
||||||
import { StyledTextArea } from '@hcengineering/text-editor'
|
import { StyledTextArea } from '@hcengineering/text-editor'
|
||||||
|
|
||||||
@ -53,14 +52,6 @@
|
|||||||
|
|
||||||
object.status = newSprintStatus
|
object.status = newSprintStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleComponentIdChanged = async (componentId: Ref<Component> | null | undefined) => {
|
|
||||||
if (componentId === undefined) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
object.component = componentId ?? undefined
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Card
|
<Card
|
||||||
@ -82,7 +73,6 @@
|
|||||||
/>
|
/>
|
||||||
<svelte:fragment slot="pool">
|
<svelte:fragment slot="pool">
|
||||||
<SprintStatusSelector selectedSprintStatus={object.status} onSprintStatusChange={handleComponentStatusChanged} />
|
<SprintStatusSelector selectedSprintStatus={object.status} onSprintStatusChange={handleComponentStatusChanged} />
|
||||||
<ComponentSelector value={object.component} onChange={handleComponentIdChanged} isEditable={true} />
|
|
||||||
<EmployeeBox
|
<EmployeeBox
|
||||||
label={tracker.string.SprintLead}
|
label={tracker.string.SprintLead}
|
||||||
placeholder={tracker.string.AssignTo}
|
placeholder={tracker.string.AssignTo}
|
||||||
|
@ -1,70 +0,0 @@
|
|||||||
<!--
|
|
||||||
// Copyright © 2022 Hardcore Engineering Inc.
|
|
||||||
//
|
|
||||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License. You may
|
|
||||||
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
//
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
-->
|
|
||||||
<script lang="ts">
|
|
||||||
import { Ref } from '@hcengineering/core'
|
|
||||||
import { Sprint, Component } from '@hcengineering/tracker'
|
|
||||||
import { getClient } from '@hcengineering/presentation'
|
|
||||||
import { ButtonKind, ButtonShape, ButtonSize, tooltip } from '@hcengineering/ui'
|
|
||||||
import { IntlString } from '@hcengineering/platform'
|
|
||||||
import tracker from '../../plugin'
|
|
||||||
import ComponentSelector from '../ComponentSelector.svelte'
|
|
||||||
import { activeComponent } from '../../issues'
|
|
||||||
|
|
||||||
export let value: Sprint
|
|
||||||
export let isEditable: boolean = true
|
|
||||||
export let shouldShowLabel: boolean = true
|
|
||||||
export let popupPlaceholder: IntlString = tracker.string.MoveToComponent
|
|
||||||
export let shouldShowPlaceholder = true
|
|
||||||
export let kind: ButtonKind = 'link'
|
|
||||||
export let size: ButtonSize = 'large'
|
|
||||||
export let shape: ButtonShape = undefined
|
|
||||||
export let justify: 'left' | 'center' = 'left'
|
|
||||||
export let width: string | undefined = '100%'
|
|
||||||
export let onlyIcon: boolean = false
|
|
||||||
export let groupBy: string | undefined = undefined
|
|
||||||
export let enlargedText = false
|
|
||||||
|
|
||||||
const client = getClient()
|
|
||||||
|
|
||||||
const handleComponentIdChanged = async (newComponentId: Ref<Component> | null | undefined) => {
|
|
||||||
if (!isEditable || newComponentId === undefined || value.component === newComponentId) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
await client.update(value, { component: newComponentId ?? undefined })
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if (value.component && value.component !== $activeComponent && groupBy !== 'component') || shouldShowPlaceholder}
|
|
||||||
<div
|
|
||||||
class="clear-mins"
|
|
||||||
use:tooltip={{ label: value.component ? tracker.string.MoveToComponent : tracker.string.AddToComponent }}
|
|
||||||
>
|
|
||||||
<ComponentSelector
|
|
||||||
{kind}
|
|
||||||
{size}
|
|
||||||
{shape}
|
|
||||||
{width}
|
|
||||||
{justify}
|
|
||||||
{isEditable}
|
|
||||||
{shouldShowLabel}
|
|
||||||
{popupPlaceholder}
|
|
||||||
{onlyIcon}
|
|
||||||
{enlargedText}
|
|
||||||
value={value.component}
|
|
||||||
onChange={handleComponentIdChanged}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
@ -66,7 +66,6 @@ import NopeComponent from './components/NopeComponent.svelte'
|
|||||||
import RelationsPopup from './components/RelationsPopup.svelte'
|
import RelationsPopup from './components/RelationsPopup.svelte'
|
||||||
import SetDueDateActionPopup from './components/SetDueDateActionPopup.svelte'
|
import SetDueDateActionPopup from './components/SetDueDateActionPopup.svelte'
|
||||||
import SetParentIssueActionPopup from './components/SetParentIssueActionPopup.svelte'
|
import SetParentIssueActionPopup from './components/SetParentIssueActionPopup.svelte'
|
||||||
import SprintComponentEditor from './components/sprints/SprintComponentEditor.svelte'
|
|
||||||
import SprintDatePresenter from './components/sprints/SprintDatePresenter.svelte'
|
import SprintDatePresenter from './components/sprints/SprintDatePresenter.svelte'
|
||||||
import SprintLeadPresenter from './components/sprints/SprintLeadPresenter.svelte'
|
import SprintLeadPresenter from './components/sprints/SprintLeadPresenter.svelte'
|
||||||
import CreateIssueTemplate from './components/templates/CreateIssueTemplate.svelte'
|
import CreateIssueTemplate from './components/templates/CreateIssueTemplate.svelte'
|
||||||
@ -440,7 +439,6 @@ export default async (): Promise<Resources> => ({
|
|||||||
RelatedIssueSelector,
|
RelatedIssueSelector,
|
||||||
DeleteComponentPresenter,
|
DeleteComponentPresenter,
|
||||||
TimeSpendReportPopup,
|
TimeSpendReportPopup,
|
||||||
SprintComponentEditor,
|
|
||||||
SprintDatePresenter,
|
SprintDatePresenter,
|
||||||
SprintLeadPresenter,
|
SprintLeadPresenter,
|
||||||
NotificationIssuePresenter
|
NotificationIssuePresenter
|
||||||
|
@ -361,7 +361,6 @@ export default mergeIds(trackerId, tracker, {
|
|||||||
SprintPresenter: '' as AnyComponent,
|
SprintPresenter: '' as AnyComponent,
|
||||||
SprintStatusPresenter: '' as AnyComponent,
|
SprintStatusPresenter: '' as AnyComponent,
|
||||||
SprintTitlePresenter: '' as AnyComponent,
|
SprintTitlePresenter: '' as AnyComponent,
|
||||||
SprintComponentEditor: '' as AnyComponent,
|
|
||||||
SprintDatePresenter: '' as AnyComponent,
|
SprintDatePresenter: '' as AnyComponent,
|
||||||
SprintLeadPresenter: '' as AnyComponent,
|
SprintLeadPresenter: '' as AnyComponent,
|
||||||
ReportedTimeEditor: '' as AnyComponent,
|
ReportedTimeEditor: '' as AnyComponent,
|
||||||
|
@ -136,8 +136,6 @@ export interface Sprint extends Doc {
|
|||||||
|
|
||||||
// Capacity in man days.
|
// Capacity in man days.
|
||||||
capacity: number
|
capacity: number
|
||||||
|
|
||||||
component?: Ref<Component>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -325,23 +325,6 @@ 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, {
|
|
||||||
component: sprint.component
|
|
||||||
})
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
res.push(
|
|
||||||
control.txFactory.createTxUpdateDoc(updateTx.objectClass, updateTx.objectSpace, updateTx.objectId, {
|
|
||||||
component: null
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
Object.prototype.hasOwnProperty.call(updateTx.operations, 'estimation') ||
|
Object.prototype.hasOwnProperty.call(updateTx.operations, 'estimation') ||
|
||||||
Object.prototype.hasOwnProperty.call(updateTx.operations, 'reportedTime')
|
Object.prototype.hasOwnProperty.call(updateTx.operations, 'reportedTime')
|
||||||
|
Loading…
Reference in New Issue
Block a user