diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index f8e9d934ad..8dcb08204c 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -30,6 +30,7 @@ import { UX } from '@anticrm/model' import attachment from '@anticrm/model-attachment' +import calendar from '@anticrm/model-calendar' import chunter from '@anticrm/model-chunter' import contact, { TPerson } from '@anticrm/model-contact' import core, { TSpace } from '@anticrm/model-core' @@ -39,10 +40,9 @@ import task, { TSpaceWithStates, TTask } from '@anticrm/model-task' import view from '@anticrm/model-view' import workbench from '@anticrm/model-workbench' import { Applicant, Candidate, Candidates, Vacancy } from '@anticrm/recruit' -import { TOpinion, TReview, TReviewCategory } from './review-model' import recruit from './plugin' import { createReviewModel, reviewTableConfig, reviewTableOptions } from './review' -import calendar from '@anticrm/model-calendar' +import { TOpinion, TReview, TReviewCategory } from './review-model' @Model(recruit.class.Vacancy, task.class.SpaceWithStates) @UX(recruit.string.Vacancy, recruit.icon.Vacancy) @@ -106,6 +106,10 @@ export class TApplicant extends TTask implements Applicant { @Prop(TypeRef(recruit.mixin.Candidate), recruit.string.Candidate) declare attachedTo: Ref + // We need to declare, to provide property with label + @Prop(TypeRef(recruit.class.Vacancy), recruit.string.Vacancy) + declare space: Ref + @Prop(Collection(attachment.class.Attachment), attachment.string.Attachments) attachments?: number @@ -160,6 +164,14 @@ export function createModel (builder: Builder): void { createItemLabel: recruit.string.VacancyCreateLabel, position: 'bottom' }, + { + id: 'applicants', + component: recruit.component.ApplicationsView, + icon: recruit.icon.Application, + label: recruit.string.Applications, + createItemLabel: recruit.string.ApplicationCreateLabel, + position: 'bottom' + }, { id: 'candidates', component: recruit.component.Candidates, diff --git a/models/recruit/src/plugin.ts b/models/recruit/src/plugin.ts index a86fe6da22..cdcf5b30dd 100644 --- a/models/recruit/src/plugin.ts +++ b/models/recruit/src/plugin.ts @@ -77,7 +77,8 @@ export default mergeIds(recruitId, recruit, { EditReview: '' as AnyComponent, ReviewPresenter: '' as AnyComponent, Opinions: '' as AnyComponent, - OpinionPresenter: '' as AnyComponent + OpinionPresenter: '' as AnyComponent, + ApplicationsView: '' as AnyComponent }, template: { DefaultVacancy: '' as Ref, diff --git a/plugins/recruit-resources/src/components/ApplicationsView.svelte b/plugins/recruit-resources/src/components/ApplicationsView.svelte new file mode 100644 index 0000000000..be8a857228 --- /dev/null +++ b/plugins/recruit-resources/src/components/ApplicationsView.svelte @@ -0,0 +1,90 @@ + + + + +
+
+
+ +
+ + { updateResultQuery(search) }} /> +
+ + + + diff --git a/plugins/recruit-resources/src/index.ts b/plugins/recruit-resources/src/index.ts index 6b4e598862..957a58c82c 100644 --- a/plugins/recruit-resources/src/index.ts +++ b/plugins/recruit-resources/src/index.ts @@ -48,6 +48,7 @@ import VacancyPresenter from './components/VacancyPresenter.svelte' import VacancyCountPresenter from './components/VacancyCountPresenter.svelte' import VacancyModifiedPresenter from './components/VacancyModifiedPresenter.svelte' import ReviewCategoryPresenter from './components/review/ReviewCategoryPresenter.svelte' +import ApplicationsView from './components/ApplicationsView.svelte' import recruit from './plugin' async function createApplication (object: Doc): Promise { @@ -166,7 +167,8 @@ export default async (): Promise => ({ Opinions, OpinionPresenter, OpinionsPresenter, - ReviewCategoryPresenter + ReviewCategoryPresenter, + ApplicationsView }, completion: { ApplicationQuery: async (client: Client, query: string) => await queryApplication(client, query)