mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-13 13:17:45 +02:00
UBERF-5603 (#4754)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
getEventPositionElement,
|
||||
showPopup
|
||||
} from '@hcengineering/ui'
|
||||
import { Menu, openDoc } from '@hcengineering/view-resources'
|
||||
import { Menu, openDoc, showMenu } from '@hcengineering/view-resources'
|
||||
import hr from '../plugin'
|
||||
import { addMember } from '../utils'
|
||||
import CreateDepartment from './CreateDepartment.svelte'
|
||||
@@ -76,10 +76,6 @@
|
||||
showPopup(CreateDepartment, { space: value._id }, eventToHTMLElement(e))
|
||||
}
|
||||
|
||||
function showMenu (e: MouseEvent) {
|
||||
showPopup(Menu, { object: value, baseMenuClass: value._class }, getEventPositionElement(e))
|
||||
}
|
||||
|
||||
function edit (e: MouseEvent): void {
|
||||
openDoc(client.getHierarchy(), value)
|
||||
}
|
||||
@@ -92,6 +88,10 @@
|
||||
$: values = allEmployees.filter((it) => it.department === value._id && it._id !== dragPersonId)
|
||||
|
||||
$: dragging = value._id === dragOver?._id && dragPersonId !== undefined
|
||||
|
||||
function onContext (e: MouseEvent): void {
|
||||
showMenu(e, { object: value, baseMenuClass: value._class })
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
@@ -99,7 +99,7 @@
|
||||
class="w-full mt-2 mb-4 container flex clear-mins flex-no-shrink"
|
||||
class:cursor-pointer={currentDescendants.length}
|
||||
on:click|stopPropagation={edit}
|
||||
on:contextmenu|preventDefault={showMenu}
|
||||
on:contextmenu={onContext}
|
||||
class:dragging
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if object && type && type.label}
|
||||
{#if object && type?.label}
|
||||
<Card
|
||||
label={hr.string.EditRequestType}
|
||||
labelProps={{ type: type.label }}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
import { EmployeePresenter } from '@hcengineering/contact-resources'
|
||||
import { WithLookup } from '@hcengineering/core'
|
||||
import { Staff } from '@hcengineering/hr'
|
||||
import { closeTooltip, getEventPositionElement, showPopup } from '@hcengineering/ui'
|
||||
import { ContextMenu } from '@hcengineering/view-resources'
|
||||
import { closeTooltip } from '@hcengineering/ui'
|
||||
import { showMenu } from '@hcengineering/view-resources'
|
||||
import hr from '../plugin'
|
||||
|
||||
import { flip } from 'svelte/animate'
|
||||
@@ -34,10 +34,6 @@
|
||||
function ondrag (p: Employee): void {
|
||||
dragPerson = p as WithLookup<Staff>
|
||||
}
|
||||
|
||||
function showContextMenu (ev: MouseEvent, object: Employee) {
|
||||
showPopup(ContextMenu, { object }, getEventPositionElement(ev))
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if value}
|
||||
@@ -54,8 +50,8 @@
|
||||
dragPerson = undefined
|
||||
closeTooltip()
|
||||
}}
|
||||
on:contextmenu|stopPropagation|preventDefault={(evt) => {
|
||||
showContextMenu(evt, p)
|
||||
on:contextmenu={(evt) => {
|
||||
showMenu(evt, { object: p })
|
||||
}}
|
||||
>
|
||||
<EmployeePresenter
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<script lang="ts">
|
||||
import hr, { Request, RequestType } from '@hcengineering/hr'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import { closeTooltip, Icon, Label, showPopup } from '@hcengineering/ui'
|
||||
import { ContextMenu } from '@hcengineering/view-resources'
|
||||
import { Icon, Label, closeTooltip } from '@hcengineering/ui'
|
||||
import { showMenu } from '@hcengineering/view-resources'
|
||||
|
||||
export let request: Request
|
||||
export let editable: boolean = false
|
||||
@@ -36,10 +36,8 @@
|
||||
|
||||
function click (e: MouseEvent, request: Request) {
|
||||
if (!editable) return
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
closeTooltip()
|
||||
showPopup(ContextMenu, { object: request }, e.target as HTMLElement)
|
||||
showMenu(e, { object: request })
|
||||
}
|
||||
|
||||
$: description = shouldShowDescription ? request.description.replace(/<[^>]*>/g, '').trim() : ''
|
||||
|
||||
Reference in New Issue
Block a user