mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-04 23:04:47 +00:00
parent
a5fbf5b59e
commit
9dbdf4dba8
@ -660,7 +660,9 @@ async function createTalants (
|
|||||||
const document = await recognize(rekoniUrl, data.base64Data, token)
|
const document = await recognize(rekoniUrl, data.base64Data, token)
|
||||||
if (document !== undefined) {
|
if (document !== undefined) {
|
||||||
if (document.title !== undefined) {
|
if (document.title !== undefined) {
|
||||||
await client.update(doc, { title: document.title })
|
await client.updateMixin(doc._id, contact.class.Person, doc.space, recruit.mixin.Candidate, {
|
||||||
|
title: document.title
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
await updateAvatar(doc, document, connection, client)
|
await updateAvatar(doc, document, connection, client)
|
||||||
|
@ -87,11 +87,13 @@ const builders: [(b: Builder) => void, string][] = [
|
|||||||
[preferenceModel, 'preference'],
|
[preferenceModel, 'preference'],
|
||||||
[hrModel, 'hr'],
|
[hrModel, 'hr'],
|
||||||
[documentModel, 'document'],
|
[documentModel, 'document'],
|
||||||
|
[trackerModel, 'tracker'],
|
||||||
|
[boardModel, 'board'],
|
||||||
|
[calendarModel, 'calendar'],
|
||||||
|
|
||||||
[serverCoreModel, 'server-core'],
|
[serverCoreModel, 'server-core'],
|
||||||
[serverAttachmentModel, 'server-attachment'],
|
[serverAttachmentModel, 'server-attachment'],
|
||||||
[serverContactModel, 'server-contact'],
|
[serverContactModel, 'server-contact'],
|
||||||
[serverNotificationModel, 'server-notification'],
|
|
||||||
[serveSettingModel, 'server-setting'],
|
[serveSettingModel, 'server-setting'],
|
||||||
[serverChunterModel, 'server-chunter'],
|
[serverChunterModel, 'server-chunter'],
|
||||||
[serverInventoryModel, 'server-inventory'],
|
[serverInventoryModel, 'server-inventory'],
|
||||||
@ -104,9 +106,7 @@ const builders: [(b: Builder) => void, string][] = [
|
|||||||
[serverGmailModel, 'server-gmail'],
|
[serverGmailModel, 'server-gmail'],
|
||||||
[serverTelegramModel, 'server-telegram'],
|
[serverTelegramModel, 'server-telegram'],
|
||||||
[serverHrModel, 'server-hr'],
|
[serverHrModel, 'server-hr'],
|
||||||
[trackerModel, 'tracker'],
|
[serverNotificationModel, 'server-notification'],
|
||||||
[boardModel, 'board'],
|
|
||||||
[calendarModel, 'calendar'],
|
|
||||||
[automationModel, 'automation']
|
[automationModel, 'automation']
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -26,8 +26,21 @@ import { getCategories } from '@anticrm/skillset'
|
|||||||
import { KanbanTemplate } from '@hcengineering/task'
|
import { KanbanTemplate } from '@hcengineering/task'
|
||||||
import recruit from './plugin'
|
import recruit from './plugin'
|
||||||
|
|
||||||
|
async function fixImportedTitle (client: MigrationClient): Promise<void> {
|
||||||
|
await client.update(
|
||||||
|
DOMAIN_CONTACT,
|
||||||
|
{
|
||||||
|
title: { $exists: true }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$rename: { title: 'recruit:mixin:Candidate.title' }
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
export const recruitOperation: MigrateOperation = {
|
export const recruitOperation: MigrateOperation = {
|
||||||
async migrate (client: MigrationClient): Promise<void> {
|
async migrate (client: MigrationClient): Promise<void> {
|
||||||
|
await fixImportedTitle(client)
|
||||||
await client.update(
|
await client.update(
|
||||||
DOMAIN_CALENDAR,
|
DOMAIN_CALENDAR,
|
||||||
{
|
{
|
||||||
|
@ -161,7 +161,12 @@ export class TxOperations implements Omit<Client, 'notify'> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update<T extends Doc>(doc: T, update: DocumentUpdate<T>, retrieve?: boolean): Promise<TxResult> {
|
update<T extends Doc>(doc: T, update: DocumentUpdate<T>, retrieve?: boolean): Promise<TxResult> {
|
||||||
if (this.client.getHierarchy().isDerived(doc._class, core.class.AttachedDoc)) {
|
const hierarchy = this.client.getHierarchy()
|
||||||
|
if (hierarchy.isMixin(doc._class)) {
|
||||||
|
const baseClass = hierarchy.getBaseClass(doc._class)
|
||||||
|
return this.updateMixin(doc._id, baseClass, doc.space, doc._class, update)
|
||||||
|
}
|
||||||
|
if (hierarchy.isDerived(doc._class, core.class.AttachedDoc)) {
|
||||||
const adoc = doc as unknown as AttachedDoc
|
const adoc = doc as unknown as AttachedDoc
|
||||||
return this.updateCollection(
|
return this.updateCollection(
|
||||||
doc._class,
|
doc._class,
|
||||||
|
Loading…
Reference in New Issue
Block a user