Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions models/recruit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,16 @@ export function createModel (builder: Builder): void {
label: recruit.string.Applications
},
'comments',
{
key: '',
presenter: tags.component.TagsPresenter,
label: task.string.TaskLabels,
sortingKey: 'labels',
props: {
_class: recruit.class.Vacancy,
key: 'labels'
}
},
'$lookup.company',
'$lookup.company.$lookup.channels',
{
Expand Down
19 changes: 19 additions & 0 deletions models/recruit/src/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,25 @@ export const recruitOperation: MigrateOperation = {
const tx = new TxOperations(client, core.account.System)
await createDefaults(client, tx)
}
},
{
state: 'create-vacancy-tag-category',
func: async (client) => {
const tx = new TxOperations(client, core.account.System)
await createOrUpdate(
tx,
tags.class.TagCategory,
core.space.Workspace,
{
icon: tags.icon.Tags,
label: 'Other',
targetClass: recruit.class.Vacancy,
tags: [],
default: true
},
recruit.category.VacancyOther
)
}
}
])
}
Expand Down
3 changes: 3 additions & 0 deletions models/recruit/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export class TVacancy extends TProject implements Vacancy {

@Prop(TypeCollection(survey.class.Poll), survey.string.Polls)
polls?: Collection<Poll>

@Prop(TypeCollection(tags.class.TagReference, task.string.TaskLabels), task.string.TaskLabels)
labels?: number
}

