Skip to content

Commit

Permalink
Revert "disable flatten result index option for existing detectors (#965
Browse files Browse the repository at this point in the history
)" (#970) (#972)

This reverts commit c51aca0.

(cherry picked from commit b47d048)

Co-authored-by: Jackie Han <jkhanjob@gmail.com>
  • Loading branch information
1 parent 8bca66d commit 23645aa
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ interface CustomResultIndexProps {
function CustomResultIndex(props: CustomResultIndexProps) {
const [enabled, setEnabled] = useState<boolean>(!!props.resultIndex);
const [customResultIndexConditionsEnabled, setCustomResultIndexConditionsEnabled] = useState<boolean>(true);
const [isDisabled, setIsDisabled] = useState(false);
const customResultIndexMinAge = get(props.formikProps, 'values.resultIndexMinAge');
const customResultIndexMinSize = get(props.formikProps, 'values.resultIndexMinSize');
const customResultIndexTTL = get(props.formikProps, 'values.resultIndexTtl');
Expand All @@ -67,14 +66,6 @@ function CustomResultIndex(props: CustomResultIndexProps) {
}
},[customResultIndexConditionsEnabled])

useEffect(() => {
if (props.isEdit && !get(props.formikProps, 'values.flattenCustomResultIndex')) {
setIsDisabled(true);
} else {
setIsDisabled(false);
}
}, [props.isEdit]);

const hintTextStyle = {
color: '#69707d',
fontSize: '12px',
Expand Down Expand Up @@ -171,7 +162,6 @@ function CustomResultIndex(props: CustomResultIndexProps) {
id={'flattenCustomResultIndex'}
label="Enable flattened custom result index"
checked={field.value ? field.value : get(props.formikProps, 'values.flattenCustomResultIndex')}
disabled={isDisabled}
{...field}
/>
<p style={hintTextStyle}>Flattening the custom result index will make it easier to query them on the dashboard. It also allows you to perform term aggregations on categorical fields.</p>
Expand Down

0 comments on commit 23645aa

Please # to comment.