diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index c5a2eb44de..c0fc049918 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -58,7 +58,6 @@ import tags, { TagElement } from '@hcengineering/tags' import task from '@hcengineering/task' import { Component, - ComponentStatus, Issue, IssueChildInfo, IssueParentInfo, @@ -108,13 +107,6 @@ export function TypeIssuePriority (): Type { @Model(tracker.class.TypeIssuePriority, core.class.Type, DOMAIN_MODEL) export class TTypeIssuePriority extends TType {} -/** - * @public - */ -export function TypeComponentStatus (): Type { - return { _class: tracker.class.TypeComponentStatus, label: 'TypeComponentStatus' as IntlString } -} - /** * @public */ @@ -122,12 +114,6 @@ export function TypeMilestoneStatus (): Type { return { _class: tracker.class.TypeMilestoneStatus, label: 'TypeMilestoneStatus' as IntlString } } -/** - * @public - */ -@Model(tracker.class.TypeComponentStatus, core.class.Type, DOMAIN_MODEL) -export class TTypeComponentStatus extends TType {} - /** * @public */ @@ -345,27 +331,15 @@ export class TComponent extends TDoc implements Component { @Prop(TypeMarkup(), tracker.string.Description) description?: Markup - @Prop(TypeComponentStatus(), tracker.string.Status) - status!: ComponentStatus - @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 @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) attachments?: number - @Prop(TypeDate(DateRangeMode.DATETIME), tracker.string.StartDate) - startDate!: Timestamp | null - - @Prop(TypeDate(DateRangeMode.DATETIME), tracker.string.TargetDate) - targetDate!: Timestamp | null - declare space: Ref } @@ -466,7 +440,6 @@ export function createModel (builder: Builder): void { TIssueTemplate, TIssueStatus, TTypeIssuePriority, - TTypeComponentStatus, TMilestone, TScrum, TScrumRecord, @@ -930,6 +903,10 @@ export function createModel (builder: Builder): void { presenter: tracker.component.PriorityRefPresenter }) + builder.mixin(tracker.class.Component, core.class.Class, view.mixin.ObjectEditor, { + editor: tracker.component.EditComponent + }) + builder.mixin(tracker.class.Component, core.class.Class, view.mixin.ObjectPresenter, { presenter: tracker.component.ComponentPresenter }) @@ -969,10 +946,6 @@ export function createModel (builder: Builder): void { value: true }) - builder.mixin(tracker.class.TypeComponentStatus, core.class.Class, view.mixin.AttributeEditor, { - inlineEditor: tracker.component.ComponentStatusEditor - }) - builder.mixin(tracker.class.TypeIssuePriority, core.class.Class, view.mixin.AllValuesFunc, { func: tracker.function.GetAllPriority }) @@ -1496,6 +1469,8 @@ export function createModel (builder: Builder): void { attribute: 'component', _class: tracker.class.Component, query: {}, + fillQuery: { space: 'space' }, + docMatches: ['space'], searchField: 'label', placeholder: tracker.string.Component }, @@ -1848,7 +1823,6 @@ export function createModel (builder: Builder): void { const componentListViewOptions: ViewOptionsModel = { groupBy: ['lead'], orderBy: [ - ['startDate', SortingOrder.Descending], ['modifiedOn', SortingOrder.Descending], ['createOn', SortingOrder.Descending] ], @@ -1863,29 +1837,12 @@ export function createModel (builder: Builder): void { descriptor: view.viewlet.List, viewOptions: componentListViewOptions, config: [ - { key: '', presenter: tracker.component.ComponentStatusPresenter, props: { kind: 'list', size: 'small' } }, { key: '', presenter: tracker.component.ComponentPresenter, props: { kind: 'list' } }, { key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } }, - { - key: '', - presenter: contact.component.MembersPresenter, - props: { - kind: 'list', - size: 'small', - intlTitle: tracker.string.ComponentMembersTitle, - intlSearchPh: tracker.string.ComponentMembersSearchPlaceholder, - listProps: { optional: true, compression: true } - } - }, - { - key: '', - presenter: tracker.component.TargetDatePresenter, - props: { listProps: { optional: true, compression: true } } - }, { key: '', presenter: view.component.DividerPresenter, props: { type: 'divider' } }, { key: '$lookup.lead', @@ -1901,62 +1858,4 @@ export function createModel (builder: Builder): void { }, tracker.viewlet.ComponentList ) - - builder.createDoc( - view.class.ViewletDescriptor, - core.space.Model, - { - label: view.string.Timeline, - icon: view.icon.Timeline, - component: tracker.component.ComponentsTimeline - }, - tracker.viewlet.Timeline - ) - - const componentTimelineViewOptions: ViewOptionsModel = { - groupBy: [], - orderBy: [ - ['startDate', SortingOrder.Descending], - ['modifiedOn', SortingOrder.Descending], - ['createOn', SortingOrder.Descending] - ], - other: [], - groupDepth: 1 - } - - builder.createDoc( - view.class.Viewlet, - core.space.Model, - { - attachTo: tracker.class.Component, - descriptor: tracker.viewlet.Timeline, - viewOptions: componentTimelineViewOptions, - config: [ - { key: '', presenter: tracker.component.IconPresenter }, - { - key: '', - presenter: tracker.component.ComponentPresenter, - props: { kind: 'list', shouldShowAvatar: false } - }, - { - key: '$lookup.lead', - presenter: tracker.component.LeadPresenter, - props: { _class: tracker.class.Component, defaultClass: contact.class.Employee, shouldShowLabel: false } - }, - { - key: '', - presenter: contact.component.MembersPresenter, - props: { - kind: 'link', - intlTitle: tracker.string.ComponentMembersTitle, - intlSearchPh: tracker.string.ComponentMembersSearchPlaceholder - } - }, - { key: '', presenter: tracker.component.TargetDatePresenter }, - { key: '', presenter: tracker.component.ComponentStatusPresenter, props: { width: 'min-content' } }, - { key: '', presenter: tracker.component.DeleteComponentPresenter } - ] - }, - tracker.viewlet.ComponentsTimeline - ) } diff --git a/models/tracker/src/plugin.ts b/models/tracker/src/plugin.ts index bc9b4446a7..b5376103ae 100644 --- a/models/tracker/src/plugin.ts +++ b/models/tracker/src/plugin.ts @@ -63,8 +63,7 @@ export default mergeIds(trackerId, tracker, { IssueTemplateList: '' as Ref, IssueKanban: '' as Ref, MilestoneList: '' as Ref, - ComponentList: '' as Ref, - ComponentsTimeline: '' as Ref + ComponentList: '' as Ref }, ids: { TxIssueCreated: '' as Ref, diff --git a/plugins/tracker-assets/lang/en.json b/plugins/tracker-assets/lang/en.json index 4aec71bdfe..6b4ef54a23 100644 --- a/plugins/tracker-assets/lang/en.json +++ b/plugins/tracker-assets/lang/en.json @@ -29,7 +29,6 @@ "CreateComponent": "Create component", "ComponentNamePlaceholder": "Component name", "ComponentDescriptionPlaceholder": "Description (optional)", - "ComponentStatusPlaceholder": "Change component status...", "ComponentLead": "Lead", "ComponentMembers": "Members", "StartDate": "Start date", diff --git a/plugins/tracker-assets/lang/ru.json b/plugins/tracker-assets/lang/ru.json index 025a021ebe..dd6b9126df 100644 --- a/plugins/tracker-assets/lang/ru.json +++ b/plugins/tracker-assets/lang/ru.json @@ -29,7 +29,6 @@ "CreateComponent": "Создать компонент", "ComponentNamePlaceholder": "Название компонента", "ComponentDescriptionPlaceholder": "Описание (необязательно)", - "ComponentStatusPlaceholder": "Сменить статус компонента...", "ComponentLead": "Руководитель", "ComponentMembers": "Участники", "StartDate": "Дата начала", diff --git a/plugins/tracker-assets/src/index.ts b/plugins/tracker-assets/src/index.ts index 423e88d744..c31b85ef8e 100644 --- a/plugins/tracker-assets/src/index.ts +++ b/plugins/tracker-assets/src/index.ts @@ -54,14 +54,6 @@ loadMetadata(tracker.icon, { PriorityLow: `${icons}#priority-low`, ComponentsList: `${icons}#list`, - ComponentsTimeline: `${icons}#timeline`, - - ComponentStatusBacklog: `${icons}#component-status-backlog`, - ComponentStatusPlanned: `${icons}#component-status-planned`, - ComponentStatusInProgress: `${icons}#component-status-in-progress`, - ComponentStatusPaused: `${icons}#component-status-paused`, - ComponentStatusCompleted: `${icons}#component-status-completed`, - ComponentStatusCanceled: `${icons}#component-status-canceled`, MilestoneStatusPlanned: `${icons}#component-status-planned`, MilestoneStatusInProgress: `${icons}#component-status-in-progress`, @@ -72,9 +64,7 @@ loadMetadata(tracker.icon, { CopyBranch: `${icons}#copyBranch`, Duplicate: `${icons}#duplicate`, TimeReport: `${icons}#timeReport`, - Estimation: `${icons}#estimation`, - - Timeline: `${icons}#timeline` + Estimation: `${icons}#estimation` }) addStringsLoader(trackerId, async (lang: string) => await import(`../lang/${lang}.json`)) diff --git a/plugins/tracker-resources/src/components/components/ComponentBrowser.svelte b/plugins/tracker-resources/src/components/components/ComponentBrowser.svelte index 5a5c80e1da..0056c61352 100644 --- a/plugins/tracker-resources/src/components/components/ComponentBrowser.svelte +++ b/plugins/tracker-resources/src/components/components/ComponentBrowser.svelte @@ -28,18 +28,9 @@ ViewletSettingButton, FilterBar } from '@hcengineering/view-resources' - import { - Button, - IconAdd, - Label, - SearchEdit, - TabItem, - TabList, - resolvedLocationStore, - showPopup - } from '@hcengineering/ui' + import { Button, IconAdd, Label, SearchEdit, TabList, resolvedLocationStore, showPopup } from '@hcengineering/ui' import { onDestroy } from 'svelte' - import { ComponentsFilterMode, componentsTitleMap, getIncludedComponentStatuses } from '../../utils' + import { ComponentsFilterMode, componentsTitleMap } from '../../utils' import tracker from '../../plugin' import ComponentsContent from './ComponentsContent.svelte' import NewComponent from './NewComponent.svelte' @@ -53,20 +44,12 @@ const viewletQuery = createQuery() const space = typeof query.space === 'string' ? query.space : tracker.project.DefaultProject - const filterModeList: TabItem[] = [ - { id: 'all', labelIntl: tracker.string.AllComponents, action: () => handleFilterModeChanged('all') }, - { id: 'backlog', labelIntl: tracker.string.BacklogComponents, action: () => handleFilterModeChanged('backlog') }, - { id: 'active', labelIntl: tracker.string.ActiveComponents, action: () => handleFilterModeChanged('active') }, - { id: 'closed', labelIntl: tracker.string.ClosedComponents, action: () => handleFilterModeChanged('closed') } - ] - let viewlet: WithLookup | undefined let viewlets: WithLookup[] | undefined let viewletKey = makeViewletKey() let searchQuery: DocumentQuery = { ...query } let resultQuery: DocumentQuery = { ...searchQuery } - let includedComponentsQuery: DocumentQuery let asideFloat = false let asideShown = true @@ -74,19 +57,11 @@ let docWidth: number let docSize = false - function handleFilterModeChanged (newMode: ComponentsFilterMode) { - if (newMode !== filterMode) { - filterMode = newMode - } - } - function showCreateDialog () { showPopup(NewComponent, { space, targetElement: null }, 'top') } $: title = componentsTitleMap[filterMode] - $: includedComponentStatuses = getIncludedComponentStatuses(filterMode) - $: includedComponentsQuery = { status: { $in: includedComponentStatuses } } $: searchQuery = search === '' ? { ...query } : { ...query, $search: search } $: resultQuery = { ...searchQuery } @@ -146,9 +121,6 @@ {/if} -
- detail?.action?.()} /> -
{#if viewlet} - + {/if} {#if $$slots.aside !== undefined && asideShown}
diff --git a/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte b/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte index be94c1b068..2771c6c3c9 100644 --- a/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte +++ b/plugins/tracker-resources/src/components/components/ComponentPresenter.svelte @@ -15,42 +15,31 @@ {#if value} - -
- {#if !inline && shouldShowAvatar} -
- -
- {/if} - - {value.label} + + + {#if !inline && shouldShowAvatar} +
+ +
+ {/if} + + {value.label} +
-
+ {/if} diff --git a/plugins/tracker-resources/src/components/components/ComponentStatusEditor.svelte b/plugins/tracker-resources/src/components/components/ComponentStatusEditor.svelte deleted file mode 100644 index 634b0f7c84..0000000000 --- a/plugins/tracker-resources/src/components/components/ComponentStatusEditor.svelte +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/plugins/tracker-resources/src/components/components/ComponentStatusPresenter.svelte b/plugins/tracker-resources/src/components/components/ComponentStatusPresenter.svelte deleted file mode 100644 index e21310e676..0000000000 --- a/plugins/tracker-resources/src/components/components/ComponentStatusPresenter.svelte +++ /dev/null @@ -1,54 +0,0 @@ - - - -{#if value} - -{/if} diff --git a/plugins/tracker-resources/src/components/components/ComponentStatusSelector.svelte b/plugins/tracker-resources/src/components/components/ComponentStatusSelector.svelte deleted file mode 100644 index 9fe1f3d6ca..0000000000 --- a/plugins/tracker-resources/src/components/components/ComponentStatusSelector.svelte +++ /dev/null @@ -1,83 +0,0 @@ - - - -{#if kind === 'list'} - -
- -
-{:else} - - - -
- change('label', component.label)} /> -
- change('description', evt.detail)} - /> -
-
- -
- + { + const trimmedLabel = rawLabel.trim() + + if (trimmedLabel.length === 0) { + rawLabel = oldLabel + } else if (trimmedLabel !== object.label) { + change('label', trimmedLabel) + } + }} +/> diff --git a/plugins/tracker-resources/src/components/components/NewComponent.svelte b/plugins/tracker-resources/src/components/components/NewComponent.svelte index f7bca5ac6f..dd2776d109 100644 --- a/plugins/tracker-resources/src/components/components/NewComponent.svelte +++ b/plugins/tracker-resources/src/components/components/NewComponent.svelte @@ -16,12 +16,11 @@ 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 { Component, ComponentStatus, Project } from '@hcengineering/tracker' - import { DatePresenter, EditBox } from '@hcengineering/ui' + import { EmployeeBox } from '@hcengineering/contact-resources' + import { Component, Project } from '@hcengineering/tracker' + import { EditBox } from '@hcengineering/ui' import { createEventDispatcher } from 'svelte' import tracker from '../../plugin' - import ComponentStatusSelector from './ComponentStatusSelector.svelte' import { StyledTextArea } from '@hcengineering/text-editor' export let space: Ref @@ -31,26 +30,14 @@ const object: Data = { label: '' as IntlString, description: '', - status: ComponentStatus.Backlog, lead: null, - members: [], comments: 0, - attachments: 0, - startDate: null, - targetDate: null + attachments: 0 } async function onSave () { await client.createDoc(tracker.class.Component, space, object) } - - const handleComponentStatusChanged = (newComponentStatus: ComponentStatus | undefined) => { - if (newComponentStatus === undefined) { - return - } - - object.status = newComponentStatus - } - - - - - diff --git a/plugins/tracker-resources/src/components/components/TargetDatePresenter.svelte b/plugins/tracker-resources/src/components/components/TargetDatePresenter.svelte deleted file mode 100644 index d0d7022dff..0000000000 --- a/plugins/tracker-resources/src/components/components/TargetDatePresenter.svelte +++ /dev/null @@ -1,32 +0,0 @@ - - - - diff --git a/plugins/tracker-resources/src/components/components/Timeline.svelte b/plugins/tracker-resources/src/components/components/Timeline.svelte deleted file mode 100644 index c71c1a6a69..0000000000 --- a/plugins/tracker-resources/src/components/components/Timeline.svelte +++ /dev/null @@ -1,490 +0,0 @@ - - - -{#if components && itemModels && lines} - { - if (ev.detail !== undefined && components !== undefined) handleRowFocused(components[ev.detail]) - }} - on:check={(ev) => { - if (ev.detail !== undefined && components !== undefined) { - onObjectChecked([components[ev.detail.row]], ev.detail.value) - } - }} - > - - {#each itemModels as attributeModel, attributeModelIndex} - {#if attributeModelIndex === 0} -
-
- -
-
- {:else if attributeModelIndex === 1} -
- -
-
- {:else} -
- -
- {/if} - {/each} - - -{:else if loadingProps !== undefined} - {#each Array(getLoadingElementsLength(loadingProps, options)) as _, rowIndex} -
-
-
- -
- -
-
-
-
- {/each} -{/if} - - diff --git a/plugins/tracker-resources/src/components/issues/AssigneeEditor.svelte b/plugins/tracker-resources/src/components/issues/AssigneeEditor.svelte index bb83fdf112..598fadbee2 100644 --- a/plugins/tracker-resources/src/components/issues/AssigneeEditor.svelte +++ b/plugins/tracker-resources/src/components/issues/AssigneeEditor.svelte @@ -52,11 +52,10 @@ if (issue.component) { const component = await client.findOne(tracker.class.Component, { _id: issue.component }) projectLead = component?.lead || undefined - projectMembers = component?.members || [] } else { projectLead = undefined - projectMembers = [] } + projectMembers = [] if (hasSpace(issue)) { const project = await client.findOne(tracker.class.Project, { _id: issue.space }) if (project !== undefined) { diff --git a/plugins/tracker-resources/src/components/issues/move/ComponentMove.svelte b/plugins/tracker-resources/src/components/issues/move/ComponentMove.svelte index a7df28082f..22192a4a74 100644 --- a/plugins/tracker-resources/src/components/issues/move/ComponentMove.svelte +++ b/plugins/tracker-resources/src/components/issues/move/ComponentMove.svelte @@ -13,8 +13,6 @@ // limitations under the License. -->