Fix Candidate attachedToClass migration and add DoneState to Applicants (#817)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2022-01-14 16:04:01 +07:00 committed by GitHub
parent cab04d037d
commit 0e12210e8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 2 deletions

View File

@ -16,7 +16,10 @@
import { Person } from '@anticrm/contact'
import core, { AttachedDoc, Class, Doc, DOMAIN_TX, MixinData, Ref, TxCollectionCUD, TxCreateDoc, TxMixin, TxUpdateDoc } from '@anticrm/core'
import { MigrateOperation, MigrationClient, MigrationResult, MigrationUpgradeClient } from '@anticrm/model'
import { DOMAIN_ATTACHMENT } from '@anticrm/model-attachment'
import { DOMAIN_COMMENT } from '@anticrm/model-chunter'
import contact, { DOMAIN_CONTACT } from '@anticrm/model-contact'
import { DOMAIN_TASK } from '@anticrm/model-task'
import recruit, { Candidate } from '@anticrm/recruit'
function toCandidateData (c: Pick<Candidate, 'onsite'|'title'|'remote'|'source'> | undefined): MixinData<Person, Candidate> {
@ -61,6 +64,30 @@ export const recruitOperation: MigrateOperation = {
_class: contact.class.Person
})
await client.update(DOMAIN_TASK, {
attachedToClass: 'recruit:class:Candidate' as Ref<Class<Doc>>
}, {
attachedToClass: recruit.mixin.Candidate
})
await client.update(DOMAIN_ATTACHMENT, {
attachedToClass: 'recruit:class:Candidate' as Ref<Class<Doc>>
}, {
attachedToClass: recruit.mixin.Candidate
})
await client.update(DOMAIN_ATTACHMENT, {
attachedToClass: 'recruit:class:Candidate' as Ref<Class<Doc>>
}, {
attachedToClass: recruit.mixin.Candidate
})
await client.update(DOMAIN_COMMENT, {
attachedToClass: 'recruit:class:Candidate' as Ref<Class<Doc>>
}, {
attachedToClass: recruit.mixin.Candidate
})
// Migrate Create operations.
await client.update(DOMAIN_TX, {
_class: core.class.TxCreateDoc,

View File

@ -41,12 +41,13 @@
{#if applications > 0}
<Table
_class={recruit.class.Applicant}
config={['', '$lookup.space.name', '$lookup.state']}
config={['', '$lookup.space.name', '$lookup.state', '$lookup.doneState']}
options={
{
lookup: {
state: task.class.State,
space: core.class.Space
space: core.class.Space,
doneState: task.class.DoneState
}
}
}