feat: Filter parameter: Improve loose type validation for booleans (#10702)

This commit is contained in:
Elias Meire
2024-09-09 09:54:36 +02:00
committed by GitHub
parent b18313f219
commit e9b8d99084
14 changed files with 261 additions and 22 deletions

View File

@@ -42,6 +42,8 @@ const i18n = useI18n();
const ndvStore = useNDVStore();
const { debounce } = useDebounce();
const debouncedEmitChange = debounce(emitChange, { debounceTime: 1000 });
function createCondition(): FilterConditionValue {
return { id: uuid(), leftValue: '', rightValue: '', operator: DEFAULT_OPERATOR_VALUE };
}
@@ -86,7 +88,7 @@ watch(
try {
newOptions = {
...DEFAULT_FILTER_OPTIONS,
...resolveParameter(typeOptions as NodeParameterValue),
...resolveParameter(typeOptions as unknown as NodeParameterValue),
};
} catch (error) {}
@@ -117,8 +119,6 @@ function emitChange() {
});
}
const debouncedEmitChange = debounce(emitChange, { debounceTime: 1000 });
function addCondition(): void {
state.paramValue.conditions.push(createCondition());
debouncedEmitChange();

View File

@@ -8,6 +8,7 @@ export const DEFAULT_FILTER_OPTIONS: FilterOptionsValue = {
caseSensitive: true,
leftValue: '',
typeValidation: 'strict',
version: 1,
};
export const OPERATORS_BY_ID = {