mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 08:48:01 +00:00
UBER-863: Fix employee filter (#3682)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
709164cd82
commit
d861cccc2c
@ -33,7 +33,10 @@
|
|||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
onClick(e)
|
onClick(e)
|
||||||
} else if (href !== undefined) {
|
} else if (href !== undefined) {
|
||||||
if (e.metaKey || e.ctrlKey) return
|
if (e.metaKey || e.ctrlKey) {
|
||||||
|
e.stopPropagation()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// we need to close popups and tooltips
|
// we need to close popups and tooltips
|
||||||
closePopup()
|
closePopup()
|
||||||
@ -60,7 +63,7 @@
|
|||||||
class:colorInherit
|
class:colorInherit
|
||||||
class:fs-bold={accent}
|
class:fs-bold={accent}
|
||||||
style:flex-shrink={shrink}
|
style:flex-shrink={shrink}
|
||||||
on:click|stopPropagation={clickHandler}
|
on:click={clickHandler}
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</span>
|
</span>
|
||||||
@ -73,7 +76,7 @@
|
|||||||
class:colorInherit
|
class:colorInherit
|
||||||
class:fs-bold={accent}
|
class:fs-bold={accent}
|
||||||
style:flex-shrink={shrink}
|
style:flex-shrink={shrink}
|
||||||
on:click|stopPropagation={clickHandler}
|
on:click={clickHandler}
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
</a>
|
</a>
|
||||||
|
@ -15,8 +15,7 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Doc } from '@hcengineering/core'
|
import type { Doc } from '@hcengineering/core'
|
||||||
import { Button, ButtonKind, ButtonSize, IconThread, tooltip } from '@hcengineering/ui'
|
import { Button, ButtonKind, ButtonSize, IconThread } from '@hcengineering/ui'
|
||||||
import { DocNavLink } from '@hcengineering/view-resources'
|
|
||||||
import CommentPopup from './CommentPopup.svelte'
|
import CommentPopup from './CommentPopup.svelte'
|
||||||
|
|
||||||
export let value: number | undefined
|
export let value: number | undefined
|
||||||
@ -29,9 +28,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if value && value > 0}
|
{#if value && value > 0}
|
||||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
||||||
<DocNavLink {object} inline noUnderline={true} shrink={0}>
|
|
||||||
{#if kind === 'list'}
|
|
||||||
<Button
|
<Button
|
||||||
{kind}
|
{kind}
|
||||||
{size}
|
{size}
|
||||||
@ -45,19 +41,4 @@
|
|||||||
{#if showCounter && !compactMode}{value ?? 0}{/if}
|
{#if showCounter && !compactMode}{value ?? 0}{/if}
|
||||||
</div>
|
</div>
|
||||||
</Button>
|
</Button>
|
||||||
{:else}
|
|
||||||
<div
|
|
||||||
use:tooltip={{
|
|
||||||
component: CommentPopup,
|
|
||||||
props: { objectId: object._id, object, withInput }
|
|
||||||
}}
|
|
||||||
class="sm-tool-icon"
|
|
||||||
>
|
|
||||||
<span class="icon"><IconThread {size} /></span>
|
|
||||||
{#if showCounter && value && value !== 0}
|
|
||||||
{value}
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
</DocNavLink>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -157,7 +157,13 @@
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div class="clear-mins flex-grow">
|
<div class="clear-mins flex-grow">
|
||||||
<EmployeePresenter {value} shouldShowPlaceholder defaultName={ui.string.NotSelected} disabled />
|
<EmployeePresenter
|
||||||
|
{value}
|
||||||
|
shouldShowPlaceholder
|
||||||
|
defaultName={ui.string.NotSelected}
|
||||||
|
disabled
|
||||||
|
noUnderline
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="check pointer-events-none">
|
<div class="check pointer-events-none">
|
||||||
{#if isSelected(value, filter.value)}
|
{#if isSelected(value, filter.value)}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
export let accent: boolean = false
|
export let accent: boolean = false
|
||||||
export let defaultName: IntlString | undefined = ui.string.NotSelected
|
export let defaultName: IntlString | undefined = ui.string.NotSelected
|
||||||
export let element: HTMLElement | undefined = undefined
|
export let element: HTMLElement | undefined = undefined
|
||||||
|
export let noUnderline: boolean = false
|
||||||
|
|
||||||
$: employeeValue = typeof value === 'string' ? $personByIdStore.get(value) : value
|
$: employeeValue = typeof value === 'string' ? $personByIdStore.get(value) : value
|
||||||
|
|
||||||
@ -41,6 +42,7 @@
|
|||||||
{colorInherit}
|
{colorInherit}
|
||||||
{accent}
|
{accent}
|
||||||
{defaultName}
|
{defaultName}
|
||||||
|
{noUnderline}
|
||||||
statusLabel={active === false && shouldShowName ? contact.string.Inactive : undefined}
|
statusLabel={active === false && shouldShowName ? contact.string.Inactive : undefined}
|
||||||
on:accent-color
|
on:accent-color
|
||||||
/>
|
/>
|
||||||
|
@ -17,15 +17,15 @@
|
|||||||
import { CommentsPresenter } from '@hcengineering/chunter-resources'
|
import { CommentsPresenter } from '@hcengineering/chunter-resources'
|
||||||
import contact, { getName } from '@hcengineering/contact'
|
import contact, { getName } from '@hcengineering/contact'
|
||||||
import { Avatar } from '@hcengineering/contact-resources'
|
import { Avatar } from '@hcengineering/contact-resources'
|
||||||
import { Hierarchy, WithLookup } from '@hcengineering/core'
|
import { WithLookup } from '@hcengineering/core'
|
||||||
import notification from '@hcengineering/notification'
|
import notification from '@hcengineering/notification'
|
||||||
import { getClient } from '@hcengineering/presentation'
|
import { getClient } from '@hcengineering/presentation'
|
||||||
import recruit, { Applicant, Candidate } from '@hcengineering/recruit'
|
import recruit, { Applicant, Candidate } from '@hcengineering/recruit'
|
||||||
import { AssigneePresenter, StateRefPresenter } from '@hcengineering/task-resources'
|
import { AssigneePresenter, StateRefPresenter } from '@hcengineering/task-resources'
|
||||||
import tracker from '@hcengineering/tracker'
|
import tracker from '@hcengineering/tracker'
|
||||||
import { Component, DueDatePresenter, showPanel } from '@hcengineering/ui'
|
import { Component, DueDatePresenter } from '@hcengineering/ui'
|
||||||
import view, { BuildModelKey } from '@hcengineering/view'
|
import { BuildModelKey } from '@hcengineering/view'
|
||||||
import { ObjectPresenter, enabledConfig } from '@hcengineering/view-resources'
|
import { DocNavLink, ObjectPresenter, enabledConfig } from '@hcengineering/view-resources'
|
||||||
import ApplicationPresenter from './ApplicationPresenter.svelte'
|
import ApplicationPresenter from './ApplicationPresenter.svelte'
|
||||||
|
|
||||||
export let object: WithLookup<Applicant>
|
export let object: WithLookup<Applicant>
|
||||||
@ -38,17 +38,14 @@
|
|||||||
const assigneeAttribute = hierarchy.getAttribute(recruit.class.Applicant, 'assignee')
|
const assigneeAttribute = hierarchy.getAttribute(recruit.class.Applicant, 'assignee')
|
||||||
const isTitleHidden = client.getHierarchy().getAttribute(recruit.mixin.Candidate, 'title').hidden
|
const isTitleHidden = client.getHierarchy().getAttribute(recruit.mixin.Candidate, 'title').hidden
|
||||||
|
|
||||||
function showCandidate () {
|
|
||||||
showPanel(view.component.EditDoc, object._id, Hierarchy.mixinOrClass(object), 'content')
|
|
||||||
}
|
|
||||||
|
|
||||||
$: channels = (object.$lookup?.attachedTo as WithLookup<Candidate>)?.$lookup?.channels
|
$: channels = (object.$lookup?.attachedTo as WithLookup<Candidate>)?.$lookup?.channels
|
||||||
|
|
||||||
$: company = object?.$lookup?.space?.company
|
$: company = object?.$lookup?.space?.company
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||||
<div class="flex-col pt-3 pb-3 pr-4 pl-4" on:click={showCandidate}>
|
<div class="flex-col pt-3 pb-3 pr-4 pl-4">
|
||||||
|
<DocNavLink {object} noUnderline>
|
||||||
{#if enabledConfig(config, 'space') || enabledConfig(config, 'company')}
|
{#if enabledConfig(config, 'space') || enabledConfig(config, 'company')}
|
||||||
<div
|
<div
|
||||||
class="flex-between gap-2 mb-3"
|
class="flex-between gap-2 mb-3"
|
||||||
@ -77,7 +74,11 @@
|
|||||||
<div class="tool flex-row-center">
|
<div class="tool flex-row-center">
|
||||||
{#if !dragged}
|
{#if !dragged}
|
||||||
<div class="mr-2">
|
<div class="mr-2">
|
||||||
<Component showLoading={false} is={notification.component.NotificationPresenter} props={{ value: object }} />
|
<Component
|
||||||
|
showLoading={false}
|
||||||
|
is={notification.component.NotificationPresenter}
|
||||||
|
props={{ value: object }}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
@ -128,13 +129,15 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if enabledConfig(config, 'comments')}
|
{#if enabledConfig(config, 'comments')}
|
||||||
{#if (object.comments ?? 0) > 0}
|
{#if (object.comments ?? 0) > 0}
|
||||||
<CommentsPresenter value={object.comments} {object} />
|
<CommentsPresenter value={object.comments} {object} kind={'list'} size={'x-small'} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if object.$lookup?.attachedTo !== undefined && (object.$lookup.attachedTo.comments ?? 0) > 0}
|
{#if object.$lookup?.attachedTo !== undefined && (object.$lookup.attachedTo.comments ?? 0) > 0}
|
||||||
<CommentsPresenter
|
<CommentsPresenter
|
||||||
value={object.$lookup?.attachedTo?.comments}
|
value={object.$lookup?.attachedTo?.comments}
|
||||||
object={object.$lookup?.attachedTo}
|
object={object.$lookup?.attachedTo}
|
||||||
withInput={false}
|
withInput={false}
|
||||||
|
kind={'list'}
|
||||||
|
size={'x-small'}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
@ -149,6 +152,7 @@
|
|||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
</DocNavLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
Loading…
Reference in New Issue
Block a user