Fix Vacancy Archive item presenting (#1901)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2022-05-29 14:55:17 +07:00 committed by GitHub
parent 868e349fdb
commit a7b2f3d5ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 5 deletions

View File

@ -134,6 +134,10 @@ export function createModel (builder: Builder): void {
} }
}) })
builder.mixin(core.class.Space, core.class.Class, view.mixin.AttributePresenter, {
presenter: recruit.component.VacancyItemPresenter
})
builder.mixin(recruit.class.Applicant, core.class.Class, view.mixin.CollectionEditor, { builder.mixin(recruit.class.Applicant, core.class.Class, view.mixin.CollectionEditor, {
editor: recruit.component.Applications editor: recruit.component.Applications
}) })

View File

@ -20,7 +20,7 @@
export let value: Vacancy export let value: Vacancy
export let inline: boolean = false export let inline: boolean = false
export let action: (item: Ref<Vacancy>) => void export let action: ((item: Ref<Vacancy>) => void) | undefined = undefined
function editVacancy (): void { function editVacancy (): void {
showPanel(recruit.component.EditVacancy, value._id, value._class, 'content') showPanel(recruit.component.EditVacancy, value._id, value._class, 'content')
@ -28,13 +28,25 @@
</script> </script>
{#if value} {#if value}
<div class="flex-presenter" class:inline-presenter={inline} on:click={() => action(value._id)}> <div
class="flex-presenter"
class:inline-presenter={inline}
on:click={() => {
if (action !== undefined) {
action(value._id)
} else {
editVacancy()
}
}}
>
<div class="icon"> <div class="icon">
<Icon icon={recruit.icon.Vacancy} size={'small'} /> <Icon icon={recruit.icon.Vacancy} size={'small'} />
</div> </div>
<span class="label">{value.name}</span> <span class="label">{value.name}</span>
<div class="action"> {#if action !== undefined}
<ActionIcon label={recruit.string.Edit} size={'small'} icon={IconEdit} action={editVacancy} /> <div class="action">
</div> <ActionIcon label={recruit.string.Edit} size={'small'} icon={IconEdit} action={editVacancy} />
</div>
{/if}
</div> </div>
{/if} {/if}