New Log Details: Fix multiple displayed links and correlactions (#110296)
* LogLineDetailsFields: fix multiple link rows * LogLineDetails: check all links to render link block
This commit is contained in:
@@ -118,6 +118,8 @@ export const LogLineDetailsComponent = memo(
|
||||
!labelGroups.length &&
|
||||
!fieldsWithoutLinks.length;
|
||||
|
||||
const hasLinks = fieldsWithLinks.links.length > 0 || fieldsWithLinks.linksFromVariableMap.length > 0;
|
||||
|
||||
return (
|
||||
<>
|
||||
<LogLineDetailsHeader focusLogLine={focusLogLine} log={log} search={search} onSearch={handleSearch} />
|
||||
@@ -141,7 +143,7 @@ export const LogLineDetailsComponent = memo(
|
||||
<LogLineDetailsDisplayedFields />
|
||||
</ControlledCollapse>
|
||||
)}
|
||||
{fieldsWithLinks.links.length > 0 && (
|
||||
{hasLinks && (
|
||||
<ControlledCollapse
|
||||
className={styles.collapsable}
|
||||
label={t('logs.log-line-details.links-section', 'Links')}
|
||||
|
||||
@@ -339,7 +339,7 @@ export const LogLineDetailsField = ({
|
||||
}
|
||||
return (
|
||||
<div className={styles.row} key={`${link.title}-${i}`}>
|
||||
<div className={disableActions ? undefined : styles.link}>
|
||||
<div className={disableActions ? styles.linkNoActions : styles.link}>
|
||||
<DataLinkButton
|
||||
buttonProps={{
|
||||
// Show tooltip message if max number of pinned lines has been reached
|
||||
@@ -401,6 +401,10 @@ const getFieldStyles = (theme: GrafanaTheme2) => ({
|
||||
link: css({
|
||||
gridColumn: '2 / 4',
|
||||
}),
|
||||
linkNoActions: css({
|
||||
gridColumn: 'span 2',
|
||||
paddingBottom: theme.spacing(0.5),
|
||||
}),
|
||||
stats: css({
|
||||
paddingRight: theme.spacing(1),
|
||||
wordBreak: 'break-all',
|
||||
|
||||
Reference in New Issue
Block a user