diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index c080f9aaed..3b4d49aa86 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -390,12 +390,6 @@ export class TMilestone extends TDoc implements Milestone { @Index(IndexKind.Indexed) status!: MilestoneStatus - @Prop(TypeRef(contact.class.Employee), tracker.string.ComponentLead) - lead!: Ref | null - - @Prop(ArrOf(TypeRef(contact.class.Employee)), tracker.string.Members) - members!: Ref[] - @Prop(Collection(chunter.class.Comment), chunter.string.Comments) comments!: number @@ -406,9 +400,6 @@ export class TMilestone extends TDoc implements Milestone { targetDate!: Timestamp declare space: Ref - - @Prop(TypeNumber(), tracker.string.Capacity) - capacity!: number } /** @@ -955,6 +946,10 @@ export function createModel (builder: Builder): void { presenter: tracker.component.MilestoneRefPresenter }) + builder.mixin(tracker.class.Milestone, core.class.Class, view.mixin.ObjectEditor, { + editor: tracker.component.EditMilestone + }) + builder.mixin(tracker.class.Issue, core.class.Class, setting.mixin.Editable, { value: true }) @@ -1336,9 +1331,6 @@ export function createModel (builder: Builder): void { filters: [] }) - builder.mixin(tracker.class.Milestone, core.class.Class, view.mixin.ClassFilters, { - filters: [] - }) builder.mixin(tracker.class.Milestone, core.class.Class, view.mixin.ClassFilters, { filters: ['status'], strict: true @@ -1766,11 +1758,10 @@ export function createModel (builder: Builder): void { ) const milestoneOptions: ViewOptionsModel = { - groupBy: ['lead'], + groupBy: ['status'], orderBy: [ ['modifiedOn', SortingOrder.Descending], - ['targetDate', SortingOrder.Descending], - ['capacity', SortingOrder.Ascending] + ['targetDate', SortingOrder.Descending] ], other: [] } @@ -1789,26 +1780,7 @@ export function createModel (builder: Builder): void { }, { key: '', presenter: tracker.component.MilestonePresenter, props: { shouldUseMargin: true } }, { key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } }, - { - key: '', - presenter: contact.component.MembersPresenter, - props: { - kind: 'link', - intlTitle: tracker.string.MilestoneMembersTitle, - intlSearchPh: tracker.string.MilestoneMembersSearchPlaceholder - } - }, - { key: '', presenter: tracker.component.MilestoneDatePresenter, props: { field: 'targetDate' } }, - { - key: 'lead', - presenter: tracker.component.MilestoneLeadPresenter, - props: { - _class: tracker.class.Milestone, - defaultClass: contact.class.Employee, - shouldShowLabel: false, - size: 'x-small' - } - } + { key: '', presenter: tracker.component.MilestoneDatePresenter, props: { field: 'targetDate' } } ] }, tracker.viewlet.MilestoneList @@ -1857,32 +1829,6 @@ export function createModel (builder: Builder): void { ['comments', 'status', 'priority', 'assignee', 'subIssues', 'blockedBy', 'milestone', 'dueDate'] ) - createAction( - builder, - { - action: view.actionImpl.ValueSelector, - actionPopup: view.component.ValueSelector, - actionProps: { - attribute: 'lead', - _class: contact.class.Employee, - query: {}, - placeholder: tracker.string.MilestoneLead - }, - label: tracker.string.MilestoneLead, - icon: contact.icon.Person, - keyBinding: [], - input: 'none', - category: tracker.category.Tracker, - target: tracker.class.Milestone, - context: { - mode: ['context'], - application: tracker.app.Tracker, - group: 'edit' - } - }, - tracker.action.SetMilestoneLead - ) - const componentListViewOptions: ViewOptionsModel = { groupBy: ['lead'], orderBy: [ diff --git a/models/tracker/src/plugin.ts b/models/tracker/src/plugin.ts index 1710e4a60d..bc9b4446a7 100644 --- a/models/tracker/src/plugin.ts +++ b/models/tracker/src/plugin.ts @@ -86,7 +86,6 @@ export default mergeIds(trackerId, tracker, { action: { NewRelatedIssue: '' as Ref>>, DeleteMilestone: '' as Ref>>, - DeleteProject: '' as Ref>>, - SetMilestoneLead: '' as Ref>> + DeleteProject: '' as Ref>> } }) diff --git a/plugins/tracker-assets/lang/en.json b/plugins/tracker-assets/lang/en.json index 184fd1e936..8582fff16e 100644 --- a/plugins/tracker-assets/lang/en.json +++ b/plugins/tracker-assets/lang/en.json @@ -207,11 +207,6 @@ "ClosedMilestones": "Done", "AddToMilestone": "Add to Milestone", "MilestoneNamePlaceholder": "Milestone name", - "MilestoneLead": "Lead", - "MilestoneLeadTitle": "Milestone lead", - "MilestoneLeadSearchPlaceholder": "Set milestone lead\u2026", - "MilestoneMembersTitle": "Milestone members", - "MilestoneMembersSearchPlaceholder": "Change milestone members\u2026", "NewMilestone": "New Milestone", "CreateMilestone": "Create", @@ -252,7 +247,6 @@ "TimeSpendHours": "{value}h", "ChildEstimation": "Subissues Estimation", "ChildReportedTime": "Subissues Time", - "Capacity": "Capacity", "CapacityValue": "of {value}d", "NewRelatedIssue": "New related issue", "RelatedIssuesNotFound": "Related issues not found", diff --git a/plugins/tracker-assets/lang/ru.json b/plugins/tracker-assets/lang/ru.json index fb211160c4..d10986894e 100644 --- a/plugins/tracker-assets/lang/ru.json +++ b/plugins/tracker-assets/lang/ru.json @@ -207,11 +207,6 @@ "ClosedMilestones": "Завершено", "AddToMilestone": "Добавить в Майлстоун", "MilestoneNamePlaceholder": "Название майлстоуна", - "MilestoneLead": "Руководитель", - "MilestoneLeadTitle": "Руководитель майлстоуна", - "MilestoneLeadSearchPlaceholder": "Назначьте руководителя майлстоуна\u2026", - "MilestoneMembersTitle": "Участники майлстоуна", - "MilestoneMembersSearchPlaceholder": "Измененить участников майлстоуна\u2026", "NewMilestone": "Новый Майлстоун", "CreateMilestone": "Создать", @@ -252,7 +247,6 @@ "TimeSpendHours": "{value}h", "ChildEstimation": "Оценка подзадач", "ChildReportedTime": "Время водзадач", - "Capacity": "Вместимость", "CapacityValue": "из {value}d", "NewRelatedIssue": "Завести связанную задачу", "RelatedIssuesNotFound": "Связанные задачи не найдены", diff --git a/plugins/tracker-resources/src/components/milestones/EditMilestone.svelte b/plugins/tracker-resources/src/components/milestones/EditMilestone.svelte index 675f361949..487370543c 100644 --- a/plugins/tracker-resources/src/components/milestones/EditMilestone.svelte +++ b/plugins/tracker-resources/src/components/milestones/EditMilestone.svelte @@ -1,89 +1,56 @@ + - - -
- -
-
- -
- -
- {#if milestone?.capacity} -
-
-
- -
- change('label', milestone.label)} /> -
- change('description', evt.detail)} - /> -
-
- -
-
+ { + const trimmedLabel = rawLabel.trim() + + if (trimmedLabel.length === 0) { + rawLabel = oldLabel + } else if (trimmedLabel !== object.label) { + await change('label', trimmedLabel) + } + }} +/> diff --git a/plugins/tracker-resources/src/components/milestones/MilestoneBrowser.svelte b/plugins/tracker-resources/src/components/milestones/MilestoneBrowser.svelte index c6aa9e3662..a0337a8ed9 100644 --- a/plugins/tracker-resources/src/components/milestones/MilestoneBrowser.svelte +++ b/plugins/tracker-resources/src/components/milestones/MilestoneBrowser.svelte @@ -138,7 +138,7 @@ {}} />
- +
{#if viewlet} diff --git a/plugins/tracker-resources/src/components/milestones/MilestoneContent.svelte b/plugins/tracker-resources/src/components/milestones/MilestoneContent.svelte index b5a11b1dec..655e1e0484 100644 --- a/plugins/tracker-resources/src/components/milestones/MilestoneContent.svelte +++ b/plugins/tracker-resources/src/components/milestones/MilestoneContent.svelte @@ -1,9 +1,8 @@ {#if viewlet?.$lookup?.descriptor?.component} @@ -36,7 +22,7 @@ is={viewlet.$lookup.descriptor.component} props={{ _class: tracker.class.Milestone, - config: updateConfig(viewlet.config), + config: viewlet.config, options: viewlet.options, createItemDialog, createItemLabel, diff --git a/plugins/tracker-resources/src/components/milestones/MilestoneLeadPresenter.svelte b/plugins/tracker-resources/src/components/milestones/MilestoneLeadPresenter.svelte deleted file mode 100644 index 9271b9f5f6..0000000000 --- a/plugins/tracker-resources/src/components/milestones/MilestoneLeadPresenter.svelte +++ /dev/null @@ -1,106 +0,0 @@ - - - -{#if value && presenter} - -{:else if presenter} - -{/if} diff --git a/plugins/tracker-resources/src/components/milestones/MilestonePresenter.svelte b/plugins/tracker-resources/src/components/milestones/MilestonePresenter.svelte index f8ccf47479..574001c65b 100644 --- a/plugins/tracker-resources/src/components/milestones/MilestonePresenter.svelte +++ b/plugins/tracker-resources/src/components/milestones/MilestonePresenter.svelte @@ -15,42 +15,26 @@ -{#if value} - -
+ +
{#if !inline && shouldShowAvatar} -
- +
+
{/if} {value.label}
-{/if} + diff --git a/plugins/tracker-resources/src/components/milestones/Milestones.svelte b/plugins/tracker-resources/src/components/milestones/Milestones.svelte index c69493b75c..dcf2d18287 100644 --- a/plugins/tracker-resources/src/components/milestones/Milestones.svelte +++ b/plugins/tracker-resources/src/components/milestones/Milestones.svelte @@ -15,58 +15,15 @@ -{#if milestone} - { - const loc = getCurrentResolvedLocation() - loc.path[5] = evt.detail - navigate(loc) - }} - /> -{:else} - -{/if} + diff --git a/plugins/tracker-resources/src/components/milestones/NewMilestone.svelte b/plugins/tracker-resources/src/components/milestones/NewMilestone.svelte index 404a6513d2..6da6e9606e 100644 --- a/plugins/tracker-resources/src/components/milestones/NewMilestone.svelte +++ b/plugins/tracker-resources/src/components/milestones/NewMilestone.svelte @@ -16,13 +16,12 @@ import { Data, Ref } from '@hcengineering/core' import { IntlString } from '@hcengineering/platform' import { Card, getClient, SpaceSelector } from '@hcengineering/presentation' - import { EmployeeBox, UserBoxList } from '@hcengineering/contact-resources' import { Milestone, MilestoneStatus, Project } from '@hcengineering/tracker' import ui, { DatePresenter, EditBox } from '@hcengineering/ui' + import { StyledTextArea } from '@hcengineering/text-editor' import { createEventDispatcher } from 'svelte' import tracker from '../../plugin' import MilestoneStatusSelector from './MilestoneStatusSelector.svelte' - import { StyledTextArea } from '@hcengineering/text-editor' export let space: Ref const dispatch = createEventDispatcher() @@ -32,11 +31,8 @@ label: '' as IntlString, description: '', status: MilestoneStatus.Planned, - lead: null, - members: [], comments: 0, attachments: 0, - capacity: 0, targetDate: Date.now() + 14 * 24 * 60 * 60 * 1000 } @@ -83,22 +79,6 @@ kind={'secondary'} size={'large'} /> - - import contact from '@hcengineering/contact' import { Ref, SortingOrder } from '@hcengineering/core' - import { ScrumRecord, Milestone, Project } from '@hcengineering/tracker' + import { ScrumRecord, Project, Scrum } from '@hcengineering/tracker' import { Button, Icon, IconAdd, Label, showPopup } from '@hcengineering/ui' import { ActionContext, List } from '@hcengineering/view-resources' import tracker from '../../plugin' @@ -31,7 +31,7 @@ showPopup(NewScrum, { space: currentSpace, targetElement: null }, null) } - const retrieveMembers = (s: Milestone) => s.members + const retrieveMembers = (s: Scrum) => s.members => ({ CreateIssueTemplate, Milestones, MilestonePresenter, + EditMilestone, Scrums, ScrumRecordPanel, MilestoneStatusPresenter, @@ -450,7 +451,6 @@ export default async (): Promise => ({ DeleteComponentPresenter, TimeSpendReportPopup, MilestoneDatePresenter, - MilestoneLeadPresenter, NotificationIssuePresenter, MilestoneFilter, PriorityFilterValuePresenter, diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts index df3271bfe1..6b3f649628 100644 --- a/plugins/tracker-resources/src/plugin.ts +++ b/plugins/tracker-resources/src/plugin.ts @@ -229,11 +229,6 @@ export default mergeIds(trackerId, tracker, { ActiveMilestones: '' as IntlString, ClosedMilestones: '' as IntlString, MilestoneNamePlaceholder: '' as IntlString, - MilestoneLead: '' as IntlString, - MilestoneLeadTitle: '' as IntlString, - MilestoneLeadSearchPlaceholder: '' as IntlString, - MilestoneMembersTitle: '' as IntlString, - MilestoneMembersSearchPlaceholder: '' as IntlString, NewMilestone: '' as IntlString, CreateMilestone: '' as IntlString, @@ -277,7 +272,6 @@ export default mergeIds(trackerId, tracker, { ChildEstimation: '' as IntlString, ChildReportedTime: '' as IntlString, - Capacity: '' as IntlString, CapacityValue: '' as IntlString, AddedReference: '' as IntlString, AddedAsBlocked: '' as IntlString, @@ -360,7 +354,7 @@ export default mergeIds(trackerId, tracker, { MilestoneStatusPresenter: '' as AnyComponent, MilestoneTitlePresenter: '' as AnyComponent, MilestoneDatePresenter: '' as AnyComponent, - MilestoneLeadPresenter: '' as AnyComponent, + EditMilestone: '' as AnyComponent, ReportedTimeEditor: '' as AnyComponent, TimeSpendReport: '' as AnyComponent, EstimationEditor: '' as AnyComponent, diff --git a/plugins/tracker/src/index.ts b/plugins/tracker/src/index.ts index 9dc29b43a4..948a4ec6f5 100644 --- a/plugins/tracker/src/index.ts +++ b/plugins/tracker/src/index.ts @@ -124,18 +124,12 @@ export interface Milestone extends Doc { status: MilestoneStatus - lead: Ref | null - members: Ref[] - space: Ref comments: number attachments?: number targetDate: Timestamp - - // Capacity in man days. - capacity: number } /**