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();
|
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 () => {
|
it('renders multi-key match selector properly', async () => {
|
||||||
const { container, getByTestId } = renderComponent(
|
const { container, getByTestId } = renderComponent(
|
||||||
{
|
{
|
||||||
|
|
|
@ -164,7 +164,7 @@ const showMappingModeSelect = computed<boolean>(() => {
|
||||||
const showMatchingColumnsSelector = computed<boolean>(() => {
|
const showMatchingColumnsSelector = computed<boolean>(() => {
|
||||||
return (
|
return (
|
||||||
!state.loading &&
|
!state.loading &&
|
||||||
props.parameter.typeOptions?.resourceMapper?.mode !== 'add' &&
|
['upsert', 'update'].includes(props.parameter.typeOptions?.resourceMapper?.mode) &&
|
||||||
state.paramValue.schema.length > 0
|
state.paramValue.schema.length > 0
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -222,7 +222,7 @@ export class ExecuteWorkflow implements INodeType {
|
||||||
resourceMapper: {
|
resourceMapper: {
|
||||||
localResourceMapperMethod: 'loadWorkflowInputMappings',
|
localResourceMapperMethod: 'loadWorkflowInputMappings',
|
||||||
valuesLabel: 'Workflow Inputs',
|
valuesLabel: 'Workflow Inputs',
|
||||||
mode: 'add',
|
mode: 'map',
|
||||||
fieldWords: {
|
fieldWords: {
|
||||||
singular: 'workflow input',
|
singular: 'workflow input',
|
||||||
plural: 'workflow inputs',
|
plural: 'workflow inputs',
|
||||||
|
|
|
@ -1366,7 +1366,7 @@ export interface INodePropertyTypeOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ResourceMapperTypeOptionsBase {
|
export interface ResourceMapperTypeOptionsBase {
|
||||||
mode: 'add' | 'update' | 'upsert';
|
mode: 'add' | 'update' | 'upsert' | 'map';
|
||||||
valuesLabel?: string;
|
valuesLabel?: string;
|
||||||
fieldWords?: {
|
fieldWords?: {
|
||||||
singular: string;
|
singular: string;
|
||||||
|
|
Loading…
Reference in a new issue