mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat(editor): Show actions in focus panel when multiple nodes are selected (no-changelog) (#18984)
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
watch,
|
||||
h,
|
||||
onBeforeUnmount,
|
||||
useTemplateRef,
|
||||
} from 'vue';
|
||||
import { onBeforeRouteLeave, useRoute, useRouter } from 'vue-router';
|
||||
import WorkflowCanvas from '@/components/canvas/WorkflowCanvas.vue';
|
||||
@@ -144,6 +145,7 @@ import { useFocusPanelStore } from '@/stores/focusPanel.store';
|
||||
import { useAITemplatesStarterCollectionStore } from '@/experiments/aiTemplatesStarterCollection/stores/aiTemplatesStarterCollection.store';
|
||||
import { useReadyToRunWorkflowsStore } from '@/experiments/readyToRunWorkflows/stores/readyToRunWorkflows.store';
|
||||
import { useKeybindings } from '@/composables/useKeybindings';
|
||||
import { type ContextMenuAction } from '@/composables/useContextMenuItems';
|
||||
|
||||
defineOptions({
|
||||
name: 'NodeView',
|
||||
@@ -263,6 +265,7 @@ useKeybindings({
|
||||
ctrl_alt_o: () => uiStore.openModal(ABOUT_MODAL_KEY),
|
||||
});
|
||||
|
||||
const canvasRef = useTemplateRef('canvas');
|
||||
const isLoading = ref(true);
|
||||
const isBlankRedirect = ref(false);
|
||||
const readOnlyNotification = ref<null | { visible: boolean }>(null);
|
||||
@@ -885,6 +888,10 @@ async function onSaveWorkflow() {
|
||||
}
|
||||
}
|
||||
|
||||
function onContextMenuAction(action: ContextMenuAction, nodeIds: string[]) {
|
||||
canvasRef.value?.executeContextMenuAction(action, nodeIds);
|
||||
}
|
||||
|
||||
function addWorkflowSavedEventBindings() {
|
||||
canvasEventBus.on('saved:workflow', npsSurveyStore.fetchPromptsData);
|
||||
canvasEventBus.on('saved:workflow', onSaveFromWithinNDV);
|
||||
@@ -2043,6 +2050,7 @@ onBeforeUnmount(() => {
|
||||
<div :class="$style.wrapper">
|
||||
<WorkflowCanvas
|
||||
v-if="editableWorkflow && editableWorkflowObject && !isLoading"
|
||||
ref="canvas"
|
||||
:id="editableWorkflow.id"
|
||||
:workflow="editableWorkflow"
|
||||
:workflow-object="editableWorkflowObject"
|
||||
@@ -2202,6 +2210,7 @@ onBeforeUnmount(() => {
|
||||
v-if="!isLoading"
|
||||
:is-canvas-read-only="isCanvasReadOnly"
|
||||
@save-keyboard-shortcut="onSaveWorkflow"
|
||||
@context-menu-action="onContextMenuAction"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user