import React, { useContext, useRef } from "react"; import { EuiFormRow, EuiLink, EuiSpacer, EuiTitle } from "@elastic/eui"; import { ContentPanel } from "../../../../components/ContentPanel"; import { SubDetailProps } from "../../interface"; import IndexMapping, { IIndexMappingsRef } from "../../../../components/IndexMapping"; import { CoreServicesContext } from "../../../../components/core_services"; import { CoreStart } from "opensearch-dashboards/public"; import { AllBuiltInComponents } from "../../../../components/FormGenerator"; import { IndicesUpdateMode } from "../../../../utils/constants"; export default function TemplateMappings(props: SubDetailProps) { const { field, noPanel } = props; const values = field.getValues(); const mappingsRef = useRef(null); const coreServices = useContext(CoreServicesContext) as CoreStart; return (
Index mapping
Define how documents and their fields are stored and indexed.{" "} Learn more } > <> } actions={ } titleSize="s" > {values.includes?.[IndicesUpdateMode.mappings] ? ( <> { if (result) { return Promise.reject(result); } return Promise.resolve(""); }); }, }, ], })} isEdit ref={mappingsRef} oldMappingsEditable docVersion={coreServices.docLinks.DOC_LINK_VERSION} /> ) : null}
); }