From 7fdb585dda01d5f831b5f82eafc4f1785761d6a7 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tumanov Date: Tue, 18 Apr 2023 14:50:50 +0500 Subject: [PATCH] TSK-1158: remove component from sprint. Remove logic for changing component on sprint change (#2998) Signed-off-by: Vyacheslav Tumanov --- models/tracker/src/index.ts | 7 +- .../src/components/CreateIssue.svelte | 6 -- .../src/components/sprints/NewSprint.svelte | 12 +--- .../sprints/SprintComponentEditor.svelte | 70 ------------------- plugins/tracker-resources/src/index.ts | 2 - plugins/tracker-resources/src/plugin.ts | 1 - plugins/tracker/src/index.ts | 2 - server-plugins/tracker-resources/src/index.ts | 17 ----- 8 files changed, 2 insertions(+), 115 deletions(-) delete mode 100644 plugins/tracker-resources/src/components/sprints/SprintComponentEditor.svelte diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index 384209968c..552ee21349 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -405,10 +405,6 @@ export class TSprint extends TDoc implements Sprint { @Prop(TypeNumber(), tracker.string.Capacity) capacity!: number - - @Prop(TypeRef(tracker.class.Component), tracker.string.Component) - @Index(IndexKind.Indexed) - component!: Ref } /** @@ -1745,7 +1741,7 @@ export function createModel (builder: Builder): void { ) const sprintOptions: ViewOptionsModel = { - groupBy: ['component', 'lead'], + groupBy: ['lead'], orderBy: [ ['startDate', 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: view.component.GrowPresenter, props: { type: 'grow' } }, - { key: '', presenter: tracker.component.SprintComponentEditor, props: { kind: 'list' } }, { key: '', presenter: contact.component.MembersPresenter, diff --git a/plugins/tracker-resources/src/components/CreateIssue.svelte b/plugins/tracker-resources/src/components/CreateIssue.svelte index f9d099d22e..62e55cc4a3 100644 --- a/plugins/tracker-resources/src/components/CreateIssue.svelte +++ b/plugins/tracker-resources/src/components/CreateIssue.svelte @@ -452,14 +452,8 @@ if (sprintId === undefined) { return } - let componentSprintId: Ref | 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.component = componentSprintId } function addTagRef (tag: TagElement): void { diff --git a/plugins/tracker-resources/src/components/sprints/NewSprint.svelte b/plugins/tracker-resources/src/components/sprints/NewSprint.svelte index 1fbb995be7..5cd42fa4f1 100644 --- a/plugins/tracker-resources/src/components/sprints/NewSprint.svelte +++ b/plugins/tracker-resources/src/components/sprints/NewSprint.svelte @@ -17,11 +17,10 @@ import { IntlString } from '@hcengineering/platform' import { Card, getClient, SpaceSelector } from '@hcengineering/presentation' 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 { createEventDispatcher } from 'svelte' import tracker from '../../plugin' - import ComponentSelector from '../ComponentSelector.svelte' import SprintStatusSelector from './SprintStatusSelector.svelte' import { StyledTextArea } from '@hcengineering/text-editor' @@ -53,14 +52,6 @@ object.status = newSprintStatus } - - const handleComponentIdChanged = async (componentId: Ref | null | undefined) => { - if (componentId === undefined) { - return - } - - object.component = componentId ?? undefined - } - - - -{#if (value.component && value.component !== $activeComponent && groupBy !== 'component') || shouldShowPlaceholder} -
- -
-{/if} diff --git a/plugins/tracker-resources/src/index.ts b/plugins/tracker-resources/src/index.ts index 5a1f556a1a..b572c0d6bb 100644 --- a/plugins/tracker-resources/src/index.ts +++ b/plugins/tracker-resources/src/index.ts @@ -66,7 +66,6 @@ import NopeComponent from './components/NopeComponent.svelte' import RelationsPopup from './components/RelationsPopup.svelte' import SetDueDateActionPopup from './components/SetDueDateActionPopup.svelte' import SetParentIssueActionPopup from './components/SetParentIssueActionPopup.svelte' -import SprintComponentEditor from './components/sprints/SprintComponentEditor.svelte' import SprintDatePresenter from './components/sprints/SprintDatePresenter.svelte' import SprintLeadPresenter from './components/sprints/SprintLeadPresenter.svelte' import CreateIssueTemplate from './components/templates/CreateIssueTemplate.svelte' @@ -440,7 +439,6 @@ export default async (): Promise => ({ RelatedIssueSelector, DeleteComponentPresenter, TimeSpendReportPopup, - SprintComponentEditor, SprintDatePresenter, SprintLeadPresenter, NotificationIssuePresenter diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts index 52361eb5c9..b50b32cbf8 100644 --- a/plugins/tracker-resources/src/plugin.ts +++ b/plugins/tracker-resources/src/plugin.ts @@ -361,7 +361,6 @@ export default mergeIds(trackerId, tracker, { SprintPresenter: '' as AnyComponent, SprintStatusPresenter: '' as AnyComponent, SprintTitlePresenter: '' as AnyComponent, - SprintComponentEditor: '' as AnyComponent, SprintDatePresenter: '' as AnyComponent, SprintLeadPresenter: '' as AnyComponent, ReportedTimeEditor: '' as AnyComponent, diff --git a/plugins/tracker/src/index.ts b/plugins/tracker/src/index.ts index 488fd2f9b7..26ec017180 100644 --- a/plugins/tracker/src/index.ts +++ b/plugins/tracker/src/index.ts @@ -136,8 +136,6 @@ export interface Sprint extends Doc { // Capacity in man days. capacity: number - - component?: Ref } /** diff --git a/server-plugins/tracker-resources/src/index.ts b/server-plugins/tracker-resources/src/index.ts index 48a16d55c6..bc331e5b7c 100644 --- a/server-plugins/tracker-resources/src/index.ts +++ b/server-plugins/tracker-resources/src/index.ts @@ -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 ( Object.prototype.hasOwnProperty.call(updateTx.operations, 'estimation') || Object.prototype.hasOwnProperty.call(updateTx.operations, 'reportedTime')