From ab02db58900ea5c624d4de9f42fdfdd7e9be90d8 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Thu, 13 Jul 2023 19:33:23 +0600 Subject: [PATCH] UBER-408 Issue as task (#3497) Signed-off-by: Denis Bykhov --- dev/generator/src/issues.ts | 2 + dev/generator/src/recruit.ts | 4 +- models/board/src/index.ts | 15 ++-- models/lead/src/index.ts | 22 +++--- models/recruit/src/index.ts | 31 ++++---- models/task/src/index.ts | 17 +++-- models/task/src/migration.ts | 71 ++++++++++++++++++- models/tracker/package.json | 1 + models/tracker/src/index.ts | 19 +++-- models/tracker/src/migration.ts | 13 +++- plugins/bitrix/src/hr.ts | 2 +- plugins/bitrix/src/utils.ts | 4 +- .../src/components/CreateCard.svelte | 2 +- .../src/components/EditCard.svelte | 8 +-- .../src/components/KanbanView.svelte | 2 +- .../src/components/TableView.svelte | 4 +- .../src/components/add-card/AddCard.svelte | 2 +- .../src/components/popups/CopyCard.svelte | 10 +-- .../src/components/popups/MoveCard.svelte | 12 ++-- .../components/selectors/RankSelect.svelte | 4 +- .../components/selectors/StateSelect.svelte | 6 +- plugins/board-resources/src/index.ts | 2 +- .../board-resources/src/utils/CardUtils.ts | 4 +- plugins/board/src/index.ts | 9 ++- .../src/components/CreateLead.svelte | 2 +- .../src/components/Leads.svelte | 4 +- .../src/components/LeadsPopup.svelte | 2 +- plugins/lead/src/index.ts | 10 ++- .../src/components/ApplicationsPopup.svelte | 2 +- .../src/components/CreateApplication.svelte | 4 +- .../src/components/KanbanCard.svelte | 8 +-- .../src/components/MoveApplication.svelte | 2 +- .../VacancyApplicationsPopup.svelte | 2 +- .../VacancyListApplicationsPopup.svelte | 4 +- plugins/recruit/src/index.ts | 6 +- .../src/components/Dashboard.svelte | 6 +- .../src/components/StatusTableView.svelte | 4 +- .../src/components/TaskHeader.svelte | 4 +- .../src/components/kanban/KanbanView.svelte | 2 +- .../src/components/state/EditStatuses.svelte | 2 +- plugins/task/src/index.ts | 5 +- .../src/components/CreateIssue.svelte | 1 + .../src/components/SubIssues.svelte | 1 + plugins/tracker/src/index.ts | 13 +--- plugins/tracker/src/utils.ts | 33 +-------- .../view-resources/src/components/Move.svelte | 8 +-- 46 files changed, 216 insertions(+), 175 deletions(-) diff --git a/dev/generator/src/issues.ts b/dev/generator/src/issues.ts index 917a759a71..ec56522f77 100644 --- a/dev/generator/src/issues.ts +++ b/dev/generator/src/issues.ts @@ -26,6 +26,7 @@ const object: AttachedData = { milestone: null, number: 0, rank: '', + doneState: null, status: '' as Ref, priority: IssuePriority.NoPriority, dueDate: null, @@ -86,6 +87,7 @@ async function genIssue (client: TxOperations, statuses: Ref[]): Pr component: object.component, milestone: object.milestone, number: (incResult as any).object.sequence, + doneState: null, status: faker.random.arrayElement(statuses), priority: faker.random.arrayElement(Object.values(IssuePriority)) as IssuePriority, rank: calcRank(lastOne, undefined), diff --git a/dev/generator/src/recruit.ts b/dev/generator/src/recruit.ts index d6a787bdd5..866555e532 100644 --- a/dev/generator/src/recruit.ts +++ b/dev/generator/src/recruit.ts @@ -158,7 +158,7 @@ async function genApplicant ( const applicant: AttachedData = { number: faker.datatype.number(), assignee: faker.random.arrayElement(emoloyeeIds), - state: faker.random.arrayElement(states), + status: faker.random.arrayElement(states), doneState: null, rank: rank as string, startDate: null, @@ -201,7 +201,7 @@ async function genApplicant ( recruit.class.Applicant, 'applications', { - state: faker.random.arrayElement(states) + status: faker.random.arrayElement(states) } ) ) diff --git a/models/board/src/index.ts b/models/board/src/index.ts index 3b6589aa31..4d1d65ad52 100644 --- a/models/board/src/index.ts +++ b/models/board/src/index.ts @@ -17,22 +17,20 @@ import automation, { AutomationSupport } from '@hcengineering/automation' import { Board, boardId, Card, CardCover, CommonBoardPreference, MenuPage } from '@hcengineering/board' import type { Employee } from '@hcengineering/contact' -import { Class, DOMAIN_MODEL, IndexKind, Markup, Ref, Type } from '@hcengineering/core' +import { Class, DOMAIN_MODEL, IndexKind, Markup, Ref, Timestamp, Type } from '@hcengineering/core' import { ArrOf, Builder, - Collection, Index, Model, Prop, TypeBoolean, + TypeDate, TypeMarkup, TypeRef, TypeString, UX } from '@hcengineering/model' -import attachment from '@hcengineering/model-attachment' -import chunter from '@hcengineering/model-chunter' import contact from '@hcengineering/model-contact' import core, { TDoc, TType } from '@hcengineering/model-core' import preference, { TPreference } from '@hcengineering/model-preference' @@ -90,12 +88,6 @@ export class TCard extends TTask implements Card { @Index(IndexKind.FullText) location?: string - @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(TypeRef(contact.class.Employee), board.string.Assignee) declare assignee: Ref | null @@ -104,6 +96,9 @@ export class TCard extends TTask implements Card { @Prop(TypeCardCover(), board.string.Cover) cover?: CardCover + + @Prop(TypeDate(), task.string.StartDate) + startDate!: Timestamp | null } @Model(board.class.MenuPage, core.class.Doc, DOMAIN_MODEL) diff --git a/models/lead/src/index.ts b/models/lead/src/index.ts index 0c35675676..9a5471746e 100644 --- a/models/lead/src/index.ts +++ b/models/lead/src/index.ts @@ -15,7 +15,7 @@ // To help typescript locate view plugin properly import type { Employee } from '@hcengineering/contact' -import { FindOptions, IndexKind, Ref, SortingOrder } from '@hcengineering/core' +import { FindOptions, IndexKind, Ref, SortingOrder, Timestamp } from '@hcengineering/core' import { Customer, Funnel, Lead, leadId } from '@hcengineering/lead' import { Builder, @@ -25,6 +25,7 @@ import { Model, Prop, ReadOnly, + TypeDate, TypeMarkup, TypeRef, TypeString, @@ -69,16 +70,13 @@ export class TLead extends TTask implements Lead { @ReadOnly() declare attachedTo: Ref + @Prop(TypeDate(), task.string.StartDate) + startDate!: Timestamp | null + @Prop(TypeString(), lead.string.Title) @Index(IndexKind.FullText) title!: string - @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(TypeRef(contact.class.Employee), lead.string.Assignee) declare assignee: Ref | null } @@ -247,7 +245,7 @@ export function createModel (builder: Builder): void { presenter: tracker.component.RelatedIssueSelector, label: tracker.string.Issues }, - 'state', + 'status', 'doneState', 'attachments', 'comments', @@ -272,9 +270,9 @@ export function createModel (builder: Builder): void { ) const leadViewOptions: ViewOptionsModel = { - groupBy: ['state', 'assignee'], + groupBy: ['status', 'assignee'], orderBy: [ - ['state', SortingOrder.Ascending], + ['status', SortingOrder.Ascending], ['modifiedOn', SortingOrder.Descending], ['createdOn', SortingOrder.Descending], ['dueDate', SortingOrder.Ascending], @@ -304,7 +302,7 @@ export function createModel (builder: Builder): void { config: [ { key: '', displayProps: { fixed: 'left', key: 'lead' } }, { - key: 'state', + key: 'status', props: { kind: 'list', size: 'small', shouldShowName: false } }, { @@ -402,7 +400,7 @@ export function createModel (builder: Builder): void { lead.class.Lead, lead.ids.LeadNotificationGroup, [], - ['comments', 'state', 'doneState'] + ['comments', 'status', 'doneState'] ) builder.createDoc( diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index 75e3b6e6a8..c13e0a26a3 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -55,6 +55,7 @@ import { recruitId } from '@hcengineering/recruit' import setting from '@hcengineering/setting' +import { State } from '@hcengineering/task' import { KeyBinding, ViewOptionsModel } from '@hcengineering/view' import recruit from './plugin' import { createReviewModel, reviewTableConfig, reviewTableOptions } from './review' @@ -158,14 +159,14 @@ export class TApplicant extends TTask implements Applicant { @Index(IndexKind.Indexed) declare space: Ref - @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) - attachments?: number - - @Prop(Collection(chunter.class.Comment), chunter.string.Comments) - comments?: number + @Prop(TypeDate(), task.string.StartDate) + startDate!: Timestamp | null @Prop(TypeRef(contact.class.Employee), recruit.string.AssignedRecruiter) declare assignee: Ref | null + + @Prop(TypeRef(task.class.State), task.string.TaskState, { _id: task.attribute.State }) + declare status: Ref } @Model(recruit.class.ApplicantMatch, core.class.AttachedDoc, DOMAIN_TASK) @@ -425,7 +426,7 @@ export function createModel (builder: Builder): void { { attachTo: recruit.class.Applicant, descriptor: view.viewlet.Table, - config: ['', '$lookup.attachedTo', 'state', 'doneState', 'modifiedOn'], + config: ['', '$lookup.attachedTo', 'status', 'doneState', 'modifiedOn'], configOptions: { sortable: true }, @@ -440,7 +441,7 @@ export function createModel (builder: Builder): void { { attachTo: recruit.class.Applicant, descriptor: view.viewlet.Table, - config: ['', '$lookup.space.name', '$lookup.space.$lookup.company', 'state', 'comments', 'doneState'], + config: ['', '$lookup.space.name', '$lookup.space.$lookup.company', 'status', 'comments', 'doneState'], configOptions: { sortable: true }, @@ -535,7 +536,7 @@ export function createModel (builder: Builder): void { presenter: tracker.component.RelatedIssueSelector, label: tracker.string.Issues }, - 'state', + 'status', 'doneState', 'attachments', 'comments', @@ -583,7 +584,7 @@ export function createModel (builder: Builder): void { presenter: tracker.component.RelatedIssueSelector, label: tracker.string.Issues }, - 'state', + 'status', 'attachments', 'comments', 'modifiedOn', @@ -651,9 +652,9 @@ export function createModel (builder: Builder): void { const applicantViewOptions = (colors: boolean): ViewOptionsModel => { const model: ViewOptionsModel = { - groupBy: ['state', 'assignee', 'space', 'createdBy', 'modifiedBy'], + groupBy: ['status', 'assignee', 'space', 'createdBy', 'modifiedBy'], orderBy: [ - ['state', SortingOrder.Ascending], + ['status', SortingOrder.Ascending], ['modifiedOn', SortingOrder.Descending], ['createdOn', SortingOrder.Descending], ['dueDate', SortingOrder.Ascending], @@ -684,7 +685,7 @@ export function createModel (builder: Builder): void { config: [ { key: '', displayProps: { fixed: 'left', key: 'app' } }, { - key: 'state', + key: 'status', props: { kind: 'list', size: 'small', shouldShowName: false } }, { @@ -778,7 +779,7 @@ export function createModel (builder: Builder): void { '', 'space', 'assignee', - 'state', + 'status', 'attachments', 'dueDate', 'comments', @@ -1125,7 +1126,7 @@ export function createModel (builder: Builder): void { action: view.actionImpl.ValueSelector, actionPopup: view.component.ValueSelector, actionProps: { - attribute: 'state', + attribute: 'status', _class: task.class.State, query: {}, searchField: 'name', @@ -1285,7 +1286,7 @@ export function createModel (builder: Builder): void { recruit.class.Applicant, recruit.ids.ApplicationNotificationGroup, [], - ['comments', 'state', 'doneState', 'dueDate'] + ['comments', 'status', 'doneState', 'dueDate'] ) builder.createDoc( diff --git a/models/task/src/index.ts b/models/task/src/index.ts index d2ef3bac6d..7c777d6f27 100644 --- a/models/task/src/index.ts +++ b/models/task/src/index.ts @@ -15,6 +15,8 @@ import type { Employee } from '@hcengineering/contact' import contact from '@hcengineering/contact' +import attachment from '@hcengineering/model-attachment' +import chunter from '@hcengineering/model-chunter' import { Arr, Attribute, Class, Doc, Domain, IndexKind, Ref, Space, Status, Timestamp } from '@hcengineering/core' import { Builder, @@ -88,8 +90,8 @@ export class TLostState extends TDoneState implements LostState {} @Model(task.class.Task, core.class.AttachedDoc, DOMAIN_TASK) @UX(task.string.Task, task.icon.Task, task.string.Task) export class TTask extends TAttachedDoc implements Task { - @Prop(TypeRef(task.class.State), task.string.TaskState, { _id: task.attribute.State }) - state!: Ref + @Prop(TypeRef(core.class.Status), task.string.TaskState, { _id: task.attribute.State }) + status!: Ref @Prop(TypeRef(task.class.DoneState), task.string.TaskStateDone, { _id: task.attribute.DoneState }) doneState!: Ref | null @@ -105,13 +107,16 @@ export class TTask extends TAttachedDoc implements Task { @Prop(TypeDate(), task.string.DueDate, { editor: task.component.DueDateEditor }) dueDate!: Timestamp | null - @Prop(TypeDate(), task.string.StartDate) - startDate!: Timestamp | null - declare rank: string @Prop(Collection(tags.class.TagReference, task.string.TaskLabels), task.string.TaskLabels) - labels!: number + labels?: number + + @Prop(Collection(chunter.class.Comment), chunter.string.Comments) + comments?: number + + @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments, { shortLabel: attachment.string.Files }) + attachments?: number } @Model(task.class.TodoItem, core.class.AttachedDoc, DOMAIN_TASK) diff --git a/models/task/src/migration.ts b/models/task/src/migration.ts index 05cffc2db3..26dc0a189c 100644 --- a/models/task/src/migration.ts +++ b/models/task/src/migration.ts @@ -13,11 +13,13 @@ // limitations under the License. // -import { Class, Doc, Domain, Ref, Space, TxOperations } from '@hcengineering/core' +import { Class, DOMAIN_TX, Doc, Domain, Ref, Space, TxOperations } from '@hcengineering/core' import { MigrateOperation, MigrationClient, MigrationUpgradeClient, createOrUpdate } from '@hcengineering/model' import core from '@hcengineering/model-core' import tags from '@hcengineering/model-tags' import { DoneStateTemplate, KanbanTemplate, StateTemplate, genRanks } from '@hcengineering/task' +import view, { Filter } from '@hcengineering/view' +import { DOMAIN_TASK } from '.' import task from './plugin' /** @@ -125,8 +127,72 @@ async function createDefaults (tx: TxOperations): Promise { await createDefaultSequence(tx) } +async function renameState (client: MigrationClient): Promise { + const toUpdate = await client.find(DOMAIN_TASK, { state: { $exists: true } }) + if (toUpdate.length > 0) { + for (const doc of toUpdate) { + await client.update( + DOMAIN_TX, + { objectId: doc._id }, + { $rename: { 'attributes.state': 'attributes.status', 'operations.state': 'operations.status' } } + ) + await client.update( + DOMAIN_TX, + { 'tx.objectId': doc._id }, + { $rename: { 'tx.attributes.state': 'tx.attributes.status', 'tx.operations.state': 'tx.operations.status' } } + ) + } + await client.update(DOMAIN_TASK, { _id: { $in: toUpdate.map((p) => p._id) } }, { $rename: { state: 'status' } }) + } +} + +async function renameStatePrefs (client: MigrationUpgradeClient): Promise { + const txop = new TxOperations(client, core.account.System) + const prefs = await client.findAll(view.class.ViewletPreference, {}) + for (const pref of prefs) { + let update = false + const config = pref.config + for (let index = 0; index < config.length; index++) { + const conf = config[index] + if (typeof conf === 'string') { + if (conf === 'state') { + config[index] = 'status' + update = true + } else if (conf === '$lookup.state') { + config[index] = '$lookup.status' + update = true + } + } else if (conf.key === 'state') { + conf.key = 'status' + update = true + } + } + if (update) { + await txop.update(pref, { + config + }) + } + } + const res = await client.findAll(view.class.FilteredView, { filters: /"key":"state"/ as any }) + if (res.length > 0) { + for (const doc of res) { + const filters = JSON.parse(doc.filters) as Filter[] + for (const filter of filters) { + if (filter.key.key === 'state') { + filter.key.key = 'status' + } + } + await txop.update(doc, { + filters: JSON.stringify(filters) + }) + } + } +} + export const taskOperation: MigrateOperation = { - async migrate (client: MigrationClient): Promise {}, + async migrate (client: MigrationClient): Promise { + await renameState(client) + }, async upgrade (client: MigrationUpgradeClient): Promise { const tx = new TxOperations(client, core.account.System) await createDefaults(tx) @@ -144,5 +210,6 @@ export const taskOperation: MigrateOperation = { }, task.category.TaskTag ) + await renameStatePrefs(client) } } diff --git a/models/tracker/package.json b/models/tracker/package.json index 8918b3e8d2..261e0b8dd9 100644 --- a/models/tracker/package.json +++ b/models/tracker/package.json @@ -40,6 +40,7 @@ "@hcengineering/model-notification": "^0.6.0", "@hcengineering/tracker": "^0.6.10", "@hcengineering/tracker-resources": "^0.6.0", + "@hcengineering/model-task": "^0.6.0", "@hcengineering/model-chunter": "^0.6.0", "@hcengineering/workbench": "^0.6.8", "@hcengineering/view": "^0.6.8", diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index fe1f970b20..baade5be08 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -46,6 +46,7 @@ import { } from '@hcengineering/model' import attachment from '@hcengineering/model-attachment' import chunter from '@hcengineering/model-chunter' +import { TTask } from '@hcengineering/model-task' import core, { DOMAIN_SPACE, TAttachedDoc, TDoc, TSpace, TStatus, TType } from '@hcengineering/model-core' import view, { actionTemplates, classPresenter, createAction, showColorsViewOption } from '@hcengineering/model-view' import workbench, { createNavigateAction } from '@hcengineering/model-workbench' @@ -53,7 +54,7 @@ import notification from '@hcengineering/notification' import { IntlString } from '@hcengineering/platform' import setting from '@hcengineering/setting' import tags, { TagElement } from '@hcengineering/tags' -import task from '@hcengineering/task' +import task, { DoneState } from '@hcengineering/task' import { Component, Issue, @@ -150,9 +151,9 @@ export function TypeReportedTime (): Type { /** * @public */ -@Model(tracker.class.Issue, core.class.AttachedDoc, DOMAIN_TRACKER) +@Model(tracker.class.Issue, task.class.Task) @UX(tracker.string.Issue, tracker.icon.Issue, 'TSK', 'title') -export class TIssue extends TAttachedDoc implements Issue { +export class TIssue extends TTask implements Issue { @Prop(TypeRef(tracker.class.Issue), tracker.string.Parent) declare attachedTo: Ref @@ -202,14 +203,12 @@ export class TIssue extends TAttachedDoc implements Issue { parents!: IssueParentInfo[] - @Prop(Collection(chunter.class.Comment), tracker.string.Comments, { icon: chunter.icon.Chunter }) - comments!: number - - @Prop(Collection(attachment.class.Attachment), tracker.string.Attachments, { icon: attachment.icon.Attachment }) - attachments!: number - @Prop(Collection(tags.class.TagReference), tracker.string.Labels) - labels?: number + declare labels: number + + @Prop(TypeRef(task.class.DoneState), task.string.TaskStateDone, { _id: task.attribute.DoneState }) + @Hidden() + declare doneState: Ref | null @Prop(TypeRef(tracker.class.Project), tracker.string.Project, { icon: tracker.icon.Issues }) @Index(IndexKind.Indexed) diff --git a/models/tracker/src/migration.ts b/models/tracker/src/migration.ts index ff89fc19e3..2519236cfd 100644 --- a/models/tracker/src/migration.ts +++ b/models/tracker/src/migration.ts @@ -18,6 +18,8 @@ import { MigrateOperation, MigrationClient, MigrationUpgradeClient, createOrUpda import tags from '@hcengineering/tags' import { IssueStatus, Project, TimeReportDayType, createStatuses } from '@hcengineering/tracker' import tracker from './plugin' +import { DOMAIN_TRACKER } from '.' +import { DOMAIN_TASK } from '@hcengineering/model-task' async function createDefaultProject (tx: TxOperations): Promise { const current = await tx.findOne(tracker.class.Project, { @@ -86,8 +88,17 @@ async function fixProjectIcons (tx: TxOperations): Promise { await Promise.all(promises) } +async function moveIssues (client: MigrationClient): Promise { + const docs = await client.find(DOMAIN_TRACKER, { _class: tracker.class.Issue }) + if (docs.length > 0) { + await client.move(DOMAIN_TRACKER, { _class: tracker.class.Issue }, DOMAIN_TASK) + } +} + export const trackerOperation: MigrateOperation = { - async migrate (client: MigrationClient): Promise {}, + async migrate (client: MigrationClient): Promise { + await moveIssues(client) + }, async upgrade (client: MigrationUpgradeClient): Promise { const tx = new TxOperations(client, core.account.System) await createDefaults(tx) diff --git a/plugins/bitrix/src/hr.ts b/plugins/bitrix/src/hr.ts index 844a18587a..e0a3359a0a 100644 --- a/plugins/bitrix/src/hr.ts +++ b/plugins/bitrix/src/hr.ts @@ -62,7 +62,7 @@ export async function createApplication ( await client.addCollection(recruit.class.Applicant, _space, doc._id, recruit.mixin.Candidate, 'applications', { ...data, - state: state._id, + status: state._id, number: (incResult as any).object.sequence, rank: calcRank(lastOne, undefined) }) diff --git a/plugins/bitrix/src/utils.ts b/plugins/bitrix/src/utils.ts index 7cf39da9c8..665b30f323 100644 --- a/plugins/bitrix/src/utils.ts +++ b/plugins/bitrix/src/utils.ts @@ -517,8 +517,8 @@ export async function convert ( } if (existing !== undefined) { - if (existing.state !== state?._id) { - update.state = state._id + if (existing.status !== state?._id) { + update.status = state._id } if (Object.keys(update).length > 0) { await ops.update(existing, update) diff --git a/plugins/board-resources/src/components/CreateCard.svelte b/plugins/board-resources/src/components/CreateCard.svelte index c8fabe44a8..73c555efa2 100644 --- a/plugins/board-resources/src/components/CreateCard.svelte +++ b/plugins/board-resources/src/components/CreateCard.svelte @@ -52,7 +52,7 @@ const incResult = await client.update(sequence, { $inc: { sequence: 1 } }, true) const value: AttachedData = { - state: state._id, + status: state._id, doneState: null, number: (incResult as any).object.sequence, title, diff --git a/plugins/board-resources/src/components/EditCard.svelte b/plugins/board-resources/src/components/EditCard.svelte index 812c7fb934..ebc6b41c37 100644 --- a/plugins/board-resources/src/components/EditCard.svelte +++ b/plugins/board-resources/src/components/EditCard.svelte @@ -63,7 +63,7 @@ let checklists: TodoItem[] = [] const mixins: Mixin[] = [] const allowedCollections = ['labels'] - const ignoreKeys = ['isArchived', 'location', 'title', 'description', 'state', 'number', 'assignee', 'doneState'] + const ignoreKeys = ['isArchived', 'location', 'title', 'description', 'status', 'number', 'assignee', 'doneState'] function change (field: string, value: any) { if (object) { @@ -79,8 +79,8 @@ object = result[0] }) - $: object?.state && - stateQuery.query(task.class.State, { _id: object.state }, (result) => { + $: object?.status && + stateQuery.query(task.class.State, { _id: object.status }, (result) => { state = result[0] }) @@ -128,7 +128,7 @@
{space?.name}>{state?.title}{state?.name}
diff --git a/plugins/board-resources/src/components/KanbanView.svelte b/plugins/board-resources/src/components/KanbanView.svelte index 0307d7777b..424f78a4d7 100644 --- a/plugins/board-resources/src/components/KanbanView.svelte +++ b/plugins/board-resources/src/components/KanbanView.svelte @@ -125,7 +125,7 @@ } ) $: listProvider.update(cards) - $: groupByDocs = groupBy(cards, 'state') + $: groupByDocs = groupBy(cards, 'status') const getUpdateProps = (doc: Doc, category: CategoryType): DocumentUpdate | undefined => { const groupValue = diff --git a/plugins/board-resources/src/components/TableView.svelte b/plugins/board-resources/src/components/TableView.svelte index 60ab06b427..96f8e1f322 100644 --- a/plugins/board-resources/src/components/TableView.svelte +++ b/plugins/board-resources/src/components/TableView.svelte @@ -23,7 +23,7 @@ {_class} config={[ 'title', - 'state', + 'status', { key: '', presenter: tags.component.TagsPresenter, @@ -40,5 +40,5 @@ 'modifiedOn' ]} {options} - query={{ isArchived, state: { $in: states } }} + query={{ isArchived, status: { $in: states } }} /> diff --git a/plugins/board-resources/src/components/add-card/AddCard.svelte b/plugins/board-resources/src/components/add-card/AddCard.svelte index ef645e51f0..773408f8b6 100644 --- a/plugins/board-resources/src/components/add-card/AddCard.svelte +++ b/plugins/board-resources/src/components/add-card/AddCard.svelte @@ -40,7 +40,7 @@ const incResult = await client.update(sequence, { $inc: { sequence: 1 } }, true) const value: AttachedData = { - state: state._id, + status: state._id, doneState: null, number: (incResult as any).object.sequence, title, diff --git a/plugins/board-resources/src/components/popups/CopyCard.svelte b/plugins/board-resources/src/components/popups/CopyCard.svelte index 552ed4f17c..45cf2ed7c9 100644 --- a/plugins/board-resources/src/components/popups/CopyCard.svelte +++ b/plugins/board-resources/src/components/popups/CopyCard.svelte @@ -24,7 +24,7 @@ let status: Status = OK const selected = { space: value.space, - state: value.state, + status: value.status, rank: value.rank } @@ -39,7 +39,7 @@ const incResult = await client.update(sequence, { $inc: { sequence: 1 } }, true) const copy: AttachedData = { - state: selected.state, + status: selected.status, doneState: null, number: (incResult as any).object.sequence, title, @@ -119,18 +119,18 @@