From 98055e4dc4775123df9771b8aa36bd1edb2b5e21 Mon Sep 17 00:00:00 2001 From: Vyacheslav Tumanov Date: Sat, 29 Jul 2023 14:20:25 +0500 Subject: [PATCH] ATS-13: Copy ID action (#3533) Signed-off-by: Vyacheslav Tumanov --- models/recruit/src/index.ts | 22 ++++++++++++++++++++++ models/recruit/src/plugin.ts | 6 ++++-- plugins/recruit-assets/lang/en.json | 3 ++- plugins/recruit-assets/lang/ru.json | 3 ++- plugins/recruit-resources/src/index.ts | 2 ++ plugins/recruit-resources/src/plugin.ts | 3 ++- plugins/recruit-resources/src/utils.ts | 4 ++++ 7 files changed, 38 insertions(+), 5 deletions(-) diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index c13e0a26a3..7b5fb162c0 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -1453,4 +1453,26 @@ export function createModel (builder: Builder): void { }, recruit.action.MoveApplicant ) + + createAction( + builder, + { + action: view.actionImpl.CopyTextToClipboard, + actionProps: { + textProvider: recruit.function.GetTalentId + }, + label: recruit.string.GetTalentIds, + icon: view.icon.CopyId, + keyBinding: [], + input: 'any', + category: recruit.category.Recruit, + target: recruit.mixin.Candidate, + context: { + mode: ['context', 'browser'], + application: recruit.app.Recruit, + group: 'copy' + } + }, + recruit.action.GetTalentIds + ) } diff --git a/models/recruit/src/plugin.ts b/models/recruit/src/plugin.ts index 2ffc4a5091..dea41a2803 100644 --- a/models/recruit/src/plugin.ts +++ b/models/recruit/src/plugin.ts @@ -30,7 +30,8 @@ export default mergeIds(recruitId, recruit, { CopyApplicationId: '' as Ref, CopyApplicationLink: '' as Ref, CopyCandidateLink: '' as Ref, - MoveApplicant: '' as Ref + MoveApplicant: '' as Ref, + GetTalentIds: '' as Ref }, actionImpl: { CreateOpinion: '' as ViewAction, @@ -42,7 +43,8 @@ export default mergeIds(recruitId, recruit, { function: { GetObjectLinkFragment: '' as Resource<(doc: Doc, props: Record) => Promise>, GetIdObjectLinkFragment: '' as Resource<(doc: Doc, props: Record) => Promise>, - GetObjectLink: '' as Resource<(doc: Doc, props: Record) => Promise> + GetObjectLink: '' as Resource<(doc: Doc, props: Record) => Promise>, + GetTalentId: '' as Resource<(doc: Doc, props: Record) => Promise> }, string: { ApplicationsShort: '' as IntlString, diff --git a/plugins/recruit-assets/lang/en.json b/plugins/recruit-assets/lang/en.json index fd4ebbeed6..b0edd6120b 100644 --- a/plugins/recruit-assets/lang/en.json +++ b/plugins/recruit-assets/lang/en.json @@ -117,7 +117,8 @@ "ConfigDescription": "Extension to manage Talents/Applicants and Vacancies.", "MyApplications": "My applications", - "ShowApplications": "Show applications" + "ShowApplications": "Show applications", + "GetTalentIds": "Get talents' ids" }, "status": { "ApplicationExists": "Application already exists", diff --git a/plugins/recruit-assets/lang/ru.json b/plugins/recruit-assets/lang/ru.json index 02c73c41af..be3622cd06 100644 --- a/plugins/recruit-assets/lang/ru.json +++ b/plugins/recruit-assets/lang/ru.json @@ -117,7 +117,8 @@ "ConfigDescription": "Модуль по работе с талантами/кандидатами и вакансиями", "MyApplications": "Мои кандидаты", - "ShowApplications": "Показать кандидатов" + "ShowApplications": "Показать кандидатов", + "GetTalentIds": "Получить ID талантов" }, "status": { "ApplicationExists": "Кандидат уже существует", diff --git a/plugins/recruit-resources/src/index.ts b/plugins/recruit-resources/src/index.ts index 134719a40f..1259b163f7 100644 --- a/plugins/recruit-resources/src/index.ts +++ b/plugins/recruit-resources/src/index.ts @@ -70,6 +70,7 @@ import { getRevTitle, getSequenceId, getSequenceLink, + getTalentId, getVacTitle, objectLinkProvider, resolveLocation @@ -335,6 +336,7 @@ export default async (): Promise => ({ VacTitleProvider: getVacTitle, RevTitleProvider: getRevTitle, IdProvider: getSequenceId, + GetTalentId: getTalentId, HasActiveApplicant: hasActiveApplicant, HasNoActiveApplicant: hasNoActiveApplicant, NoneApplications: noneApplicant, diff --git a/plugins/recruit-resources/src/plugin.ts b/plugins/recruit-resources/src/plugin.ts index b76b03df58..3848dc3d3d 100644 --- a/plugins/recruit-resources/src/plugin.ts +++ b/plugins/recruit-resources/src/plugin.ts @@ -131,7 +131,8 @@ export default mergeIds(recruitId, recruit, { TemplateReplaceConfirm: '' as IntlString, Apply: '' as IntlString, OpenVacancyList: '' as IntlString, - Export: '' as IntlString + Export: '' as IntlString, + GetTalentIds: '' as IntlString }, space: { CandidatesPublic: '' as Ref diff --git a/plugins/recruit-resources/src/utils.ts b/plugins/recruit-resources/src/utils.ts index df3e787fad..4de2dff6dc 100644 --- a/plugins/recruit-resources/src/utils.ts +++ b/plugins/recruit-resources/src/utils.ts @@ -196,3 +196,7 @@ export async function getSequenceId (doc: RecruitDocument): Promise { return label !== undefined ? `${label}-${doc.number}` : doc.number.toString() } + +export async function getTalentId (doc: Candidate): Promise { + return doc._id +}