mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(editor): Decouple Draggable from NDV store (#14531)
This commit is contained in:
committed by
GitHub
parent
e54f450a9d
commit
be627f08a4
@@ -72,15 +72,24 @@ const getJsonParameterPath = (path: string) => {
|
||||
});
|
||||
};
|
||||
|
||||
const onDragStart = (el: HTMLElement) => {
|
||||
const canDraggableDrop = computed(() => ndvStore.canDraggableDrop);
|
||||
const draggableStickyPosition = computed(() => ndvStore.draggableStickyPos);
|
||||
|
||||
const onDragStart = (el: HTMLElement, data?: string) => {
|
||||
if (el?.dataset.path) {
|
||||
draggingPath.value = el.dataset.path;
|
||||
}
|
||||
|
||||
ndvStore.draggableStartDragging({
|
||||
type: 'mapping',
|
||||
data: data ?? '',
|
||||
dimensions: el?.getBoundingClientRect() ?? null,
|
||||
});
|
||||
ndvStore.resetMappingTelemetry();
|
||||
};
|
||||
|
||||
const onDragEnd = (el: HTMLElement) => {
|
||||
ndvStore.draggableStopDragging();
|
||||
draggingPath.value = null;
|
||||
const mappingTelemetry = ndvStore.mappingTelemetry;
|
||||
const telemetryPayload = {
|
||||
@@ -132,6 +141,8 @@ const getListItemName = (path: string) => {
|
||||
type="mapping"
|
||||
target-data-key="mappable"
|
||||
:disabled="!mappingEnabled"
|
||||
:can-drop="canDraggableDrop"
|
||||
:sticky-position="draggableStickyPosition"
|
||||
@dragstart="onDragStart"
|
||||
@dragend="onDragEnd"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user