UBERF-5603 (#4754)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2024-02-23 15:39:49 +07:00
committed by GitHub
parent cc8a1d549a
commit ffc8d1dfac
184 changed files with 2755 additions and 561 deletions
@@ -26,6 +26,7 @@
import Reviews from './review/Reviews.svelte'
export let object: Applicant
export let readonly: boolean = false
let candidate: Candidate
let vacancy: Vacancy
@@ -63,9 +64,9 @@
{#if object !== undefined && candidate !== undefined}
<Scroller horizontal stickedScrollBars>
<div class="flex-between min-w-min">
<div class="card"><CandidateCard {candidate} on:click /></div>
<div class="card"><CandidateCard {candidate} disabled={readonly} on:click /></div>
<div class="flex-center arrows"><ExpandRightDouble /></div>
<div class="card"><VacancyCard {vacancy} /></div>
<div class="card"><VacancyCard {vacancy} disabled={readonly} /></div>
</div>
</Scroller>
<div class="mt-6">
@@ -75,6 +76,7 @@
label={recruit.string.TalentReviews}
application={object?._id}
company={vacancy?.company}
{readonly}
/>
</div>
{/if}
@@ -22,9 +22,9 @@
import presentation, { createQuery, getClient } from '@hcengineering/presentation'
import { Vacancy } from '@hcengineering/recruit'
import tracker from '@hcengineering/tracker'
import { Button, Component, EditBox, IconMixin, IconMoreH, Label } from '@hcengineering/ui'
import view from '@hcengineering/view'
import { Button, Component, EditBox, IconMixin, IconMoreH, Label, showPopup } from '@hcengineering/ui'
import { ContextMenu, DocAttributeBar, DocNavLink } from '@hcengineering/view-resources'
import { DocAttributeBar, DocNavLink, showMenu } from '@hcengineering/view-resources'
import { createEventDispatcher, onDestroy } from 'svelte'
import recruit from '../plugin'
import VacancyApplications from './VacancyApplications.svelte'
@@ -70,12 +70,6 @@
$: updateObject(_id)
function showMenu (ev?: Event): void {
if (object !== undefined) {
showPopup(ContextMenu, { object, excludedActions: [view.action.Open] }, (ev as MouseEvent).target as HTMLElement)
}
}
const ignoreMixins: Set<Ref<Mixin<Doc>>> = new Set<Ref<Mixin<Doc>>>()
const hierarchy = client.getHierarchy()
let mixins: Mixin<Doc>[] = []
@@ -164,7 +158,14 @@
{/if}
</svelte:fragment>
<svelte:fragment slot="utils">
<Button icon={IconMoreH} iconProps={{ size: 'medium' }} kind={'icon'} on:click={showMenu} />
<Button
icon={IconMoreH}
iconProps={{ size: 'medium' }}
kind={'icon'}
on:click={(e) => {
showMenu(e, { object, excludedActions: [view.action.Open] })
}}
/>
<Button
icon={IconMixin}
kind={'icon'}
@@ -25,8 +25,10 @@
export let objectId: Ref<Doc>
export let vacancies: number | undefined
export let readonly: boolean = false
const createApp = (ev: MouseEvent): void => {
if (readonly) return
showPopup(CreateVacancy, { company: objectId, preserveCompany: true }, ev.target as HTMLElement)
}
const config: (BuildModelKey | string)[] = [
@@ -54,7 +56,9 @@
<span class="antiSection-header__title">
<Label label={recruit.string.Vacancies} />
</span>
<Button id="appls.add" icon={IconAdd} kind={'ghost'} on:click={createApp} />
{#if !readonly}
<Button id="appls.add" icon={IconAdd} kind={'ghost'} on:click={createApp} />
{/if}
</div>
{#if (vacancies ?? 0) > 0}
<Scroller horizontal>
@@ -62,6 +66,7 @@
_class={recruit.class.Vacancy}
{config}
query={{ company: objectId }}
{readonly}
loadingProps={{ length: vacancies ?? 0 }}
/>
</Scroller>
@@ -73,9 +78,11 @@
<span class="content-dark-color">
<Label label={getEmbeddedLabel('No Vacancies')} />
</span>
<span class="over-underline content-color" on:click={createApp}>
<Label label={recruit.string.CreateVacancy} />
</span>
{#if !readonly}
<span class="over-underline content-color" on:click={createApp}>
<Label label={recruit.string.CreateVacancy} />
</span>
{/if}
</div>
{/if}
</div>
@@ -18,7 +18,7 @@
import { DateRangeMode, Doc, FindOptions, Ref } from '@hcengineering/core'
import { IntlString } from '@hcengineering/platform'
import { Applicant, Review } from '@hcengineering/recruit'
import { Button, DatePresenter, IconAdd, Label, showPopup, Scroller } from '@hcengineering/ui'
import { Button, DatePresenter, IconAdd, Label, Scroller, showPopup } from '@hcengineering/ui'
import { Table } from '@hcengineering/view-resources'
import recruit from '../../plugin'
import FileDuo from '../icons/FileDuo.svelte'
@@ -29,8 +29,10 @@
export let label: IntlString = recruit.string.Reviews
export let application: Ref<Applicant> | undefined
export let company: Ref<Organization> | undefined
export let readonly: boolean = false
const createApp = (): void => {
if (readonly) return
showPopup(
CreateReview,
{
@@ -54,7 +56,9 @@
<span class="antiSection-header__title">
<Label {label} />
</span>
<Button icon={IconAdd} kind={'ghost'} on:click={createApp} />
{#if !readonly}
<Button icon={IconAdd} kind={'ghost'} on:click={createApp} />
{/if}
</div>
{#if reviews > 0}
<Scroller horizontal>
@@ -83,6 +87,7 @@
}
]}
{options}
{readonly}
query={{ attachedTo: objectId }}
loadingProps={{ length: reviews }}
/>
@@ -95,10 +100,12 @@
<span class="content-dark-color mt-2">
<Label label={recruit.string.NoReviewForCandidate} />
</span>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<span class="over-underline content-color" on:click={createApp}>
<Label label={recruit.string.CreateAnReview} />
</span>
{#if !readonly}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<span class="over-underline content-color" on:click={createApp}>
<Label label={recruit.string.CreateAnReview} />
</span>
{/if}
</div>
{/if}
</div>