fix(editor): Prevent variable value overflow (#19026)

This commit is contained in:
Raúl Gómez Morales
2025-09-03 17:19:59 +02:00
committed by GitHub
parent 277685e9e5
commit a90584b6bc
2 changed files with 18 additions and 1 deletions

View File

@@ -147,6 +147,23 @@ describe('VariablesView', () => {
expect(wrapper.container.querySelectorAll('tr')).toHaveLength(4); expect(wrapper.container.querySelectorAll('tr')).toHaveLength(4);
}); });
it('should truncate long variable values', async () => {
userWithPrivileges([
{
id: '1',
key: 'a',
value: 'This is a very long variable value that should be truncated',
},
]);
const { findByTestId, getByText, queryByText } = renderComponent();
const table = await findByTestId('resources-table');
expect(table).toBeVisible();
expect(queryByText('This is a very long variable value that should be truncated')).toBeNull();
expect(getByText('This is a very long ...')).toBeVisible();
});
describe('CRUD', () => { describe('CRUD', () => {
it('should create variables', async () => { it('should create variables', async () => {
const { environmentsStore } = userWithPrivileges([ const { environmentsStore } = userWithPrivileges([

View File

@@ -347,7 +347,7 @@ onMounted(() => {
</td> </td>
<td> <td>
<template v-if="data.value"> <template v-if="data.value">
{{ data.value }} <span v-n8n-truncate:20="data.value" />
</template> </template>
<N8nBadge v-else theme="warning"> Value missing </N8nBadge> <N8nBadge v-else theme="warning"> Value missing </N8nBadge>
</td> </td>