Support handleUnknownValues in default operators

Summary: We treat every column without the power search config as if it contains strings. Sometimes that might bite us, for instance, when the column contains an object.

Reviewed By: lblasa

Differential Revision: D49822511

fbshipit-source-id: 18dadb5abe624fae510663fc26668b2b594899c3
This commit is contained in:
Andrey Goncharov
2023-10-02 08:27:37 -07:00
committed by Facebook GitHub Bot
parent 446147b9fe
commit 8a591a7855

View File

@@ -18,25 +18,29 @@ export type PowerSearchOperatorProcessor = (
) => boolean; ) => boolean;
export const dataTablePowerSearchOperators = { export const dataTablePowerSearchOperators = {
string_contains: () => ({ string_contains: (handleUnknownValues?: boolean) => ({
label: 'contains', label: 'contains',
key: 'string_contains', key: 'string_contains',
valueType: 'STRING', valueType: 'STRING',
handleUnknownValues,
}), }),
string_not_contains: () => ({ string_not_contains: (handleUnknownValues?: boolean) => ({
label: 'does not contain', label: 'does not contain',
key: 'string_not_contains', key: 'string_not_contains',
valueType: 'STRING', valueType: 'STRING',
handleUnknownValues,
}), }),
string_matches_exactly: () => ({ string_matches_exactly: (handleUnknownValues?: boolean) => ({
label: 'is', label: 'is',
key: 'string_matches_exactly', key: 'string_matches_exactly',
valueType: 'STRING', valueType: 'STRING',
handleUnknownValues,
}), }),
string_not_matches_exactly: () => ({ string_not_matches_exactly: (handleUnknownValues?: boolean) => ({
label: 'is not', label: 'is not',
key: 'string_not_matches_exactly', key: 'string_not_matches_exactly',
valueType: 'STRING', valueType: 'STRING',
handleUnknownValues,
}), }),
string_set_contains_any_of: () => ({ string_set_contains_any_of: () => ({
label: 'contains any of', label: 'contains any of',