From 21f2f7fb50056e9a8f983b9a83c1ac8746817473 Mon Sep 17 00:00:00 2001
From: Nicolas Chaulet
Date: Tue, 7 Apr 2020 16:22:48 -0400
Subject: [PATCH 1/8] [Ingest] Create datasource in one page
---
.../components/layout.tsx | 36 +--
.../components/navigation.tsx | 85 ------
.../create_datasource_page/constants.ts | 7 -
.../create_datasource_page/index.tsx | 272 ++++++++----------
.../step_configure_datasource.tsx | 247 +++-------------
.../step_define_datasource.tsx | 168 +++++++++++
.../create_datasource_page/step_review.tsx | 202 -------------
.../step_select_config.tsx | 46 +--
.../step_select_package.tsx | 56 +---
9 files changed, 336 insertions(+), 783 deletions(-)
delete mode 100644 x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/navigation.tsx
create mode 100644 x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_define_datasource.tsx
delete mode 100644 x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_review.tsx
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx
index 8bb7b2553c1b1..6798662e78c1e 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx
@@ -19,35 +19,21 @@ import { WithHeaderLayout } from '../../../../layouts';
import { AgentConfig, PackageInfo } from '../../../../types';
import { PackageIcon } from '../../../../components/package_icon';
import { CreateDatasourceFrom, CreateDatasourceStep } from '../types';
-import { CreateDatasourceStepsNavigation } from './navigation';
export const CreateDatasourcePageLayout: React.FunctionComponent<{
from: CreateDatasourceFrom;
basePath: string;
cancelUrl: string;
maxStep: CreateDatasourceStep | '';
- currentStep: CreateDatasourceStep;
agentConfig?: AgentConfig;
packageInfo?: PackageInfo;
- restrictWidth?: number;
-}> = ({
- from,
- basePath,
- cancelUrl,
- maxStep,
- currentStep,
- agentConfig,
- packageInfo,
- restrictWidth,
- children,
-}) => {
+}> = ({ from, basePath, cancelUrl, maxStep, agentConfig, packageInfo, children }) => {
return (
-
+
@@ -67,7 +53,7 @@ export const CreateDatasourcePageLayout: React.FunctionComponent<{
- {agentConfig || from === 'config' ? (
+ {agentConfig && from === 'config' ? (
@@ -82,7 +68,7 @@ export const CreateDatasourcePageLayout: React.FunctionComponent<{
) : null}
- {packageInfo || from === 'package' ? (
+ {packageInfo && from === 'package' ? (
@@ -113,16 +99,10 @@ export const CreateDatasourcePageLayout: React.FunctionComponent<{
}
- rightColumn={
-
- }
>
- {children}
+
+ {children}
+
);
};
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/navigation.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/navigation.tsx
deleted file mode 100644
index 099a7a83caa10..0000000000000
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/navigation.tsx
+++ /dev/null
@@ -1,85 +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 styled from 'styled-components';
-import { useHistory } from 'react-router-dom';
-import { i18n } from '@kbn/i18n';
-import { EuiStepsHorizontal } from '@elastic/eui';
-import { CreateDatasourceFrom, CreateDatasourceStep } from '../types';
-import { WeightedCreateDatasourceSteps, CREATE_DATASOURCE_STEP_PATHS } from '../constants';
-
-const StepsHorizontal = styled(EuiStepsHorizontal)`
- background: none;
-`;
-
-export const CreateDatasourceStepsNavigation: React.FunctionComponent<{
- from: CreateDatasourceFrom;
- basePath: string;
- maxStep: CreateDatasourceStep | '';
- currentStep: CreateDatasourceStep;
-}> = ({ from, basePath, maxStep, currentStep }) => {
- const history = useHistory();
-
- const steps = [
- from === 'config'
- ? {
- title: i18n.translate('xpack.ingestManager.createDatasource.stepSelectPackageLabel', {
- defaultMessage: 'Select package',
- }),
- isSelected: currentStep === 'selectPackage',
- isComplete:
- WeightedCreateDatasourceSteps.indexOf('selectPackage') <=
- WeightedCreateDatasourceSteps.indexOf(maxStep),
- onClick: () => {
- history.push(`${basePath}${CREATE_DATASOURCE_STEP_PATHS.selectPackage}`);
- },
- }
- : {
- title: i18n.translate('xpack.ingestManager.createDatasource.stepSelectConfigLabel', {
- defaultMessage: 'Select configuration',
- }),
- isSelected: currentStep === 'selectConfig',
- isComplete:
- WeightedCreateDatasourceSteps.indexOf('selectConfig') <=
- WeightedCreateDatasourceSteps.indexOf(maxStep),
- onClick: () => {
- history.push(`${basePath}${CREATE_DATASOURCE_STEP_PATHS.selectConfig}`);
- },
- },
- {
- title: i18n.translate('xpack.ingestManager.createDatasource.stepConfigureDatasourceLabel', {
- defaultMessage: 'Configure data source',
- }),
- isSelected: currentStep === 'configure',
- isComplete:
- WeightedCreateDatasourceSteps.indexOf('configure') <=
- WeightedCreateDatasourceSteps.indexOf(maxStep),
- disabled:
- WeightedCreateDatasourceSteps.indexOf(maxStep) <
- WeightedCreateDatasourceSteps.indexOf('configure') - 1,
- onClick: () => {
- history.push(`${basePath}${CREATE_DATASOURCE_STEP_PATHS.configure}`);
- },
- },
- {
- title: i18n.translate('xpack.ingestManager.createDatasource.stepReviewLabel', {
- defaultMessage: 'Review',
- }),
- isSelected: currentStep === 'review',
- isComplete:
- WeightedCreateDatasourceSteps.indexOf('review') <=
- WeightedCreateDatasourceSteps.indexOf(maxStep),
- disabled:
- WeightedCreateDatasourceSteps.indexOf(maxStep) <
- WeightedCreateDatasourceSteps.indexOf('review') - 1,
- onClick: () => {
- history.push(`${basePath}${CREATE_DATASOURCE_STEP_PATHS.review}`);
- },
- },
- ];
-
- return ;
-};
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/constants.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/constants.ts
index eea18179560a1..49223a8eb4531 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/constants.ts
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/constants.ts
@@ -9,10 +9,3 @@ export const WeightedCreateDatasourceSteps = [
'configure',
'review',
];
-
-export const CREATE_DATASOURCE_STEP_PATHS = {
- selectConfig: '/select-config',
- selectPackage: '/select-package',
- configure: '/configure',
- review: '/review',
-};
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
index 23d0f3317a667..3dc7957fa4063 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
@@ -4,32 +4,34 @@
* you may not use this file except in compliance with the Elastic License.
*/
import React, { useState } from 'react';
-import {
- useRouteMatch,
- HashRouter as Router,
- Switch,
- Route,
- Redirect,
- useHistory,
-} from 'react-router-dom';
+import { useRouteMatch, useHistory } from 'react-router-dom';
+import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
-import { EuiButtonEmpty } from '@elastic/eui';
+import {
+ EuiButtonEmpty,
+ EuiButton,
+ EuiSteps,
+ EuiBottomBar,
+ EuiFlexGroup,
+ EuiFlexItem,
+} from '@elastic/eui';
+import { EuiStepProps } from '@elastic/eui/src/components/steps/step';
import { AGENT_CONFIG_DETAILS_PATH } from '../../../constants';
import { AgentConfig, PackageInfo, NewDatasource } from '../../../types';
-import { useLink, sendCreateDatasource } from '../../../hooks';
+import { useLink, sendCreateDatasource, useCore } from '../../../hooks';
import { useLinks as useEPMLinks } from '../../epm/hooks';
import { CreateDatasourcePageLayout } from './components';
import { CreateDatasourceFrom, CreateDatasourceStep } from './types';
-import { CREATE_DATASOURCE_STEP_PATHS } from './constants';
import { StepSelectPackage } from './step_select_package';
import { StepSelectConfig } from './step_select_config';
import { StepConfigureDatasource } from './step_configure_datasource';
-import { StepReviewDatasource } from './step_review';
+
+import { StepDefineDatasource } from './step_define_datasource';
export const CreateDatasourcePage: React.FunctionComponent = () => {
+ const { notifications } = useCore();
const {
params: { configId, pkgkey },
- path: matchPath,
url: basePath,
} = useRouteMatch();
const history = useHistory();
@@ -99,26 +101,6 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
});
const cancelUrl = from === 'config' ? CONFIG_URL : PACKAGE_URL;
- // Redirect to first step
- const redirectToFirstStep =
- from === 'config' ? (
-
- ) : (
-
- );
-
- // Url to first and second steps
- const SELECT_PACKAGE_URL = useLink(`${basePath}${CREATE_DATASOURCE_STEP_PATHS.selectPackage}`);
- const SELECT_CONFIG_URL = useLink(`${basePath}${CREATE_DATASOURCE_STEP_PATHS.selectConfig}`);
- const CONFIGURE_DATASOURCE_URL = useLink(`${basePath}${CREATE_DATASOURCE_STEP_PATHS.configure}`);
- const firstStepUrl = from === 'config' ? SELECT_PACKAGE_URL : SELECT_CONFIG_URL;
- const secondStepUrl = CONFIGURE_DATASOURCE_URL;
-
- // Redirect to second step
- const redirectToSecondStep = (
-
- );
-
// Save datasource
const saveDatasource = async () => {
setIsSaving(true);
@@ -127,6 +109,17 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
return result;
};
+ const onSubmit = async () => {
+ const { error } = await saveDatasource();
+ if (!error) {
+ history.push(`${AGENT_CONFIG_DETAILS_PATH}${agentConfig ? agentConfig.id : configId}`);
+ } else {
+ notifications.toasts.addError(error, {
+ title: 'Error',
+ });
+ }
+ };
+
const layoutProps = {
from,
basePath,
@@ -134,134 +127,99 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
maxStep,
agentConfig,
packageInfo,
- restrictWidth: 770,
};
- return (
-
-
- {/* Redirect to first step from `/` */}
- {from === 'config' ? (
-
+ ),
+ }
+ : {
+ title: i18n.translate('xpack.ingestManager.createDatasource.stepSelectPackageTitle', {
+ defaultMessage: 'Select an integration',
+ }),
+ children: (
+
+ ),
+ },
+ {
+ title: i18n.translate('xpack.ingestManager.createDatasource.stepDefineDatasourceTitle', {
+ defaultMessage: 'Define your data source',
+ }),
+ status: !packageInfo || !agentConfig ? 'disabled' : undefined,
+ children:
+ agentConfig && packageInfo ? (
+
- ) : (
-
- )}
+ ) : null,
+ },
+ ];
- {/* First step, either render select package or select config depending on entry */}
- {from === 'config' ? (
-
-
- {
- setMaxStep('selectPackage');
- history.push(`${basePath}${CREATE_DATASOURCE_STEP_PATHS.configure}`);
- }}
- />
-
-
- ) : (
-
-
- {
- setMaxStep('selectConfig');
- history.push(`${basePath}${CREATE_DATASOURCE_STEP_PATHS.configure}`);
- }}
- />
-
-
- )}
-
- {/* Second step to configure data source, redirect to first step if agent config */}
- {/* or package info isn't defined (i.e. after full page reload) */}
-
-
- {!agentConfig || !packageInfo ? (
- redirectToFirstStep
- ) : (
-
- {from === 'config' ? (
-
- ) : (
-
- )}
-
- }
- cancelUrl={cancelUrl}
- onNext={() => {
- setMaxStep('configure');
- history.push(`${basePath}${CREATE_DATASOURCE_STEP_PATHS.review}`);
- }}
- />
- )}
-
-
-
- {/* Third step to review, redirect to second step if data source name is missing */}
- {/* (i.e. after full page reload) */}
-
-
- {!agentConfig || !datasource.name ? (
- redirectToSecondStep
- ) : (
-
-
-
- }
- onSubmit={async () => {
- const { error } = await saveDatasource();
- if (!error) {
- history.push(
- `${AGENT_CONFIG_DETAILS_PATH}${agentConfig ? agentConfig.id : configId}`
- );
- } else {
- // TODO: Handle save datasource error
- }
- }}
- />
- )}
-
-
-
-
+ return (
+
+
+ {packageInfo && agentConfig && (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+
);
};
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx
index b45beef4a8b5e..c29fa0cb384de 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx
@@ -36,12 +36,8 @@ export const StepConfigureDatasource: React.FunctionComponent<{
packageInfo: PackageInfo;
datasource: NewDatasource;
updateDatasource: (fields: Partial) => void;
- backLink: JSX.Element;
- cancelUrl: string;
- onNext: () => void;
-}> = ({ agentConfig, packageInfo, datasource, updateDatasource, backLink, cancelUrl, onNext }) => {
+}> = ({ agentConfig, packageInfo, datasource, updateDatasource }) => {
// Form show/hide states
- const [isShowingAdvancedDefine, setIsShowingAdvancedDefine] = useState(false);
// Update datasource's package and config info
useEffect(() => {
@@ -80,213 +76,52 @@ export const StepConfigureDatasource: React.FunctionComponent<{
}
}, [datasource.package, datasource.config_id, agentConfig, packageInfo, updateDatasource]);
- // Step A, define datasource
- const DefineDatasource = (
-
-
-
-
- }
- >
-
- updateDatasource({
- name: e.target.value,
- })
- }
- />
-
-
-
-
- }
- labelAppend={
-
-
-
- }
- >
-
- updateDatasource({
- description: e.target.value,
- })
- }
- />
-
-
-
-
- setIsShowingAdvancedDefine(!isShowingAdvancedDefine)}
- >
-
-
- {/* Todo: Populate list of existing namespaces */}
- {isShowingAdvancedDefine ? (
-
-
-
-
-
- }
- >
- {
- updateDatasource({
- namespace: newNamespace,
- });
- }}
- onChange={(newNamespaces: Array<{ label: string }>) => {
- updateDatasource({
- namespace: newNamespaces.length ? newNamespaces[0].label : '',
- });
- }}
- />
-
-
-
-
- ) : null}
-
- );
-
- // Step B, configure inputs (and their streams)
- // Assume packages only export one datasource for now
- const ConfigureInputs =
- packageInfo.datasources &&
+ return packageInfo.datasources &&
packageInfo.datasources[0] &&
packageInfo.datasources[0].inputs &&
packageInfo.datasources[0].inputs.length ? (
-
- {packageInfo.datasources[0].inputs.map(packageInput => {
- const datasourceInput = datasource.inputs.find(input => input.type === packageInput.type);
- return datasourceInput ? (
-
- ) => {
- const indexOfUpdatedInput = datasource.inputs.findIndex(
- input => input.type === packageInput.type
- );
- const newInputs = [...datasource.inputs];
- newInputs[indexOfUpdatedInput] = {
- ...newInputs[indexOfUpdatedInput],
- ...updatedInput,
- };
- updateDatasource({
- inputs: newInputs,
- });
- }}
- />
-
- ) : null;
- })}
-
- ) : (
-
-
-
-
-
-
- }
- />
-
- );
-
- return (
-
-
-
-
-
- {backLink}
-
-
-
-
+ {packageInfo.datasources[0].inputs.map(packageInput => {
+ const datasourceInput = datasource.inputs.find(input => input.type === packageInput.type);
+ return datasourceInput ? (
+
+ ) => {
+ const indexOfUpdatedInput = datasource.inputs.findIndex(
+ input => input.type === packageInput.type
+ );
+ const newInputs = [...datasource.inputs];
+ newInputs[indexOfUpdatedInput] = {
+ ...newInputs[indexOfUpdatedInput],
+ ...updatedInput,
+ };
+ updateDatasource({
+ inputs: newInputs,
+ });
+ }}
/>
-
-
-
-
-
-
-
-
-
-
- onNext()}>
+ ) : null;
+ })}
+
+ ) : (
+
+
+
-
-
-
-
-
+
+
+ }
+ />
+
);
};
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_define_datasource.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_define_datasource.tsx
new file mode 100644
index 0000000000000..9e07faf8906c2
--- /dev/null
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_define_datasource.tsx
@@ -0,0 +1,168 @@
+/*
+ * 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, { useEffect, useState, Fragment } from 'react';
+import { FormattedMessage } from '@kbn/i18n/react';
+import {
+ EuiPanel,
+ EuiFlexGrid,
+ EuiFlexGroup,
+ EuiFlexItem,
+ EuiFormRow,
+ EuiFieldText,
+ EuiButtonEmpty,
+ EuiSpacer,
+ EuiEmptyPrompt,
+ EuiText,
+ EuiComboBox,
+} from '@elastic/eui';
+import { AgentConfig, PackageInfo, Datasource, NewDatasource } from '../../../types';
+import { packageToConfigDatasourceInputs } from '../../../services';
+
+export const StepDefineDatasource: React.FunctionComponent<{
+ agentConfig: AgentConfig;
+ packageInfo: PackageInfo;
+ datasource: NewDatasource;
+ updateDatasource: (fields: Partial) => void;
+}> = ({ agentConfig, packageInfo, datasource, updateDatasource }) => {
+ // Form show/hide states
+ const [isShowingAdvancedDefine, setIsShowingAdvancedDefine] = useState(false);
+
+ // Update datasource's package and config info
+ useEffect(() => {
+ const dsPackage = datasource.package;
+ const currentPkgKey = dsPackage ? `${dsPackage.name}-${dsPackage.version}` : '';
+ const pkgKey = `${packageInfo.name}-${packageInfo.version}`;
+
+ // If package has changed, create shell datasource with input&stream values based on package info
+ if (currentPkgKey !== pkgKey) {
+ // Existing datasources on the agent config using the package name, retrieve highest number appended to datasource name
+ const dsPackageNamePattern = new RegExp(`${packageInfo.name}-(\\d+)`);
+ const dsWithMatchingNames = (agentConfig.datasources as Datasource[])
+ .filter(ds => Boolean(ds.name.match(dsPackageNamePattern)))
+ .map(ds => parseInt(ds.name.match(dsPackageNamePattern)![1], 10))
+ .sort();
+
+ updateDatasource({
+ name: `${packageInfo.name}-${
+ dsWithMatchingNames.length ? dsWithMatchingNames[dsWithMatchingNames.length - 1] + 1 : 1
+ }`,
+ package: {
+ name: packageInfo.name,
+ title: packageInfo.title,
+ version: packageInfo.version,
+ },
+ inputs: packageToConfigDatasourceInputs(packageInfo),
+ });
+ }
+
+ // If agent config has changed, update datasource's config ID and namespace
+ if (datasource.config_id !== agentConfig.id) {
+ updateDatasource({
+ config_id: agentConfig.id,
+ namespace: agentConfig.namespace,
+ });
+ }
+ }, [datasource.package, datasource.config_id, agentConfig, packageInfo, updateDatasource]);
+
+ return (
+ <>
+
+
+
+ }
+ >
+
+ updateDatasource({
+ name: e.target.value,
+ })
+ }
+ />
+
+
+
+
+ }
+ labelAppend={
+
+
+
+ }
+ >
+
+ updateDatasource({
+ description: e.target.value,
+ })
+ }
+ />
+
+
+
+
+ setIsShowingAdvancedDefine(!isShowingAdvancedDefine)}
+ >
+
+
+ {/* Todo: Populate list of existing namespaces */}
+ {isShowingAdvancedDefine ? (
+
+
+
+
+
+ }
+ >
+ {
+ updateDatasource({
+ namespace: newNamespace,
+ });
+ }}
+ onChange={(newNamespaces: Array<{ label: string }>) => {
+ updateDatasource({
+ namespace: newNamespaces.length ? newNamespaces[0].label : '',
+ });
+ }}
+ />
+
+
+
+
+ ) : null}
+ >
+ );
+};
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_review.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_review.tsx
deleted file mode 100644
index 20af5954c1436..0000000000000
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_review.tsx
+++ /dev/null
@@ -1,202 +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, { Fragment, useState, useEffect } from 'react';
-import { i18n } from '@kbn/i18n';
-import { FormattedMessage } from '@kbn/i18n/react';
-import {
- EuiFlexGroup,
- EuiFlexItem,
- EuiButtonEmpty,
- EuiButton,
- EuiTitle,
- EuiCallOut,
- EuiText,
- EuiCheckbox,
- EuiTabbedContent,
- EuiCodeBlock,
- EuiSpacer,
-} from '@elastic/eui';
-import { dump } from 'js-yaml';
-import { NewDatasource, AgentConfig } from '../../../types';
-import { useConfig, sendGetAgentStatus } from '../../../hooks';
-import { storedDatasourceToAgentDatasource } from '../../../services';
-
-const KEYS_TO_SINK = ['inputs', 'streams'];
-
-export const StepReviewDatasource: React.FunctionComponent<{
- agentConfig: AgentConfig;
- datasource: NewDatasource;
- backLink: JSX.Element;
- cancelUrl: string;
- onSubmit: () => void;
- isSubmitLoading: boolean;
-}> = ({ agentConfig, datasource, backLink, cancelUrl, onSubmit, isSubmitLoading }) => {
- // Agent count info states
- const [agentCount, setAgentCount] = useState(0);
- const [agentCountChecked, setAgentCountChecked] = useState(false);
-
- // Config information
- const {
- fleet: { enabled: isFleetEnabled },
- } = useConfig();
-
- // Retrieve agent count
- useEffect(() => {
- const getAgentCount = async () => {
- const { data } = await sendGetAgentStatus({ configId: agentConfig.id });
- if (data?.results.total) {
- setAgentCount(data.results.total);
- }
- };
-
- if (isFleetEnabled) {
- getAgentCount();
- }
- }, [agentConfig.id, isFleetEnabled]);
-
- const showAgentDisclaimer = isFleetEnabled && agentCount;
- const fullAgentDatasource = storedDatasourceToAgentDatasource(datasource);
-
- return (
-
-
-
-
-
-
-
-
-
-
- {backLink}
-
-
-
- {/* Agents affected warning */}
- {showAgentDisclaimer ? (
-
-
- }
- >
-
-
- {agentConfig.name},
- }}
- />
-
-
-
-
- ) : null}
-
- {/* Preview and YAML view */}
- {/* TODO: Implement preview tab */}
-
-
-
-
- {dump(fullAgentDatasource, {
- sortKeys: (a: string, b: string) => {
- // Make YAML output prettier by sinking certain fields
- if (KEYS_TO_SINK.indexOf(a) > -1) {
- return 1;
- }
- if (KEYS_TO_SINK.indexOf(b) > -1) {
- return -1;
- }
- return 0;
- },
- })}
-
-
- ),
- },
- ]}
- />
-
-
- {/* Confirm agents affected */}
- {showAgentDisclaimer ? (
-
-
-
-
-
-
-
-
-
-
-
- }
- checked={agentCountChecked}
- onChange={e => setAgentCountChecked(e.target.checked)}
- />
-
-
-
- ) : null}
-
-
-
-
-
-
-
-
-
- onSubmit()}
- isLoading={isSubmitLoading}
- disabled={isSubmitLoading || Boolean(showAgentDisclaimer && !agentCountChecked)}
- >
-
-
-
-
-
-
- );
-};
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_config.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_config.tsx
index 2ddfc170069a1..3c3c6525a6035 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_config.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_config.tsx
@@ -8,10 +8,8 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import {
EuiButtonEmpty,
- EuiButton,
EuiFlexGroup,
EuiFlexItem,
- EuiTitle,
EuiSelectable,
EuiSpacer,
EuiTextColor,
@@ -27,15 +25,12 @@ export const StepSelectConfig: React.FunctionComponent<{
updatePackageInfo: (packageInfo: PackageInfo | undefined) => void;
agentConfig: AgentConfig | undefined;
updateAgentConfig: (config: AgentConfig | undefined) => void;
- cancelUrl: string;
- onNext: () => void;
-}> = ({ pkgkey, updatePackageInfo, agentConfig, updateAgentConfig, cancelUrl, onNext }) => {
+}> = ({ pkgkey, updatePackageInfo, agentConfig, updateAgentConfig }) => {
const hasWriteCapabilites = useCapabilities().write;
// Selected config state
const [selectedConfigId, setSelectedConfigId] = useState(
agentConfig ? agentConfig.id : undefined
);
- const [selectedConfigLoading, setSelectedConfigLoading] = useState(false);
const [selectedConfigError, setSelectedConfigError] = useState();
// Todo: replace with create agent config flyout
@@ -70,9 +65,7 @@ export const StepSelectConfig: React.FunctionComponent<{
useEffect(() => {
const fetchAgentConfigInfo = async () => {
if (selectedConfigId) {
- setSelectedConfigLoading(true);
const { data, error } = await sendGetOneAgentConfig(selectedConfigId);
- setSelectedConfigLoading(false);
if (error) {
setSelectedConfigError(error);
updateAgentConfig(undefined);
@@ -124,16 +117,6 @@ export const StepSelectConfig: React.FunctionComponent<{
-
-
-
-
-
-
-
) : null}
-
-
-
-
-
-
-
-
- onNext()}
- >
-
-
-
-
-
);
};
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_package.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_package.tsx
index cc7fc89ab8a80..3603fad619a4a 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_package.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_package.tsx
@@ -6,15 +6,7 @@
import React, { useEffect, useState, Fragment } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
-import {
- EuiButtonEmpty,
- EuiButton,
- EuiFlexGroup,
- EuiFlexItem,
- EuiTitle,
- EuiSelectable,
- EuiSpacer,
-} from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiSelectable, EuiSpacer } from '@elastic/eui';
import { Error } from '../../../components';
import { AgentConfig, PackageInfo } from '../../../types';
import { useGetOneAgentConfig, useGetPackages, sendGetPackageInfoByKey } from '../../../hooks';
@@ -25,14 +17,11 @@ export const StepSelectPackage: React.FunctionComponent<{
updateAgentConfig: (config: AgentConfig | undefined) => void;
packageInfo?: PackageInfo;
updatePackageInfo: (packageInfo: PackageInfo | undefined) => void;
- cancelUrl: string;
- onNext: () => void;
-}> = ({ agentConfigId, updateAgentConfig, packageInfo, updatePackageInfo, cancelUrl, onNext }) => {
+}> = ({ agentConfigId, updateAgentConfig, packageInfo, updatePackageInfo }) => {
// Selected package state
const [selectedPkgKey, setSelectedPkgKey] = useState(
packageInfo ? `${packageInfo.name}-${packageInfo.version}` : undefined
);
- const [selectedPkgLoading, setSelectedPkgLoading] = useState(false);
const [selectedPkgError, setSelectedPkgError] = useState();
// Fetch agent config info
@@ -57,9 +46,7 @@ export const StepSelectPackage: React.FunctionComponent<{
useEffect(() => {
const fetchPackageInfo = async () => {
if (selectedPkgKey) {
- setSelectedPkgLoading(true);
const { data, error } = await sendGetPackageInfoByKey(selectedPkgKey);
- setSelectedPkgLoading(false);
if (error) {
setSelectedPkgError(error);
updatePackageInfo(undefined);
@@ -109,16 +96,6 @@ export const StepSelectPackage: React.FunctionComponent<{
return (
-
-
-
-
-
-
-
) : null}
-
-
-
-
-
-
-
-
- onNext()}
- >
-
-
-
-
-
);
};
From d22ea9f51b8f1b5f6288d117d1311d7d2318a430 Mon Sep 17 00:00:00 2001
From: Nicolas Chaulet
Date: Wed, 8 Apr 2020 10:29:20 -0400
Subject: [PATCH 2/8] Add confirm modal with agent count
---
.../components/confirm_modal.tsx | 74 ++++++++++++
.../components/index.ts | 1 +
.../create_datasource_page/index.tsx | 112 ++++++++++++------
.../step_configure_datasource.tsx | 19 +--
.../step_define_datasource.tsx | 3 -
.../step_select_config.tsx | 32 +----
6 files changed, 156 insertions(+), 85 deletions(-)
create mode 100644 x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx
new file mode 100644
index 0000000000000..329891d78e0c5
--- /dev/null
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx
@@ -0,0 +1,74 @@
+/*
+ * 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 { EuiOverlayMask, EuiConfirmModal } from '@elastic/eui';
+import { FormattedMessage } from '@kbn/i18n/react';
+import { EuiCallOut } from '@elastic/eui';
+import { EuiSpacer } from '@elastic/eui';
+import { i18n } from '@kbn/i18n';
+import { AgentConfig } from '../../../../types';
+
+export const ConfirmCreateDatasourceModal: React.FunctionComponent<{
+ onConfirm: () => void;
+ onCancel: () => void;
+ agentCount: number;
+ agentConfig: AgentConfig;
+}> = ({ onConfirm, onCancel, agentCount, agentConfig }) => {
+ return (
+
+
+ }
+ onCancel={onCancel}
+ onConfirm={onConfirm}
+ cancelButtonText={
+
+ }
+ confirmButtonText={
+
+ }
+ buttonColor="primary"
+ >
+
+ {agentConfig.name},
+ }}
+ />
+
+
+
+
+
+ );
+};
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/index.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/index.ts
index e5f18e1449d1b..953a5d020e0fb 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/index.ts
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/index.ts
@@ -5,3 +5,4 @@
*/
export { CreateDatasourcePageLayout } from './layout';
export { DatasourceInputPanel } from './datasource_input_panel';
+export { ConfirmCreateDatasourceModal } from './confirm_modal';
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
index 3dc7957fa4063..5b6ccd13dba99 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
@@ -3,7 +3,7 @@
* 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, { useState } from 'react';
+import React, { useState, useEffect } from 'react';
import { useRouteMatch, useHistory } from 'react-router-dom';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
@@ -18,9 +18,15 @@ import {
import { EuiStepProps } from '@elastic/eui/src/components/steps/step';
import { AGENT_CONFIG_DETAILS_PATH } from '../../../constants';
import { AgentConfig, PackageInfo, NewDatasource } from '../../../types';
-import { useLink, sendCreateDatasource, useCore } from '../../../hooks';
+import {
+ useLink,
+ sendCreateDatasource,
+ useCore,
+ useConfig,
+ sendGetAgentStatus,
+} from '../../../hooks';
import { useLinks as useEPMLinks } from '../../epm/hooks';
-import { CreateDatasourcePageLayout } from './components';
+import { CreateDatasourcePageLayout, ConfirmCreateDatasourceModal } from './components';
import { CreateDatasourceFrom, CreateDatasourceStep } from './types';
import { StepSelectPackage } from './step_select_package';
import { StepSelectConfig } from './step_select_config';
@@ -30,6 +36,9 @@ import { StepDefineDatasource } from './step_define_datasource';
export const CreateDatasourcePage: React.FunctionComponent = () => {
const { notifications } = useCore();
+ const {
+ fleet: { enabled: isFleetEnabled },
+ } = useConfig();
const {
params: { configId, pkgkey },
url: basePath,
@@ -37,12 +46,29 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
const history = useHistory();
const from: CreateDatasourceFrom = configId ? 'config' : 'package';
const [maxStep, setMaxStep] = useState('');
- const [isSaving, setIsSaving] = useState(false);
// Agent config and package info states
const [agentConfig, setAgentConfig] = useState();
const [packageInfo, setPackageInfo] = useState();
+ const agentConfigId = agentConfig?.id;
+ // Retrieve agent count
+ useEffect(() => {
+ const getAgentCount = async () => {
+ if (agentConfigId) {
+ const { data } = await sendGetAgentStatus({ configId: agentConfigId });
+ if (data?.results.total) {
+ setAgentCount(data.results.total);
+ }
+ }
+ };
+
+ if (isFleetEnabled && agentConfigId) {
+ getAgentCount();
+ }
+ }, [agentConfigId, isFleetEnabled]);
+ const [agentCount, setAgentCount] = useState(0);
+
// New datasource state
const [datasource, setDatasource] = useState({
name: '',
@@ -87,6 +113,9 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
};
setDatasource(newDatasource);
+ if (newDatasource.package && newDatasource.config_id && newDatasource.config_id !== '') {
+ setFormState('VALID');
+ }
// eslint-disable-next-line no-console
console.debug('Datasource updated', newDatasource);
};
@@ -102,14 +131,21 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
const cancelUrl = from === 'config' ? CONFIG_URL : PACKAGE_URL;
// Save datasource
+ const [formState, setFormState] = useState<
+ 'VALID' | 'INVALID' | 'CONFIRM' | 'LOADING' | 'SUBMITTED'
+ >('INVALID');
const saveDatasource = async () => {
- setIsSaving(true);
+ setFormState('LOADING');
const result = await sendCreateDatasource(datasource);
- setIsSaving(false);
+ setFormState('SUBMITTED');
return result;
};
const onSubmit = async () => {
+ if (agentCount !== 0 && formState !== 'CONFIRM') {
+ setFormState('CONFIRM');
+ return;
+ }
const { error } = await saveDatasource();
if (!error) {
history.push(`${AGENT_CONFIG_DETAILS_PATH}${agentConfig ? agentConfig.id : configId}`);
@@ -117,6 +153,7 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
notifications.toasts.addError(error, {
title: 'Error',
});
+ setFormState('VALID');
}
};
@@ -191,35 +228,42 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
return (
-
- {packageInfo && agentConfig && (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ {formState === 'CONFIRM' && agentConfig && (
+ setFormState('VALID')}
+ />
)}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
);
};
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx
index c29fa0cb384de..1c345c025b1b9 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx
@@ -3,24 +3,9 @@
* 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, { useEffect, useState, Fragment } from 'react';
-import { i18n } from '@kbn/i18n';
+import React, { useEffect } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
-import {
- EuiSteps,
- EuiPanel,
- EuiFlexGrid,
- EuiFlexGroup,
- EuiFlexItem,
- EuiFormRow,
- EuiFieldText,
- EuiButtonEmpty,
- EuiSpacer,
- EuiEmptyPrompt,
- EuiText,
- EuiButton,
- EuiComboBox,
-} from '@elastic/eui';
+import { EuiPanel, EuiFlexGroup, EuiFlexItem, EuiEmptyPrompt, EuiText } from '@elastic/eui';
import {
AgentConfig,
PackageInfo,
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_define_datasource.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_define_datasource.tsx
index 9e07faf8906c2..792389381eaf0 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_define_datasource.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_define_datasource.tsx
@@ -6,15 +6,12 @@
import React, { useEffect, useState, Fragment } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import {
- EuiPanel,
EuiFlexGrid,
- EuiFlexGroup,
EuiFlexItem,
EuiFormRow,
EuiFieldText,
EuiButtonEmpty,
EuiSpacer,
- EuiEmptyPrompt,
EuiText,
EuiComboBox,
} from '@elastic/eui';
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_config.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_config.tsx
index 3c3c6525a6035..6cbe56e628903 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_config.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_select_config.tsx
@@ -6,17 +6,8 @@
import React, { useEffect, useState, Fragment } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
-import {
- EuiButtonEmpty,
- EuiFlexGroup,
- EuiFlexItem,
- EuiSelectable,
- EuiSpacer,
- EuiTextColor,
-} from '@elastic/eui';
+import { EuiFlexGroup, EuiFlexItem, EuiSelectable, EuiSpacer, EuiTextColor } from '@elastic/eui';
import { Error } from '../../../components';
-import { AGENT_CONFIG_PATH } from '../../../constants';
-import { useCapabilities, useLink } from '../../../hooks';
import { AgentConfig, PackageInfo, GetAgentConfigsResponseItem } from '../../../types';
import { useGetPackageInfoByKey, useGetAgentConfigs, sendGetOneAgentConfig } from '../../../hooks';
@@ -26,16 +17,12 @@ export const StepSelectConfig: React.FunctionComponent<{
agentConfig: AgentConfig | undefined;
updateAgentConfig: (config: AgentConfig | undefined) => void;
}> = ({ pkgkey, updatePackageInfo, agentConfig, updateAgentConfig }) => {
- const hasWriteCapabilites = useCapabilities().write;
// Selected config state
const [selectedConfigId, setSelectedConfigId] = useState(
agentConfig ? agentConfig.id : undefined
);
const [selectedConfigError, setSelectedConfigError] = useState();
- // Todo: replace with create agent config flyout
- const CREATE_NEW_CONFIG_URI = useLink(AGENT_CONFIG_PATH);
-
// Fetch package info
const { data: packageInfoData, error: packageInfoError } = useGetPackageInfoByKey(pkgkey);
@@ -115,23 +102,6 @@ export const StepSelectConfig: React.FunctionComponent<{
return (
-
-
-
-
-
-
-
-
-
Date: Wed, 8 Apr 2020 14:53:34 -0400
Subject: [PATCH 3/8] Fix bottom bar to not hide the navigation
---
.../sections/agent_config/create_datasource_page/index.tsx | 3 +--
x-pack/plugins/ingest_manager/public/index.ts | 2 ++
x-pack/plugins/ingest_manager/public/styles/_index.scss | 6 ++++++
3 files changed, 9 insertions(+), 2 deletions(-)
create mode 100644 x-pack/plugins/ingest_manager/public/styles/_index.scss
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
index 5b6ccd13dba99..3c67becb8dc9a 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
@@ -225,7 +225,6 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
) : null,
},
];
-
return (
{formState === 'CONFIRM' && agentConfig && (
@@ -237,7 +236,7 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
/>
)}
-
+
diff --git a/x-pack/plugins/ingest_manager/public/index.ts b/x-pack/plugins/ingest_manager/public/index.ts
index aa1e0e79e548b..c54174e84f848 100644
--- a/x-pack/plugins/ingest_manager/public/index.ts
+++ b/x-pack/plugins/ingest_manager/public/index.ts
@@ -6,6 +6,8 @@
import { PluginInitializerContext } from 'src/core/public';
import { IngestManagerPlugin } from './plugin';
+import './styles/_index.scss';
+
export const plugin = (initializerContext: PluginInitializerContext) => {
return new IngestManagerPlugin(initializerContext);
};
diff --git a/x-pack/plugins/ingest_manager/public/styles/_index.scss b/x-pack/plugins/ingest_manager/public/styles/_index.scss
new file mode 100644
index 0000000000000..b2a76166f84e1
--- /dev/null
+++ b/x-pack/plugins/ingest_manager/public/styles/_index.scss
@@ -0,0 +1,6 @@
+/**
+ * 1. Hack EUI so the bottom bar doesn't obscure the nav drawer flyout.
+ */
+.ingestManager__bottomBar {
+ z-index: 5;
+}
From ea41ff906171c0afc726608414aa46bff1191feb Mon Sep 17 00:00:00 2001
From: Nicolas Chaulet
Date: Wed, 8 Apr 2020 15:16:23 -0400
Subject: [PATCH 4/8] Fix translations
---
.../components/confirm_modal.tsx | 3 ++-
.../create_datasource_page/index.tsx | 2 ++
.../translations/translations/ja-JP.json | 20 -------------------
.../translations/translations/zh-CN.json | 20 -------------------
4 files changed, 4 insertions(+), 41 deletions(-)
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx
index 329891d78e0c5..2b9c2a0d7a5a7 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx
@@ -47,7 +47,8 @@ export const ConfirmCreateDatasourceModal: React.FunctionComponent<{
{
/>
)}
+
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 2ae29202ede43..7973bc8f27f57 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -8308,7 +8308,6 @@
"xpack.ingestManager.agentConfigForm.systemMonitoringFieldLabel": "オプション",
"xpack.ingestManager.agentConfigForm.systemMonitoringText": "システムメトリックを収集",
"xpack.ingestManager.agentConfigForm.systemMonitoringTooltipText": "このオプションを有効にすると、システムメトリックと情報を収集するデータソースで構成をブートストラップできます。",
- "xpack.ingestManager.agentConfigInfo.yamlTabName": "YAML",
"xpack.ingestManager.agentConfigList.actionsColumnTitle": "アクション",
"xpack.ingestManager.agentConfigList.actionsMenuText": "開く",
"xpack.ingestManager.agentConfigList.addButton": "エージェント構成を作成",
@@ -8447,21 +8446,14 @@
"xpack.ingestManager.createAgentConfig.flyoutTitleDescription": "エージェント構成は、エージェントのグループ全体にわたる設定を管理する目的で使用されます。エージェント構成にデータソースを追加すると、エージェントで収集するデータを指定できます。エージェント構成の編集時には、フリートを使用して、指定したエージェントのグループに更新をデプロイできます。",
"xpack.ingestManager.createAgentConfig.submitButtonLabel": "エージェント構成を作成",
"xpack.ingestManager.createAgentConfig.successNotificationTitle": "エージェント構成「{name}」を作成しました",
- "xpack.ingestManager.createDatasource.addDatasourceButtonText": "データソースに構成を追加",
"xpack.ingestManager.createDatasource.agentConfigurationNameLabel": "構成",
"xpack.ingestManager.createDatasource.cancelLinkText": "キャンセル",
- "xpack.ingestManager.createDatasource.changeConfigLinkText": "構成を変更",
- "xpack.ingestManager.createDatasource.changePackageLinkText": "パッケージを変更",
- "xpack.ingestManager.createDatasource.continueButtonText": "続行",
- "xpack.ingestManager.createDatasource.editDatasourceLinkText": "データソースを編集",
"xpack.ingestManager.createDatasource.packageNameLabel": "パッケージ",
"xpack.ingestManager.createDatasource.pageTitle": "データソースを作成",
"xpack.ingestManager.createDatasource.stepConfigure.advancedOptionsToggleLinkText": "高度なオプション",
- "xpack.ingestManager.createDatasource.stepConfigure.chooseDataTitle": "収集したいデータを選択してください",
"xpack.ingestManager.createDatasource.stepConfigure.datasourceDescriptionInputLabel": "説明",
"xpack.ingestManager.createDatasource.stepConfigure.datasourceNameInputLabel": "データソース名",
"xpack.ingestManager.createDatasource.stepConfigure.datasourceNamespaceInputLabel": "名前空間",
- "xpack.ingestManager.createDatasource.stepConfigure.defineDatasourceTitle": "データソースを定義する",
"xpack.ingestManager.createDatasource.stepConfigure.hideStreamsAriaLabel": "{type} ストリームを隠す",
"xpack.ingestManager.createDatasource.stepConfigure.inputSettingsDescription": "次の設定はすべてのストリームに適用されます。",
"xpack.ingestManager.createDatasource.stepConfigure.inputSettingsTitle": "設定",
@@ -8470,27 +8462,15 @@
"xpack.ingestManager.createDatasource.stepConfigure.showStreamsAriaLabel": "{type} ストリームを表示",
"xpack.ingestManager.createDatasource.stepConfigure.streamsEnabledCountText": "{count} / {total, plural, one {# ストリーム} other {# ストリーム}}が有効です",
"xpack.ingestManager.createDatasource.stepConfigure.toggleAdvancedOptionsButtonText": "高度なオプション",
- "xpack.ingestManager.createDatasource.stepConfigureDatasourceLabel": "構成データソース",
- "xpack.ingestManager.createDatasource.stepReview.agentsAffectedCalloutText": "選択されたエージェント構成 {configName} が一部のエージェントで既に使用されていることをフリートが検出しました。このアクションの結果として、フリートはこの構成に登録されているすべてのエージェントを更新します。",
- "xpack.ingestManager.createDatasource.stepReview.agentsAffectedCalloutTitle": "このアクションは {count, plural, one {# エージェント} other {# エージェント}}に影響します",
- "xpack.ingestManager.createDatasource.stepReview.confirmAgentDisclaimerText": "このアクションによって、この構成に登録されているすべてのエージェントが更新されることを理解しています。",
- "xpack.ingestManager.createDatasource.stepReview.confirmAgentDisclaimerTitle": "意思決定を確認",
- "xpack.ingestManager.createDatasource.stepReview.reviewTitle": "変更の見直し",
- "xpack.ingestManager.createDatasource.stepReviewLabel": "見直し",
"xpack.ingestManager.createDatasource.StepSelectConfig.agentConfigAgentsCountText": "{count, plural, one {# エージェント} other {# エージェント}}",
- "xpack.ingestManager.createDatasource.StepSelectConfig.createNewConfigButtonText": "新しい構成を作成",
"xpack.ingestManager.createDatasource.StepSelectConfig.errorLoadingAgentConfigsTitle": "エージェント構成の読み込みエラー",
"xpack.ingestManager.createDatasource.StepSelectConfig.errorLoadingPackageTitle": "パッケージ情報の読み込みエラー",
"xpack.ingestManager.createDatasource.StepSelectConfig.errorLoadingSelectedAgentConfigTitle": "選択したエージェント構成の読み込みエラー",
"xpack.ingestManager.createDatasource.StepSelectConfig.filterAgentConfigsInputPlaceholder": "エージェント構成の検索",
- "xpack.ingestManager.createDatasource.StepSelectConfig.selectAgentConfigTitle": "エージェント構成を選択する",
- "xpack.ingestManager.createDatasource.stepSelectConfigLabel": "構成を選択",
"xpack.ingestManager.createDatasource.stepSelectPackage.errorLoadingConfigTitle": "エージェント構成情報の読み込みエラー",
"xpack.ingestManager.createDatasource.stepSelectPackage.errorLoadingPackagesTitle": "パッケージの読み込みエラー",
"xpack.ingestManager.createDatasource.stepSelectPackage.errorLoadingSelectedPackageTitle": "選択したパッケージの読み込みエラー",
"xpack.ingestManager.createDatasource.stepSelectPackage.filterPackagesInputPlaceholder": "パッケージの検索",
- "xpack.ingestManager.createDatasource.stepSelectPackage.selectPackageTitle": "パッケージを選択する",
- "xpack.ingestManager.createDatasource.stepSelectPackageLabel": "パッケージを選択",
"xpack.ingestManager.deleteAgentConfigs.confirmModal.affectedAgentsMessage": "{agentsCount, plural, one {# エージェントを} other {# エージェントを}}{agentConfigsCount, plural, one {このエージェント構成に} other {これらのエージェント構成に}}割り当てました。 {agentsCount, plural, one {このエージェント} other {これらのエージェント}}の登録が解除されます。",
"xpack.ingestManager.deleteAgentConfigs.confirmModal.cancelButtonLabel": "キャンセル",
"xpack.ingestManager.deleteAgentConfigs.confirmModal.confirmAndReassignButtonLabel": "{agentConfigsCount, plural, one {エージェント構成} other {エージェント構成}} and unenroll {agentsCount, plural, one {エージェント} other {エージェント}} を削除",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 7f5df15dec83a..9de5fed598765 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -8311,7 +8311,6 @@
"xpack.ingestManager.agentConfigForm.systemMonitoringFieldLabel": "可选",
"xpack.ingestManager.agentConfigForm.systemMonitoringText": "收集系统指标",
"xpack.ingestManager.agentConfigForm.systemMonitoringTooltipText": "启用此选项可使用收集系统指标和信息的数据源启动您的配置。",
- "xpack.ingestManager.agentConfigInfo.yamlTabName": "YAML",
"xpack.ingestManager.agentConfigList.actionsColumnTitle": "操作",
"xpack.ingestManager.agentConfigList.actionsMenuText": "打开",
"xpack.ingestManager.agentConfigList.addButton": "创建代理配置",
@@ -8450,21 +8449,14 @@
"xpack.ingestManager.createAgentConfig.flyoutTitleDescription": "代理配置用于管理整个代理组的设置。您可以将数据源添加到代理配置以指定代理收集的数据。编辑代理配置时,可以使用 Fleet 将更新部署到指定的代理组。",
"xpack.ingestManager.createAgentConfig.submitButtonLabel": "创建代理配置",
"xpack.ingestManager.createAgentConfig.successNotificationTitle": "代理配置“{name}”已创建",
- "xpack.ingestManager.createDatasource.addDatasourceButtonText": "将数据源添加到配置",
"xpack.ingestManager.createDatasource.agentConfigurationNameLabel": "配置",
"xpack.ingestManager.createDatasource.cancelLinkText": "取消",
- "xpack.ingestManager.createDatasource.changeConfigLinkText": "更改配置",
- "xpack.ingestManager.createDatasource.changePackageLinkText": "更改软件包",
- "xpack.ingestManager.createDatasource.continueButtonText": "继续",
- "xpack.ingestManager.createDatasource.editDatasourceLinkText": "编辑数据源",
"xpack.ingestManager.createDatasource.packageNameLabel": "软件包",
"xpack.ingestManager.createDatasource.pageTitle": "创建数据源",
"xpack.ingestManager.createDatasource.stepConfigure.advancedOptionsToggleLinkText": "高级选项",
- "xpack.ingestManager.createDatasource.stepConfigure.chooseDataTitle": "选择要收集的数据",
"xpack.ingestManager.createDatasource.stepConfigure.datasourceDescriptionInputLabel": "描述",
"xpack.ingestManager.createDatasource.stepConfigure.datasourceNameInputLabel": "数据源名称",
"xpack.ingestManager.createDatasource.stepConfigure.datasourceNamespaceInputLabel": "命名空间",
- "xpack.ingestManager.createDatasource.stepConfigure.defineDatasourceTitle": "定义您的数据源",
"xpack.ingestManager.createDatasource.stepConfigure.hideStreamsAriaLabel": "隐藏 {type} 流",
"xpack.ingestManager.createDatasource.stepConfigure.inputSettingsDescription": "以下设置适用于所有流。",
"xpack.ingestManager.createDatasource.stepConfigure.inputSettingsTitle": "设置",
@@ -8473,27 +8465,15 @@
"xpack.ingestManager.createDatasource.stepConfigure.showStreamsAriaLabel": "显示 {type} 流",
"xpack.ingestManager.createDatasource.stepConfigure.streamsEnabledCountText": "{count} / {total, plural, one {# 个流} other {# 个流}}已启用",
"xpack.ingestManager.createDatasource.stepConfigure.toggleAdvancedOptionsButtonText": "高级选项",
- "xpack.ingestManager.createDatasource.stepConfigureDatasourceLabel": "配置数据源",
- "xpack.ingestManager.createDatasource.stepReview.agentsAffectedCalloutText": "Fleet 检测到所选代理配置 {configName} 已由您的部分代理使用。此操作的结果是,Fleet 将更新用此配置进行注册的所有代理。",
- "xpack.ingestManager.createDatasource.stepReview.agentsAffectedCalloutTitle": "此操作将影响 {count, plural, one {# 个代理} other {# 个代理}}",
- "xpack.ingestManager.createDatasource.stepReview.confirmAgentDisclaimerText": "我理解此操作将更新注册到此配置的所有代理。",
- "xpack.ingestManager.createDatasource.stepReview.confirmAgentDisclaimerTitle": "确认您的决定",
- "xpack.ingestManager.createDatasource.stepReview.reviewTitle": "复查更改",
- "xpack.ingestManager.createDatasource.stepReviewLabel": "复查",
"xpack.ingestManager.createDatasource.StepSelectConfig.agentConfigAgentsCountText": "{count, plural, one {# 个代理} other {# 个代理}}",
- "xpack.ingestManager.createDatasource.StepSelectConfig.createNewConfigButtonText": "创建新配置",
"xpack.ingestManager.createDatasource.StepSelectConfig.errorLoadingAgentConfigsTitle": "加载代理配置时出错",
"xpack.ingestManager.createDatasource.StepSelectConfig.errorLoadingPackageTitle": "加载软件包信息时出错",
"xpack.ingestManager.createDatasource.StepSelectConfig.errorLoadingSelectedAgentConfigTitle": "加载选定代理配置时出错",
"xpack.ingestManager.createDatasource.StepSelectConfig.filterAgentConfigsInputPlaceholder": "搜索代理配置",
- "xpack.ingestManager.createDatasource.StepSelectConfig.selectAgentConfigTitle": "选择代理配置",
- "xpack.ingestManager.createDatasource.stepSelectConfigLabel": "选择配置",
"xpack.ingestManager.createDatasource.stepSelectPackage.errorLoadingConfigTitle": "加载代理配置信息时出错",
"xpack.ingestManager.createDatasource.stepSelectPackage.errorLoadingPackagesTitle": "加载软件包时出错",
"xpack.ingestManager.createDatasource.stepSelectPackage.errorLoadingSelectedPackageTitle": "加载选定软件包时出错",
"xpack.ingestManager.createDatasource.stepSelectPackage.filterPackagesInputPlaceholder": "搜索软件包",
- "xpack.ingestManager.createDatasource.stepSelectPackage.selectPackageTitle": "选择软件包",
- "xpack.ingestManager.createDatasource.stepSelectPackageLabel": "选择软件包",
"xpack.ingestManager.deleteAgentConfigs.confirmModal.affectedAgentsMessage": "{agentsCount, plural, one {# 个代理} other {# 个代理}}已分配{agentConfigsCount, plural, one {给此代理配置} other {给这些代理配置}}。将取消注册{agentsCount, plural, one {此代理} other {这些代理}}。",
"xpack.ingestManager.deleteAgentConfigs.confirmModal.cancelButtonLabel": "取消",
"xpack.ingestManager.deleteAgentConfigs.confirmModal.confirmAndReassignButtonLabel": "删除{agentConfigsCount, plural, one {代理配置} other {代理配置}}并取消注册{agentsCount, plural, one {代理} other {代理}}",
From 47945a6b37bffec9e6d0df54b333cd9b495380ef Mon Sep 17 00:00:00 2001
From: Nicolas Chaulet
Date: Thu, 9 Apr 2020 15:36:38 -0400
Subject: [PATCH 5/8] Fix after review
---
.../ingest_manager/components/header.tsx | 14 ++++++++++----
.../components/confirm_modal.tsx | 5 +----
.../create_datasource_page/components/layout.tsx | 8 ++++----
.../agent_config/create_datasource_page/index.tsx | 2 ++
.../step_configure_datasource.tsx | 2 +-
.../agent_enrollment_flyout/instructions.tsx | 2 +-
.../sections/fleet/agent_list_page/index.tsx | 4 ++--
7 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx
index e1f29fdbeb323..d37f34a3ea52c 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx
@@ -13,8 +13,8 @@ const Container = styled.div`
background-color: ${props => props.theme.eui.euiPageBackgroundColor};
`;
-const Wrapper = styled.div`
- max-width: 1200px;
+const Wrapper = styled.div<{ maxWidth?: number }>`
+ max-width: ${props => props.maxWidth || 1200}px;
margin-left: auto;
margin-right: auto;
padding-top: ${props => props.theme.eui.paddingSizes.xl};
@@ -30,6 +30,7 @@ const Tabs = styled(EuiTabs)`
`;
export interface HeaderProps {
+ restrictHeaderWidth?: number;
leftColumn?: JSX.Element;
rightColumn?: JSX.Element;
tabs?: EuiTabProps[];
@@ -42,9 +43,14 @@ const HeaderColumns: React.FC> = memo(({ leftColumn, r
));
-export const Header: React.FC = ({ leftColumn, rightColumn, tabs }) => (
+export const Header: React.FC = ({
+ leftColumn,
+ rightColumn,
+ tabs,
+ restrictHeaderWidth,
+}) => (
-
+
{tabs ? (
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx
index 2b9c2a0d7a5a7..aa7eab8f5be8d 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/confirm_modal.tsx
@@ -5,10 +5,8 @@
*/
import React from 'react';
-import { EuiOverlayMask, EuiConfirmModal } from '@elastic/eui';
+import { EuiCallOut, EuiOverlayMask, EuiConfirmModal, EuiSpacer } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
-import { EuiCallOut } from '@elastic/eui';
-import { EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { AgentConfig } from '../../../../types';
@@ -21,7 +19,6 @@ export const ConfirmCreateDatasourceModal: React.FunctionComponent<{
return (
= ({ from, basePath, cancelUrl, maxStep, agentConfig, packageInfo, children }) => {
return (
@@ -45,7 +47,7 @@ export const CreateDatasourcePageLayout: React.FunctionComponent<{
@@ -100,9 +102,7 @@ export const CreateDatasourcePageLayout: React.FunctionComponent<{
}
>
-
- {children}
-
+ {children}
);
};
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
index 1b94ee9a54ea2..69caba63386d3 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
@@ -89,6 +89,7 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
if (updatedPackageInfo) {
setPackageInfo(updatedPackageInfo);
} else {
+ setFormState('INVALID');
setPackageInfo(undefined);
setMaxStep('');
}
@@ -102,6 +103,7 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
if (updatedAgentConfig) {
setAgentConfig(updatedAgentConfig);
} else {
+ setFormState('INVALID');
setAgentConfig(undefined);
setMaxStep('');
}
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx
index 7282955aff634..843891b63ca01 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/step_configure_datasource.tsx
@@ -3,7 +3,7 @@
* 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, { useEffect, useState } from 'react';
+import React, { useEffect } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import {
EuiPanel,
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/fleet/agent_list_page/components/agent_enrollment_flyout/instructions.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/fleet/agent_list_page/components/agent_enrollment_flyout/instructions.tsx
index 1bc20c2baf660..a0244c601cd96 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/fleet/agent_list_page/components/agent_enrollment_flyout/instructions.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/fleet/agent_list_page/components/agent_enrollment_flyout/instructions.tsx
@@ -86,7 +86,7 @@ export const EnrollmentInstructions: React.FunctionComponent = ({ selecte
steps={[
{
title: i18n.translate('xpack.ingestManager.agentEnrollment.stepSetupAgents', {
- defaultMessage: 'Setup Beats agent',
+ defaultMessage: 'Setup Elastic agent',
}),
children: (
= () => {
}
@@ -373,7 +373,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => {
setIsEnrollmentFlyoutOpen(true)}>
) : null
From 5a16fdea61f1e9c77d44bc4caff7fafdd815329b Mon Sep 17 00:00:00 2001
From: Nicolas Chaulet
Date: Thu, 9 Apr 2020 17:13:38 -0400
Subject: [PATCH 6/8] Fix after review part 2
---
.../ingest_manager/components/header.tsx | 23 ++-
.../components/layout.tsx | 146 ++++++++++--------
2 files changed, 95 insertions(+), 74 deletions(-)
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx
index d37f34a3ea52c..1aab6d901a992 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/components/header.tsx
@@ -7,6 +7,7 @@ import React, { memo } from 'react';
import styled from 'styled-components';
import { EuiFlexGroup, EuiFlexItem, EuiTabs, EuiTab, EuiSpacer } from '@elastic/eui';
import { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab';
+import { EuiFlexItemProps } from '@elastic/eui/src/components/flex/flex_item';
const Container = styled.div`
border-bottom: ${props => props.theme.eui.euiBorderThin};
@@ -33,25 +34,33 @@ export interface HeaderProps {
restrictHeaderWidth?: number;
leftColumn?: JSX.Element;
rightColumn?: JSX.Element;
+ rightColumnGrow?: EuiFlexItemProps['grow'];
tabs?: EuiTabProps[];
}
-const HeaderColumns: React.FC> = memo(({ leftColumn, rightColumn }) => (
-
- {leftColumn ? {leftColumn} : null}
- {rightColumn ? {rightColumn} : null}
-
-));
+const HeaderColumns: React.FC> = memo(
+ ({ leftColumn, rightColumn, rightColumnGrow }) => (
+
+ {leftColumn ? {leftColumn} : null}
+ {rightColumn ? {rightColumn} : null}
+
+ )
+);
export const Header: React.FC = ({
leftColumn,
rightColumn,
+ rightColumnGrow,
tabs,
restrictHeaderWidth,
}) => (
-
+
{tabs ? (
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx
index e5ac1df2a4a6e..2c23d3bf9f358 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx
@@ -28,79 +28,91 @@ export const CreateDatasourcePageLayout: React.FunctionComponent<{
agentConfig?: AgentConfig;
packageInfo?: PackageInfo;
}> = ({ from, basePath, cancelUrl, maxStep, agentConfig, packageInfo, children }) => {
- return (
-
-
-
+ const leftColumn = (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ const rightColumn = (
+
+
+
+ {agentConfig && from === 'config' ? (
+
+
+
+
+
+ {agentConfig?.name || '-'}
+
+
+ ) : null}
+ {packageInfo && from === 'package' ? (
+
+
-
-
-
-
-
-
-
-
-
-
-
-
- {agentConfig && from === 'config' ? (
+
+
+
-
-
-
-
-
- {agentConfig?.name || '-'}
-
-
+
- ) : null}
- {packageInfo && from === 'package' ? (
-
-
-
-
-
-
-
-
-
-
- {packageInfo?.title || packageInfo?.name || '-'}
-
-
-
-
+ {packageInfo?.title || packageInfo?.name || '-'}
- ) : null}
-
-
-
- }
+
+
+
+ ) : null}
+
+
+ );
+
+ const maxWidth = 770;
+ return (
+
{children}
From 0e41dbc311d82287a87bb907545bd7e576dc3876 Mon Sep 17 00:00:00 2001
From: Nicolas Chaulet
Date: Sun, 12 Apr 2020 17:13:52 -0400
Subject: [PATCH 7/8] Fix copy after review
---
.../create_datasource_page/components/layout.tsx | 15 +++++++++++----
.../agent_config/create_datasource_page/index.tsx | 2 +-
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx
index 2c23d3bf9f358..73a7ba8ec119d 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/components/layout.tsx
@@ -51,10 +51,17 @@ export const CreateDatasourcePageLayout: React.FunctionComponent<{
-
+ {from === 'config' ? (
+
+ ) : (
+
+ )}
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
index 69caba63386d3..1a809f1fc78b1 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
@@ -200,7 +200,7 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
from === 'package'
? {
title: i18n.translate('xpack.ingestManager.createDatasource.stepSelectAgentConfigTitle', {
- defaultMessage: 'Select an Agent configuration',
+ defaultMessage: 'Select an agent configuration',
}),
children: (
Date: Mon, 13 Apr 2020 08:45:57 -0400
Subject: [PATCH 8/8] Remove scss
---
.../sections/agent_config/create_datasource_page/index.tsx | 2 +-
x-pack/plugins/ingest_manager/public/index.ts | 1 -
x-pack/plugins/ingest_manager/public/styles/_index.scss | 6 ------
3 files changed, 1 insertion(+), 8 deletions(-)
delete mode 100644 x-pack/plugins/ingest_manager/public/styles/_index.scss
diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
index 1a809f1fc78b1..1ad579d591b21 100644
--- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
+++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_datasource_page/index.tsx
@@ -269,7 +269,7 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
)}
-
+
diff --git a/x-pack/plugins/ingest_manager/public/index.ts b/x-pack/plugins/ingest_manager/public/index.ts
index 141bd8dd799c3..c11ad60dffee4 100644
--- a/x-pack/plugins/ingest_manager/public/index.ts
+++ b/x-pack/plugins/ingest_manager/public/index.ts
@@ -5,7 +5,6 @@
*/
import { PluginInitializerContext } from 'src/core/public';
import { IngestManagerPlugin } from './plugin';
-import './styles/_index.scss';
export { IngestManagerStart } from './plugin';
diff --git a/x-pack/plugins/ingest_manager/public/styles/_index.scss b/x-pack/plugins/ingest_manager/public/styles/_index.scss
deleted file mode 100644
index b2a76166f84e1..0000000000000
--- a/x-pack/plugins/ingest_manager/public/styles/_index.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-/**
- * 1. Hack EUI so the bottom bar doesn't obscure the nav drawer flyout.
- */
-.ingestManager__bottomBar {
- z-index: 5;
-}