fix: Add droppable state for booleans when mapping (#5838)

This commit is contained in:
Mutasem Aldmour 2023-03-31 12:35:02 +02:00 committed by GitHub
parent 96533a995c
commit e3884ce378
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View file

@ -291,4 +291,31 @@ describe('Data mapping', () => {
.should('have.text', '{{ $json.input[0].count }} {{ $json.input }}');
ndv.getters.parameterExpressionPreview('value').should('include.text', '0 [object Object]');
});
it('shows you can drop to inputs, including booleans', () => {
cy.fixture('Test_workflow_3.json').then((data) => {
cy.get('body').paste(JSON.stringify(data));
});
workflowPage.actions.openNode('Set');
ndv.actions.clearParameterInput('value');
cy.get('body').type('{esc}');
ndv.getters.parameterInput('keepOnlySet').find('input[type="checkbox"]').should('exist');
ndv.getters.parameterInput('keepOnlySet').find('input[type="text"]').should('not.exist');
ndv.getters.inputDataContainer().should('exist').find('span').contains('count').realMouseDown().realMouseMove(100, 100);
cy.wait(50);
ndv.getters.parameterInput('keepOnlySet').find('input[type="checkbox"]').should('not.exist');
ndv.getters.parameterInput('keepOnlySet').find('input[type="text"]')
.should('exist')
.invoke('css', 'border')
.then((border) => expect(border).to.include('1.5px dashed rgb(90, 76, 194)'));
ndv.getters.parameterInput('value').find('input[type="text"]')
.should('exist')
.invoke('css', 'border')
.then((border) => expect(border).to.include('1.5px dashed rgb(90, 76, 194)'));
});
});

View file

@ -298,6 +298,14 @@
</n8n-option>
</n8n-select>
<!-- temporary state of booleans while data is mapped -->
<n8n-input
v-else-if="parameter.type === 'boolean' && droppable"
:size="inputSize"
:value="JSON.stringify(displayValue)"
:disabled="isReadOnly"
:title="displayTitle"
/>
<el-switch
v-else-if="parameter.type === 'boolean'"
class="switch-input"