fix(editor): Copy to editor not using pinned data from the execution (#28905)

Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com>
This commit is contained in:
RomanDavydchuk
2026-04-27 12:31:36 +00:00
committed by GitHub
co-authored by Michael Kret
parent 3637287ee1
commit 20d9215736
2 changed files with 32 additions and 0 deletions
@@ -1,6 +1,7 @@
import { createTestingPinia } from '@pinia/testing';
import { mockedStore } from '@/__tests__/utils';
import { useWorkflowsStore } from '@/app/stores/workflows.store';
import { useUIStore } from '@/app/stores/ui.store';
import {
injectWorkflowState,
useWorkflowState,
@@ -222,4 +223,31 @@ describe('useExecutionDebugging()', () => {
expect(setWorkflowExecutionData).toHaveBeenCalledWith(mockExecution);
expect(toast.showToast).toHaveBeenCalledTimes(1);
});
it('should mark workflow as dirty after pinning imported execution data', async () => {
const mockExecution = {
data: {
resultData: {
runData: {
TriggerNode: [
{
data: {
main: [[{ json: { id: '1' } }, { json: { id: '2' } }]],
},
},
],
},
},
},
} as unknown as IExecutionResponse;
const workflowStore = mockedStore(useWorkflowsStore);
const uiStore = mockedStore(useUIStore);
mockWorkflowDocumentStore.getNodes.mockReturnValue([{ name: 'TriggerNode' }] as INodeUi[]);
workflowStore.getExecution.mockResolvedValueOnce(mockExecution);
await executionDebugging.applyExecutionData('1');
expect(uiStore.markStateDirty).toHaveBeenCalledTimes(1);
});
});
@@ -130,6 +130,10 @@ export const useExecutionDebugging = (providedWorkflowState?: WorkflowState) =>
}
});
if (pinnings > 0 || matchingPinnedNodeNames.length > 0) {
uiStore.markStateDirty();
}
toast.showToast({
title: i18n.baseText('nodeView.showMessage.debug.title'),
message: i18n.baseText('nodeView.showMessage.debug.content'),