Skip to content

Commit

Permalink
Revert "disable flatten result index option for existing detectors (o…
Browse files Browse the repository at this point in the history
…pensearch-project#965)"

This reverts commit c51aca0.
  • Loading branch information
jackiehanyang committed Feb 3, 2025
1 parent c51aca0 commit e978b73
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 e978b73

Please sign in to comment.