mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-31 08:46:58 +02:00
fix(editor): Prevent expression editor result panel from overflowing in HTML and Markdown render modes (#30470)
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
89477fc60c
commit
709ebbd23d
|
|
@ -1,7 +1,7 @@
|
|||
import { createComponentRenderer } from '@/__tests__/render';
|
||||
import ExpressionEditModal from './ExpressionEditModal.vue';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import { waitFor, within } from '@testing-library/vue';
|
||||
import { fireEvent, waitFor, within } from '@testing-library/vue';
|
||||
import { setActivePinia, type Pinia } from 'pinia';
|
||||
import { defaultSettings } from '@/__tests__/defaults';
|
||||
import { useSettingsStore } from '@/app/stores/settings.store';
|
||||
|
|
@ -179,5 +179,36 @@ describe('ExpressionEditModal', () => {
|
|||
expect(getByTestId('radio-button-markdown')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it('only applies the CodeMirror editor class in text mode', async () => {
|
||||
const { getByTestId } = renderModal({
|
||||
pinia,
|
||||
props: {
|
||||
parameter: createTestNodeProperties({ name: 'foo', type: 'string' }),
|
||||
path: '',
|
||||
modelValue: 'test',
|
||||
dialogVisible: true,
|
||||
},
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(getByTestId('expression-modal-output')).toHaveClass('editor');
|
||||
});
|
||||
|
||||
await fireEvent.click(getByTestId('radio-button-html'));
|
||||
await waitFor(() => {
|
||||
expect(getByTestId('expression-modal-output')).not.toHaveClass('editor');
|
||||
});
|
||||
|
||||
await fireEvent.click(getByTestId('radio-button-markdown'));
|
||||
await waitFor(() => {
|
||||
expect(getByTestId('expression-modal-output')).not.toHaveClass('editor');
|
||||
});
|
||||
|
||||
await fireEvent.click(getByTestId('radio-button-text'));
|
||||
await waitFor(() => {
|
||||
expect(getByTestId('expression-modal-output')).toHaveClass('editor');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ const onResizeThrottle = useThrottleFn(onResize, 10);
|
|||
<div :class="[$style.editorContainer, { 'ph-no-capture': redactValues }]">
|
||||
<ExpressionOutput
|
||||
ref="expressionResultRef"
|
||||
:class="$style.editor"
|
||||
:class="outputRenderMode === 'text' ? $style.editor : undefined"
|
||||
:segments="segments"
|
||||
:extensions="theme"
|
||||
:render="outputRenderMode"
|
||||
|
|
@ -323,12 +323,14 @@ const onResizeThrottle = useThrottleFn(onResize, 10);
|
|||
display: flex;
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.io {
|
||||
display: flex;
|
||||
flex: 1 1 0;
|
||||
gap: var(--spacing--sm);
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.input,
|
||||
|
|
@ -337,6 +339,8 @@ const onResizeThrottle = useThrottleFn(onResize, 10);
|
|||
flex-direction: column;
|
||||
gap: var(--spacing--2xs);
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.output {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ export default defineComponent({
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
overflow-wrap: anywhere;
|
||||
padding: var(--spacing--sm) var(--spacing--md);
|
||||
border: var(--border);
|
||||
border-radius: var(--radius);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user