[IM] Move template wizard steps to shared directory + update legacy details panel (#69559)
This commit is contained in:
parent
cc4c1729d1
commit
b00deeb754
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
export type TestSubjects =
|
||||
| 'aliasesTab'
|
||||
| 'aliasesTabContent'
|
||||
| 'appTitle'
|
||||
| 'cell'
|
||||
| 'closeDetailsButton'
|
||||
|
@ -27,7 +27,7 @@ export type TestSubjects =
|
|||
| 'indicesTab'
|
||||
| 'legacyTemplateTable'
|
||||
| 'manageTemplateButton'
|
||||
| 'mappingsTab'
|
||||
| 'mappingsTabContent'
|
||||
| 'noAliasesCallout'
|
||||
| 'noMappingsCallout'
|
||||
| 'noSettingsCallout'
|
||||
|
@ -36,7 +36,7 @@ export type TestSubjects =
|
|||
| 'row'
|
||||
| 'sectionError'
|
||||
| 'sectionLoading'
|
||||
| 'settingsTab'
|
||||
| 'settingsTabContent'
|
||||
| 'summaryTab'
|
||||
| 'summaryTitle'
|
||||
| 'systemTemplatesSwitch'
|
||||
|
|
|
@ -432,18 +432,18 @@ describe('Index Templates tab', () => {
|
|||
// Navigate and verify all tabs
|
||||
actions.selectDetailsTab('settings');
|
||||
expect(exists('summaryTab')).toBe(false);
|
||||
expect(exists('settingsTab')).toBe(true);
|
||||
expect(exists('settingsTabContent')).toBe(true);
|
||||
|
||||
actions.selectDetailsTab('aliases');
|
||||
expect(exists('summaryTab')).toBe(false);
|
||||
expect(exists('settingsTab')).toBe(false);
|
||||
expect(exists('aliasesTab')).toBe(true);
|
||||
expect(exists('settingsTabContent')).toBe(false);
|
||||
expect(exists('aliasesTabContent')).toBe(true);
|
||||
|
||||
actions.selectDetailsTab('mappings');
|
||||
expect(exists('summaryTab')).toBe(false);
|
||||
expect(exists('settingsTab')).toBe(false);
|
||||
expect(exists('aliasesTab')).toBe(false);
|
||||
expect(exists('mappingsTab')).toBe(true);
|
||||
expect(exists('settingsTabContent')).toBe(false);
|
||||
expect(exists('aliasesTabContent')).toBe(false);
|
||||
expect(exists('mappingsTabContent')).toBe(true);
|
||||
});
|
||||
|
||||
test('should show an info callout if data is not present', async () => {
|
||||
|
|
|
@ -5,3 +5,5 @@
|
|||
*/
|
||||
|
||||
export { TabAliases, TabMappings, TabSettings } from './details_panel';
|
||||
|
||||
export { StepAliases, StepMappings, StepSettings } from './wizard_steps';
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
export { StepAliases } from './step_aliases';
|
||||
export { StepMappings } from './step_mappings';
|
||||
export { StepSettings } from './step_settings';
|
|
@ -19,17 +19,17 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { Forms } from '../../../../shared_imports';
|
||||
import { documentationService } from '../../../services/documentation';
|
||||
import { Forms } from '../../../../../shared_imports';
|
||||
import { useJsonStep } from './use_json_step';
|
||||
|
||||
interface Props {
|
||||
defaultValue: { [key: string]: any };
|
||||
onChange: (content: Forms.Content) => void;
|
||||
esDocsBase: string;
|
||||
}
|
||||
|
||||
export const StepAliases: React.FunctionComponent<Props> = React.memo(
|
||||
({ defaultValue, onChange }) => {
|
||||
({ defaultValue, onChange, esDocsBase }) => {
|
||||
const { jsonContent, setJsonContent, error } = useJsonStep({
|
||||
defaultValue,
|
||||
onChange,
|
||||
|
@ -42,7 +42,7 @@ export const StepAliases: React.FunctionComponent<Props> = React.memo(
|
|||
<EuiTitle>
|
||||
<h2 data-test-subj="stepTitle">
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepAliases.stepTitle"
|
||||
id="xpack.idxMgmt.formWizard.stepAliases.stepTitle"
|
||||
defaultMessage="Aliases (optional)"
|
||||
/>
|
||||
</h2>
|
||||
|
@ -53,7 +53,7 @@ export const StepAliases: React.FunctionComponent<Props> = React.memo(
|
|||
<EuiText>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepAliases.aliasesDescription"
|
||||
id="xpack.idxMgmt.formWizard.stepAliases.aliasesDescription"
|
||||
defaultMessage="Set up aliases to associate with your indices."
|
||||
/>
|
||||
</p>
|
||||
|
@ -64,13 +64,13 @@ export const StepAliases: React.FunctionComponent<Props> = React.memo(
|
|||
<EuiButtonEmpty
|
||||
size="s"
|
||||
flush="right"
|
||||
href={documentationService.getTemplatesDocumentationLink()}
|
||||
href={`${esDocsBase}/indices-aliases.html`}
|
||||
target="_blank"
|
||||
iconType="help"
|
||||
>
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepAliases.docsButtonLabel"
|
||||
defaultMessage="Index Templates docs"
|
||||
id="xpack.idxMgmt.formWizard.stepAliases.docsButtonLabel"
|
||||
defaultMessage="Index Aliases docs"
|
||||
/>
|
||||
</EuiButtonEmpty>
|
||||
</EuiFlexItem>
|
||||
|
@ -82,13 +82,13 @@ export const StepAliases: React.FunctionComponent<Props> = React.memo(
|
|||
<EuiFormRow
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepAliases.fieldAliasesLabel"
|
||||
id="xpack.idxMgmt.formWizard.stepAliases.fieldAliasesLabel"
|
||||
defaultMessage="Aliases"
|
||||
/>
|
||||
}
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepAliases.aliasesEditorHelpText"
|
||||
id="xpack.idxMgmt.formWizard.stepAliases.aliasesEditorHelpText"
|
||||
defaultMessage="Use JSON format: {code}"
|
||||
values={{
|
||||
code: (
|
||||
|
@ -120,7 +120,7 @@ export const StepAliases: React.FunctionComponent<Props> = React.memo(
|
|||
showGutter={false}
|
||||
minLines={6}
|
||||
aria-label={i18n.translate(
|
||||
'xpack.idxMgmt.templateForm.stepAliases.fieldAliasesAriaLabel',
|
||||
'xpack.idxMgmt.formWizard.stepAliases.fieldAliasesAriaLabel',
|
||||
{
|
||||
defaultMessage: 'Aliases code editor',
|
||||
}
|
|
@ -15,23 +15,23 @@ import {
|
|||
EuiText,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { Forms } from '../../../../shared_imports';
|
||||
import { documentationService } from '../../../services/documentation';
|
||||
import { Forms } from '../../../../../shared_imports';
|
||||
import {
|
||||
MappingsEditor,
|
||||
OnUpdateHandler,
|
||||
LoadMappingsFromJsonButton,
|
||||
IndexSettings,
|
||||
} from '../../mappings_editor';
|
||||
} from '../../../mappings_editor';
|
||||
|
||||
interface Props {
|
||||
defaultValue: { [key: string]: any };
|
||||
onChange: (content: Forms.Content) => void;
|
||||
indexSettings?: IndexSettings;
|
||||
esDocsBase: string;
|
||||
}
|
||||
|
||||
export const StepMappings: React.FunctionComponent<Props> = React.memo(
|
||||
({ defaultValue, onChange, indexSettings }) => {
|
||||
({ defaultValue, onChange, indexSettings, esDocsBase }) => {
|
||||
const [mappings, setMappings] = useState(defaultValue);
|
||||
|
||||
const onMappingsEditorUpdate = useCallback<OnUpdateHandler>(
|
||||
|
@ -58,7 +58,7 @@ export const StepMappings: React.FunctionComponent<Props> = React.memo(
|
|||
<EuiTitle>
|
||||
<h2 data-test-subj="stepTitle">
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepMappings.stepTitle"
|
||||
id="xpack.idxMgmt.formWizard.stepMappings.stepTitle"
|
||||
defaultMessage="Mappings (optional)"
|
||||
/>
|
||||
</h2>
|
||||
|
@ -69,7 +69,7 @@ export const StepMappings: React.FunctionComponent<Props> = React.memo(
|
|||
<EuiText>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepMappings.mappingsDescription"
|
||||
id="xpack.idxMgmt.formWizard.stepMappings.mappingsDescription"
|
||||
defaultMessage="Define how to store and index documents."
|
||||
/>
|
||||
</p>
|
||||
|
@ -86,12 +86,12 @@ export const StepMappings: React.FunctionComponent<Props> = React.memo(
|
|||
<EuiButtonEmpty
|
||||
size="s"
|
||||
flush="right"
|
||||
href={documentationService.getMappingDocumentationLink()}
|
||||
href={`${esDocsBase}/mapping.html`}
|
||||
target="_blank"
|
||||
iconType="help"
|
||||
>
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepMappings.docsButtonLabel"
|
||||
id="xpack.idxMgmt.formWizard.stepMappings.docsButtonLabel"
|
||||
defaultMessage="Mapping docs"
|
||||
/>
|
||||
</EuiButtonEmpty>
|
|
@ -19,17 +19,17 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { Forms } from '../../../../shared_imports';
|
||||
import { documentationService } from '../../../services/documentation';
|
||||
import { Forms } from '../../../../../shared_imports';
|
||||
import { useJsonStep } from './use_json_step';
|
||||
|
||||
interface Props {
|
||||
defaultValue: { [key: string]: any };
|
||||
onChange: (content: Forms.Content) => void;
|
||||
esDocsBase: string;
|
||||
}
|
||||
|
||||
export const StepSettings: React.FunctionComponent<Props> = React.memo(
|
||||
({ defaultValue, onChange }) => {
|
||||
({ defaultValue, onChange, esDocsBase }) => {
|
||||
const { jsonContent, setJsonContent, error } = useJsonStep({
|
||||
defaultValue,
|
||||
onChange,
|
||||
|
@ -42,7 +42,7 @@ export const StepSettings: React.FunctionComponent<Props> = React.memo(
|
|||
<EuiTitle>
|
||||
<h2 data-test-subj="stepTitle">
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepSettings.stepTitle"
|
||||
id="xpack.idxMgmt.formWizard.stepSettings.stepTitle"
|
||||
defaultMessage="Index settings (optional)"
|
||||
/>
|
||||
</h2>
|
||||
|
@ -53,7 +53,7 @@ export const StepSettings: React.FunctionComponent<Props> = React.memo(
|
|||
<EuiText>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepSettings.settingsDescription"
|
||||
id="xpack.idxMgmt.formWizard.stepSettings.settingsDescription"
|
||||
defaultMessage="Define the behavior of your indices."
|
||||
/>
|
||||
</p>
|
||||
|
@ -64,12 +64,12 @@ export const StepSettings: React.FunctionComponent<Props> = React.memo(
|
|||
<EuiButtonEmpty
|
||||
size="s"
|
||||
flush="right"
|
||||
href={documentationService.getSettingsDocumentationLink()}
|
||||
href={`${esDocsBase}/index-modules.html#index-modules-settings`}
|
||||
target="_blank"
|
||||
iconType="help"
|
||||
>
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepSettings.docsButtonLabel"
|
||||
id="xpack.idxMgmt.formWizard.stepSettings.docsButtonLabel"
|
||||
defaultMessage="Index settings docs"
|
||||
/>
|
||||
</EuiButtonEmpty>
|
||||
|
@ -82,13 +82,13 @@ export const StepSettings: React.FunctionComponent<Props> = React.memo(
|
|||
<EuiFormRow
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepSettings.fieldIndexSettingsLabel"
|
||||
id="xpack.idxMgmt.formWizard.stepSettings.fieldIndexSettingsLabel"
|
||||
defaultMessage="Index settings"
|
||||
/>
|
||||
}
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateForm.stepSettings.settingsEditorHelpText"
|
||||
id="xpack.idxMgmt.formWizard.stepSettings.settingsEditorHelpText"
|
||||
defaultMessage="Use JSON format: {code}"
|
||||
values={{
|
||||
code: <EuiCode>{JSON.stringify({ number_of_replicas: 1 })}</EuiCode>,
|
||||
|
@ -114,7 +114,7 @@ export const StepSettings: React.FunctionComponent<Props> = React.memo(
|
|||
showGutter={false}
|
||||
minLines={6}
|
||||
aria-label={i18n.translate(
|
||||
'xpack.idxMgmt.templateForm.stepSettings.fieldIndexSettingsAriaLabel',
|
||||
'xpack.idxMgmt.formWizard.stepSettings.fieldIndexSettingsAriaLabel',
|
||||
{
|
||||
defaultMessage: 'Index settings editor',
|
||||
}
|
|
@ -7,7 +7,7 @@
|
|||
import { useEffect, useState, useCallback } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { isJSON, Forms } from '../../../../shared_imports';
|
||||
import { isJSON, Forms } from '../../../../../shared_imports';
|
||||
|
||||
interface Parameters {
|
||||
onChange: (content: Forms.Content) => void;
|
|
@ -4,4 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
export { TabAliases, TabMappings, TabSettings } from './components';
|
||||
export {
|
||||
TabAliases,
|
||||
TabMappings,
|
||||
TabSettings,
|
||||
StepAliases,
|
||||
StepMappings,
|
||||
StepSettings,
|
||||
} from './components';
|
||||
|
|
|
@ -6,11 +6,18 @@
|
|||
import React from 'react';
|
||||
|
||||
import { Forms } from '../../../../shared_imports';
|
||||
import { documentationService } from '../../../services/documentation';
|
||||
import { StepAliases } from '../../shared';
|
||||
import { WizardContent } from '../template_form';
|
||||
import { StepAliases } from './step_aliases';
|
||||
|
||||
export const StepAliasesContainer = () => {
|
||||
const { defaultValue, updateContent } = Forms.useContent<WizardContent>('aliases');
|
||||
|
||||
return <StepAliases defaultValue={defaultValue} onChange={updateContent} />;
|
||||
return (
|
||||
<StepAliases
|
||||
defaultValue={defaultValue}
|
||||
onChange={updateContent}
|
||||
esDocsBase={documentationService.getEsDocsBase()}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
import React from 'react';
|
||||
|
||||
import { Forms } from '../../../../shared_imports';
|
||||
import { documentationService } from '../../../services/documentation';
|
||||
import { StepMappings } from '../../shared';
|
||||
import { WizardContent } from '../template_form';
|
||||
import { StepMappings } from './step_mappings';
|
||||
|
||||
export const StepMappingsContainer = () => {
|
||||
const { defaultValue, updateContent, getData } = Forms.useContent<WizardContent>('mappings');
|
||||
|
@ -17,6 +18,7 @@ export const StepMappingsContainer = () => {
|
|||
defaultValue={defaultValue}
|
||||
onChange={updateContent}
|
||||
indexSettings={getData().settings}
|
||||
esDocsBase={documentationService.getEsDocsBase()}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -6,11 +6,18 @@
|
|||
import React from 'react';
|
||||
|
||||
import { Forms } from '../../../../shared_imports';
|
||||
import { documentationService } from '../../../services/documentation';
|
||||
import { StepSettings } from '../../shared';
|
||||
import { WizardContent } from '../template_form';
|
||||
import { StepSettings } from './step_settings';
|
||||
|
||||
export const StepSettingsContainer = React.memo(() => {
|
||||
const { defaultValue, updateContent } = Forms.useContent<WizardContent>('settings');
|
||||
|
||||
return <StepSettings defaultValue={defaultValue} onChange={updateContent} />;
|
||||
return (
|
||||
<StepSettings
|
||||
defaultValue={defaultValue}
|
||||
onChange={updateContent}
|
||||
esDocsBase={documentationService.getEsDocsBase()}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
|
|
@ -30,7 +30,6 @@ import {
|
|||
UIM_TEMPLATE_DETAIL_PANEL_SETTINGS_TAB,
|
||||
UIM_TEMPLATE_DETAIL_PANEL_ALIASES_TAB,
|
||||
} from '../../../../../../../common/constants';
|
||||
import { TemplateDeserialized } from '../../../../../../../common';
|
||||
import {
|
||||
TemplateDeleteModal,
|
||||
SectionLoading,
|
||||
|
@ -41,7 +40,8 @@ import { useLoadIndexTemplate } from '../../../../../services/api';
|
|||
import { decodePathFromReactRouter } from '../../../../../services/routing';
|
||||
import { SendRequestResponse } from '../../../../../../shared_imports';
|
||||
import { useServices } from '../../../../../app_context';
|
||||
import { TabSummary, TabMappings, TabSettings, TabAliases } from '../../template_details/tabs';
|
||||
import { TabAliases, TabMappings, TabSettings } from '../../../../../components/shared';
|
||||
import { TabSummary } from '../../template_details/tabs';
|
||||
|
||||
interface Props {
|
||||
template: { name: string; isLegacy?: boolean };
|
||||
|
@ -83,15 +83,6 @@ const TABS = [
|
|||
},
|
||||
];
|
||||
|
||||
const tabToComponentMap: {
|
||||
[key: string]: React.FunctionComponent<{ templateDetails: TemplateDeserialized }>;
|
||||
} = {
|
||||
[SUMMARY_TAB_ID]: TabSummary,
|
||||
[SETTINGS_TAB_ID]: TabSettings,
|
||||
[MAPPINGS_TAB_ID]: TabMappings,
|
||||
[ALIASES_TAB_ID]: TabAliases,
|
||||
};
|
||||
|
||||
const tabToUiMetricMap: { [key: string]: string } = {
|
||||
[SUMMARY_TAB_ID]: UIM_TEMPLATE_DETAIL_PANEL_SUMMARY_TAB,
|
||||
[SETTINGS_TAB_ID]: UIM_TEMPLATE_DETAIL_PANEL_SETTINGS_TAB,
|
||||
|
@ -144,7 +135,19 @@ export const LegacyTemplateDetails: React.FunctionComponent<Props> = ({
|
|||
/>
|
||||
);
|
||||
} else if (templateDetails) {
|
||||
const Content = tabToComponentMap[activeTab];
|
||||
const {
|
||||
template: { settings, mappings, aliases },
|
||||
} = templateDetails;
|
||||
|
||||
const tabToComponentMap: Record<string, React.ReactNode> = {
|
||||
[SUMMARY_TAB_ID]: <TabSummary templateDetails={templateDetails} />,
|
||||
[SETTINGS_TAB_ID]: <TabSettings settings={settings} />,
|
||||
[MAPPINGS_TAB_ID]: <TabMappings mappings={mappings} />,
|
||||
[ALIASES_TAB_ID]: <TabAliases aliases={aliases} />,
|
||||
};
|
||||
|
||||
const tabContent = tabToComponentMap[activeTab];
|
||||
|
||||
const managedTemplateCallout = isManaged ? (
|
||||
<Fragment>
|
||||
<EuiCallOut
|
||||
|
@ -188,7 +191,7 @@ export const LegacyTemplateDetails: React.FunctionComponent<Props> = ({
|
|||
|
||||
<EuiSpacer size="l" />
|
||||
|
||||
<Content templateDetails={templateDetails} />
|
||||
{tabContent}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,3 @@
|
|||
*/
|
||||
|
||||
export { TabSummary } from './tab_summary';
|
||||
export { TabMappings } from './tab_mappings';
|
||||
export { TabSettings } from './tab_settings';
|
||||
export { TabAliases } from './tab_aliases';
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { EuiCodeBlock, EuiCallOut } from '@elastic/eui';
|
||||
import { TemplateDeserialized } from '../../../../../../../common';
|
||||
|
||||
interface Props {
|
||||
templateDetails: TemplateDeserialized;
|
||||
}
|
||||
|
||||
export const TabAliases: React.FunctionComponent<Props> = ({ templateDetails }) => {
|
||||
const {
|
||||
template: { aliases },
|
||||
} = templateDetails;
|
||||
|
||||
if (aliases && Object.keys(aliases).length) {
|
||||
return (
|
||||
<div data-test-subj="aliasesTab">
|
||||
<EuiCodeBlock lang="json">{JSON.stringify(aliases, null, 2)}</EuiCodeBlock>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<EuiCallOut
|
||||
title={
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateDetails.aliasesTab.noAliasesTitle"
|
||||
defaultMessage="No aliases defined."
|
||||
/>
|
||||
}
|
||||
iconType="pin"
|
||||
data-test-subj="noAliasesCallout"
|
||||
/>
|
||||
);
|
||||
};
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { EuiCodeBlock, EuiCallOut } from '@elastic/eui';
|
||||
import { TemplateDeserialized } from '../../../../../../../common';
|
||||
|
||||
interface Props {
|
||||
templateDetails: TemplateDeserialized;
|
||||
}
|
||||
|
||||
export const TabMappings: React.FunctionComponent<Props> = ({ templateDetails }) => {
|
||||
const {
|
||||
template: { mappings },
|
||||
} = templateDetails;
|
||||
|
||||
if (mappings && Object.keys(mappings).length) {
|
||||
return (
|
||||
<div data-test-subj="mappingsTab">
|
||||
<EuiCodeBlock lang="json">{JSON.stringify(mappings, null, 2)}</EuiCodeBlock>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<EuiCallOut
|
||||
title={
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateDetails.mappingsTab.noMappingsTitle"
|
||||
defaultMessage="No mappings defined."
|
||||
/>
|
||||
}
|
||||
iconType="pin"
|
||||
data-test-subj="noMappingsCallout"
|
||||
/>
|
||||
);
|
||||
};
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { EuiCodeBlock, EuiCallOut } from '@elastic/eui';
|
||||
import { TemplateDeserialized } from '../../../../../../../common';
|
||||
|
||||
interface Props {
|
||||
templateDetails: TemplateDeserialized;
|
||||
}
|
||||
|
||||
export const TabSettings: React.FunctionComponent<Props> = ({ templateDetails }) => {
|
||||
const {
|
||||
template: { settings },
|
||||
} = templateDetails;
|
||||
|
||||
if (settings && Object.keys(settings).length) {
|
||||
return (
|
||||
<div data-test-subj="settingsTab">
|
||||
<EuiCodeBlock lang="json">{JSON.stringify(settings, null, 2)}</EuiCodeBlock>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<EuiCallOut
|
||||
title={
|
||||
<FormattedMessage
|
||||
id="xpack.idxMgmt.templateDetails.settingsTab.noSettingsTitle"
|
||||
defaultMessage="No settings defined."
|
||||
/>
|
||||
}
|
||||
iconType="pin"
|
||||
data-test-subj="noSettingsCallout"
|
||||
/>
|
||||
);
|
||||
};
|
|
@ -20,6 +20,10 @@ class DocumentationService {
|
|||
this.kibanaDocsBase = `${docsBase}/kibana/${DOC_LINK_VERSION}`;
|
||||
}
|
||||
|
||||
public getEsDocsBase() {
|
||||
return this.esDocsBase;
|
||||
}
|
||||
|
||||
public getSettingsDocumentationLink() {
|
||||
return `${this.esDocsBase}/index-modules.html#index-modules-settings`;
|
||||
}
|
||||
|
|
|
@ -7065,9 +7065,6 @@
|
|||
"xpack.idxMgmt.summary.summaryTitle": "一般",
|
||||
"xpack.idxMgmt.templateCreate.loadingTemplateToCloneDescription": "クローンを作成するテンプレートを読み込み中…",
|
||||
"xpack.idxMgmt.templateCreate.loadingTemplateToCloneErrorMessage": "クローンを作成するテンプレートを読み込み中にエラーが発生",
|
||||
"xpack.idxMgmt.templateDetails.aliasesTab.noAliasesTitle": "エイリアスが定義されていません。",
|
||||
"xpack.idxMgmt.templateDetails.mappingsTab.noMappingsTitle": "マッピングが定義されていません。",
|
||||
"xpack.idxMgmt.templateDetails.settingsTab.noSettingsTitle": "設定が定義されていません。",
|
||||
"xpack.idxMgmt.templateDetails.summaryTab.ilmPolicyDescriptionListTitle": "ILM ポリシー",
|
||||
"xpack.idxMgmt.templateDetails.summaryTab.indexPatternsDescriptionListTitle": "インデックス{numIndexPatterns, plural, one {パターン} other {パターン}}",
|
||||
"xpack.idxMgmt.templateDetails.summaryTab.noneDescriptionText": "なし",
|
||||
|
@ -7082,12 +7079,6 @@
|
|||
"xpack.idxMgmt.templateForm.createButtonLabel": "テンプレートを作成",
|
||||
"xpack.idxMgmt.templateForm.saveButtonLabel": "テンプレートを保存",
|
||||
"xpack.idxMgmt.templateForm.saveTemplateError": "テンプレートを作成できません",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.aliasesDescription": "エイリアスをセットアップして、インデックスに関連付けてください。",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.aliasesEditorHelpText": "JSON フォーマットを使用: {code}",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.docsButtonLabel": "インデックステンプレートドキュメント",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.fieldAliasesAriaLabel": "エイリアスコードエディター",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.fieldAliasesLabel": "エイリアス",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.stepTitle": "エイリアス (任意)",
|
||||
"xpack.idxMgmt.templateForm.stepLogistics.docsButtonLabel": "インデックステンプレートドキュメント",
|
||||
"xpack.idxMgmt.templateForm.stepLogistics.fieldIndexPatternsHelpText": "スペースと {invalidCharactersList} は使用できません。",
|
||||
"xpack.idxMgmt.templateForm.stepLogistics.fieldIndexPatternsLabel": "インデックスパターン",
|
||||
|
@ -7103,9 +7094,6 @@
|
|||
"xpack.idxMgmt.templateForm.stepLogistics.stepTitle": "ロジスティクス",
|
||||
"xpack.idxMgmt.templateForm.stepLogistics.versionDescription": "テンプレートを外部管理システムで識別するための番号です。",
|
||||
"xpack.idxMgmt.templateForm.stepLogistics.versionTitle": "バージョン",
|
||||
"xpack.idxMgmt.templateForm.stepMappings.docsButtonLabel": "マッピングドキュメント",
|
||||
"xpack.idxMgmt.templateForm.stepMappings.mappingsDescription": "ドキュメントの保存とインデックス方法を定義します。",
|
||||
"xpack.idxMgmt.templateForm.stepMappings.stepTitle": "マッピング (任意)",
|
||||
"xpack.idxMgmt.templateForm.stepReview.requestTab.descriptionText": "このリクエストは次のインデックステンプレートを作成します。",
|
||||
"xpack.idxMgmt.templateForm.stepReview.requestTabTitle": "リクエスト",
|
||||
"xpack.idxMgmt.templateForm.stepReview.stepTitle": "「{templateName}」の詳細の確認",
|
||||
|
@ -7127,12 +7115,6 @@
|
|||
"xpack.idxMgmt.templateForm.steps.mappingsStepName": "マッピング",
|
||||
"xpack.idxMgmt.templateForm.steps.settingsStepName": "インデックス設定",
|
||||
"xpack.idxMgmt.templateForm.steps.summaryStepName": "テンプレートのレビュー",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.docsButtonLabel": "インデックス設定ドキュメント",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.fieldIndexSettingsAriaLabel": "インデックス設定エディター",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.fieldIndexSettingsLabel": "インデックス設定",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.settingsDescription": "インデックスの動作を定義します。",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.settingsEditorHelpText": "JSON フォーマットを使用: {code}",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.stepTitle": "インデックス設定 (任意)",
|
||||
"xpack.idxMgmt.templateList.table.ilmPolicyColumnDescription": "インデックスライフサイクルポリシー「{policyName}」",
|
||||
"xpack.idxMgmt.templateList.table.ilmPolicyColumnTitle": "ILM ポリシー",
|
||||
"xpack.idxMgmt.templateList.table.indexPatternsColumnTitle": "インデックスパターン",
|
||||
|
|
|
@ -7069,9 +7069,6 @@
|
|||
"xpack.idxMgmt.summary.summaryTitle": "常规",
|
||||
"xpack.idxMgmt.templateCreate.loadingTemplateToCloneDescription": "正在加载要克隆的模板……",
|
||||
"xpack.idxMgmt.templateCreate.loadingTemplateToCloneErrorMessage": "加载要克隆的模板时出错",
|
||||
"xpack.idxMgmt.templateDetails.aliasesTab.noAliasesTitle": "未定义任何别名。",
|
||||
"xpack.idxMgmt.templateDetails.mappingsTab.noMappingsTitle": "未定义任何映射。",
|
||||
"xpack.idxMgmt.templateDetails.settingsTab.noSettingsTitle": "未定义任何设置。",
|
||||
"xpack.idxMgmt.templateDetails.summaryTab.ilmPolicyDescriptionListTitle": "ILM 策略",
|
||||
"xpack.idxMgmt.templateDetails.summaryTab.indexPatternsDescriptionListTitle": "索引{numIndexPatterns, plural, one {模式} other {模式}}",
|
||||
"xpack.idxMgmt.templateDetails.summaryTab.noneDescriptionText": "无",
|
||||
|
@ -7086,12 +7083,6 @@
|
|||
"xpack.idxMgmt.templateForm.createButtonLabel": "创建模板",
|
||||
"xpack.idxMgmt.templateForm.saveButtonLabel": "保存模板",
|
||||
"xpack.idxMgmt.templateForm.saveTemplateError": "无法创建模板",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.aliasesDescription": "设置要与索引关联的别名。",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.aliasesEditorHelpText": "使用 JSON 格式:{code}",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.docsButtonLabel": "索引模板文档",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.fieldAliasesAriaLabel": "别名代码编辑器",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.fieldAliasesLabel": "别名",
|
||||
"xpack.idxMgmt.templateForm.stepAliases.stepTitle": "别名(可选)",
|
||||
"xpack.idxMgmt.templateForm.stepLogistics.docsButtonLabel": "索引模板文档",
|
||||
"xpack.idxMgmt.templateForm.stepLogistics.fieldIndexPatternsHelpText": "不允许使用空格和字符 {invalidCharactersList}。",
|
||||
"xpack.idxMgmt.templateForm.stepLogistics.fieldIndexPatternsLabel": "索引模式",
|
||||
|
@ -7107,9 +7098,6 @@
|
|||
"xpack.idxMgmt.templateForm.stepLogistics.stepTitle": "运筹",
|
||||
"xpack.idxMgmt.templateForm.stepLogistics.versionDescription": "在外部管理系统中标识该模板的编号。",
|
||||
"xpack.idxMgmt.templateForm.stepLogistics.versionTitle": "版本",
|
||||
"xpack.idxMgmt.templateForm.stepMappings.docsButtonLabel": "映射文档",
|
||||
"xpack.idxMgmt.templateForm.stepMappings.mappingsDescription": "定义如何存储和索引文档。",
|
||||
"xpack.idxMgmt.templateForm.stepMappings.stepTitle": "映射(可选)",
|
||||
"xpack.idxMgmt.templateForm.stepReview.requestTab.descriptionText": "此请求将创建以下索引模板。",
|
||||
"xpack.idxMgmt.templateForm.stepReview.requestTabTitle": "请求",
|
||||
"xpack.idxMgmt.templateForm.stepReview.stepTitle": "查看 “{templateName}” 的详情",
|
||||
|
@ -7131,12 +7119,6 @@
|
|||
"xpack.idxMgmt.templateForm.steps.mappingsStepName": "映射",
|
||||
"xpack.idxMgmt.templateForm.steps.settingsStepName": "索引设置",
|
||||
"xpack.idxMgmt.templateForm.steps.summaryStepName": "复查模板",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.docsButtonLabel": "索引设置文档",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.fieldIndexSettingsAriaLabel": "索引设置编辑器",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.fieldIndexSettingsLabel": "索引设置",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.settingsDescription": "定义索引的行为。",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.settingsEditorHelpText": "使用 JSON 格式:{code}",
|
||||
"xpack.idxMgmt.templateForm.stepSettings.stepTitle": "索引设置(可选)",
|
||||
"xpack.idxMgmt.templateList.table.ilmPolicyColumnDescription": "“{policyName}”索引生命周期策略",
|
||||
"xpack.idxMgmt.templateList.table.ilmPolicyColumnTitle": "ILM 策略",
|
||||
"xpack.idxMgmt.templateList.table.indexPatternsColumnTitle": "索引模式",
|
||||
|
|
Loading…
Reference in a new issue