mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(editor): Filter component + implement in If node (#7490)
New Filter component + implementation in If node (v2) <img width="3283" alt="image" src="https://github.com/n8n-io/n8n/assets/8850410/35c379ef-4b62-4d06-82e7-673d4edcd652"> --------- Co-authored-by: Giulio Andreini <andreini@netseven.it> Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -1071,6 +1071,7 @@ export type NodePropertyTypes =
|
||||
| 'resourceLocator'
|
||||
| 'curlImport'
|
||||
| 'resourceMapper'
|
||||
| 'filter'
|
||||
| 'credentials';
|
||||
|
||||
export type CodeAutocompleteTypes = 'function' | 'functionItem';
|
||||
@@ -1118,6 +1119,7 @@ export interface INodePropertyTypeOptions {
|
||||
sortable?: boolean; // Supported when "multipleValues" set to true
|
||||
expirable?: boolean; // Supported by: hidden (only in the credentials)
|
||||
resourceMapper?: ResourceMapperTypeOptions;
|
||||
filter?: FilterTypeOptions;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@@ -1137,6 +1139,18 @@ export interface ResourceMapperTypeOptions {
|
||||
};
|
||||
}
|
||||
|
||||
type NonEmptyArray<T> = [T, ...T[]];
|
||||
|
||||
export type FilterTypeCombinator = 'and' | 'or';
|
||||
|
||||
export type FilterTypeOptions = Partial<{
|
||||
caseSensitive: boolean | string; // default = true
|
||||
leftValue: string; // when set, user can't edit left side of condition
|
||||
allowedCombinators: NonEmptyArray<FilterTypeCombinator>; // default = ['and', 'or']
|
||||
maxConditions: number; // default = 10
|
||||
typeValidation: 'strict' | 'loose' | {}; // default = strict, `| {}` is a TypeScript trick to allow custom strings, but still give autocomplete
|
||||
}>;
|
||||
|
||||
export interface IDisplayOptions {
|
||||
hide?: {
|
||||
[key: string]: NodeParameterValue[] | undefined;
|
||||
@@ -2209,6 +2223,42 @@ export type ResourceMapperValue = {
|
||||
matchingColumns: string[];
|
||||
schema: ResourceMapperField[];
|
||||
};
|
||||
|
||||
export type FilterOperatorType =
|
||||
| 'string'
|
||||
| 'number'
|
||||
| 'boolean'
|
||||
| 'array'
|
||||
| 'object'
|
||||
| 'dateTime'
|
||||
| 'any';
|
||||
|
||||
export interface FilterOperatorValue {
|
||||
type: FilterOperatorType;
|
||||
operation: string;
|
||||
rightType?: FilterOperatorType;
|
||||
singleValue?: boolean; // default = false
|
||||
}
|
||||
|
||||
export type FilterConditionValue = {
|
||||
id: string;
|
||||
leftValue: unknown;
|
||||
operator: FilterOperatorValue;
|
||||
rightValue: unknown;
|
||||
};
|
||||
|
||||
export type FilterOptionsValue = {
|
||||
caseSensitive: boolean;
|
||||
leftValue: string;
|
||||
typeValidation: 'strict' | 'loose';
|
||||
};
|
||||
|
||||
export type FilterValue = {
|
||||
options: FilterOptionsValue;
|
||||
conditions: FilterConditionValue[];
|
||||
combinator: FilterTypeCombinator;
|
||||
};
|
||||
|
||||
export interface ExecutionOptions {
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user