-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dvinyanin Alexandr <[email protected]>
- Loading branch information
Showing
12 changed files
with
58 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Doc, Ref, TxOperations } from '@anticrm/core' | ||
import { Lead } from '@anticrm/lead' | ||
import lead from './plugin' | ||
|
||
export async function getLeadTitle (client: TxOperations, ref: Ref<Doc>): Promise<string> { | ||
const object = await client.findOne(lead.class.Lead, { _id: ref as Ref<Lead> }) | ||
if (object === undefined) throw new Error(`Lead not found, _id: ${ref}`) | ||
return `LEAD-${object.number}` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import core, { Doc, Ref, TxOperations } from '@anticrm/core' | ||
import { translate } from '@anticrm/platform' | ||
import { Applicant } from '@anticrm/recruit' | ||
import recruit from './plugin' | ||
|
||
export async function getApplicationTitle (client: TxOperations, ref: Ref<Doc>): Promise<string> { | ||
const object = await client.findOne( | ||
recruit.class.Applicant, | ||
{ _id: ref as Ref<Applicant> }, | ||
{ lookup: { _class: core.class.Class } } | ||
) | ||
if (object?.$lookup?._class?.shortLabel === undefined) { | ||
throw new Error(`Application shortLabel not found, _id: ${ref}`) | ||
} | ||
const label = await translate(object.$lookup._class.shortLabel, {}) | ||
return `${label}-${object.number}` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters