diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index 9b415e8179..afd690a502 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -300,6 +300,10 @@ export function createModel (builder: Builder): void { const boardId = 'board' const projectsId = 'projects' + builder.mixin(tracker.class.IssueStatus, core.class.Class, view.mixin.AttributePresenter, { + presenter: tracker.component.StatusPresenter + }) + builder.createDoc( workbench.class.Application, core.space.Model, diff --git a/plugins/tracker-resources/src/components/issues/EditIssue.svelte b/plugins/tracker-resources/src/components/issues/EditIssue.svelte index 954f18a07c..8cdba917b4 100644 --- a/plugins/tracker-resources/src/components/issues/EditIssue.svelte +++ b/plugins/tracker-resources/src/components/issues/EditIssue.svelte @@ -25,7 +25,7 @@ import tracker from '../../plugin' import IssuePresenter from './IssuePresenter.svelte' import PriorityPresenter from './PriorityPresenter.svelte' - import StatusPresenter from './StatusPresenter.svelte' + import StatusEditor from './StatusEditor.svelte' export let _id: Ref export let _class: Ref> @@ -167,7 +167,7 @@ - +
diff --git a/plugins/tracker-resources/src/components/issues/Issues.svelte b/plugins/tracker-resources/src/components/issues/Issues.svelte index 37b0761dad..1fddb35500 100644 --- a/plugins/tracker-resources/src/components/issues/Issues.svelte +++ b/plugins/tracker-resources/src/components/issues/Issues.svelte @@ -351,7 +351,7 @@ itemsConfig={[ { key: '', presenter: tracker.component.PriorityPresenter, props: { currentSpace } }, { key: '', presenter: tracker.component.IssuePresenter, props: { currentTeam } }, - { key: '', presenter: tracker.component.StatusPresenter, props: { currentSpace, statuses } }, + { key: '', presenter: tracker.component.StatusEditor, props: { currentSpace, statuses } }, { key: '', presenter: tracker.component.TitlePresenter, props: { shouldUseMargin: true } }, { key: '', presenter: tracker.component.DueDatePresenter, props: { currentSpace } }, { key: 'modifiedOn', presenter: tracker.component.ModificationDatePresenter }, diff --git a/plugins/tracker-resources/src/components/issues/IssuesList.svelte b/plugins/tracker-resources/src/components/issues/IssuesList.svelte index a2d9deaaa5..97217dce04 100644 --- a/plugins/tracker-resources/src/components/issues/IssuesList.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuesList.svelte @@ -32,7 +32,7 @@ import { buildModel, getObjectPresenter, LoadingProps, Menu } from '@anticrm/view-resources' import { createEventDispatcher } from 'svelte' import tracker from '../../plugin' - import { IssuesGroupByKeys, issuesGroupPresenterMap, IssuesOrderByKeys, issuesSortOrderMap } from '../../utils' + import { IssuesGroupByKeys, issuesGroupEditorMap, IssuesOrderByKeys, issuesSortOrderMap } from '../../utils' import CreateIssue from '../CreateIssue.svelte' export let _class: Ref> @@ -64,8 +64,7 @@ $: combinedGroupedIssues = Object.values(groupedIssues).flat(1) $: options = { ...baseOptions, sort: { [orderBy]: issuesSortOrderMap[orderBy] } } as FindOptions - $: headerComponent = - groupByKey === undefined || groupByKey === 'assignee' ? null : issuesGroupPresenterMap[groupByKey] + $: headerComponent = groupByKey === undefined || groupByKey === 'assignee' ? null : issuesGroupEditorMap[groupByKey] $: selectedObjectIdsSet = new Set>(selectedObjectIds.map((it) => it._id)) $: objectRefs.length = combinedGroupedIssues.length diff --git a/plugins/tracker-resources/src/components/issues/StatusEditor.svelte b/plugins/tracker-resources/src/components/issues/StatusEditor.svelte new file mode 100644 index 0000000000..ec3c6f5053 --- /dev/null +++ b/plugins/tracker-resources/src/components/issues/StatusEditor.svelte @@ -0,0 +1,68 @@ + + + +{#if value} + {#if isEditable} + + + + {:else} + + {/if} +{/if} diff --git a/plugins/tracker-resources/src/components/issues/StatusPresenter.svelte b/plugins/tracker-resources/src/components/issues/StatusPresenter.svelte index ec3c6f5053..c9370fd9b0 100644 --- a/plugins/tracker-resources/src/components/issues/StatusPresenter.svelte +++ b/plugins/tracker-resources/src/components/issues/StatusPresenter.svelte @@ -13,56 +13,13 @@ // limitations under the License. --> {#if value} - {#if isEditable} - - - - {:else} - - {/if} + + {value.name} + {/if} diff --git a/plugins/tracker-resources/src/index.ts b/plugins/tracker-resources/src/index.ts index 666ec2c6a8..9d97c894de 100644 --- a/plugins/tracker-resources/src/index.ts +++ b/plugins/tracker-resources/src/index.ts @@ -30,6 +30,7 @@ import IssuePresenter from './components/issues/IssuePresenter.svelte' import TitlePresenter from './components/issues/TitlePresenter.svelte' import PriorityPresenter from './components/issues/PriorityPresenter.svelte' import StatusPresenter from './components/issues/StatusPresenter.svelte' +import StatusEditor from './components/issues/StatusEditor.svelte' import DueDatePresenter from './components/issues/DueDatePresenter.svelte' import AssigneePresenter from './components/issues/AssigneePresenter.svelte' import ViewOptionsPopup from './components/issues/ViewOptionsPopup.svelte' @@ -55,6 +56,7 @@ export default async (): Promise => ({ ModificationDatePresenter, PriorityPresenter, StatusPresenter, + StatusEditor, AssigneePresenter, DueDatePresenter, EditIssue, diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts index 5106754d10..f229b6244e 100644 --- a/plugins/tracker-resources/src/plugin.ts +++ b/plugins/tracker-resources/src/plugin.ts @@ -137,6 +137,7 @@ export default mergeIds(trackerId, tracker, { ModificationDatePresenter: '' as AnyComponent, PriorityPresenter: '' as AnyComponent, StatusPresenter: '' as AnyComponent, + StatusEditor: '' as AnyComponent, AssigneePresenter: '' as AnyComponent, DueDatePresenter: '' as AnyComponent, EditIssue: '' as AnyComponent, diff --git a/plugins/tracker-resources/src/utils.ts b/plugins/tracker-resources/src/utils.ts index 5702ae960b..7b8bea6a34 100644 --- a/plugins/tracker-resources/src/utils.ts +++ b/plugins/tracker-resources/src/utils.ts @@ -93,8 +93,8 @@ export const issuesSortOrderMap: Record = { dueDate: SortingOrder.Descending } -export const issuesGroupPresenterMap: Record<'status' | 'priority', AnyComponent | undefined> = { - status: tracker.component.StatusPresenter, +export const issuesGroupEditorMap: Record<'status' | 'priority', AnyComponent | undefined> = { + status: tracker.component.StatusEditor, priority: tracker.component.PriorityPresenter }