import React from "react"; import { EuiLink, EuiSpacer } from "@elastic/eui"; import flat from "flat"; import { ContentPanel } from "../../../../components/ContentPanel"; import CustomFormRow from "../../../../components/CustomFormRow"; import { AllBuiltInComponents, IFieldComponentProps } from "../../../../components/FormGenerator"; import AdvancedSettings from "../../../../components/AdvancedSettings"; import { INDEX_SETTINGS_URL, IndicesUpdateMode } from "../../../../utils/constants"; import { SubDetailProps } from "../../interface"; import { getCommonFormRowProps } from "../../hooks"; const WrappedNumber = ({ onChange, ...others }: IFieldComponentProps) => { return ( { if (val === "") { onChange(undefined); return; } onChange(val); }} /> ); }; export default function IndexSettings(props: SubDetailProps) { const { field, isEdit, noPanel } = props; const values = field.getValues(); return ( } titleSize="s" > {values.includes?.[IndicesUpdateMode.settings] ? ( <> { field.setValue(["template", "settings"], totalValue); field.validatePromise(); }} accordionProps={{ initialIsOpen: false, id: "accordionForCreateComposableTemplateSettings", buttonContent:

Advanced settings

, }} editorProps={{ width: "100%", formatValue: flat, }} rowProps={{ fullWidth: true, label: "Specify advanced index settings", helpText: ( <>

Specify a comma-delimited list of settings.{" "} View index settings

All the settings will be handled in flat structure.{" "} Learn more

), }} /> ) : null}
); }