TSK-810 Rename Team -> Project, Project -> Component (#2756)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2023-03-17 12:17:53 +06:00
committed by GitHub
parent 26adf14966
commit 0f24fe80d6
110 changed files with 1646 additions and 1324 deletions
@@ -18,22 +18,22 @@
import { Card, getClient, KeyedAttribute, SpaceSelector } from '@hcengineering/presentation'
import tags, { TagElement } from '@hcengineering/tags'
import { StyledTextBox } from '@hcengineering/text-editor'
import { IssuePriority, IssueTemplate, Project, Sprint, Team } from '@hcengineering/tracker'
import { IssuePriority, IssueTemplate, Component as ComponentType, Sprint, Project } from '@hcengineering/tracker'
import { Component, EditBox, Label } from '@hcengineering/ui'
import { createEventDispatcher } from 'svelte'
import { activeProject, activeSprint } from '../../issues'
import { activeComponent, activeSprint } from '../../issues'
import tracker from '../../plugin'
import AssigneeEditor from '../issues/AssigneeEditor.svelte'
import PriorityEditor from '../issues/PriorityEditor.svelte'
import ProjectSelector from '../ProjectSelector.svelte'
import ComponentSelector from '../ComponentSelector.svelte'
import SprintSelector from '../sprints/SprintSelector.svelte'
import EstimationEditor from './EstimationEditor.svelte'
import SubIssueTemplates from './IssueTemplateChilds.svelte'
export let space: Ref<Team>
export let space: Ref<Project>
export let priority: IssuePriority = IssuePriority.NoPriority
export let assignee: Ref<Employee> | null = null
export let project: Ref<Project> | null = $activeProject ?? null
export let component: Ref<ComponentType> | null = $activeComponent ?? null
export let sprint: Ref<Sprint> | null = $activeSprint ?? null
export let relatedTo: Doc | undefined
@@ -44,7 +44,7 @@
title: '',
description: '',
assignee,
project,
component,
sprint,
priority,
estimation: 0,
@@ -66,7 +66,7 @@
}
$: _space = space
let spaceRef: Team | undefined
let spaceRef: Project | undefined
$: canSave = getTitle(object.title ?? '').length > 0
@@ -87,7 +87,7 @@
title: getTitle(object.title),
description: object.description,
assignee: object.assignee,
project: object.project,
component: object.component,
sprint: object.sprint,
priority: object.priority,
estimation: object.estimation,
@@ -104,12 +104,12 @@
objectId = generateId()
}
const handleProjectIdChanged = (projectId: Ref<Project> | null | undefined) => {
if (projectId === undefined) {
const handleComponentIdChanged = (componentId: Ref<ComponentType> | null | undefined) => {
if (componentId === undefined) {
return
}
object = { ...object, project: projectId }
object = { ...object, component: componentId }
}
const handleSprintIdChanged = (sprintId: Ref<Sprint> | null | undefined) => {
@@ -137,8 +137,8 @@
>
<svelte:fragment slot="header">
<SpaceSelector
_class={tracker.class.Team}
label={tracker.string.Team}
_class={tracker.class.Project}
label={tracker.string.Project}
bind:space={_space}
on:space={(evt) => {
spaceRef = evt.detail
@@ -160,9 +160,9 @@
/>
<SubIssueTemplates
bind:children={object.children}
project={object.project}
component={object.component}
sprint={object.sprint}
team={_space}
project={_space}
maxHeight="limited"
/>
<svelte:fragment slot="pool">
@@ -198,7 +198,11 @@
}}
/>
<EstimationEditor kind={'no-border'} size={'small'} value={object} />
<ProjectSelector value={object.project} onChange={handleProjectIdChanged} />
<SprintSelector value={object.sprint} onChange={handleSprintIdChanged} useProject={object.project ?? undefined} />
<ComponentSelector value={object.component} onChange={handleComponentIdChanged} />
<SprintSelector
value={object.sprint}
onChange={handleSprintIdChanged}
useComponent={object.component ?? undefined}
/>
</svelte:fragment>
</Card>
@@ -22,9 +22,9 @@
IssuePriority,
IssueStatus,
IssueTemplateChild,
Project,
Component as ComponentType,
Sprint,
Team
Project
} from '@hcengineering/tracker'
import { Button, Component, EditBox } from '@hcengineering/ui'
import { createEventDispatcher } from 'svelte'
@@ -34,9 +34,9 @@
import StatusEditor from '../issues/StatusEditor.svelte'
import EstimationEditor from './EstimationEditor.svelte'
export let team: Team
export let project: Project
export let sprint: Ref<Sprint> | null = null
export let project: Ref<Project> | null = null
export let component: Ref<ComponentType> | null = null
export let childIssue: DraftIssueChild | undefined = undefined
export let showBorder = false
export let statuses: WithLookup<IssueStatus>[]
@@ -66,8 +66,8 @@
title: '',
description: '',
assignee: null,
status: team.defaultIssueStatus,
project,
status: project.defaultIssueStatus,
component,
priority: IssuePriority.NoPriority,
sprint,
estimation: 0
@@ -95,7 +95,7 @@
const value: IssueTemplateChild = {
...newIssue,
title: getTitle(newIssue.title),
project: project ?? null,
component: component ?? null,
labels: labels.map((it) => it._id)
}
if (childIssue === undefined) {
@@ -130,7 +130,7 @@
{#key newIssue.id}
<AttachmentStyledBox
objectId={newIssue.id}
space={team._id}
space={project._id}
_class={tracker.class.Issue}
bind:content={newIssue.description}
placeholder={tracker.string.SubIssueDescriptionPlaceholder}
@@ -19,9 +19,9 @@
DraftIssueChild,
IssueStatus,
IssueTemplateChild,
Project,
Component,
Sprint,
Team
Project
} from '@hcengineering/tracker'
import { eventToHTMLElement, showPopup } from '@hcengineering/ui'
import { ActionContext, FixedColumn } from '@hcengineering/view-resources'
@@ -35,9 +35,9 @@
import EstimationEditor from './EstimationEditor.svelte'
export let issues: DraftIssueChild[]
export let team: Ref<Team>
export let project: Ref<Project>
export let sprint: Ref<Sprint> | null = null
export let project: Ref<Project> | null = null
export let component: Ref<Component> | null = null
export let statuses: WithLookup<IssueStatus>[]
const dispatch = createEventDispatcher()
@@ -49,9 +49,9 @@
DraftIssueChildEditor,
{
showBorder: true,
team: currentTeam,
project: currentProject,
sprint,
project,
component,
statuses,
childIssue: target
},
@@ -91,19 +91,19 @@
resetDrag()
}
const teamQuery = createQuery()
$: teamQuery.query(
tracker.class.Team,
const projectQuery = createQuery()
$: projectQuery.query(
tracker.class.Project,
{
_id: team
_id: project
},
(res) => ([currentTeam] = res)
(res) => ([currentProject] = res)
)
let currentTeam: Team | undefined = undefined
let currentProject: Project | undefined = undefined
function getIssueTemplateId (currentTeam: Team | undefined, issue: IssueTemplateChild): string {
return currentTeam
? `${currentTeam.identifier}-${issues.findIndex((it) => it.id === issue.id)}`
function getIssueTemplateId (currentProject: Project | undefined, issue: IssueTemplateChild): string {
return currentProject
? `${currentProject.identifier}-${issues.findIndex((it) => it.id === issue.id)}`
: `${issues.findIndex((it) => it.id === issue.id)}}`
}
</script>
@@ -156,7 +156,7 @@
<!-- svelte-ignore a11y-click-events-have-key-events -->
<span class="issuePresenter" on:click={(evt) => openIssue(evt, issue)}>
<FixedColumn key={'issue_template_issue'} justify={'left'}>
{getIssueTemplateId(currentTeam, issue)}
{getIssueTemplateId(currentProject, issue)}
</FixedColumn>
</span>
<span class="text name" title={issue.title} on:click={(evt) => openIssue(evt, issue)}>
@@ -21,7 +21,7 @@
import presentation, { createQuery, getClient, MessageViewer } from '@hcengineering/presentation'
import setting, { settingId } from '@hcengineering/setting'
import tags from '@hcengineering/tags'
import type { IssueTemplate, IssueTemplateChild, Team } from '@hcengineering/tracker'
import type { IssueTemplate, IssueTemplateChild, Project } from '@hcengineering/tracker'
import {
Button,
EditBox,
@@ -52,7 +52,7 @@
const client = getClient()
let template: WithLookup<IssueTemplate> | undefined
let currentTeam: Team | undefined
let currentProject: Project | undefined
let title = ''
let description = ''
let innerWidth: number
@@ -85,9 +85,9 @@
;[template] = result
title = template.title
description = template.description
currentTeam = template.$lookup?.space
currentProject = template.$lookup?.space
},
{ lookup: { space: tracker.class.Team, labels: tags.class.TagElement } }
{ lookup: { space: tracker.class.Project, labels: tags.class.TagElement } }
)
$: canSave = title.trim().length > 0
@@ -249,11 +249,11 @@
{/if}
</div>
<div class="mt-6">
{#key template._id && currentTeam !== undefined}
{#if currentTeam !== undefined}
{#key template._id && currentProject !== undefined}
{#if currentProject !== undefined}
<SubIssueTemplates
maxHeight="limited"
team={template.space}
project={template.space}
bind:children={template.children}
on:create-issue={createIssue}
on:update-issue={updateIssue}
@@ -292,7 +292,7 @@
</svelte:fragment>
<svelte:fragment slot="custom-attributes">
{#if template && currentTeam}
{#if template && currentProject}
<TemplateControlPanel issue={template} />
{/if}
@@ -17,7 +17,7 @@
import presentation, { createQuery, getClient, KeyedAttribute } from '@hcengineering/presentation'
import tags, { TagElement, TagReference } from '@hcengineering/tags'
import { StyledTextArea } from '@hcengineering/text-editor'
import { IssuePriority, IssueTemplateChild, Project, Sprint } from '@hcengineering/tracker'
import { IssuePriority, IssueTemplateChild, Component as ComponentType, Sprint } from '@hcengineering/tracker'
import { Button, Component, EditBox } from '@hcengineering/ui'
import { createEventDispatcher } from 'svelte'
import tracker from '../../plugin'
@@ -26,7 +26,7 @@
import EstimationEditor from './EstimationEditor.svelte'
export let sprint: Ref<Sprint> | null = null
export let project: Ref<Project> | null = null
export let component: Ref<ComponentType> | null = null
export let childIssue: IssueTemplateChild | undefined = undefined
export let showBorder = false
export let isScrollable: boolean = false
@@ -57,7 +57,7 @@
title: '',
description: '',
assignee: null,
project: null,
component: null,
priority: IssuePriority.NoPriority,
sprint,
estimation: 0
@@ -85,7 +85,7 @@
const value: IssueTemplateChild = {
...newIssue,
title: getTitle(newIssue.title),
project: project ?? null,
component: component ?? null,
labels: labels.map((it) => it._id)
}
if (childIssue === undefined) {
@@ -15,7 +15,7 @@
<script lang="ts">
import { Ref } from '@hcengineering/core'
import { createQuery } from '@hcengineering/presentation'
import tracker, { IssueTemplateChild, Project, Sprint, Team } from '@hcengineering/tracker'
import tracker, { IssueTemplateChild, Component, Sprint, Project } from '@hcengineering/tracker'
import { eventToHTMLElement, showPopup } from '@hcengineering/ui'
import { ActionContext, FixedColumn } from '@hcengineering/view-resources'
import { createEventDispatcher } from 'svelte'
@@ -27,9 +27,9 @@
import IssueTemplateChildEditor from './IssueTemplateChildEditor.svelte'
export let issues: IssueTemplateChild[]
export let team: Ref<Team>
export let project: Ref<Project>
export let sprint: Ref<Sprint> | null = null
export let project: Ref<Project> | null = null
export let component: Ref<Component> | null = null
const dispatch = createEventDispatcher()
@@ -42,7 +42,7 @@
{
showBorder: true,
sprint,
project,
component,
childIssue: target
},
eventToHTMLElement(evt),
@@ -81,19 +81,19 @@
resetDrag()
}
const teamQuery = createQuery()
$: teamQuery.query(
tracker.class.Team,
const projectQuery = createQuery()
$: projectQuery.query(
tracker.class.Project,
{
_id: team
_id: project
},
(res) => ([currentTeam] = res)
(res) => ([currentProject] = res)
)
let currentTeam: Team | undefined = undefined
let currentProject: Project | undefined = undefined
function getIssueTemplateId (currentTeam: Team | undefined, issue: IssueTemplateChild): string {
return currentTeam
? `${currentTeam.identifier}-${issues.findIndex((it) => it.id === issue.id)}`
function getIssueTemplateId (currentProject: Project | undefined, issue: IssueTemplateChild): string {
return currentProject
? `${currentProject.identifier}-${issues.findIndex((it) => it.id === issue.id)}`
: `${issues.findIndex((it) => it.id === issue.id)}}`
}
</script>
@@ -138,7 +138,7 @@
<!-- svelte-ignore a11y-click-events-have-key-events -->
<span class="issuePresenter" on:click={(evt) => openIssue(evt, issue)}>
<FixedColumn key={'issue_template_issue'} justify={'left'}>
{getIssueTemplateId(currentTeam, issue)}
{getIssueTemplateId(currentProject, issue)}
</FixedColumn>
</span>
<span class="text name" title={issue.title} on:click={(evt) => openIssue(evt, issue)}>
@@ -14,7 +14,7 @@
-->
<script lang="ts">
import { Ref } from '@hcengineering/core'
import { IssueTemplateChild, Project, Sprint, Team } from '@hcengineering/tracker'
import { IssueTemplateChild, Component, Sprint, Project } from '@hcengineering/tracker'
import { Button, closeTooltip, ExpandCollapse, IconAdd, Scroller } from '@hcengineering/ui'
import { afterUpdate, createEventDispatcher } from 'svelte'
import tracker from '../../plugin'
@@ -24,9 +24,9 @@
import IssueTemplateChildList from './IssueTemplateChildList.svelte'
export let children: IssueTemplateChild[] = []
export let team: Ref<Team>
export let project: Ref<Project>
export let sprint: Ref<Sprint> | null = null
export let project: Ref<Project> | null = null
export let component: Ref<Component> | null = null
export let isScrollable: boolean = false
export let maxHeight: 'max' | 'card' | 'limited' | string | undefined = undefined
@@ -88,10 +88,10 @@
<div class="flex-col flex-no-shrink max-h-30 list clear-mins" class:collapsed={isCollapsed}>
<Scroller>
<IssueTemplateChildList
{project}
{component}
{sprint}
bind:issues={children}
{team}
{project}
on:move={handleIssueSwap}
on:update-issue
/>
@@ -102,7 +102,7 @@
{#if isCreating}
<ExpandCollapse isExpanded={!isCollapsed} on:changeContent>
<IssueTemplateChildEditor
{project}
{component}
{sprint}
{isScrollable}
{maxHeight}
@@ -14,11 +14,11 @@
-->
<script lang="ts">
import { DocumentQuery, Ref } from '@hcengineering/core'
import { IssueTemplate, Team } from '@hcengineering/tracker'
import { IssueTemplate, Project } from '@hcengineering/tracker'
import tracker from '../../plugin'
import IssueTemplatesView from './IssueTemplatesView.svelte'
export let currentSpace: Ref<Team>
export let currentSpace: Ref<Project>
const query: DocumentQuery<IssueTemplate> = { space: currentSpace }
</script>
@@ -22,7 +22,7 @@
import tracker from '../../plugin'
import AssigneeEditor from '../issues/AssigneeEditor.svelte'
import PriorityEditor from '../issues/PriorityEditor.svelte'
import ProjectEditor from '../projects/ProjectEditor.svelte'
import ComponentEditor from '../components/ComponentEditor.svelte'
import SprintEditor from '../sprints/SprintEditor.svelte'
export let issue: WithLookup<IssueTemplate>
@@ -37,7 +37,7 @@
keys = filtredKeys.filter((key) => !isCollectionAttr(hierarchy, key))
}
$: updateKeys(['title', 'description', 'priority', 'number', 'assignee', 'project', 'sprint'])
$: updateKeys(['title', 'description', 'priority', 'number', 'assignee', 'component', 'sprint'])
const key: KeyedAttribute = {
key: 'labels',
@@ -97,9 +97,9 @@
<div class="divider" />
<span class="label">
<Label label={tracker.string.Project} />
<Label label={tracker.string.Component} />
</span>
<ProjectEditor value={issue} />
<ComponentEditor value={issue} />
{#if issue.sprint}
<span class="label">