Skip to content

Commit

Permalink
Fix after review
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Apr 9, 2020
1 parent 6186e8c commit 47945a6
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -30,6 +30,7 @@ const Tabs = styled(EuiTabs)`
`;

export interface HeaderProps {
restrictHeaderWidth?: number;
leftColumn?: JSX.Element;
rightColumn?: JSX.Element;
tabs?: EuiTabProps[];
Expand All @@ -42,9 +43,14 @@ const HeaderColumns: React.FC<Omit<HeaderProps, 'tabs'>> = memo(({ leftColumn, r
</EuiFlexGroup>
));

export const Header: React.FC<HeaderProps> = ({ leftColumn, rightColumn, tabs }) => (
export const Header: React.FC<HeaderProps> = ({
leftColumn,
rightColumn,
tabs,
restrictHeaderWidth,
}) => (
<Container>
<Wrapper>
<Wrapper maxWidth={restrictHeaderWidth}>
<HeaderColumns leftColumn={leftColumn} rightColumn={rightColumn} />
<EuiFlexGroup>
{tabs ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -21,7 +19,6 @@ export const ConfirmCreateDatasourceModal: React.FunctionComponent<{
return (
<EuiOverlayMask>
<EuiConfirmModal
maxWidth="566px"
title={
<FormattedMessage
id="xpack.ingestManager.createDatasource.confirmModalTitle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export const CreateDatasourcePageLayout: React.FunctionComponent<{
}> = ({ from, basePath, cancelUrl, maxStep, agentConfig, packageInfo, children }) => {
return (
<WithHeaderLayout
restrictHeaderWidth={833}
restrictWidth={833}
leftColumn={
<EuiFlexGroup direction="column" gutterSize="s" alignItems="flexStart">
<EuiFlexItem>
Expand All @@ -45,7 +47,7 @@ export const CreateDatasourcePageLayout: React.FunctionComponent<{
<h1>
<FormattedMessage
id="xpack.ingestManager.createDatasource.pageTitle"
defaultMessage="New data source"
defaultMessage="Add data source"
/>
</h1>
</EuiText>
Expand Down Expand Up @@ -100,9 +102,7 @@ export const CreateDatasourcePageLayout: React.FunctionComponent<{
</EuiFlexGroup>
}
>
<EuiFlexGroup style={{ maxWidth: 833 }}>
<EuiFlexItem>{children}</EuiFlexItem>
</EuiFlexGroup>
{children}
</WithHeaderLayout>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
if (updatedPackageInfo) {
setPackageInfo(updatedPackageInfo);
} else {
setFormState('INVALID');
setPackageInfo(undefined);
setMaxStep('');
}
Expand All @@ -102,6 +103,7 @@ export const CreateDatasourcePage: React.FunctionComponent = () => {
if (updatedAgentConfig) {
setAgentConfig(updatedAgentConfig);
} else {
setFormState('INVALID');
setAgentConfig(undefined);
setMaxStep('');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const EnrollmentInstructions: React.FunctionComponent<Props> = ({ selecte
steps={[
{
title: i18n.translate('xpack.ingestManager.agentEnrollment.stepSetupAgents', {
defaultMessage: 'Setup Beats agent',
defaultMessage: 'Setup Elastic agent',
}),
children: (
<ShellEnrollmentInstructions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => {
<h2>
<FormattedMessage
id="xpack.ingestManager.agentList.noAgentsPrompt"
defaultMessage="No agents installed"
defaultMessage="No agents enrolled"
/>
</h2>
}
Expand All @@ -373,7 +373,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => {
<EuiButton fill iconType="plusInCircle" onClick={() => setIsEnrollmentFlyoutOpen(true)}>
<FormattedMessage
id="xpack.ingestManager.agentList.addButton"
defaultMessage="Install new agent"
defaultMessage="Enroll new agent"
/>
</EuiButton>
) : null
Expand Down

0 comments on commit 47945a6

Please sign in to comment.