mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[7.7] [Mappings Editor] Add logic for including type name in e… (#62341)
This commit is contained in:
parent
671b444320
commit
4973ddd780
1 changed files with 7 additions and 1 deletions
|
@ -24,6 +24,9 @@ import { serializers } from '../../../../shared_imports';
|
|||
|
||||
import { serializeTemplate } from '../../../../../common/lib/template_serialization';
|
||||
import { Template } from '../../../../../common/types';
|
||||
|
||||
import { doMappingsHaveType } from '../../mappings_editor/lib';
|
||||
|
||||
import { StepProps } from '../types';
|
||||
|
||||
const { stripEmptyFields } = serializers;
|
||||
|
@ -159,7 +162,10 @@ export const StepReview: React.FunctionComponent<StepProps> = ({ template, updat
|
|||
);
|
||||
|
||||
const RequestTab = () => {
|
||||
const endpoint = `PUT _template/${name || '<templateName>'}`;
|
||||
const includeTypeName = doMappingsHaveType(template.mappings);
|
||||
const endpoint = `PUT _template/${name || '<templateName>'}${
|
||||
includeTypeName ? '?include_type_name' : ''
|
||||
}`;
|
||||
const templateString = JSON.stringify(serializedTemplate, null, 2);
|
||||
const request = `${endpoint}\n${templateString}`;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue