mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
1992 fix (#1994)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
57ff7642dd
commit
b6a0366c0b
@ -500,6 +500,10 @@ export function createModel (builder: Builder): void {
|
||||
filters: ['attachedTo', 'assignee', 'state', 'doneState', 'modifiedOn']
|
||||
})
|
||||
|
||||
builder.mixin(recruit.class.Vacancy, core.class.Class, view.mixin.ClassFilters, {
|
||||
filters: ['company', 'location', 'dueTo']
|
||||
})
|
||||
|
||||
createReviewModel(builder)
|
||||
|
||||
// createAction(builder, { ...viewTemplates.open, target: recruit.class.Vacancy, context: { mode: ['browser', 'context'] } })
|
||||
|
@ -28,23 +28,21 @@
|
||||
$: resultQuery = search === '' ? {} : { $search: search }
|
||||
|
||||
type ApplicationInfo = { count: number; modifiedOn: number }
|
||||
let applications: Map<Ref<Vacancy>, ApplicationInfo> | undefined
|
||||
let applications: Map<Ref<Vacancy>, ApplicationInfo> = new Map<Ref<Vacancy>, ApplicationInfo>()
|
||||
|
||||
const applicantQuery = createQuery()
|
||||
$: applicantQuery.query(
|
||||
recruit.class.Applicant,
|
||||
{},
|
||||
(res) => {
|
||||
const result = new Map<Ref<Vacancy>, ApplicationInfo>()
|
||||
|
||||
for (const d of res) {
|
||||
const v = result.get(d.space) ?? { count: 0, modifiedOn: 0 }
|
||||
const v = applications.get(d.space) ?? { count: 0, modifiedOn: 0 }
|
||||
v.count++
|
||||
v.modifiedOn = Math.max(v.modifiedOn, d.modifiedOn)
|
||||
result.set(d.space, v)
|
||||
applications.set(d.space, v)
|
||||
}
|
||||
|
||||
applications = result
|
||||
applications = applications
|
||||
},
|
||||
{
|
||||
projection: {
|
||||
@ -68,7 +66,7 @@
|
||||
[
|
||||
'@applications',
|
||||
{
|
||||
key: '@applications',
|
||||
key: '',
|
||||
presenter: recruit.component.VacancyCountPresenter,
|
||||
label: recruit.string.Applications,
|
||||
props: { applications },
|
||||
@ -138,7 +136,7 @@
|
||||
<div class="ac-header__wrap-title">
|
||||
<div class="ac-header__icon"><Icon icon={recruit.icon.Vacancy} size={'small'} /></div>
|
||||
<span class="ac-header__title"><Label label={recruit.string.Vacancies} /></span>
|
||||
<div class="ml-4"><FilterButton _class={recruit.mixin.Candidate} bind:filters /></div>
|
||||
<div class="ml-4"><FilterButton _class={recruit.class.Vacancy} bind:filters /></div>
|
||||
</div>
|
||||
<SearchEdit
|
||||
bind:value={search}
|
||||
|
Loading…
Reference in New Issue
Block a user