Fix skills target and application labels (#1896)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2022-05-29 11:32:39 +07:00 committed by GitHub
parent 79bce33abc
commit b6c8994999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 23 deletions

View File

@ -92,20 +92,6 @@ async function createDefaults (tx: TxOperations): Promise<void> {
await createSequence(tx, recruit.class.Opinion)
await createSequence(tx, recruit.class.Applicant)
await createDefaultKanbanTemplate(tx)
await createOrUpdate(
tx,
tags.class.TagCategory,
tags.space.Tags,
{
icon: tags.icon.Tags,
label: 'Text Label',
targetClass: recruit.class.Applicant,
tags: [],
default: true
},
recruit.category.OtherLabel
)
}
async function createDefaultKanbanTemplate (tx: TxOperations): Promise<Ref<KanbanTemplate>> {

View File

@ -41,6 +41,7 @@
"@anticrm/workbench": "~0.6.1",
"@anticrm/view": "~0.6.0",
"@anticrm/model-presentation": "~0.6.0",
"@anticrm/tags": "~0.6.2"
"@anticrm/tags": "~0.6.2",
"@anticrm/model-tags": "~0.6.0"
}
}

View File

@ -14,11 +14,12 @@
//
import { Class, Doc, Ref, Space, TxOperations } from '@anticrm/core'
import { MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@anticrm/model'
import { createOrUpdate, MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@anticrm/model'
import core from '@anticrm/model-core'
import { KanbanTemplate, StateTemplate, DoneStateTemplate, genRanks, createKanban } from '@anticrm/task'
import { DOMAIN_TASK } from '.'
import task from './plugin'
import tags from '@anticrm/model-tags'
/**
* @public
@ -196,5 +197,19 @@ export const taskOperation: MigrateOperation = {
async upgrade (client: MigrationUpgradeClient): Promise<void> {
const tx = new TxOperations(client, core.account.System)
await createDefaults(tx)
await createOrUpdate(
tx,
tags.class.TagCategory,
tags.space.Tags,
{
icon: tags.icon.Tags,
label: 'Text Label',
targetClass: task.class.Task,
tags: [],
default: true
},
task.category.TaskTag
)
}
}

View File

@ -18,6 +18,7 @@ import type { Ref, Space } from '@anticrm/core'
import { ObjectSearchCategory, ObjectSearchFactory } from '@anticrm/model-presentation'
import type { Resource } from '@anticrm/platform'
import { mergeIds } from '@anticrm/platform'
import { TagCategory } from '@anticrm/tags'
import { KanbanTemplate, taskId } from '@anticrm/task'
import task from '@anticrm/task-resources/src/plugin'
import type { AnyComponent } from '@anticrm/ui'
@ -39,7 +40,8 @@ export default mergeIds(taskId, task, {
UnarchiveSpace: '' as ViewAction
},
category: {
Task: '' as Ref<ActionCategory>
Task: '' as Ref<ActionCategory>,
TaskTag: '' as Ref<TagCategory>
},
component: {
ProjectView: '' as AnyComponent,

View File

@ -112,8 +112,7 @@ export default mergeIds(recruitId, recruit, {
},
category: {
Other: '' as Ref<TagCategory>,
Category: '' as Ref<TagCategory>,
OtherLabel: '' as Ref<TagCategory>
Category: '' as Ref<TagCategory>
},
component: {
VacancyItemPresenter: '' as AnyComponent,

View File

@ -30,7 +30,7 @@
$: query.query(
tags.class.TagReference,
{ attachedTo: object._id, attachedToClass: object._class },
{ attachedTo: object._id, attachedToClass: _class },
(result) => {
items = result
},
@ -38,7 +38,7 @@
)
async function addRef (tag: TagElement): Promise<void> {
await client.addCollection(tags.class.TagReference, object.space, object._id, object._class, key.key, {
await client.addCollection(tags.class.TagReference, object.space, object._id, _class, key.key, {
title: tag.title,
tag: tag._id,
color: tag.color
@ -46,7 +46,7 @@
}
async function removeTag (id: Ref<TagReference>): Promise<void> {
await client.removeCollection(tags.class.TagReference, object.space, id, object._id, object._class, key.key)
await client.removeCollection(tags.class.TagReference, object.space, id, object._id, _class, key.key)
}
let elements: Map<Ref<TagElement>, TagElement> = new Map()
@ -60,7 +60,7 @@
bind:elements
{key}
bind:items
targetClass={object._class}
targetClass={_class}
on:open={(evt) => addRef(evt.detail)}
on:delete={(evt) => removeTag(evt.detail)}
/>