Support no_value operator type
Summary: Project doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU Reviewed By: lblasa Differential Revision: D48605550 fbshipit-source-id: 3c555c5cf2928e2a87686dff4c68516338203197
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f16ff8ade4
commit
f9d5d713ef
@@ -79,6 +79,11 @@ export const PowerSearchTerm: React.FC<PowerSearchTermProps> = ({
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'NO_VALUE': {
|
||||||
|
// Nothing needs to be done. The effect below is going to fire and mark it as the final value.
|
||||||
|
searchValueInputComponent = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
console.error(
|
console.error(
|
||||||
'PowerSearchTerm -> unknownoperator.valueType',
|
'PowerSearchTerm -> unknownoperator.valueType',
|
||||||
@@ -88,6 +93,15 @@ export const PowerSearchTerm: React.FC<PowerSearchTermProps> = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (searchTerm.operator.valueType === 'NO_VALUE') {
|
||||||
|
onFinalize({
|
||||||
|
...searchTerm,
|
||||||
|
searchValue: null,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [searchTerm, onFinalize]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Space.Compact block size="small">
|
<Space.Compact block size="small">
|
||||||
<Button>{searchTerm.field.label}</Button>
|
<Button>{searchTerm.field.label}</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user