mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
add map option to preserve field order
This commit is contained in:
parent
4e759419f7
commit
6fc8e29fca
|
@ -74,6 +74,27 @@ describe('ResourceMapper.vue', () => {
|
|||
expect(queryByTestId('matching-column-select')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders map mode properly', async () => {
|
||||
const { getByTestId, queryByTestId } = renderComponent(
|
||||
{
|
||||
props: {
|
||||
parameter: {
|
||||
typeOptions: {
|
||||
resourceMapper: {
|
||||
mode: 'map',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{ merge: true },
|
||||
);
|
||||
await waitAllPromises();
|
||||
expect(getByTestId('resource-mapper-container')).toBeInTheDocument();
|
||||
// This mode doesn't render matching column selector
|
||||
expect(queryByTestId('matching-column-select')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders multi-key match selector properly', async () => {
|
||||
const { container, getByTestId } = renderComponent(
|
||||
{
|
||||
|
|
|
@ -164,7 +164,7 @@ const showMappingModeSelect = computed<boolean>(() => {
|
|||
const showMatchingColumnsSelector = computed<boolean>(() => {
|
||||
return (
|
||||
!state.loading &&
|
||||
props.parameter.typeOptions?.resourceMapper?.mode !== 'add' &&
|
||||
['upsert', 'update'].includes(props.parameter.typeOptions?.resourceMapper?.mode) &&
|
||||
state.paramValue.schema.length > 0
|
||||
);
|
||||
});
|
||||
|
|
|
@ -222,7 +222,7 @@ export class ExecuteWorkflow implements INodeType {
|
|||
resourceMapper: {
|
||||
localResourceMapperMethod: 'loadWorkflowInputMappings',
|
||||
valuesLabel: 'Workflow Inputs',
|
||||
mode: 'add',
|
||||
mode: 'map',
|
||||
fieldWords: {
|
||||
singular: 'workflow input',
|
||||
plural: 'workflow inputs',
|
||||
|
|
|
@ -1366,7 +1366,7 @@ export interface INodePropertyTypeOptions {
|
|||
}
|
||||
|
||||
export interface ResourceMapperTypeOptionsBase {
|
||||
mode: 'add' | 'update' | 'upsert';
|
||||
mode: 'add' | 'update' | 'upsert' | 'map';
|
||||
valuesLabel?: string;
|
||||
fieldWords?: {
|
||||
singular: string;
|
||||
|
|
Loading…
Reference in a new issue