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] Handle long text in agent details page (#91776) #92042

Merged
merged 1 commit into from
Feb 19, 2021
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 @@ -27,8 +27,7 @@ import { displayInputType, getLogsQueryByInputType } from './input_type_utils';

const StyledEuiAccordion = styled(EuiAccordion)`
.ingest-integration-title-button {
padding: ${(props) => props.theme.eui.paddingSizes.m}
${(props) => props.theme.eui.paddingSizes.m};
padding: ${(props) => props.theme.eui.paddingSizes.m};
}

&.euiAccordion-isOpen .ingest-integration-title-button {
Expand All @@ -38,6 +37,10 @@ const StyledEuiAccordion = styled(EuiAccordion)`
.euiTableRow:last-child .euiTableRowCell {
border-bottom: none;
}

.euiIEFlexWrapFix {
min-width: 0;
}
`;

const CollapsablePanel: React.FC<{ id: string; title: React.ReactNode }> = ({
Expand All @@ -46,11 +49,11 @@ const CollapsablePanel: React.FC<{ id: string; title: React.ReactNode }> = ({
children,
}) => {
return (
<EuiPanel paddingSize="none" style={{ overflow: 'hidden' }}>
<EuiPanel paddingSize="none">
<StyledEuiAccordion
id={id}
arrowDisplay="right"
buttonClassName={'ingest-integration-title-button'}
buttonClassName="ingest-integration-title-button"
buttonContent={title}
>
{children}
Expand Down Expand Up @@ -128,8 +131,9 @@ export const AgentDetailsIntegration: React.FunctionComponent<{
<PackageIcon size="l" packageName="default" version="0" />
)}
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexItem className="eui-textTruncate">
<EuiLink
className="eui-textTruncate"
href={getHref('edit_integration', {
policyId: agentPolicy.id,
packagePolicyId: packagePolicy.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ export const AgentDetailsOverviewSection: React.FunctionComponent<{
<EuiDescriptionListTitle>{title}</EuiDescriptionListTitle>
</FlexItemWithMinWidth>
<FlexItemWithMinWidth grow={7}>
<EuiDescriptionListDescription>{description}</EuiDescriptionListDescription>
<EuiDescriptionListDescription className="eui-textTruncate">
{description}
</EuiDescriptionListDescription>
</FlexItemWithMinWidth>
</EuiFlexGroup>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ export const AgentLogsUI: React.FunctionComponent<AgentLogsProps> = memo(({ agen
[http.basePath, state.start, state.end, logStreamQuery]
);

const [logsPanelRef, { height: logPanelHeight }] = useMeasure<HTMLDivElement>();

const agentVersion = agent.local_metadata?.elastic?.agent?.version;
const isLogFeatureAvailable = useMemo(() => {
if (!agentVersion) {
Expand All @@ -199,6 +197,13 @@ export const AgentLogsUI: React.FunctionComponent<AgentLogsProps> = memo(({ agen
return semverGte(agentVersionWithPrerelease, '7.11.0');
}, [agentVersion]);

// Set absolute height on logs component (needed to render correctly in Safari)
// based on available height, or 600px, whichever is greater
const [logsPanelRef, { height: measuredlogPanelHeight }] = useMeasure<HTMLDivElement>();
const logPanelHeight = useMemo(() => Math.max(measuredlogPanelHeight, 600), [
measuredlogPanelHeight,
]);

if (!isLogFeatureAvailable) {
return (
<EuiCallOut
Expand Down