Skip to content

Commit e978b73

Browse files
committed
Revert "disable flatten result index option for existing detectors (opensearch-project#965)"
This reverts commit c51aca0.
1 parent c51aca0 commit e978b73

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

public/pages/DefineDetector/components/CustomResultIndex/CustomResultIndex.tsx

-10
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ interface CustomResultIndexProps {
4848
function CustomResultIndex(props: CustomResultIndexProps) {
4949
const [enabled, setEnabled] = useState<boolean>(!!props.resultIndex);
5050
const [customResultIndexConditionsEnabled, setCustomResultIndexConditionsEnabled] = useState<boolean>(true);
51-
const [isDisabled, setIsDisabled] = useState(false);
5251
const customResultIndexMinAge = get(props.formikProps, 'values.resultIndexMinAge');
5352
const customResultIndexMinSize = get(props.formikProps, 'values.resultIndexMinSize');
5453
const customResultIndexTTL = get(props.formikProps, 'values.resultIndexTtl');
@@ -67,14 +66,6 @@ function CustomResultIndex(props: CustomResultIndexProps) {
6766
}
6867
},[customResultIndexConditionsEnabled])
6968

70-
useEffect(() => {
71-
if (props.isEdit && !get(props.formikProps, 'values.flattenCustomResultIndex')) {
72-
setIsDisabled(true);
73-
} else {
74-
setIsDisabled(false);
75-
}
76-
}, [props.isEdit]);
77-
7869
const hintTextStyle = {
7970
color: '#69707d',
8071
fontSize: '12px',
@@ -171,7 +162,6 @@ function CustomResultIndex(props: CustomResultIndexProps) {
171162
id={'flattenCustomResultIndex'}
172163
label="Enable flattened custom result index"
173164
checked={field.value ? field.value : get(props.formikProps, 'values.flattenCustomResultIndex')}
174-
disabled={isDisabled}
175165
{...field}
176166
/>
177167
<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>

0 commit comments

Comments
 (0)