fix(editor): Don't render pinned icon for disabled nodes (#10712)

This commit is contained in:
Raúl Gómez Morales 2024-09-06 14:48:03 +02:00 committed by GitHub
parent 43713dcd89
commit 879b837581
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View file

@ -18,6 +18,18 @@ describe('CanvasNodeStatusIcons', () => {
expect(getByTestId('canvas-node-status-pinned')).toBeInTheDocument();
});
it('should not render pinned icon when disabled', () => {
const { queryByTestId } = renderComponent({
global: {
provide: createCanvasNodeProvide({
data: { disabled: true, pinnedData: { count: 5, visible: true } },
}),
},
});
expect(queryByTestId('canvas-node-status-pinned')).not.toBeInTheDocument();
});
it('should render correctly for a running node', () => {
const { getByTestId } = renderComponent({
global: {

View file

@ -15,6 +15,7 @@ const {
executionRunning,
hasRunData,
runDataIterations,
isDisabled,
} = useCanvasNode();
const hideNodeIssues = computed(() => false); // @TODO Implement this
@ -45,7 +46,7 @@ const hideNodeIssues = computed(() => false); // @TODO Implement this
</N8nTooltip>
</div>
<div
v-else-if="hasPinnedData && !nodeHelpers.isProductionExecutionPreview.value"
v-else-if="hasPinnedData && !nodeHelpers.isProductionExecutionPreview.value && !isDisabled"
data-test-id="canvas-node-status-pinned"
:class="[$style.status, $style.pinnedData]"
>