@Mixin(recruit.mixin.Candidate, contact.class.Person)
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
"CreateNewSkills": "Vytvořit nové dovednosti, pokud neexistují",
"SwapFirstAndLastNames": "Vyměňte jméno a příjmení",
"ForbidCreateVacancyPermission": "Zakázat vytvoření pozice",
"ForbidCreateVacancyPermissionDescription": "Zakazuje uživatelům vytvářet nové volné pozice"
"ForbidCreateVacancyPermissionDescription": "Zakazuje uživatelům vytvářet nové volné pozice",
"NumberLabels": "{count, plural, =0 {žádné štítky} =1 {1 štítek} other {# štítků}}"
},
"status": {
"ApplicationExists": "Přihláška již existuje",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
"CreateNewSkills": "Neue Fähigkeiten erstellen, wenn keine bestehenden gefunden werden",
"SwapFirstAndLastNames": "Vor- und Nachnamen tauschen",
"ForbidCreateVacancyPermission": "Stellenerstellung verbieten",
"ForbidCreateVacancyPermissionDescription": "Verbietet Benutzern das Erstellen neuer Stellenangebote"
"ForbidCreateVacancyPermissionDescription": "Verbietet Benutzern das Erstellen neuer Stellenangebote",
"NumberLabels": "{count, plural, =0 {keine Labels} =1 {1 Label} other {# Labels}}"
},
"status": {
"ApplicationExists": "Bewerbung existiert bereits",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
"CreateNewSkills": "Create new skills if existing not found",
"SwapFirstAndLastNames": "Swap first and last names",
"ForbidCreateVacancyPermission": "Forbid create vacancy",
"ForbidCreateVacancyPermissionDescription": "Forbid users creating new vacancies"
"ForbidCreateVacancyPermissionDescription": "Forbid users creating new vacancies",
"NumberLabels": "{count, plural, =0 {no labels} =1 {1 label} other {# labels}}"
},
"status": {
"ApplicationExists": "Application already exists",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
"CreateNewSkills": "Crear nuevas habilidades si no se encuentran las existentes",
"SwapFirstAndLastNames": "Intercambie nombres y apellidos",
"ForbidCreateVacancyPermission": "Prohibir crear vacante",
"ForbidCreateVacancyPermissionDescription": "Prohíbe a los usuarios crear nuevas vacantes"
"ForbidCreateVacancyPermissionDescription": "Prohíbe a los usuarios crear nuevas vacantes",
"NumberLabels": "{count, plural, =0 {sin etiquetas} =1 {1 etiqueta} other {# etiquetas}}"
},
"status": {
"ApplicationExists": "La solicitud ya existe",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
"CreateNewSkills": "Créer de nouvelles compétences si les existantes ne sont pas trouvées",
"SwapFirstAndLastNames": "Permuter le prénom et le nom",
"ForbidCreateVacancyPermission": "Interdire la création de poste vacant",
"ForbidCreateVacancyPermissionDescription": "Interdit aux utilisateurs de créer de nouveaux postes vacants"
"ForbidCreateVacancyPermissionDescription": "Interdit aux utilisateurs de créer de nouveaux postes vacants",
"NumberLabels": "{count, plural, =0 {aucune étiquette} =1 {1 étiquette} other {# étiquettes}}"
},
"status": {
"ApplicationExists": "La candidature existe déjà",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"CreateNewSkills": "Crea nuove competenze se quelle esistenti non vengono trovate",
"SwapFirstAndLastNames": "Scambia nome e cognome",
"ForbidCreateVacancyPermission": "Vieta creazione posizione aperta",
"ForbidCreateVacancyPermissionDescription": "Vieta agli utenti di creare nuove posizioni aperte"
"ForbidCreateVacancyPermissionDescription": "Vieta agli utenti di creare nuove posizioni aperte",
"NumberLabels": "{count, plural, =0 {nessuna etichetta} =1 {1 etichetta} other {# etichette}}"
},
"status": {
"ApplicationExists": "La candidatura esiste già",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
"CreateNewSkills": "既存のスキルが見つからない場合は新しいスキルを作成",
"SwapFirstAndLastNames": "名と姓を入れ替える",
"ForbidCreateVacancyPermission": "求人の作成禁止",
"ForbidCreateVacancyPermissionDescription": "ユーザーが新しい求人を作成することを禁止します"
"ForbidCreateVacancyPermissionDescription": "ユーザーが新しい求人を作成することを禁止します",
"NumberLabels": "{count, plural, =0 {ラベルなし} =1 {1 ラベル} other {# ラベル}}"
},
"status": {
"ApplicationExists": "応募はすでに存在します",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
"CreateNewSkills": "기존 스킬이 없으면 새로 만들기",
"SwapFirstAndLastNames": "이름과 성 바꾸기",
"ForbidCreateVacancyPermission": "채용 공고 생성 금지",
"ForbidCreateVacancyPermissionDescription": "사용자의 새 채용 공고 생성을 금지합니다"
"ForbidCreateVacancyPermissionDescription": "사용자의 새 채용 공고 생성을 금지합니다",
"NumberLabels": "{count, plural, =0 {라벨 없음} =1 {라벨 1개} other {라벨 #개}}"
},
"status": {
"ApplicationExists": "이미 존재하는 지원입니다",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
"CreateNewSkills": "Utwórz nowe umiejętności, jeśli nie istnieją",
"SwapFirstAndLastNames": "Zamień imię i nazwisko",
"ForbidCreateVacancyPermission": "Zabroń tworzenia wolnych stanowisk",
"ForbidCreateVacancyPermissionDescription": "Zabroń użytkownikom tworzenia nowych stanowisk"
"ForbidCreateVacancyPermissionDescription": "Zabroń użytkownikom tworzenia nowych stanowisk",
"NumberLabels": "{count, plural, =0 {brak etykiet} =1 {1 etykieta} few {# etykiety} other {# etykiet}}"
},
"status": {
"ApplicationExists": "Aplikacja już istnieje",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
"CreateNewSkills": "Criar novas competências se as existentes não forem encontradas",
"SwapFirstAndLastNames": "Trocar primeiro e último nome",
"ForbidCreateVacancyPermission": "Proibir criação de vaga",
"ForbidCreateVacancyPermissionDescription": "Proíbe os utilizadores de criar novas vagas"
"ForbidCreateVacancyPermissionDescription": "Proíbe os utilizadores de criar novas vagas",
"NumberLabels": "{count, plural, =0 {sem etiquetas} =1 {1 etiqueta} other {# etiquetas}}"
},
"status": {
"ApplicationExists": "A candidatura já existe",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
"CreateNewSkills": "Criar novas competências se as existentes não forem encontradas",
"SwapFirstAndLastNames": "Trocar primeiro e último nome",
"ForbidCreateVacancyPermission": "Proibir criação de vaga",
"ForbidCreateVacancyPermissionDescription": "Proíbe os utilizadores de criar novas vagas"
"ForbidCreateVacancyPermissionDescription": "Proíbe os utilizadores de criar novas vagas",
"NumberLabels": "{count, plural, =0 {sem etiquetas} =1 {1 etiqueta} other {# etiquetas}}"
},
"status": {
"ApplicationExists": "A candidatura já existe",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
"CreateNewSkills": "Создать навыки, если не найдены существующие",
"SwapFirstAndLastNames": "Поменять местами имя и фамилию",
"ForbidCreateVacancyPermission": "Запретить создание вакансии",
"ForbidCreateVacancyPermissionDescription": "Запрещает пользователям создавать новые вакансии"
"ForbidCreateVacancyPermissionDescription": "Запрещает пользователям создавать новые вакансии",
"NumberLabels": "{count, plural, =0 {нет меток} one {# метка} few {# метки} other {# меток}}"
},
"status": {
"ApplicationExists": "Кандидат уже существует",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
"CreateNewSkills": "Mevcut bulunamazsa yeni yetenekler oluştur",
"SwapFirstAndLastNames": "Ad ve soyadı değiştir",
"ForbidCreateVacancyPermission": "İş ilanı oluşturmayı yasakla",
"ForbidCreateVacancyPermissionDescription": "Kullanıcıların yeni iş ilanı oluşturmasını yasaklar"
"ForbidCreateVacancyPermissionDescription": "Kullanıcıların yeni iş ilanı oluşturmasını yasaklar",
"NumberLabels": "{count, plural, =0 {etiket yok} =1 {1 etiket} other {# etiket}}"
},
"status": {
"ApplicationExists": "Başvuru zaten mevcut",
Expand Down
3 changes: 2 additions & 1 deletion plugins/recruit-assets/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
"CreateNewSkills": "如果未找到现有技能,则创建新技能",
"SwapFirstAndLastNames": "交换名字和姓氏",
"ForbidCreateVacancyPermission": "禁止创建职位",
"ForbidCreateVacancyPermissionDescription": "禁止用户创建新职位"
"ForbidCreateVacancyPermissionDescription": "禁止用户创建新职位",
"NumberLabels": "{count, plural, =0 {无标签} =1 {1 个标签} other {# 个标签}}"
},
"status": {
"ApplicationExists": "申请已存在",
Expand Down
55 changes: 54 additions & 1 deletion plugins/recruit-resources/src/components/CreateVacancy.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import core, {
AttachedData,
Data,
Doc,
PersonId,
Ref,
Role,
RolesAssignment,
Expand All @@ -39,7 +41,7 @@
getClient
} from '@hcengineering/presentation'
import { RecruitEvents, Vacancy, Vacancy as VacancyClass } from '@hcengineering/recruit'
import tags from '@hcengineering/tags'
import tags, { TagElement, TagReference } from '@hcengineering/tags'
import task, { ProjectType } from '@hcengineering/task'
import { selectedTypeStore, typeStore } from '@hcengineering/task-resources'
import tracker, { Issue, IssueStatus, IssueTemplate, IssueTemplateData, Project } from '@hcengineering/tracker'
Expand Down Expand Up @@ -110,6 +112,32 @@
const hierarchy = client.getHierarchy()
const templateQ = createQuery()
fillDefaults(hierarchy, vacancyData, recruit.class.Vacancy)

let labels: TagReference[] = []
const labelsKey = {
key: 'labels',
attr: hierarchy.getAttribute(recruit.class.Vacancy, 'labels')
}

function addTagRef (tag: TagElement): void {
labels = [
...labels,
{
_class: tags.class.TagReference,
_id: generateId(),
attachedTo: '' as Ref<Doc>,
attachedToClass: recruit.class.Vacancy,
collection: 'labels',
space: core.space.Space,
modifiedOn: 0,
modifiedBy: '' as PersonId,
title: tag.title,
tag: tag._id,
color: tag.color
}
]
}

$: typeId &&
templateQ.query(task.class.ProjectType, { _id: typeId }, (result) => {
const { _class, _id, description, targetClass, ...templateData } = result[0]
Expand Down Expand Up @@ -254,6 +282,13 @@

const ops = client.apply()
const id = await ops.createDoc(recruit.class.Vacancy, core.space.Space, data, objectId)
for (const label of labels) {
await ops.addCollection(tags.class.TagReference, core.space.Space, id, recruit.class.Vacancy, 'labels', {
title: label.title,
color: label.color,
tag: label.tag
})
}
await descriptionBox.createAttachments(undefined, ops)
await ops.commit()
Analytics.handleEvent(RecruitEvents.VacancyCreated, {
Expand Down Expand Up @@ -415,6 +450,24 @@
size={'large'}
/>

<Component
is={tags.component.TagsDropdownEditor}
props={{
items: labels,
key: labelsKey,
targetClass: recruit.class.Vacancy,
countLabel: recruit.string.NumberLabels,
kind: 'regular',
size: 'large'
}}
on:open={(evt) => {
addTagRef(evt.detail)
}}
on:delete={(evt) => {
labels = labels.filter((it) => it.tag !== evt.detail._id)
}}
/>

{#each roles as role}
<AccountArrayEditor
value={rolesAssignment?.[role._id] ?? []}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
{mixins}
{readonly}
ignoreKeys={['name', 'fullDescription', 'private', 'archived', 'type', 'owners']}
allowedCollections={['labels']}
/>
{/if}
</svelte:fragment>
Expand Down
6 changes: 4 additions & 2 deletions plugins/recruit-resources/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ export default mergeIds(recruitId, recruit, {
Export: '' as IntlString,
GetTalentIds: '' as IntlString,
CreateNewSkills: '' as IntlString,
SwapFirstAndLastNames: '' as IntlString
SwapFirstAndLastNames: '' as IntlString,
NumberLabels: '' as IntlString
},
category: {
Other: '' as Ref<TagCategory>,
Category: '' as Ref<TagCategory>
Category: '' as Ref<TagCategory>,
VacancyOther: '' as Ref<TagCategory>
},
completion: {
ApplicationQuery: '' as Resource<ObjectSearchFactory>,
Expand Down
1 change: 1 addition & 0 deletions plugins/recruit/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface Vacancy extends Project {
comments?: number
number: number
polls?: Collection<Poll>
labels?: number
}

/** @public */
Expand Down
Loading