Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Fleet agent details design review (#84939) #85067

Merged
merged 2 commits into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import {
EuiLink,
EuiAccordion,
EuiTitle,
EuiToolTip,
EuiPanel,
EuiButtonIcon,
EuiBasicTable,
EuiBasicTableProps,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import styled from 'styled-components';
Expand All @@ -25,8 +27,15 @@ const StyledEuiAccordion = styled(EuiAccordion)`
.ingest-integration-title-button {
padding: ${(props) => props.theme.eui.paddingSizes.m}
${(props) => props.theme.eui.paddingSizes.m};
}

&.euiAccordion-isOpen .ingest-integration-title-button {
border-bottom: 1px solid ${(props) => props.theme.eui.euiColorLightShade};
}

.euiTableRow:last-child .euiTableRowCell {
border-bottom: none;
}
`;

const CollapsablePanel: React.FC<{ id: string; title: React.ReactNode }> = ({
Expand All @@ -35,7 +44,7 @@ const CollapsablePanel: React.FC<{ id: string; title: React.ReactNode }> = ({
children,
}) => {
return (
<EuiPanel paddingSize="none">
<EuiPanel paddingSize="none" style={{ overflow: 'hidden' }}>
<StyledEuiAccordion
id={id}
arrowDisplay="right"
Expand All @@ -59,7 +68,7 @@ export const AgentDetailsIntegration: React.FunctionComponent<{
return packagePolicy.inputs.filter((input) => input.enabled);
}, [packagePolicy.inputs]);

const columns = [
const columns: EuiBasicTableProps<PackagePolicyInput>['columns'] = [
{
field: 'type',
width: '100%',
Expand All @@ -71,24 +80,28 @@ export const AgentDetailsIntegration: React.FunctionComponent<{
},
},
{
align: 'right',
name: i18n.translate('xpack.fleet.agentDetailsIntegrations.actionsLabel', {
defaultMessage: 'Actions',
}),
field: 'type',
width: 'auto',
render: (inputType: string) => {
return (
<EuiButtonIcon
href={getHref('fleet_agent_details', {
agentId: agent.id,
tabId: 'logs',
logQuery: getLogsQueryByInputType(inputType),
})}
iconType="editorAlignLeft"
title={i18n.translate('xpack.fleet.agentDetailsIntegrations.viewLogsButton', {
<EuiToolTip
content={i18n.translate('xpack.fleet.agentDetailsIntegrations.viewLogsButton', {
defaultMessage: 'View logs',
})}
/>
>
<EuiButtonIcon
href={getHref('fleet_agent_details', {
agentId: agent.id,
tabId: 'logs',
logQuery: getLogsQueryByInputType(inputType),
})}
iconType="editorAlignLeft"
/>
</EuiToolTip>
);
},
},
Expand Down Expand Up @@ -142,7 +155,7 @@ export const AgentDetailsIntegrationsSection: React.FunctionComponent<{
}

return (
<EuiFlexGroup direction="column">
<EuiFlexGroup direction="column" gutterSize="m">
{(agentPolicy.package_policies as PackagePolicy[]).map((packagePolicy) => {
return (
<EuiFlexItem grow={false} key={packagePolicy.id}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiPanel,
EuiIcon,
EuiToolTip,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { EuiText } from '@elastic/eui';
import { EuiIcon } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { Agent, AgentPolicy } from '../../../../../types';
import { useKibanaVersion, useLink } from '../../../../../hooks';
Expand Down Expand Up @@ -66,27 +66,21 @@ export const AgentDetailsOverviewSection: React.FunctionComponent<{
</EuiFlexItem>
{isAgentUpgradeable(agent, kibanaVersion) ? (
<EuiFlexItem grow={false}>
<EuiText color="subdued" size="s" className="eui-textNoWrap">
<EuiIcon size="m" type="alert" color="warning" />
&nbsp;
<FormattedMessage
id="xpack.fleet.agentList.agentUpgradeLabel"
defaultMessage="Upgrade available"
/>
</EuiText>
<EuiToolTip
position="right"
content={i18n.translate('xpack.fleet.agentList.agentUpgradeLabel', {
defaultMessage: 'Upgrade available',
})}
>
<EuiIcon type="alert" color="warning" />
</EuiToolTip>
</EuiFlexItem>
) : null}
</EuiFlexGroup>
) : (
'-'
),
},
{
title: i18n.translate('xpack.fleet.agentDetails.enrollmentTokenLabel', {
defaultMessage: 'Enrollment token',
}),
description: '-', // Fixme when we have the enrollment tokenhttps://github.com/elastic/kibana/issues/61269
},
{
title: i18n.translate('xpack.fleet.agentDetails.integrationsLabel', {
defaultMessage: 'Integrations',
Expand Down