diff --git a/changelog.md b/changelog.md index 083636bc83..047d18f2a9 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,7 @@ Tracker: - Issue state history. - Subissue issue popup. +- Label support Lead: diff --git a/models/tracker/package.json b/models/tracker/package.json index 2c046c9a99..1f3a356b82 100644 --- a/models/tracker/package.json +++ b/models/tracker/package.json @@ -43,6 +43,7 @@ "@anticrm/view": "~0.6.0", "@anticrm/model-presentation": "~0.6.0", "@anticrm/setting": "~0.6.1", - "@anticrm/task": "~0.6.0" + "@anticrm/task": "~0.6.0", + "@anticrm/tags": "~0.6.2" } } diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index 5be2437f07..4057eabee4 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -51,6 +51,7 @@ import { Team } from '@anticrm/tracker' import { KeyBinding } from '@anticrm/view' +import tags from '@anticrm/tags' import tracker from './plugin' import presentation from '@anticrm/model-presentation' @@ -184,8 +185,8 @@ export class TIssue extends TAttachedDoc implements Issue { @Prop(Collection(attachment.class.Attachment), tracker.string.Attachments) attachments!: number - // @Prop(Collection(core.class.TypeString), tracker.string.Labels) - labels?: string[] + @Prop(Collection(tags.class.TagReference), tracker.string.Labels) + labels?: number declare space: Ref diff --git a/models/tracker/src/migration.ts b/models/tracker/src/migration.ts index cdf2922b75..5110c4b383 100644 --- a/models/tracker/src/migration.ts +++ b/models/tracker/src/migration.ts @@ -14,8 +14,9 @@ // import core, { Doc, generateId, Ref, SortingOrder, TxOperations, TxResult } from '@anticrm/core' -import { MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@anticrm/model' +import { createOrUpdate, MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@anticrm/model' import { IssueStatus, IssueStatusCategory, Team, genRanks, Issue } from '@anticrm/tracker' +import tags from '@anticrm/tags' import { DOMAIN_TRACKER } from '.' import tracker from './plugin' @@ -256,6 +257,19 @@ async function upgradeProjectIcons (tx: TxOperations): Promise { async function createDefaults (tx: TxOperations): Promise { await createDefaultTeam(tx) + await createOrUpdate( + tx, + tags.class.TagCategory, + tags.space.Tags, + { + icon: tags.icon.Tags, + label: 'Other', + targetClass: tracker.class.Issue, + tags: [], + default: true + }, + tracker.category.Other + ) } async function upgradeTeams (tx: TxOperations): Promise { diff --git a/plugins/tracker-assets/lang/en.json b/plugins/tracker-assets/lang/en.json index ac3004c945..afd251f233 100644 --- a/plugins/tracker-assets/lang/en.json +++ b/plugins/tracker-assets/lang/en.json @@ -51,6 +51,7 @@ "Unassigned": "Unassigned", "Back": "Back", "List": "List", + "NumberLabels": "{count, plural, =0 {no labels} =1 {1 label} other {# labels}}", "CategoryBacklog": "Backlog", "CategoryUnstarted": "Unstarted", diff --git a/plugins/tracker-assets/lang/ru.json b/plugins/tracker-assets/lang/ru.json index 67ed6107ca..7d9162be65 100644 --- a/plugins/tracker-assets/lang/ru.json +++ b/plugins/tracker-assets/lang/ru.json @@ -51,6 +51,7 @@ "Unassigned": "Не назначен", "Back": "Назад", "List": "Список", + "NumberLabels": "{count, plural, =0 {нет меток} =1 {1 метка} =2 {2 метки} =3 {3 метки} =4 {4 метки} other {# меток}}", "CategoryBacklog": "Пул", "CategoryUnstarted": "Не запущенные", diff --git a/plugins/tracker-resources/package.json b/plugins/tracker-resources/package.json index 2ddffd5f35..9790a6ab21 100644 --- a/plugins/tracker-resources/package.json +++ b/plugins/tracker-resources/package.json @@ -41,6 +41,7 @@ "@anticrm/login": "~0.6.1", "@anticrm/setting": "~0.6.1", "@anticrm/calendar": "~0.6.0", + "@anticrm/tags": "~0.6.2", "@anticrm/task": "~0.6.0", "@anticrm/chunter": "~0.6.1", "@anticrm/notification": "~0.6.0", diff --git a/plugins/tracker-resources/src/components/CreateIssue.svelte b/plugins/tracker-resources/src/components/CreateIssue.svelte index 8fd20e7962..cb9179ab81 100644 --- a/plugins/tracker-resources/src/components/CreateIssue.svelte +++ b/plugins/tracker-resources/src/components/CreateIssue.svelte @@ -15,12 +15,14 @@ {#if issueStatuses} - (object.status = detail)} - /> +
+ (object.status = detail)} + /> +
(currentAssignee = detail)} /> - + { + addTagRef(evt.detail) + }} + on:delete={(evt) => { + labels = labels.filter((it) => it._id !== evt.detail) + }} + /> {#if object.dueDate !== null} diff --git a/plugins/tracker-resources/src/components/issues/edit/ControlPanel.svelte b/plugins/tracker-resources/src/components/issues/edit/ControlPanel.svelte index 47b3b9c820..b14e965902 100644 --- a/plugins/tracker-resources/src/components/issues/edit/ControlPanel.svelte +++ b/plugins/tracker-resources/src/components/issues/edit/ControlPanel.svelte @@ -15,7 +15,8 @@